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

Unified Diff: third_party/WebKit/Source/core/dom/Node.h

Issue 2463293003: Some speculation about making opaque root finding cheaper.
Patch Set: Created 4 years, 1 month 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
Index: third_party/WebKit/Source/core/dom/Node.h
diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h
index 14569362b0753e5e501033b88e80017145519c2a..f251527d92de4ecc0a08c5d80ef4e340618a87ea 100644
--- a/third_party/WebKit/Source/core/dom/Node.h
+++ b/third_party/WebKit/Source/core/dom/Node.h
@@ -333,7 +333,13 @@ class CORE_EXPORT Node : public EventTarget {
void setParentOrShadowHostNode(ContainerNode*);
// Knows about all kinds of hosts.
- ContainerNode* parentOrShadowHostOrTemplateHostNode() const;
+ ContainerNode* parentOrShadowHostOrTemplateHostNode() const {
+ if (UNLIKELY(isDocumentFragment() && !isShadowRoot()))
+ return parentOrShadowHostOrTemplateHostNodeForDocumentFragment();
+ return parentOrShadowHostNode();
+ }
+ ContainerNode* parentOrShadowHostOrTemplateHostNodeForDocumentFragment()
+ const;
// Returns the parent node, but nullptr if the parent node is a ShadowRoot.
ContainerNode* nonShadowBoundaryParentNode() const;
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp ('k') | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698