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 upRemoving an event handler attribute with removeAttribute isn't affecting the list of event handlers correctly #25652
Labels
Projects
Comments
This was referenced Jan 30, 2020
|
I'm not sure whether the expected distinction is literally between IDL-setter and content-attribute setter or whether it's really a distinction between setting to an uncompiled string vs. setting to a function; the test descriptions read like it's the former but might not be true. |
|
Event handler IDL attributes have specific setting behaviour: https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes |
bors-servo
added a commit
that referenced
this issue
Jan 31, 2020
Make nulling out an inline event handler remove it from the list order Setting a content attribute or IDL attribute to null now removes event handlers like it's supposed to; the removeAttribute case seems to be something deeper which this change doesn't fix. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25196, but not the related #25652 <!-- Either: --> - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
html/webappapis/scripting/events/event-handler-removal.window.html has two cases that call removeAttribute: "Event handler set through content attribute should be deactivated when the content attribute is removed", and "Event handler set through IDL should NOT be deactivated when the content attribute is removed". As these names imply, the tests differ in that one is using
.onclick =where the other uses.setAttribute('onclick', ...)Servo doesn't distinguish between the two cases, so it fails the first and passes the second.