Enable layout testing of the scroll animator.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 02:41:20 +0000 (02:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 02:41:20 +0000 (02:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81858
Add a call to the InternalSettings that layout tests can use to
turn on scroll animation. Enable animation updates for the
Chromium platform DRT when scroll animation has been turned on in
a test. This should be a no-op for all current layout tests.

Patch by Scott Byer <scottbyer@chromium.org> on 2012-03-26
Reviewed by James Robinson.

Source/WebCore:

No new tests. Layout test results should be unchanged.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setEnableScrollAnimator):
(WebCore):
(WebCore::InternalSettings::scrollAnimatorEnabled):
* testing/InternalSettings.h:
(InternalSettings):
* testing/InternalSettings.idl:

Source/WebKit/chromium:

* public/WebSettings.h:
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::scrollAnimatorEnabled):
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):

Tools:

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::serviceAnimation):
(WebViewHost::scheduleAnimation):
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h
Tools/ChangeLog
Tools/DumpRenderTree/chromium/WebViewHost.cpp
Tools/DumpRenderTree/chromium/WebViewHost.h

index 3534baf5237126b604f2110c470c534a9ba35789..86a7b8cda34f34d6d0f3f84a0dbafe89c8bbe91a 100644 (file)
@@ -1,3 +1,24 @@
+2012-03-26  Scott Byer  <scottbyer@chromium.org>
+
+        Enable layout testing of the scroll animator.
+        https://bugs.webkit.org/show_bug.cgi?id=81858
+        Add a call to the InternalSettings that layout tests can use to
+        turn on scroll animation. Enable animation updates for the
+        Chromium platform DRT when scroll animation has been turned on in
+        a test. This should be a no-op for all current layout tests.
+
+        Reviewed by James Robinson.
+
+        No new tests. Layout test results should be unchanged.
+
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::setEnableScrollAnimator):
+        (WebCore):
+        (WebCore::InternalSettings::scrollAnimatorEnabled):
+        * testing/InternalSettings.h:
+        (InternalSettings):
+        * testing/InternalSettings.idl:
+
 2012-03-26  Charles Wei  <charles.wei@torchmobile.com.cn>
 
         Fix minor spell error in DocumentLoader.h
index 50231caf4636103b1c043305bfe986139c8383a8..1c6ba3e0447b93cd5628c495fc8abb3af698efc0 100644 (file)
@@ -295,4 +295,26 @@ void InternalSettings::setPictographFontFamily(const String& family, const Strin
     setFontFamily(settings(), family, script, &Settings::setPictographFontFamily);
 }
 
+void InternalSettings::setEnableScrollAnimator(bool enabled, ExceptionCode& ec)
+{
+#if ENABLE(SMOOTH_SCROLLING)
+    InternalSettingsGuardForSettings();
+    settings()->setEnableScrollAnimator(enabled);
+#else
+    UNUSED_PARAM(enabled);
+    UNUSED_PARAM(ec);
+#endif
+}
+
+bool InternalSettings::scrollAnimatorEnabled(ExceptionCode& ec)
+{
+#if ENABLE(SMOOTH_SCROLLING)
+    InternalSettingsGuardForSettingsReturn(false);
+    return settings()->scrollAnimatorEnabled();
+#else
+    UNUSED_PARAM(ec);
+    return false;
+#endif
+}
+
 }
index bd66802b03b6c79636ece9d3fe84acf5f6953d4d..3a8e84877172216c159ad734bee5d0f9948a25d9 100644 (file)
@@ -70,6 +70,8 @@ public:
     void setCursiveFontFamily(const String& family, const String& script, ExceptionCode&);
     void setFantasyFontFamily(const String& family, const String& script, ExceptionCode&);
     void setPictographFontFamily(const String& family, const String& script, ExceptionCode&);
+    void setEnableScrollAnimator(bool enabled, ExceptionCode&);
+    bool scrollAnimatorEnabled(ExceptionCode&);
 
     void restoreTo(Settings*);
 
index d22afd774987db49cbf9d859018ae77b4d83f4f0..dacac38564c7ca61e6674a5982ed49ccff32c4d9 100644 (file)
@@ -49,6 +49,8 @@ module window {
         void setCursiveFontFamily(in DOMString family, in DOMString script) raises(DOMException);
         void setFantasyFontFamily(in DOMString family, in DOMString script) raises(DOMException);
         void setPictographFontFamily(in DOMString family, in DOMString script) raises(DOMException);
+        void setEnableScrollAnimator(in boolean enabled) raises(DOMException);
+        boolean scrollAnimatorEnabled() raises(DOMException);
     };
 }
 
