Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve readability of flow tree dump #8632

Merged
merged 1 commit into from Nov 24, 2015
Merged

Conversation

@mrobinson
Copy link
Member

mrobinson commented Nov 21, 2015

Use the PrintTree utility to improve the readability of flow tree
dumps. Blocks and fragments are now split over two dump levels, because
otherwise they are impenetrable. Also start printing the restyle damage of
fragments.

Review on Reviewable

@highfive
Copy link

highfive commented Nov 21, 2015

warning Warning warning

  • These commits modify layout code, but no reftests are modified. Please consider adding a reftest!
@mrobinson
Copy link
Member Author

mrobinson commented Nov 21, 2015

Before:

+ Block - 7f230fc43190: frag=(15 SpecificFragmentInfo::Generic bb LogicalRect(, i800px×b608px, @ (i0px,b0px)) bp LogicalMargin(, inline: 0px..0px block: 0px..0px) m LogicalMargin(, inline: 0px..0px block: 0px..0px)) (@ LogicalRect(, i800px×b608px, @ (i0px,b0px)), CC 1, ADC 1, Ovr Rect(800px×608px at (0px,0px)), Dmg REPAINT | BUBBLE_ISIZES)
| + Block - 7f230fc42f10: frag=(11 SpecificFragmentInfo::Generic bb LogicalRect(, i784px×b18.616666666666667px, @ (i8px,b0px)) bp LogicalMargin(, inline: 0px..0px block: 0px..0px) m LogicalMargin(, inline: 8px..8px block: 8px..8px)) (@ LogicalRect(, i800px×b18.616666666666667px, @ (i0px,b8px)), CC 2, ADC 0, Ovr Rect(784px×37.233333333333334px at (8px,0px)), Dmg REPAINT | BUBBLE_ISIZES)
| | + Block - 7f230e844a90: frag=(3 SpecificFragmentInfo::Generic bb LogicalRect(, i784px×b18.616666666666667px, @ (i0px,b0px)) bp LogicalMargin(, inline: 0px..0px block: 0px..0px) m LogicalMargin(, inline: 0px..0px block: 0px..0px)) (@ LogicalRect(, i784px×b18.616666666666667px, @ (i8px,b0px)), CC 1, ADC 0, Ovr Rect(784px×18.616666666666667px at (0px,0px)), Dmg REPAINT | BUBBLE_ISIZES)
| | | + Inline - 7f230e828390 - Ovr Rect(43px×18.616666666666667px at (0px,0px)) - 
  * (2 SpecificFragmentInfo::ScannedText bb LogicalRect(, i43px×b18.616666666666667px, @ (i0px,b0px)) bp LogicalMargin(, inline: 0px..0px block: 0px..0px) m LogicalMargin(, inline: 0px..0px block: 0px..0px) "hello!")
| | + Block - 7f230fc42290: frag=(8 SpecificFragmentInfo::Generic bb LogicalRect(, i90px×b18.616666666666667px, @ (i0px,b0px)) bp LogicalMargin(, inline: 0px..0px block: 0px..0px) m LogicalMargin(, inline: 0px..0px block: 0px..0px)) (@ LogicalRect(, i90px×b18.616666666666667px, @ (i8px,b18.616666666666667px)), CC 1, ADC 0, Ovr Rect(90px×18.616666666666667px at (0px,0px)), Dmg REPAINT | BUBBLE_ISIZES)
| | | + Inline - 7f230fc28390 - Ovr Rect(90px×18.616666666666667px at (0px,0px)) - 
  * (6 SpecificFragmentInfo::ScannedText bb LogicalRect(, i48px×b18.616666666666667px, @ (i0px,b0px)) bp LogicalMargin(, inline: 0px..0px block: 0px..0px) m LogicalMargin(, inline: 0px..0px block: 0px..0px) "hello! ")
  * (7 SpecificFragmentInfo::ScannedText bb LogicalRect(, i42px×b18.616666666666667px, @ (i48px,b0px)) bp LogicalMargin(, inline: 0px..0px block: 0px..0px) m LogicalMargin(, inline: 0px..0px block: 0px..0px) "hihihi")

After:

