⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267648 in webkit


Ignore:
Timestamp:
Sep 26, 2020, 10:56:33 PM (6 years ago)
Author:
Alan Bujtas
Message:

[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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267645 r267648  
     12020-09-26  Zalan Bujtas  <zalan@apple.com>
     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
    1252020-09-26  Wenson Hsieh  <wenson_hsieh@apple.com>
    226
  • trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp

    r267325 r267648  
    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()) {
     
    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())
     
    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";
Note: See TracChangeset for help on using the changeset viewer.