Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bd4d235baac329bb75ef8d15e840f2b1eb7987f8
      
https://github.com/WebKit/WebKit/commit/bd4d235baac329bb75ef8d15e840f2b1eb7987f8
  Author: Alan Baradlay <[email protected]>
  Date:   2026-08-30 (Sun, 30 Aug 2026)

  Changed paths:
    M LayoutTests/fast/box-shadow/shadow-repaint-expected.txt
    M 
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/underline-visual-overflow-with-subpixel-position-expected.txt
    M 
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/underline-visual-overflow-with-subpixel-position.html
    M LayoutTests/fast/repaint/blur-change-expected.txt
    M 
LayoutTests/fast/repaint/box-shadow-repaint-sideways-writing-modes-expected.txt
    M LayoutTests/fast/repaint/box-shadow-repaint-writing-modes-expected.txt
    A 
LayoutTests/fast/repaint/box-shadow-repaint-writing-modes-pixel-expected.html
    A LayoutTests/fast/repaint/box-shadow-repaint-writing-modes-pixel.html
    M LayoutTests/fast/repaint/box-shadow-top-left-repaint-expected.txt
    A LayoutTests/fast/repaint/box-shadow-top-left-repaint-pixel-expected.html
    A LayoutTests/fast/repaint/box-shadow-top-left-repaint-pixel.html
    M LayoutTests/fast/repaint/focus-ring-repaint-expected.txt
    A 
LayoutTests/fast/repaint/inline-box-color-change-in-multiline-block-expected.txt
    A LayoutTests/fast/repaint/inline-box-color-change-in-multiline-block.html
    M LayoutTests/fast/repaint/inline-box-ink-overflow-shrink-expected.txt
    A 
LayoutTests/fast/repaint/inline-box-ink-overflow-shrink-pixel-expected.html
    A LayoutTests/fast/repaint/inline-box-ink-overflow-shrink-pixel.html
    M LayoutTests/fast/repaint/inline-box-ink-overflow-shrink.html
    A LayoutTests/fast/repaint/inline-box-text-decoration-change-expected.txt
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-in-inline-block-expected.txt
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-in-inline-block.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-in-multiline-block-expected.txt
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-in-multiline-block.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-subpixel-position-pixel-expected.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-subpixel-position-pixel.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-expected.txt
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-in-block-expected.txt
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-in-block.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-pixel-expected.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-pixel.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-position-under-expected.txt
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-position-under-pixel-expected.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-position-under-pixel.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-position-under.html
    A LayoutTests/fast/repaint/inline-box-text-decoration-change.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-removal-with-underline-offset-pixel-expected.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-removal-with-underline-offset-pixel.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-removal-with-underline-position-under-pixel-expected.html
    A 
LayoutTests/fast/repaint/inline-box-text-decoration-removal-with-underline-position-under-pixel.html
    M 
LayoutTests/fast/repaint/missing-repaint-when-text-decoration-is-present-expected.txt
    A LayoutTests/fast/repaint/outline-add-remove-on-block-pixel-expected.html
    A LayoutTests/fast/repaint/outline-add-remove-on-block-pixel.html
    A 
LayoutTests/fast/repaint/outline-and-text-decoration-on-block-pixel-expected.html
    A LayoutTests/fast/repaint/outline-and-text-decoration-on-block-pixel.html
    M LayoutTests/fast/repaint/overlapping-lines-with-ink-overflow-expected.txt
    M 
LayoutTests/fast/repaint/vertical-rl-repaint-when-decoration-changes-expected.txt
    M LayoutTests/platform/glib/fast/repaint/focus-ring-repaint-expected.txt
    M 
LayoutTests/platform/glib/fast/repaint/overlapping-lines-with-ink-overflow-expected.txt
    M LayoutTests/svg/repaint/svg-outline-repaint-on-hover-expected.txt
    M 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.cpp
    M 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderTextControlSingleLine.cpp
    M Source/WebCore/style/StyleDifference.cpp

  Log Message:
  -----------
  [IFC] Repaint an ink overflow only style change without running inline layout
https://bugs.webkit.org/show_bug.cgi?id=322481
<rdar://problem/186104270>

Reviewed by Antti Koivisto.

A link picking up an underline on :hover changes nothing but ink overflow, yet 
Style::difference reports it as
DifferenceResult::Layout, which runs inline layout over the whole block and 
repaints a block wide band.