index 34f61c4f82453c195224fc552b4c64fa6d755966..ba4c70806d3b95415f0147b12eee5f418331767a 100644 (file)
@@ -1,3 +1,21 @@
+2012-03-26  Scott Byer  <scottbyer@chromium.org>
+
+        Enable layout testing of the scroll animator.
+        https://bugs.webkit.org/show_bug.cgi?id=81858
+        Add a call to the InternalSettings that layout tests can use to
+        turn on scroll animation. Enable animation updates for the
+        Chromium platform DRT when scroll animation has been turned on in
+        a test. This should be a no-op for all current layout tests.
+
+        Reviewed by James Robinson.
+
+        * public/WebSettings.h:
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::scrollAnimatorEnabled):
+        (WebKit):
+        * src/WebSettingsImpl.h:
+        (WebSettingsImpl):
+
 2012-03-26  Nat Duca  <nduca@chromium.org>
 
         [chromium] Add isInputThrottled/didBecomeReadyForAdditionalInput to WebWidget
index d96fcd6fc7a5ba98710b3aaac314c5339534af79..e93caa98fea0d2229e2ef9812283cfc60e6a1dbc 100644 (file)
@@ -139,6 +139,7 @@ public:
     virtual void setPasswordEchoDurationInSeconds(double) = 0;
     virtual void setShouldPrintBackgrounds(bool) = 0;
     virtual void setEnableScrollAnimator(bool) = 0;
+    virtual bool scrollAnimatorEnabled() const = 0;
     virtual void setHixie76WebSocketProtocolEnabled(bool) = 0;
     virtual void setVisualWordMovementEnabled(bool) = 0;
     virtual void setAcceleratedPaintingEnabled(bool) = 0;
index 8fc0e4272df1897c15c2707c0704182377469de5..5dde21b59814cd7797550dc3639fe4b8fb552798 100644 (file)
@@ -498,6 +498,15 @@ void WebSettingsImpl::setEnableScrollAnimator(bool enabled)
 #endif
 }
 
+bool WebSettingsImpl::scrollAnimatorEnabled() const
+{
+#if ENABLE(SMOOTH_SCROLLING)
+    return m_settings->scrollAnimatorEnabled();
+#else
+    return false;
+#endif
+}
+
 void WebSettingsImpl::setHixie76WebSocketProtocolEnabled(bool enabled)
 {
 #if ENABLE(WEB_SOCKETS)
index edd6a1e2986811f23106898ada794604cdb920ca..0b76fcffc50b7d6a08d9748c8f4e399fc827e15f 100644 (file)
@@ -131,6 +131,7 @@ public:
     virtual void setPasswordEchoDurationInSeconds(double);
     virtual void setShouldPrintBackgrounds(bool);
     virtual void setEnableScrollAnimator(bool);
+    virtual bool scrollAnimatorEnabled() const;
     virtual void setHixie76WebSocketProtocolEnabled(bool);
     virtual void setVisualWordMovementEnabled(bool);
     virtual void setShouldDisplaySubtitles(bool);
index a03748f71cd37b0dbb734b26f7d4e126748d162c..e87aa0008b1357f546ea80e136d0d8947bd2b46f 100644 (file)
@@ -1,3 +1,20 @@
+2012-03-26  Scott Byer  <scottbyer@chromium.org>
+
+        Enable layout testing of the scroll animator.
+        https://bugs.webkit.org/show_bug.cgi?id=81858
+        Add a call to the InternalSettings that layout tests can use to
+        turn on scroll animation. Enable animation updates for the
+        Chromium platform DRT when scroll animation has been turned on in
+        a test. This should be a no-op for all current layout tests.
+
+        Reviewed by James Robinson.
+
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::serviceAnimation):
+        (WebViewHost::scheduleAnimation):
+        * DumpRenderTree/chromium/WebViewHost.h:
+        (WebViewHost):
+
 2012-03-26  Dinu Jacob  <dinu.jacob@nokia.com>
 
         [Qt][WK2] Support multi-file upload
index fde2d68016a0936efdfc43139168fb9746be4b63..b3e9dda0164900d0dea89e1c77ac78d5309a1dac 100644 (file)
@@ -757,9 +757,16 @@ void WebViewHost::scheduleComposite()
 }
 
 #if ENABLE(REQUEST_ANIMATION_FRAME)
+void WebViewHost::serviceAnimation()
+{
+    if (webView()->settings()->scrollAnimatorEnabled())
+        webView()->animate(0.0);
+    scheduleComposite();
+}
+
 void WebViewHost::scheduleAnimation()
 {
-    postDelayedTask(new HostMethodTask(this, &WebViewHost::scheduleComposite), 0);
+    postDelayedTask(new HostMethodTask(this, &WebViewHost::serviceAnimation), 0);
 }
 #endif
 
index a990ae31934d91fc9cbc178f920861aeeb45e66a..706035d33740c923cd587d8d2494f3f0fd9e6826 100644 (file)
@@ -175,6 +175,7 @@ class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewCl
     virtual void didAutoResize(const WebKit::WebSize& newSize);
     virtual void scheduleComposite();
 #if ENABLE(REQUEST_ANIMATION_FRAME)
+    virtual void serviceAnimation();
     virtual void scheduleAnimation();
 #endif
     virtual void didFocus();