Commit 9666130b authored by Nicolás Peña Moreno's avatar Nicolás Peña Moreno Committed by Commit Bot

[ElementTiming] Do not walk objects that cannot be reported

Bug: 942033
Change-Id: Id45597527c69c84296b67b84b26228d1207b59ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1648896Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667178}
parent e549bc63
......@@ -179,6 +179,17 @@ bool TextPaintTimingDetector::ShouldWalkObject(
Node* node = object.GetNode();
if (!node)
return false;
// If we have finished recording Largest Text Paint and the element is a
// shadow element or has no elementtiming attribute, then we should not record
// its text.
if (!is_recording_ltp_) {
if (node->IsInShadowTree() || !node->IsElementNode() ||
ToElement(node)
->FastGetAttribute(html_names::kElementtimingAttr)
.IsEmpty()) {
return false;
}
}
DOMNodeId node_id = DOMNodeIds::ExistingIdForNode(node);
if (node_id == kInvalidDOMNodeId)
return true;
......
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