Closed Bug 787412 Opened 12 years ago Closed 12 years ago

HTMLOptionElement.prototype.text should use do a deep tree traversal

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: tobias.scheer, Assigned: Ms2ger)

References

()

Details

Attachments

(2 files)

Attached image BUG.png
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11

Steps to reproduce:

Apply Google Website Translator to a website and translate from German to English.


Actual results:

Select elements are displayed empty because of changing <SELECT><OPTION>TEXT</OPTION></SELECT> to <SELECT><OPTION><FONT><FONT>TEXT</FONT></FONT></OPTION></SELECT>. Other browsers removes the false FONT tags, FireFox doesn't.


Expected results:

Correct display of selected option in select-elements.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
Summary: SELECTs stay empty after translation of Google Website Translator → Ignore/remove empty <font> tags within <select> tags
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1732

Note that the HTML parser ignores the font tags when parsing "<SELECT><OPTION><FONT><FONT>TEXT</FONT></FONT></OPTION></SELECT>".
Component: DOM: Core & HTML → Layout: Form Controls
OS: Windows 7 → All
Version: 15 Branch → Trunk
The real issue here is the spec says:

  The text IDL attribute, on getting, must return the value of the textContent IDL
  attribute on the element, ...

while our impl does:

  nsContentUtils::GetNodeTextContent(this, false, text);

Note the false for aDeep.  It should perhaps be true instead?
Assignee: nobody → Ms2ger
Status: NEW → ASSIGNED
Component: Layout: Form Controls → DOM: Core & HTML
Hardware: x86_64 → All
Summary: Ignore/remove empty <font> tags within <select> tags → HTMLOptionElement.prototype.text should use do a deep tree traversal
Attached patch Patch v1Splinter Review
Attachment #657389 - Flags: review?(mounir)
Comment on attachment 657389 [details] [diff] [review]
Patch v1

Review of attachment 657389 [details] [diff] [review]:
-----------------------------------------------------------------

Could you put the new test in the forms/ subdirectory?

Also, since when did we moved to w3c-style tests?
Attachment #657389 - Flags: review?(mounir) → review+
https://hg.mozilla.org/mozilla-central/rev/79504d9c90d3
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Depends on: 801486
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: