Title: [291330] trunk
Revision
291330
Author
za...@apple.com
Date
2022-03-15 21:11:41 -0700 (Tue, 15 Mar 2022)

Log Message

REGRESSION (r282737): `text-shadow` is clipped
https://bugs.webkit.org/show_bug.cgi?id=237898
<rdar://problem/90320701>

Reviewed by Darin Adler.

Source/WebCore:

Inflate the ink overflow rect with the text shadow values (note that here, in the display builder we work with physical coordinates).

Test: fast/text/text-shadow-ink-overflow-missing.html

* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::getTextShadowHorizontalExtent const):
(WebCore::RenderStyle::getTextShadowVerticalExtent const):

LayoutTests:

* fast/text/text-shadow-ink-overflow-missing-expected.html: Added.
* fast/text/text-shadow-ink-overflow-missing.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (291329 => 291330)


--- trunk/LayoutTests/ChangeLog	2022-03-16 04:06:29 UTC (rev 291329)
+++ trunk/LayoutTests/ChangeLog	2022-03-16 04:11:41 UTC (rev 291330)
@@ -1,3 +1,14 @@
+2022-03-15  Alan Bujtas  <za...@apple.com>
+
+        REGRESSION (r282737): `text-shadow` is clipped
+        https://bugs.webkit.org/show_bug.cgi?id=237898
+        <rdar://problem/90320701>
+
+        Reviewed by Darin Adler.
+
+        * fast/text/text-shadow-ink-overflow-missing-expected.html: Added.
+        * fast/text/text-shadow-ink-overflow-missing.html: Added.
+
 2022-03-15  Jean-Yves Avenard  <j...@apple.com>
 
         REGRESSION(r287249): [ Monterey wk2 ] media/media-source/media-webm-vorbis-partial.html is a constant text failure

Added: trunk/LayoutTests/fast/text/text-shadow-ink-overflow-missing-expected.html (0 => 291330)


--- trunk/LayoutTests/fast/text/text-shadow-ink-overflow-missing-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/text-shadow-ink-overflow-missing-expected.html	2022-03-16 04:11:41 UTC (rev 291330)
@@ -0,0 +1,9 @@
+<style>
+div {
+  font-size: 20px;
+  text-shadow: 0px 100px 1px black;
+  font-family: Ahem;
+  will-change: transform;
+}
+</style>
+<div>PASS if this line is doubled.</div>

Added: trunk/LayoutTests/fast/text/text-shadow-ink-overflow-missing.html (0 => 291330)


--- trunk/LayoutTests/fast/text/text-shadow-ink-overflow-missing.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/text-shadow-ink-overflow-missing.html	2022-03-16 04:11:41 UTC (rev 291330)
@@ -0,0 +1,26 @@
+<style>
+.wrapper {
+  position: relative;
+  font-family: Ahem;
+}
+
+.shadow {
+  position: relative;
+  z-index: 1;
+  font-size: 20px;
+  text-shadow: 0px 100px 1px black;
+}
+
+.absolute {
+  position: absolute;
+  left: 0;
+  top: 0;
+  will-change: transform;
+}
+</style>
+
+<div class="wrapper">
+  <div class="shadow">PASS if this line is doubled.</div>
+  <div class="absolute"></div>
+</div>
+

Modified: trunk/Source/WebCore/ChangeLog (291329 => 291330)


--- trunk/Source/WebCore/ChangeLog	2022-03-16 04:06:29 UTC (rev 291329)
+++ trunk/Source/WebCore/ChangeLog	2022-03-16 04:11:41 UTC (rev 291330)
@@ -1,3 +1,21 @@
+2022-03-15  Alan Bujtas  <za...@apple.com>
+
+        REGRESSION (r282737): `text-shadow` is clipped
+        https://bugs.webkit.org/show_bug.cgi?id=237898
+        <rdar://problem/90320701>
+
+        Reviewed by Darin Adler.
+
+        Inflate the ink overflow rect with the text shadow values (note that here, in the display builder we work with physical coordinates).
+
+        Test: fast/text/text-shadow-ink-overflow-missing.html
+
+        * layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
+        (WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::getTextShadowHorizontalExtent const):
+        (WebCore::RenderStyle::getTextShadowVerticalExtent const):
+
 2022-03-15  Diego Pino Garcia  <dp...@igalia.com>
 
         [GLIB] REGRESSION(r291257): Unreviewed, fix build when using ATK

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp (291329 => 291330)


--- trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp	2022-03-16 04:06:29 UTC (rev 291329)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp	2022-03-16 04:11:41 UTC (rev 291330)
@@ -135,6 +135,7 @@
             : formattingState().layoutState().geometryForBox(layoutBox.initialContainingBlock()).contentBox().size();
         auto strokeOverflow = ceilf(style.computedStrokeWidth(ceiledIntSize(initialContaingBlockSize)));
         auto inkOverflow = textRunRect;
+
         inkOverflow.inflate(strokeOverflow);
         auto letterSpacing = style.fontCascade().letterSpacing();
         if (letterSpacing < 0) {
@@ -141,6 +142,10 @@
             // Last letter's negative spacing shrinks logical rect. Push it to ink overflow.
             inkOverflow.expand(-letterSpacing, { });
         }
+
+        auto textShadow = style.textShadowExtent();
+        inkOverflow.inflate(-textShadow.top(), textShadow.right(), textShadow.bottom(), -textShadow.left());
+
         return inkOverflow;
     };
     auto content = downcast<InlineTextBox>(layoutBox).content();

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (291329 => 291330)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-16 04:06:29 UTC (rev 291329)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-16 04:11:41 UTC (rev 291330)
@@ -505,6 +505,7 @@
 
     float outlineOffset() const;
     const ShadowData* textShadow() const { return m_rareInheritedData->textShadow.get(); }
+    LayoutBoxExtent textShadowExtent() const { return shadowExtent(textShadow()); }
     void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
     void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to