From 1ed88bc02510d2d49548d291a6e38973774e7b35 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 8 Dec 2015 18:07:06 +0100 Subject: Respect --enable-smooth-scrolling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the scroll animator default to follow the same flags as used in Chromium. Change-Id: Ic6a9d23950f2ac6a18bd9b4e58cbedf560943717 Reviewed-by: Michael BrĂ¼ning --- src/core/web_engine_settings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index 160ed9693..539caed5f 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -215,7 +215,6 @@ void WebEngineSettings::initDefaults(bool offTheRecord) s_defaultAttributes.insert(SpatialNavigationEnabled, false); s_defaultAttributes.insert(LocalContentCanAccessFileUrls, true); s_defaultAttributes.insert(HyperlinkAuditingEnabled, false); - s_defaultAttributes.insert(ScrollAnimatorEnabled, false); s_defaultAttributes.insert(ErrorPageEnabled, true); s_defaultAttributes.insert(PluginsEnabled, false); s_defaultAttributes.insert(FullScreenSupportEnabled, false); @@ -225,11 +224,13 @@ void WebEngineSettings::initDefaults(bool offTheRecord) // But first we must ensure the WebContext has been initialized QtWebEngineCore::WebEngineContext::current(); base::CommandLine* commandLine = base::CommandLine::ForCurrentProcess(); + bool smoothScrolling = commandLine->HasSwitch(switches::kEnableSmoothScrolling); bool webGL = content::GpuProcessHost::gpu_enabled() && !commandLine->HasSwitch(switches::kDisable3DAPIs) && !commandLine->HasSwitch(switches::kDisableExperimentalWebGL); bool accelerated2dCanvas = content::GpuProcessHost::gpu_enabled() && !commandLine->HasSwitch(switches::kDisableAccelerated2dCanvas); + s_defaultAttributes.insert(ScrollAnimatorEnabled, smoothScrolling); s_defaultAttributes.insert(WebGLEnabled, webGL); s_defaultAttributes.insert(Accelerated2dCanvasEnabled, accelerated2dCanvas); } -- cgit v1.2.3