Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing an event handler attribute with removeAttribute isn't affecting the list of event handlers correctly #25652

Open
pshaughn opened this issue Jan 30, 2020 · 2 comments

Comments

@pshaughn
Copy link
Member

@pshaughn pshaughn commented Jan 30, 2020

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.

@pshaughn
Copy link
Member Author

@pshaughn pshaughn commented 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.

@jdm jdm added this to To do in web-platform-test failures via automation Jan 31, 2020
@jdm jdm added the A-content/dom label Jan 31, 2020
@jdm
Copy link
Member

@jdm jdm commented Jan 31, 2020

Event handler IDL attributes have specific setting behaviour: https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes
Event handler content attributes also have specific setting behaviour: https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-content-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
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.