Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d725d8ea8e0b1f6e3bb4d57dc4ea04b918b14f8b
      
https://github.com/WebKit/WebKit/commit/d725d8ea8e0b1f6e3bb4d57dc4ea04b918b14f8b
  Author: Alan Baradlay <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    A LayoutTests/fast/inline/negative-margin-inline-box-geometry-expected.txt
    A LayoutTests/fast/inline/negative-margin-inline-box-geometry.html
    M Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp
    M Source/WebCore/layout/formattingContexts/inline/RangeBasedLineBuilder.cpp

  Log Message:
  -----------
  Incorrect box sizing on span when it has no siblings and `padding-left + 
margin-left === 0`
https://bugs.webkit.org/show_bug.cgi?id=300478
<rdar://problem/162376969>

Reviewed by Antti Koivisto.

The range-based line builder fast path doesn't handle inline box
margins. It's gated on horizontalMarginBorderAndPadding() being zero,
but that sums all components -- negative margin canceling positive
padding gives zero and incorrectly enables the fast path.

The fix also checks that marginStart and marginEnd are non-negative.

* LayoutTests/fast/inline/negative-margin-inline-box-geometry-expected.txt: 
Added.
* LayoutTests/fast/inline/negative-margin-inline-box-geometry.html: Added.
* Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp:
(WebCore::Layout::IntrinsicWidthHandler::IntrinsicWidthHandler):
* Source/WebCore/layout/formattingContexts/inline/RangeBasedLineBuilder.cpp:
(WebCore::Layout::RangeBasedLineBuilder::isEligibleForRangeInlineLayout):

Canonical link: https://commits.webkit.org/311080@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to