Closed Bug 468692 Opened 11 years ago Closed 11 years ago

localName should return in lower case for HTML

Categories

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

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: hsivonen, Assigned: hsivonen)

References

()

Details

(Keywords: html5)

Attachments

(1 file, 1 obsolete file)

Build ID:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20081209 Minefield/3.2a1pre

Steps to reproduce:
 1) Load http://hsivonen.iki.fi/test/moz/localName.html

Expected results:
Expected alert "html".

Actual results:
Alerts "HTML".

Additional info:
Safari 3.2.1 alerts "html". HTML5 requires the lower case behavior by not specifying upper casing to occur.
http://www.whatwg.org/specs/web-apps/current-work/#apis-in-html-documents
Why is this bug valid?

The spec has this:
"This does not apply to XML documents or to elements that are not in the HTML namespace despite being in HTML documents."

"Element.tagName and Node.nodeName

These attributes must return element names converted to uppercase, regardless of the case with which they were created.
"
ah, localName
But the spec does have "Awaiting implementation feedback" comment.
HTML 4: "If the document is an HTML 4.01 document the element type names exposed through a property are in uppercase."
Presumably, we can't give informed implementor feedback without implementing this in a build that gets reasonably wide testing. (HTML5 supersedes HTML4.)

This feature is desirable for writing namespace-aware scripts that run one code path on both HTML and XML DOMs.

Note that Safari has shipped with this, so there's a good reason to assume that this doesn't break the Web.
(In reply to comment #0)
> HTML5 requires the lower case behavior by not
> specifying upper casing to occur.
I don't understand why not specifying upper casing means lower casing.
And Opera gives HTML, not html.
Gecko and Opera: HTML
WebKit: html
Well, ok, there is "The canonical form of HTML markup is all-lowercase;".
Attached image screenshot (obsolete) —
Doesn't seem to happen on Linux, but on OSX if the page (in this case Google News)
is long enough to cause scrollbars, they are painted to random places.

So to test click 'News' in the iframe.
Comment on attachment 354243 [details]
screenshot

Argh, wrong bug.
Attachment #354243 - Attachment is obsolete: true
Blocks: 482923
Taking in order to implement this in the HTML5 parsing repo.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Patch attached to bug 468708.
This was fixed as part of rev 39f1a74e500b together with bug 468708.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.