blur() on shadow host should work when a shadow host contains a focused element in...
[WebKit-https.git] / Source / WebCore / html / HTMLDocument.cpp
index f2e511eb03fff09007ee4924db6e81b80d3d7b91..61044809aca986980aecbbd6026dafa139b45727 100644 (file)
@@ -138,7 +138,9 @@ void HTMLDocument::setDesignMode(const String& value)
 
 Element* HTMLDocument::activeElement()
 {
-    return treeScope()->activeElement();
+    if (Node* node = treeScope()->focusedNode())
+        return node->isElementNode() ? toElement(node) : body();
+    return body();
 }
 
 bool HTMLDocument::hasFocus()