Fix color-filter to apply to text decorations
https://bugs.webkit.org/show_bug.cgi?id=185068
<rdar://problem/39782136>

Reviewed by Alan Bujtas.
Source/WebCore:

Transform the colors of text shadows, and the shadows of text-decorations through
the color-filter.

Rather than clone the ShadowData stored on TextPainter and TextDecorationPainter
(which would have awkward ownership implications) we pass the color filters through
and just map the color through it before painting.

Re-order the members of TextPainter a little to optimize padding.

Also fix a bug where FilterOperations::transformColor() could transform an invalid
color to a valid one; we never want this.

Tests: css3/color-filters/color-filter-text-decoration-shadow.html
       css3/color-filters/color-filter-text-shadow.html

* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/TextDecorationPainter.h:
(WebCore::TextDecorationPainter::setTextShadow):
(WebCore::TextDecorationPainter::setShadowColorFilter):
(WebCore::TextDecorationPainter::addTextShadow): Deleted.
* rendering/TextPainter.cpp:
(WebCore::ShadowApplier::ShadowApplier):
(WebCore::TextPainter::paintTextWithShadows):
(WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): Simplify the logic that only paints the shadow
on the first iteration.
(WebCore::TextPainter::paintRange):
* rendering/TextPainter.h:
(WebCore::TextPainter::setShadowColorFilter):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintTextWithShadows):

LayoutTests:

* css3/color-filters/color-filter-text-decoration-shadow-expected.html: Added.
* css3/color-filters/color-filter-text-decoration-shadow.html: Added.
* css3/color-filters/color-filter-text-shadow-expected.html: Added.
* css3/color-filters/color-filter-text-shadow.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@231100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3511f77..df35aec 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2018-04-26  Simon Fraser  <simon.fraser@apple.com>
+
+        Fix color-filter to apply to text decorations
+        https://bugs.webkit.org/show_bug.cgi?id=185068
+        <rdar://problem/39782136>
+
+        Reviewed by Alan Bujtas.
+
+        * css3/color-filters/color-filter-text-decoration-shadow-expected.html: Added.
+        * css3/color-filters/color-filter-text-decoration-shadow.html: Added.
+        * css3/color-filters/color-filter-text-shadow-expected.html: Added.
+        * css3/color-filters/color-filter-text-shadow.html: Added.
+
 2018-04-27  Per Arne Vollan  <pvollan@apple.com>
 
         Mark CSS color filters tests as failing on Windows.
