⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 282686 in webkit


Ignore:
Timestamp:
Sep 17, 2021, 1:07:23 PM (5 years ago)
Author:
Simon Fraser
Message:

Convert usesMockScrollAnimator from a DeprecatedGlobalSettings to a WebPreference
https://bugs.webkit.org/show_bug.cgi?id=230371

Reviewed by Tim Horton.
Source/WebCore:

There were ordering problems that resulted from timing of a test calling
internals.setUsesMockScrollAnimator(true) and the first access of the scrollAnimator(),
which resulted in fast/scrolling/scroll-animator-select-list-events.html failing
when run twice in a row.

Fix by making usesMockScrollAnimator a WebPreference, which means that tests
can use <!-- webkit-test-runner --> options to enable it, which avoids the
ordering dependency.

  • page/DeprecatedGlobalSettings.cpp:

(WebCore::DeprecatedGlobalSettings::setUsesMockScrollAnimator): Deleted.
(WebCore::DeprecatedGlobalSettings::usesMockScrollAnimator): Deleted.

  • page/DeprecatedGlobalSettings.h:
  • page/FrameView.cpp:

(WebCore::FrameView::mockScrollAnimatorEnabled const):
(WebCore::FrameView::usesMockScrollAnimator const): Deleted.

  • page/FrameView.h:
  • platform/ScrollableArea.cpp:

(WebCore::ScrollableArea::scrollAnimator const):

  • platform/ScrollableArea.h:

(WebCore::ScrollableArea::mockScrollAnimatorEnabled const):
(WebCore::ScrollableArea::usesMockScrollAnimator const): Deleted.

  • rendering/RenderLayerScrollableArea.cpp:

(WebCore::RenderLayerScrollableArea::mockScrollAnimatorEnabled const):
(WebCore::RenderLayerScrollableArea::usesMockScrollAnimator const): Deleted.

  • rendering/RenderLayerScrollableArea.h:
  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::mockScrollAnimatorEnabled const):
(WebCore::RenderListBox::usesMockScrollAnimator const): Deleted.

  • rendering/RenderListBox.h:
  • testing/Internals.cpp:

(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setUsesMockScrollAnimator): Deleted.

  • testing/Internals.h:
  • testing/Internals.idl:

Source/WebKitLegacy/win:

Add Windows preferences.

  • WebPreferences.cpp:

(WebPreferences::mockScrollAnimatorEnabled):

  • WebPreferences.h:
  • WebView.cpp:

(WebView::notifyPreferencesChanged):

Source/WTF:

Add a MockScrollAnimatorEnabled setting.

  • Scripts/Preferences/WebPreferences.yaml:

LayoutTests:

Convert to use the <!-- webkit-test-runner --> format for specifying MockScrollAnimatorEnabled.

  • fast/scrolling/scroll-animator-basic-events.html:
  • fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html:
  • fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html:
  • fast/scrolling/scroll-animator-select-list-events.html:
Location:
trunk
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r282682 r282686  
     12021-09-17  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Convert usesMockScrollAnimator from a DeprecatedGlobalSettings to a WebPreference
     4        https://bugs.webkit.org/show_bug.cgi?id=230371
     5
     6        Reviewed by Tim Horton.
     7       
     8        Convert to use the  <!-- webkit-test-runner --> format for specifying MockScrollAnimatorEnabled.
     9
     10        * fast/scrolling/scroll-animator-basic-events.html:
     11        * fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html:
     12        * fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html:
     13        * fast/scrolling/scroll-animator-select-list-events.html:
     14
    1152021-09-17  Ayumi Kojima  <ayumi_kojima@apple.com>
    216
  • trunk/LayoutTests/fast/scrolling/scroll-animator-basic-events.html

    r261211 r282686  
    1 <html>
     1<html> <!-- webkit-test-runner [ MockScrollAnimatorEnabled=true ] -->
    22<style>
    33    #scrollme {
     
    1313<script>
    1414    jsTestIsAsync = true;
    15     if (window.internals)
    16         window.internals.setUsesMockScrollAnimator(true);
    1715
    1816    window.onload = function() {
  • trunk/LayoutTests/fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html

    r261211 r282686  
    1 <html>
     1<html> <!-- webkit-test-runner [ MockScrollAnimatorEnabled=true ] -->
    22<script src="../../resources/js-test-pre.js"></script>
    33<script>
    44    jsTestIsAsync = true;
    55    if (window.internals) {
    6         window.internals.setUsesMockScrollAnimator(true);
    76        window.internals.setUsesOverlayScrollbars(true);
    87    }
  • trunk/LayoutTests/fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html

    r261211 r282686  
    1 <html>
     1<html> <!-- webkit-test-runner [ MockScrollAnimatorEnabled=true ] -->
    22<script src="../../resources/js-test-pre.js"></script>
    33<script>
    44    jsTestIsAsync = true;
    55    if (window.internals) {
    6         window.internals.setUsesMockScrollAnimator(true);
    76        window.internals.setUsesOverlayScrollbars(true);
    87    }
  • trunk/LayoutTests/fast/scrolling/scroll-animator-select-list-events.html

    r261211 r282686  
    1 <html>
     1<html> <!-- webkit-test-runner [ MockScrollAnimatorEnabled=true ] -->
    22<script src="../../resources/js-test-pre.js"></script>
    33<script>
    44    jsTestIsAsync = true;
    5     if (window.internals)
    6         window.internals.setUsesMockScrollAnimator(true);
    75
    86    window.onload = function() {
  • trunk/Source/WTF/ChangeLog

    r282643 r282686  
     12021-09-17  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Convert usesMockScrollAnimator from a DeprecatedGlobalSettings to a WebPreference
     4        https://bugs.webkit.org/show_bug.cgi?id=230371
     5
     6        Reviewed by Tim Horton.
     7
     8        Add a MockScrollAnimatorEnabled setting.
     9
     10        * Scripts/Preferences/WebPreferences.yaml:
     11
    1122021-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
    213
  • trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml

    r282643 r282686  
    15221522      default: true
    15231523
     1524MockScrollAnimatorEnabled:
     1525  type: bool
     1526  defaultValue:
     1527    WebKitLegacy:
     1528      default: false
     1529    WebKit:
     1530      default: false
     1531    WebCore:
     1532      default: false
     1533
    15241534MockScrollbarsEnabled:
    15251535  type: bool
  • trunk/Source/WebCore/ChangeLog

    r282684 r282686  
     12021-09-17  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Convert usesMockScrollAnimator from a DeprecatedGlobalSettings to a WebPreference
     4        https://bugs.webkit.org/show_bug.cgi?id=230371
     5
     6        Reviewed by Tim Horton.
     7
     8        There were ordering problems that resulted from timing of a test calling
     9        internals.setUsesMockScrollAnimator(true) and the first access of the scrollAnimator(),
     10        which resulted in fast/scrolling/scroll-animator-select-list-events.html failing
     11        when run twice in a row.
     12
     13        Fix by making usesMockScrollAnimator a WebPreference, which means that tests
     14        can use <!-- webkit-test-runner --> options to enable it, which avoids the
     15        ordering dependency.
     16
     17        * page/DeprecatedGlobalSettings.cpp:
     18        (WebCore::DeprecatedGlobalSettings::setUsesMockScrollAnimator): Deleted.
     19        (WebCore::DeprecatedGlobalSettings::usesMockScrollAnimator): Deleted.
     20        * page/DeprecatedGlobalSettings.h:
     21        * page/FrameView.cpp:
     22        (WebCore::FrameView::mockScrollAnimatorEnabled const):
     23        (WebCore::FrameView::usesMockScrollAnimator const): Deleted.
     24        * page/FrameView.h:
     25        * platform/ScrollableArea.cpp:
     26        (WebCore::ScrollableArea::scrollAnimator const):
     27        * platform/ScrollableArea.h:
     28        (WebCore::ScrollableArea::mockScrollAnimatorEnabled const):
     29        (WebCore::ScrollableArea::usesMockScrollAnimator const): Deleted.
     30        * rendering/RenderLayerScrollableArea.cpp:
     31        (WebCore::RenderLayerScrollableArea::mockScrollAnimatorEnabled const):
     32        (WebCore::RenderLayerScrollableArea::usesMockScrollAnimator const): Deleted.
     33        * rendering/RenderLayerScrollableArea.h:
     34        * rendering/RenderListBox.cpp:
     35        (WebCore::RenderListBox::mockScrollAnimatorEnabled const):
     36        (WebCore::RenderListBox::usesMockScrollAnimator const): Deleted.
     37        * rendering/RenderListBox.h:
     38        * testing/Internals.cpp:
     39        (WebCore::Internals::resetToConsistentState):
     40        (WebCore::Internals::setUsesMockScrollAnimator): Deleted.
     41        * testing/Internals.h:
     42        * testing/Internals.idl:
     43
    1442021-09-17  Alan Bujtas  <zalan@apple.com>
    245
  • trunk/Source/WebCore/page/DeprecatedGlobalSettings.cpp

    r280462 r282686  
    4444bool DeprecatedGlobalSettings::gMockScrollbarsEnabled = false;
    4545bool DeprecatedGlobalSettings::gUsesOverlayScrollbars = false;
    46 bool DeprecatedGlobalSettings::gMockScrollAnimatorEnabled = false;
    4746
    4847#if PLATFORM(WIN)
     
    126125}
    127126
    128 void DeprecatedGlobalSettings::setUsesMockScrollAnimator(bool flag)
    129 {
    130     gMockScrollAnimatorEnabled = flag;
    131 }
    132 
    133 bool DeprecatedGlobalSettings::usesMockScrollAnimator()
    134 {
    135     return gMockScrollAnimatorEnabled;
    136 }
    137 
    138127void DeprecatedGlobalSettings::setLowPowerVideoAudioBufferSizeEnabled(bool flag)
    139128{
  • trunk/Source/WebCore/page/DeprecatedGlobalSettings.h

    r280462 r282686  
    5858    static bool usesOverlayScrollbars();
    5959
    60     WEBCORE_EXPORT static void setUsesMockScrollAnimator(bool);
    61     static bool usesMockScrollAnimator();
    62 
    6360    static bool lowPowerVideoAudioBufferSizeEnabled() { return gLowPowerVideoAudioBufferSizeEnabled; }
    6461    WEBCORE_EXPORT static void setLowPowerVideoAudioBufferSizeEnabled(bool);
     
    104101    static bool gMockScrollbarsEnabled;
    105102    static bool gUsesOverlayScrollbars;
    106     static bool gMockScrollAnimatorEnabled;
    107103
    108104#if PLATFORM(WIN)
  • trunk/Source/WebCore/page/FrameView.cpp

    r282629 r282686  
    14461446}
    14471447
    1448 bool FrameView::usesMockScrollAnimator() const
    1449 {
    1450     return DeprecatedGlobalSettings::usesMockScrollAnimator();
     1448bool FrameView::mockScrollAnimatorEnabled() const
     1449{
     1450    return frame().settings().mockScrollAnimatorEnabled();
    14511451}
    14521452
  • trunk/Source/WebCore/page/FrameView.h

    r282629 r282686  
    775775
    776776    bool usesCompositedScrolling() const final;
    777     bool usesMockScrollAnimator() const final;
     777    bool mockScrollAnimatorEnabled() const final;
    778778    void logMockScrollAnimatorMessage(const String&) const final;
    779779
  • trunk/Source/WebCore/platform/ScrollableArea.cpp

    r282629 r282686  
    7676{
    7777    if (!m_scrollAnimator) {
    78         if (usesMockScrollAnimator()) {
     78        if (mockScrollAnimatorEnabled()) {
    7979            m_scrollAnimator = makeUnique<ScrollAnimatorMock>(const_cast<ScrollableArea&>(*this), [this](const String& message) {
    8080                logMockScrollAnimatorMessage(message);
  • trunk/Source/WebCore/platform/ScrollableArea.h

    r279218 r282686  
    335335    void horizontalScrollbarLayerDidChange();
    336336
    337     virtual bool usesMockScrollAnimator() const { return false; }
     337    virtual bool mockScrollAnimatorEnabled() const { return false; }
    338338    virtual void logMockScrollAnimatorMessage(const String&) const { };
    339339
  • trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp

    r281991 r282686  
    18331833}
    18341834
    1835 bool RenderLayerScrollableArea::usesMockScrollAnimator() const
    1836 {
    1837     return DeprecatedGlobalSettings::usesMockScrollAnimator();
     1835bool RenderLayerScrollableArea::mockScrollAnimatorEnabled() const
     1836{
     1837    return m_layer.renderer().settings().mockScrollAnimatorEnabled();
    18381838}
    18391839
  • trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h

    r279869 r282686  
    191191    bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const final;
    192192    bool isScrollSnapInProgress() const final;
    193     bool usesMockScrollAnimator() const final;
     193    bool mockScrollAnimatorEnabled() const final;
    194194    void logMockScrollAnimatorMessage(const String&) const final;
    195195
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r278253 r282686  
    899899}
    900900
    901 bool RenderListBox::usesMockScrollAnimator() const
    902 {
    903     return DeprecatedGlobalSettings::usesMockScrollAnimator();
     901bool RenderListBox::mockScrollAnimatorEnabled() const
     902{
     903    return settings().mockScrollAnimatorEnabled();
    904904}
    905905
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r278340 r282686  
    139139    bool hasScrollableOrRubberbandableAncestor() final;
    140140    IntRect scrollableAreaBoundingBox(bool* = nullptr) const final;
    141     bool usesMockScrollAnimator() const final;
     141    bool mockScrollAnimatorEnabled() const final;
    142142    void logMockScrollAnimatorMessage(const String&) const final;
    143143    String debugDescription() const final;
  • trunk/Source/WebCore/testing/Internals.cpp

    r282628 r282686  
    532532    overrideUserPreferredLanguages(Vector<String>());
    533533    WebCore::DeprecatedGlobalSettings::setUsesOverlayScrollbars(false);
    534     WebCore::DeprecatedGlobalSettings::setUsesMockScrollAnimator(false);
    535534    if (!page.mainFrame().editor().isContinuousSpellCheckingEnabled())
    536535        page.mainFrame().editor().toggleContinuousSpellChecking();
     
    38213820}
    38223821
    3823 void Internals::setUsesMockScrollAnimator(bool enabled)
    3824 {
    3825     WebCore::DeprecatedGlobalSettings::setUsesMockScrollAnimator(enabled);
    3826 }
    3827 
    38283822void Internals::forceReload(bool endToEnd)
    38293823{
  • trunk/Source/WebCore/testing/Internals.h

    r282628 r282686  
    593593
    594594    void setUsesOverlayScrollbars(bool);
    595     void setUsesMockScrollAnimator(bool);
    596595
    597596    ExceptionOr<String> getCurrentCursorInfo();
  • trunk/Source/WebCore/testing/Internals.idl

    r282628 r282686  
    688688
    689689    undefined setUsesOverlayScrollbars(boolean enabled);
    690     undefined setUsesMockScrollAnimator(boolean enabled);
    691690
    692691    undefined forceReload(boolean endToEnd);
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r282393 r282686  
     12021-09-17  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Convert usesMockScrollAnimator from a DeprecatedGlobalSettings to a WebPreference
     4        https://bugs.webkit.org/show_bug.cgi?id=230371
     5
     6        Reviewed by Tim Horton.
     7
     8        Add Windows preferences.
     9
     10        * WebPreferences.cpp:
     11        (WebPreferences::mockScrollAnimatorEnabled):
     12        * WebPreferences.h:
     13        * WebView.cpp:
     14        (WebView::notifyPreferencesChanged):
     15
    1162021-09-14  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebKitLegacy/win/WebPreferences.cpp

    r277569 r282686  
    26382638}
    26392639
     2640bool WebPreferences::mockScrollAnimatorEnabled()
     2641{
     2642    return boolValueForKey("WebKitMockScrollAnimatorEnabled");
     2643}
     2644
  • trunk/Source/WebKitLegacy/win/WebPreferences.h

    r277569 r282686  
    347347    // needed for testing purposes and can be toggled via the set*PreferenceForTesting functions.
    348348    bool canvasColorSpaceEnabled();
     349    bool mockScrollAnimatorEnabled();
    349350
    350351private:
  • trunk/Source/WebKitLegacy/win/WebView.cpp

    r282606 r282686  
    55875587
    55885588    settings.setCanvasColorSpaceEnabled(m_preferences->canvasColorSpaceEnabled());
     5589    settings.setMockScrollAnimatorEnabled(m_preferences->mockScrollAnimatorEnabled());
    55895590
    55905591    return S_OK;
  • trunk/Tools/DumpRenderTree/TestOptions.cpp

    r277767 r282686  
    156156            { "MainContentUserGestureOverrideEnabled", false },
    157157            { "MenuItemElementEnabled", false },
     158            { "MockScrollAnimatorEnabled", false },
    158159            { "ModernMediaControlsEnabled", true },
    159160            { "NeedsStorageAccessFromFileURLsQuirk", false },
Note: See TracChangeset for help on using the changeset viewer.