Changeset 267437 in webkit
- Timestamp:
- Sep 22, 2020, 2:45:32 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
layout/inlineformatting/InlineFormattingContext.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267435 r267437 1 2020-09-22 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Atomic inline-level box with margin is mispositioned 4 https://bugs.webkit.org/show_bug.cgi?id=216842 5 6 Reviewed by Antti Koivisto. 7 8 The inline box that an atomic inline-level box generates has the height of the margin box. Therefore the inline box's logical top position 9 is the position of the top edge of the margin box. 10 When converting the inline box geometry back to the layout box, we need to offset the top position (border box top edge) 11 with the value of the used margin before. 12 13 * layout/inlineformatting/InlineFormattingContext.cpp: 14 (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): 15 1 16 2020-09-22 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp
r267434 r267437 445 445 } 446 446 auto& boxGeometry = formattingState.boxGeometry(layoutBox); 447 auto logicalTopLeft = inlineBox->logicalRect().topLeft(); 448 449 logicalTopLeft.move({ }, lineBoxVerticalOffset); 447 auto marginBoxLogicalTopLeft = inlineBox->logicalRect().topLeft(); 448 auto borderBoxLogicalTopLeft = marginBoxLogicalTopLeft + InlineLayoutSize({ }, boxGeometry.marginBefore()); 449 450 borderBoxLogicalTopLeft.move({ }, lineBoxVerticalOffset); 450 451 if (layoutBox.isInFlowPositioned()) 451 logicalTopLeft += geometry.inFlowPositionedPositionOffset(layoutBox, horizontalConstraints);452 borderBoxLogicalTopLeft += geometry.inFlowPositionedPositionOffset(layoutBox, horizontalConstraints); 452 453 453 454 if (layoutBox.isAtomicInlineLevelBox()) { 454 455 // Atomic inline boxes are all set. Their margin/border/content box geometries are already computed. We just have to position them here. 455 boxGeometry.setLogicalTopLeft(toLayoutPoint( logicalTopLeft));456 boxGeometry.setLogicalTopLeft(toLayoutPoint(borderBoxLogicalTopLeft)); 456 457 continue; 457 458 } … … 463 464 if (!isSpanningInlineBox) { 464 465 // This box showed up on this line the first time. 465 boxGeometry.setLogicalTopLeft(toLayoutPoint( logicalTopLeft));466 boxGeometry.setLogicalTopLeft(toLayoutPoint(borderBoxLogicalTopLeft)); 466 467 boxGeometry.setContentBoxWidth(toLayoutUnit(contentBoxWidth)); 467 468 boxGeometry.setContentBoxHeight(toLayoutUnit(inlineBox->logicalHeight())); … … 469 470 } 470 471 // This is a just a simple box geometry for the line spanning inline box. getBoundingClientRect looks into each line boxes (will turn into fragmented boxes). 471 boxGeometry.setLogicalLeft(std::min(boxGeometry.logicalLeft(), toLayoutUnit( logicalTopLeft.x())));472 boxGeometry.setLogicalLeft(std::min(boxGeometry.logicalLeft(), toLayoutUnit(borderBoxLogicalTopLeft.x()))); 472 473 boxGeometry.setContentBoxWidth(std::max(toLayoutUnit(contentBoxWidth), boxGeometry.contentBoxWidth())); 473 474 boxGeometry.setContentBoxHeight(boxGeometry.contentBoxHeight() + toLayoutUnit(inlineBox->logicalHeight()));
Note:
See TracChangeset
for help on using the changeset viewer.