Implement parsing for CSS scroll snap points
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Aug 2014 00:19:40 +0000 (00:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Aug 2014 00:19:40 +0000 (00:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134301

Source/JavaScriptCore:

Patch by Wenson Hsieh <wenson_hsieh@apple.com> on 2014-08-06
Reviewed by Dean Jackson.

* Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP

Source/WebCore:

Provided support for parsing -webkit-scroll-snap-* properties, i.e.  type, points-x, points-y, destination, and coordinates.
The exact syntax of the scroll snap CSS properties follow the W3C spec at http://dev.w3.org/csswg/css-snappoints/

Patch by Wenson Hsieh <wenson_hsieh@apple.com> on 2014-08-06
Reviewed by Dean Jackson.

Tests: css3/scroll-snap/scroll-snap-property-parsing.html,
    css3/scroll-snap/scroll-snap-property-computed-style.html

* CMakeLists.txt: Added StyleScrollSnapPoints.h, StyleScrollSnapPoints.cpp
* Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP
* WebCore.vcxproj/WebCore.vcxproj: Added StyleScrollSnapPoints.h, StyleScrollSnapPoints.cpp
* WebCore.vcxproj/WebCore.vcxproj.filters: Added StyleScrollSnapPoints.h, StyleScrollSnapPoints.cpp
* WebCore.xcodeproj/project.pbxproj: Added StyleScrollSnapPoints.h, StyleScrollSnapPoints.cpp, LengthRepeat.h
* css/CSSCalculationValue.cpp: Support for LengthRepeat
(WebCore::hasDoubleValue):
* css/CSSComputedStyleDeclaration.cpp: Support for showing computed style for snap point properties.
(WebCore::scrollSnapDestination):
(WebCore::scrollSnapPoints):
(WebCore::scrollSnapCoordinates):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp: Support for parsing snap point properties.
(WebCore::isValidKeywordPropertyAndValue): handle snap point type
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue): Added support for parsing snap points.
(WebCore::CSSParser::parseNonElementSnapPoints): Helper for parsing snap points-x/y.
(WebCore::CSSParser::parseScrollSnapDestination): Helper for parsing snap point destinations.
(WebCore::CSSParser::parseScrollSnapCoordinate): Helper for parsing snap point coordinates.
* css/CSSParser.h: Support for parsing snap point properties.
* css/CSSParserValues.cpp:
(WebCore::CSSParserValue::createCSSValue):
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::CSSPrimitiveValue::init):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::getLengthRepeatValue):
(WebCore::CSSPrimitiveValue::formatNumberForcustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isLengthRepeat):
(WebCore::CSSPrimitiveValue::getLengthRepeatValue):
* css/CSSPrimitiveValueMappings.h: Added converters for snap point type properties.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ScrollSnapType):
* css/CSSPropertyNames.in: Added relevant snap point property names.
* css/CSSValueKeywords.in: Added "proximity", "mandatory" and "elements".
* css/LengthRepeat.h: Added to represent values of repeat(<length>)
(WebCore::LengthRepeat::create):
(WebCore::LengthRepeat::cloneForCSSOM):
(WebCore::LengthRepeat::interval):
(WebCore::LengthRepeat::setInterval):
(WebCore::LengthRepeat::equals):
(WebCore::LengthRepeat::cssText):
(WebCore::LengthRepeat::LengthRepeat):
* css/StyleResolver.cpp: Support for handling snap point properties
(WebCore::StyleResolver::applyProperty):Updated switch case to build snap-point-related style data
* rendering/style/RenderStyle.h: Added methods to access and modify snap point data
* rendering/style/RenderStyleConstants.h: Added scroll snap type flags.
* rendering/style/StyleAllInOne.cpp: Added StyleScrollSnapPoints.cpp
* rendering/style/StyleRareNonInheritedData.cpp: Added initiazing for m_scrollSnapPoints, updated equality check
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h: Added field for StyleScrollSnapPoints
* rendering/style/StyleScrollSnapPoints.cpp: Added. Wrapper for basic snap point data structures.
(WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints):
(WebCore::StyleScrollSnapPoints::copy):
(WebCore::StyleScrollSnapPoints::operator==):
* rendering/style/StyleScrollSnapPoints.h: Added.
(WebCore::StyleScrollSnapPoints::create):
(WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Creates a new Length representing the default repeat value of repeat(100%)
(WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Creates a new Length representing a default destination value (0px)
(WebCore::StyleScrollSnapPoints::operator!=):

Source/WebInspectorUI:

Patch by Wenson Hsieh <wenson_hsieh@apple.com> on 2014-08-06
Reviewed by Dean Jackson.

* UserInterface/Models/CSSKeywordCompletions.js: Added snap point property keywords, such as mandatory, proximity, elements, and repeat.

Source/WebKit/mac:

Patch by Wenson Hsieh <wenson_hsieh@apple.com> on 2014-08-06
Reviewed by Dean Jackson.

* Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP

Source/WebKit2:

Patch by Wenson Hsieh <wenson_hsieh@apple.com> on 2014-08-06
Reviewed by Dean Jackson.

* Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP

LayoutTests:

Patch by Wenson Hsieh <wenson_hsieh@apple.com> on 2014-08-06
Reviewed by Dean Jackson.

Tests that parsing -webkit-scroll-snap-* properties behaves as expected.

* css3/scroll-snap/scroll-snap-property-computed-style-expected.txt: Expected text output of below test.
* css3/scroll-snap/scroll-snap-property-computed-style.html: Tests that scroll snap properties are correctly displayed via getComputedStyle.
* css3/scroll-snap/scroll-snap-property-computed-style.js: Script for above test.
(testComputedScrollSnapRule):
* css3/scroll-snap/scroll-snap-property-parsing-expected.txt: Expected text output of below test.
* css3/scroll-snap/scroll-snap-property-parsing.html: Tests that scroll snap properties are correctly parsed.
* css3/scroll-snap/scroll-snap-property-parsing.js: Script for above test.
(testScrollSnapRule):

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

43 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style-expected.txt [new file with mode: 0644]
LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.html [new file with mode: 0644]
LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.js [new file with mode: 0644]
LayoutTests/css3/scroll-snap/scroll-snap-property-parsing-expected.txt [new file with mode: 0644]
LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.html [new file with mode: 0644]
LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.js [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSCalculationValue.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSParserValues.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/LengthRepeat.h [new file with mode: 0644]
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleAllInOne.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h
Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp [new file with mode: 0644]
Source/WebCore/rendering/style/StyleScrollSnapPoints.h [new file with mode: 0644]
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig

index ce97c50..f6b4642 100644 (file)
@@ -1,3 +1,21 @@
+2014-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Implement parsing for CSS scroll snap points
+        https://bugs.webkit.org/show_bug.cgi?id=134301
+
+        Reviewed by Dean Jackson.
+
+        Tests that parsing -webkit-scroll-snap-* properties behaves as expected.
+
+        * css3/scroll-snap/scroll-snap-property-computed-style-expected.txt: Expected text output of below test.
+        * css3/scroll-snap/scroll-snap-property-computed-style.html: Tests that scroll snap properties are correctly displayed via getComputedStyle.
+        * css3/scroll-snap/scroll-snap-property-computed-style.js: Script for above test.
+        (testComputedScrollSnapRule):
+        * css3/scroll-snap/scroll-snap-property-parsing-expected.txt: Expected text output of below test.
+        * css3/scroll-snap/scroll-snap-property-parsing.html: Tests that scroll snap properties are correctly parsed.
+        * css3/scroll-snap/scroll-snap-property-parsing.js: Script for above test.
+        (testScrollSnapRule):
+
 2014-08-06  Simon Fraser  <simon.fraser@apple.com>
 
         REGRESSION (r168119): Album flipping animation doesn’t work
diff --git a/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style-expected.txt b/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style-expected.txt
new file mode 100644 (file)
index 0000000..630ffff
--- /dev/null
@@ -0,0 +1,147 @@
+Test the computed style of the -webkit-scroll-snap-* properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+invalid snapping type : potato
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-type') is 'none'
+
+invalid points along x axis : hello world
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(100%)'
+
+invalid points along y axis : hello world
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'repeat(100%)'
+
+typo in point definition : repaet(50px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(100%)'
+
+another invalid point definition : ??px repeat(50px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(100%)'
+
+invalid destination : foo bar
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '0px 0px'
+
+short one destination value : 50%
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '0px 0px'
+
+extra destination value : 50px 100% 75px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '0px 0px'
+
+invalid coordinates : ben bitdiddle
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is 'none'
+
+mismatched x coordinate : 50% 100px 75%
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is 'none'
+
+mandatory type : mandatory
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-type') is 'mandatory'
+
+proximity type : proximity
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-type') is 'proximity'
+
+element points along x axis : elements
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'elements'
+
+percentage points along x axis : 100% 50%
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '100% 50%'
+
+pixel points along x axis : 100px 50px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '100px 50px'
+
+percentage points repeat along x axis : repeat(100%)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(100%)'
+
+pixel points repeat along x axis : repeat(25px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(25px)'
+
+percentage points along x axis with percentage repeat : 100% repeat(100%)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '100% repeat(100%)'
+
+pixel points along x axis with percentage repeat : 100px 50px repeat(25%)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '100px 50px repeat(25%)'
+
+percentage points along x axis with pixel repeat : 100% 50% repeat(40px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '100% 50% repeat(40px)'
+
+pixel points along x axis with pixel repeat : 100px repeat(42px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '100px repeat(42px)'
+
+element points along y axis : elements
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'elements'
+
+percentage points along y axis : 100% 50%
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is '100% 50%'
+
+pixel points along y axis : 100px 50px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is '100px 50px'
+
+percentage points repeat along y axis : repeat(100%)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'repeat(100%)'
+
+pixel points repeat along y axis : repeat(25px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'repeat(25px)'
+
+percentage points along y axis with percentage repeat : 100% repeat(100%)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is '100% repeat(100%)'
+
+pixel points along y axis with percentage repeat : 100px 50px repeat(25%)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is '100px 50px repeat(25%)'
+
+percentage points along y axis with pixel repeat : 100% 50% repeat(40px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is '100% 50% repeat(40px)'
+
+pixel points along y axis with pixel repeat : 100px repeat(42px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is '100px repeat(42px)'
+
+pixel/pixel destination : 10px 50px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '10px 50px'
+
+pixel/percentage destination : 20px 40%
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '20px 40%'
+
+percentage/pixel destination : 0% 0px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '0% 0px'
+
+percentage/percentage destination : 5% 100%
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '5% 100%'
+
+single pixel coordinate : 50px 100px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is '50px 100px'
+
+single percentage coordinate : 50% 100%
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is '50% 100%'
+
+multiple pixel coordinates : 50px 100px 150px 100px 200px 100px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is '50px 100px, 150px 100px, 200px 100px'
+
+multiple percentage coordinates : 50% 100% 150% 100% 200% 100%
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is '50% 100%, 150% 100%, 200% 100%'
+
+mm along x axis with pixel repeat : 10mm repeat(42mm)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '37.78125px repeat(158.734375px)'
+
+in along x axis with pixel repeat : 10in repeat(4in)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '960px repeat(384px)'
+
+pt along x axis with pixel repeat : 10pt repeat(42pt)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '13.328125px repeat(56px)'
+
+in/cm destination : 2in 5cm
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '192px 188.96875px'
+
+in/cm coordinate : 2in 5cm 5in 2cm
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is '192px 188.96875px, 480px 75.578125px'
+
+subpixel along x axis with pixel repeat : 100.5px repeat(50.25px)
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '100.5px repeat(50.25px)'
+
+subpixel destination : 0.125px 2.4375px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '0.125px 2.4375px'
+
+subpixel cordinate : 110.125px 25.4375px
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is '110.125px 25.4375px'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.html b/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.html
new file mode 100644 (file)
index 0000000..1f220eb
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="scroll-snap-property-computed-style.js"></script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.js b/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.js
new file mode 100644 (file)
index 0000000..8956e1a
--- /dev/null
@@ -0,0 +1,73 @@
+description("Test the computed style of the -webkit-scroll-snap-* properties.");
+
+var stylesheet;
+var styleElement = document.createElement("style");
+document.head.appendChild(styleElement);
+stylesheet = styleElement.sheet;
+
+function testComputedScrollSnapRule(description, snapProperty, rule, expected)
+{
+    debug("");
+    debug(description + " : " + rule);
+
+    stylesheet.insertRule("body { -webkit-scroll-snap-" + snapProperty + ": " + rule + "; }", 0);
+
+    shouldBe("window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-" + snapProperty + "')", "'" + expected + "'");
+    stylesheet.deleteRule(0);
+}
+
+testComputedScrollSnapRule("invalid snapping type", "type", "potato", "none");
+testComputedScrollSnapRule("invalid points along x axis", "points-x", "hello world", "repeat(100%)");
+testComputedScrollSnapRule("invalid points along y axis", "points-y", "hello world", "repeat(100%)");
+testComputedScrollSnapRule("typo in point definition", "points-x", "repaet(50px)", "repeat(100%)");
+testComputedScrollSnapRule("another invalid point definition", "points-x", "??px repeat(50px)", "repeat(100%)");
+testComputedScrollSnapRule("invalid destination", "destination", "foo bar", "0px 0px");
+testComputedScrollSnapRule("short one destination value", "destination", "50%", "0px 0px");
+testComputedScrollSnapRule("extra destination value", "destination", "50px 100% 75px", "0px 0px");
+testComputedScrollSnapRule("invalid coordinates", "coordinate", "ben bitdiddle", "none")
+testComputedScrollSnapRule("mismatched x coordinate", "coordinate", "50% 100px 75%", "none");
+
+testComputedScrollSnapRule("mandatory type", "type", "mandatory", "mandatory");
+testComputedScrollSnapRule("proximity type", "type", "proximity", "proximity");
+
+testComputedScrollSnapRule("element points along x axis", "points-x", "elements", "elements");
+testComputedScrollSnapRule("percentage points along x axis", "points-x", "100% 50%", "100% 50%");
+testComputedScrollSnapRule("pixel points along x axis", "points-x", "100px 50px", "100px 50px");
+testComputedScrollSnapRule("percentage points repeat along x axis", "points-x", "repeat(100%)", "repeat(100%)");
+testComputedScrollSnapRule("pixel points repeat along x axis", "points-x", "repeat(25px)", "repeat(25px)");
+testComputedScrollSnapRule("percentage points along x axis with percentage repeat", "points-x", "100% repeat(100%)", "100% repeat(100%)");
+testComputedScrollSnapRule("pixel points along x axis with percentage repeat", "points-x", "100px 50px repeat(25%)", "100px 50px repeat(25%)");
+testComputedScrollSnapRule("percentage points along x axis with pixel repeat", "points-x", "100% 50% repeat(40px)", "100% 50% repeat(40px)");
+testComputedScrollSnapRule("pixel points along x axis with pixel repeat", "points-x", "100px repeat(42px)", "100px repeat(42px)");
+
+testComputedScrollSnapRule("element points along y axis", "points-y", "elements", "elements");
+testComputedScrollSnapRule("percentage points along y axis", "points-y", "100% 50%", "100% 50%");
+testComputedScrollSnapRule("pixel points along y axis", "points-y", "100px 50px", "100px 50px");
+testComputedScrollSnapRule("percentage points repeat along y axis", "points-y", "repeat(100%)", "repeat(100%)");
+testComputedScrollSnapRule("pixel points repeat along y axis", "points-y", "repeat(25px)", "repeat(25px)");
+testComputedScrollSnapRule("percentage points along y axis with percentage repeat", "points-y", "100% repeat(100%)", "100% repeat(100%)");
+testComputedScrollSnapRule("pixel points along y axis with percentage repeat", "points-y", "100px 50px repeat(25%)", "100px 50px repeat(25%)");
+testComputedScrollSnapRule("percentage points along y axis with pixel repeat", "points-y", "100% 50% repeat(40px)", "100% 50% repeat(40px)");
+testComputedScrollSnapRule("pixel points along y axis with pixel repeat", "points-y", "100px repeat(42px)", "100px repeat(42px)");
+
+testComputedScrollSnapRule("pixel/pixel destination", "destination", "10px 50px", "10px 50px");
+testComputedScrollSnapRule("pixel/percentage destination", "destination", "20px 40%", "20px 40%");
+testComputedScrollSnapRule("percentage/pixel destination", "destination", "0% 0px", "0% 0px");
+testComputedScrollSnapRule("percentage/percentage destination", "destination", "5% 100%", "5% 100%");
+
+testComputedScrollSnapRule("single pixel coordinate", "coordinate", "50px 100px", "50px 100px");
+testComputedScrollSnapRule("single percentage coordinate", "coordinate", "50% 100%", "50% 100%");
+testComputedScrollSnapRule("multiple pixel coordinates", "coordinate", "50px 100px 150px 100px 200px 100px", "50px 100px, 150px 100px, 200px 100px");
+testComputedScrollSnapRule("multiple percentage coordinates", "coordinate", "50% 100% 150% 100% 200% 100%", "50% 100%, 150% 100%, 200% 100%");
+
+testComputedScrollSnapRule("mm along x axis with pixel repeat", "points-x", "10mm repeat(42mm)", "37.78125px repeat(158.734375px)");
+testComputedScrollSnapRule("in along x axis with pixel repeat", "points-x", "10in repeat(4in)", "960px repeat(384px)");
+testComputedScrollSnapRule("pt along x axis with pixel repeat", "points-x", "10pt repeat(42pt)", "13.328125px repeat(56px)");
+testComputedScrollSnapRule("in/cm destination", "destination", "2in 5cm", "192px 188.96875px");
+testComputedScrollSnapRule("in/cm coordinate", "coordinate", "2in 5cm 5in 2cm", "192px 188.96875px, 480px 75.578125px");
+
+testComputedScrollSnapRule("subpixel along x axis with pixel repeat", "points-x", "100.5px repeat(50.25px)", "100.5px repeat(50.25px)");
+testComputedScrollSnapRule("subpixel destination", "destination", "0.125px 2.4375px", "0.125px 2.4375px");
+testComputedScrollSnapRule("subpixel cordinate", "coordinate", "110.125px 25.4375px", "110.125px 25.4375px");
+
+successfullyParsed = true;
diff --git a/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing-expected.txt b/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing-expected.txt
new file mode 100644 (file)
index 0000000..216e04d
--- /dev/null
@@ -0,0 +1,189 @@
+Test the parsing of the -webkit-scroll-snap-* properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+mandatory type : mandatory
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-type') is 'mandatory'
+
+proximity type : proximity
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-type') is 'proximity'
+
+element points along x axis : elements
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is 'elements'
+
+percentage points along x axis : 100% 50%
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100% 50%'
+
+pixel points along x axis : 100px 50px
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100px 50px'
+
+percentage points repeat along x axis : repeat(100%)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(100%)'
+
+pixe points repeat along x axis : repeat(25px)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(25px)'
+
+percentage points along x axis with percentage repeat : 100% repeat(100%)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100% repeat(100%)'
+
+pixel points along x axis with percentage repeat : 100px 50px repeat(25%)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100px 50px repeat(25%)'
+
+percentage points along x axis with pixel repeat : 100% 50% repeat(40px)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100% 50% repeat(40px)'
+
+pixel points along x axis with pixel repeat : 100px repeat(42px)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100px repeat(42px)'
+
+element points along y axis : elements
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is 'elements'
+
+percentage points along y axis : 100% 50%
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is '100% 50%'
+
+pixel points along y axis : 100px 50px
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is '100px 50px'
+
+percentage points repeat along y axis : repeat(100%)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is 'repeat(100%)'
+
+pixe points repeat along y axis : repeat(25px)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is 'repeat(25px)'
+
+percentage points along y axis with percentage repeat : 100% repeat(100%)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is '100% repeat(100%)'
+
+pixel points along y axis with percentage repeat : 100px 50px repeat(25%)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is '100px 50px repeat(25%)'
+
+percentage points along y axis with pixel repeat : 100% 50% repeat(40px)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is '100% 50% repeat(40px)'
+
+pixel points along y axis with pixel repeat : 100px repeat(42px)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is '100px repeat(42px)'
+
+em points along x axis with pixel repeat : 100em repeat(42em)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+FAIL declaration.getPropertyValue('-webkit-scroll-snap-points-x') should be 100em repeat 42em. Was 100em repeat(42em).
+
+mm along x axis with pixel repeat : 100mm repeat(42mm)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+FAIL declaration.getPropertyValue('-webkit-scroll-snap-points-x') should be 100mm repeat 42mm. Was 100mm repeat(42mm).
+
+in along x axis with pixel repeat : 100in repeat(42in)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+FAIL declaration.getPropertyValue('-webkit-scroll-snap-points-x') should be 100in repeat 42in. Was 100in repeat(42in).
+
+pt along x axis with pixel repeat : 100pt repeat(42pt)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+FAIL declaration.getPropertyValue('-webkit-scroll-snap-points-x') should be 100pt repeat 42pt. Was 100pt repeat(42pt).
+
+pixel/pixel destination : 10px 50px
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-destination') is '10px 50px'
+
+pixel/percentage destination : 20px 40%
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-destination') is '20px 40%'
+
+percentage/pixel destination : 0% 0px
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-destination') is '0% 0px'
+
+percentage/percentage destination : 5% 100%
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-destination') is '5% 100%'
+
+em/ex destination : 12em 16ex
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-destination') is '12em 16ex'
+
+in/cm destination : 2in 5cm
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-destination') is '2in 5cm'
+
+single pixel coordinate : 50px 100px
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-coordinate') is '50px 100px'
+
+single percentage coordinate : 50% 100%
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-coordinate') is '50% 100%'
+
+multiple pixel coordinates : 50px 100px 150px 100px 200px 100px
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-coordinate') is '50px 100px 150px 100px 200px 100px'
+
+multiple percentage coordinates : 50% 100% 150% 100% 200% 100%
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-coordinate') is '50% 100% 150% 100% 200% 100%'
+
+em/ex coordinate : 12em 16ex 16em 12ex
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-coordinate') is '12em 16ex 16em 12ex'
+
+in/cm coordinate : 2in 5cm 5in 2cm
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-coordinate') is '2in 5cm 5in 2cm'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.html b/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.html
new file mode 100644 (file)
index 0000000..cd2efa0
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="scroll-snap-property-parsing.js"></script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.js b/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.js
new file mode 100644 (file)
index 0000000..0f12785
--- /dev/null
@@ -0,0 +1,67 @@
+description("Test the parsing of the -webkit-scroll-snap-* properties.");
+
+var stylesheet, cssRule, declaration;
+var styleElement = document.createElement("style");
+document.head.appendChild(styleElement);
+stylesheet = styleElement.sheet;
+
+function testScrollSnapRule(description, snapProperty, rule, expectedValue)
+{
+    debug("");
+    debug(description + " : " + rule);
+
+    stylesheet.insertRule("body { -webkit-scroll-snap-" + snapProperty + ": " + rule + "; }", 0);
+    cssRule = stylesheet.cssRules.item(0);
+
+    shouldBe("cssRule.type", "1");
+
+    declaration = cssRule.style;
+    shouldBe("declaration.length", "1");
+    shouldBe("declaration.getPropertyValue('-webkit-scroll-snap-" + snapProperty + "')", "'" + expectedValue + "'");
+}
+
+testScrollSnapRule("mandatory type", "type", "mandatory", "mandatory");
+testScrollSnapRule("proximity type", "type", "proximity", "proximity");
+
+testScrollSnapRule("element points along x axis", "points-x", "elements", "elements");
+testScrollSnapRule("percentage points along x axis", "points-x", "100% 50%", "100% 50%");
+testScrollSnapRule("pixel points along x axis", "points-x", "100px 50px", "100px 50px");
+testScrollSnapRule("percentage points repeat along x axis", "points-x", "repeat(100%)", "repeat(100%)");
+testScrollSnapRule("pixe points repeat along x axis", "points-x", "repeat(25px)", "repeat(25px)");
+testScrollSnapRule("percentage points along x axis with percentage repeat", "points-x", "100% repeat(100%)", "100% repeat(100%)");
+testScrollSnapRule("pixel points along x axis with percentage repeat", "points-x", "100px 50px repeat(25%)", "100px 50px repeat(25%)");
+testScrollSnapRule("percentage points along x axis with pixel repeat", "points-x", "100% 50% repeat(40px)", "100% 50% repeat(40px)");
+testScrollSnapRule("pixel points along x axis with pixel repeat", "points-x", "100px repeat(42px)", "100px repeat(42px)");
+
+testScrollSnapRule("element points along y axis", "points-y", "elements", "elements");
+testScrollSnapRule("percentage points along y axis", "points-y", "100% 50%", "100% 50%");
+testScrollSnapRule("pixel points along y axis", "points-y", "100px 50px", "100px 50px");
+testScrollSnapRule("percentage points repeat along y axis", "points-y", "repeat(100%)", "repeat(100%)");
+testScrollSnapRule("pixe points repeat along y axis", "points-y", "repeat(25px)", "repeat(25px)");
+testScrollSnapRule("percentage points along y axis with percentage repeat", "points-y", "100% repeat(100%)", "100% repeat(100%)");
+testScrollSnapRule("pixel points along y axis with percentage repeat", "points-y", "100px 50px repeat(25%)", "100px 50px repeat(25%)");
+testScrollSnapRule("percentage points along y axis with pixel repeat", "points-y", "100% 50% repeat(40px)", "100% 50% repeat(40px)");
+testScrollSnapRule("pixel points along y axis with pixel repeat", "points-y", "100px repeat(42px)", "100px repeat(42px)");
+
+testScrollSnapRule("em points along x axis with pixel repeat", "points-x", "100em repeat(42em)", "100em repeat 42em");
+testScrollSnapRule("mm along x axis with pixel repeat", "points-x", "100mm repeat(42mm)", "100mm repeat 42mm");
+testScrollSnapRule("in along x axis with pixel repeat", "points-x", "100in repeat(42in)", "100in repeat 42in");
+testScrollSnapRule("pt along x axis with pixel repeat", "points-x", "100pt repeat(42pt)", "100pt repeat 42pt");
+
+testScrollSnapRule("pixel/pixel destination", "destination", "10px 50px", "10px 50px");
+testScrollSnapRule("pixel/percentage destination", "destination", "20px 40%", "20px 40%");
+testScrollSnapRule("percentage/pixel destination", "destination", "0% 0px", "0% 0px");
+testScrollSnapRule("percentage/percentage destination", "destination", "5% 100%", "5% 100%");
+
+testScrollSnapRule("em/ex destination", "destination", "12em 16ex", "12em 16ex");
+testScrollSnapRule("in/cm destination", "destination", "2in 5cm", "2in 5cm");
+
+testScrollSnapRule("single pixel coordinate", "coordinate", "50px 100px", "50px 100px");
+testScrollSnapRule("single percentage coordinate", "coordinate", "50% 100%", "50% 100%");
+testScrollSnapRule("multiple pixel coordinates", "coordinate", "50px 100px 150px 100px 200px 100px", "50px 100px 150px 100px 200px 100px");
+testScrollSnapRule("multiple percentage coordinates", "coordinate", "50% 100% 150% 100% 200% 100%", "50% 100% 150% 100% 200% 100%");
+
+testScrollSnapRule("em/ex coordinate", "coordinate", "12em 16ex 16em 12ex", "12em 16ex 16em 12ex");
+testScrollSnapRule("in/cm coordinate", "coordinate", "2in 5cm 5in 2cm", "2in 5cm 5in 2cm");
+
+successfullyParsed = true;
index 1128b2a..4e2e605 100644 (file)
@@ -251,6 +251,9 @@ fast/frames/transparent-scrollbar.html
 fast/events/drag-and-drop-subframe-dataTransfer.html
 fast/events/drag-dataTransferItemList-file-handling.html
 
+# ENABLE(CSS_SCROLL_SNAP) is disabled.
+css3/scroll-snap
+
 # ENABLE(DRAGGABLE_REGION) is disabled
 fast/css/draggable-region-parser.html
 
index 35b2f71..eb9cdae 100644 (file)
@@ -364,6 +364,9 @@ Bug(GTK) plugins/quicktime-plugin-replacement.html [ Skip ]
 # Style scoped support unimplemented
 Bug(GTK) fast/css/style-scoped [ Skip ]
 
+# ENABLE(CSS_SCROLL_SNAP) is disabled.
+css3/scroll-snap
+
 # ENABLE(SHADOW_DOM) is disabled.
 Bug(GTK) fast/dom/shadow [ Skip ]
 Bug(GTK) fast/dom/HTMLTemplateElement/cycles-in-shadow.html [ Skip ]
index 4feec26..f7c5a2a 100644 (file)
@@ -1436,6 +1436,9 @@ webkit.org/b/60731 fast/css-grid-layout
 # <style scoped> is not yet enabled. http://webkit.org/b/49142
 webkit.org/b/49142 fast/css/style-scoped
 
+# ENABLE(CSS_SCROLL_SNAP) is disabled.
+css3/scroll-snap
+
 # ENABLE(SHADOW_DOM) is disabled.
 editing/shadow
 fast/dom/shadow
index 3379b78..f6b8721 100644 (file)
@@ -1,3 +1,12 @@
+2014-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Implement parsing for CSS scroll snap points
+        https://bugs.webkit.org/show_bug.cgi?id=134301
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP
+
 2014-08-06  Mark Lam  <mark.lam@apple.com>
 
         Gardening: fix for build failure on GTK bots.
index 994f0b2..d75244d 100644 (file)
@@ -186,6 +186,8 @@ ENABLE_REMOTE_INSPECTOR_macosx_101000 = ENABLE_REMOTE_INSPECTOR;
 ENABLE_RESOLUTION_MEDIA_QUERY = ;
 ENABLE_SCRIPTED_SPEECH = ;
 ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS;
+ENABLE_CSS_SCROLL_SNAP = $(ENABLE_CSS_SCROLL_SNAP_$(PLATFORM_NAME));
+ENABLE_CSS_SCROLL_SNAP_macosx = ENABLE_CSS_SCROLL_SNAP;
 ENABLE_SPEECH_SYNTHESIS = $(ENABLE_SPEECH_SYNTHESIS_$(PLATFORM_NAME));
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
@@ -248,4 +250,4 @@ ENABLE_FTL_JIT_iphonesimulator = ;
 
 ENABLE_LLINT_C_LOOP = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LONG_MOUSE_PRESS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(FEATURE_DEFINES_$(PLATFORM_NAME));
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LONG_MOUSE_PRESS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHARED_WORKERS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(FEATURE_DEFINES_$(PLATFORM_NAME));
index fe8ae0c..0de496c 100644 (file)
@@ -2442,6 +2442,7 @@ set(WebCore_SOURCES
     rendering/style/StyleMultiColData.cpp
     rendering/style/StyleRareInheritedData.cpp
     rendering/style/StyleRareNonInheritedData.cpp
+    rendering/style/StyleScrollSnapPoints.cpp
     rendering/style/StyleSurroundData.cpp
     rendering/style/StyleTransformData.cpp
     rendering/style/StyleVisualData.cpp
index 067efa0..3dbc9fb 100644 (file)
@@ -1,3 +1,81 @@
+2014-08-06  Wenson Hsieh <wenson_hsieh@apple.com>
+
+        Implement parsing for CSS scroll snap points
+        https://bugs.webkit.org/show_bug.cgi?id=134301
+
+        Provided support for parsing -webkit-scroll-snap-* properties, i.e.  type, points-x, points-y, destination, and coordinates.
+        The exact syntax of the scroll snap CSS properties follow the W3C spec at http://dev.w3.org/csswg/css-snappoints/
+
+        Reviewed by Dean Jackson.
+
+        Tests: css3/scroll-snap/scroll-snap-property-parsing.html,
+            css3/scroll-snap/scroll-snap-property-computed-style.html
+
+        * CMakeLists.txt: Added StyleScrollSnapPoints.h, StyleScrollSnapPoints.cpp
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP
+        * WebCore.vcxproj/WebCore.vcxproj: Added StyleScrollSnapPoints.h, StyleScrollSnapPoints.cpp
+        * WebCore.vcxproj/WebCore.vcxproj.filters: Added StyleScrollSnapPoints.h, StyleScrollSnapPoints.cpp
+        * WebCore.xcodeproj/project.pbxproj: Added StyleScrollSnapPoints.h, StyleScrollSnapPoints.cpp, LengthRepeat.h
+        * css/CSSCalculationValue.cpp: Support for LengthRepeat
+        (WebCore::hasDoubleValue):
+        * css/CSSComputedStyleDeclaration.cpp: Support for showing computed style for snap point properties.
+        (WebCore::scrollSnapDestination):
+        (WebCore::scrollSnapPoints):
+        (WebCore::scrollSnapCoordinates):
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSParser.cpp: Support for parsing snap point properties.
+        (WebCore::isValidKeywordPropertyAndValue): handle snap point type
+        (WebCore::isKeywordPropertyID):
+        (WebCore::CSSParser::parseValue): Added support for parsing snap points.
+        (WebCore::CSSParser::parseNonElementSnapPoints): Helper for parsing snap points-x/y.
+        (WebCore::CSSParser::parseScrollSnapDestination): Helper for parsing snap point destinations.
+        (WebCore::CSSParser::parseScrollSnapCoordinate): Helper for parsing snap point coordinates.
+        * css/CSSParser.h: Support for parsing snap point properties.
+        * css/CSSParserValues.cpp:
+        (WebCore::CSSParserValue::createCSSValue):
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::isValidCSSUnitTypeForDoubleConversion):
+        (WebCore::CSSPrimitiveValue::init):
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::getLengthRepeatValue):
+        (WebCore::CSSPrimitiveValue::formatNumberForcustomCSSText):
+        (WebCore::CSSPrimitiveValue::cloneForCSSOM):
+        (WebCore::CSSPrimitiveValue::equals):
+        * css/CSSPrimitiveValue.h:
+        (WebCore::CSSPrimitiveValue::isLengthRepeat):
+        (WebCore::CSSPrimitiveValue::getLengthRepeatValue):
+        * css/CSSPrimitiveValueMappings.h: Added converters for snap point type properties.
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator ScrollSnapType):
+        * css/CSSPropertyNames.in: Added relevant snap point property names.
+        * css/CSSValueKeywords.in: Added "proximity", "mandatory" and "elements".
+        * css/LengthRepeat.h: Added to represent values of repeat(<length>)
+        (WebCore::LengthRepeat::create):
+        (WebCore::LengthRepeat::cloneForCSSOM):
+        (WebCore::LengthRepeat::interval):
+        (WebCore::LengthRepeat::setInterval):
+        (WebCore::LengthRepeat::equals):
+        (WebCore::LengthRepeat::cssText):
+        (WebCore::LengthRepeat::LengthRepeat):
+        * css/StyleResolver.cpp: Support for handling snap point properties
+        (WebCore::StyleResolver::applyProperty):Updated switch case to build snap-point-related style data
+        * rendering/style/RenderStyle.h: Added methods to access and modify snap point data
+        * rendering/style/RenderStyleConstants.h: Added scroll snap type flags.
+        * rendering/style/StyleAllInOne.cpp: Added StyleScrollSnapPoints.cpp
+        * rendering/style/StyleRareNonInheritedData.cpp: Added initiazing for m_scrollSnapPoints, updated equality check
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h: Added field for StyleScrollSnapPoints
+        * rendering/style/StyleScrollSnapPoints.cpp: Added. Wrapper for basic snap point data structures.
+        (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints):
+        (WebCore::StyleScrollSnapPoints::copy):
+        (WebCore::StyleScrollSnapPoints::operator==):
+        * rendering/style/StyleScrollSnapPoints.h: Added.
+        (WebCore::StyleScrollSnapPoints::create):
+        (WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Creates a new Length representing the default repeat value of repeat(100%)
+        (WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Creates a new Length representing a default destination value (0px)
+        (WebCore::StyleScrollSnapPoints::operator!=):
+
 2014-08-06  Andy Estes  <aestes@apple.com>
 
         [iOS] Subresources referenced in converted QuickLook documents sometimes fail to load
index 994f0b2..d75244d 100644 (file)
@@ -186,6 +186,8 @@ ENABLE_REMOTE_INSPECTOR_macosx_101000 = ENABLE_REMOTE_INSPECTOR;
 ENABLE_RESOLUTION_MEDIA_QUERY = ;
 ENABLE_SCRIPTED_SPEECH = ;
 ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS;
+ENABLE_CSS_SCROLL_SNAP = $(ENABLE_CSS_SCROLL_SNAP_$(PLATFORM_NAME));
+ENABLE_CSS_SCROLL_SNAP_macosx = ENABLE_CSS_SCROLL_SNAP;
 ENABLE_SPEECH_SYNTHESIS = $(ENABLE_SPEECH_SYNTHESIS_$(PLATFORM_NAME));
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
@@ -248,4 +250,4 @@ ENABLE_FTL_JIT_iphonesimulator = ;
 
 ENABLE_LLINT_C_LOOP = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LONG_MOUSE_PRESS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(FEATURE_DEFINES_$(PLATFORM_NAME));
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LONG_MOUSE_PRESS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHARED_WORKERS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(FEATURE_DEFINES_$(PLATFORM_NAME));
index f8c7e7a..72ee6bf 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="..\rendering\style\StyleScrollSnapPoints.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\rendering\style\StyleSurroundData.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     <ClInclude Include="..\css\DashboardRegion.h" />
     <ClInclude Include="..\css\FontLoader.h" />
     <ClInclude Include="..\css\LengthFunctions.h" />
+    <ClInclude Include="..\css\LengthRepeat.h" />
     <ClInclude Include="..\css\MediaFeatureNames.h" />
     <ClInclude Include="..\css\MediaList.h" />
     <ClInclude Include="..\css\MediaQuery.h" />
     <ClInclude Include="..\rendering\style\StyleRareInheritedData.h" />
     <ClInclude Include="..\rendering\style\StyleRareNonInheritedData.h" />
     <ClInclude Include="..\rendering\style\StyleReflection.h" />
+    <ClInclude Include="..\rendering\style\StyleScrollSnapPoints.h" />
     <ClInclude Include="..\rendering\style\StyleSurroundData.h" />
     <ClInclude Include="..\rendering\style\StyleTransformData.h" />
     <ClInclude Include="..\rendering\style\StyleVariableData.h" />
index 36f4a1e..6a66196 100644 (file)
     <ClCompile Include="..\rendering\style\StyleRareNonInheritedData.cpp">
       <Filter>rendering\style</Filter>
     </ClCompile>
+    <ClCompile Include="..\rendering\style\StyleScrollSnapPoints.cpp">
+      <Filter>rendering\style</Filter>
+    </ClCompile>
     <ClCompile Include="..\rendering\style\StyleSurroundData.cpp">
       <Filter>rendering\style</Filter>
     </ClCompile>
     <ClInclude Include="..\css\LengthFunctions.h">
       <Filter>css</Filter>
     </ClInclude>
+    <ClInclude Include="..\css\LengthRepeat.h">
+      <Filter>css</Filter>
+    </ClInclude>
     <ClInclude Include="..\css\MediaFeatureNames.h">
       <Filter>css</Filter>
     </ClInclude>
     <ClInclude Include="..\rendering\style\StyleReflection.h">
       <Filter>rendering\style</Filter>
     </ClInclude>
+    <ClInclude Include="..\rendering\style\StyleScrollSnapPoints.h">
+      <Filter>rendering\style</Filter>
+    </ClInclude>
     <ClInclude Include="..\rendering\style\StyleSurroundData.h">
       <Filter>rendering\style</Filter>
     </ClInclude>
index 09a789d..619b812 100644 (file)
                F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */; };
                F3F5CF1112ED81A80084C569 /* InspectorConsoleInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */; };
                F3F5CF1312ED81B30084C569 /* InspectorDatabaseInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */; };
+               F42FFB461984B71600F6837F /* LengthRepeat.h in Headers */ = {isa = PBXBuildFile; fileRef = F42FFB451984B71600F6837F /* LengthRepeat.h */; };
+               F47A5E3E195B8C8A00483100 /* StyleScrollSnapPoints.h in Headers */ = {isa = PBXBuildFile; fileRef = F47A5E3B195B8C8A00483100 /* StyleScrollSnapPoints.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               F47A5E3F195B8E4800483100 /* StyleScrollSnapPoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F47A5E3A195B8C8A00483100 /* StyleScrollSnapPoints.cpp */; };
                F50664F7157F52DC00AC226F /* FormController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F50664F5157F52DC00AC226F /* FormController.cpp */; };
                F50664F8157F52DC00AC226F /* FormController.h in Headers */ = {isa = PBXBuildFile; fileRef = F50664F6157F52DC00AC226F /* FormController.h */; };
                F513A3EA15FF4841001526DB /* ValidationMessageClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F513A3E915FF4841001526DB /* ValidationMessageClient.h */; };
                F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMDebuggerAgent.h; sourceTree = "<group>"; };
                F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleInstrumentation.h; sourceTree = "<group>"; };
                F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseInstrumentation.h; sourceTree = "<group>"; };
+               F42FFB451984B71600F6837F /* LengthRepeat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthRepeat.h; sourceTree = "<group>"; };
+               F47A5E3A195B8C8A00483100 /* StyleScrollSnapPoints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleScrollSnapPoints.cpp; path = style/StyleScrollSnapPoints.cpp; sourceTree = "<group>"; };
+               F47A5E3B195B8C8A00483100 /* StyleScrollSnapPoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleScrollSnapPoints.h; path = style/StyleScrollSnapPoints.h; sourceTree = "<group>"; };
                F50664F5157F52DC00AC226F /* FormController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormController.cpp; sourceTree = "<group>"; };
                F50664F6157F52DC00AC226F /* FormController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormController.h; sourceTree = "<group>"; };
                F513A3E915FF4841001526DB /* ValidationMessageClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValidationMessageClient.h; sourceTree = "<group>"; };
                                BC2274760E8366E200E7F975 /* SVGRenderStyleDefs.cpp */,
                                BC2274770E8366E200E7F975 /* SVGRenderStyleDefs.h */,
                                448B1B780F3A2F9B0047A9E2 /* TextSizeAdjustment.h */,
+                               F47A5E3A195B8C8A00483100 /* StyleScrollSnapPoints.cpp */,
+                               F47A5E3B195B8C8A00483100 /* StyleScrollSnapPoints.h */,
                        );
                        name = style;
                        sourceTree = "<group>";
                                93CA4C9F09DF93FA00DF8677 /* quirks.css */,
                                BC4368E70C226E32005EFB5F /* Rect.h */,
                                A80E79960A19BD21007FB8C5 /* Rect.idl */,
+                               F42FFB451984B71600F6837F /* LengthRepeat.h */,
                                BC74DA361013F3F7007987AD /* RGBColor.cpp */,
                                BC74DA351013F3F7007987AD /* RGBColor.h */,
                                858C38EF0AA8FDD100B187A4 /* RGBColor.idl */,
                                510192D218B6B9AB007FC7A1 /* ImageControlsRootElementMac.h in Headers */,
                                A779791A0D6B9D0C003851B9 /* ImageData.h in Headers */,
                                97205AB61239291000B17380 /* ImageDocument.h in Headers */,
+                               F42FFB461984B71600F6837F /* LengthRepeat.h in Headers */,
                                F55B3DC21251F12D003EF269 /* ImageInputType.h in Headers */,
                                089582560E857A7E00F82C83 /* ImageLoader.h in Headers */,
                                BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */,
                                E1FF8F65180745D800132674 /* JSSubtleCrypto.h in Headers */,
                                B20111080AB7740500DB0E68 /* JSSVGAElement.h in Headers */,
                                24D9129213CA951E00D21915 /* JSSVGAltGlyphDefElement.h in Headers */,
+                               F47A5E3E195B8C8A00483100 /* StyleScrollSnapPoints.h in Headers */,
                                07AC47021952102100EE9723 /* ISOVTTCue.h in Headers */,
                                6515EC920D9723FF0063D49A /* JSSVGAltGlyphElement.h in Headers */,
                                24D9129613CA956100D21915 /* JSSVGAltGlyphItemElement.h in Headers */,
                                93309E0D099E64920056E581 /* FrameSelection.cpp in Sources */,
                                4A8C96EB0BE69032004EEFF0 /* FrameSelectionMac.mm in Sources */,
                                C4CD629A18383766007EBAF1 /* FrameSnapshotting.cpp in Sources */,
+                               F47A5E3F195B8E4800483100 /* StyleScrollSnapPoints.cpp in Sources */,
                                65A21484097A3F5300B9050A /* FrameTree.cpp in Sources */,
                                65CBFEF90974F607001DAC25 /* FrameView.cpp in Sources */,
                                97205AAF123928CA00B17380 /* FTPDirectoryDocument.cpp in Sources */,
index 206c5a3..0887260 100644 (file)
@@ -139,6 +139,9 @@ static bool hasDoubleValue(CSSPrimitiveValue::UnitTypes type)
     case CSSPrimitiveValue::CSS_COUNTER_NAME:
     case CSSPrimitiveValue::CSS_SHAPE:
     case CSSPrimitiveValue::CSS_QUAD:
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPrimitiveValue::CSS_LENGTH_REPEAT:
+#endif
     case CSSPrimitiveValue::CSS_CALC:
     case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_NUMBER:
     case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_LENGTH:
index eedf959..5bbf425 100644 (file)
 #include "DashboardRegion.h"
 #endif
 
+#if ENABLE(CSS_SCROLL_SNAP)
+#include "LengthRepeat.h"
+#include "StyleScrollSnapPoints.h"
+#endif
+
 namespace WebCore {
 
 // List of all properties we know how to compute, omitting shorthands.
@@ -212,6 +217,13 @@ static const CSSPropertyID computedProperties[] = {
     CSSPropertyWordBreak,
     CSSPropertyWordSpacing,
     CSSPropertyWordWrap,
+#if ENABLE(CSS_SCROLL_SNAP)
+    CSSPropertyWebkitScrollSnapType,
+    CSSPropertyWebkitScrollSnapPointsX,
+    CSSPropertyWebkitScrollSnapPointsY,
+    CSSPropertyWebkitScrollSnapDestination,
+    CSSPropertyWebkitScrollSnapCoordinate,
+#endif
     CSSPropertyZIndex,
     CSSPropertyZoom,
 
@@ -1072,6 +1084,64 @@ static PassRef<CSSValueList> getTransitionPropertyValue(const AnimationList* ani
     return list;
 }
 
+#if ENABLE(CSS_SCROLL_SNAP)
+static PassRef<CSSValueList> scrollSnapDestination(RenderStyle* style, Length x, Length y)
+{
+    RefPtr<CSSValueList> snapDestinationValue = CSSValueList::createSpaceSeparated();
+    if (x.isPercentNotCalculated())
+        snapDestinationValue->append(cssValuePool().createValue(x.percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
+    else
+        snapDestinationValue->append(zoomAdjustedPixelValue(valueForLength(x, 0), style));
+
+    if (y.isPercentNotCalculated())
+        snapDestinationValue->append(cssValuePool().createValue(y.percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
+    else
+        snapDestinationValue->append(zoomAdjustedPixelValue(valueForLength(y, 0), style));
+
+    return snapDestinationValue.releaseNonNull();
+}
+
+static PassRef<CSSValueList> scrollSnapPoints(RenderStyle* style, const Vector<Length>& points, Length repeatPoint, bool hasRepeat)
+{
+    RefPtr<CSSValueList> snapPointsValue = CSSValueList::createSpaceSeparated();
+    for (auto& point : points) {
+        if (point.isPercentNotCalculated())
+            snapPointsValue->append(cssValuePool().createValue(point.percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
+        else
+            snapPointsValue->append(zoomAdjustedPixelValue(valueForLength(point, 0), style));
+    }
+    if (hasRepeat) {
+        if (repeatPoint.isPercentNotCalculated())
+            snapPointsValue->append(cssValuePool().createValue(LengthRepeat::create(cssValuePool().createValue(repeatPoint.percent(), CSSPrimitiveValue::CSS_PERCENTAGE))));
+        else
+            snapPointsValue->append(cssValuePool().createValue(LengthRepeat::create(zoomAdjustedPixelValue(valueForLength(repeatPoint, 0), style))));
+    }
+    return snapPointsValue.releaseNonNull();
+}
+
+static PassRef<CSSValueList> scrollSnapCoordinates(RenderStyle* style, const Vector<SnapCoordinate>& coordinates)
+{
+    RefPtr<CSSValueList> snapCoordinatesValue = CSSValueList::createCommaSeparated();
+    for (const auto& coordinate : coordinates) {
+        RefPtr<CSSValueList> currentCoordinate = CSSValueList::createSpaceSeparated();
+        Length point = coordinate.first;
+        if (point.isPercentNotCalculated())
+            currentCoordinate->append(cssValuePool().createValue(point.percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
+        else
+            currentCoordinate->append(zoomAdjustedPixelValue(valueForLength(point, 0), style));
+
+        point = coordinate.second;
+        if (point.isPercentNotCalculated())
+            currentCoordinate->append(cssValuePool().createValue(point.percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
+        else
+            currentCoordinate->append(zoomAdjustedPixelValue(valueForLength(point, 0), style));
+
+        snapCoordinatesValue->append(PassRefPtr<CSSValueList>(WTF::move(currentCoordinate)));
+    }
+    return snapCoordinatesValue.releaseNonNull();
+}
+#endif
+
 static PassRef<CSSValueList> getDelayValue(const AnimationList* animList)
 {
     auto list = CSSValueList::createCommaSeparated();
@@ -3039,6 +3109,26 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert
         case CSSPropertyWritingMode:
         case CSSPropertyWebkitSvgShadow:
             return svgPropertyValue(propertyID, DoNotUpdateLayout);
+
+#if ENABLE(CSS_SCROLL_SNAP)
+        case CSSPropertyWebkitScrollSnapType:
+            return cssValuePool().createValue(style->scrollSnapType());
+        case CSSPropertyWebkitScrollSnapDestination:
+            return scrollSnapDestination(style.get(), style->scrollSnapDestinationX(), style->scrollSnapDestinationY());
+        case CSSPropertyWebkitScrollSnapPointsX:
+            if (style->scrollSnapUsesElementsX())
+                return cssValuePool().createValue("elements", CSSPrimitiveValue::CSS_STRING);
+            return scrollSnapPoints(style.get(), style->scrollSnapOffsetsX(), style->scrollSnapRepeatOffsetX(), style->scrollSnapHasRepeatX());
+        case CSSPropertyWebkitScrollSnapPointsY:
+            if (style->scrollSnapUsesElementsY())
+                return cssValuePool().createValue("elements", CSSPrimitiveValue::CSS_STRING);
+            return scrollSnapPoints(style.get(), style->scrollSnapOffsetsY(), style->scrollSnapRepeatOffsetY(), style->scrollSnapHasRepeatY());
+        case CSSPropertyWebkitScrollSnapCoordinate:
+            Vector<SnapCoordinate> coords = style->scrollSnapCoordinates();
+            if (!coords.size())
+                return cssValuePool().createValue("none", CSSPrimitiveValue::CSS_STRING);
+            return scrollSnapCoordinates(style.get(), coords);
+#endif
     }
 
     logUnimplementedPropertyID(propertyID);
index 6b11db4..2cf9dcb 100644 (file)
 #include "WebKitCSSFilterValue.h"
 #endif
 
+#if ENABLE(CSS_SCROLL_SNAP)
+#include "LengthRepeat.h"
+#endif
+
 #if ENABLE(DASHBOARD_SUPPORT)
 #include "DashboardRegion.h"
 #endif
@@ -720,6 +724,12 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
         if (valueID == CSSValueNormal || valueID == CSSValueBreakWord)
             return true;
         break;
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPropertyWebkitScrollSnapType: // none | mandatory | proximity
+        if (valueID == CSSValueNone || valueID == CSSValueMandatory || valueID == CSSValueProximity)
+            return true;
+        break;
+#endif
     case CSSPropertyOverflowX: // visible | hidden | scroll | auto | marquee | overlay | inherit
         if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitMarquee)
             return true;
@@ -1138,6 +1148,9 @@ static inline bool isKeywordPropertyID(CSSPropertyID propertyId)
     case CSSPropertyWhiteSpace:
     case CSSPropertyWordBreak:
     case CSSPropertyWordWrap:
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPropertyWebkitScrollSnapType:
+#endif
         return true;
     default:
         return false;
@@ -3032,6 +3045,9 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
     case CSSPropertyWhiteSpace:
     case CSSPropertyWordBreak:
     case CSSPropertyWordWrap:
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPropertyWebkitScrollSnapType:
+#endif
         // These properties should be handled before in isValidKeywordPropertyAndValue().
         ASSERT_NOT_REACHED();
         return false;
@@ -3046,6 +3062,19 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
         validPrimitive = false;
         break;
 #endif
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPropertyWebkitScrollSnapPointsX:
+    case CSSPropertyWebkitScrollSnapPointsY:
+        if (id == CSSValueElements) {
+            validPrimitive = true;
+            break;
+        }
+        return parseNonElementSnapPoints(propId, important);
+    case CSSPropertyWebkitScrollSnapDestination: // <length>{2}
+        return parseScrollSnapDestination(propId, important);
+    case CSSPropertyWebkitScrollSnapCoordinate:
+        return parseScrollSnapCoordinate(propId, important);
+#endif
     default:
         return parseSVGValue(propId, important);
     }
@@ -3153,6 +3182,83 @@ bool CSSParser::useLegacyBackgroundSizeShorthandBehavior() const
     return m_context.useLegacyBackgroundSizeShorthandBehavior;
 }
 
+#if ENABLE(CSS_SCROLL_SNAP)
+bool CSSParser::parseNonElementSnapPoints(CSSPropertyID propId, bool important)
+{
+    RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
+    while (CSSParserValue* val = m_valueList->current()) {
+        RefPtr<CSSValue> parsedValue;
+        if (validUnit(val, FPercent | FLength)) {
+            parsedValue = createPrimitiveNumericValue(val);
+            values->append(parsedValue.release());
+        } else if (val->unit == CSSParserValue::Function
+            && val->function->args != 0
+            && val->function->args->size() == 1
+            && equalIgnoringCase(val->function->name, "repeat(")) {
+            CSSParserValue* parserVal = val->function->args.get()->current();
+            if (validUnit(parserVal, FLength | FPercent)) {
+                values->append(cssValuePool().createValue(LengthRepeat::create(createPrimitiveNumericValue(parserVal))));
+                m_valueList->next();
+                if (m_valueList->current())
+                    return false;
+                break;
+            }
+        } else
+            return false;
+        m_valueList->next();
+    }
+    if (values->length()) {
+        addProperty(propId, values.release(), important);
+        m_valueList->next();
+        return true;
+    }
+    return false;
+}
+
+bool CSSParser::parseScrollSnapDestination(CSSPropertyID propId, bool important)
+{
+    RefPtr<CSSValueList> position = CSSValueList::createSpaceSeparated();
+    if (m_valueList->size() != 2)
+        return false;
+    CSSParserValue* curParserVal = m_valueList->current();
+    if (!validUnit(curParserVal, FPercent | FLength))
+        return false;
+    RefPtr<CSSValue> cssValueX = createPrimitiveNumericValue(curParserVal);
+    m_valueList->next();
+    curParserVal = m_valueList->current();
+    if (!validUnit(curParserVal, FPercent | FLength))
+        return false;
+    RefPtr<CSSValue> cssValueY = createPrimitiveNumericValue(curParserVal);
+    position->append(cssValueX.release());
+    position->append(cssValueY.release());
+    addProperty(propId, position, important);
+    m_valueList->next();
+    return true;
+}
+
+bool CSSParser::parseScrollSnapCoordinate(CSSPropertyID propId, bool important)
+{
+    RefPtr<CSSValueList> positions = CSSValueList::createSpaceSeparated();
+    while (m_valueList->current()) {
+        CSSParserValue* parsedValueX = m_valueList->current();
+        // Don't accept odd-length lists of coordinates.
+        if (!m_valueList->next())
+            return false;
+        CSSParserValue* parsedValueY = m_valueList->current();
+        if (!validUnit(parsedValueX, FPercent | FLength) || !validUnit(parsedValueY, FPercent | FLength))
+            return false;
+        positions->append(createPrimitiveNumericValue(parsedValueX));
+        positions->append(createPrimitiveNumericValue(parsedValueY));
+        m_valueList->next();
+    }
+    if (positions->length()) {
+        addProperty(propId, positions.release(), important);
+        return true;
+    }
+    return false;
+}
+#endif
+
 const int cMaxFillProperties = 9;
 
 bool CSSParser::parseFillShorthand(CSSPropertyID propId, const CSSPropertyID* properties, int numProperties, bool important)
index aed9374..26762b8 100644 (file)
@@ -534,6 +534,12 @@ private:
     bool parseSize(CSSPropertyID propId, bool important);
     SizeParameterType parseSizeParameter(CSSValueList* parsedValues, CSSParserValue* value, SizeParameterType prevParamType);
 
+#if ENABLE(CSS_SCROLL_SNAP)
+    bool parseNonElementSnapPoints(CSSPropertyID propId, bool important);
+    bool parseScrollSnapDestination(CSSPropertyID propId, bool important);
+    bool parseScrollSnapCoordinate(CSSPropertyID propId, bool important);
+#endif
+
     bool parseFontFaceSrcURI(CSSValueList*);
     bool parseFontFaceSrcLocal(CSSValueList*);
 
index 3cfd1d7..d42ed08 100644 (file)
@@ -141,6 +141,9 @@ PassRefPtr<CSSValue> CSSParserValue::createCSSValue()
     case CSSPrimitiveValue::CSS_COUNTER_NAME:
     case CSSPrimitiveValue::CSS_SHAPE:
     case CSSPrimitiveValue::CSS_QUAD:
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPrimitiveValue::CSS_LENGTH_REPEAT:
+#endif
     case CSSPrimitiveValue::CSS_CALC:
     case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_NUMBER:
     case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_LENGTH:
index eff06ab..8b1faa7 100644 (file)
 #include "DashboardRegion.h"
 #endif
 
+#if ENABLE(CSS_SCROLL_SNAP)
+#include "LengthRepeat.h"
+#endif
+
 using namespace WTF;
 
 namespace WebCore {
@@ -119,6 +123,9 @@ static inline bool isValidCSSUnitTypeForDoubleConversion(CSSPrimitiveValue::Unit
     case CSSPrimitiveValue::CSS_PARSER_OPERATOR:
     case CSSPrimitiveValue::CSS_RECT:
     case CSSPrimitiveValue::CSS_QUAD:
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPrimitiveValue::CSS_LENGTH_REPEAT:
+#endif
     case CSSPrimitiveValue::CSS_RGBCOLOR:
     case CSSPrimitiveValue::CSS_SHAPE:
     case CSSPrimitiveValue::CSS_STRING:
@@ -398,6 +405,15 @@ void CSSPrimitiveValue::init(PassRefPtr<Quad> quad)
     m_value.quad = quad.leakRef();
 }
 
+#if ENABLE(CSS_SCROLL_SNAP)
+void CSSPrimitiveValue::init(PassRefPtr<LengthRepeat> lengthRepeat)
+{
+    m_primitiveUnitType = CSS_LENGTH_REPEAT;
+    m_hasCachedCSSText = false;
+    m_value.lengthRepeat = lengthRepeat.leakRef();
+}
+#endif
+
 #if ENABLE(DASHBOARD_SUPPORT)
 void CSSPrimitiveValue::init(PassRefPtr<DashboardRegion> r)
 {
@@ -453,6 +469,11 @@ void CSSPrimitiveValue::cleanup()
     case CSS_QUAD:
         m_value.quad->deref();
         break;
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSS_LENGTH_REPEAT:
+        m_value.lengthRepeat->deref();
+        break;
+#endif
     case CSS_PAIR:
         m_value.pair->deref();
         break;
@@ -898,6 +919,19 @@ Quad* CSSPrimitiveValue::getQuadValue(ExceptionCode& ec) const
     return m_value.quad;
 }
 
+#if ENABLE(CSS_SCROLL_SNAP)
+LengthRepeat* CSSPrimitiveValue::getLengthRepeatValue(ExceptionCode& ec) const
+{
+    ec = 0;
+    if (m_primitiveUnitType != CSS_LENGTH_REPEAT) {
+        ec = INVALID_ACCESS_ERR;
+        return 0;
+    }
+
+    return m_value.lengthRepeat;
+}
+#endif
+
 PassRefPtr<RGBColor> CSSPrimitiveValue::getRGBColorValue(ExceptionCode& ec) const
 {
     ec = 0;
@@ -1047,6 +1081,10 @@ ALWAYS_INLINE String CSSPrimitiveValue::formatNumberForcustomCSSText() const
         return getRectValue()->cssText();
     case CSS_QUAD:
         return getQuadValue()->cssText();
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSS_LENGTH_REPEAT:
+        return getLengthRepeatValue()->cssText();
+#endif
     case CSS_RGBCOLOR:
     case CSS_PARSER_HEXCOLOR: {
         RGBA32 rgbColor = m_value.rgbcolor;
@@ -1186,6 +1224,11 @@ PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::cloneForCSSOM() const
     case CSS_QUAD:
         result = CSSPrimitiveValue::create(m_value.quad->cloneForCSSOM());
         break;
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSS_LENGTH_REPEAT:
+        result = CSSPrimitiveValue::create(m_value.lengthRepeat->cloneForCSSOM());
+        break;
+#endif
     case CSS_PAIR:
         // Pair is not exposed to the CSSOM, no need for a deep clone.
         result = CSSPrimitiveValue::create(m_value.pair);
@@ -1316,6 +1359,10 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
         return m_value.rect && other.m_value.rect && m_value.rect->equals(*other.m_value.rect);
     case CSS_QUAD:
         return m_value.quad && other.m_value.quad && m_value.quad->equals(*other.m_value.quad);
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSS_LENGTH_REPEAT:
+        return m_value.lengthRepeat && other.m_value.lengthRepeat && m_value.lengthRepeat->equals(*other.m_value.lengthRepeat);
+#endif
     case CSS_RGBCOLOR:
         return m_value.rgbcolor == other.m_value.rgbcolor;
     case CSS_PAIR:
index badbb84..f5b1b69 100644 (file)
@@ -43,6 +43,10 @@ class Rect;
 class RenderStyle;
 class CSSBasicShape;
 
+#if ENABLE(CSS_SCROLL_SNAP)
+class LengthRepeat;
+#endif
+
 struct Length;
 struct LengthSize;
 
@@ -104,6 +108,9 @@ public:
         CSS_DPI = 31,
         CSS_DPCM = 32,
         CSS_FR = 33,
+#if ENABLE(CSS_SCROLL_SNAP)
+        CSS_LENGTH_REPEAT = 34,
+#endif
         CSS_PAIR = 100, // We envision this being exposed as a means of getting computed style values for pairs (border-spacing/radius, background-position, etc.)
 #if ENABLE(DASHBOARD_SUPPORT)
         CSS_DASHBOARD_REGION = 101, // FIXME: Dashboard region should not be a primitive value.
@@ -181,6 +188,9 @@ public:
     bool isPercentage() const { return primitiveType() == CSS_PERCENTAGE; }
     bool isPx() const { return primitiveType() == CSS_PX; }
     bool isRect() const { return m_primitiveUnitType == CSS_RECT; }
+#if ENABLE(CSS_SCROLL_SNAP)
+    bool isLengthRepeat() const { return m_primitiveUnitType == CSS_LENGTH_REPEAT; }
+#endif
     bool isRGBColor() const { return m_primitiveUnitType == CSS_RGBCOLOR; }
     bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; }
     bool isString() const { return m_primitiveUnitType == CSS_STRING; }
@@ -303,6 +313,11 @@ public:
     Quad* getQuadValue(ExceptionCode&) const;
     Quad* getQuadValue() const { return m_primitiveUnitType != CSS_QUAD ? 0 : m_value.quad; }
 
+#if ENABLE(CSS_SCROLL_SNAP)
+    LengthRepeat* getLengthRepeatValue(ExceptionCode&) const;
+    LengthRepeat* getLengthRepeatValue() const { return m_primitiveUnitType != CSS_LENGTH_REPEAT ? 0 : m_value.lengthRepeat; }
+#endif
+
     PassRefPtr<RGBColor> getRGBColorValue(ExceptionCode&) const;
     RGBA32 getRGBA32Value() const { return m_primitiveUnitType != CSS_RGBCOLOR ? 0 : m_value.rgbcolor; }
 
@@ -371,6 +386,9 @@ private:
     void init(PassRefPtr<Rect>);
     void init(PassRefPtr<Pair>);
     void init(PassRefPtr<Quad>);
+#if ENABLE(CSS_SCROLL_SNAP)
+    void init(PassRefPtr<LengthRepeat>);
+#endif
     void init(PassRefPtr<DashboardRegion>); // FIXME: Dashboard region should not be a primitive value.
     void init(PassRefPtr<CSSBasicShape>);
     void init(PassRefPtr<CSSCalcValue>);
@@ -392,6 +410,9 @@ private:
         Counter* counter;
         Rect* rect;
         Quad* quad;
+#if ENABLE(CSS_SCROLL_SNAP)
+        LengthRepeat* lengthRepeat;
+#endif
         unsigned rgbcolor;
         Pair* pair;
         DashboardRegion* region;
index 9802c3e..abbd500 100644 (file)
@@ -5183,6 +5183,43 @@ template<> inline CSSPrimitiveValue::operator EJustifySelfOverflowAlignment() co
     return JustifySelfOverflowAlignmentTrue;
 }
 
+
+#if ENABLE(CSS_SCROLL_SNAP)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollSnapType e)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_VALUE_ID;
+    switch (e) {
+    case ScrollSnapType::None:
+        m_value.valueID = CSSValueNone;
+        break;
+    case ScrollSnapType::Proximity:
+        m_value.valueID = CSSValueProximity;
+        break;
+    case ScrollSnapType::Mandatory:
+        m_value.valueID = CSSValueMandatory;
+        break;
+    }
+}
+
+template<> inline CSSPrimitiveValue::operator ScrollSnapType() const
+{
+    ASSERT(isValueID());
+    switch (m_value.valueID) {
+    case CSSValueNone:
+        return ScrollSnapType::None;
+    case CSSValueProximity:
+        return ScrollSnapType::Proximity;
+    case CSSValueMandatory:
+        return ScrollSnapType::Mandatory;
+    default:
+        break;
+    }
+    ASSERT_NOT_REACHED();
+    return ScrollSnapType::None;
+}
+#endif
+
 }
 
 #endif
index b66abad..64af49f 100644 (file)
@@ -387,6 +387,13 @@ isolation
 -webkit-print-color-adjust [Inherited]
 -webkit-rtl-ordering [Inherited]
 -webkit-ruby-position [Inherited]
+#if defined(ENABLE_CSS_SCROLL_SNAP)
+-webkit-scroll-snap-points-x
+-webkit-scroll-snap-points-y
+-webkit-scroll-snap-type
+-webkit-scroll-snap-destination
+-webkit-scroll-snap-coordinate
+#endif
 -webkit-text-combine [Inherited]
 -epub-text-combine = -webkit-text-combine
 #if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT
index 40523ef..37d6a17 100644 (file)
@@ -989,6 +989,16 @@ at
 // closest-side
 // farthest-side
 
+#if defined(ENABLE_CSS_SCROLL_SNAP)
+// -webkit-scroll-snap-points-x
+// -webkit-scroll-snap-points-y
+elements
+
+// -webkit-scroll-snap-type
+mandatory
+proximity
+#endif
+
 // -webkit-region-fragment
 // auto
 break
diff --git a/Source/WebCore/css/LengthRepeat.h b/Source/WebCore/css/LengthRepeat.h
new file mode 100644 (file)
index 0000000..83028e9
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2014 Apple Inc. 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#ifndef LengthRepeat_h
+#define LengthRepeat_h
+
+#if ENABLE(CSS_SCROLL_SNAP)
+
+#include "CSSPrimitiveValue.h"
+#include <wtf/RefPtr.h>
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+class LengthRepeat : public RefCounted<LengthRepeat> {
+public:
+    static PassRefPtr<LengthRepeat> create(PassRefPtr<CSSPrimitiveValue> interval) { return adoptRef(new LengthRepeat(interval)); }
+
+    PassRefPtr<LengthRepeat> cloneForCSSOM() const { return create(interval()); }
+
+    CSSPrimitiveValue* interval() const { return m_interval.get(); }
+
+    void setInterval(PassRefPtr<CSSPrimitiveValue> interval) { m_interval = interval; }
+
+    bool equals(const LengthRepeat& other) const
+    {
+        return compareCSSValuePtr(m_interval, other.m_interval);
+    }
+
+    String cssText() const
+    {
+        return "repeat(" + interval()->cssText() + ")";
+    }
+
+private:
+    LengthRepeat(PassRefPtr<CSSPrimitiveValue> interval)
+        : m_interval(interval)
+    {
+    }
+
+    RefPtr<CSSPrimitiveValue> m_interval;
+};
+
+} // namespace WebCore
+
+#endif /* ENABLE(CSS_SCROLL_SNAP) */
+
+#endif // LengthRepeat_h
index ecd7e21..21b8643 100644 (file)
 #include "WebVTTElement.h"
 #endif
 
+#if ENABLE(CSS_SCROLL_SNAP)
+#include "LengthRepeat.h"
+#endif
+
 namespace WebCore {
 
 using namespace HTMLNames;
@@ -2843,6 +2847,88 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
             state.style()->setJustifySelf(*primitiveValue);
         return;
     }
+
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPropertyWebkitScrollSnapType: {
+        state.style()->setScrollSnapType(*primitiveValue);
+        return;
+    }
+    case CSSPropertyWebkitScrollSnapPointsX:
+    case CSSPropertyWebkitScrollSnapPointsY: {
+        RenderStyle* renderStyle = state.style();
+        if (id == CSSPropertyWebkitScrollSnapPointsX)
+            renderStyle->setScrollSnapHasRepeatX(false);
+        else
+            renderStyle->setScrollSnapHasRepeatY(false);
+
+        if (primitiveValue && primitiveValue->getValueID() == CSSValueElements) {
+            if (id == CSSPropertyWebkitScrollSnapPointsX)
+                renderStyle->setScrollSnapUsesElementsX(true);
+            else
+                renderStyle->setScrollSnapUsesElementsY(true);
+            return;
+        }
+        if (id == CSSPropertyWebkitScrollSnapPointsX)
+            renderStyle->setScrollSnapUsesElementsX(false);
+        else
+            renderStyle->setScrollSnapUsesElementsY(false);
+
+        Vector<Length> offsets;
+        for (CSSValueListIterator it(value); it.hasMore(); it.advance()) {
+            RefPtr<CSSValue> rawItemValue = it.value();
+            CSSPrimitiveValue* primitiveItemValue = toCSSPrimitiveValue(rawItemValue.get());
+            if (primitiveItemValue->isLengthRepeat()) {
+                LengthRepeat* lengthRepeat = primitiveItemValue->getLengthRepeatValue();
+                if (lengthRepeat && lengthRepeat->interval()) {
+                    if (id == CSSPropertyWebkitScrollSnapPointsX) {
+                        renderStyle->setScrollSnapRepeatOffsetX(lengthRepeat->interval()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData()));
+                        renderStyle->setScrollSnapHasRepeatX(true);
+                    } else {
+                        renderStyle->setScrollSnapRepeatOffsetY(lengthRepeat->interval()->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData()));
+                        renderStyle->setScrollSnapHasRepeatY(true);
+                    }
+                    break;
+                }
+            } else
+                offsets.append(primitiveItemValue->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData()));
+        }
+        if (id == CSSPropertyWebkitScrollSnapPointsX)
+            renderStyle->setScrollSnapOffsetsX(offsets);
+        else
+            renderStyle->setScrollSnapOffsetsY(offsets);
+        return;
+    }
+    case CSSPropertyWebkitScrollSnapDestination: {
+        CSSValueList& position = toCSSValueList(*value);
+        RefPtr<CSSValue> xCoordinate = position.item(0);
+        RefPtr<CSSPrimitiveValue> xCoordinateValue = toCSSPrimitiveValue(xCoordinate.get());
+        state.style()->setScrollSnapDestinationX(xCoordinateValue->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData()));
+
+        RefPtr<CSSValue> yCoordinate = position.item(1);
+        RefPtr<CSSPrimitiveValue> yCoordinateValue = toCSSPrimitiveValue(yCoordinate.get());
+        state.style()->setScrollSnapDestinationY(yCoordinateValue->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData()));
+        return;
+    }
+    case CSSPropertyWebkitScrollSnapCoordinate: {
+        Vector<SnapCoordinate> coordinates;
+        CSSValueList& valueList = toCSSValueList(*value);
+        size_t pointCount = valueList.length();
+        // Every x must be followed by a y.
+        if (pointCount % 2)
+            return;
+        pointCount /= 2;
+        coordinates.reserveCapacity(pointCount);
+        for (size_t i = 0; i < pointCount; i++) {
+            RefPtr<CSSValue> xCoordinate = valueList.item(i * 2);
+            RefPtr<CSSValue> yCoordinate = valueList.item((i * 2) + 1);
+            RefPtr<CSSPrimitiveValue> xCoordinateValue = toCSSPrimitiveValue(xCoordinate.get());
+            RefPtr<CSSPrimitiveValue> yCoordinateValue = toCSSPrimitiveValue(yCoordinate.get());
+            coordinates.append(SnapCoordinate(xCoordinateValue->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData()), yCoordinateValue->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData())));
+        }
+        state.style()->setScrollSnapCoordinates(coordinates);
+        return;
+    }
+#endif
     // These properties are aliased and DeprecatedStyleBuilder already applied the property on the prefixed version.
     case CSSPropertyTransitionDelay:
     case CSSPropertyTransitionDuration:
index 1600a61..06cc1b2 100644 (file)
 #include "StyleDashboardRegion.h"
 #endif
 
+#if ENABLE(CSS_SCROLL_SNAP)
+#include "StyleScrollSnapPoints.h"
+#endif
+
 #if ENABLE(IOS_TEXT_AUTOSIZING)
 #include "TextSizeAdjustment.h"
 #endif
@@ -1078,6 +1082,20 @@ public:
 
     LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxContain; }
     const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; }
