Unreviewed, reverting r263753.
authorlawrence.j@apple.com <lawrence.j@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2020 16:54:42 +0000 (16:54 +0000)
committerlawrence.j@apple.com <lawrence.j@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2020 16:54:42 +0000 (16:54 +0000)
This commit caused build failures across multiple platforms.

Reverted changeset:

"Move Color blending related functions to their own files"
https://bugs.webkit.org/show_bug.cgi?id=213742
https://trac.webkit.org/changeset/263753

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263757 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSGradientValue.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/TextIndicator.cpp
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/platform/graphics/Color.cpp
Source/WebCore/platform/graphics/Color.h
Source/WebCore/platform/graphics/ColorBlending.cpp [deleted file]
Source/WebCore/platform/graphics/ColorBlending.h [deleted file]
Source/WebCore/platform/graphics/filters/FilterOperation.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderTheme.cpp

index 79b2326..c3e2874 100644 (file)
@@ -1,3 +1,15 @@
+2020-06-30  Jason Lawrence  <lawrence.j@apple.com>
+
+        Unreviewed, reverting r263753.
+
+        This commit caused build failures across multiple platforms.
+
+        Reverted changeset:
+
+        "Move Color blending related functions to their own files"
+        https://bugs.webkit.org/show_bug.cgi?id=213742
+        https://trac.webkit.org/changeset/263753
+
 2020-06-30  Sam Weinig  <weinig@apple.com>
 
         Move Color blending related functions to their own files
index 4a6d1e9..95c7698 100644 (file)
@@ -1907,7 +1907,6 @@ platform/encryptedmedia/CDMProxy.cpp
 platform/graphics/ANGLEWebKitBridge.cpp
 platform/graphics/BitmapImage.cpp
 platform/graphics/Color.cpp
-platform/graphics/ColorBlending.cpp
 platform/graphics/ColorUtilities.cpp
 platform/graphics/ComplexTextController.cpp
 platform/graphics/CrossfadeGeneratedImage.cpp
index dc0e586..fa31908 100644 (file)
                7C193BFC1F5E10C50088F3E6 /* JSImageSmoothingQuality.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSImageSmoothingQuality.h; sourceTree = "<group>"; };
                7C193BFD1F5E10D60088F3E6 /* JSPath2D.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSPath2D.cpp; sourceTree = "<group>"; };
                7C193BFE1F5E10D70088F3E6 /* JSPath2D.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSPath2D.h; sourceTree = "<group>"; };
-               7C1B4A6524A997590033727F /* ColorBlending.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ColorBlending.cpp; sourceTree = "<group>"; };
-               7C1B4A6724A997660033727F /* ColorBlending.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ColorBlending.h; sourceTree = "<group>"; };
                7C1E8CFF1ED0C2BE00B1D983 /* BeforeUnloadEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BeforeUnloadEvent.idl; sourceTree = "<group>"; };
                7C1E8D001ED0C2BE00B1D983 /* CallbackResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackResult.h; sourceTree = "<group>"; };
                7C1E97251A9F9834007BF0FB /* AutoFillButtonElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AutoFillButtonElement.cpp; sourceTree = "<group>"; };
                                A89943260B42338700D7C802 /* BitmapImage.h */,
                                B27535380B053814002CE64F /* Color.cpp */,
                                B27535390B053814002CE64F /* Color.h */,
-                               7C1B4A6524A997590033727F /* ColorBlending.cpp */,
-                               7C1B4A6724A997660033727F /* ColorBlending.h */,
                                7CAC6AEC247F1C5100E61D59 /* ColorComponents.h */,
                                3103B7DE1DB01556008BB890 /* ColorHash.h */,
                                7CAC6AE8247F082000E61D59 /* ColorMatrix.h */,
index 1042fa3..4b99d9b 100644 (file)
@@ -29,7 +29,6 @@
 #include "CSSCalculationValue.h"
 #include "CSSToLengthConversionData.h"
 #include "CSSValueKeywords.h"