Report it as DifferenceResult::Overflow instead. That goes through the existing 
setNeedsLayoutForOverflowChange,
so the box takes simplified layout, and since webkit.org/b/322772 the style 
driven ink overflow pass can be
re-run over the already positioned display boxes. Ink overflow can shrink as 
well as grow, so both sides are
covered: repaintBeforeStyleChange repaints the old area while the old geometry 
is still in place, and the
recompute returns the union of before and after for the boxes that actually 
moved.

Tests: fast/repaint/box-shadow-repaint-writing-modes-pixel.html
       fast/repaint/box-shadow-top-left-repaint-pixel.html
       fast/repaint/inline-box-color-change-in-multiline-block.html
       fast/repaint/inline-box-ink-overflow-shrink-pixel.html
       fast/repaint/inline-box-text-decoration-change-in-inline-block.html
       fast/repaint/inline-box-text-decoration-change-in-multiline-block.html
       
fast/repaint/inline-box-text-decoration-change-subpixel-position-pixel.html
       
fast/repaint/inline-box-text-decoration-change-with-underline-offset-in-block.html
       
fast/repaint/inline-box-text-decoration-change-with-underline-offset-pixel.html
       fast/repaint/inline-box-text-decoration-change-with-underline-offset.html
       
fast/repaint/inline-box-text-decoration-change-with-underline-position-under-pixel.html
       
fast/repaint/inline-box-text-decoration-change-with-underline-position-under.html
       fast/repaint/inline-box-text-decoration-change.html
       
fast/repaint/inline-box-text-decoration-removal-with-underline-offset-pixel.html
       
fast/repaint/inline-box-text-decoration-removal-with-underline-position-under-pixel.html
       fast/repaint/outline-add-remove-on-block-pixel.html
       fast/repaint/outline-and-text-decoration-on-block-pixel.html

* LayoutTests/fast/box-shadow/shadow-repaint-expected.txt:
  Same area, now the box plus four edge strips: the renderer no longer 
selfNeedsLayout, so repaintAfterLayoutIfNeeded takes its per edge delta path.

* 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::InlineContentBuilder::updateLineOverflow const): 
Deleted. Its caller wants the ink overflow recompute too now, so it calls 
updateOverflow directly.
* 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateOverflow):
  Snapshots each display box's ink overflow, recomputes, and returns the union 
of before and after for the boxes that changed, so an unchanged box costs 
nothing. Forces
  contentMayHaveInkOverflow, since the cached flag is what the last layout saw 
and the change may have introduced
  ink overflow on content that had none. The union starts at the first changed 
rect rather than an empty one:
  uniteEvenIfEmpty is needed for boxes whose ink overflow is empty at a 
non-zero position, and would otherwise
  pull the result out to include the origin.

* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h:
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout):
  Repaints the delta between the overflow it had on entry and the recomputed 
one, which is what covers a block's own outline or box-shadow. Only for the 
normal flow half: out-of-flow movement issues its own repaints.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::simplifiedNormalFlowLayout):
  Always recomputes now. The old guard only fired when an inline level box 
child was laid out, and an ink overflow only change dirties no box child. 
Reaching here on a
  block with inline children already means this block or its inline content 
asked for an overflow update, since out-of-flow content marks its containing 
block with a bit of its own.

* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::adjustStyleDifference const): A RenderInline with no 
line layout to re-run the pass over (SVG text) has nothing to update, so it 
takes the full layout.
(WebCore::RenderElement::repaintBeforeStyleChange): Repaints the old area here, 
while the old geometry is still in place. A transform driven Overflow diff is 
on a composited layer and has nothing to repaint.
* Source/WebCore/rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
  Stops after a simplified layout. Everything below it is relative to the 
geometry layout produces, most notably centerRendererIfNeeded(), which offsets 
the inner
  renderer from wherever it currently sits, so simplified layout would have it 
centered twice.
* Source/WebCore/style/StyleDifference.cpp:
(WebCore::Style::DifferenceFunctions::changeRequiresLayout): Drops the visual 
overflow check and the FIXME asking for exactly this optimization.
(WebCore::Style::DifferenceFunctions::difference): Reports the change as 
Overflow.

* 
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/underline-visual-overflow-with-subpixel-position-expected.txt:
* 
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/underline-visual-overflow-with-subpixel-position.html:
  The 13px tall rects it checks for are now 36 wide rather than 784. Also 
snapshots the rect list once, since
  shouldNotBe writes to the console and the second repaintRectsAsText() call 