diff --git a/LayoutTests/css3/color-filters/color-filter-text-decoration-shadow-expected.html b/LayoutTests/css3/color-filters/color-filter-text-decoration-shadow-expected.html
new file mode 100644
index 0000000..5727a38
--- /dev/null
+++ b/LayoutTests/css3/color-filters/color-filter-text-decoration-shadow-expected.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>CSS Test: color-filter reference</title>
+        <link rel="author" title="Apple" href="http://www.apple.com/">
+
+        <style type="text/css">
+            .test
+            {
+				font: 120px sans-serif;
+				color: green;
+				margin: 100px 20px;
+				text-decoration: underline overline line-through;
+            }
+
+            .single
+            {
+				text-shadow: 150px 0 0 yellow;
+            }
+
+            .multiple
+            {
+				text-shadow: 150px 0 0 yellow, 300px 0 0 cyan;
+            }
+        </style>
+    </head>
+    <body>
+        <div class="test single">O</div>
+        <div class="test multiple">O</div>
+    </body>
+</html>
diff --git a/LayoutTests/css3/color-filters/color-filter-text-decoration-shadow.html b/LayoutTests/css3/color-filters/color-filter-text-decoration-shadow.html
new file mode 100644
index 0000000..144f093
--- /dev/null
+++ b/LayoutTests/css3/color-filters/color-filter-text-decoration-shadow.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>CSS Test: color-filter affects text decoration shadows</title>
+        <link rel="author" title="Apple" href="http://www.apple.com/">
+        <link rel="match" href="color-filter-text-decoration-shadow-expected.html">
+
+        <meta name="assert" content="color-filter affects text decoration shadows">
+        <style type="text/css">
+            .test
+            {
+				font: 120px sans-serif;
+				color: rgb(255, 128, 255);
+				color-filter: invert();
+				margin: 100px 20px;
+				text-decoration: underline overline line-through;
+            }
+
+            .single
+            {
+				text-shadow: 150px 0 0 blue;
+            }
+
+            .multiple
+            {
+				text-shadow: 150px 0 0 blue, 300px 0 0 red;
+            }
+        </style>
+    </head>
+    <body>
+        <div class="test single">O</div>
+        <div class="test multiple">O</div>
+    </body>
+</html>
diff --git a/LayoutTests/css3/color-filters/color-filter-text-shadow-expected.html b/LayoutTests/css3/color-filters/color-filter-text-shadow-expected.html
new file mode 100644
index 0000000..5275d86
--- /dev/null
+++ b/LayoutTests/css3/color-filters/color-filter-text-shadow-expected.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>CSS Test: color-filter reference</title>
+        <link rel="author" title="Apple" href="http://www.apple.com/">
+
+        <style type="text/css">
+            .test
+            {
+				font: 120px Ahem;
+				color: green;
+				margin: 100px 20px;
+            }
+
+            .single
+            {
+				text-shadow: 50px 50px 0 yellow;
+            }
+
+            .multiple
+            {
+				text-shadow: 50px 50px 0 yellow, 100px 100px 0 cyan;
+            }
+        </style>
+    </head>
+    <body>
+        <p>At the top you should see a green square with a yellow shadow.</p>
+        <p>Below is a green square with a yellow shadow and a cyan shadow.</p>
+        <div class="test single">A</div>
+        <div class="test multiple">A</div>
+    </body>
+</html>
diff --git a/LayoutTests/css3/color-filters/color-filter-text-shadow.html b/LayoutTests/css3/color-filters/color-filter-text-shadow.html
new file mode 100644
index 0000000..af0202c
--- /dev/null
+++ b/LayoutTests/css3/color-filters/color-filter-text-shadow.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>CSS Test: color-filter affects the text shadow</title>
+        <link rel="author" title="Apple" href="http://www.apple.com/">
+        <link rel="match" href="color-filter-text-shadow-expected.html">
+
+        <meta name="assert" content="color-filter affects the color of text-shadow">
+        <style type="text/css">
+            .test
+            {
+				font: 120px Ahem;
+				color: rgb(255, 128, 255);
+				color-filter: invert();
+				margin: 100px 20px;
+            }
+
+            .single
+            {
+				text-shadow: 50px 50px 0 blue;
+            }
+
+            .multiple
+            {
+				text-shadow: 50px 50px 0 blue, 100px 100px 0 red;
+            }
+        </style>
+		<script>
+			if (window.internals)
+			    internals.settings.setColorFilterEnabled(true);
+		</script>
+    </head>
+    <body>
+        <p>At the top you should see a green square with a yellow shadow.</p>
+        <p>Below is a green square with a yellow shadow and a cyan shadow.</p>
+        <div class="test single">A</div>
+        <div class="test multiple">A</div>
+    </body>
+</html>
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index afaf81e..c98d01b 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,48 @@
+2018-04-26  Simon Fraser  <simon.fraser@apple.com>
+
+        Fix color-filter to apply to text decorations
+        https://bugs.webkit.org/show_bug.cgi?id=185068
+        <rdar://problem/39782136>
+
+        Reviewed by Alan Bujtas.
+        
+        Transform the colors of text shadows, and the shadows of text-decorations through
+        the color-filter.
+        
+        Rather than clone the ShadowData stored on TextPainter and TextDecorationPainter
+        (which would have awkward ownership implications) we pass the color filters through
+        and just map the color through it before painting.
+        
+        Re-order the members of TextPainter a little to optimize padding.
+        
+        Also fix a bug where FilterOperations::transformColor() could transform an invalid
+        color to a valid one; we never want this.
+
+        Tests: css3/color-filters/color-filter-text-decoration-shadow.html
+               css3/color-filters/color-filter-text-shadow.html
+
+        * platform/graphics/filters/FilterOperations.cpp:
+        (WebCore::FilterOperations::transformColor const):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintMarkedTextForeground):
+        (WebCore::InlineTextBox::paintMarkedTextDecoration):
+        * rendering/TextDecorationPainter.cpp:
+        (WebCore::TextDecorationPainter::paintTextDecoration):
+        * rendering/TextDecorationPainter.h:
+        (WebCore::TextDecorationPainter::setTextShadow):
+        (WebCore::TextDecorationPainter::setShadowColorFilter):
+        (WebCore::TextDecorationPainter::addTextShadow): Deleted.
+        * rendering/TextPainter.cpp:
+        (WebCore::ShadowApplier::ShadowApplier):
+        (WebCore::TextPainter::paintTextWithShadows):
+        (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): Simplify the logic that only paints the shadow
+        on the first iteration.
+        (WebCore::TextPainter::paintRange):
+        * rendering/TextPainter.h:
+        (WebCore::TextPainter::setShadowColorFilter):
+        * rendering/svg/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::paintTextWithShadows):
+
 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Rename minimumLayoutSize to viewLayoutSize
