Bug 1554753 - Should not treat 0 opacity text without stroke width as drawing stroke r=jfkthame
authorviolet <violet.bugreport@gmail.com>
Wed, 12 Jun 2019 15:28:55 +0000
changeset 478594 362cff551a019dc78cfc03047ee93d9fa72f1148
parent 478593 6b9cfebe807648f7c68f5a618f54cb0633298045
child 478595 fb1d0b91ebc2e5dd5931292285adeb798d50f9ec
push id36146
push useropoprus@mozilla.com
push dateThu, 13 Jun 2019 09:54:24 +0000
treeherdermozilla-central@1cd7d9c0a6c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1554753, 1248708
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1554753 - Should not treat 0 opacity text without stroke width as drawing stroke r=jfkthame The regressor Bug 1248708 inadvertently changed the behavior for opacity 0 text when implementing -webkit-text-stroke. It treats all opacity 0 text as drawing stroke even if the stroke property isn't used in the first place. We should check aParams.textStrokeWidth is actually set before changing draw mode. Differential Revision: https://phabricator.services.mozilla.com/D34663
layout/generic/nsTextFrame.cpp
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -6665,17 +6665,18 @@ static void DrawTextRun(const gfxTextRun
   params.callbacks = aParams.callbacks;
   if (aParams.callbacks) {
     aParams.callbacks->NotifyBeforeText(aParams.textColor);
     params.drawMode = DrawMode::GLYPH_PATH;
     aTextRun->Draw(aRange, aTextBaselinePt, params);
     aParams.callbacks->NotifyAfterText();
   } else {
     auto* textDrawer = aParams.context->GetTextDrawer();
-    if (NS_GET_A(aParams.textColor) != 0 || textDrawer) {
+    if (NS_GET_A(aParams.textColor) != 0 || textDrawer ||
+        aParams.textStrokeWidth == 0.0f) {
       aParams.context->SetColor(Color::FromABGR(aParams.textColor));
     } else {
       params.drawMode = DrawMode::GLYPH_STROKE;
     }
 
     if ((NS_GET_A(aParams.textStrokeColor) != 0 || textDrawer) &&
         aParams.textStrokeWidth != 0.0f) {
       if (textDrawer) {