Title: [159960] trunk/Source
Revision
159960
Author
[email protected]
Date
2013-12-02 13:53:17 -0800 (Mon, 02 Dec 2013)

Log Message

Add a setting to opt into a mode where the background extends and fixed elements 
don't move on rubber-band
https://bugs.webkit.org/show_bug.cgi?id=124745

Reviewed by Tim Horton.

Source/WebCore: 

New setting backgroundShouldExtendBeyondPage() will cause the tile cache to have a 
margin, and it will also cause fixed elements and backgrounds to stick to the 
viewport on scroll instead of sticking to the document. 

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::scrollBehaviorForFixedElements):
* page/Settings.in:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):

Source/WebKit: 

Keep Windows happy.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Source/WebKit2: 

Add SPI to enable the new setting.

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetBackgroundShouldExtendBeyondPage):
(WKPreferencesGetBackgroundShouldExtendBeyondPage):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (159959 => 159960)


--- trunk/Source/WebCore/ChangeLog	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebCore/ChangeLog	2013-12-02 21:53:17 UTC (rev 159960)
@@ -1,3 +1,22 @@
+2013-12-02  Beth Dakin  <[email protected]>
+
+        Add a setting to opt into a mode where the background extends and fixed elements 
+        don't move on rubber-band
+        https://bugs.webkit.org/show_bug.cgi?id=124745
+
+        Reviewed by Tim Horton.
+
+        New setting backgroundShouldExtendBeyondPage() will cause the tile cache to have a 
+        margin, and it will also cause fixed elements and backgrounds to stick to the 
+        viewport on scroll instead of sticking to the document. 
+
+        * WebCore.exp.in:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollBehaviorForFixedElements):
+        * page/Settings.in:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::RenderLayerBacking):
+
 2013-12-02  Roger Zanoni  <[email protected]>
 
         [MediaStream] Use iterator-based loops instead of index-based loops

Modified: trunk/Source/WebCore/page/FrameView.cpp (159959 => 159960)


--- trunk/Source/WebCore/page/FrameView.cpp	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebCore/page/FrameView.cpp	2013-12-02 21:53:17 UTC (rev 159960)
@@ -4178,8 +4178,7 @@
 
 ScrollBehaviorForFixedElements FrameView::scrollBehaviorForFixedElements() const
 {
-    // FIXME: Implement. This should consult a setting that does not yet exist.
-    return StickToDocumentBounds;
+    return frame().settings().backgroundShouldExtendBeyondPage() ? StickToViewportBounds : StickToDocumentBounds;
 }
 
 RenderView* FrameView::renderView() const

Modified: trunk/Source/WebCore/page/Settings.in (159959 => 159960)


--- trunk/Source/WebCore/page/Settings.in	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebCore/page/Settings.in	2013-12-02 21:53:17 UTC (rev 159960)
@@ -212,3 +212,5 @@
 
 simpleLineLayoutEnabled initial=true, setNeedsStyleRecalcInAllFrames=1
 simpleLineLayoutDebugBordersEnabled initial=false, setNeedsStyleRecalcInAllFrames=1
+
+backgroundShouldExtendBeyondPage initial=false

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (159959 => 159960)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2013-12-02 21:53:17 UTC (rev 159960)
@@ -136,8 +136,11 @@
 
         tiledBacking->setIsInWindow(page->isInWindow());
 
-        if (m_isMainFrameRenderViewLayer)
+        if (m_isMainFrameRenderViewLayer) {
             tiledBacking->setUnparentsOffscreenTiles(true);
+            if (page->settings().backgroundShouldExtendBeyondPage())
+                tiledBacking->setTileMargins(512, 512, 512, 512);
+        }
 
         tiledBacking->setScrollingPerformanceLoggingEnabled(page->settings().scrollingPerformanceLoggingEnabled());
         adjustTiledBackingCoverage();

Modified: trunk/Source/WebKit/ChangeLog (159959 => 159960)


--- trunk/Source/WebKit/ChangeLog	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebKit/ChangeLog	2013-12-02 21:53:17 UTC (rev 159960)
@@ -1,3 +1,15 @@
+2013-12-02  Beth Dakin  <[email protected]>
+
+        Add a setting to opt into a mode where the background extends and fixed elements 
+        don't move on rubber-band
+        https://bugs.webkit.org/show_bug.cgi?id=124745
+
+        Reviewed by Tim Horton.
+
+        Keep Windows happy.
+
+        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
+
 2013-12-02  Brent Fulgham  <[email protected]>
 
         [Win] WebKit Project doesn't copy resource bundle

Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (159959 => 159960)


--- trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in	2013-12-02 21:53:17 UTC (rev 159960)
@@ -456,6 +456,7 @@
         symbolWithPointer(?cursiveFontFamily@Settings@WebCore@@QBEABVAtomicString@WTF@@W4UScriptCode@@@Z, ?cursiveFontFamily@Settings@WebCore@@QEBAAEBVAtomicString@WTF@@W4UScriptCode@@@Z)
         symbolWithPointer(?setSimpleLineLayoutEnabled@Settings@WebCore@@QAEX_N@Z, ?setSimpleLineLayoutEnabled@Settings@WebCore@@QEAAX_N@Z)
         symbolWithPointer(?setSimpleLineLayoutDebugBordersEnabled@Settings@WebCore@@QAEX_N@Z, ?setSimpleLineLayoutDebugBordersEnabled@Settings@WebCore@@QEAAX_N@Z)
+        symbolWithPointer(?setBackgroundShouldExtendBeyondPage@Settings@WebCore@@QAEX_N@Z, ?setBackgroundShouldExtendBeyondPage@Settings@WebCore@@QEAAX_N@Z)
         symbolWithPointer(?storeUpdatedQuotaForOrigin@ApplicationCacheStorage@WebCore@@QAE_NPBVSecurityOrigin@2@_J@Z, ?storeUpdatedQuotaForOrigin@ApplicationCacheStorage@WebCore@@QEAA_NPEBVSecurityOrigin@2@_J@Z)
         symbolWithPointer(?cacheStorage@WebCore@@YAAAVApplicationCacheStorage@1@XZ, ?cacheStorage@WebCore@@YAAEAVApplicationCacheStorage@1@XZ)
         symbolWithPointer(?setDefaultOriginQuota@ApplicationCacheStorage@WebCore@@QAEX_J@Z, ?setDefaultOriginQuota@ApplicationCacheStorage@WebCore@@QEAAX_J@Z)

Modified: trunk/Source/WebKit2/ChangeLog (159959 => 159960)


--- trunk/Source/WebKit2/ChangeLog	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebKit2/ChangeLog	2013-12-02 21:53:17 UTC (rev 159960)
@@ -1,3 +1,21 @@
+2013-12-02  Beth Dakin  <[email protected]>
+
+        Add a setting to opt into a mode where the background extends and fixed elements 
+        don't move on rubber-band
+        https://bugs.webkit.org/show_bug.cgi?id=124745
+
+        Reviewed by Tim Horton.
+
+        Add SPI to enable the new setting.
+
+        * Shared/WebPreferencesStore.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetBackgroundShouldExtendBeyondPage):
+        (WKPreferencesGetBackgroundShouldExtendBeyondPage):
+        * UIProcess/API/C/WKPreferencesPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2013-12-02  Tim Horton  <[email protected]>
 
         Remote Layer Tree: Hook up setLayerTreeStateIsFrozen

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (159959 => 159960)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2013-12-02 21:53:17 UTC (rev 159960)
@@ -173,6 +173,7 @@
     macro(ThreadedScrollingEnabled, threadedScrollingEnabled, Bool, bool, true) \
     macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true) \
     macro(SimpleLineLayoutDebugBordersEnabled, simpleLineLayoutDebugBordersEnabled, Bool, bool, false) \
+    macro(BackgroundShouldExtendBeyondPage, backgroundShouldExtendBeyondPage, Bool, bool, false) \
     macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false) \
     macro(VideoPluginProxyEnabled, isVideoPluginProxyEnabled, Bool, bool, DEFAULT_VIDEO_PLUGIN_PROXY_ENABLED) \
     macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false) \

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (159959 => 159960)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2013-12-02 21:53:17 UTC (rev 159960)
@@ -1206,6 +1206,16 @@
     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 (159959 => 159960)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2013-12-02 21:53:17 UTC (rev 159960)
@@ -304,6 +304,10 @@
 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/WebProcess/WebPage/WebPage.cpp (159959 => 159960)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-12-02 21:44:07 UTC (rev 159959)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-12-02 21:53:17 UTC (rev 159960)
@@ -2521,6 +2521,7 @@
     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()));
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to