+#if ENABLE(CSS_SCROLL_SNAP)
+    ScrollSnapType scrollSnapType() const { return static_cast<ScrollSnapType>(rareNonInheritedData->m_scrollSnapType); }
+    Vector<Length> scrollSnapOffsetsX() const { return rareNonInheritedData->m_scrollSnapPoints->offsetsX; }
+    Vector<Length> scrollSnapOffsetsY() const { return rareNonInheritedData->m_scrollSnapPoints->offsetsY; }
+    Length scrollSnapRepeatOffsetX() const { return rareNonInheritedData->m_scrollSnapPoints->repeatOffsetX; }
+    Length scrollSnapRepeatOffsetY() const { return rareNonInheritedData->m_scrollSnapPoints->repeatOffsetY; }
+    bool scrollSnapHasRepeatX() const { return rareNonInheritedData->m_scrollSnapPoints->hasRepeatX; }
+    bool scrollSnapHasRepeatY() const { return rareNonInheritedData->m_scrollSnapPoints->hasRepeatY; }
+    Length scrollSnapDestinationX() const { return rareNonInheritedData->m_scrollSnapPoints->destinationX; }
+    Length scrollSnapDestinationY() const { return rareNonInheritedData->m_scrollSnapPoints->destinationY; }
+    Vector<SnapCoordinate> scrollSnapCoordinates() const { return rareNonInheritedData->m_scrollSnapPoints->coordinates; }
+    bool scrollSnapUsesElementsX() const { return rareNonInheritedData->m_scrollSnapPoints->usesElementsX; }
+    bool scrollSnapUsesElementsY() const { return rareNonInheritedData->m_scrollSnapPoints->usesElementsY; }
+#endif
 #if ENABLE(TOUCH_EVENTS)
     Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
 #endif