diff --git a/Source/WebCore/platform/graphics/filters/FilterOperations.cpp b/Source/WebCore/platform/graphics/filters/FilterOperations.cpp
index 6dbeac8..0273ac2 100644
--- a/Source/WebCore/platform/graphics/filters/FilterOperations.cpp
+++ b/Source/WebCore/platform/graphics/filters/FilterOperations.cpp
@@ -122,7 +122,7 @@
 
 bool FilterOperations::transformColor(Color& color) const
 {
-    if (isEmpty())
+    if (isEmpty() || !color.isValid())
         return false;
 
     FloatComponents components;
diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp
index 0a73973..5a859bb 100644
--- a/Source/WebCore/rendering/InlineTextBox.cpp
+++ b/Source/WebCore/rendering/InlineTextBox.cpp
@@ -1012,8 +1012,9 @@
     textPainter.setStyle(markedText.style.textStyles);
     textPainter.setIsHorizontal(isHorizontal());
     if (markedText.style.textShadow) {
-        // FIXME: need to transform shadow color here.
         textPainter.setShadow(&markedText.style.textShadow.value());
+        if (lineStyle.hasColorFilter())
+            textPainter.setShadowColorFilter(&lineStyle.colorFilter());
     }
     textPainter.setEmphasisMark(emphasisMark, emphasisMarkOffset, combinedText());
 
@@ -1067,8 +1068,9 @@
     decorationPainter.setBaseline(lineStyle().fontMetrics().ascent());
     decorationPainter.setIsHorizontal(isHorizontal());
     if (markedText.style.textShadow) {
-        // FIXME: transform shadow color.
-        decorationPainter.addTextShadow(&markedText.style.textShadow.value());
+        decorationPainter.setTextShadow(&markedText.style.textShadow.value());
+        if (lineStyle().hasColorFilter())
+            decorationPainter.setShadowColorFilter(&lineStyle().colorFilter());
     }
 
     {
diff --git a/Source/WebCore/rendering/TextDecorationPainter.cpp b/Source/WebCore/rendering/TextDecorationPainter.cpp
index f87ce1b..fdb3672 100644
--- a/Source/WebCore/rendering/TextDecorationPainter.cpp
+++ b/Source/WebCore/rendering/TextDecorationPainter.cpp
@@ -325,7 +325,11 @@
             }
             int shadowX = m_isHorizontal ? shadow->x() : shadow->y();
             int shadowY = m_isHorizontal ? shadow->y() : -shadow->x();
-            m_context.setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow->radius(), shadow->color());
+            
+            Color shadowColor = shadow->color();
+            if (m_shadowColorFilter)
+                m_shadowColorFilter->transformColor(shadowColor);
+            m_context.setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow->radius(), shadowColor);
             shadow = shadow->next();
         }
 
diff --git a/Source/WebCore/rendering/TextDecorationPainter.h b/Source/WebCore/rendering/TextDecorationPainter.h
index ec47498..ac749af 100644
--- a/Source/WebCore/rendering/TextDecorationPainter.h
+++ b/Source/WebCore/rendering/TextDecorationPainter.h
@@ -50,7 +50,8 @@
     void setIsHorizontal(bool isHorizontal) { m_isHorizontal = isHorizontal; }
     void setWidth(float width) { m_width = width; }
     void setBaseline(float baseline) { m_baseline = baseline; }
-    void addTextShadow(const ShadowData* textShadow) { m_shadow = textShadow; }
+    void setTextShadow(const ShadowData* textShadow) { m_shadow = textShadow; }
+    void setShadowColorFilter(const FilterOperations* colorFilter) { m_shadowColorFilter = colorFilter; }
 
     void paintTextDecoration(const TextRun&, const FloatPoint& textOrigin, const FloatPoint& boxOrigin);
 
@@ -78,6 +79,7 @@
     bool m_isPrinting;
     bool m_isHorizontal { true };
     const ShadowData* m_shadow { nullptr };
+    const FilterOperations* m_shadowColorFilter { nullptr };
     const InlineTextBox* m_inlineTextBox { nullptr };
     const FontCascade* m_font { nullptr };
 
diff --git a/Source/WebCore/rendering/TextPainter.cpp b/Source/WebCore/rendering/TextPainter.cpp
index e59dbf6..25ff5d1 100644
--- a/Source/WebCore/rendering/TextPainter.cpp
+++ b/Source/WebCore/rendering/TextPainter.cpp
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-ShadowApplier::ShadowApplier(GraphicsContext& context, const ShadowData* shadow, const FloatRect& textRect, bool lastShadowIterationShouldDrawText, bool opaque, FontOrientation orientation)
+ShadowApplier::ShadowApplier(GraphicsContext& context, const ShadowData* shadow, const FilterOperations* colorFilter, const FloatRect& textRect, bool lastShadowIterationShouldDrawText, bool opaque, FontOrientation orientation)
     : m_context { context }
     , m_shadow { shadow }
     , m_onlyDrawsShadow { !isLastShadowIteration() || !lastShadowIterationShouldDrawText }
@@ -50,7 +50,9 @@
     int shadowY = orientation == Horizontal ? shadow->y() : -shadow->x();
     FloatSize shadowOffset(shadowX, shadowY);
     int shadowRadius = shadow->radius();
-    const Color& shadowColor = shadow->color();
+    Color shadowColor = shadow->color();
+    if (colorFilter)
+        colorFilter->transformColor(shadowColor);
 
     // When drawing shadows, we usually clip the context to the area the shadow will reside, and then
     // draw the text itself outside the clipped area (so only the shadow shows up). However, we can
@@ -114,7 +116,7 @@
     m_glyphDisplayList = nullptr;
 }
 
