Title: [216229] trunk/Source
Revision
216229
Author
commit-qu...@webkit.org
Date
2017-05-04 19:32:26 -0700 (Thu, 04 May 2017)

Log Message

UIColor +whiteColor and +clearColor are ambiguous and need to be casted when soft linked.
https://bugs.webkit.org/show_bug.cgi?id=171704

Patch by Jeremy Jones <jere...@apple.com> on 2017-05-04
Reviewed by Jer Noble.

Source/WebCore:

No new tests because no behavior change.

Fix build by casting result of +clearColor to UIColor.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(clearUIColor):
(WebVideoFullscreenInterfaceAVKit::setupFullscreen):
(WebVideoFullscreenInterfaceAVKit::exitFullscreen):
(WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):

Source/WebKit/mac:

Fix build by casting result of +whiteColor to UIColor.

* WebView/WebView.mm:
(-[WebView _createImageWithPlatterForImage:boundingRect:contentScaleFactor:clippingRects:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (216228 => 216229)


--- trunk/Source/WebCore/ChangeLog	2017-05-05 02:19:14 UTC (rev 216228)
+++ trunk/Source/WebCore/ChangeLog	2017-05-05 02:32:26 UTC (rev 216229)
@@ -1,3 +1,20 @@
+2017-05-04  Jeremy Jones  <jere...@apple.com>
+
+        UIColor +whiteColor and +clearColor are ambiguous and need to be casted when soft linked.
+        https://bugs.webkit.org/show_bug.cgi?id=171704
+
+        Reviewed by Jer Noble.
+
+        No new tests because no behavior change.
+
+        Fix build by casting result of +clearColor to UIColor.
+
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (clearUIColor):
+        (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
+        (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
+        (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
+
 2017-05-04  Chris Dumez  <cdu...@apple.com>
 
         Element.slot should be marked as [Unscopable]

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (216228 => 216229)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2017-05-05 02:19:14 UTC (rev 216228)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2017-05-05 02:32:26 UTC (rev 216229)
@@ -75,6 +75,11 @@
 SOFT_LINK_CLASS(UIKit, UIColor)
 SOFT_LINK_CONSTANT(UIKit, UIRemoteKeyboardLevel, UIWindowLevel)
 
+static UIColor *clearUIColor()
+{
+    return (UIColor *)[getUIColorClass() clearColor];
+}
+
 #if !LOG_DISABLED
 static const char* boolString(bool val)
 {
@@ -602,7 +607,7 @@
     if (![[parentView window] _isHostedInAnotherProcess]) {
         if (!m_window)
             m_window = adoptNS([allocUIWindowInstance() initWithFrame:[[getUIScreenClass() mainScreen] bounds]]);
-        [m_window setBackgroundColor:[getUIColorClass() clearColor]];
+        [m_window setBackgroundColor:clearUIColor()];
         if (!m_viewController)
             m_viewController = adoptNS([allocUIViewControllerInstance() init]);
         [[m_viewController view] setFrame:[m_window bounds]];
@@ -615,7 +620,7 @@
     if (!m_playerLayerView)
         m_playerLayerView = adoptNS([[getWebAVPlayerLayerViewClass() alloc] init]);
     [m_playerLayerView setHidden:[playerController() isExternalPlaybackActive]];
-    [m_playerLayerView setBackgroundColor:[getUIColorClass() clearColor]];
+    [m_playerLayerView setBackgroundColor:clearUIColor()];
 
     if (!isInPictureInPictureMode) {
         [m_playerLayerView setVideoView:&videoView];
@@ -646,7 +651,7 @@
 
     [m_playerViewController view].frame = [parentView convertRect:initialRect toView:[m_playerViewController view].superview];
 
-    [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
+    [[m_playerViewController view] setBackgroundColor:clearUIColor()];
     [[m_playerViewController view] setAutoresizingMask:(UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin)];
 
     [[m_playerViewController view] setNeedsLayout];
@@ -748,8 +753,8 @@
 
             [CATransaction begin];
             [CATransaction setDisableActions:YES];
-            [m_playerLayerView setBackgroundColor:[getUIColorClass() clearColor]];
-            [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
+            [m_playerLayerView setBackgroundColor:clearUIColor()];
+            [[m_playerViewController view] setBackgroundColor:clearUIColor()];
             [CATransaction commit];
 
             dispatch_async(dispatch_get_main_queue(), [protectedThis, this]() {
@@ -930,8 +935,8 @@
 
     m_exitCompleted = true;
 
-    [m_playerLayerView setBackgroundColor:[getUIColorClass() clearColor]];
-    [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
+    [m_playerLayerView setBackgroundColor:clearUIColor()];
+    [[m_playerViewController view] setBackgroundColor:clearUIColor()];
 
     clearMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
     

Modified: trunk/Source/WebKit/mac/ChangeLog (216228 => 216229)


--- trunk/Source/WebKit/mac/ChangeLog	2017-05-05 02:19:14 UTC (rev 216228)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-05-05 02:32:26 UTC (rev 216229)
@@ -1,3 +1,15 @@
+2017-05-04  Jeremy Jones  <jere...@apple.com>
+
+        UIColor +whiteColor and +clearColor are ambiguous and need to be casted when soft linked.
+        https://bugs.webkit.org/show_bug.cgi?id=171704
+
+        Reviewed by Jer Noble.
+
+        Fix build by casting result of +whiteColor to UIColor.
+
+        * WebView/WebView.mm:
+        (-[WebView _createImageWithPlatterForImage:boundingRect:contentScaleFactor:clippingRects:]):
+
 2017-05-04  Sam Weinig  <s...@webkit.org>
 
         Remove support for legacy Notifications

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (216228 => 216229)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2017-05-05 02:19:14 UTC (rev 216228)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2017-05-05 02:32:26 UTC (rev 216229)
@@ -1877,7 +1877,7 @@
 
     // FIXME: This should match the background color of the text, or if the background cannot be captured as a single color, we should fall back
     // to a default representation, e.g. black text on a white background.
-    CGContextSetFillColorWithColor(newContext, [[getUIColorClass() whiteColor] CGColor]);
+    CGContextSetFillColorWithColor(newContext, [(UIColor *)[getUIColorClass() whiteColor] CGColor]);
     for (auto textBoundingRect : scaledClippingRects)
         CGContextFillRect(newContext, textBoundingRect);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to