@@ -1594,6 +1612,21 @@ public:
 
     void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); }
     void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
+#if ENABLE(CSS_SCROLL_SNAP)
+    void setScrollSnapType(ScrollSnapType type) { SET_VAR(rareNonInheritedData, m_scrollSnapType, type); }
+    void setScrollSnapOffsetsX(Vector<Length>& offsets) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, offsetsX, offsets); }
+    void setScrollSnapOffsetsY(Vector<Length>& offsets) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, offsetsY, offsets); }
+    void setScrollSnapRepeatOffsetX(Length repeatOffset) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, repeatOffsetX, repeatOffset); }
+    void setScrollSnapRepeatOffsetY(Length repeatOffset) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, repeatOffsetY, repeatOffset); }
+    void setScrollSnapHasRepeatX(bool hasRepeat) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, hasRepeatX, hasRepeat); }
+    void setScrollSnapHasRepeatY(bool hasRepeat) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, hasRepeatY, hasRepeat); }
+    void setScrollSnapDestinationX(Length destination) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, destinationX, destination); }
+    void setScrollSnapDestinationY(Length destination) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, destinationY, destination); }
+    void setScrollSnapCoordinates(Vector<SnapCoordinate>& coordinates) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, coordinates, coordinates); }
+    void setScrollSnapUsesElementsX(bool usesElements) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, usesElementsX, usesElements); }
+    void setScrollSnapUsesElementsY(bool usesElements) { SET_VAR(rareNonInheritedData.access()->m_scrollSnapPoints, usesElementsY, usesElements); }
+#endif
+
 #if ENABLE(TOUCH_EVENTS)
     void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); }
 #endif
