Bug 153538 - Add Event.deepPath() and Event.scoped
Summary: Add Event.deepPath() and Event.scoped
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
: 155283 (view as bug list)
Depends on: 155285 155327
Blocks: 148695
  Show dependency treegraph
 
Reported: 2016-01-26 23:47 PST by Ryosuke Niwa
Modified: 2019-02-06 09:18 PST (History)
10 users (show)

See Also:


Attachments
Adds the support (61.96 KB, patch)
2016-03-11 00:51 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (724.55 KB, application/zip)
2016-03-11 01:42 PST, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (760.60 KB, application/zip)
2016-03-11 01:46 PST, Build Bot
no flags Details
Archive of layout-test-results from ews126 for ios-simulator-wk2 (579.81 KB, application/zip)
2016-03-11 01:50 PST, Build Bot
no flags Details
Archive of layout-test-results from ews116 for mac-yosemite (793.00 KB, application/zip)
2016-03-11 02:07 PST, Build Bot
no flags Details
Patch for landing (64.54 KB, patch)
2016-03-11 17:16 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews124 for ios-simulator-wk2 (716.49 KB, application/zip)
2016-03-11 18:08 PST, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-yosemite (825.71 KB, application/zip)
2016-03-11 18:27 PST, Build Bot
no flags Details
Patch for landing 2 (68.50 KB, patch)
2016-03-11 18:32 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2016-01-26 23:47:36 PST
Implement extensions to Event interface for shadow DOM:
http://w3c.github.io/webcomponents/spec/shadow/#widl-Event-deepPath-sequence-EventTarget
Comment 1 Radar WebKit Bug Importer 2016-01-26 23:47:59 PST
<rdar://problem/24363836>
Comment 2 Ryosuke Niwa 2016-03-09 19:10:23 PST
*** Bug 155283 has been marked as a duplicate of this bug. ***
Comment 3 Ryosuke Niwa 2016-03-11 00:51:47 PST
Created attachment 273698 [details]
Adds the support
Comment 4 WebKit Commit Bot 2016-03-11 00:53:52 PST
Attachment 273698 [details] did not pass style-queue:


ERROR: Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp:218:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 29 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Build Bot 2016-03-11 01:42:54 PST
Comment on attachment 273698 [details]
Adds the support

Attachment 273698 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/959444

New failing tests:
fast/shadow-dom/trusted-event-scoped-flags.html
fast/shadow-dom/negative-tabindex-on-shadow-host.html
Comment 6 Build Bot 2016-03-11 01:42:58 PST
Created attachment 273709 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 7 Build Bot 2016-03-11 01:46:53 PST
Comment on attachment 273698 [details]
Adds the support

Attachment 273698 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/959449

New failing tests:
fast/shadow-dom/negative-tabindex-on-shadow-host.html
Comment 8 Build Bot 2016-03-11 01:46:56 PST
Created attachment 273710 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 9 Build Bot 2016-03-11 01:50:30 PST
Comment on attachment 273698 [details]
Adds the support

Attachment 273698 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/959447

New failing tests:
fast/shadow-dom/trusted-event-scoped-flags.html
Comment 10 Build Bot 2016-03-11 01:50:33 PST
Created attachment 273711 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.10.5
Comment 11 Build Bot 2016-03-11 02:07:14 PST
Comment on attachment 273698 [details]
Adds the support

Attachment 273698 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/959452

New failing tests:
fast/shadow-dom/trusted-event-scoped-flags.html
fast/shadow-dom/negative-tabindex-on-shadow-host.html
Comment 12 Build Bot 2016-03-11 02:07:17 PST
Created attachment 273712 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 13 Darin Adler 2016-03-11 13:03:43 PST
Comment on attachment 273698 [details]
Adds the support

View in context: https://bugs.webkit.org/attachment.cgi?id=273698&action=review

r=me assuming you address whatever is causing the tests to fail

