blur() on shadow host should work when a shadow host contains a focused element in...
[WebKit-https.git] / Source / WebCore / dom / TreeScope.cpp
index cdaee47f48493ee81506b67a350f4d4278b42bbb..376fbc3bf7441b597dd9ae8a649df25e79101c37 100644 (file)
@@ -164,14 +164,14 @@ static Node* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFrame)
     return 0;
 }
 
-Element* TreeScope::activeElement()
+Node* TreeScope::focusedNode()
 {
     Document* document = rootNode()->document();
     Node* node = document->focusedNode();
     if (!node && document->page())
         node = focusedFrameOwnerElement(document->page()->focusController()->focusedFrame(), document->frame());
     if (!node)
-        return this == document ? document->body() : 0;
+        return 0;
 
     TreeScope* treeScope = node->treeScope();
 
@@ -181,9 +181,8 @@ Element* TreeScope::activeElement()
     }
     if (this != treeScope)
         return 0;
-    if (node->isElementNode())
-        return toElement(node);
-    return 0;
+
+    return node;
 }
 
 } // namespace WebCore