-#include "ColorBlending.h"
 #include "FloatSize.h"
 #include "Gradient.h"
 #include "GradientImage.h"
index 33a927d..873d25d 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "AXObjectCache.h"
 #include "CharacterData.h"
-#include "ColorBlending.h"
 #include "DeleteSelectionCommand.h"
 #include "Document.h"
 #include "Editing.h"
@@ -1801,7 +1800,7 @@ Color CaretBase::computeCaretColor(const RenderStyle& elementStyle, Node* node)
     if (!elementStyle.caretColor().isValid() && rootEditableStyle) {
         auto rootEditableBackgroundColor = rootEditableStyle->visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor);
         auto elementBackgroundColor = elementStyle.visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor);
-        auto disappearsIntoBackground = blendSourceOver(rootEditableBackgroundColor, elementBackgroundColor) == rootEditableBackgroundColor;
+        auto disappearsIntoBackground = rootEditableBackgroundColor.blend(elementBackgroundColor) == rootEditableBackgroundColor;
         if (disappearsIntoBackground)
             return rootEditableStyle->visitedDependentColorWithColorFilter(CSSPropertyCaretColor);
     }
index 2e0a891..7ae7299 100644 (file)
@@ -35,7 +35,6 @@
 #include "CachedResourceLoader.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
-#include "ColorBlending.h"
 #include "DOMWindow.h"
 #include "DebugPageOverlays.h"
 #include "DeprecatedGlobalSettings.h"
@@ -4038,11 +4037,11 @@ Color FrameView::documentBackgroundColor() const
     if (!bodyBackgroundColor.isValid()) {
         if (!htmlBackgroundColor.isValid())
             return Color();
-        return blendSourceOver(baseBackgroundColor(), htmlBackgroundColor);
+        return baseBackgroundColor().blend(htmlBackgroundColor);
     }
 
     if (!htmlBackgroundColor.isValid())
-        return blendSourceOver(baseBackgroundColor(), bodyBackgroundColor);
+        return baseBackgroundColor().blend(bodyBackgroundColor);
 
     // We take the aggregate of the base background color
     // the <html> background color, and the <body>
@@ -4051,7 +4050,7 @@ Color FrameView::documentBackgroundColor() const
     // technically part of the document background, but it
     // otherwise poses problems when the aggregate is not
     // fully opaque.
-    return blendSourceOver(blendSourceOver(baseBackgroundColor(), htmlBackgroundColor), bodyBackgroundColor);
+    return baseBackgroundColor().blend(htmlBackgroundColor).blend(bodyBackgroundColor);
 }
 
 bool FrameView::hasCustomScrollbars() const
index 863e9ce..5b6ed5e 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "TextIndicator.h"
 
-#include "ColorBlending.h"
 #include "ColorHash.h"
 #include "Document.h"
 #include "Editor.h"
@@ -250,7 +249,7 @@ static Color estimatedBackgroundColorForRange(const SimpleRange& range, const Fr
     }
     parentRendererBackgroundColors.reverse();
     for (const auto& backgroundColor : parentRendererBackgroundColors)
-        estimatedBackgroundColor = blendSourceOver(estimatedBackgroundColor, backgroundColor);
+        estimatedBackgroundColor = estimatedBackgroundColor.blend(backgroundColor);
 
     return estimatedBackgroundColor;
 }
index bc5ed71..98c3bb9 100644 (file)
@@ -41,7 +41,6 @@
 #include "CachedImage.h"
 #include "CalculationValue.h"
 #include "ClipPathOperation.h"
-#include "ColorBlending.h"
 #include "FloatConversion.h"
 #include "FontCascade.h"
 #include "FontSelectionAlgorithm.h"
index 7b0cf63..63dd040 100644 (file)
@@ -144,6 +144,65 @@ float Color::luminance() const
     return WebCore::luminance(toSRGBALossy());
 }
 
