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

Unified Diff: Source/core/dom/SiblingRuleHelper.cpp

Issue 198783003: Recalc sibling styles for forward positional rules on mutations only. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issue. Created 6 years, 9 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/dom/SiblingRuleHelper.h ('k') | Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/SiblingRuleHelper.cpp
diff --git a/Source/core/dom/SiblingRuleHelper.cpp b/Source/core/dom/SiblingRuleHelper.cpp
index 7ebc4ca499c8bd0ec9b05a5e32f8f6097ced821a..baacc0fc018cbd1124be3d95a635fa41750e5392 100644
--- a/Source/core/dom/SiblingRuleHelper.cpp
+++ b/Source/core/dom/SiblingRuleHelper.cpp
@@ -28,6 +28,14 @@ void SiblingRuleHelper::setChildrenAffectedByDirectAdjacentRules()
toShadowRoot(m_node)->setChildrenAffectedByDirectAdjacentRules();
}
+void SiblingRuleHelper::setChildrenAffectedByIndirectAdjacentRules()
+{
+ if (m_node->isElementNode())
+ toElement(m_node)->setChildrenAffectedByIndirectAdjacentRules();
+ else
+ toShadowRoot(m_node)->setChildrenAffectedByIndirectAdjacentRules();
+}
+
void SiblingRuleHelper::setChildrenAffectedByForwardPositionalRules()
{
if (m_node->isElementNode())
@@ -80,6 +88,11 @@ bool SiblingRuleHelper::childrenAffectedByDirectAdjacentRules() const
return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByDirectAdjacentRules() : toShadowRoot(m_node)->childrenAffectedByDirectAdjacentRules();
}
+bool SiblingRuleHelper::childrenAffectedByIndirectAdjacentRules() const
+{
+ return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByIndirectAdjacentRules() : toShadowRoot(m_node)->childrenAffectedByIndirectAdjacentRules();
+}
+
bool SiblingRuleHelper::childrenAffectedByForwardPositionalRules() const
{
return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByForwardPositionalRules() : toShadowRoot(m_node)->childrenAffectedByForwardPositionalRules();
@@ -93,7 +106,7 @@ bool SiblingRuleHelper::childrenAffectedByBackwardPositionalRules() const
void SiblingRuleHelper::checkForChildrenAdjacentRuleChanges()
{
bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules();
- bool hasIndirectAdjacentRules = childrenAffectedByForwardPositionalRules();
+ bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules();
if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules)
return;
« no previous file with comments | « Source/core/dom/SiblingRuleHelper.h ('k') | Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698