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

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

Issue 525393002: Clean up code duplication of isAtShadowBoundary() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.h
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index 530c3abea4b1d0cd572573266ae7736743f01af7..a2324f3fc07fbc4a9332287bc85c4391a1053a17 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -842,6 +842,14 @@ inline bool isShadowHost(const Element* element)
return element && element->shadow();
}
+inline bool isAtShadowBoundary(const Element* element)
+{
+ if (!element)
+ return false;
+ ContainerNode* parentNode = element->parentNode();
+ return parentNode && parentNode->isShadowRoot();
+}
+
// These macros do the same as their NODE equivalents but additionally provide a template specialization
// for isElementOfType<>() so that the Traversal<> API works for these Element types.
#define DEFINE_ELEMENT_TYPE_CASTS(thisType, predicate) \
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698