+Color Color::blend(const Color& source) const
+{
+    if (!isVisible() || source.isOpaque())
+        return source;
+
+    if (!source.alpha())
+        return *this;
+
+    auto [selfR, selfG, selfB, selfA] = toSRGBASimpleColorLossy();
+    auto [sourceR, sourceG, sourceB, sourceA] = source.toSRGBASimpleColorLossy();
+
+    int d = 0xFF * (selfA + sourceA) - selfA * sourceA;
+    int a = d / 0xFF;
+    int r = (selfR * selfA * (0xFF - sourceA) + 0xFF * sourceA * sourceR) / d;
+    int g = (selfG * selfA * (0xFF - sourceA) + 0xFF * sourceA * sourceG) / d;
+    int b = (selfB * selfA * (0xFF - sourceA) + 0xFF * sourceA * sourceB) / d;
+
+    return makeSimpleColor(r, g, b, a);
+}
+
+Color Color::blendWithWhite() const
+{
+    constexpr int startAlpha = 153; // 60%
+    constexpr int endAlpha = 204; // 80%;
+    constexpr int alphaIncrement = 17;
+
+    auto blendComponent = [](int c, int a) -> int {
+        float alpha = a / 255.0f;
+        int whiteBlend = 255 - a;
+        c -= whiteBlend;
+        return static_cast<int>(c / alpha);
+    };
+
+    // If the color contains alpha already, we leave it alone.
+    if (!isOpaque())
+        return *this;
+
+    auto [existingR, existingG, existingB, existingAlpha] = toSRGBASimpleColorLossy();
+
+    Color result;
+    for (int alpha = startAlpha; alpha <= endAlpha; alpha += alphaIncrement) {
+        // We have a solid color.  Convert to an equivalent color that looks the same when blended with white
+        // at the current alpha.  Try using less transparency if the numbers end up being negative.
+        int r = blendComponent(existingR, alpha);
+        int g = blendComponent(existingG, alpha);
+        int b = blendComponent(existingB, alpha);
+        
+        result = makeSimpleColor(r, g, b, alpha);
+
+        if (r >= 0 && g >= 0 && b >= 0)
+            break;
+    }
+
+    // FIXME: Why is preserving the semantic bit desired and/or correct here?
+    if (isSemantic())
+        result.tagAsSemantic();
+    return result;
+}
+
 Color Color::colorWithAlpha(float alpha) const
 {
     if (isExtended())
index 61c998f..f3dbf97 100644 (file)
@@ -143,6 +143,10 @@ public:
     // FIXME: Replace remaining uses with luminance.
     WEBCORE_EXPORT float lightness() const;
 
+    // This is an implementation of Porter-Duff's "source-over" equation
+    Color blend(const Color&) const;
+    Color blendWithWhite() const;
+
     Color invertedColorWithAlpha(Optional<float> alpha) const;
     Color invertedColorWithAlpha(float alpha) const;
 
@@ -234,6 +238,9 @@ bool operator!=(const Color&, const Color&);
 // One or both must be extended colors.
 bool extendedColorsEqual(const Color&, const Color&);
 
+Color blend(const Color& from, const Color& to, double progress);
+Color blendWithoutPremultiply(const Color& from, const Color& to, double progress);
+
 #if USE(CG)
 WEBCORE_EXPORT CGColorRef cachedCGColor(const Color&);
 #endif
diff --git a/Source/WebCore/platform/graphics/ColorBlending.cpp b/Source/WebCore/platform/graphics/ColorBlending.cpp
deleted file mode 100644 (file)
index 1b28373..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "ColorBlending.h"
-
-#include "AnimationUtilities.h"
-#include "Color.h"
-
-namespace WebCore {
-
-Color blendSourceOver(const Color& backdrop, const Color& source)
-{
-    if (!backdrop.isVisible() || source.isOpaque())
-        return source;
-
-    if (!source.alpha())
-        return *this;
-
-    auto [backdropR, backdropG, backdropB, backdropA] = backdrop.toSRGBASimpleColorLossy();
-    auto [sourceR, sourceG, sourceB, sourceA] = source.toSRGBASimpleColorLossy();
-
-    int d = 0xFF * (backdropA + sourceA) - backdropA * sourceA;
-    int a = d / 0xFF;
-    int r = (backdropR * backdropA * (0xFF - sourceA) + 0xFF * sourceA * sourceR) / d;
-    int g = (backdropG * backdropA * (0xFF - sourceA) + 0xFF * sourceA * sourceG) / d;
-    int b = (backdropB * backdropA * (0xFF - sourceA) + 0xFF * sourceA * sourceB) / d;
-
-    return makeSimpleColor(r, g, b, a);
-}
-
-Color blendWithWhite(const Color& color)
-{
-    constexpr int startAlpha = 153; // 60%
-    constexpr int endAlpha = 204; // 80%;
-    constexpr int alphaIncrement = 17;
-
-    auto blendComponent = [](int c, int a) -> int {
-        float alpha = a / 255.0f;
-        int whiteBlend = 255 - a;
-        c -= whiteBlend;
-        return static_cast<int>(c / alpha);
-    };
-
-    // If the color contains alpha already, we leave it alone.
-    if (!color.isOpaque())
-        return color;
-
-    auto [existingR, existingG, existingB, existingAlpha] = color.toSRGBASimpleColorLossy();
-
-    SimpleColor result;
-    for (int alpha = startAlpha; alpha <= endAlpha; alpha += alphaIncrement) {
-        // We have a solid color.  Convert to an equivalent color that looks the same when blended with white
-        // at the current alpha.  Try using less transparency if the numbers end up being negative.
-        int r = blendComponent(existingR, alpha);
-        int g = blendComponent(existingG, alpha);
-        int b = blendComponent(existingB, alpha);
-        
-        result = makeSimpleColor(r, g, b, alpha);
-
-        if (r >= 0 && g >= 0 && b >= 0)
-            break;
-    }
-
-    // FIXME: Why is preserving the semantic bit desired and/or correct here?
-    if (color.isSemantic())
-        return Color(result, Color::Semantic);
-    return result;
-}
-
-Color blend(const Color& from, const Color& to, double progress)
-{
-    // FIXME: ExtendedColor - needs to handle color spaces.
-    // We need to preserve the state of the valid flag at the end of the animation
-    if (progress == 1 && !to.isValid())
-        return { };
-
-    // Since premultiplyCeiling() bails on zero alpha, special-case that.
-    auto premultipliedFrom = from.alpha() ? premultiplyCeiling(from.toSRGBASimpleColorLossy()) : Color::transparent;
-    auto premultipliedTo = to.alpha() ? premultiplyCeiling(to.toSRGBASimpleColorLossy()) : Color::transparent;
-
-    SimpleColor premultBlended = makeSimpleColor(
-        WebCore::blend(premultipliedFrom.redComponent(), premultipliedTo.redComponent(), progress),
-        WebCore::blend(premultipliedFrom.greenComponent(), premultipliedTo.greenComponent(), progress),
-        WebCore::blend(premultipliedFrom.blueComponent(), premultipliedTo.blueComponent(), progress),
-        WebCore::blend(premultipliedFrom.alphaComponent(), premultipliedTo.alphaComponent(), progress)
-    );
-
-    return unpremultiply(premultBlended);
-}
-
-Color blendWithoutPremultiply(const Color& from, const Color& to, double progress)
-{
-    // FIXME: ExtendedColor - needs to handle color spaces.
-    // We need to preserve the state of the valid flag at the end of the animation
-    if (progress == 1 && !to.isValid())
-        return { };
-
-    auto fromSRGB = from.toSRGBASimpleColorLossy();
-    auto toSRGB = from.toSRGBASimpleColorLossy();
-
-    return makeSimpleColor(
-        WebCore::blend(fromSRGB.redComponent(), toSRGB.redComponent(), progress),
-        WebCore::blend(fromSRGB.greenComponent(), toSRGB.greenComponent(), progress),
-        WebCore::blend(fromSRGB.blueComponent(), toSRGB.blueComponent(), progress),
-        WebCore::blend(fromSRGB.alphaComponent(), toSRGB.alphaComponent(), progress)
-    );
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/ColorBlending.h b/Source/WebCore/platform/graphics/ColorBlending.h
deleted file mode 100644 (file)
index ed2b807..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-namespace WebCore {
-
-class Color;
-
-// This is an implementation of Porter-Duff's "source-over" equation
-Color blendSourceOver(const Color&, const Color&);
-
-// Bespoke "whitening" algorithm used by RenderTheme::transformSelectionBackgroundColor.
-Color blendWithWhite(const Color&);
-
-Color blend(const Color& from, const Color& to, double progress);
-Color blendWithoutPremultiply(const Color& from, const Color& to, double progress);
-
-}
index 69f764c..f057c24 100644 (file)
@@ -29,7 +29,6 @@
 #include "AnimationUtilities.h"
 #include "CachedResourceLoader.h"
 #include "CachedSVGDocumentReference.h"
-#include "ColorBlending.h"
 #include "ColorMatrix.h"
 #include "ColorUtilities.h"
 #include "FilterEffect.h"
index 5ddfc31..6c31e7d 100644 (file)
@@ -29,7 +29,6 @@
 #include "BitmapImage.h"
 #include "BorderEdge.h"
 #include "CachedImage.h"
-#include "ColorBlending.h"
 #include "Document.h"
 #include "DocumentTimeline.h"
 #include "FloatRoundedRect.h"
@@ -935,7 +934,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
             FloatRect backgroundRectForPainting = snapRectToDevicePixels(backgroundRect, deviceScaleFactor);
             if (baseColor.isVisible()) {
                 if (!baseBgColorOnly && bgColor.isVisible())
-                    baseColor = blendSourceOver(baseColor, bgColor);
+                    baseColor = baseColor.blend(bgColor);
                 context.fillRect(backgroundRectForPainting, baseColor, CompositeOperator::Copy);
             } else if (!baseBgColorOnly && bgColor.isVisible()) {
                 auto operation = context.compositeOperation();
index c02581c..8e09ea5 100644 (file)
@@ -29,7 +29,6 @@
 #include "AccessibilityMenuList.h"
 #include "CSSFontSelector.h"
 #include "Chrome.h"
-#include "ColorBlending.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "HTMLNames.h"
@@ -533,14 +532,14 @@ void RenderMenuList::getItemBackgroundColor(unsigned listIndex, Color& itemBackg
     }
 
     // Otherwise, the item's background is overlayed on top of the menu background.
-    backgroundColor = blendSourceOver(style().visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor), backgroundColor);
+    backgroundColor = style().visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor).blend(backgroundColor);
     if (backgroundColor.isOpaque()) {
         itemBackgroundColor = backgroundColor;
         return;
     }
 
     // If the menu background is not opaque, then add an opaque white background behind.
-    itemBackgroundColor = blendSourceOver(Color::white, backgroundColor);
+    itemBackgroundColor = Color(Color::white).blend(backgroundColor);
 }
 
 PopupMenuStyle RenderMenuList::menuStyle() const
index fc80cb7..a21d52c 100644 (file)
@@ -22,7 +22,6 @@
 #include "RenderTheme.h"
 
 #include "CSSValueKeywords.h"
-#include "ColorBlending.h"
 #include "ControlStates.h"
 #include "Document.h"
 #include "FileList.h"
@@ -617,7 +616,7 @@ Color RenderTheme::inactiveSelectionBackgroundColor(OptionSet<StyleColor::Option
 
 Color RenderTheme::transformSelectionBackgroundColor(const Color& color, OptionSet<StyleColor::Options>) const
 {
-    return blendWithWhite(color);
+    return color.blendWithWhite();
 }
 
 Color RenderTheme::activeSelectionForegroundColor(OptionSet<StyleColor::Options> options) const