Title: [277325] trunk
Revision
277325
Author
[email protected]
Date
2021-05-11 08:33:13 -0700 (Tue, 11 May 2021)

Log Message

REGRESSION(r275515): wpt/quirks/blocks-ignore-line-height.html
https://bugs.webkit.org/show_bug.cgi?id=225591
<rdar://problem/77766308>

Reviewed by Antti Koivisto.

Source/WebCore:

Replace the generic line height quirk with a list-item specific one.
The original quirk was added to cover fast/lists/list-item-line-height.html but it looks like
it only needs a list-item specific quirk. This is copied from legacy line layout (see InlineFlowBox c'tor).

Test: fast/inline/line-height-in-non-standards-mode.html

* layout/formattingContexts/inline/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::inlineLevelBoxAffectsLineBox const):
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::rootBoxStyle):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isOriginalDisplayListItemType const):
(WebCore::RenderStyle::isDisplayListItemType):

LayoutTests:

* fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html: progression.
* fast/inline/line-height-in-non-standards-mode-expected.html: Added.
* fast/inline/line-height-in-non-standards-mode.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (277324 => 277325)


--- trunk/LayoutTests/ChangeLog	2021-05-11 14:55:53 UTC (rev 277324)
+++ trunk/LayoutTests/ChangeLog	2021-05-11 15:33:13 UTC (rev 277325)
@@ -1,3 +1,15 @@
+2021-05-11  Zalan Bujtas  <[email protected]>
+
+        REGRESSION(r275515): wpt/quirks/blocks-ignore-line-height.html
+        https://bugs.webkit.org/show_bug.cgi?id=225591
+        <rdar://problem/77766308>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html: progression.
+        * fast/inline/line-height-in-non-standards-mode-expected.html: Added.
+        * fast/inline/line-height-in-non-standards-mode.html: Added.
+
 2021-05-11  Cathie Chen  <[email protected]>
 
         [CSS contain] Support contain:size

Modified: trunk/LayoutTests/fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html (277324 => 277325)


--- trunk/LayoutTests/fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html	2021-05-11 14:55:53 UTC (rev 277324)
+++ trunk/LayoutTests/fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html	2021-05-11 15:33:13 UTC (rev 277325)
@@ -3,7 +3,7 @@
   font-family: Ahem;
   font-size: 20px;
   background-color: green;
-  height: 112px;
+  height: 110px;
   padding-top: 90px; 
 }
 </style>

Added: trunk/LayoutTests/fast/inline/line-height-in-non-standards-mode-expected.html (0 => 277325)


--- trunk/LayoutTests/fast/inline/line-height-in-non-standards-mode-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/line-height-in-non-standards-mode-expected.html	2021-05-11 15:33:13 UTC (rev 277325)
@@ -0,0 +1,8 @@
+<style>
+div {
+  width: 200px;
+  height: 250px;
+  background-color: green;
+}
+</style>
+<div></div>

Added: trunk/LayoutTests/fast/inline/line-height-in-non-standards-mode.html (0 => 277325)


--- trunk/LayoutTests/fast/inline/line-height-in-non-standards-mode.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/line-height-in-non-standards-mode.html	2021-05-11 15:33:13 UTC (rev 277325)
@@ -0,0 +1,11 @@
+<style>
+div {
+  line-height: 10;
+  width: 200px;
+  font-family: Ahem;
+  font-size: 50px;
+  background-color: green;
+  color: green;
+}
+</style>
+<div><span style="font-size: 50%">X</span></div>

Modified: trunk/Source/WebCore/ChangeLog (277324 => 277325)


--- trunk/Source/WebCore/ChangeLog	2021-05-11 14:55:53 UTC (rev 277324)
+++ trunk/Source/WebCore/ChangeLog	2021-05-11 15:33:13 UTC (rev 277325)
@@ -1,5 +1,27 @@
 2021-05-11  Zalan Bujtas  <[email protected]>
 
