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

Unified Diff: Source/core/css/RuleFeature.cpp

Issue 664033002: [Invalidation Tracking] Trace ScheduleStyleInvalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 2 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 | « no previous file | Source/core/inspector/InspectorTraceEvents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/RuleFeature.cpp
diff --git a/Source/core/css/RuleFeature.cpp b/Source/core/css/RuleFeature.cpp
index 272b9b06ce26109250e0f41884055f8a8e5f32f2..3fcafbda9029ba117595ea3a1ef0d48c3dffa8c8 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -37,6 +37,7 @@
#include "core/css/invalidation/DescendantInvalidationSet.h"
#include "core/dom/Element.h"
#include "core/dom/Node.h"
+#include "core/inspector/InspectorTraceEvents.h"
#include "wtf/BitVector.h"
namespace blink {
@@ -598,33 +599,42 @@ void RuleFeatureSet::scheduleStyleInvalidationForClassChange(const SpaceSplitStr
void RuleFeatureSet::scheduleStyleInvalidationForAttributeChange(const QualifiedName& attributeName, Element& element)
{
-
- if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_attributeInvalidationSets.get(attributeName.localName()))
+ if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_attributeInvalidationSets.get(attributeName.localName())) {
+ TRACE_SCHEDULE_STYLE_INVALIDATION(element, *invalidationSet, attributeChange, attributeName);
m_styleInvalidator.scheduleInvalidation(invalidationSet, element);
+ }
}
void RuleFeatureSet::scheduleStyleInvalidationForIdChange(const AtomicString& oldId, const AtomicString& newId, Element& element)
{
if (!oldId.isEmpty()) {
- if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_idInvalidationSets.get(oldId))
+ if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_idInvalidationSets.get(oldId)) {
+ TRACE_SCHEDULE_STYLE_INVALIDATION(element, *invalidationSet, idChange, oldId);
m_styleInvalidator.scheduleInvalidation(invalidationSet, element);
+ }
}
if (!newId.isEmpty()) {
- if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_idInvalidationSets.get(newId))
+ if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_idInvalidationSets.get(newId)) {
+ TRACE_SCHEDULE_STYLE_INVALIDATION(element, *invalidationSet, idChange, newId);
m_styleInvalidator.scheduleInvalidation(invalidationSet, element);
+ }
}
}
void RuleFeatureSet::scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoType pseudo, Element& element)
{
- if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_pseudoInvalidationSets.get(pseudo))
+ if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_pseudoInvalidationSets.get(pseudo)) {
+ TRACE_SCHEDULE_STYLE_INVALIDATION(element, *invalidationSet, pseudoChange, pseudo);
m_styleInvalidator.scheduleInvalidation(invalidationSet, element);
+ }
}
-void RuleFeatureSet::addClassToInvalidationSet(const AtomicString& className, Element& element)
+inline void RuleFeatureSet::addClassToInvalidationSet(const AtomicString& className, Element& element)
{
- if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_classInvalidationSets.get(className))
+ if (RefPtrWillBeRawPtr<DescendantInvalidationSet> invalidationSet = m_classInvalidationSets.get(className)) {
+ TRACE_SCHEDULE_STYLE_INVALIDATION(element, *invalidationSet, classChange, className);
m_styleInvalidator.scheduleInvalidation(invalidationSet, element);
+ }
}
StyleInvalidator& RuleFeatureSet::styleInvalidator()
« no previous file with comments | « no previous file | Source/core/inspector/InspectorTraceEvents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698