Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Unified Diff: Source/core/dom/ContainerNode.h

Issue 270503006: Make pseudo-classes selector queries work on DocumentFragment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address Esprehn's comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.h
diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h
index 99543d230c3308ecd517eb6de1b2df2dfaff6469..6cec25d805b6856e3646fe434786156d295374c2 100644
--- a/Source/core/dom/ContainerNode.h
+++ b/Source/core/dom/ContainerNode.h
@@ -323,6 +323,12 @@ inline ContainerNode* Node::parentElementOrShadowRoot() const
return parent && (parent->isElementNode() || parent->isShadowRoot()) ? parent : 0;
}
+inline ContainerNode* Node::parentElementOrDocumentFragment() const
+{
+ ContainerNode* parent = parentNode();
+ return parent && (parent->isElementNode() || parent->isDocumentFragment()) ? parent : 0;
+}
+
// This constant controls how much buffer is initially allocated
// for a Node Vector that is used to store child Nodes of a given Node.
// FIXME: Optimize the value.
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698