Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8161ef47a831063cc78510b3c4c147770c18facc
      
https://github.com/WebKit/WebKit/commit/8161ef47a831063cc78510b3c4c147770c18facc
  Author: Alan Baradlay <[email protected]>
  Date:   2026-01-08 (Thu, 08 Jan 2026)

  Changed paths:
    M LayoutTests/fast/repaint/emoji-glyph-overflow-repaint-fail-expected.txt
    M Source/WebCore/layout/formattingContexts/inline/InlineContentAligner.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineItem.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineItem.h
    M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineTextItem.h
    M 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h

  Log Message:
  -----------
  https://mcas-practicetest.cognia.org/
 Grade 8 ELA math examples fail to repaint content properly
https://bugs.webkit.org/show_bug.cgi?id=301447
<rdar://163290779>

Reviewed by Antti Koivisto.

1. Track glyph overflow during inline text measurement and inflate ink overflow 
during display box construction.
   (while we don't need glyph overflow until after display box creation, 
iterating content all over again is a major perf hit)
2. Shrink Layout::Line::Run from 128 bytes to 88 bytes in order to make room 
for glyph overflow bits (speedo perf)
  - rearrange member variables
  - retire a few optionals
  - make TrailingWhitespace smaller (size as 24bits)
3. Fallback to post-layout glyph overflow computation when 5:3bit 
(ascent:descent) is MAXed indicating overflow value is larger than
   what we can fit into a byte.

Covered by existing test.

* LayoutTests/fast/repaint/emoji-glyph-overflow-repaint-fail-expected.txt:
* Source/WebCore/layout/formattingContexts/inline/InlineContentAligner.cpp:
(WebCore::Layout::computedExpansions):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp:
(WebCore::Layout::InlineFormattingUtils::inlineContentEnding):
* Source/WebCore/layout/formattingContexts/inline/InlineItem.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineItem.h:
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::computeContentAttributesAndInlineTextItemWidths):
* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::restoreTrimmedTrailingWhitespace):
(WebCore::Layout::Line::TrimmableTrailingContent::remove):
(WebCore::Layout::Line::Run::Run):
(WebCore::Layout::Line::Run::expand):
(WebCore::Layout::Line::Run::detachTrailingWhitespace):
(WebCore::Layout::Line::Run::removeTrailingWhitespace):
* Source/WebCore/layout/formattingContexts/inline/InlineLine.h:
(WebCore::Layout::Line::Run::isContentful const):
(WebCore::Layout::Line::Run::textContent const):
(WebCore::Layout::Line::Run::hasTrailingWhitespace const):
(WebCore::Layout::Line::Run::trailingWhitespaceWidth const):
(WebCore::Layout::Line::Run::isWhitespaceOnly const):
(WebCore::Layout::Line::Run::GlyphOverflow::isEmpty const):
(WebCore::Layout::Line::Run::glyphOverflow const):
(WebCore::Layout::Line::Run::isShapingBoundaryStart const):
(WebCore::Layout::Line::Run::isShapingBoundaryEnd const):
(WebCore::Layout::Line::Run::isInsideShapingBoundary const):
(WebCore::Layout::Line::Run::isShapingBoundary const):
(WebCore::Layout::Line::Run::hasCollapsibleTrailingWhitespace const):
(WebCore::Layout::Line::Run::hasCollapsedTrailingWhitespace const):
(WebCore::Layout::Line::Run::setNeedsHyphen):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::collectFallbackFonts):
(WebCore::Layout::LineBoxBuilder::adjustInlineBoxHeightsForLineBoxContainIfApplicable):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::toString):
* Source/WebCore/layout/formattingContexts/inline/InlineTextItem.h:
(WebCore::Layout::InlineTextItem::glyphOverflow const):
(WebCore::Layout::InlineTextItem::setGlyphOverflow):
* 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::appendSoftLineBreakDisplayBox):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::width):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h:
(WebCore::Layout::TextUtil::width):

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



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

Reply via email to