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

Unified Diff: Source/core/dom/Document.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/ContainerNode.cpp ('k') | Source/core/dom/DocumentStyleSheetCollection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index be81d141c0b1f3fc25a1d9bdc473b2c5aabab58f..294185a12a2b6e91f08a183c19a0ff035727792c 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1200,7 +1200,7 @@ void Document::setContentLanguage(const AtomicString& language)
m_contentLanguage = language;
// Document's style depends on the content language.
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Language));
}
void Document::setXMLVersion(const String& version, ExceptionState& exceptionState)
@@ -1710,7 +1710,7 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
// rare and just invalidate the cache for now.
if (styleEngine()->usesRemUnits() && (documentElement()->needsAttach() || documentElement()->computedStyle()->fontSize() != documentElementStyle->fontSize())) {
ensureStyleResolver().invalidateMatchedPropertiesCache();
- documentElement()->setNeedsStyleRecalc(SubtreeStyleChange);
+ documentElement()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FontSizeChange));
}
EOverflow overflowX = OAUTO;
@@ -1748,13 +1748,13 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
if (body) {
if (RenderStyle* style = body->renderStyle()) {
if (style->direction() != rootDirection || style->writingMode() != rootWritingMode)
- body->setNeedsStyleRecalc(SubtreeStyleChange);
+ body->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::WritingModeChange));
}
}
if (RenderStyle* style = documentElement()->renderStyle()) {
if (style->direction() != rootDirection || style->writingMode() != rootWritingMode)
- documentElement()->setNeedsStyleRecalc(SubtreeStyleChange);
+ documentElement()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::WritingModeChange));
}
}
@@ -1937,7 +1937,7 @@ void Document::updateLayout()
void Document::setNeedsFocusedElementCheck()
{
- setNeedsStyleRecalc(LocalStyleChange);
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
}
void Document::clearFocusedElementSoon()
@@ -2063,7 +2063,7 @@ bool Document::dirtyElementsForLayerUpdate()
return false;
for (WillBeHeapHashSet<RawPtrWillBeMember<Element> >::iterator it = m_layerUpdateSVGFilterElements.begin(), end = m_layerUpdateSVGFilterElements.end(); it != end; ++it)
- (*it)->setNeedsStyleRecalc(LocalStyleChange);
+ (*it)->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::SVGFilterLayerUpdate));
m_layerUpdateSVGFilterElements.clear();
return true;
}
@@ -4308,7 +4308,7 @@ void Document::setEncodingData(const DocumentEncodingData& newData)
// FIXME: How is possible to not have a renderer here?
if (renderView())
renderView()->style()->setRTLOrdering(m_visuallyOrdered ? VisualOrder : LogicalOrder);
- setNeedsStyleRecalc(SubtreeStyleChange);
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::VisuallyOrdered));
}
}
@@ -4470,7 +4470,7 @@ void Document::setDesignMode(InheritedBool value)
continue;
if (!toLocalFrame(frame)->document())
break;
- toLocalFrame(frame)->document()->setNeedsStyleRecalc(SubtreeStyleChange);
+ toLocalFrame(frame)->document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::DesignMode));
}
}
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/DocumentStyleSheetCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698