Index: Source/core/page/FocusController.cpp |
diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp |
index b8c2276bd90e38f1560f60bb9b8560fa61268158..2f3173962b8c6d642cf89752a69ac69d50b2852b 100644 |
--- a/Source/core/page/FocusController.cpp |
+++ b/Source/core/page/FocusController.cpp |
@@ -654,7 +654,10 @@ static void clearSelectionIfNeeded(LocalFrame* oldFocusedFrame, LocalFrame* newF |
return; |
Node* selectionStartNode = selection.selection().start().deprecatedNode(); |
- if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendantOf(newFocusedNode) || selectionStartNode->deprecatedShadowAncestorNode() == newFocusedNode) |
+ if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendantOf(newFocusedNode)) |
+ return; |
+ |
+ if (selectionStartNode->isInShadowTree() && selectionStartNode->shadowHost() == newFocusedNode) |
return; |
if (Node* mousePressNode = newFocusedFrame->eventHandler().mousePressNode()) { |