Changeset 269912 in webkit


Ignore:
Timestamp:
Nov 17, 2020 10:06:26 AM (3 years ago)
Author:
Alan Bujtas
Message:

[LFC][Integration] Add even more integral snapping to inline level boxes
https://bugs.webkit.org/show_bug.cgi?id=219011

Reviewed by Antti Koivisto.

It is required to match current legacy inline geometries.

  • layout/inlineformatting/InlineLineBox.cpp:

(WebCore::Layout::LineBox::InlineLevelBox::setLogicalTop):
(WebCore::Layout::LineBox::InlineLevelBox::setLogicalHeight):

  • layout/inlineformatting/InlineLineBox.h:

(WebCore::Layout::LineBox::InlineLevelBox::setLogicalTop): Deleted.
(WebCore::Layout::LineBox::InlineLevelBox::setLogicalHeight): Deleted.

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/platform/ios/css1/formatting_model/height_of_lines-expected.txt

    r269655 r269912  
    120120                  text run at (510,183) width 28: " and "
    121121                RenderImage {IMG} at (552,198) size 131x130 [border: (10px solid #000000)]
    122                 RenderText {#text} at (697,183) size 758x258
     122                RenderText {#text} at (697,183) size 758x257
    123123                  text run at (697,183) width 8: ". "
    124124                  text run at (704,183) width 39: "This is"
  • trunk/LayoutTests/platform/ios/css1/text_properties/vertical_align-expected.txt

    r269655 r269912  
    8686      RenderBlock {P} at (0,746) size 784x70
    8787        RenderImage {IMG} at (0,0) size 15x50
    88         RenderText {#text} at (15,13) size 755x56
    89           text run at (15,13) width 740: " The image at the beginning of this sentence should be middle-aligned, which should align its middle with the point"
     88        RenderText {#text} at (15,14) size 755x55
     89          text run at (15,14) width 740: " The image at the beginning of this sentence should be middle-aligned, which should align its middle with the point"
    9090          text run at (0,50) width 318: "defined as the text baseline plus half the x-height."
    9191      RenderBlock {P} at (0,832) size 784x126
     
    429429              RenderBlock {P} at (4,431) size 762x70
    430430                RenderImage {IMG} at (0,0) size 15x50
    431                 RenderText {#text} at (15,13) size 755x56
    432                   text run at (15,13) width 740: " The image at the beginning of this sentence should be middle-aligned, which should align its middle with the point"
     431                RenderText {#text} at (15,14) size 755x55
     432                  text run at (15,14) width 740: " The image at the beginning of this sentence should be middle-aligned, which should align its middle with the point"
    433433                  text run at (0,50) width 318: "defined as the text baseline plus half the x-height."
    434434              RenderBlock {P} at (4,517) size 762x126
  • trunk/LayoutTests/platform/mac/css1/formatting_model/height_of_lines-expected.txt

    r269655 r269912  
    6969          text run at (510,183) width 28: " and "
    7070        RenderImage {IMG} at (552,198) size 131x130 [border: (10px solid #000000)]
    71         RenderText {#text} at (697,183) size 769x258
     71        RenderText {#text} at (697,183) size 769x257
    7272          text run at (697,183) width 8: ". "
    7373          text run at (704,183) width 39: "This is"
     
    119119                  text run at (596,183) width 25: " and"
    120120                RenderImage {IMG} at (15,218) size 130x130 [border: (10px solid #000000)]
    121                 RenderText {#text} at (160,203) size 747x238
     121                RenderText {#text} at (160,203) size 747x237
    122122                  text run at (160,203) width 7: ". "
    123123                  text run at (167,203) width 580: "This is additional text to make sure that there is enough room left below the image so that this line does"
  • trunk/LayoutTests/platform/mac/css1/text_properties/vertical_align-expected.txt

    r269655 r269912  
    8686      RenderBlock {P} at (0,751) size 769x68
    8787        RenderImage {IMG} at (0,0) size 15x50
    88         RenderText {#text} at (15,14) size 755x54
    89           text run at (15,14) width 740: " The image at the beginning of this sentence should be middle-aligned, which should align its middle with the point"
     88        RenderText {#text} at (15,15) size 755x53
     89          text run at (15,15) width 740: " The image at the beginning of this sentence should be middle-aligned, which should align its middle with the point"
    9090          text run at (0,50) width 317: "defined as the text baseline plus half the x-height."
    9191      RenderBlock {P} at (0,835) size 769x124
     
    432432              RenderBlock {P} at (4,420) size 747x68
    433433                RenderImage {IMG} at (0,0) size 15x50
    434                 RenderText {#text} at (15,14) size 718x54
    435                   text run at (15,14) width 703: " The image at the beginning of this sentence should be middle-aligned, which should align its middle with the"
     434                RenderText {#text} at (15,15) size 718x53
     435                  text run at (15,15) width 703: " The image at the beginning of this sentence should be middle-aligned, which should align its middle with the"
    436436                  text run at (0,50) width 354: "point defined as the text baseline plus half the x-height."
    437437              RenderBlock {P} at (4,504) size 747x124
  • trunk/Source/WebCore/ChangeLog

    r269909 r269912  
     12020-11-17  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Integration] Add even more integral snapping to inline level boxes
     4        https://bugs.webkit.org/show_bug.cgi?id=219011
     5
     6        Reviewed by Antti Koivisto.
     7
     8        It is required to match current legacy inline geometries.
     9
     10        * layout/inlineformatting/InlineLineBox.cpp:
     11        (WebCore::Layout::LineBox::InlineLevelBox::setLogicalTop):
     12        (WebCore::Layout::LineBox::InlineLevelBox::setLogicalHeight):
     13        * layout/inlineformatting/InlineLineBox.h:
     14        (WebCore::Layout::LineBox::InlineLevelBox::setLogicalTop): Deleted.
     15        (WebCore::Layout::LineBox::InlineLevelBox::setLogicalHeight): Deleted.
     16        * layout/integration/LayoutIntegrationLineLayout.cpp:
     17        (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
     18
    1192020-11-17  Chris Lord  <clord@igalia.com>
    220
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp

    r269299 r269912  
    5656    // FIXME: Remove legacy rounding.
    5757    m_layoutBounds = { InlineLayoutUnit(roundToInt(layoutBounds.ascent)), InlineLayoutUnit(roundToInt(layoutBounds.descent)) };
     58}
     59
     60void LineBox::InlineLevelBox::setLogicalTop(InlineLayoutUnit logicalTop)
     61{
     62    // FIXME: Remove legacy rounding.
     63    m_logicalRect.setTop(roundToInt(logicalTop));
     64}
     65
     66void LineBox::InlineLevelBox::setLogicalHeight(InlineLayoutUnit logicalHeight)
     67{
     68    // FIXME: Remove legacy rounding.
     69    m_logicalRect.setHeight(roundToInt(logicalHeight));
    5870}
    5971
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h

    r269299 r269912  
    112112        InlineLayoutUnit logicalHeight() const { return m_logicalRect.height(); }
    113113
    114         void setLogicalTop(InlineLayoutUnit logicalTop) { m_logicalRect.setTop(logicalTop); }
    115114        void setLogicalWidth(InlineLayoutUnit logicalWidth) { m_logicalRect.setWidth(logicalWidth); }
    116         void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalRect.setHeight(logicalHeight); }
     115        void setLogicalHeight(InlineLayoutUnit);
     116        void setLogicalTop(InlineLayoutUnit);
    117117        void setBaseline(InlineLayoutUnit);
    118118        void setDescent(InlineLayoutUnit);
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r269825 r269912  
    133133
    134134    auto baseline = replacedOrInlineBlock.baselinePosition(AlphabeticBaseline, false /* firstLine */, HorizontalLine, PositionOnContainingLine);
    135     replacedBox.setBaseline(baseline);
     135    replacedBox.setBaseline(roundToInt(baseline));
    136136}
    137137
Note: See TracChangeset for help on using the changeset viewer.