+        REGRESSION(r275515): wpt/quirks/blocks-ignore-line-height.html
+        https://bugs.webkit.org/show_bug.cgi?id=225591
+        <rdar://problem/77766308>
+
+        Reviewed by Antti Koivisto.
+
+        Replace the generic line height quirk with a list-item specific one.
+        The original quirk was added to cover fast/lists/list-item-line-height.html but it looks like
+        it only needs a list-item specific quirk. This is copied from legacy line layout (see InlineFlowBox c'tor).
+
+        Test: fast/inline/line-height-in-non-standards-mode.html
+
+        * layout/formattingContexts/inline/InlineFormattingContextQuirks.cpp:
+        (WebCore::Layout::InlineFormattingContext::Quirks::inlineLevelBoxAffectsLineBox const):
+        * layout/integration/LayoutIntegrationBoxTree.cpp:
+        (WebCore::LayoutIntegration::rootBoxStyle):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::isOriginalDisplayListItemType const):
+        (WebCore::RenderStyle::isDisplayListItemType):
+
+2021-05-11  Zalan Bujtas  <[email protected]>
+
         [LFC][Integration] Disable IFC when inline level box has box shadow
         https://bugs.webkit.org/show_bug.cgi?id=225634
 

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContextQuirks.cpp (277324 => 277325)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContextQuirks.cpp	2021-05-11 14:55:53 UTC (rev 277324)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContextQuirks.cpp	2021-05-11 15:33:13 UTC (rev 277325)
@@ -73,23 +73,13 @@
         if (inlineLevelBox.hasContent() || inlineBoxHasImaginaryStrut)
             return true;
         if (inlineLevelBox.isRootInlineBox()) {
-            auto shouldRootInlineBoxWithNoContentStretchLineBox = [&] {
-                if (inlineLevelBox.layoutBox().style().lineHeight().isNegative())
-                    return false;
-                // The root inline box with non-initial line height value stretches the line box even when root has no content
-                // but there's at least one inline box with content.
-                // e.g. <div style="line-height: 100px;"><span>content</span></div>
-                if (!lineBox.hasInlineBox())
-                    return false;
-                for (auto& inlineLevelBox : lineBox.nonRootInlineLevelBoxes()) {
-                    if (!inlineLevelBox.isInlineBox())
-                        continue;
-                    if (inlineLevelBox.hasContent())
-                        return true;
-                }
-                return false;
-            };
-            return shouldRootInlineBoxWithNoContentStretchLineBox();
+            // This root inline box has no direct text content and we are in non-standards mode.
+            // Now according to legacy line layout, we need to apply the following list-item specific quirk:
+            // We do not create markers for list items when the list-style-type is none, while other browsers do.
+            // The side effect of having no marker is that in quirks mode we have to specifically check for list-item
+            // and make sure it is treated as if it had content and stretched the line.
+            // see InlineFlowBox c'tor.
+            return inlineLevelBox.layoutBox().style().isOriginalDisplayListItemType();
         }
         // Non-root inline boxes (e.g. <span>).
         auto& boxGeometry = formattingContext().geometryForBox(inlineLevelBox.layoutBox());

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp (277324 => 277325)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2021-05-11 14:55:53 UTC (rev 277324)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2021-05-11 15:33:13 UTC (rev 277325)
@@ -46,7 +46,7 @@
 static RenderStyle rootBoxStyle(const RenderStyle& style)
 {
     auto clonedStyle = RenderStyle::clone(style);
-    clonedStyle.setDisplay(DisplayType::Block);
+    clonedStyle.setEffectiveDisplay(DisplayType::Block);
     return clonedStyle;
 }
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (277324 => 277325)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2021-05-11 14:55:53 UTC (rev 277324)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2021-05-11 15:33:13 UTC (rev 277325)
@@ -1500,6 +1500,7 @@
     bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); }
     bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleOrGridBox(display()); }
     bool isDisplayRegionType() const;
+    bool isOriginalDisplayListItemType() const { return isDisplayListItemType(originalDisplay()); }
 
     bool setWritingMode(WritingMode);
 
@@ -1965,6 +1966,7 @@
     static bool isDisplayFlexibleBox(DisplayType);
     static bool isDisplayGridBox(DisplayType);
     static bool isDisplayFlexibleOrGridBox(DisplayType);
+    static bool isDisplayListItemType(DisplayType);
 
     static LayoutBoxExtent shadowExtent(const ShadowData*);
     static LayoutBoxExtent shadowInsetExtent(const ShadowData*);
@@ -2368,6 +2370,11 @@
     return isDisplayFlexibleBox(display) || isDisplayGridBox(display);
 }
 
+inline bool RenderStyle::isDisplayListItemType(DisplayType display)
+{
+    return display == DisplayType::ListItem;
+}
+
 inline bool RenderStyle::hasAnyPublicPseudoStyles() const
 {
     return m_nonInheritedFlags.hasAnyPublicPseudoStyles();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to