Open Bug 501312 Opened 15 years ago Updated 2 years ago

Moving element from XHTML document to HTML document breaks .setAttribute in some cases

Categories

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

x86
All
defect

Tracking

()

People

(Reporter: smaug, Unassigned)

References

Details

Attachments

(1 file)

If an XHTML element has attributes FOO="BAR" and foo="bar", 
moving the element to a HTML document doesn't allow one to get FOO attribute using
.getAttribute. The problem doesn't happen if one has normal XML element which is
moved to HTML document.

In 1.9.1 we do still separate XHTML elements from HTML elements. XHTML elements
don't lose their XML behavior when moved to HTML document.
You can still use getAttributeNS to get both attributes, right?

I'm not really sure what we can do here, other than trying to collapse the two attributes. However that both seems dangerous (since we don't know which attribute to keep), as well as a big perf problem.
We can have a flag in the (X)HTML element which tells whether it should
behave like XML or HTML. The flag would be set based on the original
ownerDocument, I guess.
I know that sucks a bit too. Then when elements are moved from XHTML to
HTML, there are elements which otherwise look like HTML elements, but
behave like XML.
(Before the namespace change, elements didn't look similar.)
I think we should follow the spec, so if that is the behavior you want you should argue on the whatwg/htmlwg list. Personally I like the current design more, but lets debate in a standards forum instead.
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: