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 upUpdate EventHandler.webidl #11158
Update EventHandler.webidl #11158
Comments
|
@KiChjang Greetings, |
|
Great! |
|
Should we implement |
|
On one hand it's not great for feature detection. On the other hand, it's really easy to forget to add them when implementing code that dispatches the appropriate event, and it leads to frustrating and confusing debugging sessions. I lean towards adding the handlers for that reason. |
|
Hi, I've done a couple patches for this - https://github.com/s-baldrick/servo/tree/11158, and now I am trying to come up with some tests, although I am not sure what will be a sensible way of going about it since not all of these events will be triggered. I guess asserting if setting an event handler does not fail could be one way, but then they all get set in the same way, so testing for this might not bring much to the table. Do you have some suggestions about this? |
|
You can actually open a PR right now, and I'll do a try run and see which tests it'll break. Some of our WPT tests are marked as FAILING, but after defining these events, I'd expect plenty of them to PASS. |
|
Cool, I'll open it this evening, as I am at work right now. |
11158 - add event handlers 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 --faster` does not report any errors - [X] These changes fix #11158 (github issue number if applicable). Either: - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ____ Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11255) <!-- Reviewable:end -->
11158 - add event handlers 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 --faster` does not report any errors - [X] These changes fix #11158 (github issue number if applicable). Either: - [x] There are tests for these changes OR - [ ] These changes do not require tests because ____ Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11255) <!-- Reviewable:end -->
11158 - add event handlers 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 --faster` does not report any errors - [X] These changes fix #11158 (github issue number if applicable). Either: - [x] There are tests for these changes OR - [ ] These changes do not require tests because ____ Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11255) <!-- Reviewable:end -->
11158 - add event handlers 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 --faster` does not report any errors - [X] These changes fix #11158 (github issue number if applicable). Either: - [x] There are tests for these changes OR - [ ] These changes do not require tests because ____ Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11255) <!-- Reviewable:end -->
11158 - add event handlers 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 --faster` does not report any errors - [X] These changes fix #11158 (github issue number if applicable). Either: - [x] There are tests for these changes OR - [ ] These changes do not require tests because ____ Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11255) <!-- Reviewable:end -->
The WebIDL has more events defined on it now. Also, there is a new
DocumentAndElementEventHandlersinterface that is supposed to be defined onDocumentandHTMLElement.Spec: https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers, https://html.spec.whatwg.org/multipage/webappapis.html#windoweventhandlers, https://html.spec.whatwg.org/multipage/webappapis.html#documentandelementeventhandlers
Code:
components/script/dom/webidls/EventHandler.webidl,components/script/dom/webidls/HTMLElement.webidl,components/script/dom/webidls/Document.webidl