Title: [165083] trunk/Source/WebKit2
Revision
165083
Author
[email protected]
Date
2014-03-04 16:26:54 -0800 (Tue, 04 Mar 2014)

Log Message

WKPage's pageExtendedBackgroundColor API exposed through WKView/WKWebView should support NSColor
https://bugs.webkit.org/show_bug.cgi?id=129704

Patch by Conrad Shultz <[email protected]> on 2014-03-04
Reviewed by Beth Dakin.

Add NSColor-returning methods to complement the existing UIColor-returning methods.

* UIProcess/API/Cocoa/WKViewPrivate.h:
Declare _pageExtendedBackgroundColor for non-TARGET_OS_IPHONE.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _pageExtendedBackgroundColor]):
Return an NSColor created from the pageExtendedBackgroundColor.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Declare _pageExtendedBackgroundColor for non-TARGET_OS_IPHONE.

* UIProcess/API/mac/WKView.mm:
(-[WKView _pageExtendedBackgroundColor]):
Return an NSColor created from the pageExtendedBackgroundColor.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (165082 => 165083)


--- trunk/Source/WebKit2/ChangeLog	2014-03-05 00:07:38 UTC (rev 165082)
+++ trunk/Source/WebKit2/ChangeLog	2014-03-05 00:26:54 UTC (rev 165083)
@@ -1,3 +1,26 @@
+2014-03-04  Conrad Shultz  <[email protected]>
+
+        WKPage's pageExtendedBackgroundColor API exposed through WKView/WKWebView should support NSColor
+        https://bugs.webkit.org/show_bug.cgi?id=129704
+
+        Reviewed by Beth Dakin.
+
+        Add NSColor-returning methods to complement the existing UIColor-returning methods.
+
+        * UIProcess/API/Cocoa/WKViewPrivate.h:
+        Declare _pageExtendedBackgroundColor for non-TARGET_OS_IPHONE.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _pageExtendedBackgroundColor]):
+        Return an NSColor created from the pageExtendedBackgroundColor.
+
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        Declare _pageExtendedBackgroundColor for non-TARGET_OS_IPHONE.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _pageExtendedBackgroundColor]):
+        Return an NSColor created from the pageExtendedBackgroundColor.
+
 2014-03-04  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Give WebProcess private RWI entitlement

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h (165082 => 165083)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h	2014-03-05 00:07:38 UTC (rev 165082)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h	2014-03-05 00:26:54 UTC (rev 165083)
@@ -81,6 +81,7 @@
 @property (readwrite) double magnification;
 @property (readwrite) BOOL allowsBackForwardNavigationGestures;
 
+@property (readonly) NSColor *_pageExtendedBackgroundColor;
 @property(copy, nonatomic) NSColor *underlayColor;
 
 - (NSView*)fullScreenPlaceholderView;

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (165082 => 165083)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-03-05 00:07:38 UTC (rev 165082)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-03-05 00:26:54 UTC (rev 165083)
@@ -67,6 +67,7 @@
 
 #if PLATFORM(MAC)
 #import "WKViewInternal.h"
+#import <WebCore/ColorMac.h>
 #endif
 
 @implementation WKWebView {
@@ -839,6 +840,19 @@
     [self _updateVisibleContentRectsWithStableState:YES];
 }
 
+#else
+
+#pragma mark - OS X-specific methods
+
+- (NSColor *)_pageExtendedBackgroundColor
+{
+    WebCore::Color color = _page->pageExtendedBackgroundColor();
+    if (!color.isValid())
+        return nil;
+
+    return nsColor(color);
+}
+
 #endif
 
 @end

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (165082 => 165083)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2014-03-05 00:07:38 UTC (rev 165082)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2014-03-05 00:26:54 UTC (rev 165083)
@@ -74,6 +74,8 @@
 
 - (void)_beginInteractiveObscuredInsetsChange;
 - (void)_endInteractiveObscuredInsetsChange;
+#else
+@property (readonly) NSColor *_pageExtendedBackgroundColor;
 #endif
 
 @end

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (165082 => 165083)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-03-05 00:07:38 UTC (rev 165082)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-03-05 00:26:54 UTC (rev 165083)
@@ -3260,6 +3260,15 @@
     return _data->_allowsBackForwardNavigationGestures;
 }
 
+- (NSColor *)_pageExtendedBackgroundColor
+{
+    WebCore::Color color = _data->_page->pageExtendedBackgroundColor();
+    if (!color.isValid())
+        return nil;
+
+    return nsColor(color);
+}
+
 // This method forces a drawing area geometry update, even if frame size updates are disabled.
 // The updated is performed asynchronously; we don't wait for the geometry update before returning.
 // The area drawn need not match the current frame size - if it differs it will be anchored to the
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to