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

Changeset 267446 in webkit


Ignore:
Timestamp:
Sep 22, 2020, 4:43:06 PM (6 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Used geometry for inline level boxes should be in the coordinate system of the formatting context root
https://bugs.webkit.org/show_bug.cgi?id=216854

Reviewed by Simon Fraser.

Convert inline level box geometry from relative to the line box to relative to the formatting context root.

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267444 r267446  
     12020-09-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Used geometry for inline level boxes should be in the coordinate system of the formatting context root
     4        https://bugs.webkit.org/show_bug.cgi?id=216854
     5
     6        Reviewed by Simon Fraser.
     7
     8        Convert inline level box geometry from relative to the line box to relative to the formatting context root.
     9
     10        * layout/inlineformatting/InlineFormattingContext.cpp:
     11        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
     12
    1132020-09-22  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r267437 r267446  
    445445            }
    446446            auto& boxGeometry = formattingState.boxGeometry(layoutBox);
    447             auto marginBoxLogicalTopLeft = inlineBox->logicalRect().topLeft();
    448             auto borderBoxLogicalTopLeft = marginBoxLogicalTopLeft + InlineLayoutSize({ }, boxGeometry.marginBefore());
    449 
     447            // Inline box coordinates are relative to the line box.
     448            // Let's convert top/left relative to the formatting context root.
     449            auto borderBoxLogicalTopLeft = lineLogicalRect.topLeft();
    450450            borderBoxLogicalTopLeft.move({ }, lineBoxVerticalOffset);
     451            auto inlineBoxLogicalTopLeft = inlineBox->logicalRect().topLeft();
     452            // Inline box height includes the margin box. Let's account for that.
     453            borderBoxLogicalTopLeft.move(inlineBoxLogicalTopLeft.x(), inlineBoxLogicalTopLeft.y() + boxGeometry.marginBefore());
     454
    451455            if (layoutBox.isInFlowPositioned())
    452456                borderBoxLogicalTopLeft += geometry.inFlowPositionedPositionOffset(layoutBox, horizontalConstraints);
Note: See TracChangeset for help on using the changeset viewer.