was measuring the first one's output.
* LayoutTests/fast/repaint/blur-change-expected.txt: Two redundant rects, each 
contained in a rect already there.
* 
LayoutTests/fast/repaint/box-shadow-repaint-sideways-writing-modes-expected.txt:
* LayoutTests/fast/repaint/box-shadow-repaint-writing-modes-expected.txt: A 
shadow colour change needs one repaint per box; the dropped rects were a second 
repaint displaced by the container's block extent. The two baselines are now 
identical.
* LayoutTests/fast/repaint/box-shadow-top-left-repaint-expected.txt: Each block 
wide band becomes the span's own rect plus the exact area its shadow covers.
* LayoutTests/fast/repaint/focus-ring-repaint-expected.txt: Two outline strips 
per box instead of two whole boxes; the img's overflow already defined the 
right and bottom edges, so only left and top moved.
* LayoutTests/fast/repaint/inline-box-ink-overflow-shrink-expected.txt: 682 
wide instead of the block's 784; the shrink direction is covered because both 
rects are the larger, pre change one.
* 
LayoutTests/fast/repaint/missing-repaint-when-text-decoration-is-present-expected.txt:
 Same area as before. The outline strips appear twice because the inner block 
and its container report identical deltas.
* LayoutTests/fast/repaint/overlapping-lines-with-ink-overflow-expected.txt: 
The span's own 72px rect instead of a 700px band; an inset shadow doesn't move 
ink overflow, so there is no damage rect at all here.
* 
LayoutTests/fast/repaint/vertical-rl-repaint-when-decoration-changes-expected.txt:
 Drops a repaint displaced by the container's block extent, and adds the 4px 
strip the underline is erased from.
* LayoutTests/platform/glib/fast/repaint/focus-ring-repaint-expected.txt:
* 
LayoutTests/platform/glib/fast/repaint/overlapping-lines-with-ink-overflow-expected.txt:
 The same rect changes
as the generic baselines, at glib's 2px focus ring width and font metrics.
* LayoutTests/svg/repaint/svg-outline-repaint-on-hover-expected.txt: Drops an 
800x204 repaint of the whole page in each direction; the outline box is 
repainted by the surviving pair.
* 
LayoutTests/fast/repaint/box-shadow-repaint-writing-modes-pixel-expected.html: 
Added.
* LayoutTests/fast/repaint/box-shadow-repaint-writing-modes-pixel.html: Added.
* LayoutTests/fast/repaint/box-shadow-top-left-repaint-pixel-expected.html: 
Added.
* LayoutTests/fast/repaint/box-shadow-top-left-repaint-pixel.html: Added.
* 
LayoutTests/fast/repaint/inline-box-color-change-in-multiline-block-expected.txt:
 Added.
* LayoutTests/fast/repaint/inline-box-color-change-in-multiline-block.html: 
Added.
* LayoutTests/fast/repaint/inline-box-ink-overflow-shrink-pixel-expected.html: 
Added.
* LayoutTests/fast/repaint/inline-box-ink-overflow-shrink-pixel.html: Added.
* LayoutTests/fast/repaint/inline-box-ink-overflow-shrink.html:
* LayoutTests/fast/repaint/inline-box-text-decoration-change-expected.txt: 
Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-in-inline-block-expected.txt:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-in-inline-block.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-in-multiline-block-expected.txt:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-in-multiline-block.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-subpixel-position-pixel-expected.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-subpixel-position-pixel.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-expected.txt:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-in-block-expected.txt:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-in-block.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-pixel-expected.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset-pixel.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-offset.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-position-under-expected.txt:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-position-under-pixel-expected.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-position-under-pixel.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-change-with-underline-position-under.html:
 Added.
* LayoutTests/fast/repaint/inline-box-text-decoration-change.html: Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-removal-with-underline-offset-pixel-expected.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-removal-with-underline-offset-pixel.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-removal-with-underline-position-under-pixel-expected.html:
 Added.
* 
LayoutTests/fast/repaint/inline-box-text-decoration-removal-with-underline-position-under-pixel.html:
 Added.
* LayoutTests/fast/repaint/outline-add-remove-on-block-pixel-expected.html: 
Added.
* LayoutTests/fast/repaint/outline-add-remove-on-block-pixel.html: Added.
* 
LayoutTests/fast/repaint/outline-and-text-decoration-on-block-pixel-expected.html:
 Added.
* LayoutTests/fast/repaint/outline-and-text-decoration-on-block-pixel.html: 
Added.

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



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

Reply via email to