@@ -1897,6 +1930,9 @@ public:
     static StyleImage* initialBorderImageSource() { return 0; }
     static StyleImage* initialMaskBoxImageSource() { return 0; }
     static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
+#if ENABLE(CSS_SCROLL_SNAP)
+    static ScrollSnapType initialScrollSnapType() { return ScrollSnapType::None; }
+#endif
 
 #if ENABLE(CSS_GRID_LAYOUT)
     // The initial value is 'none' for grid tracks.
index 4de435c..d2833a0 100644 (file)
@@ -575,6 +575,14 @@ enum Isolation { IsolationAuto, IsolationIsolate };
 // Fill, Stroke, ViewBox are just used for SVG.
 enum CSSBoxType { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, Fill, Stroke, ViewBox };
 
+#if ENABLE(CSS_SCROLL_SNAP)
+enum class ScrollSnapType {
+    None,
+    Proximity,
+    Mandatory
+};
+#endif
+
 } // namespace WebCore
 
 #endif // RenderStyleConstants_h
index feb95b2..28b7a8c 100644 (file)
@@ -56,3 +56,7 @@
 #include "StyleGridData.cpp"
 #include "StyleGridItemData.cpp"
 #endif
+
+#if ENABLE(CSS_SCROLL_SNAP)
+#include "StyleScrollSnapPoints.cpp"
+#endif
index c33b269..ee84ae2 100644 (file)
@@ -53,6 +53,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , m_grid(StyleGridData::create())
     , m_gridItem(StyleGridItemData::create())
 #endif
