Bug 234047

Summary: [WebIDL] Remove the now-unused [DocumentEventHandler] extended attribute
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: BindingsAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Enhancement CC: cdumez, changseok, darin, esprehn+autocc, ews-watchlist, gyuyoung.kim, joepeck, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 234349    
Bug Blocks:    
Attachments:
Description Flags
Patch darin: review+, ews-feeder: commit-queue-

Alexey Shvayka
Reported 2021-12-08 17:09:06 PST
Remove [DocumentEventHandler] extended attribute
Attachments
Patch (20.54 KB, patch)
2021-12-08 17:16 PST, Alexey Shvayka
darin: review+
ews-feeder: commit-queue-
Alexey Shvayka
Comment 1 2021-12-08 17:16:45 PST
Darin Adler
Comment 2 2021-12-08 17:30:11 PST
Comment on attachment 446465 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446465&action=review No progression on WPT tests? > Source/WebCore/ChangeLog:3 > + Remove [DocumentEventHandler] extended attribute In future, consider making the patch that removes the last use separate from the patch removing the implementation. Makes it a little easier to concentrate on those two separate concerns, and I don’t think there are a lot of downsides.
Darin Adler
Comment 3 2021-12-08 17:35:04 PST
I think the behavior change is much more interesting and needs attention and focus (which I did when reviewing, I think) than the "remove the IDL extended attribute", even though the latter is more satisfying and helps the project out long term.
Alexey Shvayka
Comment 4 2021-12-08 17:42:55 PST
(In reply to Darin Adler from comment #2) Thank you for review! > No progression on WPT tests? As far as I tested, no, and I'm a bit hesitant to contribute a test that asserts the lack of Document-reflecting for "selectionchange" event, considering the spec has no such concept and no other browser has the same issue. > > Source/WebCore/ChangeLog:3 > > + Remove [DocumentEventHandler] extended attribute > > In future, consider making the patch that removes the last use separate from > the patch removing the implementation. > > Makes it a little easier to concentrate on those two separate concerns, and > I don’t think there are a lot of downsides. Noted, thanks!
Alexey Shvayka
Comment 5 2021-12-08 17:48:04 PST
(In reply to Darin Adler from comment #3) > I think the behavior change is much more interesting and needs attention and > focus (which I did when reviewing, I think) than the "remove the IDL > extended attribute", even though the latter is more satisfying and helps the > project out long term. If you don't mind, I will land the reviewed diff in 2 bugs: 1) `el.setAttribute("onselectionchange", "<code">)` now properly sets event listener; 2) `document.body.onselectionchange = function() {}` now doesn't forward event listener to Document.
Alexey Shvayka
Comment 6 2021-12-08 17:50:39 PST
(In reply to Alexey Shvayka from comment #4) > (In reply to Darin Adler from comment #2) > > > No progression on WPT tests? > > As far as I tested, no, and I'm a bit hesitant to contribute a test that > asserts the lack of Document-reflecting for "selectionchange" event, > considering the spec has no such concept and no other browser has the same > issue. But I can surely add a WPT for `el.setAttribute("onselectionchange", "<code">)` part.
Darin Adler
Comment 7 2021-12-08 18:02:51 PST
(In reply to Alexey Shvayka from comment #4) > As far as I tested, no, and I'm a bit hesitant to contribute a test that > asserts the lack of Document-reflecting for "selectionchange" event, > considering the spec has no such concept and no other browser has the same > issue. I wouldn’t necessarily rush to do this, why go out of our way to quickly create a test that highlights something generally harmless but wrong in the current versions of Safari, but there is some precedent for these kinds of tests, ones that check for possible mistakes that have been done in the past.
Darin Adler
Comment 8 2021-12-08 18:03:34 PST
(In reply to Alexey Shvayka from comment #5) > If you don't mind, I will land the reviewed diff in 2 bugs: > > 1) `el.setAttribute("onselectionchange", "<code">)` now properly sets event > listener; > > 2) `document.body.onselectionchange = function() {}` now doesn't forward > event listener to Document. Why not 3 steps? 3) Remove the now-unused DocumentEventHandler extended attribute.
Alexey Shvayka
Comment 9 2021-12-08 18:14:41 PST
(In reply to Darin Adler from comment #7) > (In reply to Alexey Shvayka from comment #4) > > As far as I tested, no, and I'm a bit hesitant to contribute a test that > > asserts the lack of Document-reflecting for "selectionchange" event, > > considering the spec has no such concept and no other browser has the same > > issue. > > I wouldn’t necessarily rush to do this, why go out of our way to quickly > create a test that highlights something generally harmless but wrong in the > current versions of Safari, but there is some precedent for these kinds of > tests, ones that check for possible mistakes that have been done in the past. Please note that L318-322 of LayoutTests/fast/dom/event-handler-attributes.html do test that wrong behaviour, observable in current version of Safari, is now fixed. (In reply to Darin Adler from comment #8) > Why not 3 steps? > > 3) Remove the now-unused DocumentEventHandler extended attribute. 👍🏻
Darin Adler
Comment 10 2021-12-08 18:17:11 PST
(In reply to Alexey Shvayka from comment #9) > Please note that L318-322 of > LayoutTests/fast/dom/event-handler-attributes.html do test that wrong > behaviour, observable in current version of Safari, is now fixed. I did! Had some feelings of pride about the fact that the test has output that is so easy to understand. Still have dim memories of when I originally wrote it.
Alexey Shvayka
Comment 11 2021-12-10 12:56:31 PST
Comment on attachment 446465 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446465&action=review > Source/WebCore/html/HTMLBodyElement.cpp:-167 > - if (name == onselectionchangeAttr) { We can't remove this until we implement emitting "selectionchange" on elements (selection targets). Otherwise we risk breaking web-compat as caught by the failing test. But we can still remove [DocumentEventHandler] as no other browser reflects IDL attribute to Document.
Alexey Shvayka
Comment 12 2021-12-15 12:14:15 PST
Radar WebKit Bug Importer
Comment 13 2021-12-15 12:15:20 PST
Note You need to log in before you can comment on or make changes to this bug.