Commit df79950d authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

[LayoutNG] Trace block flow invalidation for devtools

This patch allows block-level NGPaintFragment invalidations to be
traced, to make relevant layout tests pass.

Note: This is a hacky fix only for making tests pass, since devtools
invalidation tracking is still an experimental feature. More work will
be done if the feature is launched.

Bug: 880519
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I6bfcd0204a66ea266e2de7a6a421fea29dc70fbf
Reviewed-on: https://chromium-review.googlesource.com/1204851Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589101}
parent c480691d
......@@ -439,11 +439,6 @@ crbug.com/591099 http/tests/devtools/elements/shadow/shadow-distribution.js [ Fa
crbug.com/591099 http/tests/devtools/network/network-datareceived.js [ Failure ]
crbug.com/591099 http/tests/devtools/network/network-datasaver-warning.js [ Failure ]
crbug.com/591099 http/tests/devtools/persistence/persistence-merge-editor-tabs.js [ Failure ]
crbug.com/591099 http/tests/devtools/tracing/timeline-misc/timeline-grouped-invalidations.js [ Failure ]
crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-and-multiple-style-invalidations.js [ Failure ]
crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations-on-deleted-node.js [ Timeout ]
crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations.js [ Failure ]
crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-style-recalc-invalidations.js [ Failure ]
crbug.com/591099 http/tests/images/restyle-decode-error.html [ Failure ]
crbug.com/591099 http/tests/local/fileapi/select-dragged-file-input.html [ Skip ]
crbug.com/591099 http/tests/misc/object-embedding-svg-delayed-size-negotiation.xhtml [ Failure ]
......
......@@ -171,6 +171,19 @@ void ObjectPaintInvalidator::
traverse(object_);
}
namespace {
bool IsClientNGPaintFragmentForObject(const DisplayItemClient& client,
const LayoutObject& object) {
if (!RuntimeEnabledFeatures::LayoutNGEnabled())
return false;
// TODO(crbug.com/880519): This hack only makes current invalidation tracking
// layout tests pass with LayoutNG. More work is needed if we want to launch
// the invalidation tracking feature.
return object.IsLayoutBlockFlow() &&
&client == ToLayoutBlockFlow(object).PaintFragment();
}
} // namespace
void ObjectPaintInvalidator::InvalidateDisplayItemClient(
const DisplayItemClient& client,
PaintInvalidationReason reason) {
......@@ -180,7 +193,8 @@ void ObjectPaintInvalidator::InvalidateDisplayItemClient(
// reduce the cost.
DCHECK(!object_.PaintingLayer() || object_.PaintingLayer()->NeedsRepaint());
if (&client == &object_) {
if (&client == &object_ ||
IsClientNGPaintFragmentForObject(client, object_)) {
TRACE_EVENT_INSTANT1(
TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"),
"PaintInvalidationTracking", TRACE_EVENT_SCOPE_THREAD, "data",
......
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