Click on node assigned to slot in button's shadow cause loss of button focus
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Nov 2018 08:53:57 +0000 (08:53 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Nov 2018 08:53:57 +0000 (08:53 +0000)
commit60111a4e7f2bcb815f34d75f70cfb051d3bdb3ca
tree6f79921223293599dd44179e27d1c96410da981c
parent2fc4289ad6ab09f49a41791c744aaaca081031df
Click on node assigned to slot in button's shadow cause loss of button focus
https://bugs.webkit.org/show_bug.cgi?id=191694
<rdar://problem/46107920>

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug by traversing the parent in the composed tree when looking for an element to focus.

Test: fast/shadow-dom/focus-slot-parent.html

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer.

LayoutTests:

Added a regression test.

* fast/shadow-dom/focus-slot-parent-expected.txt: Added.
* fast/shadow-dom/focus-slot-parent.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/shadow-dom/focus-slot-parent-expected.txt [new file with mode: 0644]
LayoutTests/fast/shadow-dom/focus-slot-parent.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp