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

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

Issue 547823002: Track reasons for |Node::SetNeedsStyleRecalc| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: reasons as tuple Created 6 years, 3 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
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index d963fbf0af9f21159517c29bcf63032a5871c944..09f6c2a9672e4e518fca47d4db8858860d714ab6 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -959,7 +959,7 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ne
styleAttributeChanged(newValue, reason);
} else if (isStyledElement() && isPresentationAttribute(name)) {
elementData()->m_presentationAttributeStyleIsDirty = true;
- setNeedsStyleRecalc(LocalStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::fromAttribute(name), LocalStyleChange);
}
if (isIdAttributeName(name)) {
@@ -980,7 +980,7 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ne
// If there is currently no StyleResolver, we can't be sure that this attribute change won't affect style.
if (!styleResolver)
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::fromAttribute(name), SubtreeStyleChange);
if (AXObjectCache* cache = document().existingAXObjectCache())
cache->handleAttributeChanged(name, this);
@@ -1598,9 +1598,9 @@ ElementShadow& Element::ensureShadow()
return ensureElementRareData().ensureShadow();
}
-void Element::didAffectSelector(AffectedSelectorMask mask)
+void Element::didAffectSelector(const StyleChangeReasonForTracing& reason, AffectedSelectorMask mask)
{
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(reason, SubtreeStyleChange);
if (ElementShadow* elementShadow = shadowWhereNodeCanBeDistributed(*this))
elementShadow->didAffectSelector(mask);
}
@@ -1618,7 +1618,7 @@ void Element::setNeedsAnimationStyleRecalc()
if (styleChangeType() != NoStyleChange)
return;
- setNeedsStyleRecalc(LocalStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::create(StyleChangeReason::Animation), LocalStyleChange);
setAnimationStyleChange(true);
}
@@ -2631,7 +2631,7 @@ void Element::setFloatingPointAttribute(const QualifiedName& attributeName, doub
void Element::setContainsFullScreenElement(bool flag)
{
setElementFlag(ContainsFullScreenElement, flag);
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::create(StyleChangeReason::FullScreen), SubtreeStyleChange);
}
static Element* parentCrossingFrameBoundaries(Element* element)
@@ -3096,14 +3096,14 @@ void Element::styleAttributeChanged(const AtomicString& newStyleString, Attribut
elementData()->m_styleAttributeIsDirty = false;
- setNeedsStyleRecalc(LocalStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange), LocalStyleChange);
InspectorInstrumentation::didInvalidateStyleAttr(this);
}
void Element::inlineStyleChanged()
{
ASSERT(isStyledElement());
- setNeedsStyleRecalc(LocalStyleChange);
+ setNeedsStyleRecalc(StyleChangeReasonForTracing::create(StyleChangeReason::Inline), LocalStyleChange);
ASSERT(elementData());
elementData()->m_styleAttributeIsDirty = true;
InspectorInstrumentation::didInvalidateStyleAttr(this);

Powered by Google App Engine
This is Rietveld 408576698