Closed
Bug 571390
Opened 15 years ago
Closed 15 years ago
classList is always empty on xul elements
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: iannbugzilla, Assigned: smaug)
References
Details
Attachments
(1 file)
7.82 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Steps to reproduce
1/ Create some xul containing various elements with classes.
2/ Add some JS that uses classList property and associated methods to manipulate the elements' classes.
Expected result
1/ classList contains DOMTokenList of classes and associated methods can be used to manipulate the list.
Actual result
1/ classList is empty, so using add method overwrites anything in className property.
Assignee | ||
Comment 1•15 years ago
|
||
The problem seems to be that DOMTokenList uses GetParsedAttr, but it should
probably use GetAttrInfo, which can handle XULprototypes.
Say you have an xul element which has a class bar.
The DOMTokenList is empty at this point and className is "bar"
If you set the element's className to "foo" then the DOMTokenList gets populated.
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → Olli.Pettay
Assignee | ||
Comment 4•15 years ago
|
||
Attachment #450646 -
Flags: review?(bzbarsky)
![]() |
||
Comment 5•15 years ago
|
||
Comment on attachment 450646 [details] [diff] [review]
patch
This looks ok, but we should add a comment to the GetParsedAttr footgun.
Attachment #450646 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 6•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/1d5faa6f718e
http://hg.mozilla.org/mozilla-central/rev/5ea4bc6c71f7
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
blocking2.0: ? → final+
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•