┌ Post layout flow tree
│  ├─ Block(7f1e11c65890) pos=LogicalRect(H LTR, i800px×b608px, @ (i0px,b0px)), overflow=Rect(800px×608px at (0px,0px)) children=1 abs-descendents=1
│  │  ├─ ↑↑ Fragment for block: SpecificFragmentInfo::Generic(15) [] border_box=LogicalRect(H LTR, i800px×b608px, @ (i0px,b0px)) damage=REPAINT | BUBBLE_ISIZES | REFLOW_OUT_OF_FLOW | REFLOW | RECONSTRUCT_FLOW
│  │  ├─ Block(7f1e11c65610) pos=LogicalRect(H LTR, i800px×b18.616666666666667px, @ (i0px,b8px)), overflow=Rect(784px×37.233333333333334px at (8px,0px)) children=2
│  │  │  ├─ ↑↑ Fragment for block: SpecificFragmentInfo::Generic(11) [] border_box=LogicalRect(H LTR, i784px×b18.616666666666667px, @ (i8px,b0px)) margin=LogicalMargin(H LTR, i:8px..8px b:8px..8px) damage=REPAINT | BUBBLE_ISIZES | REFLOW_OUT_OF_FLOW | REFLOW | RECONSTRUCT_FLOW
│  │  │  ├─ Block(7f1e11c63f90) pos=LogicalRect(H LTR, i784px×b18.616666666666667px, @ (i8px,b0px)), overflow=Rect(784px×18.616666666666667px at (0px,0px)) children=1
│  │  │  │  ├─ ↑↑ Fragment for block: SpecificFragmentInfo::Generic(3) [] border_box=LogicalRect(H LTR, i784px×b18.616666666666667px, @ (i0px,b0px)) damage=REPAINT | BUBBLE_ISIZES | REFLOW_OUT_OF_FLOW | REFLOW | RECONSTRUCT_FLOW
│  │  │  │  ├─ Inline(7f1e11c4c390) overflow=Rect(43px×18.616666666666667px at (0px,0px))
│  │  │  │  │  └─ SpecificFragmentInfo::ScannedText(2) [ "hello!"] border_box=LogicalRect(H LTR, i43px×b18.616666666666667px, @ (i0px,b0px)) damage=REPAINT | BUBBLE_ISIZES | REFLOW_OUT_OF_FLOW | REFLOW | RECONSTRUCT_FLOW
│  │  │  ├─ Block(7f1e11c65390) pos=LogicalRect(H LTR, i90px×b18.616666666666667px, @ (i8px,b18.616666666666667px)), overflow=Rect(90px×18.616666666666667px at (0px,0px)) children=1
│  │  │  │  ├─ ↑↑ Fragment for block: SpecificFragmentInfo::Generic(8) [] border_box=LogicalRect(H LTR, i90px×b18.616666666666667px, @ (i0px,b0px)) damage=REPAINT | BUBBLE_ISIZES | REFLOW_OUT_OF_FLOW | REFLOW | RECONSTRUCT_FLOW
│  │  │  │  ├─ Inline(7f1e11c4c550) overflow=Rect(90px×18.616666666666667px at (0px,0px))
│  │  │  │  │  ├─ SpecificFragmentInfo::ScannedText(6) [ "hello! "] border_box=LogicalRect(H LTR, i48px×b18.616666666666667px, @ (i0px,b0px)) damage=REPAINT | BUBBLE_ISIZES | REFLOW_OUT_OF_FLOW | REFLOW | RECONSTRUCT_FLOW
│  │  │  │  │  └─ SpecificFragmentInfo::ScannedText(7) [ "hihihi"] border_box=LogicalRect(H LTR, i42px×b18.616666666666667px, @ (i48px,b0px)) damage=REPAINT | BUBBLE_ISIZES | REFLOW_OUT_OF_FLOW | REFLOW | RECONSTRUCT_FLOW
@mrobinson mrobinson force-pushed the mrobinson:flow-tree-dump branch 2 times, most recently from ebbbd5e to 5bbe9ed Nov 21, 2015
@nox
Copy link
Member

nox commented Nov 21, 2015

Why is it [ "hello!"] and not ["hello!"]?

@mrobinson
Copy link
Member Author

mrobinson commented Nov 21, 2015

@nox, that's because of the way that the Debug formatter for SpecificFragmentInfo was implemented before. In the latest version of the branch, I've eliminated that behavior.

@mrobinson mrobinson force-pushed the mrobinson:flow-tree-dump branch from 5bbe9ed to e7c5afd Nov 21, 2015
@pcwalton
Copy link
Contributor

pcwalton commented Nov 23, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Nov 23, 2015

📌 Commit e7c5afd has been approved by pcwalton

@pcwalton
Copy link
Contributor

pcwalton commented Nov 23, 2015

Might be nice to have a more abbreviated way to represent damage (maybe one letter or Unicode symbol for each flag?) but this is a big improvement as is.

@bors-servo
Copy link
Contributor

bors-servo commented Nov 23, 2015

🔒 Merge conflict

@jdm jdm added S-needs-rebase and removed S-awaiting-merge labels Nov 23, 2015
Use the PrintTree utility to improve the readability of flow tree
dumps. Blocks and fragments are now split over two dump levels, because
otherwise they are impenetrable. Also start printing the restyle damage of
fragments.
@bors-servo
Copy link
Contributor

bors-servo commented Nov 24, 2015

The latest upstream changes (presumably #8655) made this pull request unmergeable. Please resolve the merge conflicts.

@mrobinson mrobinson force-pushed the mrobinson:flow-tree-dump branch from e7c5afd to 8dd664a Nov 24, 2015
@mrobinson
Copy link
Member Author

mrobinson commented Nov 24, 2015

@bors-servo r=pcwalton

I fixed the merge conflict by simply resolving some use lines, so I'm resending this to bors.

@bors-servo
Copy link
Contributor

bors-servo commented Nov 24, 2015

📌 Commit 8dd664a has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Nov 24, 2015

Testing commit 8dd664a with merge a2330f4...

bors-servo added a commit that referenced this pull request Nov 24, 2015
Improve readability of flow tree dump

Use the PrintTree utility to improve the readability of flow tree
dumps. Blocks and fragments are now split over two dump levels, because
otherwise they are impenetrable. Also start printing the restyle damage of
fragments.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8632)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 24, 2015

💔 Test failed - mac-rel-css

@jdm
Copy link
Member

jdm commented Nov 24, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Nov 24, 2015

Previous build results for android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-wpt are reusable. Rebuilding only mac-rel-css...

@bors-servo
Copy link
Contributor

bors-servo commented Nov 24, 2015

@bors-servo bors-servo merged commit 8dd664a into servo:master Nov 24, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@mrobinson mrobinson deleted the mrobinson:flow-tree-dump branch Nov 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.