Commit 6c31f3d1 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

[LayoutNG] Add "self-paint" to ShowFragmentTree output

Now the tree looks like this:
 Box (block-flow children-inline) offset:0,34 size:600x72
    LineBox offset:31,0 size:568x18
      Box (children-inline)(self paint) offset:0,-1 size:367x19
        Text offset:0,1 size:337x17 start: 30 end: 83
      Text offset:377,0 size:191x17 start: 1 end: 30
    LineBox offset:24,18 size:575x18
      Box (children-inline)(self paint) offset:0,-1 size:575x19
        Text offset:0,1 size:200x17 start: 144 end: 171
        Text offset:200,1 size:375x17 start: 84 end: 144
    LineBox offset:21,36 size:578x18

Useful when debugging painting.

Bug: 635619
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I0901841736b7bbad9534a3ecbcc187c9b968d15c
Reviewed-on: https://chromium-review.googlesource.com/892103
Commit-Queue: Aleks Totic <atotic@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532788}
parent 9108b5c0
......@@ -90,22 +90,28 @@ void AppendFragmentToString(const NGPhysicalFragment* fragment,
bool has_content = false;
if (fragment->IsBox()) {
const auto* box = ToNGPhysicalBoxFragment(fragment);
if (flags & NGPhysicalFragment::DumpType) {
builder->Append("Box");
String box_type = StringForBoxType(*fragment);
has_content = true;
if (!box_type.IsEmpty()) {
builder->Append(" (");
builder->Append(box_type);
builder->Append(")");
}
has_content = true;
if (flags & NGPhysicalFragment::DumpSelfPainting &&
box->HasSelfPaintingLayer()) {
if (box_type.IsEmpty())
builder->Append(" ");
builder->Append("(self paint)");
}
}
has_content =
AppendFragmentOffsetAndSize(fragment, builder, flags, has_content);
builder->Append("\n");
const auto* box = ToNGPhysicalBoxFragment(fragment);
if (flags & NGPhysicalFragment::DumpSubtree) {
const auto& children = box->Children();
for (unsigned i = 0; i < children.size(); i++)
......
......@@ -161,6 +161,7 @@ class CORE_EXPORT NGPhysicalFragment
DumpOffset = 0x10,
DumpSize = 0x20,
DumpTextOffsets = 0x40,
DumpSelfPainting = 0x80,
DumpAll = -1
};
typedef int DumpFlags;
......
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