Index: Source/core/css/invalidation/StyleInvalidator.cpp |
diff --git a/Source/core/css/invalidation/StyleInvalidator.cpp b/Source/core/css/invalidation/StyleInvalidator.cpp |
index e237c9ae1a70081d237e993b3b6c134eea328f2d..08fe2866f136c877b66815e3f7e9f70f94cffbd9 100644 |
--- a/Source/core/css/invalidation/StyleInvalidator.cpp |
+++ b/Source/core/css/invalidation/StyleInvalidator.cpp |
@@ -13,6 +13,7 @@ |
#include "core/dom/ElementTraversal.h" |
#include "core/dom/shadow/ElementShadow.h" |
#include "core/dom/shadow/ShadowRoot.h" |
+#include "core/inspector/InspectorTraceEvents.h" |
#include "core/rendering/RenderObject.h" |
namespace blink { |
@@ -86,8 +87,10 @@ bool StyleInvalidator::RecursionData::matchesCurrentInvalidationSets(Element& el |
{ |
ASSERT(!m_wholeSubtreeInvalid); |
- if (m_invalidateCustomPseudo && element.shadowPseudoId() != nullAtom) |
+ if (m_invalidateCustomPseudo && element.shadowPseudoId() != nullAtom) { |
+ TRACE_STYLE_INVALIDATOR_INVALIDATION(element, InvalidateCustomPseudo); |
return true; |
+ } |
for (InvalidationSets::iterator it = m_invalidationSets.begin(); it != m_invalidationSets.end(); ++it) { |
if ((*it)->invalidatesElement(element)) |
@@ -108,9 +111,13 @@ bool StyleInvalidator::checkInvalidationSetsAgainstElement(Element& element, Sty |
for (InvalidationList::const_iterator it = invalidationList->begin(); it != invalidationList->end(); ++it) |
recursionData.pushInvalidationSet(**it); |
// FIXME: It's really only necessary to clone the render style for this element, not full style recalc. |
+ TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), |
pdr.
2014/09/30 02:08:49
Can you add a newline here so it's clear the comme
kouhei (in TOK)
2014/09/30 02:22:00
I think this comment is related. IIUC, theoretical
|
+ "StyleInvalidatorInvalidationTracking", |
+ "data", InspectorStyleInvalidatorInvalidateEvent::invalidationList(element, *invalidationList)); |
return true; |
} |
} |
+ |
return recursionData.matchesCurrentInvalidationSets(element); |
} |
@@ -148,10 +155,12 @@ bool StyleInvalidator::invalidate(Element& element, StyleInvalidator::RecursionD |
element.setNeedsStyleRecalc(recursionData.wholeSubtreeInvalid() ? SubtreeStyleChange : LocalStyleChange); |
} else if (recursionData.hasInvalidationSets() && someChildrenNeedStyleRecalc) { |
// Clone the RenderStyle in order to preserve correct style sharing, if possible. Otherwise recalc style. |
- if (RenderObject* renderer = element.renderer()) |
+ if (RenderObject* renderer = element.renderer()) { |
renderer->setStyleInternal(RenderStyle::clone(renderer->style())); |
- else |
+ } else { |
+ TRACE_STYLE_INVALIDATOR_INVALIDATION(element, PreventStyleSharingForParent); |
element.setNeedsStyleRecalc(LocalStyleChange); |
+ } |
} |
element.clearChildNeedsStyleInvalidation(); |