Title: [288015] trunk
Revision
288015
Author
[email protected]
Date
2022-01-14 05:40:15 -0800 (Fri, 14 Jan 2022)

Log Message

[LFC][IFC] Incorrect root inline box position when non-empty atomic inline level child box has height: 0px
https://bugs.webkit.org/show_bug.cgi?id=235218
<rdar://84617690>

Reviewed by Antti Koivisto.

Source/WebCore:

Even if the atomic inline level box itself does not stetch the line box, it may still affect the root inline box position
through baseline "syncing" (This is mostly the case with 0 tall boxes as (non-empty) atomic inline boxes in general stretch the line box).

Test: fast/block/line-layout/non-empty-inline-block-with-zero-height.html

* layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp:
(WebCore::Layout::LineBoxVerticalAligner::computeRootInlineBoxVerticalPosition const):

LayoutTests:

* fast/block/line-layout/non-empty-inline-block-with-zero-height-expected.html: Added.
* fast/block/line-layout/non-empty-inline-block-with-zero-height.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (288014 => 288015)


--- trunk/LayoutTests/ChangeLog	2022-01-14 12:55:03 UTC (rev 288014)
+++ trunk/LayoutTests/ChangeLog	2022-01-14 13:40:15 UTC (rev 288015)
@@ -1,3 +1,14 @@
+2022-01-14  Alan Bujtas  <[email protected]>
+
+        [LFC][IFC] Incorrect root inline box position when non-empty atomic inline level child box has height: 0px
+        https://bugs.webkit.org/show_bug.cgi?id=235218
+        <rdar://84617690>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/block/line-layout/non-empty-inline-block-with-zero-height-expected.html: Added.
+        * fast/block/line-layout/non-empty-inline-block-with-zero-height.html: Added.
+
 2022-01-14  Antti Koivisto  <[email protected]>
 
         [:has() pseudo-class] Avoid O(n^2) in style invalidation with repeated DOM mutations

Added: trunk/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height-expected.html (0 => 288015)


--- trunk/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height-expected.html	2022-01-14 13:40:15 UTC (rev 288015)
@@ -0,0 +1,7 @@
+<style>
+div {
+  font-family: Ahem;
+  font-size: 50px;
+}
+</style>
+<div><span>XXX</span></div>

Added: trunk/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height.html (0 => 288015)


--- trunk/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height.html	2022-01-14 13:40:15 UTC (rev 288015)
@@ -0,0 +1,13 @@
+<style>
+div {
+  font-family: Ahem;
+  font-size: 20px;
+}
+
+span {
+  display: inline-block;
+  height: 0px;
+  font-size: 50px;
+}
+</style>
+<div><span>XXX</span></div>

Modified: trunk/Source/WebCore/ChangeLog (288014 => 288015)


--- trunk/Source/WebCore/ChangeLog	2022-01-14 12:55:03 UTC (rev 288014)
+++ trunk/Source/WebCore/ChangeLog	2022-01-14 13:40:15 UTC (rev 288015)
@@ -1,3 +1,19 @@
+2022-01-14  Alan Bujtas  <[email protected]>
+
+        [LFC][IFC] Incorrect root inline box position when non-empty atomic inline level child box has height: 0px
+        https://bugs.webkit.org/show_bug.cgi?id=235218
+        <rdar://84617690>
+
+        Reviewed by Antti Koivisto.
+
+        Even if the atomic inline level box itself does not stetch the line box, it may still affect the root inline box position
+        through baseline "syncing" (This is mostly the case with 0 tall boxes as (non-empty) atomic inline boxes in general stretch the line box).
+
+        Test: fast/block/line-layout/non-empty-inline-block-with-zero-height.html
+
+        * layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp:
+        (WebCore::Layout::LineBoxVerticalAligner::computeRootInlineBoxVerticalPosition const):
+
 2022-01-14  Chris Lord  <[email protected]>
 
         [GTK][WPE] Share code between NicosiaGCGLLayer+ANGLE and NicosiaImageBufferPipe

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp (288014 => 288015)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp	2022-01-14 12:55:03 UTC (rev 288014)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp	2022-01-14 13:40:15 UTC (rev 288015)
@@ -289,7 +289,9 @@
             }
         }
         inlineLevelBoxAbsoluteBaselineOffsetMap.add(&inlineLevelBox, absoluteBaselineOffset);
-        auto affectsRootInlineBoxVerticalPosition = formattingGeometry.inlineLevelBoxAffectsLineBox(inlineLevelBox, lineBox);
+
+        auto inlineLevelBoxStrechesLineBox = formattingGeometry.inlineLevelBoxAffectsLineBox(inlineLevelBox, lineBox);
+        auto affectsRootInlineBoxVerticalPosition = inlineLevelBoxStrechesLineBox || (inlineLevelBox.isAtomicInlineLevelBox() && inlineLevelBox.baseline());
         if (affectsRootInlineBoxVerticalPosition) {
             auto topOffsetFromRootInlineBoxBaseline = absoluteBaselineOffset + inlineLevelBox.layoutBounds().ascent;
             if (maximumTopOffsetFromRootInlineBoxBaseline)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to