Bug 1219833 - Respect composition underline color; r=masayuki, a=sylvestre
authorJim Chen <nchen@mozilla.com>
Tue, 03 Nov 2015 11:53:58 -0500
changeset 296663 cd32550ec7fe
parent 296662 d681ec6fe6b2
child 296664 1a56a93a6292
push id5278
push usercbook@mozilla.com
push date2015-11-09 10:38 +0000
treeherdermozilla-beta@d3b021968c63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki, sylvestre
bugs1219833
milestone43.0
Bug 1219833 - Respect composition underline color; r=masayuki, a=sylvestre nsTextFrame didn't use the composition underline color if the composition didn't have a foreground color defined. This patch makes it use the underline color if foreground color is not defined.
layout/generic/nsTextFrame.cpp
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5363,18 +5363,18 @@ nsTextFrame::DrawSelectionDecorations(gf
           relativeSize = aRangeStyle.mIsBoldLine ? 2.0f : 1.0f;
         } else if (!weDefineSelectionUnderline) {
           // There is no underline style definition.
           return;
         }
         // If underline color is defined and that doesn't depend on the
         // foreground color, we should use the color directly.
         if (aRangeStyle.IsUnderlineColorDefined() &&
-            aRangeStyle.IsForegroundColorDefined() &&
-            aRangeStyle.mUnderlineColor != aRangeStyle.mForegroundColor) {
+            (!aRangeStyle.IsForegroundColorDefined() ||
+             aRangeStyle.mUnderlineColor != aRangeStyle.mForegroundColor)) {
           color = aRangeStyle.mUnderlineColor;
         }
         // If foreground color or background color is defined, the both colors
         // are computed by GetSelectionTextColors().  Then, we should use its
         // foreground color always.  The color should have sufficient contrast
         // with the background color.
         else if (aRangeStyle.IsForegroundColorDefined() ||
                  aRangeStyle.IsBackgroundColorDefined()) {