Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7a3ff16540bff913ee4b37e40116ea8dae35c7ea
      
https://github.com/WebKit/WebKit/commit/7a3ff16540bff913ee4b37e40116ea8dae35c7ea
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-04-09 (Thu, 09 Apr 2026)

  Changed paths:
    A LayoutTests/fast/css/focus-ring-border-radius-outline-offset-expected.html
    A LayoutTests/fast/css/focus-ring-border-radius-outline-offset.html
    M Source/WebCore/rendering/OutlinePainter.cpp

  Log Message:
  -----------
  Make auto outlines follow the border radii better
https://bugs.webkit.org/show_bug.cgi?id=311567

Reviewed by Simon Fraser.

Fixed paintFocusRing() to use BorderShape::shapeForOffsetRect instead
of pathWithShrinkWrappedRects when the focus ring rects resolve to a
single rectangle. The old path resolved border-radius against the
already-inflated rect (after outline-offset) then further adjusted via
adjustedRadiiForHuggingCurve, double-adjusting the radii.

The new path mirrors how non-auto outlines compute radii: resolve
against the original border box, then let BorderShape handle the offset
expansion/contraction. A containment check ensures block elements with
child rects (e.g., <select> buttons containing <div>/<svg>) also take
the corrected path, while genuine multi-rect cases (inline elements
spanning lines) still use the shrink-wrap path.

Also restructured the function to use early returns.

This improves this demo: https://codepen.io/argyleink/pen/wvYrZEV

Test: fast/css/focus-ring-border-radius-outline-offset.html
Canonical link: https://commits.webkit.org/310900@main



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

Reply via email to