> Source/WebCore/dom/EventPath.cpp:249
> +    // Use Vector instead of HashSet since we expect the number of ancestor tree scopes to be small.

Expecting the number to be small, and not caring at all about the performance of pathological cases are two different things. Is this really the right tradeoff all the time?

> Source/WebCore/dom/EventPath.h:51
> +    void computePathDisclosedToTarget(const EventTarget&, Vector<EventTarget*>&) const;

Why not have this return a Vector instead of using an out argument?
Comment 14 Ryosuke Niwa 2016-03-11 16:45:36 PST
(In reply to comment #13)
> Comment on attachment 273698 [details]
> Adds the support
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=273698&action=review
> 
> r=me assuming you address whatever is causing the tests to fail

Fixed the test.  I was missing m_relatedTarget check in FocusEvent.

> > Source/WebCore/dom/EventPath.cpp:249
> > +    // Use Vector instead of HashSet since we expect the number of ancestor tree scopes to be small.
> 
> Expecting the number to be small, and not caring at all about the
> performance of pathological cases are two different things. Is this really
> the right tradeoff all the time?

I think so.  Nobody uses shadow DOM API today but this vector grows as much as there are number of ancestor shadow trees, and I don't think it can ever grow behind a small number (e.g. 8-10).  We can revisit this design if it becomes a problem in practice.

It's hard to make decisions given the lack of contents that use these APIs.

> > Source/WebCore/dom/EventPath.h:51
> > +    void computePathDisclosedToTarget(const EventTarget&, Vector<EventTarget*>&) const;
> 
> Why not have this return a Vector instead of using an out argument?

Fixed.
Comment 15 Ryosuke Niwa 2016-03-11 17:16:30 PST
Created attachment 273788 [details]
Patch for landing
Comment 16 Ryosuke Niwa 2016-03-11 17:20:25 PST
Comment on attachment 273788 [details]
Patch for landing

Wait for EWS
Comment 17 WebKit Commit Bot 2016-03-11 17:21:18 PST
Attachment 273788 [details] did not pass style-queue:


ERROR: Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp:218:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 31 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 18 Build Bot 2016-03-11 18:08:10 PST
Comment on attachment 273788 [details]
Patch for landing

Attachment 273788 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/963179

New failing tests:
fast/shadow-dom/trusted-event-scoped-flags.html
Comment 19 Build Bot 2016-03-11 18:08:14 PST
Created attachment 273791 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.10.5
Comment 20 Build Bot 2016-03-11 18:27:02 PST
Comment on attachment 273788 [details]
Patch for landing

Attachment 273788 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/963231

New failing tests:
fast/shadow-dom/trusted-event-scoped-flags.html
Comment 21 Build Bot 2016-03-11 18:27:06 PST
Created attachment 273792 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 22 Ryosuke Niwa 2016-03-11 18:32:15 PST
Created attachment 273793 [details]
Patch for landing 2
Comment 23 WebKit Commit Bot 2016-03-11 18:36:01 PST
Attachment 273793 [details] did not pass style-queue:


ERROR: Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp:218:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 32 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 24 Ryosuke Niwa 2016-03-11 18:37:37 PST
Comment on attachment 273793 [details]
Patch for landing 2

View in context: https://bugs.webkit.org/attachment.cgi?id=273793&action=review

> LayoutTests/platform/ios-simulator/fast/shadow-dom/trusted-event-scoped-flags-expected.txt:19
> +FAIL input.type = "text"; log(input, "mousemove"); eventSender.mouseMoveTo(x, y); eventType should be mousemove (of type string). Was undefined (of type undefined).

iOS doesn't support eventSender so these tests would fail there.
Comment 25 Ryosuke Niwa 2016-03-11 19:10:50 PST
Committed r198056: <http://trac.webkit.org/changeset/198056>
Comment 26 Lucas Forschler 2019-02-06 09:18:48 PST
Mass move bugs into the DOM component.