Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upel.toggleAttribute("style") after assigning to el.style returns true instead of false #25130
Comments
|
When we .style= in If we setAttribute("style") instead of .style=, then the test passes as written, but the type returned by GetAttribute is DOMSTring, not CSSStyleDeclaration; it's like the content attribute isn't connected to either the IDL type or to the Javascript object attribute. Setting el.style as it is in the test, and then reading back el.style from Javascript, gets a CSSStyleDeclaration, so the IDL attribute is there on the Javascript DOM element, but seemingly entirely separately from get/set/toggleAttribute. |
|
Oh! has the PutForwards commented out and the attribute is readonly, so there is no code that handles setting the style IDL property right now. Setting the content attribute works because of this code. |
|
I am astounded that we apparently haven't had a working style setter in 7 years. |
|
Fixed by #25450 |
WPT dom/nodes/attributes.html tests toggleAttribute in many situations, most of which pass, but "Toggling element with inline style should make inline style disappear" fails. It's actually just testing what toggleAttribute returns and not strictly testing whether the style has disappeared or not, but the return value of toggleAttribute should definitely be false here. Special things I can see here to distinguish this case from passing ones are that this test is using .style= instead of setAttribute, and that style might be the only [PutForward] attribute in the entire test.