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

Changeset 254790 in webkit


Ignore:
Timestamp:
Jan 17, 2020, 9:49:24 PM (7 years ago)
Author:
cathiechen
Message:

Add support for scroll behavior parsing
https://bugs.webkit.org/show_bug.cgi?id=205009

Reviewed by Frédéric Wang.

Based on the patch by Frédéric Wang.

LayoutTests/imported/w3c:

  • web-platform-tests/css/cssom-view/inheritance-expected.txt:
  • web-platform-tests/css/cssom-view/inheritance.html:
  • web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt:
  • web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html:
  • web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt:
  • web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html:

Source/WebCore:

Add support for parsing scroll-behavior css property and ScrollOptions.

Tests: LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html

LayoutTests/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html
LayoutTests/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html

  • CMakeLists.txt: Add IDL files for ScrollOptions and ScrollBehavior.
  • DerivedSources.make:
  • Headers.cmake: Add headers for ScrollBehavor and ScrollOptions.
  • Sources.txt: Add ScrollBehavor and ScrollOptions implementation.
  • WebCore.xcodeproj/project.pbxproj: Add files to the build system.
  • css/CSSComputedStyleDeclaration.cpp: Handle scroll-behavior.

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/CSSProperties.json: Add scroll-behavior.
  • css/CSSValueKeywords.in: Add keywords for scroll-behavior.
  • css/parser/CSSParserContext.cpp: Add runtime config for scroll-behavior.

(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):

  • css/parser/CSSParserContext.h: Ditto.

(WebCore::CSSParserContextHash::hash):

  • css/parser/CSSParserFastPaths.cpp: Remove scroll-behavior templates. It is handled in the slow path since property can be disabled.

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeScrollBehavior):
(WebCore::CSSPropertyParser::parseSingleValue): Parse scroll-behavior (only if enabled).

  • page/ScrollBehavior.cpp: Added.

(WebCore::useSmoothScrolling): Helper funciton to determine the scroll behavior to apply to an element from the CSS and DOM behavior.

  • page/ScrollBehavior.h: Added.
  • page/ScrollBehavior.idl: Added.
  • page/ScrollIntoViewOptions.h: Make this class inherits from ScrollOption. Also remove unnecessary forward declaration.
  • page/ScrollIntoViewOptions.idl: Make this class inherits from ScrollOption.
  • page/ScrollOptions.h: Added.
  • page/ScrollOptions.idl: Added.
  • page/ScrollToOptions.h: Make this struct inherits from ScrollOptions.

(WebCore::ScrollToOptions::ScrollToOptions):
(WebCore::normalizeNonFiniteCoordinatesOrFallBackTo): Copy the current ScrollToOptions so that the scroll behavior is preserved.

  • page/ScrollToOptions.idl: Make this class inherit from ScrollOptions.
  • page/Settings.yaml: New setting for CSSOM View smooth scrolling.
  • rendering/style/RenderStyle.h: Handle 'smooth scrolling' boolean data.

(WebCore::RenderStyle::useSmoothScrolling const):
(WebCore::RenderStyle::setUseSmoothScrolling):
(WebCore::RenderStyle::initialUseSmoothScrolling):

  • rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):

  • rendering/style/StyleRareNonInheritedData.h:
  • style/StyleBuilderConverter.h:

(WebCore::Style::BuilderConverter::convertSmoothScrolling):

Source/WebKit:

Add CSSOM smooth scrolling as an experimental feature.

  • Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

Add run time flag for CSSOMViewSmoothScrolling.

  • WebView/WebPreferenceKeysPrivate.h: Handle CSSOMViewSmoothScrolling by.
  • WebView/WebPreferences.mm:

([WebPreferences initialize]): Disable CSSOMViewSmoothScrolling by default.
(-[WebPreferences CSSOMViewSmoothScrollingEnabled]): Getter.
(-[WebPreferences setCSSOMViewSmoothScrollingEnabled:]): Setter.

  • WebView/WebPreferencesPrivate.h:
  • WebView/WebView.mm:

(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

  • Interfaces/IWebPreferencesPrivate.idl: Handle smooth scrolling option.
  • WebPreferenceKeysPrivate.h: Ditto.
  • WebPreferences.cpp: Ditto.

(WebPreferences::initializeDefaultSettings):
(WebPreferences::CSSOMViewSmoothScrollingEnabled):
(WebPreferences::setCSSOMViewSmoothScrollingEnabled):

  • WebPreferences.h: Ditto.
  • WebView.cpp: Ditto.

(WebView::notifyPreferencesChanged):

Tools:

  • DumpRenderTree/TestOptions.cpp:

(TestOptions::TestOptions): Parse CSSOMViewSmoothScrollingEnabled.

  • DumpRenderTree/TestOptions.h: Add CSSOMViewSmoothScrollingEnabled, disabled by default.
  • DumpRenderTree/mac/DumpRenderTree.mm:

(enableExperimentalFeatures):
(setWebPreferencesForTestOptions): Set CSSOMViewSmoothScrollingEnabled from the test options.

Location:
trunk
Files:
5 added
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r254672 r254790  
     12020-01-17  Cathie Chen  <cathiechen@igalia.com>
     2
     3        Add support for scroll behavior parsing
     4        https://bugs.webkit.org/show_bug.cgi?id=205009
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Based on the patch by Frédéric Wang.
     9
     10        * web-platform-tests/css/cssom-view/inheritance-expected.txt:
     11        * web-platform-tests/css/cssom-view/inheritance.html:
     12        * web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt:
     13        * web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html:
     14        * web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt:
     15        * web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html:
     16
    1172020-01-16  Rob Buis  <rbuis@igalia.com>
    218
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance-expected.txt

    r251634 r254790  
    11
    2 FAIL Property scroll-behavior has initial value auto assert_true: scroll-behavior doesn't seem to be supported in the computed style expected true got false
    3 FAIL Property scroll-behavior does not inherit assert_true: expected true got false
     2PASS Property scroll-behavior has initial value auto
     3PASS Property scroll-behavior does not inherit
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html

    r254129 r254790  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt

    r254129 r254790  
    11
    2 FAIL Property scroll-behavior value 'auto' computes to 'auto' assert_true: scroll-behavior doesn't seem to be supported in the computed style expected true got false
    3 FAIL Property scroll-behavior value 'smooth' computes to 'smooth' assert_true: scroll-behavior doesn't seem to be supported in the computed style expected true got false
     2PASS Property scroll-behavior value 'auto' computes to 'auto'
     3PASS Property scroll-behavior value 'smooth' computes to 'smooth'
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html

    r254129 r254790  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
    22<html>
    33<head>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt

    r254129 r254790  
    11
    2 FAIL e.style['scroll-behavior'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value ""
    3 FAIL e.style['scroll-behavior'] = "smooth" should set the property value assert_not_equals: property should be set got disallowed value ""
     2PASS e.style['scroll-behavior'] = "auto" should set the property value
     3PASS e.style['scroll-behavior'] = "smooth" should set the property value
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html

    r254129 r254790  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
    22<html>
    33<head>
  • trunk/Source/WebCore/CMakeLists.txt

    r254681 r254790  
    973973    page/ResizeObserverEntry.idl
    974974    page/Screen.idl
     975    page/ScrollBehavior.idl
    975976    page/ScrollIntoViewOptions.idl
    976977    page/ScrollLogicalPosition.idl
     978    page/ScrollOptions.idl
    977979    page/ScrollToOptions.idl
    978980    page/ShareData.idl
  • trunk/Source/WebCore/ChangeLog

    r254789 r254790  
     12020-01-17  Cathie Chen  <cathiechen@igalia.com>
     2
     3        Add support for scroll behavior parsing
     4        https://bugs.webkit.org/show_bug.cgi?id=205009
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Based on the patch by Frédéric Wang.
     9
     10        Add support for parsing scroll-behavior css property and ScrollOptions.
     11
     12        Tests: LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html
     13               LayoutTests/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html
     14               LayoutTests/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html
     15
     16        * CMakeLists.txt: Add IDL files for ScrollOptions and ScrollBehavior.
     17        * DerivedSources.make:
     18        * Headers.cmake: Add headers for ScrollBehavor and ScrollOptions.
     19        * Sources.txt: Add ScrollBehavor and ScrollOptions implementation.
     20        * WebCore.xcodeproj/project.pbxproj: Add files to the build system.
     21        * css/CSSComputedStyleDeclaration.cpp: Handle scroll-behavior.
     22        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     23        * css/CSSProperties.json: Add scroll-behavior.
     24        * css/CSSValueKeywords.in: Add keywords for scroll-behavior.
     25        * css/parser/CSSParserContext.cpp: Add runtime config for scroll-behavior.
     26        (WebCore::CSSParserContext::CSSParserContext):
     27        (WebCore::operator==):
     28        * css/parser/CSSParserContext.h: Ditto.
     29        (WebCore::CSSParserContextHash::hash):
     30        * css/parser/CSSParserFastPaths.cpp: Remove scroll-behavior templates. It is handled in the slow path since property can be disabled.
     31        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
     32        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
     33        * css/parser/CSSPropertyParser.cpp:
     34        (WebCore::consumeScrollBehavior):
     35        (WebCore::CSSPropertyParser::parseSingleValue): Parse scroll-behavior (only if enabled).
     36        * page/ScrollBehavior.cpp: Added.
     37        (WebCore::useSmoothScrolling): Helper funciton to determine the scroll behavior to apply to an element from the CSS and DOM behavior.
     38        * page/ScrollBehavior.h: Added.
     39        * page/ScrollBehavior.idl: Added.
     40        * page/ScrollIntoViewOptions.h: Make this class inherits from ScrollOption. Also remove unnecessary forward declaration.
     41        * page/ScrollIntoViewOptions.idl: Make this class inherits from ScrollOption.
     42        * page/ScrollOptions.h: Added.
     43        * page/ScrollOptions.idl: Added.
     44        * page/ScrollToOptions.h: Make this struct inherits from ScrollOptions.
     45        (WebCore::ScrollToOptions::ScrollToOptions):
     46        (WebCore::normalizeNonFiniteCoordinatesOrFallBackTo): Copy the current ScrollToOptions so that the scroll behavior is preserved.
     47        * page/ScrollToOptions.idl: Make this class inherit from ScrollOptions.
     48        * page/Settings.yaml: New setting for CSSOM View smooth scrolling.
     49        * rendering/style/RenderStyle.h: Handle 'smooth scrolling' boolean data.
     50        (WebCore::RenderStyle::useSmoothScrolling const):
     51        (WebCore::RenderStyle::setUseSmoothScrolling):
     52        (WebCore::RenderStyle::initialUseSmoothScrolling):
     53        * rendering/style/StyleRareNonInheritedData.cpp:
     54        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     55        (WebCore::StyleRareNonInheritedData::operator== const):
     56        * rendering/style/StyleRareNonInheritedData.h:
     57        * style/StyleBuilderConverter.h:
     58        (WebCore::Style::BuilderConverter::convertSmoothScrolling):
     59
    1602020-01-17  Ryosuke Niwa  <rniwa@webkit.org>
    261
  • trunk/Source/WebCore/DerivedSources.make

    r254029 r254790  
    920920    $(WebCore)/page/ResizeObserverEntry.idl \
    921921    $(WebCore)/page/Screen.idl \
     922    $(WebCore)/page/ScrollBehavior.idl \
    922923    $(WebCore)/page/ScrollIntoViewOptions.idl \
    923924    $(WebCore)/page/ScrollLogicalPosition.idl \
     925    $(WebCore)/page/ScrollOptions.idl \
    924926    $(WebCore)/page/ScrollToOptions.idl \
    925927    $(WebCore)/page/ShareData.idl \
  • trunk/Source/WebCore/Headers.cmake

    r254766 r254790  
    836836    page/RenderingUpdateScheduler.h
    837837    page/RuntimeEnabledFeatures.h
     838    page/ScrollBehavior.h
    838839    page/ScrollIntoViewOptions.h
    839840    page/ScrollLogicalPosition.h
     841    page/ScrollOptions.h
    840842    page/ScrollToOptions.h
    841843    page/SecurityOrigin.h
  • trunk/Source/WebCore/Sources.txt

    r254766 r254790  
    16561656page/RuntimeEnabledFeatures.cpp
    16571657page/Screen.cpp
     1658page/ScrollBehavior.cpp
    16581659page/SecurityOrigin.cpp
    16591660page/SecurityOriginData.cpp
     
    33973398JSScreen.cpp
    33983399JSScriptProcessorNode.cpp
     3400JSScrollBehavior.cpp
    33993401JSScrollIntoViewOptions.cpp
    34003402JSScrollLogicalPosition.cpp
     3403JSScrollOptions.cpp
    34013404JSScrollToOptions.cpp
    34023405JSSecurityPolicyViolationEvent.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r254779 r254790  
    24132413                834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; };
    24142414                834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; };
     2415                834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */; };
     2416                834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */; };
    24152417                834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
    24162418                8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
     
    24672469                83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
    24682470                83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2471                83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356424 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2472                83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356435 /* ScrollOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    24692473                83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    24702474                83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; };
     
    1021310217                8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
    1021410218                8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
     10219                8350C3E71DA59B6200356424 /* ScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.h; sourceTree = "<group>"; };
     10220                8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.cpp; sourceTree = "<group>"; };
     10221                8350C3E71DA59B6200356435 /* ScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollOptions.h; sourceTree = "<group>"; };
    1021510222                8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
    1021610223                8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
    1021710224                8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
     10225                8350C3E81DA59B6200356424 /* ScrollBehavior.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollBehavior.idl; sourceTree = "<group>"; };
     10226                8350C3E81DA59B6200356435 /* ScrollOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollOptions.idl; sourceTree = "<group>"; };
    1021810227                8350C3E81DA59B6200356446 /* ScrollToOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollToOptions.idl; sourceTree = "<group>"; };
    1021910228                83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; };
     
    1033710346                83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
    1033810347                83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
     10348                83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollBehavior.cpp; sourceTree = "<group>"; };
     10349                83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollOptions.cpp; sourceTree = "<group>"; };
    1033910350                83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
    1034010351                83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
    1034110352                83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
     10353                83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollBehavior.h; sourceTree = "<group>"; };
     10354                83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollOptions.h; sourceTree = "<group>"; };
    1034210355                83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollToOptions.h; sourceTree = "<group>"; };
    1034310356                83EE598B1F50958B003E8B30 /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; };
     
    2083920852                                BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
    2084020853                                BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
     20854                                8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */,
     20855                                8350C3E71DA59B6200356424 /* ScrollBehavior.h */,
     20856                                8350C3E81DA59B6200356424 /* ScrollBehavior.idl */,
    2084120857                                8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */,
    2084220858                                8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */,
    2084320859                                8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */,
    2084420860                                8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */,
     20861                                8350C3E71DA59B6200356435 /* ScrollOptions.h */,
     20862                                8350C3E81DA59B6200356435 /* ScrollOptions.idl */,
    2084520863                                8350C3E71DA59B6200356446 /* ScrollToOptions.h */,
    2084620864                                8350C3E81DA59B6200356446 /* ScrollToOptions.idl */,
     
    2563625654                                BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
    2563725655                                BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
     25656                                83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */,
     25657                                83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */,
    2563825658                                83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */,
    2563925659                                83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */,
    2564025660                                83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */,
    2564125661                                83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */,
     25662                                83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */,
     25663                                83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */,
    2564225664                                83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */,
    2564325665                                83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */,
     
    3100431026                                BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
    3100531027                                FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
     31028                                834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */,
    3100631029                                834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */,
    3100731030                                834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */,
     31031                                834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */,
    3100831032                                834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
    3100931033                                CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
     
    3221732241                                BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
    3221832242                                0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
     32243                                83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */,
    3221932244                                1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
    3222032245                                0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
     
    3225332278                                7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
    3225432279                                83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */,
     32280                                83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */,
    3225532281                                F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
    3225632282                                F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r254561 r254790  
    33753375            return cssValuePool.createIdentifierValue(CSSValueTouch);
    33763376#endif
     3377        case CSSPropertyScrollBehavior:
     3378            if (!style.useSmoothScrolling())
     3379                return cssValuePool.createIdentifierValue(CSSValueAuto);
     3380            return cssValuePool.createIdentifierValue(CSSValueSmooth);
    33773381        case CSSPropertyPerspective:
    33783382            if (!style.hasPerspective())
  • trunk/Source/WebCore/css/CSSProperties.json

    r254187 r254790  
    35553555            }
    35563556        },
     3557        "scroll-behavior": {
     3558            "values": [
     3559                "auto",
     3560                "smooth"
     3561            ],
     3562            "specification": {
     3563                "category": "cssom-view",
     3564                "url": "https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior"
     3565            }
     3566        },
    35573567        "shape-rendering": {
    35583568            "inherited": true,
     
    64826492            }
    64836493        },
     6494        "scroll-behavior": {
     6495            "values": [
     6496                "auto",
     6497                "smooth"
     6498            ],
     6499            "codegen-properties": {
     6500                "converter": "SmoothScrolling",
     6501                "name-for-methods": "UseSmoothScrolling"
     6502            },
     6503            "status": {
     6504                "status": "experimental"
     6505            },
     6506            "specification": {
     6507                "url": "https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior"
     6508            }
     6509        },
    64846510        "scroll-padding": {
    64856511            "codegen-properties": {
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r254187 r254790  
    13891389#endif
    13901390
     1391// scroll-behavior
     1392// auto
     1393smooth
     1394
    13911395// hanging-punctuation
    13921396allow-end
  • trunk/Source/WebCore/css/parser/CSSParserContext.cpp

    r245483 r254790  
    7676#endif
    7777    deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
     78    scrollBehaviorEnabled = document.settings().CSSOMViewSmoothScrollingEnabled();
    7879    useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
    7980}
     
    100101#endif
    101102        && a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
     103        && a.scrollBehaviorEnabled == b.scrollBehaviorEnabled
    102104        && a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin
    103105        && a.useSystemAppearance == b.useSystemAppearance;
  • trunk/Source/WebCore/css/parser/CSSParserContext.h

    r251655 r254790  
    6666#endif
    6767    bool deferredCSSParserEnabled { false };
     68    bool scrollBehaviorEnabled { false };
    6869   
    6970    // This is only needed to support getMatchedCSSRules.
     
    117118            & key.attachmentEnabled                         << 11
    118119#endif
    119             & key.mode                                      << 12; // Keep this last.
     120            & key.scrollBehaviorEnabled                     << 12
     121            & key.mode                                      << 13; // Keep this last.
    120122        hash ^= WTF::intHash(bits);
    121123        return hash;
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r254232 r254790  
    639639    case CSSPropertyResize: // none | both | horizontal | vertical | auto
    640640        return valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto;
    641     // FIXME-NEWPARSER: Investigate this property.
    642     // case CSSPropertyScrollBehavior: // auto | smooth
    643     //     ASSERT(RuntimeEnabledFeatures::cssomSmoothScrollEnabled());
    644     //   return valueID == CSSValueAuto || valueID == CSSValueSmooth;
    645641    case CSSPropertyShapeRendering:
    646642        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricPrecision;
     
    943939    // case CSSPropertyHyphens:
    944940    // case CSSPropertyOverflowAnchor:
    945     // case CSSPropertyScrollBehavior:
    946941    // case CSSPropertyScrollSnapType:
    947942    // case CSSPropertyTextAlignLast:
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r254232 r254790  
    23282328#endif
    23292329
     2330static RefPtr<CSSPrimitiveValue> consumeScrollBehavior(CSSParserTokenRange& range)
     2331{
     2332    auto valueID = range.peek().id();
     2333    if (valueID != CSSValueAuto && valueID != CSSValueSmooth)
     2334        return nullptr;
     2335    return consumeIdent(range);
     2336}
     2337
    23302338static RefPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode)
    23312339{
     
    39103918        return consumeScrollSnapType(m_range);
    39113919#endif
     3920    case CSSPropertyScrollBehavior:
     3921        if (!m_context.scrollBehaviorEnabled)
     3922            return nullptr;
     3923        return consumeScrollBehavior(m_range);
    39123924    case CSSPropertyClip:
    39133925        return consumeClip(m_range, m_context.mode);
  • trunk/Source/WebCore/page/ScrollIntoViewOptions.h

    r239427 r254790  
    2121
    2222#include "ScrollLogicalPosition.h"
     23#include "ScrollOptions.h"
    2324
    2425namespace WebCore {
    2526
    26 class Element;
    27 
    28 struct ScrollIntoViewOptions {
     27struct ScrollIntoViewOptions : ScrollOptions {
    2928    Optional<ScrollLogicalPosition> blockPosition { ScrollLogicalPosition::Start };
    3029    Optional<ScrollLogicalPosition> inlinePosition { ScrollLogicalPosition::Nearest };
  • trunk/Source/WebCore/page/ScrollIntoViewOptions.idl

    r235659 r254790  
    1818 */
    1919
    20 // FIXME(webkit.org/b/188043): Support ScrollBehavior.
    21 dictionary ScrollIntoViewOptions {
     20dictionary ScrollIntoViewOptions : ScrollOptions {
    2221    [ImplementedAs=blockPosition] ScrollLogicalPosition block = "start";
    2322    [ImplementedAs=inlinePosition] ScrollLogicalPosition inline = "nearest";
  • trunk/Source/WebCore/page/ScrollToOptions.h

    r239427 r254790  
    2929#pragma once
    3030
     31#include "ScrollOptions.h"
    3132#include <cmath>
    3233#include <wtf/Optional.h>
     
    3435namespace WebCore {
    3536
    36 struct ScrollToOptions {
     37struct ScrollToOptions : ScrollOptions {
    3738    Optional<double> left;
    3839    Optional<double> top;
     40
     41    ScrollToOptions() = default;
     42    ScrollToOptions(double x, double y)
     43        : left(x)
     44        , top(y)
     45    { }
    3946};
    4047
     
    4855inline ScrollToOptions normalizeNonFiniteCoordinatesOrFallBackTo(const ScrollToOptions& value, double x, double y)
    4956{
    50     ScrollToOptions options;
     57    ScrollToOptions options = value;
    5158    options.left = normalizeNonFiniteValueOrFallBackTo(value.left, x);
    5259    options.top = normalizeNonFiniteValueOrFallBackTo(value.top, y);
  • trunk/Source/WebCore/page/ScrollToOptions.idl

    r234254 r254790  
    2727 */
    2828
    29 // FIXME(webkit.org/b/188043): Support ScrollBehavior.
    30 dictionary ScrollToOptions {
     29dictionary ScrollToOptions : ScrollOptions {
    3130    unrestricted double left;
    3231    unrestricted double top;
  • trunk/Source/WebCore/page/Settings.yaml

    r254669 r254790  
    622622  initial: false
    623623
     624CSSOMViewSmoothScrollingEnabled:
     625  initial: false
     626
    624627inputEventsEnabled:
    625628  initial: true
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r254187 r254790  
    737737#endif
    738738
     739    bool useSmoothScrolling() const { return m_rareNonInheritedData->useSmoothScrolling; }
     740
    739741#if ENABLE(TEXT_AUTOSIZING)
    740742    TextSizeAdjustment textSizeAdjust() const { return m_rareInheritedData->textSizeAdjust; }
     
    12641266    void setUseTouchOverflowScrolling(bool v) { SET_VAR(m_rareInheritedData, useTouchOverflowScrolling, v); }
    12651267#endif
     1268
     1269    void setUseSmoothScrolling(bool v) { SET_VAR(m_rareNonInheritedData, useSmoothScrolling, v); }
    12661270
    12671271#if ENABLE(TEXT_AUTOSIZING)
     
    17021706#endif
    17031707
     1708    static bool initialUseSmoothScrolling() { return false; }
     1709
    17041710    static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
    17051711    static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r253987 r254790  
    9090    , userDrag(static_cast<unsigned>(RenderStyle::initialUserDrag()))
    9191    , textOverflow(static_cast<unsigned>(RenderStyle::initialTextOverflow()))
     92    , useSmoothScrolling(static_cast<unsigned>(RenderStyle::initialUseSmoothScrolling()))
    9293    , marginBeforeCollapse(static_cast<unsigned>(MarginCollapse::Collapse))
    9394    , marginAfterCollapse(static_cast<unsigned>(MarginCollapse::Collapse))
     
    183184    , userDrag(o.userDrag)
    184185    , textOverflow(o.textOverflow)
     186    , useSmoothScrolling(o.useSmoothScrolling)
    185187    , marginBeforeCollapse(o.marginBeforeCollapse)
    186188    , marginAfterCollapse(o.marginAfterCollapse)
     
    281283        && userDrag == o.userDrag
    282284        && textOverflow == o.textOverflow
     285        && useSmoothScrolling == o.useSmoothScrolling
    283286        && marginBeforeCollapse == o.marginBeforeCollapse
    284287        && marginAfterCollapse == o.marginAfterCollapse
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r253987 r254790  
    184184    unsigned userDrag : 2; // UserDrag
    185185    unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
     186    unsigned useSmoothScrolling : 1; // ScrollBehavior
    186187    unsigned marginBeforeCollapse : 2; // MarginCollapse
    187188    unsigned marginAfterCollapse : 2; // MarginCollapse
  • trunk/Source/WebCore/style/StyleBuilderConverter.h

    r254187 r254790  
    131131#endif
    132132    static FontFeatureSettings convertFontFeatureSettings(BuilderState&, const CSSValue&);
     133    static bool convertSmoothScrolling(BuilderState&, const CSSValue&);
    133134    static FontSelectionValue convertFontWeightFromValue(const CSSValue&);
    134135    static FontSelectionValue convertFontStretchFromValue(const CSSValue&);
     
    13761377#endif
    13771378
     1379inline bool BuilderConverter::convertSmoothScrolling(BuilderState&, const CSSValue& value)
     1380{
     1381    return downcast<CSSPrimitiveValue>(value).valueID() == CSSValueSmooth;
     1382}
     1383
    13781384inline SVGLengthValue BuilderConverter::convertSVGLengthValue(BuilderState&, const CSSValue& value)
    13791385{
  • trunk/Source/WebKit/ChangeLog

    r254784 r254790  
     12020-01-17  Cathie Chen  <cathiechen@igalia.com>
     2
     3        Add support for scroll behavior parsing
     4        https://bugs.webkit.org/show_bug.cgi?id=205009
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Based on the patch by Frédéric Wang.
     9
     10        Add CSSOM smooth scrolling as an experimental feature.
     11
     12        * Shared/WebPreferences.yaml:
     13
    1142020-01-17  Peng Liu  <peng.liu6@apple.com>
    215
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r254669 r254790  
    13201320  category: internal
    13211321
     1322CSSOMViewSmoothScrollingEnabled:
     1323  type: bool
     1324  defaultValue: false
     1325  humanReadableName: "CSSOM View Smooth Scrolling"
     1326  humanReadableDescription: "Enable DOM API and CSS property for 'smooth' scroll behavior"
     1327  category: experimental
     1328
    13221329WebAnimationsEnabled:
    13231330  type: bool
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r254683 r254790  
     12020-01-17  Cathie Chen  <cathiechen@igalia.com>
     2
     3        Add support for scroll behavior parsing
     4        https://bugs.webkit.org/show_bug.cgi?id=205009
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Based on the patch by Frédéric Wang.
     9
     10        Add run time flag for CSSOMViewSmoothScrolling.
     11
     12        * WebView/WebPreferenceKeysPrivate.h: Handle CSSOMViewSmoothScrolling by.
     13        * WebView/WebPreferences.mm:
     14        ([WebPreferences initialize]): Disable CSSOMViewSmoothScrolling by default.
     15        (-[WebPreferences CSSOMViewSmoothScrollingEnabled]): Getter.
     16        (-[WebPreferences setCSSOMViewSmoothScrollingEnabled:]): Setter.
     17        * WebView/WebPreferencesPrivate.h:
     18        * WebView/WebView.mm:
     19        (-[WebView _preferencesChanged:]):
     20
    1212020-01-16  David Kilzer  <ddkilzer@apple.com>
    222
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h

    r254669 r254790  
    189189#define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled"
    190190#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey @"WebKitCSSOMViewScrollingAPIEnabled"
     191#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey @"WebKitCSSOMViewSmoothScrollingEnabled"
    191192#define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
    192193#define WebKitRemotePlaybackEnabledPreferenceKey @"WebKitRemotePlaybackEnabled"
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm

    r254669 r254790  
    665665
    666666        @YES, WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
     667        @NO, WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey,
    667668        @YES, WebKitNeedsStorageAccessFromFileURLsQuirkKey,
    668669        @NO, WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
     
    31843185}
    31853186
     3187- (BOOL)CSSOMViewSmoothScrollingEnabled
     3188{
     3189    return [self _boolValueForKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
     3190}
     3191
     3192- (void)setCSSOMViewSmoothScrollingEnabled:(BOOL)flag
     3193{
     3194    [self _setBoolValue:flag forKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
     3195}
     3196
    31863197- (BOOL)webAnimationsEnabled
    31873198{
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h

    r254669 r254790  
    639639@property (nonatomic) BOOL visualViewportAPIEnabled;
    640640@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
     641@property (nonatomic) BOOL CSSOMViewSmoothScrollingEnabled;
    641642@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
    642643@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r254669 r254790  
    30063006    settings.setSyntheticEditingCommandsEnabled([preferences syntheticEditingCommandsEnabled]);
    30073007    settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
     3008    settings.setCSSOMViewSmoothScrollingEnabled([preferences CSSOMViewSmoothScrollingEnabled]);
    30083009    settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
    30093010
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r254669 r254790  
     12020-01-17  Cathie Chen  <cathiechen@igalia.com>
     2
     3        Add support for scroll behavior parsing
     4        https://bugs.webkit.org/show_bug.cgi?id=205009
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Based on the patch by Frédéric Wang.
     9
     10        * Interfaces/IWebPreferencesPrivate.idl: Handle smooth scrolling option.
     11        * WebPreferenceKeysPrivate.h: Ditto.
     12        * WebPreferences.cpp: Ditto.
     13        (WebPreferences::initializeDefaultSettings):
     14        (WebPreferences::CSSOMViewSmoothScrollingEnabled):
     15        (WebPreferences::setCSSOMViewSmoothScrollingEnabled):
     16        * WebPreferences.h: Ditto.
     17        * WebView.cpp: Ditto.
     18        (WebView::notifyPreferencesChanged):
     19
    1202020-01-16  Cathie Chen  <cathiechen@igalia.com>
    221
  • trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl

    r254669 r254790  
    224224    HRESULT CSSOMViewScrollingAPIEnabled([out, retval] BOOL*);
    225225    HRESULT setCSSOMViewScrollingAPIEnabled([in] BOOL enabled);
     226    HRESULT CSSOMViewSmoothScrollingEnabled([out, retval] BOOL*);
     227    HRESULT setCSSOMViewSmoothScrollingEnabled([in] BOOL enabled);
    226228    HRESULT fetchAPIKeepAliveEnabled([out, retval] BOOL* enabled);
    227229    HRESULT setFetchAPIKeepAliveEnabled([in] BOOL enabled);
  • trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h

    r254669 r254790  
    210210
    211211#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled"
     212#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey "WebKitCSSOMViewSmoothScrollingEnabled"
    212213
    213214#define WebKitResizeObserverEnabledPreferenceKey "WebKitResizeObserverEnabled"
  • trunk/Source/WebKitLegacy/win/WebPreferences.cpp

    r254669 r254790  
    340340    CFDictionaryAddValue(defaults, CFSTR(WebKitResizeObserverEnabledPreferenceKey), kCFBooleanFalse);
    341341
     342    CFDictionaryAddValue(defaults, CFSTR(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey), kCFBooleanFalse);
     343
    342344    CFDictionaryAddValue(defaults, CFSTR(WebKitCoreMathMLEnabledPreferenceKey), kCFBooleanFalse);
    343345
     
    22862288}
    22872289
     2290HRESULT WebPreferences::CSSOMViewSmoothScrollingEnabled(_Out_ BOOL* enabled)
     2291{
     2292    if (!enabled)
     2293        return E_POINTER;
     2294    *enabled = boolValueForKey(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey);
     2295    return S_OK;
     2296}
     2297
     2298HRESULT WebPreferences::setCSSOMViewSmoothScrollingEnabled(BOOL enabled)
     2299{
     2300    setBoolValue(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey, enabled);
     2301    return S_OK;
     2302}
     2303
    22882304HRESULT WebPreferences::requestIdleCallbackEnabled(_Out_ BOOL* enabled)
    22892305{
  • trunk/Source/WebKitLegacy/win/WebPreferences.h

    r254669 r254790  
    272272    virtual HRESULT STDMETHODCALLTYPE CSSOMViewScrollingAPIEnabled(_Out_ BOOL*);
    273273    virtual HRESULT STDMETHODCALLTYPE setCSSOMViewScrollingAPIEnabled(BOOL);
     274    virtual HRESULT STDMETHODCALLTYPE CSSOMViewSmoothScrollingEnabled(_Out_ BOOL*);
     275    virtual HRESULT STDMETHODCALLTYPE setCSSOMViewSmoothScrollingEnabled(BOOL);
    274276    virtual HRESULT STDMETHODCALLTYPE fetchAPIKeepAliveEnabled(_Out_ BOOL*);
    275277    virtual HRESULT STDMETHODCALLTYPE setFetchAPIKeepAliveEnabled(BOOL);
  • trunk/Source/WebKitLegacy/win/WebView.cpp

    r254669 r254790  
    53215321    settings.setCSSOMViewScrollingAPIEnabled(!!enabled);
    53225322
     5323    hr = prefsPrivate->CSSOMViewSmoothScrollingEnabled(&enabled);
     5324    if (FAILED(hr))
     5325        return hr;
     5326    settings.setCSSOMViewSmoothScrollingEnabled(!!enabled);
     5327
    53235328    hr = preferences->privateBrowsingEnabled(&enabled);
    53245329    if (FAILED(hr))
  • trunk/Tools/ChangeLog

    r254786 r254790  
     12020-01-17  Cathie Chen  <cathiechen@igalia.com>
     2
     3        Add support for scroll behavior parsing
     4        https://bugs.webkit.org/show_bug.cgi?id=205009
     5
     6        Reviewed by Frédéric Wang.
     7
     8        Based on the patch by Frédéric Wang.
     9
     10        * DumpRenderTree/TestOptions.cpp:
     11        (TestOptions::TestOptions): Parse CSSOMViewSmoothScrollingEnabled.
     12        * DumpRenderTree/TestOptions.h: Add CSSOMViewSmoothScrollingEnabled, disabled by default.
     13        * DumpRenderTree/mac/DumpRenderTree.mm:
     14        (enableExperimentalFeatures):
     15        (setWebPreferencesForTestOptions): Set CSSOMViewSmoothScrollingEnabled from the test options.
     16
    1172020-01-16  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Tools/DumpRenderTree/TestOptions.cpp

    r254669 r254790  
    143143        else if (key == "experimental:ResizeObserverEnabled")
    144144            enableResizeObserver = parseBooleanTestHeaderValue(value);
     145        else if (key == "experimental:CSSOMViewSmoothScrollingEnabled")
     146            enableCSSOMViewSmoothScrolling = parseBooleanTestHeaderValue(value);
    145147        else if (key == "experimental:CoreMathMLEnabled")
    146148            enableCoreMathML = parseBooleanTestHeaderValue(value);
  • trunk/Tools/DumpRenderTree/TestOptions.h

    r254669 r254790  
    5151    bool adClickAttributionEnabled { false };
    5252    bool enableResizeObserver { false };
     53    bool enableCSSOMViewSmoothScrolling { false };
    5354    bool enableCoreMathML { false };
    5455    bool enableRequestIdleCallback { false };
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r254669 r254790  
    885885    [preferences setCSSShadowPartsEnabled:YES];
    886886    [preferences setAspectRatioOfImgFromWidthAndHeightEnabled:YES];
     887    [preferences setCSSOMViewSmoothScrollingEnabled:YES];
    887888}
    888889
     
    10321033    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
    10331034    preferences.resizeObserverEnabled = options.enableResizeObserver;
     1035    preferences.CSSOMViewSmoothScrollingEnabled = options.enableCSSOMViewSmoothScrolling;
    10341036    preferences.coreMathMLEnabled = options.enableCoreMathML;
    10351037    preferences.requestIdleCallbackEnabled = options.enableRequestIdleCallback;
Note: See TracChangeset for help on using the changeset viewer.