+#if ENABLE(CSS_SCROLL_SNAP)
+    , m_scrollSnapPoints(StyleScrollSnapPoints::create())
+#endif
     , m_mask(FillLayer(MaskFillLayer))
     , m_pageSize()
 #if ENABLE(CSS_SHAPES)
@@ -65,6 +68,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , m_order(RenderStyle::initialOrder())
     , m_flowThread(RenderStyle::initialFlowThread())
     , m_regionThread(RenderStyle::initialRegionThread())
+#if ENABLE(CSS_SCROLL_SNAP)
+    , m_scrollSnapType(RenderStyle::initialScrollSnapType())
+#endif
     , m_regionFragment(RenderStyle::initialRegionFragment())
     , m_regionBreakAfter(RenderStyle::NonInheritedFlags::initialPageBreak())
     , m_regionBreakBefore(RenderStyle::NonInheritedFlags::initialPageBreak())
@@ -118,6 +124,9 @@ inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn
     , m_grid(o.m_grid)
     , m_gridItem(o.m_gridItem)
 #endif
+#if ENABLE(CSS_SCROLL_SNAP)
+    , m_scrollSnapPoints(o.m_scrollSnapPoints)
+#endif
     , m_content(o.m_content ? o.m_content->clone() : nullptr)
     , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
     , m_boxShadow(o.m_boxShadow ? std::make_unique<ShadowData>(*o.m_boxShadow) : nullptr)
