Bug 1219833 - Respect composition underline color; r=masayuki, a=sylvestre
authorJim Chen <nchen@mozilla.com>
Tue, 03 Nov 2015 11:53:58 -0500
changeset 307707 cd32550ec7fe9d11024f0ef4d8654c303c0798c1
parent 307706 d681ec6fe6b2cde04d5a40d53563418c7c870d2b
child 307708 1a56a93a629298ae68e1e978928375d8a4920b30
push id7348
push userjbruaroey@mozilla.com
push dateMon, 09 Nov 2015 21:46:36 +0000
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()) {