Title: [288503] branches/safari-613-branch
Revision
288503
Author
[email protected]
Date
2022-01-24 17:55:10 -0800 (Mon, 24 Jan 2022)

Log Message

Cherry-pick r288015. rdar://problem/84617690

    [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.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-613-branch/LayoutTests/ChangeLog (288502 => 288503)


--- branches/safari-613-branch/LayoutTests/ChangeLog	2022-01-25 01:55:06 UTC (rev 288502)
+++ branches/safari-613-branch/LayoutTests/ChangeLog	2022-01-25 01:55:10 UTC (rev 288503)
@@ -1,5 +1,44 @@
 2022-01-24  Alan Coon  <[email protected]>
 
+        Cherry-pick r288015. rdar://problem/84617690
+
+    [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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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-24  Alan Coon  <[email protected]>
+
         Cherry-pick r288012. rdar://problem/87397176
 
     [:has() pseudo-class] Avoid O(n^2) in style invalidation with repeated DOM mutations

Added: branches/safari-613-branch/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height-expected.html (0 => 288503)


--- branches/safari-613-branch/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height-expected.html	                        (rev 0)
+++ branches/safari-613-branch/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height-expected.html	2022-01-25 01:55:10 UTC (rev 288503)
@@ -0,0 +1,7 @@
+<style>
+div {
+  font-family: Ahem;
+  font-size: 50px;
+}
+</style>
+<div><span>XXX</span></div>

Added: branches/safari-613-branch/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height.html (0 => 288503)


--- branches/safari-613-branch/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height.html	                        (rev 0)
+++ branches/safari-613-branch/LayoutTests/fast/block/line-layout/non-empty-inline-block-with-zero-height.html	2022-01-25 01:55:10 UTC (rev 288503)
@@ -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: branches/safari-613-branch/Source/WebCore/ChangeLog (288502 => 288503)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-01-25 01:55:06 UTC (rev 288502)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-01-25 01:55:10 UTC (rev 288503)
@@ -1,5 +1,49 @@
 2022-01-24  Alan Coon  <[email protected]>
 
+        Cherry-pick r288015. rdar://problem/84617690
+
+    [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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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-24  Alan Coon  <[email protected]>
+
         Cherry-pick r288012. rdar://problem/87397176
 
     [:has() pseudo-class] Avoid O(n^2) in style invalidation with repeated DOM mutations

Modified: branches/safari-613-branch/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp (288502 => 288503)


--- branches/safari-613-branch/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp	2022-01-25 01:55:06 UTC (rev 288502)
+++ branches/safari-613-branch/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp	2022-01-25 01:55:10 UTC (rev 288503)
@@ -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