Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit e41b4d0

Browse files
[LFC] Add <wbr> to showLayoutTree
https://bugs.webkit.org/show_bug.cgi?id=217025 Reviewed by Darin Adler. This patch also tweaks the inline tree output (one line geometry output per line, different output format). <div style="width: 100px;">first_line<wbr>second_line</div> block box at (0,10) size 100x20 line at (0.00,0.00) size 100.00x10.00 baseline at (8.00) line at (0.00,10.00) size 100.00x10.00 baseline at (8.00) text run at (0.00,0.00) size 100.00x10.00 run(0, 10) text run at (0.00,0.00) size 110.00x10.00 run(0, 11) anonymous inline box (0x495583d20) length->(10) "first_line" word break opportunity at (100,8) size 0x0 (0x4967c0680) anonymous inline box (0x495591e00) length->(11) "second_line" * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): (WebCore::Layout::outputLayoutBox): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@267648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 6f00416 commit e41b4d0

File tree

2 files changed

+37
-15
lines changed

2 files changed

+37
-15
lines changed

Source/WebCore/ChangeLog

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2020-09-26 Zalan Bujtas <[email protected]>
2+
3+
[LFC] Add <wbr> to showLayoutTree
4+
https://bugs.webkit.org/show_bug.cgi?id=217025
5+
6+
Reviewed by Darin Adler.
7+
8+
This patch also tweaks the inline tree output (one line geometry output per line, different output format).
9+
10+
<div style="width: 100px;">first_line<wbr>second_line</div>
11+
12+
block box at (0,10) size 100x20
13+
line at (0.00,0.00) size 100.00x10.00 baseline at (8.00)
14+
line at (0.00,10.00) size 100.00x10.00 baseline at (8.00)
15+
text run at (0.00,0.00) size 100.00x10.00 run(0, 10)
16+
text run at (0.00,0.00) size 110.00x10.00 run(0, 11)
17+
anonymous inline box (0x495583d20) length->(10) "first_line"
18+
word break opportunity at (100,8) size 0x0 (0x4967c0680)
19+
anonymous inline box (0x495591e00) length->(11) "second_line"
20+
21+
* layout/layouttree/LayoutTreeBuilder.cpp:
22+
(WebCore::Layout::outputInlineRuns):
23+
(WebCore::Layout::outputLayoutBox):
24+
125
2020-09-26 Wenson Hsieh <[email protected]>
226

327
Remove support for setting CMYKA fill and stroke colors in 2D canvas

Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -383,25 +383,23 @@ static void outputInlineRuns(TextStream& stream, const LayoutState& layoutState,
383383
auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
384384
auto& lines = inlineFormattingState.lines();
385385

386-
unsigned printedCharacters = 0;
387-
while (++printedCharacters <= depth * 2)
388-
stream << " ";
389-
stream << " ";
390-
391-
stream << "lines are -> ";
392-
for (auto& line : lines)
393-
stream << "[" << line.logicalLeft() << "," << line.logicalTop() << " " << line.logicalWidth() << "x" << line.logicalHeight() << "][baseline: " << line.baseline() << "]";
394-
stream.nextLine();
386+
for (auto& line : lines) {
387+
size_t printedCharacters = 0;
388+
while (++printedCharacters <= depth * 2)
389+
stream << " ";
390+
stream << " line at (" << line.logicalLeft() << "," << line.logicalTop() << ") size " << line.logicalWidth() << "x" << line.logicalHeight() << " baseline at (" << line.baseline() << ")";
391+
stream.nextLine();
392+
}
395393

396394
for (auto& run : inlineFormattingState.lineRuns()) {
397395
unsigned printedCharacters = 0;
398396
while (++printedCharacters <= depth * 2)
399397
stream << " ";
400398
stream << " ";
401399
if (run.text())
402-
stream << "inline text box";
400+
stream << "text run";
403401
else
404-
stream << "inline box";
402+
stream << "box run";
405403
stream << " at (" << run.logicalLeft() << "," << run.logicalTop() << ") size " << run.logicalWidth() << "x" << run.logicalHeight();
406404
if (run.text())
407405
stream << " run(" << run.text()->start() << ", " << run.text()->end() << ")";
@@ -453,14 +451,14 @@ static void outputLayoutBox(TextStream& stream, const Box& layoutBox, const BoxG
453451
stream << "anonymous inline box";
454452
else if (layoutBox.isInlineBlockBox())
455453
stream << "inline-block box";
456-
else if (layoutBox.isInlineBox())
457-
stream << "inline box";
454+
else if (layoutBox.isLineBreakBox())
455+
stream << (downcast<LineBreakBox>(layoutBox).isOptional() ? "word break opportunity" : "line break");
458456
else if (layoutBox.isAtomicInlineLevelBox())
459457
stream << "atomic inline level box";
460458
else if (layoutBox.isReplacedBox())
461459
stream << "replaced inline box";
462-
else if (layoutBox.isLineBreakBox())
463-
stream << "line break";
460+
else if (layoutBox.isInlineBox())
461+
stream << "inline box";
464462
else
465463
stream << "other inline level box";
466464
} else if (layoutBox.isBlockLevelBox())

0 commit comments

Comments
 (0)