@@ -144,6 +153,9 @@ inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn
     , m_order(o.m_order)
     , m_flowThread(o.m_flowThread)
     , m_regionThread(o.m_regionThread)
+#if ENABLE(CSS_SCROLL_SNAP)
+    , m_scrollSnapType(o.m_scrollSnapType)
+#endif
     , m_regionFragment(o.m_regionFragment)
     , m_regionBreakAfter(o.m_regionBreakAfter)
     , m_regionBreakBefore(o.m_regionBreakBefore)
@@ -208,6 +220,9 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && m_grid == o.m_grid
         && m_gridItem == o.m_gridItem
 #endif
+#if ENABLE(CSS_SCROLL_SNAP)
+        && m_scrollSnapPoints == o.m_scrollSnapPoints
+#endif
         && contentDataEquivalent(o)
         && counterDataEquivalent(o)
         && shadowDataEquivalent(o)
@@ -253,6 +268,9 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && m_borderFit == o.m_borderFit
         && m_textCombine == o.m_textCombine
         && m_textDecorationStyle == o.m_textDecorationStyle
+#if ENABLE(CSS_SCROLL_SNAP)
+        && m_scrollSnapType == o.m_scrollSnapType
+#endif
         && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation
 #if ENABLE(CSS_COMPOSITING)
         && m_effectiveBlendMode == o.m_effectiveBlendMode
