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.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog
index 34dfc43..dfec486 100644
--- a/LayoutTests/imported/w3c/ChangeLog
+++ b/LayoutTests/imported/w3c/ChangeLog
@@ -1,3 +1,19 @@
+2020-01-17 Cathie Chen <cathiechen@igalia.com>
+
+ 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.
+
+ * 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:
+
2020-01-16 Rob Buis <rbuis@igalia.com>
Fetch: URL parser not always using UTF-8
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance-expected.txt
index 3ac0a37..875a727 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance-expected.txt
@@ -1,4 +1,4 @@
-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
-FAIL Property scroll-behavior does not inherit assert_true: expected true got false
+PASS Property scroll-behavior has initial value auto
+PASS Property scroll-behavior does not inherit
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html
index 8c381e7..37485b1 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
<html>
<head>
<meta charset="utf-8">
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt
index a225224..2f5c8c1 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt
@@ -1,4 +1,4 @@
-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
-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
+PASS Property scroll-behavior value 'auto' computes to 'auto'
+PASS Property scroll-behavior value 'smooth' computes to 'smooth'
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html
index ffea289..4d18d32 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
<html>
<head>
<meta charset="utf-8">
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt
index 80fdd2c..ef84934 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt
@@ -1,4 +1,4 @@
-FAIL e.style['scroll-behavior'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['scroll-behavior'] = "smooth" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['scroll-behavior'] = "auto" should set the property value
+PASS e.style['scroll-behavior'] = "smooth" should set the property value
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html
index 6e708b9..c08593b 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
<html>
<head>
<meta charset="utf-8">
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index bdf5031..861283d 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -972,8 +972,10 @@
page/ResizeObserverCallback.idl
page/ResizeObserverEntry.idl
page/Screen.idl
+ page/ScrollBehavior.idl
page/ScrollIntoViewOptions.idl
page/ScrollLogicalPosition.idl
+ page/ScrollOptions.idl
page/ScrollToOptions.idl
page/ShareData.idl
page/UndoItem.idl
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 01bfb1f..645a714 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,62 @@
+2020-01-17 Cathie Chen <cathiechen@igalia.com>
+
+ 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.
+
+ 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):
+
2020-01-17 Ryosuke Niwa <rniwa@webkit.org>
iOS: Prepare deploying Ref/RefPtr in touch event code
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index 2a55fbf..21fb1ad 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -919,8 +919,10 @@
$(WebCore)/page/ResizeObserverCallback.idl \
$(WebCore)/page/ResizeObserverEntry.idl \
$(WebCore)/page/Screen.idl \
+ $(WebCore)/page/ScrollBehavior.idl \
$(WebCore)/page/ScrollIntoViewOptions.idl \
$(WebCore)/page/ScrollLogicalPosition.idl \
+ $(WebCore)/page/ScrollOptions.idl \
$(WebCore)/page/ScrollToOptions.idl \
$(WebCore)/page/ShareData.idl \
$(WebCore)/page/UndoItem.idl \
diff --git a/Source/WebCore/Headers.cmake b/Source/WebCore/Headers.cmake
index 7440903..bb87806 100644
--- a/Source/WebCore/Headers.cmake
+++ b/Source/WebCore/Headers.cmake
@@ -835,8 +835,10 @@
page/RemoteFrame.h
page/RenderingUpdateScheduler.h
page/RuntimeEnabledFeatures.h
+ page/ScrollBehavior.h
page/ScrollIntoViewOptions.h
page/ScrollLogicalPosition.h
+ page/ScrollOptions.h
page/ScrollToOptions.h
page/SecurityOrigin.h
page/SecurityOriginData.h
diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt
index 5400dc9..7abc47c 100644
--- a/Source/WebCore/Sources.txt
+++ b/Source/WebCore/Sources.txt
@@ -1655,6 +1655,7 @@
page/ResourceUsageThread.cpp
page/RuntimeEnabledFeatures.cpp
page/Screen.cpp
+page/ScrollBehavior.cpp
page/SecurityOrigin.cpp
page/SecurityOriginData.cpp
page/SecurityPolicy.cpp
@@ -3396,8 +3397,10 @@
JSSVGZoomEvent.cpp
JSScreen.cpp
JSScriptProcessorNode.cpp
+JSScrollBehavior.cpp
JSScrollIntoViewOptions.cpp
JSScrollLogicalPosition.cpp
+JSScrollOptions.cpp
JSScrollToOptions.cpp
JSSecurityPolicyViolationEvent.cpp
JSServiceWorker.cpp
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index 6507b9a..d891a2f 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -2412,6 +2412,8 @@
83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; };
834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; };
+ 834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */; };
+ 834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */; };
834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2466,6 +2468,8 @@
83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C45B8D1DC2B67C008871BA /* ValidationBubble.h */; settings = {ATTRIBUTES = (Private, ); }; };
83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356424 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356435 /* ScrollOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; };
83D35AF21C718D9000F70D5A /* JSXMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */; };
@@ -10212,9 +10216,14 @@
834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
+ 8350C3E71DA59B6200356424 /* ScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.h; sourceTree = "<group>"; };
+ 8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.cpp; sourceTree = "<group>"; };
+ 8350C3E71DA59B6200356435 /* ScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollOptions.h; sourceTree = "<group>"; };
8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
+ 8350C3E81DA59B6200356424 /* ScrollBehavior.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollBehavior.idl; sourceTree = "<group>"; };
+ 8350C3E81DA59B6200356435 /* ScrollOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollOptions.idl; sourceTree = "<group>"; };
8350C3E81DA59B6200356446 /* ScrollToOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollToOptions.idl; sourceTree = "<group>"; };
83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; };
835657C61ECAB0E800CDE72D /* JSDOMMatrixInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMMatrixInit.cpp; sourceTree = "<group>"; };
@@ -10336,9 +10345,13 @@
83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; };
83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
+ 83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollBehavior.cpp; sourceTree = "<group>"; };
+ 83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollOptions.cpp; sourceTree = "<group>"; };
83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
+ 83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollBehavior.h; sourceTree = "<group>"; };
+ 83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollOptions.h; sourceTree = "<group>"; };
83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollToOptions.h; sourceTree = "<group>"; };
83EE598B1F50958B003E8B30 /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; };
83EE598C1F50958B003E8B30 /* JSErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorCallback.cpp; sourceTree = "<group>"; };
@@ -20838,10 +20851,15 @@
BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */,
BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
+ 8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */,
+ 8350C3E71DA59B6200356424 /* ScrollBehavior.h */,
+ 8350C3E81DA59B6200356424 /* ScrollBehavior.idl */,
8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */,
8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */,
8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */,
8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */,
+ 8350C3E71DA59B6200356435 /* ScrollOptions.h */,
+ 8350C3E81DA59B6200356435 /* ScrollOptions.idl */,
8350C3E71DA59B6200356446 /* ScrollToOptions.h */,
8350C3E81DA59B6200356446 /* ScrollToOptions.idl */,
BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */,
@@ -25635,10 +25653,14 @@
58B2FA022232D60A00938D63 /* JSResizeObserverEntry.h */,
BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
+ 83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */,
+ 83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */,
83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */,
83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */,
83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */,
83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */,
+ 83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */,
+ 83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */,
83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */,
83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */,
7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */,
@@ -31003,8 +31025,10 @@
5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */,
BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
+ 834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */,
834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */,
834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */,
+ 834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */,
834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
@@ -32216,6 +32240,7 @@
44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
+ 83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */,
1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
@@ -32252,6 +32277,7 @@
83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */,
7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */,
+ 83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */,
F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index a0ec06f..3957975 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -3374,6 +3374,10 @@
return cssValuePool.createIdentifierValue(CSSValueAuto);
return cssValuePool.createIdentifierValue(CSSValueTouch);
#endif
+ case CSSPropertyScrollBehavior:
+ if (!style.useSmoothScrolling())
+ return cssValuePool.createIdentifierValue(CSSValueAuto);
+ return cssValuePool.createIdentifierValue(CSSValueSmooth);
case CSSPropertyPerspective:
if (!style.hasPerspective())
return cssValuePool.createIdentifierValue(CSSValueNone);
diff --git a/Source/WebCore/css/CSSProperties.json b/Source/WebCore/css/CSSProperties.json
index 52f20e2..6e314c4 100644
--- a/Source/WebCore/css/CSSProperties.json
+++ b/Source/WebCore/css/CSSProperties.json
@@ -3554,6 +3554,16 @@
"url": "https://www.w3.org/TR/SVG/shapes.html"
}
},
+ "scroll-behavior": {
+ "values": [
+ "auto",
+ "smooth"
+ ],
+ "specification": {
+ "category": "cssom-view",
+ "url": "https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior"
+ }
+ },
"shape-rendering": {
"inherited": true,
"values": [
@@ -6481,6 +6491,22 @@
"url": "https://www.w3.org/TR/css-ui-4/#propdef-user-select"
}
},
+ "scroll-behavior": {
+ "values": [
+ "auto",
+ "smooth"
+ ],
+ "codegen-properties": {
+ "converter": "SmoothScrolling",
+ "name-for-methods": "UseSmoothScrolling"
+ },
+ "status": {
+ "status": "experimental"
+ },
+ "specification": {
+ "url": "https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior"
+ }
+ },
"scroll-padding": {
"codegen-properties": {
"enable-if": "ENABLE_CSS_SCROLL_SNAP",
diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in
index bc921ae..281435e 100644
--- a/Source/WebCore/css/CSSValueKeywords.in
+++ b/Source/WebCore/css/CSSValueKeywords.in
@@ -1388,6 +1388,10 @@
pinch-zoom
#endif
+// scroll-behavior
+// auto
+smooth
+
// hanging-punctuation
allow-end
first
diff --git a/Source/WebCore/css/parser/CSSParserContext.cpp b/Source/WebCore/css/parser/CSSParserContext.cpp
index 7537188..71f9aa6 100644
--- a/Source/WebCore/css/parser/CSSParserContext.cpp
+++ b/Source/WebCore/css/parser/CSSParserContext.cpp
@@ -75,6 +75,7 @@
attachmentEnabled = RuntimeEnabledFeatures::sharedFeatures().attachmentElementEnabled();
#endif
deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
+ scrollBehaviorEnabled = document.settings().CSSOMViewSmoothScrollingEnabled();
useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
}
@@ -99,6 +100,7 @@
&& a.attachmentEnabled == b.attachmentEnabled
#endif
&& a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
+ && a.scrollBehaviorEnabled == b.scrollBehaviorEnabled
&& a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin
&& a.useSystemAppearance == b.useSystemAppearance;
}
diff --git a/Source/WebCore/css/parser/CSSParserContext.h b/Source/WebCore/css/parser/CSSParserContext.h
index 86525fd..c74dc94 100644
--- a/Source/WebCore/css/parser/CSSParserContext.h
+++ b/Source/WebCore/css/parser/CSSParserContext.h
@@ -65,6 +65,7 @@
bool attachmentEnabled { false };
#endif
bool deferredCSSParserEnabled { false };
+ bool scrollBehaviorEnabled { false };
// This is only needed to support getMatchedCSSRules.
bool hasDocumentSecurityOrigin { false };
@@ -116,7 +117,8 @@
#if ENABLE(ATTACHMENT_ELEMENT)
& key.attachmentEnabled << 11
#endif
- & key.mode << 12; // Keep this last.
+ & key.scrollBehaviorEnabled << 12
+ & key.mode << 13; // Keep this last.
hash ^= WTF::intHash(bits);
return hash;
}
diff --git a/Source/WebCore/css/parser/CSSParserFastPaths.cpp b/Source/WebCore/css/parser/CSSParserFastPaths.cpp
index 6bea42f..0a934d4 100644
--- a/Source/WebCore/css/parser/CSSParserFastPaths.cpp
+++ b/Source/WebCore/css/parser/CSSParserFastPaths.cpp
@@ -638,10 +638,6 @@
|| valueID == CSSValueSticky || valueID == CSSValueWebkitSticky;
case CSSPropertyResize: // none | both | horizontal | vertical | auto
return valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto;
- // FIXME-NEWPARSER: Investigate this property.
- // case CSSPropertyScrollBehavior: // auto | smooth
- // ASSERT(RuntimeEnabledFeatures::cssomSmoothScrollEnabled());
- // return valueID == CSSValueAuto || valueID == CSSValueSmooth;
case CSSPropertyShapeRendering:
return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricPrecision;
case CSSPropertyStrokeLinejoin:
@@ -942,7 +938,6 @@
// case CSSPropertyFontKerning:
// case CSSPropertyHyphens:
// case CSSPropertyOverflowAnchor:
- // case CSSPropertyScrollBehavior:
// case CSSPropertyScrollSnapType:
// case CSSPropertyTextAlignLast:
// case CSSPropertyTextCombineUpright:
diff --git a/Source/WebCore/css/parser/CSSPropertyParser.cpp b/Source/WebCore/css/parser/CSSPropertyParser.cpp
index b83cc57..a0634ba 100644
--- a/Source/WebCore/css/parser/CSSPropertyParser.cpp
+++ b/Source/WebCore/css/parser/CSSPropertyParser.cpp
@@ -2327,6 +2327,14 @@
#endif
+static RefPtr<CSSPrimitiveValue> consumeScrollBehavior(CSSParserTokenRange& range)
+{
+ auto valueID = range.peek().id();
+ if (valueID != CSSValueAuto && valueID != CSSValueSmooth)
+ return nullptr;
+ return consumeIdent(range);
+}
+
static RefPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode)
{
RefPtr<CSSPrimitiveValue> parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
@@ -3909,6 +3917,10 @@
case CSSPropertyScrollSnapType:
return consumeScrollSnapType(m_range);
#endif
+ case CSSPropertyScrollBehavior:
+ if (!m_context.scrollBehaviorEnabled)
+ return nullptr;
+ return consumeScrollBehavior(m_range);
case CSSPropertyClip:
return consumeClip(m_range, m_context.mode);
#if ENABLE(POINTER_EVENTS)
diff --git a/Source/WebCore/page/ScrollBehavior.cpp b/Source/WebCore/page/ScrollBehavior.cpp
new file mode 100644
index 0000000..4ed29cb
--- /dev/null
+++ b/Source/WebCore/page/ScrollBehavior.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2019 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollBehavior.h"
+
+#include "Element.h"
+#include "RenderElement.h"
+#include "RenderStyle.h"
+#include "Settings.h"
+
+namespace WebCore {
+
+bool useSmoothScrolling(ScrollBehavior behavior, Element& associatedElement)
+{
+ if (!associatedElement.document().settings().CSSOMViewSmoothScrollingEnabled() || !associatedElement.renderer())
+ return false;
+
+ // https://drafts.csswg.org/cssom-view/#scrolling
+ switch (behavior) {
+ case ScrollBehavior::Auto:
+ return associatedElement.renderer()->style().useSmoothScrolling();
+ case ScrollBehavior::Instant:
+ return false;
+ case ScrollBehavior::Smooth:
+ return true;
+ }
+ ASSERT_NOT_REACHED();
+ return false;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/page/ScrollBehavior.h b/Source/WebCore/page/ScrollBehavior.h
new file mode 100644
index 0000000..1baef88
--- /dev/null
+++ b/Source/WebCore/page/ScrollBehavior.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2019 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+class Element;
+
+enum class ScrollBehavior : uint8_t {
+ Auto = 0,
+ Instant,
+ Smooth
+};
+
+bool useSmoothScrolling(ScrollBehavior, Element& associatedElement);
+
+} // namespace WebCore
diff --git a/Source/WebCore/page/ScrollBehavior.idl b/Source/WebCore/page/ScrollBehavior.idl
new file mode 100644
index 0000000..8971ae9
--- /dev/null
+++ b/Source/WebCore/page/ScrollBehavior.idl
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2019 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+enum ScrollBehavior { "auto", "instant", "smooth" };
diff --git a/Source/WebCore/page/ScrollIntoViewOptions.h b/Source/WebCore/page/ScrollIntoViewOptions.h
index 939cd73..f275f2f 100644
--- a/Source/WebCore/page/ScrollIntoViewOptions.h
+++ b/Source/WebCore/page/ScrollIntoViewOptions.h
@@ -20,12 +20,11 @@
#pragma once
#include "ScrollLogicalPosition.h"
+#include "ScrollOptions.h"
namespace WebCore {
-class Element;
-
-struct ScrollIntoViewOptions {
+struct ScrollIntoViewOptions : ScrollOptions {
Optional<ScrollLogicalPosition> blockPosition { ScrollLogicalPosition::Start };
Optional<ScrollLogicalPosition> inlinePosition { ScrollLogicalPosition::Nearest };
};
diff --git a/Source/WebCore/page/ScrollIntoViewOptions.idl b/Source/WebCore/page/ScrollIntoViewOptions.idl
index cf9d1fd..1b24c68 100644
--- a/Source/WebCore/page/ScrollIntoViewOptions.idl
+++ b/Source/WebCore/page/ScrollIntoViewOptions.idl
@@ -17,8 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
-// FIXME(webkit.org/b/188043): Support ScrollBehavior.
-dictionary ScrollIntoViewOptions {
+dictionary ScrollIntoViewOptions : ScrollOptions {
[ImplementedAs=blockPosition] ScrollLogicalPosition block = "start";
[ImplementedAs=inlinePosition] ScrollLogicalPosition inline = "nearest";
};
diff --git a/Source/WebCore/page/ScrollOptions.h b/Source/WebCore/page/ScrollOptions.h
new file mode 100644
index 0000000..e1867c6
--- /dev/null
+++ b/Source/WebCore/page/ScrollOptions.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2019 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ScrollBehavior.h"
+
+namespace WebCore {
+
+struct ScrollOptions {
+ Optional<ScrollBehavior> behavior { ScrollBehavior::Auto };
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/page/ScrollOptions.idl b/Source/WebCore/page/ScrollOptions.idl
new file mode 100644
index 0000000..329d6ff
--- /dev/null
+++ b/Source/WebCore/page/ScrollOptions.idl
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2019 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary ScrollOptions {
+ ScrollBehavior behavior = "auto";
+};
diff --git a/Source/WebCore/page/ScrollToOptions.h b/Source/WebCore/page/ScrollToOptions.h
index ce1cba1..f5774d4 100644
--- a/Source/WebCore/page/ScrollToOptions.h
+++ b/Source/WebCore/page/ScrollToOptions.h
@@ -28,14 +28,21 @@
#pragma once
+#include "ScrollOptions.h"
#include <cmath>
#include <wtf/Optional.h>
namespace WebCore {
-struct ScrollToOptions {
+struct ScrollToOptions : ScrollOptions {
Optional<double> left;
Optional<double> top;
+
+ ScrollToOptions() = default;
+ ScrollToOptions(double x, double y)
+ : left(x)
+ , top(y)
+ { }
};
inline double normalizeNonFiniteValueOrFallBackTo(Optional<double> value, double fallbackValue)
@@ -47,7 +54,7 @@
// FIXME(https://webkit.org/b/88339): Consider using FloatPoint or DoublePoint for fallback and return values.
inline ScrollToOptions normalizeNonFiniteCoordinatesOrFallBackTo(const ScrollToOptions& value, double x, double y)
{
- ScrollToOptions options;
+ ScrollToOptions options = value;
options.left = normalizeNonFiniteValueOrFallBackTo(value.left, x);
options.top = normalizeNonFiniteValueOrFallBackTo(value.top, y);
return options;
diff --git a/Source/WebCore/page/ScrollToOptions.idl b/Source/WebCore/page/ScrollToOptions.idl
index 510bc07..2b9b554 100644
--- a/Source/WebCore/page/ScrollToOptions.idl
+++ b/Source/WebCore/page/ScrollToOptions.idl
@@ -26,8 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// FIXME(webkit.org/b/188043): Support ScrollBehavior.
-dictionary ScrollToOptions {
+dictionary ScrollToOptions : ScrollOptions {
unrestricted double left;
unrestricted double top;
};
diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml
index e6d5605..887559c 100644
--- a/Source/WebCore/page/Settings.yaml
+++ b/Source/WebCore/page/Settings.yaml
@@ -621,6 +621,9 @@
CSSOMViewScrollingAPIEnabled:
initial: false
+CSSOMViewSmoothScrollingEnabled:
+ initial: false
+
inputEventsEnabled:
initial: true
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index 0af602a..31d294c 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -736,6 +736,8 @@
bool useTouchOverflowScrolling() const { return m_rareInheritedData->useTouchOverflowScrolling; }
#endif
+ bool useSmoothScrolling() const { return m_rareNonInheritedData->useSmoothScrolling; }
+
#if ENABLE(TEXT_AUTOSIZING)
TextSizeAdjustment textSizeAdjust() const { return m_rareInheritedData->textSizeAdjust; }
AutosizeStatus autosizeStatus() const;
@@ -1264,6 +1266,8 @@
void setUseTouchOverflowScrolling(bool v) { SET_VAR(m_rareInheritedData, useTouchOverflowScrolling, v); }
#endif
+ void setUseSmoothScrolling(bool v) { SET_VAR(m_rareNonInheritedData, useSmoothScrolling, v); }
+
#if ENABLE(TEXT_AUTOSIZING)
void setTextSizeAdjust(TextSizeAdjustment adjustment) { SET_VAR(m_rareInheritedData, textSizeAdjust, adjustment); }
void setAutosizeStatus(AutosizeStatus);
@@ -1701,6 +1705,8 @@
static bool initialUseTouchOverflowScrolling() { return false; }
#endif
+ static bool initialUseSmoothScrolling() { return false; }
+
static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
index 7a43d6c..6903581 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
@@ -89,6 +89,7 @@
, backfaceVisibility(static_cast<unsigned>(RenderStyle::initialBackfaceVisibility()))
, userDrag(static_cast<unsigned>(RenderStyle::initialUserDrag()))
, textOverflow(static_cast<unsigned>(RenderStyle::initialTextOverflow()))
+ , useSmoothScrolling(static_cast<unsigned>(RenderStyle::initialUseSmoothScrolling()))
, marginBeforeCollapse(static_cast<unsigned>(MarginCollapse::Collapse))
, marginAfterCollapse(static_cast<unsigned>(MarginCollapse::Collapse))
, appearance(static_cast<unsigned>(RenderStyle::initialAppearance()))
@@ -182,6 +183,7 @@
, backfaceVisibility(o.backfaceVisibility)
, userDrag(o.userDrag)
, textOverflow(o.textOverflow)
+ , useSmoothScrolling(o.useSmoothScrolling)
, marginBeforeCollapse(o.marginBeforeCollapse)
, marginAfterCollapse(o.marginAfterCollapse)
, appearance(o.appearance)
@@ -280,6 +282,7 @@
&& backfaceVisibility == o.backfaceVisibility
&& userDrag == o.userDrag
&& textOverflow == o.textOverflow
+ && useSmoothScrolling == o.useSmoothScrolling
&& marginBeforeCollapse == o.marginBeforeCollapse
&& marginAfterCollapse == o.marginAfterCollapse
&& appearance == o.appearance
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
index bea6bc1..bcc4e15 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
@@ -183,6 +183,7 @@
unsigned userDrag : 2; // UserDrag
unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
+ unsigned useSmoothScrolling : 1; // ScrollBehavior
unsigned marginBeforeCollapse : 2; // MarginCollapse
unsigned marginAfterCollapse : 2; // MarginCollapse
unsigned appearance : 6; // EAppearance
diff --git a/Source/WebCore/style/StyleBuilderConverter.h b/Source/WebCore/style/StyleBuilderConverter.h
index 20888a7..75a1b23 100644
--- a/Source/WebCore/style/StyleBuilderConverter.h
+++ b/Source/WebCore/style/StyleBuilderConverter.h
@@ -130,6 +130,7 @@
static bool convertOverflowScrolling(BuilderState&, const CSSValue&);
#endif
static FontFeatureSettings convertFontFeatureSettings(BuilderState&, const CSSValue&);
+ static bool convertSmoothScrolling(BuilderState&, const CSSValue&);
static FontSelectionValue convertFontWeightFromValue(const CSSValue&);
static FontSelectionValue convertFontStretchFromValue(const CSSValue&);
static Optional<FontSelectionValue> convertFontStyleFromValue(const CSSValue&);
@@ -1375,6 +1376,11 @@
}
#endif
+inline bool BuilderConverter::convertSmoothScrolling(BuilderState&, const CSSValue& value)
+{
+ return downcast<CSSPrimitiveValue>(value).valueID() == CSSValueSmooth;
+}
+
inline SVGLengthValue BuilderConverter::convertSVGLengthValue(BuilderState&, const CSSValue& value)
{
return SVGLengthValue::fromCSSPrimitiveValue(downcast<CSSPrimitiveValue>(value));
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 31e1b90..3ed8c29 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,16 @@
+2020-01-17 Cathie Chen <cathiechen@igalia.com>
+
+ 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.
+
+ Add CSSOM smooth scrolling as an experimental feature.
+
+ * Shared/WebPreferences.yaml:
+
2020-01-17 Peng Liu <peng.liu6@apple.com>
Fix a build failure related to the feature flag (GPU_PROCESS)
diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml
index c409215..d8c139c 100644
--- a/Source/WebKit/Shared/WebPreferences.yaml
+++ b/Source/WebKit/Shared/WebPreferences.yaml
@@ -1319,6 +1319,13 @@
humanReadableDescription: "Stop plugins smaller than a certain threshold from loading."
category: internal
+CSSOMViewSmoothScrollingEnabled:
+ type: bool
+ defaultValue: false
+ humanReadableName: "CSSOM View Smooth Scrolling"
+ humanReadableDescription: "Enable DOM API and CSS property for 'smooth' scroll behavior"
+ category: experimental
+
WebAnimationsEnabled:
type: bool
defaultValue: true
diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog
index c6ad45e..a16dfbd 100644
--- a/Source/WebKitLegacy/mac/ChangeLog
+++ b/Source/WebKitLegacy/mac/ChangeLog
@@ -1,3 +1,23 @@
+2020-01-17 Cathie Chen <cathiechen@igalia.com>
+
+ 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.
+
+ 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:]):
+
2020-01-16 David Kilzer <ddkilzer@apple.com>
Enable -Wconditional-uninitialized in WebInspectorUI, WebKitLegacy, WebKit projects
diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
index 8567e39..b9b0c8f 100644
--- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
@@ -188,6 +188,7 @@
#define WebKitDirectoryUploadEnabledPreferenceKey @"WebKitDirectoryUploadEnabled"
#define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled"
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey @"WebKitCSSOMViewScrollingAPIEnabled"
+#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey @"WebKitCSSOMViewSmoothScrollingEnabled"
#define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
#define WebKitRemotePlaybackEnabledPreferenceKey @"WebKitRemotePlaybackEnabled"
#define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
index 2739f87..4ab7f08 100644
--- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
+++ b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
@@ -664,6 +664,7 @@
#endif
@YES, WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
+ @NO, WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey,
@YES, WebKitNeedsStorageAccessFromFileURLsQuirkKey,
@NO, WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
#if ENABLE(MEDIA_STREAM)
@@ -3183,6 +3184,16 @@
[self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
}
+- (BOOL)CSSOMViewSmoothScrollingEnabled
+{
+ return [self _boolValueForKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
+}
+
+- (void)setCSSOMViewSmoothScrollingEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
+}
+
- (BOOL)webAnimationsEnabled
{
return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
index e187f21..68a6c456 100644
--- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
+++ b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
@@ -638,6 +638,7 @@
@property (nonatomic) BOOL visualViewportAPIEnabled;
@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
+@property (nonatomic) BOOL CSSOMViewSmoothScrollingEnabled;
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;
@property (nonatomic) BOOL javaScriptMarkupEnabled;
diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm
index 82604d62..9870540 100644
--- a/Source/WebKitLegacy/mac/WebView/WebView.mm
+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm
@@ -3005,6 +3005,7 @@
settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]);
settings.setSyntheticEditingCommandsEnabled([preferences syntheticEditingCommandsEnabled]);
settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
+ settings.setCSSOMViewSmoothScrollingEnabled([preferences CSSOMViewSmoothScrollingEnabled]);
settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
switch ([preferences storageBlockingPolicy]) {
diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog
index 48ec1db..a99b6a2 100644
--- a/Source/WebKitLegacy/win/ChangeLog
+++ b/Source/WebKitLegacy/win/ChangeLog
@@ -1,3 +1,22 @@
+2020-01-17 Cathie Chen <cathiechen@igalia.com>
+
+ 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.
+
+ * 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):
+
2020-01-16 Cathie Chen <cathiechen@igalia.com>
Mapping HTML attributes width/height to the default aspect ratio of <img>
diff --git a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl
index cd2f977..f9250c4 100644
--- a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl
+++ b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl
@@ -223,6 +223,8 @@
HRESULT setVisualViewportAPIEnabled([in] BOOL enabled);
HRESULT CSSOMViewScrollingAPIEnabled([out, retval] BOOL*);
HRESULT setCSSOMViewScrollingAPIEnabled([in] BOOL enabled);
+ HRESULT CSSOMViewSmoothScrollingEnabled([out, retval] BOOL*);
+ HRESULT setCSSOMViewSmoothScrollingEnabled([in] BOOL enabled);
HRESULT fetchAPIKeepAliveEnabled([out, retval] BOOL* enabled);
HRESULT setFetchAPIKeepAliveEnabled([in] BOOL enabled);
HRESULT spatialNavigationEnabled([out, retval] BOOL *enabled);
diff --git a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h
index fd71855..e0995bb 100644
--- a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h
+++ b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h
@@ -209,6 +209,7 @@
#define WebKitServerTimingEnabledPreferenceKey "WebKitServerTimingEnabled"
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled"
+#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey "WebKitCSSOMViewSmoothScrollingEnabled"
#define WebKitResizeObserverEnabledPreferenceKey "WebKitResizeObserverEnabled"
diff --git a/Source/WebKitLegacy/win/WebPreferences.cpp b/Source/WebKitLegacy/win/WebPreferences.cpp
index 4459c33..c38b33e 100644
--- a/Source/WebKitLegacy/win/WebPreferences.cpp
+++ b/Source/WebKitLegacy/win/WebPreferences.cpp
@@ -339,6 +339,8 @@
CFDictionaryAddValue(defaults, CFSTR(WebKitResizeObserverEnabledPreferenceKey), kCFBooleanFalse);
+ CFDictionaryAddValue(defaults, CFSTR(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey), kCFBooleanFalse);
+
CFDictionaryAddValue(defaults, CFSTR(WebKitCoreMathMLEnabledPreferenceKey), kCFBooleanFalse);
CFDictionaryAddValue(defaults, CFSTR(WebKitRequestIdleCallbackEnabledPreferenceKey), kCFBooleanFalse);
@@ -2285,6 +2287,20 @@
return S_OK;
}
+HRESULT WebPreferences::CSSOMViewSmoothScrollingEnabled(_Out_ BOOL* enabled)
+{
+ if (!enabled)
+ return E_POINTER;
+ *enabled = boolValueForKey(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey);
+ return S_OK;
+}
+
+HRESULT WebPreferences::setCSSOMViewSmoothScrollingEnabled(BOOL enabled)
+{
+ setBoolValue(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey, enabled);
+ return S_OK;
+}
+
HRESULT WebPreferences::requestIdleCallbackEnabled(_Out_ BOOL* enabled)
{
if (!enabled)
diff --git a/Source/WebKitLegacy/win/WebPreferences.h b/Source/WebKitLegacy/win/WebPreferences.h
index aa05cbb..5645cc5 100644
--- a/Source/WebKitLegacy/win/WebPreferences.h
+++ b/Source/WebKitLegacy/win/WebPreferences.h
@@ -271,6 +271,8 @@
virtual HRESULT STDMETHODCALLTYPE setVisualViewportAPIEnabled(BOOL);
virtual HRESULT STDMETHODCALLTYPE CSSOMViewScrollingAPIEnabled(_Out_ BOOL*);
virtual HRESULT STDMETHODCALLTYPE setCSSOMViewScrollingAPIEnabled(BOOL);
+ virtual HRESULT STDMETHODCALLTYPE CSSOMViewSmoothScrollingEnabled(_Out_ BOOL*);
+ virtual HRESULT STDMETHODCALLTYPE setCSSOMViewSmoothScrollingEnabled(BOOL);
virtual HRESULT STDMETHODCALLTYPE fetchAPIKeepAliveEnabled(_Out_ BOOL*);
virtual HRESULT STDMETHODCALLTYPE setFetchAPIKeepAliveEnabled(BOOL);
virtual HRESULT STDMETHODCALLTYPE spatialNavigationEnabled(_Out_ BOOL*);
diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp
index 8388e74..571bd5a 100644
--- a/Source/WebKitLegacy/win/WebView.cpp
+++ b/Source/WebKitLegacy/win/WebView.cpp
@@ -5320,6 +5320,11 @@
return hr;
settings.setCSSOMViewScrollingAPIEnabled(!!enabled);
+ hr = prefsPrivate->CSSOMViewSmoothScrollingEnabled(&enabled);
+ if (FAILED(hr))
+ return hr;
+ settings.setCSSOMViewSmoothScrollingEnabled(!!enabled);
+
hr = preferences->privateBrowsingEnabled(&enabled);
if (FAILED(hr))
return hr;
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index cb4a37a..7c1c7f6 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,19 @@
+2020-01-17 Cathie Chen <cathiechen@igalia.com>
+
+ 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.
+
+ * 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.
+
2020-01-16 Simon Fraser <simon.fraser@apple.com>
fast/forms/ios/zoom-after-input-tap-wide-input.html is timing out
diff --git a/Tools/DumpRenderTree/TestOptions.cpp b/Tools/DumpRenderTree/TestOptions.cpp
index 7e21474..47602ae 100644
--- a/Tools/DumpRenderTree/TestOptions.cpp
+++ b/Tools/DumpRenderTree/TestOptions.cpp
@@ -142,6 +142,8 @@
adClickAttributionEnabled = parseBooleanTestHeaderValue(value);
else if (key == "experimental:ResizeObserverEnabled")
enableResizeObserver = parseBooleanTestHeaderValue(value);
+ else if (key == "experimental:CSSOMViewSmoothScrollingEnabled")
+ enableCSSOMViewSmoothScrolling = parseBooleanTestHeaderValue(value);
else if (key == "experimental:CoreMathMLEnabled")
enableCoreMathML = parseBooleanTestHeaderValue(value);
else if (key == "experimental:RequestIdleCallbackEnabled")
diff --git a/Tools/DumpRenderTree/TestOptions.h b/Tools/DumpRenderTree/TestOptions.h
index 6c5c4b4..7465922 100644
--- a/Tools/DumpRenderTree/TestOptions.h
+++ b/Tools/DumpRenderTree/TestOptions.h
@@ -50,6 +50,7 @@
bool enableCSSLogical { false };
bool adClickAttributionEnabled { false };
bool enableResizeObserver { false };
+ bool enableCSSOMViewSmoothScrolling { false };
bool enableCoreMathML { false };
bool enableRequestIdleCallback { false };
bool enableAsyncClipboardAPI { false };
diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm
index 1101b5e..049f542 100644
--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -884,6 +884,7 @@
[preferences setLinkPreloadResponsiveImagesEnabled:YES];
[preferences setCSSShadowPartsEnabled:YES];
[preferences setAspectRatioOfImgFromWidthAndHeightEnabled:YES];
+ [preferences setCSSOMViewSmoothScrollingEnabled:YES];
}
// Called before each test.
@@ -1031,6 +1032,7 @@
preferences.CSSLogicalEnabled = options.enableCSSLogical;
preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
preferences.resizeObserverEnabled = options.enableResizeObserver;
+ preferences.CSSOMViewSmoothScrollingEnabled = options.enableCSSOMViewSmoothScrolling;
preferences.coreMathMLEnabled = options.enableCoreMathML;
preferences.requestIdleCallbackEnabled = options.enableRequestIdleCallback;
preferences.asyncClipboardAPIEnabled = options.enableAsyncClipboardAPI;