Title: [287452] trunk
Revision
287452
Author
wei...@apple.com
Date
2021-12-26 16:46:40 -0800 (Sun, 26 Dec 2021)

Log Message

Replace WebKit/CocoaColor.h with WebCore/ColorCocoa.h, not confusing at all
https://bugs.webkit.org/show_bug.cgi?id=234693

Reviewed by Simon Fraser.

Source/WebKit:

We don't need both. The WebCore one can work for both.

* Platform/cocoa/CocoaColor.h: Removed.
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::typeFromObject):
(IPC::encodeColorInternal):
(IPC::encodeObject):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView themeColor]):
(-[WKWebView underPageBackgroundColor]):
(-[WKWebView setUnderPageBackgroundColor:]):
(-[WKWebView _themeColor]):
(-[WKWebView _pageExtendedBackgroundColor]):
(-[WKWebView _sampledPageTopColor]):
* UIProcess/API/Cocoa/_WKApplicationManifest.mm:
(-[_WKApplicationManifest initWithCoder:]):
(-[_WKApplicationManifest themeColor]):
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(colorForItem):
(-[WKSafeBrowsingBox setSafeBrowsingBackgroundColor:]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
(-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):

Tools:

Use WebCore/ColorCocoa.h instead.

* TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewThemeColor.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewUnderPageBackgroundColor.mm:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (287451 => 287452)


--- trunk/Source/WebKit/ChangeLog	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/ChangeLog	2021-12-27 00:46:40 UTC (rev 287452)
@@ -1,3 +1,37 @@
+2021-12-26  Sam Weinig  <wei...@apple.com>
+
+        Replace WebKit/CocoaColor.h with WebCore/ColorCocoa.h, not confusing at all
+        https://bugs.webkit.org/show_bug.cgi?id=234693
+
+        Reviewed by Simon Fraser.
+
+        We don't need both. The WebCore one can work for both.
+
+        * Platform/cocoa/CocoaColor.h: Removed.
+        * Shared/Cocoa/ArgumentCodersCocoa.mm:
+        (IPC::typeFromObject):
+        (IPC::encodeColorInternal):
+        (IPC::encodeObject):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView themeColor]):
+        (-[WKWebView underPageBackgroundColor]):
+        (-[WKWebView setUnderPageBackgroundColor:]):
+        (-[WKWebView _themeColor]):
+        (-[WKWebView _pageExtendedBackgroundColor]):
+        (-[WKWebView _sampledPageTopColor]):
+        * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
+        (-[_WKApplicationManifest initWithCoder:]):
+        (-[_WKApplicationManifest themeColor]):
+        * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
+        * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
+        (colorForItem):
+        (-[WKSafeBrowsingBox setSafeBrowsingBackgroundColor:]):
+        (-[WKSafeBrowsingWarning showDetailsClicked]):
+        (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::PDFPlugin):
+
 2021-12-26  Yousuke Kimoto  <yousuke.kim...@sony.com>
 
         RemoteInspectorProtocolHandler::inspect() expects ConnectionID as uint32_t

Deleted: trunk/Source/WebKit/Platform/cocoa/CocoaColor.h (287451 => 287452)


--- trunk/Source/WebKit/Platform/cocoa/CocoaColor.h	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/Platform/cocoa/CocoaColor.h	2021-12-27 00:46:40 UTC (rev 287452)
@@ -1,36 +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
-
-#include <wtf/Compiler.h>
-
-#if USE(APPKIT)
-OBJC_CLASS NSColor;
-using CocoaColor = NSColor;
-#else
-OBJC_CLASS UIColor;
-using CocoaColor = UIColor;
-#endif

Modified: trunk/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm (287451 => 287452)


--- trunk/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm	2021-12-27 00:46:40 UTC (rev 287452)
@@ -29,7 +29,6 @@
 #if PLATFORM(COCOA)
 
 #import "ArgumentCodersCF.h"
-#import "CocoaColor.h"
 #import "CocoaFont.h"
 #import "CoreTextHelpers.h"
 #import <CoreText/CTFont.h>
@@ -172,7 +171,7 @@
     // Specific classes handled.
     if ([object isKindOfClass:[NSArray class]])
         return NSType::Array;
