Bug 1547353 - Fix macOS selection color when gfx.color_management.mode = 1. r=nical
authorruchikabgosain <ruchikag826@gmail.com>
Sun, 01 Sep 2019 14:16:07 +0000
changeset 491040 74bee2c675addb12595806d8edafe1fa899550f8
parent 491039 10f791c3a57f54869b1afeb237dbc544f74f4591
child 491041 f103fcfc4c16c1f3f4afcabf308064274ee06f61
push id114013
push usercsabou@mozilla.com
push dateSun, 01 Sep 2019 21:52:27 +0000
treeherdermozilla-inbound@b338d55d5007 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1547353
milestone70.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 1547353 - Fix macOS selection color when gfx.color_management.mode = 1. r=nical Differential Revision: https://phabricator.services.mozilla.com/D43259
widget/nsXPLookAndFeel.cpp
--- a/widget/nsXPLookAndFeel.cpp
+++ b/widget/nsXPLookAndFeel.cpp
@@ -880,22 +880,23 @@ nsresult nsXPLookAndFeel::GetColorImpl(C
   if (StaticPrefs::ui_use_native_colors() &&
       NS_SUCCEEDED(NativeGetColor(aID, aResult))) {
     if (!mozilla::ServoStyleSet::IsInServoTraversal()) {
       MOZ_ASSERT(NS_IsMainThread());
       if ((gfxPlatform::GetCMSMode() == eCMSMode_All) &&
           !IsSpecialColor(aID, aResult)) {
         qcms_transform* transform = gfxPlatform::GetCMSInverseRGBTransform();
         if (transform) {
-          uint8_t color[3];
+          uint8_t color[4];
           color[0] = NS_GET_R(aResult);
           color[1] = NS_GET_G(aResult);
           color[2] = NS_GET_B(aResult);
+          color[3] = NS_GET_A(aResult);
           qcms_transform_data(transform, color, color, 1);
-          aResult = NS_RGB(color[0], color[1], color[2]);
+          aResult = NS_RGBA(color[0], color[1], color[2], color[3]);
         }
       }
 
       CACHE_COLOR(aID, aResult);
     }
     return NS_OK;
   }