Diff
Modified: trunk/Source/WebKit2/ChangeLog (160384 => 160385)
--- trunk/Source/WebKit2/ChangeLog 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/ChangeLog 2013-12-10 21:39:59 UTC (rev 160385)
@@ -1,3 +1,38 @@
+2013-12-10 Beth Dakin <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=125533
+ BackgroundExtendsBeyondPage setting should be switchable per WKView
+ -and corresponding-
+ <rdar://problem/15571310>
+
+ Reviewed by Anders Carlsson.
+
+ This patch removes the WKPreferences API and adds WKPage API in its place. To
+ ensure that the setting sticks after a crash, it is also now a creation parameter.
+
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode):
+ (WebKit::WebPageCreationParameters::decode):
+ * Shared/WebPageCreationParameters.h:
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageSetBackgroundExtendsBeyondPage):
+ (WKPageBackgroundExtendsBeyondPage):
+ * UIProcess/API/C/WKPage.h:
+ * UIProcess/API/C/WKPreferences.cpp:
+ * UIProcess/API/C/WKPreferencesPrivate.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy):
+ (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
+ (WebKit::WebPageProxy::backgroundExtendsBeyondPage):
+ (WebKit::WebPageProxy::initializeCreationParameters):
+ * UIProcess/WebPageProxy.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ (WebKit::WebPage::setBackgroundExtendsBeyondPage):
+ (WebKit::WebPage::updatePreferences):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
2013-12-10 Anders Carlsson <[email protected]>
Rename API::TypedObject to API::ObjectImpl
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (160384 => 160385)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-12-10 21:39:59 UTC (rev 160385)
@@ -59,6 +59,7 @@
encoder << minimumLayoutSize;
encoder << autoSizingShouldExpandToViewHeight;
encoder.encodeEnum(scrollPinningBehavior);
+ encoder << backgroundExtendsBeyondPage;
#if PLATFORM(MAC)
encoder.encodeEnum(layerHostingMode);
@@ -120,6 +121,8 @@
return false;
if (!decoder.decodeEnum(parameters.scrollPinningBehavior))
return false;
+ if (!decoder.decode(parameters.backgroundExtendsBeyondPage))
+ return false;
#if PLATFORM(MAC)
if (!decoder.decodeEnum(parameters.layerHostingMode))
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (160384 => 160385)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-12-10 21:39:59 UTC (rev 160385)
@@ -97,6 +97,8 @@
WebCore::ScrollPinningBehavior scrollPinningBehavior;
+ bool backgroundExtendsBeyondPage;
+
#if PLATFORM(MAC)
LayerHostingMode layerHostingMode;
ColorSpaceData colorSpace;
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (160384 => 160385)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp 2013-12-10 21:39:59 UTC (rev 160385)
@@ -495,6 +495,16 @@
toImpl(pageRef)->setRubberBandsAtBottom(rubberBandsAtBottom);
}
+void WKPageSetBackgroundExtendsBeyondPage(WKPageRef pageRef, bool backgroundExtendsBeyondPage)
+{
+ toImpl(pageRef)->setBackgroundExtendsBeyondPage(backgroundExtendsBeyondPage);
+}
+
+bool WKPageBackgroundExtendsBeyondPage(WKPageRef pageRef)
+{
+ return toImpl(pageRef)->backgroundExtendsBeyondPage();
+}
+
void WKPageSetPaginationMode(WKPageRef pageRef, WKPaginationMode paginationMode)
{
Pagination::Mode mode;
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.h (160384 => 160385)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.h 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.h 2013-12-10 21:39:59 UTC (rev 160385)
@@ -176,6 +176,9 @@
WK_EXPORT bool WKPageRubberBandsAtBottom(WKPageRef);
WK_EXPORT void WKPageSetRubberBandsAtBottom(WKPageRef, bool rubberBandsAtBottom);
+WK_EXPORT void WKPageSetBackgroundExtendsBeyondPage(WKPageRef, bool backgroundExtendsBeyondPage);
+WK_EXPORT bool WKPageBackgroundExtendsBeyondPage(WKPageRef);
+
WK_EXPORT bool WKPageCanDelete(WKPageRef page);
WK_EXPORT bool WKPageHasSelectedRange(WKPageRef page);
WK_EXPORT bool WKPageIsContentEditable(WKPageRef page);
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (160384 => 160385)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2013-12-10 21:39:59 UTC (rev 160385)
@@ -1206,16 +1206,6 @@
return toImpl(preferencesRef)->simpleLineLayoutDebugBordersEnabled();
}
-void WKPreferencesSetBackgroundShouldExtendBeyondPage(WKPreferencesRef preferencesRef, bool flag)
-{
- toImpl(preferencesRef)->setBackgroundShouldExtendBeyondPage(flag);
-}
-
-bool WKPreferencesGetBackgroundShouldExtendBeyondPage(WKPreferencesRef preferencesRef)
-{
- return toImpl(preferencesRef)->backgroundShouldExtendBeyondPage();
-}
-
void WKPreferencesSetMediaStreamEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
toImpl(preferencesRef)->setMediaStreamEnabled(enabled);
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h (160384 => 160385)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h 2013-12-10 21:39:59 UTC (rev 160385)
@@ -304,10 +304,6 @@
WK_EXPORT void WKPreferencesSetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef);
-// Defaults to false.
-WK_EXPORT void WKPreferencesSetBackgroundShouldExtendBeyondPage(WKPreferencesRef, bool);
-WK_EXPORT bool WKPreferencesGetBackgroundShouldExtendBeyondPage(WKPreferencesRef);
-
WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
// Defaults to false.
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (160384 => 160385)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-12-10 21:39:59 UTC (rev 160385)
@@ -296,6 +296,7 @@
, m_rubberBandsAtRight(true)
, m_rubberBandsAtTop(true)
, m_rubberBandsAtBottom(true)
+ , m_backgroundExtendsBeyondPage(false)
, m_mainFrameInViewSourceMode(false)
, m_pageCount(0)
, m_renderTreeSize(0)
@@ -1738,6 +1739,23 @@
m_rubberBandsAtBottom = rubberBandsAtBottom;
}
+void WebPageProxy::setBackgroundExtendsBeyondPage(bool backgroundExtendsBeyondPage)
+{
+ if (backgroundExtendsBeyondPage == m_backgroundExtendsBeyondPage)
+ return;
+
+ m_backgroundExtendsBeyondPage = backgroundExtendsBeyondPage;
+
+ if (!isValid())
+ return;
+ m_process->send(Messages::WebPage::SetBackgroundExtendsBeyondPage(backgroundExtendsBeyondPage), m_pageID);
+}
+
+bool WebPageProxy::backgroundExtendsBeyondPage() const
+{
+ return m_backgroundExtendsBeyondPage;
+}
+
void WebPageProxy::setPaginationMode(WebCore::Pagination::Mode mode)
{
if (mode == m_paginationMode)
@@ -3825,6 +3843,7 @@
m_creationParameters.minimumLayoutSize = m_minimumLayoutSize;
m_creationParameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToViewHeight;
m_creationParameters.scrollPinningBehavior = m_scrollPinningBehavior;
+ m_creationParameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage;
#if PLATFORM(MAC)
m_creationParameters.layerHostingMode = m_layerHostingMode;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (160384 => 160385)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-12-10 21:39:59 UTC (rev 160385)
@@ -584,6 +584,9 @@
bool rubberBandsAtBottom() const;
void setRubberBandsAtBottom(bool);
+ void setBackgroundExtendsBeyondPage(bool);
+ bool backgroundExtendsBeyondPage() const;
+
void setPaginationMode(WebCore::Pagination::Mode);
WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
void setPaginationBehavesLikeColumns(bool);
@@ -1326,6 +1329,8 @@
bool m_rubberBandsAtTop;
bool m_rubberBandsAtBottom;
+ bool m_backgroundExtendsBeyondPage;
+
bool m_mainFrameInViewSourceMode;
unsigned m_pageCount;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (160384 => 160385)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-12-10 21:39:59 UTC (rev 160385)
@@ -389,6 +389,7 @@
setAutoSizingShouldExpandToViewHeight(parameters.autoSizingShouldExpandToViewHeight);
setScrollPinningBehavior(parameters.scrollPinningBehavior);
+ setBackgroundExtendsBeyondPage(parameters.backgroundExtendsBeyondPage);
m_userAgent = parameters.userAgent;
@@ -1319,6 +1320,12 @@
m_page->setShouldSuppressScrollbarAnimations(suppressAnimations);
}
+void WebPage::setBackgroundExtendsBeyondPage(bool backgroundExtendsBeyondPage)
+{
+ if (m_page->settings().backgroundShouldExtendBeyondPage() != backgroundExtendsBeyondPage)
+ m_page->settings().setBackgroundShouldExtendBeyondPage(backgroundExtendsBeyondPage);
+}
+
void WebPage::setPaginationMode(uint32_t mode)
{
Pagination pagination = m_page->pagination();
@@ -2524,7 +2531,6 @@
settings.setLowPowerVideoAudioBufferSizeEnabled(store.getBoolValueForKey(WebPreferencesKey::lowPowerVideoAudioBufferSizeEnabledKey()));
settings.setSimpleLineLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::simpleLineLayoutEnabledKey()));
settings.setSimpleLineLayoutDebugBordersEnabled(store.getBoolValueForKey(WebPreferencesKey::simpleLineLayoutDebugBordersEnabledKey()));
- settings.setBackgroundShouldExtendBeyondPage(store.getBoolValueForKey(WebPreferencesKey::backgroundShouldExtendBeyondPageKey()));
settings.setUseLegacyTextAlignPositionedElementBehavior(store.getBoolValueForKey(WebPreferencesKey::useLegacyTextAlignPositionedElementBehaviorKey()));
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (160384 => 160385)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-12-10 21:39:59 UTC (rev 160385)
@@ -318,6 +318,8 @@
void setSuppressScrollbarAnimations(bool);
+ void setBackgroundExtendsBeyondPage(bool);
+
void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
void setPaginationBehavesLikeColumns(bool);
void setPageLength(double);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (160384 => 160385)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-12-10 21:28:37 UTC (rev 160384)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-12-10 21:39:59 UTC (rev 160385)
@@ -148,6 +148,8 @@
ListenForLayoutMilestones(uint32_t milestones)
SetSuppressScrollbarAnimations(bool suppressAnimations)
+ SetBackgroundExtendsBeyondPage(bool backgroundExtendsBeyondPage)
+
SetPaginationMode(uint32_t mode)
SetPaginationBehavesLikeColumns(bool behavesLikeColumns)
SetPageLength(double pageLength)