-    if ([object isKindOfClass:[CocoaColor class]])
+    if ([object isKindOfClass:[WebCore::CocoaColor class]])
         return NSType::Color;
     if ([object isKindOfClass:[NSData class]])
         return NSType::Data;
@@ -261,7 +260,7 @@
 
 #pragma mark - NSColor / UIColor
 
-static inline void encodeColorInternal(Encoder& encoder, CocoaColor *color)
+static inline void encodeColorInternal(Encoder& encoder, WebCore::CocoaColor *color)
 {
     encoder << colorFromCocoaColor(color);
 }
@@ -491,7 +490,7 @@
         encodeArrayInternal(encoder, static_cast<NSArray *>(object));
         return;
     case NSType::Color:
-        encodeColorInternal(encoder, static_cast<CocoaColor *>(object));
+        encodeColorInternal(encoder, static_cast<WebCore::CocoaColor *>(object));
         return;
     case NSType::Dictionary:
         encodeDictionaryInternal(encoder, static_cast<NSDictionary *>(object));

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (287451 => 287452)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-12-27 00:46:40 UTC (rev 287452)
@@ -30,7 +30,6 @@
 #import "APIFrameTreeNode.h"
 #import "APIPageConfiguration.h"
 #import "APISerializedScriptValue.h"
-#import "CocoaColor.h"
 #import "CocoaImage.h"
 #import "CompletionHandlerCallChecker.h"
 #import "ContentAsStringIncludesChildFrames.h"
@@ -1776,17 +1775,17 @@
     return wrapper(_page->loadFile(URL.absoluteString, readAccessURL.absoluteString, isAppInitiated));
 }
 
-- (CocoaColor *)themeColor
+- (WebCore::CocoaColor *)themeColor
 {
     return cocoaColorOrNil(_page->themeColor()).autorelease();
 }
 
-- (CocoaColor *)underPageBackgroundColor
+- (WebCore::CocoaColor *)underPageBackgroundColor
 {
     return cocoaColor(_page->underPageBackgroundColor()).autorelease();
 }
 
-- (void)setUnderPageBackgroundColor:(CocoaColor *)underPageBackgroundColorOverride
+- (void)setUnderPageBackgroundColor:(WebCore::CocoaColor *)underPageBackgroundColorOverride
 {
     _page->setUnderPageBackgroundColorOverride(WebCore::roundAndClampToSRGBALossy(underPageBackgroundColorOverride.CGColor));
 }
@@ -3326,18 +3325,18 @@
 }
 
 // FIXME: Remove old `-[WKWebView _themeColor]` SPI <rdar://76662644>
-- (CocoaColor *)_themeColor
+- (WebCore::CocoaColor *)_themeColor
 {
     return [self themeColor];
 }
 
 // FIXME: Remove old `-[WKWebView _pageExtendedBackgroundColor]` SPI <rdar://77789732>
-- (CocoaColor *)_pageExtendedBackgroundColor
+- (WebCore::CocoaColor *)_pageExtendedBackgroundColor
 {
     return cocoaColorOrNil(_page->pageExtendedBackgroundColor()).autorelease();
 }
 
-- (CocoaColor *)_sampledPageTopColor
+- (WebCore::CocoaColor *)_sampledPageTopColor
 {
     return cocoaColorOrNil(_page->sampledPageTopColor()).autorelease();
 }

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifest.mm (287451 => 287452)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifest.mm	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifest.mm	2021-12-27 00:46:40 UTC (rev 287452)
@@ -26,7 +26,6 @@
 #import "config.h"
 #import "_WKApplicationManifestInternal.h"
 
-#import "CocoaColor.h"
 #import <WebCore/ApplicationManifest.h>
 #import <WebCore/ApplicationManifestParser.h>
 #import <WebCore/Color.h>
@@ -156,7 +155,7 @@
     URL scopeURL = [aDecoder decodeObjectOfClass:[NSURL class] forKey:@"scope"];
     NSInteger display = [aDecoder decodeIntegerForKey:@"display"];
     URL startURL = [aDecoder decodeObjectOfClass:[NSURL class] forKey:@"start_url"];
-    CocoaColor *themeColor = [aDecoder decodeObjectOfClass:[CocoaColor class] forKey:@"theme_color"];
+    WebCore::CocoaColor *themeColor = [aDecoder decodeObjectOfClass:[WebCore::CocoaColor class] forKey:@"theme_color"];
     NSArray<_WKApplicationManifestIcon *> *icons = [aDecoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [_WKApplicationManifestIcon class]]] forKey:@"icons"];
 
     WebCore::ApplicationManifest coreApplicationManifest {
@@ -238,7 +237,7 @@
     return _applicationManifest->applicationManifest().startURL;
 }
 
-- (CocoaColor *)themeColor
+- (WebCore::CocoaColor *)themeColor
 {
     return cocoaColor(_applicationManifest->applicationManifest().themeColor).autorelease();
 }
@@ -313,7 +312,7 @@
     return nil;
 }
 
-- (CocoaColor *)themeColor
+- (WebCore::CocoaColor *)themeColor
 {
     return nil;
 }

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h (287451 => 287452)


--- trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h	2021-12-27 00:46:40 UTC (rev 287452)
@@ -23,8 +23,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "CocoaColor.h"
 #import "WKFoundation.h"
+#import <WebCore/ColorCocoa.h>
 #import <variant>
 #import <wtf/CompletionHandler.h>
 #import <wtf/RefPtr.h>
@@ -55,10 +55,10 @@
 @interface WKSafeBrowsingBox : ViewType {
 @package
 #if PLATFORM(MAC)
-    RetainPtr<CocoaColor> _backgroundColor;
+    RetainPtr<WebCore::CocoaColor> _backgroundColor;
 #endif
 }
-- (void)setSafeBrowsingBackgroundColor:(CocoaColor *)color;
+- (void)setSafeBrowsingBackgroundColor:(WebCore::CocoaColor *)color;
 @end
 
 #if PLATFORM(MAC)

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm (287451 => 287452)


--- trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm	2021-12-27 00:46:40 UTC (rev 287452)
@@ -103,12 +103,12 @@
 #endif
 }
 
-static CocoaColor *colorForItem(WarningItem item, ViewType *warning)
+static WebCore::CocoaColor *colorForItem(WarningItem item, ViewType *warning)
 {
     ASSERT([warning isKindOfClass:[WKSafeBrowsingWarning class]]);
 #if PLATFORM(MAC)
 
-    auto colorNamed = [] (NSString *name) -> CocoaColor * {
+    auto colorNamed = [] (NSString *name) -> WebCore::CocoaColor * {
 #if HAVE(SAFE_BROWSING)
         return [NSColor colorNamed:name bundle:[NSBundle bundleWithIdentifier:@"com.apple.WebKit"]];
 #else
@@ -262,7 +262,7 @@
 
 @implementation WKSafeBrowsingBox
 
-- (void)setSafeBrowsingBackgroundColor:(CocoaColor *)color
+- (void)setSafeBrowsingBackgroundColor:(WebCore::CocoaColor *)color
 {
 #if PLATFORM(MAC)
     _backgroundColor = color;
@@ -436,7 +436,7 @@
 #endif
 
     auto line = adoptNS([WKSafeBrowsingBox new]);
-    [line setSafeBrowsingBackgroundColor:[CocoaColor lightGrayColor]];
+    [line setSafeBrowsingBackgroundColor:[WebCore::CocoaColor lightGrayColor]];
     for (ViewType *view in @[details.get(), bottom.get(), line.get()])
         view.translatesAutoresizingMaskIntoConstraints = NO;
 
@@ -573,7 +573,7 @@
     self->_warning = warning;
     self.delegate = warning;
 
-    CocoaColor *foregroundColor = colorForItem(WarningItem::MessageText, warning);
+    auto *foregroundColor = colorForItem(WarningItem::MessageText, warning);
     auto string = adoptNS([attributedString mutableCopy]);
     [string addAttributes:@{ NSForegroundColorAttributeName : foregroundColor } range:NSMakeRange(0, [string length])];
     [self setBackgroundColor:colorForItem(WarningItem::BoxBackground, warning)];

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (287451 => 287452)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2021-12-27 00:46:40 UTC (rev 287452)
@@ -2016,7 +2016,6 @@
 		F4DBC0C1276AA6CA0001D169 /* _WKModalContainerInfoInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = F4DBC0C0276AA6CA0001D169 /* _WKModalContainerInfoInternal.h */; };
 		F4EB4AFD269CD7F300D297AE /* OSStateSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = F4EB4AFC269CD23600D297AE /* OSStateSPI.h */; };
 		F4EC94E32356CC57000BB614 /* ApplicationServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 29D04E2821F7C73D0076741D /* ApplicationServicesSPI.h */; };
-		F4FE0A3B24632B60002631E1 /* CocoaColor.h in Headers */ = {isa = PBXBuildFile; fileRef = F4FE0A3A24632B10002631E1 /* CocoaColor.h */; };
 		F6113E25126CE1820057D0A7 /* APIUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = F6113E24126CE1820057D0A7 /* APIUserContentURLPattern.h */; };
 		F6113E29126CE19B0057D0A7 /* WKUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = F6113E27126CE19B0057D0A7 /* WKUserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		F634445612A885C8000612D8 /* APISecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = F634445512A885C8000612D8 /* APISecurityOrigin.h */; };
@@ -6447,7 +6446,6 @@
 		F4EB4AFC269CD23600D297AE /* OSStateSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSStateSPI.h; sourceTree = "<group>"; };
 		F4F59AD32065A5C9006CAA46 /* WKSelectMenuListViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKSelectMenuListViewController.mm; path = ios/forms/WKSelectMenuListViewController.mm; sourceTree = "<group>"; };
 		F4F59AD42065A5CA006CAA46 /* WKSelectMenuListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKSelectMenuListViewController.h; path = ios/forms/WKSelectMenuListViewController.h; sourceTree = "<group>"; };
-		F4FE0A3A24632B10002631E1 /* CocoaColor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CocoaColor.h; sourceTree = "<group>"; };
 		F4FE0A3C24635667002631E1 /* CocoaFont.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CocoaFont.h; sourceTree = "<group>"; };
 		F6113E24126CE1820057D0A7 /* APIUserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIUserContentURLPattern.h; sourceTree = "<group>"; };
 		F6113E26126CE19B0057D0A7 /* WKUserContentURLPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserContentURLPattern.cpp; sourceTree = "<group>"; };
@@ -9169,7 +9167,6 @@
 		4450AEBE1DC3FAAC009943F2 /* cocoa */ = {
 			isa = PBXGroup;
 			children = (
-				F4FE0A3A24632B10002631E1 /* CocoaColor.h */,
 				F4FE0A3C24635667002631E1 /* CocoaFont.h */,
 				4482734624528F6000A95493 /* CocoaImage.h */,
 				BCE0937614FB128B001138D9 /* LayerHostingContext.h */,
@@ -12840,7 +12837,6 @@
 				4659F25F275FF6B200BBB369 /* CaptivePortalModeObserver.h in Headers */,
 				BCE579A62634836700F5C5E9 /* CGDisplayListImageBufferBackend.h in Headers */,
 				57B4B46020B504AC00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h in Headers */,
-				F4FE0A3B24632B60002631E1 /* CocoaColor.h in Headers */,
 				4482734724528F6000A95493 /* CocoaImage.h in Headers */,
 				CE11AD521CBC482F00681EE5 /* CodeSigning.h in Headers */,
 				37BEC4E119491486008B4286 /* CompletionHandlerCallChecker.h in Headers */,

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (287451 => 287452)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2021-12-27 00:46:40 UTC (rev 287452)
@@ -29,7 +29,6 @@
 #if ENABLE(PDFKIT_PLUGIN)
 
 #import "ArgumentCoders.h"
-#import "CocoaColor.h"
 #import "DataReference.h"
 #import "FrameInfoData.h"
 #import "Logging.h"
@@ -62,6 +61,7 @@
 #import <WebCore/CSSPropertyNames.h>
 #import <WebCore/Chrome.h>
 #import <WebCore/Color.h>
+#import <WebCore/ColorCocoa.h>
 #import <WebCore/ColorSerialization.h>
 #import <WebCore/Cursor.h>
 #import <WebCore/DictionaryLookup.h>
@@ -656,7 +656,7 @@
         auto* document = frame.coreFrame()->document();
 
         // FIXME: <rdar://problem/75332948> get the background color from PDFKit instead of hardcoding it
-        document->bodyOrFrameset()->setInlineStyleProperty(WebCore::CSSPropertyBackgroundColor, WebCore::serializationForHTML(WebCore::roundAndClampToSRGBALossy([CocoaColor grayColor].CGColor)));
+        document->bodyOrFrameset()->setInlineStyleProperty(WebCore::CSSPropertyBackgroundColor, WebCore::serializationForHTML(WebCore::roundAndClampToSRGBALossy([WebCore::CocoaColor grayColor].CGColor)));
     }
 
     if (supportsForms()) {

Modified: trunk/Tools/ChangeLog (287451 => 287452)


--- trunk/Tools/ChangeLog	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Tools/ChangeLog	2021-12-27 00:46:40 UTC (rev 287452)
@@ -1,3 +1,16 @@
+2021-12-26  Sam Weinig  <wei...@apple.com>
+
+        Replace WebKit/CocoaColor.h with WebCore/ColorCocoa.h, not confusing at all
+        https://bugs.webkit.org/show_bug.cgi?id=234693
+
+        Reviewed by Simon Fraser.
+
+        Use WebCore/ColorCocoa.h instead.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm:
+        * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewThemeColor.mm:
+        * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewUnderPageBackgroundColor.mm:
+
 2021-12-24  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK][a11y] Expose live region attributes with ATSPI

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm (287451 => 287452)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm	2021-12-27 00:46:40 UTC (rev 287452)
@@ -28,10 +28,10 @@
 
 #if PLATFORM(COCOA)
 
-#import "CocoaColor.h"
 #import "PasteboardUtilities.h"
 #import "PlatformUtilities.h"
 #import "TestWKWebView.h"
+#import <WebCore/ColorCocoa.h>
 #import <WebKit/WKPreferencesPrivate.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/text/WTFString.h>
@@ -153,7 +153,7 @@
         EXPECT_WK_STREQ("我叫謝文昇", [attributedString string]);
 
         __block BOOL foundColorAttribute = NO;
-        [attributedString enumerateAttribute:NSForegroundColorAttributeName inRange:NSMakeRange(0, 5) options:0 usingBlock:^(CocoaColor *color, NSRange range, BOOL*) {
+        [attributedString enumerateAttribute:NSForegroundColorAttributeName inRange:NSMakeRange(0, 5) options:0 usingBlock:^(WebCore::CocoaColor *color, NSRange range, BOOL*) {
             CGFloat redComponent = 0;
             CGFloat greenComponent = 0;
             CGFloat blueComponent = 0;

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewThemeColor.mm (287451 => 287452)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewThemeColor.mm	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewThemeColor.mm	2021-12-27 00:46:40 UTC (rev 287452)
@@ -25,7 +25,6 @@
 
 #import "config.h"
 
-#import "CocoaColor.h"
 #import "TestCocoa.h"
 #import "TestWKWebView.h"
 #import <WebKit/WKPreferencesPrivate.h>

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewUnderPageBackgroundColor.mm (287451 => 287452)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewUnderPageBackgroundColor.mm	2021-12-27 00:03:41 UTC (rev 287451)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewUnderPageBackgroundColor.mm	2021-12-27 00:46:40 UTC (rev 287452)
@@ -25,9 +25,9 @@
 
 #import "config.h"
 
-#import "CocoaColor.h"
 #import "TestCocoa.h"
 #import "TestWKWebView.h"
+#import <WebCore/ColorCocoa.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <wtf/RetainPtr.h>
 
@@ -46,7 +46,7 @@
 #elif HAVE(OS_DARK_MODE_SUPPORT) && PLATFORM(IOS_FAMILY)
     auto color = retainPtr(UIColor.systemBackgroundColor);
 #else
-    auto color = retainPtr([CocoaColor whiteColor]);
+    auto color = retainPtr([WebCore::CocoaColor whiteColor]);
 #endif
 
     // Some of the above can sometimes be a monochrome color, so convert it to sRGB so the comparisons below work.
@@ -196,7 +196,7 @@
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, redColor.get()));
 
     [underPageBackgroundColorObserver setState:@"should-not-change"];
-    [webView setUnderPageBackgroundColor:[CocoaColor colorWithCGColor:redColor.get()]];
+    [webView setUnderPageBackgroundColor:[WebCore::CocoaColor colorWithCGColor:redColor.get()]];
     EXPECT_NSSTRING_EQ("should-not-change", [underPageBackgroundColorObserver state]);
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, redColor.get()));
 
@@ -212,7 +212,7 @@
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, blueColor.get()));
 
     [underPageBackgroundColorObserver setState:@"should-not-change"];
-    [webView setUnderPageBackgroundColor:[CocoaColor colorWithCGColor:blueColor.get()]];
+    [webView setUnderPageBackgroundColor:[WebCore::CocoaColor colorWithCGColor:blueColor.get()]];
     EXPECT_NSSTRING_EQ("should-not-change", [underPageBackgroundColorObserver state]);
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, blueColor.get()));
 
@@ -228,7 +228,7 @@
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, defaultBackgroundColor().get()));
 
     [underPageBackgroundColorObserver setState:@"should-not-change"];
-    [webView setUnderPageBackgroundColor:[CocoaColor colorWithCGColor:defaultBackgroundColor().get()]];
+    [webView setUnderPageBackgroundColor:[WebCore::CocoaColor colorWithCGColor:defaultBackgroundColor().get()]];
     EXPECT_NSSTRING_EQ("should-not-change", [underPageBackgroundColorObserver state]);
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, defaultBackgroundColor().get()));
 
@@ -238,12 +238,12 @@
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, defaultBackgroundColor().get()));
 
     [underPageBackgroundColorObserver setState:@"before-nonnull-override"];
-    [webView setUnderPageBackgroundColor:[CocoaColor colorWithCGColor:redColor.get()]];
+    [webView setUnderPageBackgroundColor:[WebCore::CocoaColor colorWithCGColor:redColor.get()]];
     EXPECT_NSSTRING_EQ("after-nonnull-override", [underPageBackgroundColorObserver state]);
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, redColor.get()));
 
     [underPageBackgroundColorObserver setState:@"should-not-change"];
-    [webView setUnderPageBackgroundColor:[CocoaColor colorWithCGColor:redColor.get()]];
+    [webView setUnderPageBackgroundColor:[WebCore::CocoaColor colorWithCGColor:redColor.get()]];
     EXPECT_NSSTRING_EQ("should-not-change", [underPageBackgroundColorObserver state]);
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, redColor.get()));
 
@@ -293,13 +293,13 @@
     EXPECT_TRUE(CGColorEqualToColor([webView scrollView].backgroundColor.CGColor, redColor.get()));
     EXPECT_EQ([webView scrollView].indicatorStyle, UIScrollViewIndicatorStyleWhite);
 
-    [webView setUnderPageBackgroundColor:[CocoaColor colorWithCGColor:blueColor.get()]];
+    [webView setUnderPageBackgroundColor:[WebCore::CocoaColor colorWithCGColor:blueColor.get()]];
     [webView waitForNextPresentationUpdate];
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, blueColor.get()));
     EXPECT_TRUE(CGColorEqualToColor([webView scrollView].backgroundColor.CGColor, blueColor.get()));
     EXPECT_EQ([webView scrollView].indicatorStyle, UIScrollViewIndicatorStyleWhite);
 
-    [webView setUnderPageBackgroundColor:[CocoaColor colorWithCGColor:whiteColor.get()]];
+    [webView setUnderPageBackgroundColor:[WebCore::CocoaColor colorWithCGColor:whiteColor.get()]];
     [webView waitForNextPresentationUpdate];
     EXPECT_TRUE(CGColorEqualToColor([webView underPageBackgroundColor].CGColor, whiteColor.get()));
     EXPECT_TRUE(CGColorEqualToColor([webView scrollView].backgroundColor.CGColor, whiteColor.get()));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to