<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[172110] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/172110">172110</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-08-05 16:40:24 -0700 (Tue, 05 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add the ability to force text to render in white, not just black
https://bugs.webkit.org/show_bug.cgi?id=135625

Patch by Peyton Randolph &lt;prandolph@apple.com&gt; on 2014-08-05
Reviewed by Beth Dakin.

This patch introduces PaintBehaviorForceWhiteText, a complement to PaintBehaviorForceBlackText. If
a client specifies both PaintBehaviorForceWhiteText and PaintBehaviorForceBlackText, the text will be
painted black.

No new tests.

* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint): Use the forced text color to paint the text if requested.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Disable the text shadow if a text color has been forced.
* rendering/PaintInfo.h:
(WebCore::PaintInfo::forceTextColor):
Return true iff the client has requested to force a black or white text color.
(WebCore::PaintInfo::forceWhiteText):
Return true iff forcing white text has been requested.
(WebCore::PaintInfo::forcedTextColor):
Return the forced text color. Currently only white and black are supported.
* rendering/PaintPhase.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents): Remove the forceBlackText-related code as it is redundant.
(WebCore::RenderLayer::paintForegroundForFragments):
Remove forceBlackText parameter and infer the correct behavior from the given paint behavior.
* rendering/RenderLayer.h:
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle): Use the forced text color if available.
(WebCore::computeTextSelectionPaintStyle): Use the forced text color if available.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingEllipsisBoxcpp">trunk/Source/WebCore/rendering/EllipsisBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxcpp">trunk/Source/WebCore/rendering/InlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingPaintInfoh">trunk/Source/WebCore/rendering/PaintInfo.h</a></li>
<li><a href="#trunkSourceWebCorerenderingPaintPhaseh">trunk/Source/WebCore/rendering/PaintPhase.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingTextPaintStylecpp">trunk/Source/WebCore/rendering/TextPaintStyle.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172109 => 172110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-05 23:39:44 UTC (rev 172109)
+++ trunk/Source/WebCore/ChangeLog        2014-08-05 23:40:24 UTC (rev 172110)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2014-08-05  Peyton Randolph  &lt;prandolph@apple.com&gt;
+
+        Add the ability to force text to render in white, not just black
+        https://bugs.webkit.org/show_bug.cgi?id=135625
+
+        Reviewed by Beth Dakin.
+
+        This patch introduces PaintBehaviorForceWhiteText, a complement to PaintBehaviorForceBlackText. If
+        a client specifies both PaintBehaviorForceWhiteText and PaintBehaviorForceBlackText, the text will be
+        painted black.
+
+        No new tests.
+
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::paint): Use the forced text color to paint the text if requested.
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paint): Disable the text shadow if a text color has been forced.
+        * rendering/PaintInfo.h:
+        (WebCore::PaintInfo::forceTextColor): 
+        Return true iff the client has requested to force a black or white text color.
+        (WebCore::PaintInfo::forceWhiteText):
+        Return true iff forcing white text has been requested.
+        (WebCore::PaintInfo::forcedTextColor): 
+        Return the forced text color. Currently only white and black are supported.
+        * rendering/PaintPhase.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintLayerContents): Remove the forceBlackText-related code as it is redundant.
+        (WebCore::RenderLayer::paintForegroundForFragments): 
+        Remove forceBlackText parameter and infer the correct behavior from the given paint behavior.
+        * rendering/RenderLayer.h:
+        * rendering/TextPaintStyle.cpp:
+        (WebCore::computeTextPaintStyle): Use the forced text color if available.
+        (WebCore::computeTextSelectionPaintStyle): Use the forced text color if available.
+
</ins><span class="cx"> 2014-08-05  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         More work on CMake.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingEllipsisBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/EllipsisBox.cpp (172109 => 172110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/EllipsisBox.cpp        2014-08-05 23:39:44 UTC (rev 172109)
+++ trunk/Source/WebCore/rendering/EllipsisBox.cpp        2014-08-05 23:40:24 UTC (rev 172110)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">         paintSelection(context, paintOffset, lineStyle, font);
</span><span class="cx"> 
</span><span class="cx">         // Select the correct color for painting the text.
</span><del>-        Color foreground = paintInfo.forceBlackText() ? Color::black : blockFlow().selectionForegroundColor();
</del><ins>+        Color foreground = paintInfo.forceTextColor() ? paintInfo.forcedTextColor() : blockFlow().selectionForegroundColor();
</ins><span class="cx">         if (foreground.isValid() &amp;&amp; foreground != textColor)
</span><span class="cx">             context-&gt;setFillColor(foreground, lineStyle.colorSpace());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (172109 => 172110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.cpp        2014-08-05 23:39:44 UTC (rev 172109)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp        2014-08-05 23:40:24 UTC (rev 172110)
</span><span class="lines">@@ -628,7 +628,7 @@
</span><span class="cx">     if (!emphasisMark.isEmpty())
</span><span class="cx">         emphasisMarkOffset = emphasisMarkAbove ? -font.fontMetrics().ascent() - font.emphasisMarkDescent(emphasisMark) : font.fontMetrics().descent() + font.emphasisMarkAscent(emphasisMark);
</span><span class="cx"> 
</span><del>-    const ShadowData* textShadow = paintInfo.forceBlackText() ? 0 : lineStyle.textShadow();
</del><ins>+    const ShadowData* textShadow = (paintInfo.forceTextColor()) ? nullptr : lineStyle.textShadow();
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint textOrigin(boxOrigin.x(), boxOrigin.y() + font.fontMetrics().ascent());
</span><span class="cx">     if (combinedText)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingPaintInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/PaintInfo.h (172109 => 172110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/PaintInfo.h        2014-08-05 23:39:44 UTC (rev 172109)
+++ trunk/Source/WebCore/rendering/PaintInfo.h        2014-08-05 23:40:24 UTC (rev 172110)
</span><span class="lines">@@ -80,7 +80,10 @@
</span><span class="cx">         return !subtreePaintRoot || subtreePaintRoot == &amp;renderer;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    bool forceTextColor() const { return forceBlackText() || forceWhiteText(); }
</ins><span class="cx">     bool forceBlackText() const { return paintBehavior &amp; PaintBehaviorForceBlackText; }
</span><ins>+    bool forceWhiteText() const { return paintBehavior &amp; PaintBehaviorForceWhiteText; }
+    Color forcedTextColor() const { return (forceBlackText()) ? Color::black : Color::white; }
</ins><span class="cx"> 
</span><span class="cx">     bool skipRootBackground() const { return paintBehavior &amp; PaintBehaviorSkipRootBackground; }
</span><span class="cx">     bool paintRootBackgroundOnly() const { return paintBehavior &amp; PaintBehaviorRootBackgroundOnly; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingPaintPhaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/PaintPhase.h (172109 => 172110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/PaintPhase.h        2014-08-05 23:39:44 UTC (rev 172109)
+++ trunk/Source/WebCore/rendering/PaintPhase.h        2014-08-05 23:40:24 UTC (rev 172110)
</span><span class="lines">@@ -56,10 +56,11 @@
</span><span class="cx">     PaintBehaviorNormal = 0,
</span><span class="cx">     PaintBehaviorSelectionOnly = 1 &lt;&lt; 0,
</span><span class="cx">     PaintBehaviorForceBlackText = 1 &lt;&lt; 1,
</span><del>-    PaintBehaviorFlattenCompositingLayers = 1 &lt;&lt; 2,
-    PaintBehaviorRenderingSVGMask = 1 &lt;&lt; 3,
-    PaintBehaviorSkipRootBackground = 1 &lt;&lt; 4,
-    PaintBehaviorRootBackgroundOnly = 1 &lt;&lt; 5
</del><ins>+    PaintBehaviorForceWhiteText = 1 &lt;&lt; 2,
+    PaintBehaviorFlattenCompositingLayers = 1 &lt;&lt; 3,
+    PaintBehaviorRenderingSVGMask = 1 &lt;&lt; 4,
+    PaintBehaviorSkipRootBackground = 1 &lt;&lt; 5,
+    PaintBehaviorRootBackgroundOnly = 1 &lt;&lt; 6,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> typedef unsigned PaintBehavior;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (172109 => 172110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-08-05 23:39:44 UTC (rev 172109)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-08-05 23:40:24 UTC (rev 172110)
</span><span class="lines">@@ -4047,7 +4047,6 @@
</span><span class="cx">     if (localPaintingInfo.overlapTestRequests &amp;&amp; isSelfPaintingLayer)
</span><span class="cx">         performOverlapTests(*localPaintingInfo.overlapTestRequests, localPaintingInfo.rootLayer, this);
</span><span class="cx"> 
</span><del>-    bool forceBlackText = localPaintingInfo.paintBehavior &amp; PaintBehaviorForceBlackText;
</del><span class="cx">     bool selectionOnly  = localPaintingInfo.paintBehavior &amp; PaintBehaviorSelectionOnly;
</span><span class="cx">     
</span><span class="cx">     PaintBehavior paintBehavior = PaintBehaviorNormal;
</span><span class="lines">@@ -4087,7 +4086,7 @@
</span><span class="cx">     if (isPaintingCompositedForeground) {
</span><span class="cx">         if (shouldPaintContent)
</span><span class="cx">             paintForegroundForFragments(layerFragments, context, transparencyLayerContext, paintingInfo.paintDirtyRect, haveTransparency,
</span><del>-                localPaintingInfo, paintBehavior, subtreePaintRootForRenderer, selectionOnly, forceBlackText);
</del><ins>+                localPaintingInfo, paintBehavior, subtreePaintRootForRenderer, selectionOnly);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (shouldPaintOutline)
</span><span class="lines">@@ -4428,7 +4427,7 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderLayer::paintForegroundForFragments(const LayerFragments&amp; layerFragments, GraphicsContext* context, GraphicsContext* transparencyLayerContext,
</span><span class="cx">     const LayoutRect&amp; transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo&amp; localPaintingInfo, PaintBehavior paintBehavior,
</span><del>-    RenderObject* subtreePaintRootForRenderer, bool selectionOnly, bool forceBlackText)
</del><ins>+    RenderObject* subtreePaintRootForRenderer, bool selectionOnly)
</ins><span class="cx"> {
</span><span class="cx">     // Begin transparency if we have something to paint.
</span><span class="cx">     if (haveTransparency) {
</span><span class="lines">@@ -4440,9 +4439,15 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    
-    PaintBehavior localPaintBehavior = forceBlackText ? (PaintBehavior)PaintBehaviorForceBlackText : paintBehavior;
</del><span class="cx"> 
</span><ins>+    PaintBehavior localPaintBehavior;
+    if (localPaintingInfo.paintBehavior &amp; PaintBehaviorForceBlackText)
+        localPaintBehavior = PaintBehaviorForceBlackText;
+    else if (localPaintingInfo.paintBehavior &amp; PaintBehaviorForceWhiteText)
+        localPaintBehavior = PaintBehaviorForceWhiteText;
+    else
+        localPaintBehavior = paintBehavior;
+
</ins><span class="cx">     // Optimize clipping for the single fragment case.
</span><span class="cx">     bool shouldClip = localPaintingInfo.clipToDirtyRect &amp;&amp; layerFragments.size() == 1 &amp;&amp; layerFragments[0].shouldPaintContent &amp;&amp; !layerFragments[0].foregroundRect.isEmpty();
</span><span class="cx">     ClipRect clippedRect;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (172109 => 172110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2014-08-05 23:39:44 UTC (rev 172109)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2014-08-05 23:40:24 UTC (rev 172110)
</span><span class="lines">@@ -1004,7 +1004,7 @@
</span><span class="cx">         const LayoutRect&amp; transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo&amp;, PaintBehavior, RenderObject* paintingRootForRenderer);
</span><span class="cx">     void paintForegroundForFragments(const LayerFragments&amp;, GraphicsContext*, GraphicsContext* transparencyLayerContext,
</span><span class="cx">         const LayoutRect&amp; transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo&amp;, PaintBehavior, RenderObject* paintingRootForRenderer,
</span><del>-        bool selectionOnly, bool forceBlackText);
</del><ins>+        bool selectionOnly);
</ins><span class="cx">     void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&amp;, GraphicsContext*, const LayerPaintingInfo&amp;, PaintBehavior, RenderObject* paintingRootForRenderer);
</span><span class="cx">     void paintOutlineForFragments(const LayerFragments&amp;, GraphicsContext*, const LayerPaintingInfo&amp;, PaintBehavior, RenderObject* paintingRootForRenderer);
</span><span class="cx">     void paintOverflowControlsForFragments(const LayerFragments&amp;, GraphicsContext*, const LayerPaintingInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextPaintStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextPaintStyle.cpp (172109 => 172110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextPaintStyle.cpp        2014-08-05 23:39:44 UTC (rev 172109)
+++ trunk/Source/WebCore/rendering/TextPaintStyle.cpp        2014-08-05 23:40:24 UTC (rev 172110)
</span><span class="lines">@@ -80,10 +80,10 @@
</span><span class="cx"> #endif
</span><span class="cx">     paintStyle.strokeWidth = lineStyle.textStrokeWidth();
</span><span class="cx"> 
</span><del>-    if (paintInfo.forceBlackText()) {
-        paintStyle.fillColor = Color::black;
-        paintStyle.strokeColor = Color::black;
-        paintStyle.emphasisMarkColor = Color::black;
</del><ins>+    if (paintInfo.forceTextColor()) {
+        paintStyle.fillColor = paintInfo.forcedTextColor();
+        paintStyle.strokeColor = paintInfo.forcedTextColor();
+        paintStyle.emphasisMarkColor = paintInfo.forcedTextColor();
</ins><span class="cx">         return paintStyle;
</span><span class="cx">     }
</span><span class="cx">     paintStyle.fillColor = lineStyle.visitedDependentColor(CSSPropertyWebkitTextFillColor);
</span><span class="lines">@@ -119,19 +119,19 @@
</span><span class="cx"> {
</span><span class="cx">     paintSelectedTextOnly = (paintInfo.phase == PaintPhaseSelection);
</span><span class="cx">     paintSelectedTextSeparately = false;
</span><del>-    selectionShadow = paintInfo.forceBlackText() ? nullptr : lineStyle.textShadow();
</del><ins>+    selectionShadow = (paintInfo.forceTextColor()) ? nullptr : lineStyle.textShadow();
</ins><span class="cx"> 
</span><span class="cx">     TextPaintStyle selectionPaintStyle = textPaintStyle;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TEXT_SELECTION)
</span><del>-    Color foreground = paintInfo.forceBlackText() ? Color::black : renderer.selectionForegroundColor();
</del><ins>+    Color foreground = paintInfo.forceTextColor() ? paintInfo.forcedTextColor() : renderer.selectionForegroundColor();
</ins><span class="cx">     if (foreground.isValid() &amp;&amp; foreground != selectionPaintStyle.fillColor) {
</span><span class="cx">         if (!paintSelectedTextOnly)
</span><span class="cx">             paintSelectedTextSeparately = true;
</span><span class="cx">         selectionPaintStyle.fillColor = foreground;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Color emphasisMarkForeground = paintInfo.forceBlackText() ? Color::black : renderer.selectionEmphasisMarkColor();
</del><ins>+    Color emphasisMarkForeground = paintInfo.forceTextColor() ? paintInfo.forcedTextColor() : renderer.selectionEmphasisMarkColor();
</ins><span class="cx">     if (emphasisMarkForeground.isValid() &amp;&amp; emphasisMarkForeground != selectionPaintStyle.emphasisMarkColor) {
</span><span class="cx">         if (!paintSelectedTextOnly)
</span><span class="cx">             paintSelectedTextSeparately = true;
</span><span class="lines">@@ -139,7 +139,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (RenderStyle* pseudoStyle = renderer.getCachedPseudoStyle(SELECTION)) {
</span><del>-        const ShadowData* shadow = paintInfo.forceBlackText() ? 0 : pseudoStyle-&gt;textShadow();
</del><ins>+        const ShadowData* shadow = paintInfo.forceTextColor() ? nullptr : pseudoStyle-&gt;textShadow();
</ins><span class="cx">         if (shadow != selectionShadow) {
</span><span class="cx">             if (!paintSelectedTextOnly)
</span><span class="cx">                 paintSelectedTextSeparately = true;
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx">             selectionPaintStyle.strokeWidth = strokeWidth;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        Color stroke = paintInfo.forceBlackText() ? Color::black : pseudoStyle-&gt;visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
</del><ins>+        Color stroke = paintInfo.forceTextColor() ? paintInfo.forcedTextColor() : pseudoStyle-&gt;visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
</ins><span class="cx">         if (stroke != selectionPaintStyle.strokeColor) {
</span><span class="cx">             if (!paintSelectedTextOnly)
</span><span class="cx">                 paintSelectedTextSeparately = true;
</span></span></pre>
</div>
</div>

</body>
</html>