Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index deb789d648f5c49cb255d46064bf1b09c6317e2b..4640e4fc62e28912c07ddf13643dddcfbf69b039 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -1146,6 +1146,13 @@ Element* Node::parentOrShadowHostElement() const |
return toElement(parent); |
} |
+ContainerNode* Node::parentOrShadowHostOrTemplateHostNode() const |
+{ |
+ if (isDocumentFragment() && toDocumentFragment(this)->isTemplateContent()) |
+ return static_cast<const TemplateContentDocumentFragment*>(this)->host(); |
+ return parentOrShadowHostNode(); |
+} |
+ |
bool Node::isBlockFlowElement() const |
{ |
return isElementNode() && renderer() && renderer()->isRenderBlockFlow(); |