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

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: use AtomicString 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
« no previous file with comments | « Source/core/dom/DocumentStyleSheetCollection.cpp ('k') | Source/core/dom/Fullscreen.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 7ea8de5065dbd90acc65c9a9d6b55422c47938c5..e859321b551d452b95a8777c81e6afabea8cb9e6 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(LocalStyleChange, StyleChangeReasonForTracing::fromAttribute(name));
}
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(SubtreeStyleChange, StyleChangeReasonForTracing::fromAttribute(name));
if (AXObjectCache* cache = document().existingAXObjectCache())
cache->handleAttributeChanged(name, this);
@@ -1622,7 +1622,7 @@ void Element::setNeedsAnimationStyleRecalc()
if (styleChangeType() != NoStyleChange)
return;
- setNeedsStyleRecalc(LocalStyleChange);
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Animation));
setAnimationStyleChange(true);
}
@@ -2635,7 +2635,7 @@ void Element::setFloatingPointAttribute(const QualifiedName& attributeName, doub
void Element::setContainsFullScreenElement(bool flag)
{
setElementFlag(ContainsFullScreenElement, flag);
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FullScreen));
}
static Element* parentCrossingFrameBoundaries(Element* element)
@@ -3100,14 +3100,14 @@ void Element::styleAttributeChanged(const AtomicString& newStyleString, Attribut
elementData()->m_styleAttributeIsDirty = false;
- setNeedsStyleRecalc(LocalStyleChange);
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange));
InspectorInstrumentation::didInvalidateStyleAttr(this);
}
void Element::inlineStyleChanged()
{
ASSERT(isStyledElement());
- setNeedsStyleRecalc(LocalStyleChange);
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Inline));
ASSERT(elementData());
elementData()->m_styleAttributeIsDirty = true;
InspectorInstrumentation::didInvalidateStyleAttr(this);
« no previous file with comments | « Source/core/dom/DocumentStyleSheetCollection.cpp ('k') | Source/core/dom/Fullscreen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698