Diff
Modified: trunk/Source/WebCore/ChangeLog (144396 => 144397)
--- trunk/Source/WebCore/ChangeLog 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebCore/ChangeLog 2013-03-01 00:47:10 UTC (rev 144397)
@@ -1,3 +1,31 @@
+2013-02-28 Conrad Shultz <[email protected]>
+
+ Need API to control page underlay color
+ https://bugs.webkit.org/show_bug.cgi?id=110918
+
+ Reviewed by Simon Fraser.
+
+ * page/ChromeClient.h:
+ (ChromeClient):
+ Declare underlayColor().
+
+ * platform/ScrollbarTheme.h:
+ (WebCore::ScrollbarTheme::setUpOverhangAreasLayerContents):
+ Have setUpOverhangAreasLayerContents() take a background color parameter.
+
+ * platform/mac/ScrollbarThemeMac.h:
+ (ScrollbarThemeMac):
+ Ditto.
+
+ * platform/mac/ScrollbarThemeMac.mm:
+ Include ColorMac.h.
+ (WebCore::ScrollbarThemeMac::setUpOverhangAreasLayerContents):
+ Use the passed-in background color, if valid, for the overhang area layer.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
+ Get the underlay color from the chrome client and pass it into setUpOverhangAreasLayerContents().
+
2013-02-28 Beth Dakin <[email protected]>
RelevantRepaintedObjects heuristic should ensure there is some coverage in the
Modified: trunk/Source/WebCore/page/ChromeClient.h (144396 => 144397)
--- trunk/Source/WebCore/page/ChromeClient.h 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebCore/page/ChromeClient.h 2013-03-01 00:47:10 UTC (rev 144397)
@@ -187,6 +187,8 @@
virtual void print(Frame*) = 0;
virtual bool shouldRubberBandInDirection(ScrollDirection) const = 0;
+ virtual Color underlayColor() const { return Color(); }
+
#if ENABLE(SQL_DATABASE)
virtual void exceededDatabaseQuota(Frame*, const String& databaseName, DatabaseDetails) = 0;
#endif
Modified: trunk/Source/WebCore/platform/ScrollbarTheme.h (144396 => 144397)
--- trunk/Source/WebCore/platform/ScrollbarTheme.h 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebCore/platform/ScrollbarTheme.h 2013-03-01 00:47:10 UTC (rev 144397)
@@ -90,7 +90,7 @@
virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect&, const IntRect&, const IntRect&) { }
#if USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
- virtual void setUpOverhangAreasLayerContents(GraphicsLayer*) { }
+ virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) { }
virtual void setUpContentShadowLayer(GraphicsLayer*) { }
#endif
Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h (144396 => 144397)
--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h 2013-03-01 00:47:10 UTC (rev 144397)
@@ -82,7 +82,7 @@
int scrollbarPartToHIPressedState(ScrollbarPart);
#if !PLATFORM(CHROMIUM) && USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
- virtual void setUpOverhangAreasLayerContents(GraphicsLayer*) OVERRIDE;
+ virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) OVERRIDE;
virtual void setUpContentShadowLayer(GraphicsLayer*) OVERRIDE;
#endif
};
Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm (144396 => 144397)
--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm 2013-03-01 00:47:10 UTC (rev 144397)
@@ -26,6 +26,7 @@
#include "config.h"
#include "ScrollbarThemeMac.h"
+#include "ColorMac.h"
#include "ImageBuffer.h"
#include "GraphicsLayer.h"
#include "LocalCurrentGraphicsContext.h"
@@ -611,13 +612,12 @@
return adoptCF(CGColorCreateWithPattern(colorSpace.get(), pattern.get(), &alpha));
}
-void ScrollbarThemeMac::setUpOverhangAreasLayerContents(GraphicsLayer* graphicsLayer)
+void ScrollbarThemeMac::setUpOverhangAreasLayerContents(GraphicsLayer* graphicsLayer, const Color& backgroundColor)
{
static CGColorRef cachedLinenBackgroundColor = linenBackgroundColor().leakRef();
-
// We operate on the CALayer directly here, since GraphicsLayer doesn't have the concept
// of pattern images, and we know that WebCore won't touch this layer.
- graphicsLayer->platformLayer().backgroundColor = cachedLinenBackgroundColor;
+ graphicsLayer->platformLayer().backgroundColor = backgroundColor.isValid() ? cachedCGColor(backgroundColor, ColorSpaceDeviceRGB) : cachedLinenBackgroundColor;
}
void ScrollbarThemeMac::setUpContentShadowLayer(GraphicsLayer* graphicsLayer)
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (144396 => 144397)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2013-03-01 00:47:10 UTC (rev 144397)
@@ -2452,7 +2452,7 @@
m_layerForOverhangAreas->setDrawsContent(false);
m_layerForOverhangAreas->setSize(m_renderView->frameView()->frameRect().size());
- ScrollbarTheme::theme()->setUpOverhangAreasLayerContents(m_layerForOverhangAreas.get());
+ ScrollbarTheme::theme()->setUpOverhangAreasLayerContents(m_layerForOverhangAreas.get(), this->page()->chrome()->client()->underlayColor());
// We want the overhang areas layer to be positioned below the frame contents,
// so insert it below the clip layer.
Modified: trunk/Source/WebKit2/ChangeLog (144396 => 144397)
--- trunk/Source/WebKit2/ChangeLog 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/ChangeLog 2013-03-01 00:47:10 UTC (rev 144397)
@@ -1,3 +1,60 @@
+2013-02-28 Conrad Shultz <[email protected]>
+
+ Need API to control page underlay color
+ https://bugs.webkit.org/show_bug.cgi?id=110918
+
+ Reviewed by Simon Fraser.
+
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode):
+ Encode underlayColor.
+ (WebKit::WebPageCreationParameters::decode):
+ Decode underlayColor.
+
+ * Shared/WebPageCreationParameters.h:
+ (WebPageCreationParameters):
+ Add underlayColor member.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView underlayColor]):
+ Accessor; retrieves the WebCore::Color from the WebPageProxy and converts it to an NSColor.
+ (-[WKView setUnderlayColor:]):
+ Mutator; converts the NSColor to a WebCore::Color and passes it to the WebPageProxy.
+
+ * UIProcess/API/mac/WKViewPrivate.h:
+ Add underlayColor @property.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setUnderlayColor):
+ Mutator; dispatches SetUnderlayColor to WebPage.
+ (WebKit::WebPageProxy::creationParameters):
+ Set the parameters' underlayColor member appropriately.
+
+ * UIProcess/WebPageProxy.h:
+ Declare new member functions and variable.
+ (WebKit::WebPageProxy::underlayColor):
+ Accessor.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::underlayColor):
+ Return the associated WebPage's underlayColor.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ (WebChromeClient):
+ Declare underlayColor().
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ Apply any underlayColor that was supplied as part of the WebPageCreationParameters.
+
+ * WebProcess/WebPage/WebPage.h:
+ Declare new member functions and variable.
+ (WebKit::WebPage::underlayColor):
+ Accessor.
+
+ * WebProcess/WebPage/WebPage.messages.in:
+ Add SetUnderlayColor message.
+
2013-02-28 Anders Carlsson <[email protected]>
Add the notion of an allowed connection to SessionStorageNamespace
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (144396 => 144397)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-03-01 00:47:10 UTC (rev 144397)
@@ -43,6 +43,7 @@
encoder << pageGroupData;
encoder << drawsBackground;
encoder << drawsTransparentBackground;
+ encoder << underlayColor;
encoder << areMemoryCacheClientCallsEnabled;
encoder << useFixedLayout;
encoder << fixedLayoutSize;
@@ -87,6 +88,8 @@
return false;
if (!decoder.decode(parameters.drawsTransparentBackground))
return false;
+ if (!decoder.decode(parameters.underlayColor))
+ return false;
if (!decoder.decode(parameters.areMemoryCacheClientCallsEnabled))
return false;
if (!decoder.decode(parameters.useFixedLayout))
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (144396 => 144397)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-03-01 00:47:10 UTC (rev 144397)
@@ -62,6 +62,8 @@
bool drawsBackground;
bool drawsTransparentBackground;
+ WebCore::Color underlayColor;
+
bool areMemoryCacheClientCallsEnabled;
bool useFixedLayout;
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (144396 => 144397)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-03-01 00:47:10 UTC (rev 144397)
@@ -3292,6 +3292,20 @@
_data->_page->setMainFrameIsScrollable(!expandsToFit);
}
+- (NSColor *)underlayColor
+{
+ Color webColor = _data->_page->underlayColor();
+ if (!webColor.isValid())
+ return nil;
+
+ return nsColor(webColor);
+}
+
+- (void)setUnderlayColor:(NSColor *)underlayColor
+{
+ _data->_page->setUnderlayColor(colorFromNSColor(underlayColor));
+}
+
- (NSView*)fullScreenPlaceholderView
{
#if ENABLE(FULLSCREEN_API)
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h (144396 => 144397)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h 2013-03-01 00:47:10 UTC (rev 144397)
@@ -53,6 +53,8 @@
@property (readwrite) CGFloat minimumLayoutWidth;
@property (readwrite) CGFloat minimumWidthForAutoLayout;
+@property(copy, nonatomic) NSColor *underlayColor;
+
- (NSView*)fullScreenPlaceholderView;
- (void)beginDeferringViewInWindowChanges;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (144396 => 144397)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-03-01 00:47:10 UTC (rev 144397)
@@ -858,6 +858,17 @@
m_process->send(Messages::WebPage::SetDrawsTransparentBackground(drawsTransparentBackground), m_pageID);
}
+void WebPageProxy::setUnderlayColor(const Color& color)
+{
+ if (m_underlayColor == color)
+ return;
+
+ m_underlayColor = color;
+
+ if (isValid())
+ m_process->send(Messages::WebPage::SetUnderlayColor(color), m_pageID);
+}
+
void WebPageProxy::viewWillStartLiveResize()
{
if (!isValid())
@@ -3834,6 +3845,7 @@
parameters.pageGroupData = m_pageGroup->data();
parameters.drawsBackground = m_drawsBackground;
parameters.drawsTransparentBackground = m_drawsTransparentBackground;
+ parameters.underlayColor = m_underlayColor;
parameters.areMemoryCacheClientCallsEnabled = m_areMemoryCacheClientCallsEnabled;
parameters.useFixedLayout = m_useFixedLayout;
parameters.fixedLayoutSize = m_fixedLayoutSize;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (144396 => 144397)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-03-01 00:47:10 UTC (rev 144397)
@@ -318,6 +318,9 @@
bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
void setDrawsTransparentBackground(bool);
+ WebCore::Color underlayColor() const { return m_underlayColor; }
+ void setUnderlayColor(const WebCore::Color&);
+
void viewWillStartLiveResize();
void viewWillEndLiveResize();
@@ -1136,6 +1139,8 @@
bool m_drawsBackground;
bool m_drawsTransparentBackground;
+ WebCore::Color m_underlayColor;
+
bool m_areMemoryCacheClientCallsEnabled;
bool m_useFixedLayout;
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (144396 => 144397)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2013-03-01 00:47:10 UTC (rev 144397)
@@ -785,6 +785,11 @@
return true;
}
+Color WebChromeClient::underlayColor() const
+{
+ return m_page->underlayColor();
+}
+
void WebChromeClient::numWheelEventHandlersChanged(unsigned count)
{
m_page->numWheelEventHandlersChanged(count);
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (144396 => 144397)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2013-03-01 00:47:10 UTC (rev 144397)
@@ -212,6 +212,8 @@
virtual void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&) OVERRIDE;
virtual void recommendedScrollbarStyleDidChange(int32_t newStyle) OVERRIDE;
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const OVERRIDE;
+
+ virtual WebCore::Color underlayColor() const OVERRIDE;
virtual void numWheelEventHandlersChanged(unsigned) OVERRIDE;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (144396 => 144397)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-03-01 00:47:10 UTC (rev 144397)
@@ -347,6 +347,8 @@
setDrawsBackground(parameters.drawsBackground);
setDrawsTransparentBackground(parameters.drawsTransparentBackground);
+ setUnderlayColor(parameters.underlayColor);
+
setPaginationMode(parameters.paginationMode);
setPaginationBehavesLikeColumns(parameters.paginationBehavesLikeColumns);
setPageLength(parameters.pageLength);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (144396 => 144397)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-03-01 00:47:10 UTC (rev 144397)
@@ -328,6 +328,9 @@
bool drawsBackground() const { return m_drawsBackground; }
bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
+ void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
+ WebCore::Color underlayColor() const { return m_underlayColor; }
+
void stopLoading();
void stopLoadingFrame(uint64_t frameID);
void setDefersLoading(bool deferLoading);
@@ -803,6 +806,8 @@
bool m_drawsBackground;
bool m_drawsTransparentBackground;
+ WebCore::Color m_underlayColor;
+
bool m_isInRedo;
bool m_isClosed;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (144396 => 144397)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-03-01 00:46:30 UTC (rev 144396)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-03-01 00:47:10 UTC (rev 144397)
@@ -29,6 +29,8 @@
SetDrawsBackground(bool drawsBackground)
SetDrawsTransparentBackground(bool drawsTransparentBackground)
+ SetUnderlayColor(WebCore::Color color)
+
ViewWillStartLiveResize()
ViewWillEndLiveResize()