Commit e18e9154 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Add subtree field to SetNeedsStyleRecalc tracing.

Whether we mark a node for kLocalStyleChange or kSubtreeStyleChange is
essential information.

Change-Id: I08241b3b319d11d0244bc10f458fb2a47ebf2359
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2033245
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737704}
parent 4b7b1fae
......@@ -1416,7 +1416,8 @@ void Node::SetNeedsStyleRecalc(StyleChangeType change_type,
TRACE_EVENT_INSTANT1(
TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"),
"StyleRecalcInvalidationTracking", TRACE_EVENT_SCOPE_THREAD, "data",
inspector_style_recalc_invalidation_tracking_event::Data(this, reason));
inspector_style_recalc_invalidation_tracking_event::Data(
this, change_type, reason));
StyleChangeType existing_change_type = GetStyleChangeType();
if (change_type > existing_change_type)
......
......@@ -610,6 +610,7 @@ inspector_style_invalidator_invalidate_event::InvalidationList(
std::unique_ptr<TracedValue>
inspector_style_recalc_invalidation_tracking_event::Data(
Node* node,
StyleChangeType change_type,
const StyleChangeReasonForTracing& reason) {
DCHECK(node);
......@@ -617,6 +618,7 @@ inspector_style_recalc_invalidation_tracking_event::Data(
value->SetString("frame",
IdentifiersFactory::FrameId(node->GetDocument().GetFrame()));
SetNodeInfo(value.get(), node, "nodeId", "nodeName");
value->SetBoolean("subtree", change_type == kSubtreeStyleChange);
value->SetString("reason", reason.ReasonString());
value->SetString("extraData", reason.GetExtraData());
SourceLocation::Capture()->ToTracedValue(value.get(), "stackTrace");
......
......@@ -70,6 +70,7 @@ class StyleChangeReasonForTracing;
class StyleImage;
class XMLHttpRequest;
enum class ResourceType : uint8_t;
enum StyleChangeType : uint32_t;
namespace probe {
class CallFunction;
......@@ -169,7 +170,9 @@ std::unique_ptr<TracedValue> RuleSetInvalidation(ContainerNode&,
(element), (invalidationSet), ##__VA_ARGS__));
namespace inspector_style_recalc_invalidation_tracking_event {
std::unique_ptr<TracedValue> Data(Node*, const StyleChangeReasonForTracing&);
std::unique_ptr<TracedValue> Data(Node*,
StyleChangeType,
const StyleChangeReasonForTracing&);
}
String DescendantInvalidationSetToIdString(const InvalidationSet&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment