Changeset 263631 in webkit


Ignore:
Timestamp:
Jun 27, 2020 10:26:28 PM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Replaced inline boxes sit on the baseline with their margins
https://bugs.webkit.org/show_bug.cgi?id=213679

Reviewed by Antti Koivisto.

Source/WebCore:

Take the margin box into account when computing the top position of a baseline aligned replaced inline box.

Test: fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html

  • layout/inlineformatting/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::alignContentVertically):

LayoutTests:

  • fast/layoutformattingcontext/replaced-box-with-margin-on-baseline-expected.html: Added.
  • fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r263628 r263631  
     12020-06-27  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Replaced inline boxes sit on the baseline with their margins
     4        https://bugs.webkit.org/show_bug.cgi?id=213679
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/layoutformattingcontext/replaced-box-with-margin-on-baseline-expected.html: Added.
     9        * fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html: Added.
     10
    1112020-06-27  Mark Lam  <mark.lam@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r263628 r263631  
     12020-06-27  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Replaced inline boxes sit on the baseline with their margins
     4        https://bugs.webkit.org/show_bug.cgi?id=213679
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Take the margin box into account when computing the top position of a baseline aligned replaced inline box.
     9
     10        Test: fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html
     11
     12        * layout/inlineformatting/InlineLineBuilder.cpp:
     13        (WebCore::Layout::LineBuilder::alignContentVertically):
     14
    1152020-06-27  Mark Lam  <mark.lam@apple.com>
    216
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp

    r258073 r263631  
    174174                auto baselineOffsetFromMarginBox = boxGeometry.marginBefore() + boxGeometry.borderTop() + boxGeometry.paddingTop().valueOr(0) + inlineBlockBaselineOffset;
    175175                logicalTop = baselineOffset() - baselineOffsetFromMarginBox;
    176             } else
    177                 logicalTop = baselineOffset() - run.logicalRect().height();
     176            } else {
     177                auto& boxGeometry = formattingContext().geometryForBox(layoutBox);
     178                logicalTop = baselineOffset() - (boxGeometry.verticalBorder() + boxGeometry.verticalPadding().valueOr(0_lu) + run.logicalRect().height() + boxGeometry.marginAfter());
     179            }
    178180            break;
    179181        case VerticalAlign::Top:
Note: See TracChangeset for help on using the changeset viewer.