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 3534baf..86a7b8c 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 50231ca..1c6ba3e 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 bd66802..3a8e848 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 d22afd7..dacac38 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 34f61c4..ba4c708 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 d96fcd6..e93caa9 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 8fc0e42..5dde21b 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 edd6a1e..0b76fcf 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 a03748f..e87aa00 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 fde2d68..b3e9dda 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 a990ae3..706035d 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();