Commit eb54eea7 authored by bdakin@apple.com's avatar bdakin@apple.com

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):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 57aed976
2013-12-02 Beth Dakin <bdakin@apple.com>
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 <rogerzanoni@gmail.com>
[MediaStream] Use iterator-based loops instead of index-based loops
......@@ -4178,8 +4178,7 @@ void FrameView::setScrollPinningBehavior(ScrollPinningBehavior pinning)
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
......
......@@ -212,3 +212,5 @@ minimumZoomFontSize type=float, initial=15, conditional=IOS_TEXT_AUTOSIZING
simpleLineLayoutEnabled initial=true, setNeedsStyleRecalcInAllFrames=1
simpleLineLayoutDebugBordersEnabled initial=false, setNeedsStyleRecalcInAllFrames=1
backgroundShouldExtendBeyondPage initial=false
......@@ -136,8 +136,11 @@ RenderLayerBacking::RenderLayerBacking(RenderLayer& layer)
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();
......
2013-12-02 Beth Dakin <bdakin@apple.com>
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 <bfulgham@apple.com>
[Win] WebKit Project doesn't copy resource bundle
......
......@@ -456,6 +456,7 @@ EXPORTS
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)
......
2013-12-02 Beth Dakin <bdakin@apple.com>
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 <timothy_horton@apple.com>
Remote Layer Tree: Hook up setLayerTreeStateIsFrozen
......
......@@ -173,6 +173,7 @@ namespace WebKit {
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) \
......
......@@ -1206,6 +1206,16 @@ bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef prefer
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);
......
......@@ -304,6 +304,10 @@ WK_EXPORT bool WKPreferencesGetSimpleLineLayoutEnabled(WKPreferencesRef);
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.
......
......@@ -2521,6 +2521,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
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()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment