Title: [282129] trunk
Revision
282129
Author
an...@apple.com
Date
2021-09-07 23:12:01 -0700 (Tue, 07 Sep 2021)

Log Message

Disable inline culling
https://bugs.webkit.org/show_bug.cgi?id=229993

Reviewed by Alan Bujtas.

LayoutTests/imported/w3c:

* web-platform-tests/css/cssom-view/cssom-getClientRects-002-expected.txt:
* web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt:
* web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt:

Source/WebCore:

Inline culling is an optimization that avoids creating LegacyInlineFlowBoxes for inline
elements under certain circumstances (basically if they don't affect rendering).

The optimization is is complex and requires a ton of code. It is a constant source of bugs.
Meanwhile the kind of content where this is beneficial is already mostly taken over by LFC.
It is time to remove it.

This patch disables the optimization but doesn't yet remove the code.

* editing/SimplifyMarkupCommand.cpp:
(WebCore::SimplifyMarkupCommand::doApply):
* rendering/LegacyEllipsisBox.cpp:
(WebCore::LegacyEllipsisBox::markupBox const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::mayAffectRendering const):
(WebCore::RenderInline::updateAlwaysCreateLineBoxes):
(WebCore::RenderInline::shouldCreateLineBoxes const): Deleted.
* rendering/RenderInline.h:
(WebCore::RenderInline::alwaysCreateLineBoxes const):
* rendering/RenderTreeAsText.cpp:
(WebCore::hasNonEmptySibling):

LayoutTests:

* fast/flexbox/line-clamp-link-after-ellipsis.html:
* platform/mac/fast/multicol/table-vertical-align-expected.txt:
* platform/mac/fast/multicol/vertical-lr/float-multicol-expected.txt:
* platform/mac/fast/multicol/vertical-rl/float-multicol-expected.txt:
* platform/mac/tables/mozilla/bugs/bug1188-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (282128 => 282129)


--- trunk/LayoutTests/ChangeLog	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/ChangeLog	2021-09-08 06:12:01 UTC (rev 282129)
@@ -1,3 +1,16 @@
+2021-09-07  Antti Koivisto  <an...@apple.com>
+
+        Disable inline culling
+        https://bugs.webkit.org/show_bug.cgi?id=229993
+
+        Reviewed by Alan Bujtas.
+
+        * fast/flexbox/line-clamp-link-after-ellipsis.html:
+        * platform/mac/fast/multicol/table-vertical-align-expected.txt:
+        * platform/mac/fast/multicol/vertical-lr/float-multicol-expected.txt:
+        * platform/mac/fast/multicol/vertical-rl/float-multicol-expected.txt:
+        * platform/mac/tables/mozilla/bugs/bug1188-expected.txt:
+
 2021-09-07  Fujii Hironori  <hironori.fu...@sony.com>
 
         [WinCairo] Support prefers-color-scheme media query

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (282128 => 282129)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-08 06:12:01 UTC (rev 282129)
@@ -1,3 +1,14 @@
+2021-09-07  Antti Koivisto  <an...@apple.com>
+
+        Disable inline culling
+        https://bugs.webkit.org/show_bug.cgi?id=229993
+
+        Reviewed by Alan Bujtas.
+
+        * web-platform-tests/css/cssom-view/cssom-getClientRects-002-expected.txt:
+        * web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt:
+        * web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt:
+
 2021-09-07  Simon Fraser  <simon.fra...@apple.com>
 
         Update the css-transforms/parsing WPT

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getClientRects-002-expected.txt (282128 => 282129)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getClientRects-002-expected.txt	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/cssom-getClientRects-002-expected.txt	2021-09-08 06:12:01 UTC (rev 282129)
@@ -1,5 +1,5 @@
 test test
 test test
 
-FAIL CSSOM View - GetClientRects().length is the same regardless source new lines assert_equals: count2 expected 1 but got 2
+PASS CSSOM View - GetClientRects().length is the same regardless source new lines
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt (282128 => 282129)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-mixed-font-sizes-expected.txt	2021-09-08 06:12:01 UTC (rev 282129)
@@ -1,7 +1,4 @@
 XXX small YYY
 
-FAIL document.elementFromPoint finds container SPAN in the empty region above a child SPAN with a smaller font size assert_equals: expected Element node <span id="target">
-    XXX <span id="small" style="font-s... but got Element node <div style="font-size: 40px">
-  <span id="target">
-    XX...
+PASS document.elementFromPoint finds container SPAN in the empty region above a child SPAN with a smaller font size
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt (282128 => 282129)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt	2021-09-08 06:12:01 UTC (rev 282129)
@@ -27,11 +27,11 @@
 PASS document.elementsFromPoint and shadow.elementsFromPoint must return the shadow host and its ancestors of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline
 PASS document.elementsFromPoint and shadow.elementsFromPoint must return the shadow host and its ancestors of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: block
 PASS document.elementsFromPoint and shadow.elementsFromPoint must return the shadow host and its ancestors of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline-block
-FAIL document.elementsFromPoint and shadowRoot.elementsFromPoint must return the shadow host and its ancestors when the hit-tested text node is assigned to a slot and the host has display: inline assert_array_equals: expected property 0 to be Element node <test-element style="display: inline;">text</test-element> but got Element node <slot></slot> (expected array [Element node <test-element style="display: inline;">text</test-element>, Element node <div id="container"><test-element style="display: inline;..., Element node <body>
+FAIL document.elementsFromPoint and shadowRoot.elementsFromPoint must return the shadow host and its ancestors when the hit-tested text node is assigned to a slot and the host has display: inline assert_array_equals: lengths differ, expected array [Element node <test-element style="display: inline;">text</test-element>, Element node <div id="container"><test-element style="display: inline;..., Element node <body>
     <div id="container"><test-element style="displ..., Element node <html><head>
-    <title>Shadow DOM and CSSOM View: Docume...] got [Element node <slot></slot>, Element node <div id="container"><test-element style="display: inline;..., Element node <body>
+    <title>Shadow DOM and CSSOM View: Docume...] length 4, got [Element node <slot></slot>, Element node <test-element style="display: inline;">text</test-element>, Element node <div id="container"><test-element style="display: inline;..., Element node <body>
     <div id="container"><test-element style="displ..., Element node <html><head>
-    <title>Shadow DOM and CSSOM View: Docume...])
+    <title>Shadow DOM and CSSOM View: Docume...] length 5
 FAIL document.elementsFromPoint and shadowRoot.elementsFromPoint must return the shadow host and its ancestors when the hit-tested text node is assigned to a slot and the host has display: block assert_array_equals: lengths differ, expected array [Element node <test-element style="display: block;">text</test-element>, Element node <div id="container"><test-element style="display: block;"..., Element node <body>
     <div id="container"><test-element style="displ..., Element node <html><head>
     <title>Shadow DOM and CSSOM View: Docume...] length 4, got [Element node <slot></slot>, Element node <test-element style="display: block;">text</test-element>, Element node <div id="container"><test-element style="display: block;"..., Element node <body>
@@ -45,11 +45,7 @@
 PASS document.elementsFromPoint and shadowRoot.elementsFromPoint must return the element assigned to a slot and its non-shadow ancestors when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: inline
 PASS document.elementsFromPoint and shadowRoot.elementsFromPoint must return the element assigned to a slot and its non-shadow ancestors when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: block
 PASS document.elementsFromPoint and shadowRoot.elementsFromPoint must return the element assigned to a slot and its non-shadow ancestors when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: inline-block
-FAIL document.elementsFromPoint must return the shadow host and its ancestors of the hit-tested element under a shadow root andshadowRoot.elementsFromPoint must return the element parent and its non-shadow ancestors of the hit-tested text node under the point when the shadow host has display: inline assert_array_equals: lengths differ, expected array [Element node <span>text</span>, Element node <test-element style="display: inline;"></test-element>, Element node <div id="container"><test-element style="display: inline;..., Element node <body>
-    <div id="container"><test-element style="displ..., Element node <html><head>
-    <title>Shadow DOM and CSSOM View: Docume...] length 5, got [Element node <span>text</span>, Element node <div id="container"><test-element style="display: inline;..., Element node <body>
-    <div id="container"><test-element style="displ..., Element node <html><head>
-    <title>Shadow DOM and CSSOM View: Docume...] length 4
+PASS document.elementsFromPoint must return the shadow host and its ancestors of the hit-tested element under a shadow root andshadowRoot.elementsFromPoint must return the element parent and its non-shadow ancestors of the hit-tested text node under the point when the shadow host has display: inline
 PASS document.elementsFromPoint must return the shadow host and its ancestors of the hit-tested element under a shadow root andshadowRoot.elementsFromPoint must return the element parent and its non-shadow ancestors of the hit-tested text node under the point when the shadow host has display: block
 PASS document.elementsFromPoint must return the shadow host and its ancestors of the hit-tested element under a shadow root andshadowRoot.elementsFromPoint must return the element parent and its non-shadow ancestors of the hit-tested text node under the point when the shadow host has display: inline-block
 PASS document.elementsFromPoint must return the shadow host and its ancestors and shadowRoot.elementsFromPoint must return the slot parent of the fallback text and its non-shadow ancestors when the hit-tested text node is a fallback content and the host has display: inline

Modified: trunk/LayoutTests/platform/mac/fast/multicol/table-vertical-align-expected.txt (282128 => 282129)


--- trunk/LayoutTests/platform/mac/fast/multicol/table-vertical-align-expected.txt	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/platform/mac/fast/multicol/table-vertical-align-expected.txt	2021-09-08 06:12:01 UTC (rev 282129)
@@ -269,7 +269,7 @@
               text run at (11,1097) width 46: "of text."
             RenderBR {BR} at (56,1097) size 1x18
           RenderTableCell {TD} at (142,478) size 233x207 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
-            RenderInline {SPAN} at (0,0) size 146x183
+            RenderInline {SPAN} at (0,0) size 146x184
               RenderText {#text} at (11,10) size 146x185
                 text run at (11,11) width 146: "Other"
                 text run at (11,121) width 109: "cell."

Modified: trunk/LayoutTests/platform/mac/fast/multicol/vertical-lr/float-multicol-expected.txt (282128 => 282129)


--- trunk/LayoutTests/platform/mac/fast/multicol/vertical-lr/float-multicol-expected.txt	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/platform/mac/fast/multicol/vertical-lr/float-multicol-expected.txt	2021-09-08 06:12:01 UTC (rev 282129)
@@ -146,7 +146,7 @@
             text run at (288,291) width 118: "you downloaded a"
             text run at (306,291) width 70: "build with "
             text run at (306,360) width 63: "Talkback,"
-          RenderInline {EM} at (0,0) size 18x106
+          RenderInline {EM} at (0,0) size 19x106
             RenderText {#text} at (324,291) size 19x106
               text run at (324,291) width 46: "please "
               text run at (324,336) width 60: "turn it on"
@@ -162,7 +162,7 @@
             text run at (414,0) width 285: "them. And all you have to do is click \"OK\". "
             text run at (414,284) width 139: "If you find something"
             text run at (432,0) width 317: "you think is a bug, check to see if it's not already "
-          RenderInline {A} at (0,0) size 18x84 [color=#0000EE]
+          RenderInline {A} at (0,0) size 19x84 [color=#0000EE]
             RenderText {#text} at (432,316) size 19x84
               text run at (432,316) width 84: "known about"
           RenderText {#text} at (432,399) size 37x431
@@ -169,7 +169,7 @@
             text run at (432,399) width 32: ", and"
             text run at (450,0) width 76: "then please "
             text run at (450,75) width 70: "follow the "
-          RenderInline {A} at (0,0) size 18x169 [color=#0000EE]
+          RenderInline {A} at (0,0) size 19x169 [color=#0000EE]
             RenderText {#text} at (450,144) size 19x169
               text run at (450,144) width 169: "bug submission procedure"
           RenderText {#text} at (450,312) size 19x5

Modified: trunk/LayoutTests/platform/mac/fast/multicol/vertical-rl/float-multicol-expected.txt (282128 => 282129)


--- trunk/LayoutTests/platform/mac/fast/multicol/vertical-rl/float-multicol-expected.txt	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/platform/mac/fast/multicol/vertical-rl/float-multicol-expected.txt	2021-09-08 06:12:01 UTC (rev 282129)
@@ -146,7 +146,7 @@
             text run at (288,291) width 118: "you downloaded a"
             text run at (306,291) width 70: "build with "
             text run at (306,360) width 63: "Talkback,"
-          RenderInline {EM} at (0,0) size 18x106
+          RenderInline {EM} at (0,0) size 19x106
             RenderText {#text} at (324,291) size 19x106
               text run at (324,291) width 46: "please "
               text run at (324,336) width 60: "turn it on"
@@ -162,7 +162,7 @@
             text run at (414,0) width 285: "them. And all you have to do is click \"OK\". "
             text run at (414,284) width 139: "If you find something"
             text run at (432,0) width 317: "you think is a bug, check to see if it's not already "
-          RenderInline {A} at (0,0) size 18x84 [color=#0000EE]
+          RenderInline {A} at (0,0) size 19x84 [color=#0000EE]
             RenderText {#text} at (432,316) size 19x84
               text run at (432,316) width 84: "known about"
           RenderText {#text} at (432,399) size 37x431
@@ -169,7 +169,7 @@
             text run at (432,399) width 32: ", and"
             text run at (450,0) width 76: "then please "
             text run at (450,75) width 70: "follow the "
-          RenderInline {A} at (0,0) size 18x169 [color=#0000EE]
+          RenderInline {A} at (0,0) size 19x169 [color=#0000EE]
             RenderText {#text} at (450,144) size 19x169
               text run at (450,144) width 169: "bug submission procedure"
           RenderText {#text} at (450,312) size 19x5

Modified: trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug1188-expected.txt (282128 => 282129)


--- trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug1188-expected.txt	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug1188-expected.txt	2021-09-08 06:12:01 UTC (rev 282129)
@@ -13,8 +13,8 @@
                 RenderText {#text} at (0,0) size 0x0
             RenderTableRow {TR} at (0,48) size 600x55
               RenderTableCell {TD} at (2,55) size 595x41 [bgcolor=#99CCCC] [r=1 c=0 rs=1 cs=3]
-                RenderInline {FONT} at (0,0) size 128x15
-                  RenderInline {B} at (0,0) size 128x15
+                RenderInline {FONT} at (0,0) size 128x16
+                  RenderInline {B} at (0,0) size 128x16
                     RenderText {#text} at (48,4) size 128x17
                       text run at (48,5) width 128: "Search the Web with"
                 RenderText {#text} at (175,2) size 5x20
@@ -31,17 +31,17 @@
                     RenderText at (0,0) size 37x13
                       text run at (0,0) width 37: "Search"
                 RenderBR {BR} at (545,2) size 1x20
-                RenderInline {SMALL} at (0,0) size 554x15
-                  RenderInline {A} at (0,0) size 98x15 [color=#0000EE]
+                RenderInline {SMALL} at (0,0) size 554x16
+                  RenderInline {A} at (0,0) size 98x16 [color=#0000EE]
                     RenderText {#text} at (20,23) size 98x17
                       text run at (20,24) width 98: "Classifieds< /A>   "
-                  RenderInline {A} at (0,0) size 58x15 [color=#0000EE]
+                  RenderInline {A} at (0,0) size 58x16 [color=#0000EE]
                     RenderText {#text} at (117,23) size 58x17
                       text run at (117,24) width 23: "Net "
                       text run at (139,24) width 36: "Search"
                   RenderText {#text} at (174,23) size 11x17
                     text run at (174,24) width 11: "   "
-                  RenderInline {A} at (0,0) size 80x15 [color=#0000EE]
+                  RenderInline {A} at (0,0) size 80x16 [color=#0000EE]
                     RenderText {#text} at (184,23) size 80x17
                       text run at (184,24) width 55: "Find Web "
                       text run at (238,24) width 26: "Sites"
@@ -48,23 +48,23 @@
                   RenderText {#text} at (263,23) size 11x17
                     text run at (263,24) width 5: " "
                     text run at (267,24) width 7: "  "
-                  RenderInline {A} at (0,0) size 65x15 [color=#0000EE]
+                  RenderInline {A} at (0,0) size 65x16 [color=#0000EE]
                     RenderText {#text} at (273,23) size 65x17
                       text run at (273,24) width 40: "What's "
                       text run at (312,24) width 26: "Cool"
                   RenderText {#text} at (337,23) size 11x17
                     text run at (337,24) width 11: "   "
-                  RenderInline {A} at (0,0) size 64x15 [color=#0000EE]
+                  RenderInline {A} at (0,0) size 64x16 [color=#0000EE]
                     RenderText {#text} at (347,23) size 64x17
                       text run at (347,24) width 64: "What's New"
                   RenderText {#text} at (410,23) size 11x17
                     text run at (410,24) width 11: "   "
-                  RenderInline {A} at (0,0) size 74x15 [color=#0000EE]
+                  RenderInline {A} at (0,0) size 74x16 [color=#0000EE]
                     RenderText {#text} at (420,23) size 74x17
                       text run at (420,24) width 74: "People Finder"
                   RenderText {#text} at (493,23) size 10x17
                     text run at (493,24) width 10: "   "
-                  RenderInline {A} at (0,0) size 72x15 [color=#0000EE]
+                  RenderInline {A} at (0,0) size 72x16 [color=#0000EE]
                     RenderText {#text} at (502,23) size 72x17
                       text run at (502,24) width 72: "Yellow Pages"
                   RenderText {#text} at (0,0) size 0x0

Modified: trunk/Source/WebCore/ChangeLog (282128 => 282129)


--- trunk/Source/WebCore/ChangeLog	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/Source/WebCore/ChangeLog	2021-09-08 06:12:01 UTC (rev 282129)
@@ -1,3 +1,32 @@
+2021-09-07  Antti Koivisto  <an...@apple.com>
+
+        Disable inline culling
+        https://bugs.webkit.org/show_bug.cgi?id=229993
+
+        Reviewed by Alan Bujtas.
+
+        Inline culling is an optimization that avoids creating LegacyInlineFlowBoxes for inline
+        elements under certain circumstances (basically if they don't affect rendering).
+
+        The optimization is is complex and requires a ton of code. It is a constant source of bugs.
+        Meanwhile the kind of content where this is beneficial is already mostly taken over by LFC.
+        It is time to remove it.
+
+        This patch disables the optimization but doesn't yet remove the code.
+
+        * editing/SimplifyMarkupCommand.cpp:
+        (WebCore::SimplifyMarkupCommand::doApply):
+        * rendering/LegacyEllipsisBox.cpp:
+        (WebCore::LegacyEllipsisBox::markupBox const):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::mayAffectRendering const):
+        (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
+        (WebCore::RenderInline::shouldCreateLineBoxes const): Deleted.
+        * rendering/RenderInline.h:
+        (WebCore::RenderInline::alwaysCreateLineBoxes const):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::hasNonEmptySibling):
+
 2021-09-07  Alex Christensen  <achristen...@webkit.org>
 
         Fix iOS debug build, probably after r282115

Modified: trunk/Source/WebCore/editing/SimplifyMarkupCommand.cpp (282128 => 282129)


--- trunk/Source/WebCore/editing/SimplifyMarkupCommand.cpp	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/Source/WebCore/editing/SimplifyMarkupCommand.cpp	2021-09-08 06:12:01 UTC (rev 282129)
@@ -71,7 +71,7 @@
                 break;
 
             auto* renderer = currentNode->renderer();
-            if (!is<RenderInline>(renderer) || downcast<RenderInline>(*renderer).alwaysCreateLineBoxes())
+            if (!is<RenderInline>(renderer) || downcast<RenderInline>(*renderer).mayAffectRendering())
                 continue;
             
             if (currentNode->firstChild() != currentNode->lastChild()) {

Modified: trunk/Source/WebCore/rendering/LegacyEllipsisBox.cpp (282128 => 282129)


--- trunk/Source/WebCore/rendering/LegacyEllipsisBox.cpp	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/Source/WebCore/rendering/LegacyEllipsisBox.cpp	2021-09-08 06:12:01 UTC (rev 282129)
@@ -93,7 +93,7 @@
 
     // If the last line-box on the last line of a block is a link, -webkit-line-clamp paints that box after the ellipsis.
     // It does not actually move the link.
-    LegacyInlineBox* anchorBox = lastLine->lastChild();
+    LegacyInlineBox* anchorBox = lastLine->lastLeafDescendant();
     if (!anchorBox || !anchorBox->renderer().style().isLink())
         return 0;
 

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (282128 => 282129)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2021-09-08 06:12:01 UTC (rev 282129)
@@ -207,7 +207,7 @@
 #endif
 }
 
-bool RenderInline::shouldCreateLineBoxes() const
+bool RenderInline::mayAffectRendering() const
 {
     // Test if we can get away with culling.
     auto* parentStyle = &parent()->style();
@@ -214,7 +214,7 @@
     RenderInline* parentRenderInline = is<RenderInline>(*parent()) ? downcast<RenderInline>(parent()) : nullptr;
     auto hasHardLineBreakChildOnly = firstChild() && firstChild() == lastChild() && firstChild()->isBR();
     bool checkFonts = document().inNoQuirksMode();
-    auto needsLineBoxes = (parentRenderInline && parentRenderInline->alwaysCreateLineBoxes())
+    auto mayAffectRendering = (parentRenderInline && parentRenderInline->mayAffectRendering())
         || (parentRenderInline && parentStyle->verticalAlign() != VerticalAlign::Baseline)
         || style().verticalAlign() != VerticalAlign::Baseline
         || style().textEmphasisMark() != TextEmphasisMark::None
@@ -222,15 +222,15 @@
         || parentStyle->lineHeight() != style().lineHeight()))
         || hasHardLineBreakChildOnly;
 
-    if (!needsLineBoxes && checkFonts && view().usesFirstLineRules()) {
+    if (!mayAffectRendering && checkFonts && view().usesFirstLineRules()) {
         // Have to check the first line style as well.
         parentStyle = &parent()->firstLineStyle();
         auto& childStyle = firstLineStyle();
-        needsLineBoxes = !parentStyle->fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.fontCascade().fontMetrics())
+        mayAffectRendering = !parentStyle->fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.fontCascade().fontMetrics())
             || childStyle.verticalAlign() != VerticalAlign::Baseline
             || parentStyle->lineHeight() != childStyle.lineHeight();
     }
-    return needsLineBoxes;
+    return mayAffectRendering;
 }
 
 void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout)
@@ -237,7 +237,7 @@
 {
     // Once we have been tainted once, just assume it will happen again. This way effects like hover highlighting that change the
     // background color will only cause a layout on the first rollover.
-    if (alwaysCreateLineBoxes() || !shouldCreateLineBoxes())
+    if (alwaysCreateLineBoxes() || !mayAffectRendering())
         return;
 
     setAlwaysCreateLineBoxes();

Modified: trunk/Source/WebCore/rendering/RenderInline.h (282128 => 282129)


--- trunk/Source/WebCore/rendering/RenderInline.h	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/Source/WebCore/rendering/RenderInline.h	2021-09-08 06:12:01 UTC (rev 282129)
@@ -82,9 +82,9 @@
     void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) final;
     void paintOutline(PaintInfo&, const LayoutPoint&);
 
-    bool alwaysCreateLineBoxes() const { return renderInlineAlwaysCreatesLineBoxes(); }
+    bool alwaysCreateLineBoxes() const { return true; }
     void setAlwaysCreateLineBoxes() { setRenderInlineAlwaysCreatesLineBoxes(true); }
-    bool shouldCreateLineBoxes() const;
+    bool mayAffectRendering() const;
     void updateAlwaysCreateLineBoxes(bool fullLayout);
 
     bool hitTestCulledInline(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset);

Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (282128 => 282129)


--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2021-09-08 04:57:37 UTC (rev 282128)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2021-09-08 06:12:01 UTC (rev 282129)
@@ -202,7 +202,7 @@
         if (!is<RenderInline>(sibling))
             return true;
         auto& siblingRendererInline = downcast<RenderInline>(sibling);
-        if (siblingRendererInline.shouldCreateLineBoxes() || !isRenderInlineEmpty(siblingRendererInline))
+        if (siblingRendererInline.mayAffectRendering() || !isRenderInlineEmpty(siblingRendererInline))
             return true;
     }
     return false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to