index ff585eb..e536de4 100644 (file)
@@ -56,6 +56,9 @@ class StyleMultiColData;
 class StyleReflection;
 class StyleResolver;
 class StyleTransformData;
+#if ENABLE(CSS_SCROLL_SNAP)
+class StyleScrollSnapPoints;
+#endif
 
 class ContentData;
 struct LengthSize;
@@ -124,6 +127,10 @@ public:
     DataRef<StyleGridItemData> m_gridItem;
 #endif
 
+#if ENABLE(CSS_SCROLL_SNAP)
+    DataRef<StyleScrollSnapPoints> m_scrollSnapPoints;
+#endif
+
     std::unique_ptr<ContentData> m_content;
     std::unique_ptr<CounterDirectiveMap> m_counterDirectives;
     String m_altText;
@@ -161,6 +168,11 @@ public:
 
     AtomicString m_flowThread;
     AtomicString m_regionThread;
+
+#if ENABLE(CSS_SCROLL_SNAP)
+    ScrollSnapType m_scrollSnapType; // ScrollSnapType
+#endif
+
     unsigned m_regionFragment : 1; // RegionFragment
 
     unsigned m_regionBreakAfter : 2; // EPageBreak
diff --git a/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp b/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp
new file mode 100644 (file)
index 0000000..3c842a5
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2014 Apple Inc. 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. AND ITS CONTRIBUTORS ``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 ITS 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 "StyleScrollSnapPoints.h"
+
+#if ENABLE(CSS_SCROLL_SNAP)
+
+namespace WebCore {
+
+StyleScrollSnapPoints::StyleScrollSnapPoints()
+    : repeatOffsetX(StyleScrollSnapPoints::defaultRepeatOffset())
+    , repeatOffsetY(StyleScrollSnapPoints::defaultRepeatOffset())
+    , destinationX(StyleScrollSnapPoints::defaultDestinationOffset())
+    , destinationY(StyleScrollSnapPoints::defaultDestinationOffset())
+    , hasRepeatX(true)
+    , hasRepeatY(true)
+    , usesElementsX(false)
+    , usesElementsY(false)
+{
+}
+
+inline StyleScrollSnapPoints::StyleScrollSnapPoints(const StyleScrollSnapPoints& o)
+    : repeatOffsetX(o.repeatOffsetX)
+    , repeatOffsetY(o.repeatOffsetY)
+    , destinationX(o.destinationX)
+    , destinationY(o.destinationY)
+    , hasRepeatX(o.hasRepeatX)
+    , hasRepeatY(o.hasRepeatY)
+    , usesElementsX(o.usesElementsX)
+    , usesElementsY(o.usesElementsY)
+    , offsetsX(o.offsetsX)
+    , offsetsY(o.offsetsY)
+    , coordinates(o.coordinates)
+{
+}
+
+PassRef<StyleScrollSnapPoints> StyleScrollSnapPoints::copy() const
+{
+    return adoptRef(*new StyleScrollSnapPoints(*this));
+}
+
+bool StyleScrollSnapPoints::operator==(const StyleScrollSnapPoints& o) const
+{
+    return (offsetsX == o.offsetsX
+        && offsetsY == o.offsetsY
+        && repeatOffsetX == o.repeatOffsetX
+        && hasRepeatX == o.hasRepeatX
+        && hasRepeatY == o.hasRepeatY
+        && destinationX == o.destinationX
+        && destinationY == o.destinationY
+        && coordinates == o.coordinates
+        && usesElementsX == o.usesElementsX
+        && usesElementsY == o.usesElementsY);
+}
+    
+} // namespace WebCore
+
+#endif /* ENABLE(CSS_SCROLL_SNAP) */
diff --git a/Source/WebCore/rendering/style/StyleScrollSnapPoints.h b/Source/WebCore/rendering/style/StyleScrollSnapPoints.h
new file mode 100644 (file)
index 0000000..22ddce3
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2014 Apple Inc. 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#ifndef StyleScrollSnapPoints_h
+#define StyleScrollSnapPoints_h
+
+#if ENABLE(CSS_SCROLL_SNAP)
+
+#include "Length.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+typedef std::pair<Length, Length> SnapCoordinate;
+
+class StyleScrollSnapPoints : public RefCounted<StyleScrollSnapPoints> {
+public:
+    static PassRef<StyleScrollSnapPoints> create() { return adoptRef(*new StyleScrollSnapPoints); }
+    
+    static Length defaultRepeatOffset()
+    {
+        return Length(100, Percent);
+    }
+    
+    static Length defaultDestinationOffset()
+    {
+        return Length(0, Fixed);
+    }
+
+    PassRef<StyleScrollSnapPoints> copy() const;
+    
+    bool operator==(const StyleScrollSnapPoints&) const;
+    bool operator!=(const StyleScrollSnapPoints& o) const
+    {
+        return !(*this == o);
+    }
+    
+    Length repeatOffsetX;
+    Length repeatOffsetY;
+    Length destinationX;
+    Length destinationY;
+    bool hasRepeatX;
+    bool hasRepeatY;
+    bool usesElementsX;
+    bool usesElementsY;
+    Vector<Length> offsetsX;
+    Vector<Length> offsetsY;
+    Vector<SnapCoordinate> coordinates;
+    
+private:
+    StyleScrollSnapPoints();
+    StyleScrollSnapPoints(const StyleScrollSnapPoints&);
+};
+
+} // namespace WebCore
+
+#endif /* ENABLE(CSS_SCROLL_SNAP) */
+
+#endif // StyleScrollSnapPoints_h
index 9f4021c..7ec639e 100644 (file)
@@ -1,3 +1,12 @@
+2014-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Implement parsing for CSS scroll snap points
+        https://bugs.webkit.org/show_bug.cgi?id=134301
+
+        Reviewed by Dean Jackson.
+
+        * UserInterface/Models/CSSKeywordCompletions.js: Added snap point property keywords, such as mandatory, proximity, elements, and repeat.
+
 2014-08-06  Brian J. Burg  <burg@cs.washington.edu>
 
         REGRESSION(r172094): tests fail because Inspector test harness does not include UIString
