Hovering over a slotted Text node clears hover state
[WebKit-https.git] / Source / WebCore / ChangeLog
index 421da65..42c65bf 100644 (file)
@@ -1,3 +1,39 @@
+2016-11-11  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Hovering over a slotted Text node clears hover state
+        https://bugs.webkit.org/show_bug.cgi?id=164002
+        <rdar://problem/29040471>
+
+        Reviewed by Simon Fraser.
+
+        The bug was caused by HitTestResult::innerElement returning the parent element of a Text node without
+        taking the shadow root or slots into account. For hit testing, we always want to use the "flat tree"
+        or "composed tree" (imprecisely but close enough in this case).
+
+        Fixed the bug by making HitTestResult::innerElement use parentNodeInComposedTree. Also renamed it to
+        HitTestResult::targetElement to be consistent with HitTestResult::targetNode.
+
+        Tests: fast/shadow-dom/activate-over-slotted-content.html
+               fast/shadow-dom/hover-over-slotted-content.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::prepareMouseEvent):
+        * html/MediaElementSession.cpp:
+        (WebCore::isMainContentForPurposesOfAutoplay):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::eventMayStartDrag):
+        (WebCore::EventHandler::hitTestResultAtPoint):
+        (WebCore::EventHandler::handleWheelEvent):
+        (WebCore::EventHandler::sendContextMenuEventForKey):
+        (WebCore::EventHandler::hoverTimerFired):
+        (WebCore::EventHandler::handleDrag):
+        (WebCore::EventHandler::handleTouchEvent):
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::targetElement): Renamed from innerElement.
+        Now finds the parent element in the composed tree.
+        * rendering/HitTestResult.h:
+        (WebCore::HitTestResult::innerNode):
+
 2016-11-11  Brent Fulgham  <bfulgham@apple.com>
 
         Unreviewed build fix after r208628