Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4fc65915b5cfbd4fe0525657e66242f86ea87fbb
      
https://github.com/WebKit/WebKit/commit/4fc65915b5cfbd4fe0525657e66242f86ea87fbb
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-05-25 (Mon, 25 May 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/RenderBlock.cpp

  Log Message:
  -----------
  Fieldset border painted behind legend when legend overlaps non-block-start 
border via negative margin
https://bugs.webkit.org/show_bug.cgi?id=189617
rdar://174185071

Reviewed by Alan Baradlay.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

Per spec [1], the fieldset border should not be painted behind the rendered
legend. When the CSS block-start border is zero (e.g. border:none;
border-left:100px solid red), paintRectToClipOutFromBorder() produced an
empty clip rect since it used borderBefore as the clip extent. This meant
a legend overlapping a non-block-start border via negative margin did not
clip that border.

When borderBefore is zero, use the legend's layout box (mapped into
paint-relative coordinates) as the clip rect instead. This only activates
when there is no block-start border, so normal fieldsets with a block-start
border gap are completely unaffected.

[1] 
https://html.spec.whatwg.org/multipage/rendering.html#the-fieldset-and-legend-elements

* LayoutTests/TestExpectations: Progression
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintRectToClipOutFromBorder):

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



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

Reply via email to