Diff
Modified: trunk/Source/WebCore/ChangeLog (229536 => 229537)
--- trunk/Source/WebCore/ChangeLog 2018-03-12 16:14:03 UTC (rev 229536)
+++ trunk/Source/WebCore/ChangeLog 2018-03-12 16:15:46 UTC (rev 229537)
@@ -1,3 +1,65 @@
+2018-03-12 Antti Koivisto <[email protected]>
+
+ Don't invalidate descendants for nth pseudo classes unless needed
+ https://bugs.webkit.org/show_bug.cgi?id=183566
+
+ Reviewed by Zalan Bujtas.
+
+ We currently invalidate the whole subtrees that may match :nth-child and similar. In many common
+ cases we know that only the direct siblings may be affected.
+
+ * css/SelectorChecker.cpp:
+ (WebCore::localContextForParent):
+ (WebCore::SelectorChecker::matchRecursively const):
+
+ Track if the context matches the subject element if the selector or its siblings only.
+
+ (WebCore::SelectorChecker::checkOne const):
+
+ Use different bits of descendant and child invalidation cases.
+
+ * cssjit/SelectorCompiler.cpp:
+ (WebCore::SelectorCompiler::fragmentMatchesRightmostOrAdjacentElement):
+ (WebCore::SelectorCompiler::constructFragmentsInternal):
+
+ Track if the context matches the subject element if the selector or its siblings only.
+
+ (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
+ (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
+ (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
+
+ Use different bits of descendant and child invalidation cases.
+
+ * dom/Element.cpp:
+ (WebCore::invalidateForForwardPositionalRules):
+ (WebCore::invalidateForBackwardPositionalRules):
+
+ Invalidate more precisely based on the new bits.
+
+ (WebCore::checkForSiblingStyleChanges):
+ (WebCore::Element::setDescendantsAffectedByForwardPositionalRules):
+ (WebCore::Element::setDescendantsAffectedByBackwardPositionalRules):
+ (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
+ (WebCore::Element::rareDataDescendantsAffectedByForwardPositionalRules const):
+ (WebCore::Element::rareDataDescendantsAffectedByBackwardPositionalRules const):
+
+ New bits.
+
+ * dom/Element.h:
+ (WebCore::Element::descendantsAffectedByForwardPositionalRules const):
+ (WebCore::Element::descendantsAffectedByBackwardPositionalRules const):
+ * dom/ElementRareData.h:
+ (WebCore::ElementRareData::descendantsAffectedByForwardPositionalRules const):
+ (WebCore::ElementRareData::setDescendantsAffectedByForwardPositionalRules):
+ (WebCore::ElementRareData::descendantsAffectedByBackwardPositionalRules const):
+ (WebCore::ElementRareData::setDescendantsAffectedByBackwardPositionalRules):
+ (WebCore::ElementRareData::ElementRareData):
+ (WebCore::ElementRareData::resetStyleRelations):
+ * style/StyleRelations.cpp:
+ (WebCore::Style::commitRelationsToRenderStyle):
+ (WebCore::Style::commitRelations):
+ * style/StyleRelations.h:
+
2018-03-12 Javier Fernandez <[email protected]>
Remove GridLayout runtime flag
Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (229536 => 229537)
--- trunk/Source/WebCore/css/SelectorChecker.cpp 2018-03-12 16:14:03 UTC (rev 229536)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp 2018-03-12 16:15:46 UTC (rev 229537)
@@ -69,6 +69,7 @@
const CSSSelector* firstSelectorOfTheFragment;
PseudoId pseudoId;
bool isMatchElement { true };
+ bool isSubjectOrAdjacentElement { true };
bool inFunctionalPseudoClass { false };
bool pseudoElementEffective { true };
bool hasScrollbarPseudo { false };
@@ -238,6 +239,7 @@
updatedContext.visitedMatchType = VisitedMatchType::Disabled;
updatedContext.isMatchElement = false;
+ updatedContext.isSubjectOrAdjacentElement = false;
if (updatedContext.mayMatchHostPseudoClass) {
updatedContext.element = nullptr;
@@ -432,6 +434,7 @@
return MatchResult::fails(Match::SelectorFailsCompletely);
nextContext.element = shadowHostNode;
nextContext.firstSelectorOfTheFragment = nextContext.selector;
+ nextContext.isSubjectOrAdjacentElement = false;
PseudoIdSet ignoreDynamicPseudo;
unsigned shadowDescendantSpecificity = 0;
MatchResult result = matchRecursively(checkingContext, nextContext, ignoreDynamicPseudo, shadowDescendantSpecificity);
@@ -746,7 +749,8 @@
case CSSSelector::PseudoClassFirstOfType:
// first-of-type matches the first element of its type
if (auto* parentElement = element.parentElement()) {
- addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByForwardPositionalRules);
+ auto relation = context.isSubjectOrAdjacentElement ? Style::Relation::ChildrenAffectedByForwardPositionalRules : Style::Relation::DescendantsAffectedByForwardPositionalRules;
+ addStyleRelation(checkingContext, *parentElement, relation);
return isFirstOfType(element, element.tagQName());
}
break;
@@ -763,7 +767,8 @@
case CSSSelector::PseudoClassLastOfType:
// last-of-type matches the last element of its type
if (Element* parentElement = element.parentElement()) {
- addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByBackwardPositionalRules);
+ auto relation = context.isSubjectOrAdjacentElement ? Style::Relation::ChildrenAffectedByBackwardPositionalRules : Style::Relation::DescendantsAffectedByBackwardPositionalRules;
+ addStyleRelation(checkingContext, *parentElement, relation);
if (!parentElement->isFinishedParsingChildren())
return false;
return isLastOfType(element, element.tagQName());
@@ -785,8 +790,10 @@
case CSSSelector::PseudoClassOnlyOfType:
// FIXME: This selector is very slow.
if (Element* parentElement = element.parentElement()) {
- addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByForwardPositionalRules);
- addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByBackwardPositionalRules);
+ auto forwardRelation = context.isSubjectOrAdjacentElement ? Style::Relation::ChildrenAffectedByForwardPositionalRules : Style::Relation::DescendantsAffectedByForwardPositionalRules;
+ addStyleRelation(checkingContext, *parentElement, forwardRelation);
+ auto backwardRelation = context.isSubjectOrAdjacentElement ? Style::Relation::ChildrenAffectedByBackwardPositionalRules : Style::Relation::DescendantsAffectedByBackwardPositionalRules;
+ addStyleRelation(checkingContext, *parentElement, backwardRelation);
if (!parentElement->isFinishedParsingChildren())
return false;
return isFirstOfType(element, element.tagQName()) && isLastOfType(element, element.tagQName());
@@ -833,7 +840,8 @@
if (!selector.parseNth())
break;
if (auto* parentElement = element.parentElement()) {
- addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByForwardPositionalRules);
+ auto relation = context.isSubjectOrAdjacentElement ? Style::Relation::ChildrenAffectedByForwardPositionalRules : Style::Relation::DescendantsAffectedByForwardPositionalRules;
+ addStyleRelation(checkingContext, *parentElement, relation);
if (const CSSSelectorList* selectorList = selector.selectorList()) {
unsigned selectorListSpecificity;
@@ -863,7 +871,8 @@
break;
if (auto* parentElement = element.parentElement()) {
- addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByForwardPositionalRules);
+ auto relation = context.isSubjectOrAdjacentElement ? Style::Relation::ChildrenAffectedByForwardPositionalRules : Style::Relation::DescendantsAffectedByForwardPositionalRules;
+ addStyleRelation(checkingContext, *parentElement, relation);
int count = 1 + countElementsOfTypeBefore(element, element.tagQName());
if (selector.matchNth(count))
@@ -881,8 +890,10 @@
specificity = CSSSelector::addSpecificities(specificity, selectorListSpecificity);
addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByPropertyBasedBackwardPositionalRules);
- } else
- addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByBackwardPositionalRules);
+ } else {
+ auto relation = context.isSubjectOrAdjacentElement ? Style::Relation::ChildrenAffectedByBackwardPositionalRules : Style::Relation::DescendantsAffectedByBackwardPositionalRules;
+ addStyleRelation(checkingContext, *parentElement, relation);
+ }
if (!parentElement->isFinishedParsingChildren())
return false;
@@ -905,7 +916,8 @@
if (!selector.parseNth())
break;
if (Element* parentElement = element.parentElement()) {
- addStyleRelation(checkingContext, *parentElement, Style::Relation::ChildrenAffectedByBackwardPositionalRules);
+ auto relation = context.isSubjectOrAdjacentElement ? Style::Relation::ChildrenAffectedByBackwardPositionalRules : Style::Relation::DescendantsAffectedByBackwardPositionalRules;
+ addStyleRelation(checkingContext, *parentElement, relation);
if (!parentElement->isFinishedParsingChildren())
return false;
Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (229536 => 229537)
--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp 2018-03-12 16:14:03 UTC (rev 229536)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp 2018-03-12 16:15:46 UTC (rev 229537)
@@ -106,7 +106,8 @@
enum class FragmentPositionInRootFragments {
Rightmost,
- NotRightmost
+ AdjacentToRightmost,
+ Other
};
enum class VisitedMode {
@@ -178,6 +179,7 @@
FragmentRelation relationToLeftFragment;
FragmentRelation relationToRightFragment;
FragmentPositionInRootFragments positionInRootFragments;
+ bool isRightmostOrAdjacent { false };
BacktrackingAction traversalBacktrackingAction = BacktrackingAction::NoBacktracking;
BacktrackingAction matchingTagNameBacktrackingAction = BacktrackingAction::NoBacktracking;
@@ -427,6 +429,11 @@
return fragment.relationToRightFragment == FragmentRelation::Rightmost && fragment.positionInRootFragments == FragmentPositionInRootFragments::Rightmost;
}
+static inline bool fragmentMatchesRightmostOrAdjacentElement(const SelectorFragment& fragment)
+{
+ return fragment.isRightmostOrAdjacent && fragment.positionInRootFragments != FragmentPositionInRootFragments::Other;
+}
+
FunctionType SelectorFragment::appendUnoptimizedPseudoClassWithContext(bool (*matcher)(const SelectorChecker::CheckingContext&))
{
unoptimizedPseudoClassesWithContext.append(JSC::FunctionPtr(matcher));
@@ -873,6 +880,7 @@
static FunctionType constructFragmentsInternal(const CSSSelector* rootSelector, SelectorContext selectorContext, SelectorFragmentList& selectorFragments, FragmentsLevel fragmentLevel, FragmentPositionInRootFragments positionInRootFragments, bool visitedMatchEnabled, VisitedMode& visitedMode, PseudoElementMatchingBehavior pseudoElementMatchingBehavior)
{
FragmentRelation relationToPreviousFragment = FragmentRelation::Rightmost;
+ bool isRightmostOrAdjacent = positionInRootFragments != FragmentPositionInRootFragments::Other;
FunctionType functionType = FunctionType::SimpleSelectorChecker;
SelectorFragment* fragment = nullptr;
unsigned specificity = 0;
@@ -914,7 +922,7 @@
case CSSSelector::PseudoClass: {
FragmentPositionInRootFragments subPosition = positionInRootFragments;
if (relationToPreviousFragment != FragmentRelation::Rightmost)
- subPosition = FragmentPositionInRootFragments::NotRightmost;
+ subPosition = isRightmostOrAdjacent ? FragmentPositionInRootFragments::AdjacentToRightmost : FragmentPositionInRootFragments::Other;
if (fragment->pseudoElementSelector && isScrollbarPseudoElement(fragment->pseudoElementSelector->pseudoElementType()))
functionType = mostRestrictiveFunctionType(functionType, addScrollbarPseudoClassType(*selector, *fragment));
else {
@@ -1016,7 +1024,10 @@
fragment->relationToLeftFragment = fragmentRelationForSelectorRelation(relation);
fragment->relationToRightFragment = relationToPreviousFragment;
fragment->positionInRootFragments = positionInRootFragments;
+ fragment->isRightmostOrAdjacent = isRightmostOrAdjacent;
relationToPreviousFragment = fragment->relationToLeftFragment;
+ if (relationToPreviousFragment != FragmentRelation::Rightmost && relationToPreviousFragment != FragmentRelation::DirectAdjacent && relationToPreviousFragment != FragmentRelation::IndirectAdjacent)
+ isRightmostOrAdjacent = false;
if (fragmentLevel != FragmentsLevel::Root)
fragment->_onlyMatchesLinksInQuirksMode_ = false;
@@ -3491,7 +3502,10 @@
{
LocalRegister parentElement(m_registerAllocator);
generateWalkToParentElement(failureCases, parentElement);
- generateAddStyleRelationIfResolvingStyle(parentElement, Style::Relation::ChildrenAffectedByForwardPositionalRules);
+ auto relation = fragmentMatchesRightmostOrAdjacentElement(fragment)
+ ? Style::Relation::ChildrenAffectedByForwardPositionalRules
+ : Style::Relation::DescendantsAffectedByForwardPositionalRules;
+ generateAddStyleRelationIfResolvingStyle(parentElement, relation);
}
Vector<std::pair<int, int>, 32> validSubsetFilters;
@@ -3551,7 +3565,10 @@
{
LocalRegister parentElement(m_registerAllocator);
generateWalkToParentElement(failureCases, parentElement);
- generateAddStyleRelationIfResolvingStyle(parentElement, Style::Relation::ChildrenAffectedByForwardPositionalRules);
+ auto relation = fragmentMatchesRightmostOrAdjacentElement(fragment)
+ ? Style::Relation::ChildrenAffectedByForwardPositionalRules
+ : Style::Relation::DescendantsAffectedByForwardPositionalRules;
+ generateAddStyleRelationIfResolvingStyle(parentElement, relation);
}
// The initial element must match the selector list.
@@ -3604,7 +3621,10 @@
LocalRegister parentElement(m_registerAllocator);
generateWalkToParentElement(failureCases, parentElement);
- generateAddStyleRelationIfResolvingStyle(parentElement, Style::Relation::ChildrenAffectedByBackwardPositionalRules);
+ auto relation = fragmentMatchesRightmostOrAdjacentElement(fragment)
+ ? Style::Relation::ChildrenAffectedByBackwardPositionalRules
+ : Style::Relation::DescendantsAffectedByBackwardPositionalRules;
+ generateAddStyleRelationIfResolvingStyle(parentElement, relation);
failureCases.append(m_assembler.branchTest32(Assembler::Zero, Assembler::Address(parentElement, Node::nodeFlagsMemoryOffset()), Assembler::TrustedImm32(Node::flagIsParsingChildrenFinished())));
Modified: trunk/Source/WebCore/dom/Element.cpp (229536 => 229537)
--- trunk/Source/WebCore/dom/Element.cpp 2018-03-12 16:14:03 UTC (rev 229536)
+++ trunk/Source/WebCore/dom/Element.cpp 2018-03-12 16:15:46 UTC (rev 229537)
@@ -2014,6 +2014,43 @@
}
}
+
+static void invalidateForForwardPositionalRules(Element& parent, Element* elementAfterChange)
+{
+ bool childrenAffected = parent.childrenAffectedByForwardPositionalRules();
+ bool descendantsAffected = parent.descendantsAffectedByForwardPositionalRules();
+
+ if (!childrenAffected && !descendantsAffected)
+ return;
+
+ for (auto* sibling = elementAfterChange; sibling; sibling = sibling->nextElementSibling()) {
+ if (childrenAffected)
+ sibling->invalidateStyleInternal();
+ if (descendantsAffected) {
+ for (auto* siblingChild = sibling->firstElementChild(); siblingChild; siblingChild = siblingChild->nextElementSibling())
+ siblingChild->invalidateStyleForSubtreeInternal();
+ }
+ }
+}
+
+static void invalidateForBackwardPositionalRules(Element& parent, Element* elementBeforeChange)
+{
+ bool childrenAffected = parent.childrenAffectedByBackwardPositionalRules();
+ bool descendantsAffected = parent.descendantsAffectedByBackwardPositionalRules();
+
+ if (!childrenAffected && !descendantsAffected)
+ return;
+
+ for (auto* sibling = elementBeforeChange; sibling; sibling = sibling->previousElementSibling()) {
+ if (childrenAffected)
+ sibling->invalidateStyleInternal();
+ if (descendantsAffected) {
+ for (auto* siblingChild = sibling->firstElementChild(); siblingChild; siblingChild = siblingChild->nextElementSibling())
+ siblingChild->invalidateStyleForSubtreeInternal();
+ }
+ }
+}
+
enum SiblingCheckType { FinishedParsingChildren, SiblingElementRemoved, Other };
static void checkForSiblingStyleChanges(Element& parent, SiblingCheckType checkType, Element* elementBeforeChange, Element* elementAfterChange)
@@ -2070,17 +2107,8 @@
invalidateForSiblingCombinators(elementAfterChange);
- // We have to invalidate everything following the insertion point in the forward case, and everything before the insertion point in the
- // backward case.
- if (parent.childrenAffectedByForwardPositionalRules()) {
- for (auto* next = elementAfterChange; next; next = next->nextElementSibling())
- next->invalidateStyleForSubtreeInternal();
- }
- // Backward positional selectors include nth-last-child, nth-last-of-type, last-of-type and only-of-type.
- if (parent.childrenAffectedByBackwardPositionalRules()) {
- for (auto* previous = elementBeforeChange; previous; previous = previous->previousElementSibling())
- previous->invalidateStyleForSubtreeInternal();
- }
+ invalidateForForwardPositionalRules(parent, elementAfterChange);
+ invalidateForBackwardPositionalRules(parent, elementBeforeChange);
}
void Element::childrenChanged(const ChildChange& change)
@@ -2815,11 +2843,21 @@
ensureElementRareData().setChildrenAffectedByForwardPositionalRules(true);
}
+void Element::setDescendantsAffectedByForwardPositionalRules()
+{
+ ensureElementRareData().setDescendantsAffectedByForwardPositionalRules(true);
+}
+
void Element::setChildrenAffectedByBackwardPositionalRules()
{
ensureElementRareData().setChildrenAffectedByBackwardPositionalRules(true);
}
+void Element::setDescendantsAffectedByBackwardPositionalRules()
+{
+ ensureElementRareData().setDescendantsAffectedByBackwardPositionalRules(true);
+}
+
void Element::setChildrenAffectedByPropertyBasedBackwardPositionalRules()
{
ensureElementRareData().setChildrenAffectedByPropertyBasedBackwardPositionalRules(true);
@@ -2841,7 +2879,9 @@
return rareDataStyleAffectedByActive()
|| rareDataChildrenAffectedByDrag()
|| rareDataChildrenAffectedByForwardPositionalRules()
+ || rareDataDescendantsAffectedByForwardPositionalRules()
|| rareDataChildrenAffectedByBackwardPositionalRules()
+ || rareDataDescendantsAffectedByBackwardPositionalRules()
|| rareDataChildrenAffectedByPropertyBasedBackwardPositionalRules();
}
@@ -2875,6 +2915,12 @@
return elementRareData()->childrenAffectedByForwardPositionalRules();
}
+bool Element::rareDataDescendantsAffectedByForwardPositionalRules() const
+{
+ ASSERT(hasRareData());
+ return elementRareData()->descendantsAffectedByForwardPositionalRules();
+}
+
bool Element::rareDataChildrenAffectedByBackwardPositionalRules() const
{
ASSERT(hasRareData());
@@ -2881,6 +2927,12 @@
return elementRareData()->childrenAffectedByBackwardPositionalRules();
}
+bool Element::rareDataDescendantsAffectedByBackwardPositionalRules() const
+{
+ ASSERT(hasRareData());
+ return elementRareData()->descendantsAffectedByBackwardPositionalRules();
+}
+
bool Element::rareDataChildrenAffectedByPropertyBasedBackwardPositionalRules() const
{
ASSERT(hasRareData());
Modified: trunk/Source/WebCore/dom/Element.h (229536 => 229537)
--- trunk/Source/WebCore/dom/Element.h 2018-03-12 16:14:03 UTC (rev 229536)
+++ trunk/Source/WebCore/dom/Element.h 2018-03-12 16:15:46 UTC (rev 229537)
@@ -333,7 +333,9 @@
bool childrenAffectedByFirstChildRules() const { return getFlag(ChildrenAffectedByFirstChildRulesFlag); }
bool childrenAffectedByLastChildRules() const { return getFlag(ChildrenAffectedByLastChildRulesFlag); }
bool childrenAffectedByForwardPositionalRules() const { return hasRareData() && rareDataChildrenAffectedByForwardPositionalRules(); }
+ bool descendantsAffectedByForwardPositionalRules() const { return hasRareData() && rareDataDescendantsAffectedByForwardPositionalRules(); }
bool childrenAffectedByBackwardPositionalRules() const { return hasRareData() && rareDataChildrenAffectedByBackwardPositionalRules(); }
+ bool descendantsAffectedByBackwardPositionalRules() const { return hasRareData() && rareDataDescendantsAffectedByBackwardPositionalRules(); }
bool childrenAffectedByPropertyBasedBackwardPositionalRules() const { return hasRareData() && rareDataChildrenAffectedByPropertyBasedBackwardPositionalRules(); }
bool affectsNextSiblingElementStyle() const { return getFlag(AffectsNextSiblingElementStyle); }
unsigned childIndex() const { return hasRareData() ? rareDataChildIndex() : 0; }
@@ -349,7 +351,9 @@
void setChildrenAffectedByFirstChildRules() { setFlag(ChildrenAffectedByFirstChildRulesFlag); }
void setChildrenAffectedByLastChildRules() { setFlag(ChildrenAffectedByLastChildRulesFlag); }
void setChildrenAffectedByForwardPositionalRules();
+ void setDescendantsAffectedByForwardPositionalRules();
void setChildrenAffectedByBackwardPositionalRules();
+ void setDescendantsAffectedByBackwardPositionalRules();
void setChildrenAffectedByPropertyBasedBackwardPositionalRules();
void setAffectsNextSiblingElementStyle() { setFlag(AffectsNextSiblingElementStyle); }
void setStyleIsAffectedByPreviousSibling() { setFlag(StyleIsAffectedByPreviousSibling); }
@@ -653,7 +657,9 @@
bool rareDataChildrenAffectedByDrag() const;
bool rareDataChildrenAffectedByLastChildRules() const;
bool rareDataChildrenAffectedByForwardPositionalRules() const;
+ bool rareDataDescendantsAffectedByForwardPositionalRules() const;
bool rareDataChildrenAffectedByBackwardPositionalRules() const;
+ bool rareDataDescendantsAffectedByBackwardPositionalRules() const;
bool rareDataChildrenAffectedByPropertyBasedBackwardPositionalRules() const;
unsigned rareDataChildIndex() const;
Modified: trunk/Source/WebCore/dom/ElementRareData.h (229536 => 229537)
--- trunk/Source/WebCore/dom/ElementRareData.h 2018-03-12 16:14:03 UTC (rev 229536)
+++ trunk/Source/WebCore/dom/ElementRareData.h 2018-03-12 16:15:46 UTC (rev 229537)
@@ -72,8 +72,12 @@
void setChildrenAffectedByLastChildRules(bool value) { m_childrenAffectedByLastChildRules = value; }
bool childrenAffectedByForwardPositionalRules() const { return m_childrenAffectedByForwardPositionalRules; }
void setChildrenAffectedByForwardPositionalRules(bool value) { m_childrenAffectedByForwardPositionalRules = value; }
+ bool descendantsAffectedByForwardPositionalRules() const { return m_descendantsAffectedByForwardPositionalRules; }
+ void setDescendantsAffectedByForwardPositionalRules(bool value) { m_descendantsAffectedByForwardPositionalRules = value; }
bool childrenAffectedByBackwardPositionalRules() const { return m_childrenAffectedByBackwardPositionalRules; }
void setChildrenAffectedByBackwardPositionalRules(bool value) { m_childrenAffectedByBackwardPositionalRules = value; }
+ bool descendantsAffectedByBackwardPositionalRules() const { return m_descendantsAffectedByBackwardPositionalRules; }
+ void setDescendantsAffectedByBackwardPositionalRules(bool value) { m_descendantsAffectedByBackwardPositionalRules = value; }
bool childrenAffectedByPropertyBasedBackwardPositionalRules() const { return m_childrenAffectedByPropertyBasedBackwardPositionalRules; }
void setChildrenAffectedByPropertyBasedBackwardPositionalRules(bool value) { m_childrenAffectedByPropertyBasedBackwardPositionalRules = value; }
@@ -131,7 +135,9 @@
// *-child-of-type, we will just give up and re-evaluate whenever children change at all.
unsigned m_childrenAffectedByLastChildRules : 1;
unsigned m_childrenAffectedByForwardPositionalRules : 1;
+ unsigned m_descendantsAffectedByForwardPositionalRules : 1;
unsigned m_childrenAffectedByBackwardPositionalRules : 1;
+ unsigned m_descendantsAffectedByBackwardPositionalRules : 1;
unsigned m_childrenAffectedByPropertyBasedBackwardPositionalRules : 1;
LayoutSize m_minimumSizeForResizing;
@@ -172,7 +178,9 @@
, m_childrenAffectedByDrag(false)
, m_childrenAffectedByLastChildRules(false)
, m_childrenAffectedByForwardPositionalRules(false)
+ , m_descendantsAffectedByForwardPositionalRules(false)
, m_childrenAffectedByBackwardPositionalRules(false)
+ , m_descendantsAffectedByBackwardPositionalRules(false)
, m_childrenAffectedByPropertyBasedBackwardPositionalRules(false)
, m_minimumSizeForResizing(defaultMinimumSizeForResizing())
{
@@ -211,7 +219,9 @@
setChildrenAffectedByDrag(false);
setChildrenAffectedByLastChildRules(false);
setChildrenAffectedByForwardPositionalRules(false);
+ setDescendantsAffectedByForwardPositionalRules(false);
setChildrenAffectedByBackwardPositionalRules(false);
+ setDescendantsAffectedByBackwardPositionalRules(false);
setChildrenAffectedByPropertyBasedBackwardPositionalRules(false);
}
Modified: trunk/Source/WebCore/style/StyleRelations.cpp (229536 => 229537)
--- trunk/Source/WebCore/style/StyleRelations.cpp 2018-03-12 16:14:03 UTC (rev 229536)
+++ trunk/Source/WebCore/style/StyleRelations.cpp 2018-03-12 16:15:46 UTC (rev 229537)
@@ -78,7 +78,9 @@
case Relation::DescendantsAffectedByPreviousSibling:
case Relation::AffectsNextSibling:
case Relation::ChildrenAffectedByForwardPositionalRules:
+ case Relation::DescendantsAffectedByForwardPositionalRules:
case Relation::ChildrenAffectedByBackwardPositionalRules:
+ case Relation::DescendantsAffectedByBackwardPositionalRules:
case Relation::ChildrenAffectedByFirstChildRules:
case Relation::ChildrenAffectedByPropertyBasedBackwardPositionalRules:
case Relation::ChildrenAffectedByLastChildRules:
@@ -127,9 +129,15 @@
case Relation::ChildrenAffectedByForwardPositionalRules:
element.setChildrenAffectedByForwardPositionalRules();
break;
+ case Relation::DescendantsAffectedByForwardPositionalRules:
+ element.setDescendantsAffectedByForwardPositionalRules();
+ break;
case Relation::ChildrenAffectedByBackwardPositionalRules:
element.setChildrenAffectedByBackwardPositionalRules();
break;
+ case Relation::DescendantsAffectedByBackwardPositionalRules:
+ element.setDescendantsAffectedByBackwardPositionalRules();
+ break;
case Relation::ChildrenAffectedByFirstChildRules:
element.setChildrenAffectedByFirstChildRules();
break;
Modified: trunk/Source/WebCore/style/StyleRelations.h (229536 => 229537)
--- trunk/Source/WebCore/style/StyleRelations.h 2018-03-12 16:14:03 UTC (rev 229536)
+++ trunk/Source/WebCore/style/StyleRelations.h 2018-03-12 16:15:46 UTC (rev 229537)
@@ -47,8 +47,10 @@
DescendantsAffectedByPreviousSibling,
// For AffectsNextSibling 'value' tells how many element siblings to mark starting with 'element'.
AffectsNextSibling,
- ChildrenAffectedByForwardPositionalRules,
+ ChildrenAffectedByForwardPositionalRules,
+ DescendantsAffectedByForwardPositionalRules,
ChildrenAffectedByBackwardPositionalRules,
+ DescendantsAffectedByBackwardPositionalRules,
ChildrenAffectedByFirstChildRules,
ChildrenAffectedByPropertyBasedBackwardPositionalRules,
ChildrenAffectedByLastChildRules,