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

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/InlineLayoutState.h
    M Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayBox.h
    M 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp
    M 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContent.h
    M 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.cpp
    M 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp

  Log Message:
  -----------
  [IFC] Compute style driven ink overflow in the integration layer instead of 
InlineDisplayContentBuilder
https://bugs.webkit.org/show_bug.cgi?id=322772
<rdar://problem/186035576>

Reviewed by Antti Koivisto.

This is a preparation for repainting an ink overflow only style change (a link 
picking up an underline on hover, say)
without running inline layout and repainting a block wide band, which is 
webkit.org/b/322481.

Ink overflow is built in two places today. InlineDisplayContentBuilder inflates 
each display box as it appends it
and does so by inflating whatever the box already has. That makes the 
computation a one-shot part of building display
content: it cannot be re-run on live content without double counting, and it 
can never shrink.

Everything in that list except glyph overflow is derived from style and box 
geometry, neither of which
needs inline layout to produce. Only glyph overflow is measured, and it arrives 
on Line::Run, which is
gone once layout is done. So cache that one value on the display box and move 
the rest out to
InlineContentBuilder, next to the line and block level overflow it already 
aggregates. The pass now
sets ink overflow from the box's visual rect rather than inflating it, which 
makes it correct to run at
any point after the boxes are positioned, not just while they are being 
appended.

No behavior change.

* Source/WebCore/layout/formattingContexts/inline/InlineLayoutState.h: Carry 
whether anything on the
(WebCore::Layout::InlineLayoutState::setContentMayHaveInkOverflow):
(WebCore::Layout::InlineLayoutState::contentMayHaveInkOverflow const):
content can produce ink overflow, so the integration pass keeps the early out 
the two collecting passes
used to have.
* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayBox.h: 
Cache the measured glyph
(WebCore::InlineDisplay::Box::setInkOverflow):
(WebCore::InlineDisplay::Box::glyphOverflow const):
(WebCore::InlineDisplay::Box::setGlyphOverflow):
(WebCore::InlineDisplay::Box::adjustInkOverflow): Deleted.
overflow. It fits in the padding after the existing flags, so 
InlineDisplay::Box does not grow.
* 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
 Remove
(WebCore::Layout::InlineDisplayContentBuilder::build):
(WebCore::Layout::InlineDisplayContentBuilder::buildTextOnlyContent):
(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::appendAtomicInlineLevelDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::appendInlineBoxDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):
(WebCore::Layout::computeInkOverflowForInlineLevelBox): Deleted.
(WebCore::Layout::adjustInkOverflowForInlineBox): Deleted.
(WebCore::Layout::InlineDisplayContentBuilder::collectInkOverflowForInlineBoxes):
 Deleted.
(WebCore::Layout::logicalBottomForTextDecorationContent): Deleted.
(WebCore::Layout::InlineDisplayContentBuilder::collectInkOverflowForTextDecorations):
 Deleted.
(WebCore::Layout::isNestedInlineBoxWithDifferentFontCascadeFromParent):
collectInkOverflowForTextDecorations, collectInkOverflowForInlineBoxes, 
computeInkOverflowForInlineLevelBox
and the per box inflation. Boxes are now appended with their visual rect as ink 
overflow.
* 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContent.h:
(WebCore::LayoutIntegration::InlineContent::setContentMayHaveInkOverflow):
(WebCore::LayoutIntegration::InlineContent::contentMayHaveInkOverflow const):
* 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.cpp:
 Added
(WebCore::LayoutIntegration::InlineContentBuilder::build const):
(WebCore::LayoutIntegration::strokeAndTextShadowInkOverflowOutsets):
(WebCore::LayoutIntegration::logicalBottomForTextDecorationContent):
(WebCore::LayoutIntegration::inkOverflowOutsetsForTextDecorations):
(WebCore::LayoutIntegration::InlineContentBuilder::updateInkOverflow const):
(WebCore::LayoutIntegration::InlineContentBuilder::updateInkOverflowForText):
(WebCore::LayoutIntegration::InlineContentBuilder::updateInkOverflowForInlineBoxes):
(WebCore::LayoutIntegration::InlineContentBuilder::handlePartialDisplayContentUpdate
 const):
updateInkOverflow, run per line before adjustDisplayLines aggregates line and 
block overflow. Note it
groups boxes by their line index, since the display lines do not know their box 
range until
adjustDisplayLines assigns it.
* 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp: Set 
the flag before build so
(WebCore::LayoutIntegration::LineLayout::constructContent):
the pass can see it.

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



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

Reply via email to