-void TextPainter::paintTextWithShadows(const ShadowData* shadow, const FontCascade& font, const TextRun& textRun, const FloatRect& boxRect, const FloatPoint& textOrigin,
+void TextPainter::paintTextWithShadows(const ShadowData* shadow, const FilterOperations* colorFilter, const FontCascade& font, const TextRun& textRun, const FloatRect& boxRect, const FloatPoint& textOrigin,
     unsigned startOffset, unsigned endOffset, const AtomicString& emphasisMark, float emphasisMarkOffset, bool stroked)
 {
     if (!shadow) {
@@ -128,7 +130,7 @@
     if (!opaque)
         m_context.setFillColor(Color::black);
     while (shadow) {
-        ShadowApplier shadowApplier(m_context, shadow, boxRect, lastShadowIterationShouldDrawText, opaque, m_textBoxIsHorizontal ? Horizontal : Vertical);
+        ShadowApplier shadowApplier(m_context, shadow, colorFilter, boxRect, lastShadowIterationShouldDrawText, opaque, m_textBoxIsHorizontal ? Horizontal : Vertical);
         if (!shadowApplier.nothingToDraw())
             paintTextOrEmphasisMarks(font, textRun, emphasisMark, emphasisMarkOffset, textOrigin + shadowApplier.extraOffset(), startOffset, endOffset);
         shadow = shadow->next();
@@ -142,27 +144,28 @@
 }
 
 void TextPainter::paintTextAndEmphasisMarksIfNeeded(const TextRun& textRun, const FloatRect& boxRect, const FloatPoint& textOrigin, unsigned startOffset, unsigned endOffset,
-    const TextPaintStyle& paintStyle, const ShadowData* shadow)
+    const TextPaintStyle& paintStyle, const ShadowData* shadow, const FilterOperations* shadowColorFilter)
 {
     if (paintStyle.paintOrder == PaintOrder::Normal) {
         // FIXME: Truncate right-to-left text correctly.
-        paintTextWithShadows(shadow, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, paintStyle.strokeWidth > 0);
+        paintTextWithShadows(shadow, shadowColorFilter, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, paintStyle.strokeWidth > 0);
     } else {
-        bool paintShadow = true;
         auto textDrawingMode = m_context.textDrawingMode();
         auto paintOrder = RenderStyle::paintTypesForPaintOrder(paintStyle.paintOrder);
+        auto shadowToUse = shadow;
+
         for (auto order : paintOrder) {
             switch (order) {
             case PaintType::Fill:
                 m_context.setTextDrawingMode(textDrawingMode & ~TextModeStroke);
-                paintTextWithShadows(paintShadow ? shadow : nullptr, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, false);
-                paintShadow = false;
+                paintTextWithShadows(shadowToUse, shadowColorFilter, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, false);
+                shadowToUse = nullptr;
                 m_context.setTextDrawingMode(textDrawingMode);
                 break;
             case PaintType::Stroke:
                 m_context.setTextDrawingMode(textDrawingMode & ~TextModeFill);
-                paintTextWithShadows(paintShadow ? shadow : nullptr, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, paintStyle.strokeWidth > 0);
-                paintShadow = false;
+                paintTextWithShadows(shadowToUse, shadowColorFilter, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, paintStyle.strokeWidth > 0);
+                shadowToUse = nullptr;
                 m_context.setTextDrawingMode(textDrawingMode);
                 break;
             case PaintType::Markers:
@@ -183,7 +186,7 @@
         m_context.concatCTM(rotation(boxRect, Clockwise));
 
     // FIXME: Truncate right-to-left text correctly.
-    paintTextWithShadows(shadow, m_combinedText ? m_combinedText->originalFont() : *m_font, emphasisMarkTextRun, boxRect, emphasisMarkTextOrigin, startOffset, endOffset,
+    paintTextWithShadows(shadow, shadowColorFilter, m_combinedText ? m_combinedText->originalFont() : *m_font, emphasisMarkTextRun, boxRect, emphasisMarkTextOrigin, startOffset, endOffset,
         m_emphasisMark, m_emphasisMarkOffset, paintStyle.strokeWidth > 0);
 
     if (m_combinedText)
@@ -202,7 +205,7 @@
 
     GraphicsContextStateSaver stateSaver(m_context, m_style.strokeWidth > 0);
     updateGraphicsContext(m_context, m_style);
-    paintTextAndEmphasisMarksIfNeeded(textRun, boxRect, textOrigin, start, end, m_style, m_shadow);
+    paintTextAndEmphasisMarksIfNeeded(textRun, boxRect, textOrigin, start, end, m_style, m_shadow, m_shadowColorFilter);
 }
 
 void TextPainter::clearGlyphDisplayLists()
diff --git a/Source/WebCore/rendering/TextPainter.h b/Source/WebCore/rendering/TextPainter.h
index 2f1b159..c2bfda1 100644
--- a/Source/WebCore/rendering/TextPainter.h
+++ b/Source/WebCore/rendering/TextPainter.h
@@ -52,6 +52,7 @@
 
     void setStyle(const TextPaintStyle& textPaintStyle) { m_style = textPaintStyle; }
     void setShadow(const ShadowData* shadow) { m_shadow = shadow; }
+    void setShadowColorFilter(const FilterOperations* colorFilter) { m_shadowColorFilter = colorFilter; }
     void setFont(const FontCascade& font) { m_font = &font; }
     void setIsHorizontal(bool isHorizontal) { m_textBoxIsHorizontal = isHorizontal; }
     void setEmphasisMark(const AtomicString& mark, float offset, const RenderCombineText*);
@@ -77,20 +78,21 @@
 private:
     void paintTextOrEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& emphasisMark, float emphasisMarkOffset,
         const FloatPoint& textOrigin, unsigned startOffset, unsigned endOffset);
-    void paintTextWithShadows(const ShadowData*, const FontCascade&, const TextRun&, const FloatRect& boxRect, const FloatPoint& textOrigin,
+    void paintTextWithShadows(const ShadowData*, const FilterOperations*, const FontCascade&, const TextRun&, const FloatRect& boxRect, const FloatPoint& textOrigin,
         unsigned startOffset, unsigned endOffset, const AtomicString& emphasisMark, float emphasisMarkOffset, bool stroked);
     void paintTextAndEmphasisMarksIfNeeded(const TextRun&, const FloatRect& boxRect, const FloatPoint& textOrigin, unsigned startOffset, unsigned endOffset,
-        const TextPaintStyle&, const ShadowData*);
+        const TextPaintStyle&, const ShadowData*, const FilterOperations*);
 
     GraphicsContext& m_context;
     const FontCascade* m_font { nullptr };
     TextPaintStyle m_style;
-    const ShadowData* m_shadow { nullptr };
     AtomicString m_emphasisMark;
+    const ShadowData* m_shadow { nullptr };
+    const FilterOperations* m_shadowColorFilter { nullptr };
     const RenderCombineText* m_combinedText { nullptr };
+    DisplayList::DisplayList* m_glyphDisplayList { nullptr };
     float m_emphasisMarkOffset { 0 };
     bool m_textBoxIsHorizontal { true };
-    DisplayList::DisplayList* m_glyphDisplayList { nullptr };
 };
 
 inline void TextPainter::setEmphasisMark(const AtomicString& mark, float offset, const RenderCombineText* combinedText)
@@ -102,7 +104,7 @@
 
 class ShadowApplier {
 public:
-    ShadowApplier(GraphicsContext&, const ShadowData*, const FloatRect& textRect, bool lastShadowIterationShouldDrawText = true, bool opaque = false, FontOrientation = Horizontal);
+    ShadowApplier(GraphicsContext&, const ShadowData*, const FilterOperations* colorFilter, const FloatRect& textRect, bool lastShadowIterationShouldDrawText = true, bool opaque = false, FontOrientation = Horizontal);
     FloatSize extraOffset() const { return m_extraOffset; }
     bool nothingToDraw() const { return m_nothingToDraw; }
     bool didSaveContext() const { return m_didSaveContext; }
diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
index 45268e9..c1fc4a8 100644
--- a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
+++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
@@ -562,7 +562,7 @@
             break;
 
         {
-            ShadowApplier shadowApplier(*usedContext, shadow, shadowRect);
+            ShadowApplier shadowApplier(*usedContext, shadow, nullptr, shadowRect);
 
             if (!shadowApplier.didSaveContext())
                 usedContext->save();