Bug 149591 - relatedNode should be retargeted respecting slots
Summary: relatedNode should be retargeted respecting slots
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks: 148695
  Show dependency treegraph
 
Reported: 2015-09-27 22:22 PDT by Ryosuke Niwa
Modified: 2015-09-28 15:11 PDT (History)
6 users (show)

See Also:


Attachments
Implements retargeting of relatedNode (35.14 KB, patch)
2015-09-28 00:29 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch for landing (35.15 KB, patch)
2015-09-28 14:17 PDT, 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 2015-09-27 22:22:52 PDT
Re-implement the event retargeting for shadow DOM.
Comment 1 Ryosuke Niwa 2015-09-28 00:29:41 PDT
Created attachment 262003 [details]
Implements retargeting of relatedNode
Comment 2 Radar WebKit Bug Importer 2015-09-28 00:31:49 PDT
<rdar://problem/22875812>
Comment 3 Antti Koivisto 2015-09-28 11:10:46 PDT
Comment on attachment 262003 [details]
Implements retargeting of relatedNode

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

r=me, looks like the best solution for this.

It would be nice if we didn't need to do anything this convoluted but I suppose it is unavoidable with the current spec.

> Source/WebCore/dom/EventDispatcher.cpp:514
> +        if (&currentTreeScope->documentScope() != &targetTreeScope.documentScope()) {
> +            m_inDifferentTree = true;

m_inDifferentDocumentScope might be a more accurate name.
Comment 4 Ryosuke Niwa 2015-09-28 11:13:32 PDT
Comment on attachment 262003 [details]
Implements retargeting of relatedNode

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

>> Source/WebCore/dom/EventDispatcher.cpp:514
>> +            m_inDifferentTree = true;
> 
> m_inDifferentDocumentScope might be a more accurate name.

This flag is also here below where we detect that one is in the document and the other one isn't.

> Source/WebCore/dom/EventDispatcher.cpp:519
> +            m_inDifferentTree = true;

Here. We still have to do some work to get out of the shadow DOM but we can avoid all subsequent works.
Comment 5 Antti Koivisto 2015-09-28 12:02:43 PDT
It is not clear what the "tree" is in m_inDifferentTree. It apparently doesn't mean different shadow tree so I thought adding "Document" there would clarify things.
Comment 6 Ryosuke Niwa 2015-09-28 13:05:49 PDT
(In reply to comment #5)
> It is not clear what the "tree" is in m_inDifferentTree. It apparently
> doesn't mean different shadow tree so I thought adding "Document" there
> would clarify things.

They're not necessarily in two different documents. They could have the same owner document but one inside the document and another outside the document.

How about m_hasDifferentTreeRoot?
Comment 7 Ryosuke Niwa 2015-09-28 14:17:31 PDT
Created attachment 262018 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2015-09-28 15:11:33 PDT
Comment on attachment 262018 [details]
Patch for landing

Clearing flags on attachment: 262018

Committed r190288: <http://trac.webkit.org/changeset/190288>
Comment 9 WebKit Commit Bot 2015-09-28 15:11:37 PDT
All reviewed patches have been landed.  Closing bug.