Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 88502d8ee638d95e6a69f16788dca8675a99f923
      
https://github.com/WebKit/WebKit/commit/88502d8ee638d95e6a69f16788dca8675a99f923
  Author: Alan Baradlay <[email protected]>
  Date:   2025-11-16 (Sun, 16 Nov 2025)

  Changed paths:
    A LayoutTests/fast/inline/empty-inline-on-empty-line-expected.txt
    A LayoutTests/fast/inline/empty-inline-on-empty-line.html
    M LayoutTests/platform/ios/css2.1/t0905-c414-flt-wrap-01-d-g-expected.txt
    M 
LayoutTests/platform/ios/editing/selection/selection-3748164-fix-expected.txt
    M LayoutTests/platform/ios/fast/css/word-space-extra-expected.txt
    M 
LayoutTests/platform/ios/fast/inline/continuation-outlines-with-layers-expected.txt
    M LayoutTests/platform/ios/tables/mozilla/bugs/bug2267-expected.txt
    M LayoutTests/platform/ios/tables/mozilla/bugs/bug26553-expected.txt
    M LayoutTests/platform/mac/css2.1/t0905-c414-flt-wrap-01-d-g-expected.txt
    M 
LayoutTests/platform/mac/editing/selection/selection-3748164-fix-expected.txt
    M LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt
    M LayoutTests/platform/mac/fast/encoding/utf-16-big-endian-expected.txt
    M LayoutTests/platform/mac/fast/encoding/utf-16-little-endian-expected.txt
    M 
LayoutTests/platform/mac/fast/inline/continuation-outlines-with-layers-expected.txt
    M LayoutTests/platform/mac/tables/mozilla/bugs/bug2267-expected.txt
    M LayoutTests/platform/mac/tables/mozilla/bugs/bug26553-expected.txt
    M 
Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
    M 
Source/WebCore/layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp
    M 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp

  Log Message:
  -----------
  [IFC] inline box reports incorrect offsetHeight when no content on line
https://bugs.webkit.org/show_bug.cgi?id=302442

Reviewed by Antti Koivisto.

In case when an empty inline box ends up on a line where there's no other 
content,
we fail to create a display box and report the containing block's position as 
offsetHeight.

e.g.
<div>
  content<br>
  <span id=empty-inline-box></span>
</div>

This content above generates 2 line boxes but the second line box
is missing the empty inline box as we only generate the root inline box here.
It essentially means we that when offsetHeight is called, we fail to find the 
associated
display box and fall back to the position of the root.

This is a relatively uncommon case but with [blocks-in-inline] it becomes more 
common
(e.g. <div><span><div>... where the first (empty) line has an empty inline box 
(span))

This change ensures that we construct display boxes for such empty inline boxes 
(on empty lines)
with height of 0.

* LayoutTests/fast/inline/empty-inline-on-empty-line-expected.txt: Added.
* LayoutTests/fast/inline/empty-inline-on-empty-line.html: Added.
* LayoutTests/platform/ios/css2.1/t0905-c414-flt-wrap-01-d-g-expected.txt:
* LayoutTests/platform/ios/editing/selection/selection-3748164-fix-expected.txt:
* LayoutTests/platform/ios/fast/css/word-space-extra-expected.txt:
* 
LayoutTests/platform/ios/fast/inline/continuation-outlines-with-layers-expected.txt:
* LayoutTests/platform/ios/tables/mozilla/bugs/bug2267-expected.txt:
* LayoutTests/platform/ios/tables/mozilla/bugs/bug26553-expected.txt:
* LayoutTests/platform/mac/css2.1/t0905-c414-flt-wrap-01-d-g-expected.txt:
* LayoutTests/platform/mac/editing/selection/selection-3748164-fix-expected.txt:
* LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt:
* LayoutTests/platform/mac/fast/encoding/utf-16-big-endian-expected.txt:
* LayoutTests/platform/mac/fast/encoding/utf-16-little-endian-expected.txt:
* 
LayoutTests/platform/mac/fast/inline/continuation-outlines-with-layers-expected.txt:
* LayoutTests/platform/mac/tables/mozilla/bugs/bug2267-expected.txt:
* LayoutTests/platform/mac/tables/mozilla/bugs/bug26553-expected.txt:
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::createDisplayContentForInlineContent):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::build):
* 
Source/WebCore/layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp:
(WebCore::Layout::LineBoxVerticalAligner::simplifiedVerticalAlignment const):
* 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::processNonBidiContent):

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



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

Reply via email to