index 7c9361b..8c995b5 100644 (file)
@@ -904,6 +904,18 @@ WebInspector.CSSKeywordCompletions._propertyKeywordMap = {
         "none", "checkbox", "radio", "push-button", "square-button", "button", "button-bevel", "default-button", "inner-spin-button", "-webkit-input-speech-button", "listbox", "listitem", "media-enter-fullscreen-button", "media-exit-fullscreen-button", "media-fullscreen-volume-slider", "media-fullscreen-volume-slider-thumb", "media-mute-button", "media-play-button", "media-overlay-play-button", "media-seek-back-button", "media-seek-forward-button", "media-rewind-button", "media-return-to-realtime-button", "media-toggle-closed-captions-button", "media-slider", "media-sliderthumb", "media-volume-slider-container", "media-volume-slider", "media-volume-sliderthumb", "media-volume-slider-mute-button", "media-controls-background", "media-controls-fullscreen-background", "media-current-time-display", "media-time-remaining-display", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "meter", "progress-bar", "progress-bar-value", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "caret", "searchfield", "searchfield-decoration", "searchfield-results-decoration", "searchfield-results-button", "searchfield-cancel-button", "snapshotted-plugin-overlay", "textfield", "relevancy-level-indicator", "continuous-capacity-level-indicator", "discrete-capacity-level-indicator", "rating-level-indicator", "textarea"
     ],
     */
+    "-webkit-scroll-snap-type": [
+        "mandatory", "proximity", "none"
+    ],
+    "-webkit-scroll-snap-points-x": [
+        "elements", "repeat"
+    ],
+    "-webkit-scroll-snap-points-y": [
+        "elements", "repeat"
+    ],
+    "-webkit-scroll-snap-coordinate": [
+        "none"
+    ],
 
     // iOS Properties
     "-webkit-text-size-adjust": [
index 35df248..b3b4c6f 100644 (file)
@@ -1,3 +1,12 @@
+2014-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Implement parsing for CSS scroll snap points
+        https://bugs.webkit.org/show_bug.cgi?id=134301
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP
+
 2014-08-06  Alexey Proskuryakov  <ap@apple.com>
 
         REGRESSION (WebKit2): iOS Safari default encoding doesn't follow system language
index 994f0b2..d75244d 100644 (file)
@@ -186,6 +186,8 @@ ENABLE_REMOTE_INSPECTOR_macosx_101000 = ENABLE_REMOTE_INSPECTOR;
 ENABLE_RESOLUTION_MEDIA_QUERY = ;
 ENABLE_SCRIPTED_SPEECH = ;
 ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS;
+ENABLE_CSS_SCROLL_SNAP = $(ENABLE_CSS_SCROLL_SNAP_$(PLATFORM_NAME));
+ENABLE_CSS_SCROLL_SNAP_macosx = ENABLE_CSS_SCROLL_SNAP;
 ENABLE_SPEECH_SYNTHESIS = $(ENABLE_SPEECH_SYNTHESIS_$(PLATFORM_NAME));
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
@@ -248,4 +250,4 @@ ENABLE_FTL_JIT_iphonesimulator = ;
 
 ENABLE_LLINT_C_LOOP = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LONG_MOUSE_PRESS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(FEATURE_DEFINES_$(PLATFORM_NAME));
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LONG_MOUSE_PRESS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHARED_WORKERS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(FEATURE_DEFINES_$(PLATFORM_NAME));
index cfd7ef4..7bd4fb7 100644 (file)
@@ -1,3 +1,12 @@
+2014-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Implement parsing for CSS scroll snap points
+        https://bugs.webkit.org/show_bug.cgi?id=134301
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_CSS_SCROLL_SNAP
+
 2014-08-06  Andy Estes  <aestes@apple.com>
 
         [iOS] Subresources referenced in converted QuickLook documents sometimes fail to load
index 994f0b2..d75244d 100644 (file)
@@ -186,6 +186,8 @@ ENABLE_REMOTE_INSPECTOR_macosx_101000 = ENABLE_REMOTE_INSPECTOR;
 ENABLE_RESOLUTION_MEDIA_QUERY = ;
 ENABLE_SCRIPTED_SPEECH = ;
 ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS;
+ENABLE_CSS_SCROLL_SNAP = $(ENABLE_CSS_SCROLL_SNAP_$(PLATFORM_NAME));
+ENABLE_CSS_SCROLL_SNAP_macosx = ENABLE_CSS_SCROLL_SNAP;
 ENABLE_SPEECH_SYNTHESIS = $(ENABLE_SPEECH_SYNTHESIS_$(PLATFORM_NAME));
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE;
@@ -248,4 +250,4 @@ ENABLE_FTL_JIT_iphonesimulator = ;
 
 ENABLE_LLINT_C_LOOP = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LONG_MOUSE_PRESS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(FEATURE_DEFINES_$(PLATFORM_NAME));
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LONG_MOUSE_PRESS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHARED_WORKERS) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(FEATURE_DEFINES_$(PLATFORM_NAME));