<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[173659] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/173659">173659</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-09-16 08:58:12 -0700 (Tue, 16 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Source/WebCore:
Scroll snap properties don't handle inherit and initial propertly.
https://bugs.webkit.org/show_bug.cgi?id=136643
Reviewed by Beth Dakin.
Restructured scroll snap code both to handle inherit and initial, and to reduce the
total code size a bit, fixing a few minor bugs along the way. Updated the regression
tests to cover the new parts.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::addValuesForNamedGridLinesAtIndex): Use a modern for loop.
(WebCore::scrollSnapDestination): Changed to take a LengthSize. Also streamlined.
(WebCore::scrollSnapPoints): Changed to to take a ScrollSnapPoints. Also streamlined and
added code to handle the "uses elements" case; serialize that as an identifier, not the
string "elements", fixing a minor bug.
(WebCore::scrollSnapCoordinates): Changed to take a Vector<LengthSize>. Also streamlined
and added code to handle the empty vector case; serialize that as an identifier, not the
string "none", fixing a minor bug.
(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword): Use nullptr.
(WebCore::counterToCSSValue): Use nullptr.
(WebCore::ComputedStyleExtractor::styledNode): Use nullptr.
(WebCore::ComputedStyleExtractor::propertyValue): Use nullptr. Moved CSS_SCROLL_SNAP
to a more appropriate section of the switch statement. Made it just call through to
the functions above in a more straightforward way.
(WebCore::CSSComputedStyleDeclaration::getPropertyValue): Reversed logic to use early
return and to call emptyString.
(WebCore::CSSComputedStyleDeclaration::item): Use emptyString.
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand): Use nullptr.
(WebCore::CSSComputedStyleDeclaration::parentRule): Use nullptr.
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use nullptr.
(WebCore::CSSComputedStyleDeclaration::getPropertyPriority): Use emptyString.
(WebCore::CSSComputedStyleDeclaration::getPropertyShorthand): Use emptyString.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyMarqueeIncrement::applyValue): Use the switch statement for the
invalid value as well as for the valid values, rather than a separate if statement.
Call convertToLength directly rather than through a StyleResolver static member function.
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValue): Fixed a formatting mistake.
* css/StyleResolver.cpp:
(WebCore::convertToIntLength): Made this function local to this file instead of a
static member function.
(WebCore::convertToFloatLength): Ditto.
(WebCore::StyleResolver::parseSnapCoordinate): Added. Used to keep snap point parsing
code small.
(WebCore::StyleResolver::parseSnapCoordinatePair): Ditto.
(WebCore::StyleResolver::parseSnapPoints): Added. Parses an entire snap points property.
(WebCore::StyleResolver::applyProperty): Removed various bits of redundant code that
were not using the primitiveValue value already in a local variable. Added the
HANDLE_INHERIT_AND_INITIAL to all the scroll snap properties and updated since the
RenderStyle structure now more closely matches the CSS properties.
* css/StyleResolver.h: Updated for above changes, and removed a redundant "private:".
* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::appendChildSnapOffsets): Use auto& instead of SnapCoordinate since that type
is now gone. Updated since coordinates are now LengthSize.
(WebCore::updateFromStyle): Changed to take a reference instead of a pointer and
also to fetch the data from RenderStyle in a new way that more closely matches the
CSS properties.
(WebCore::updateSnapOffsetsForScrollableArea): Ditto. Also moved some memory allocation
inside if statements so we don't wastefully allocate and destroy.
* rendering/style/RenderStyle.cpp: Added an include of StyleScrollSnapPoints.h now
that the header doesn't include them. Moved the conditional includes out of the main
include paragraph (even though I don't think conditional includes are usually a good
idea).
(WebCore::RenderStyle::initialScrollSnapPointsX): Added.
(WebCore::RenderStyle::initialScrollSnapPointsY): Added.
(WebCore::RenderStyle::initialScrollSnapDestination): Added.
(WebCore::RenderStyle::initialScrollSnapCoordinates): Added.
(WebCore::RenderStyle::scrollSnapPointsX): Added.
(WebCore::RenderStyle::scrollSnapPointsY): Added.
(WebCore::RenderStyle::scrollSnapDestination): Added.
(WebCore::RenderStyle::scrollSnapCoordinates): Added.
(WebCore::RenderStyle::setScrollSnapPointsX): Added.
(WebCore::RenderStyle::setScrollSnapPointsY): Added.
(WebCore::RenderStyle::setScrollSnapDestination): Added.
(WebCore::RenderStyle::setScrollSnapCoordinates): Added.
* rendering/style/RenderStyle.h: Replaced the include of StyleScrollSnapPoints.h with
a forward declaration of ScrollSnapPoints. Removed getters and setters for the old
style properties and replaced them with new ones that match the CSS properties more
closely. Tweaked formatting a bit. Added initial value functions for the the scroll snap
properties.
* rendering/style/StyleRareNonInheritedData.cpp: Added include of StyleScrollSnapPoints.h
now that RenderStyle.h doesn't include it.
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated since
m_scrollSnapType is now unsigned instead of ScrollSnapType.
* rendering/style/StyleRareNonInheritedData.h: Fixed type of m_scrollSnapType to be
unsigned instead of ScrollSnapType. This should have been causing problems on Windows,
but I think we got lucky and had no detectable problems.
* rendering/style/StyleScrollSnapPoints.cpp:
(WebCore::ScrollSnapPoints::ScrollSnapPoints): Added.
(WebCore::operator==): Added overloads for both ScrollSnapPoints and also for
StyleScrollSnapPoints; using a free function for both since both have public data.
(WebCore::defaultScrollSnapDestination): Added, replaces a static member function.
(WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Updated both the default
constructor and the copy constructor for the new design.
* rendering/style/StyleScrollSnapPoints.h: Added a ScrollSnapPoints struct for the
type of the snap-points-x and snap-points-y CSS properties. Changed the data members
of StyleScrollSnapPoints to match the various CSS properties rather than breaking
out all the data into separate data members.
(WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Deleted. Replaced by the
default constructor for ScrollSnapPoints.
(WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Deleted. Replaced by
a function inside the .cpp file.
LayoutTests:
Scroll snap properties do not handle inherit and initial properly.
https://bugs.webkit.org/show_bug.cgi?id=136643
Reviewed by Beth Dakin.
* css3/scroll-snap/scroll-snap-property-computed-style-expected.txt: Added
expected passing results from new tests.
* css3/scroll-snap/scroll-snap-property-computed-style.js: Added new test
cases that cover inherit and initial. Before, these would crash or fail.
* css3/scroll-snap/scroll-snap-property-parsing-expected.txt: Added expected
passing results from new tests, and also updated to expect pass rather than
fail for the tests that had incorrect expected results.
* css3/scroll-snap/scroll-snap-property-parsing.js: Added new test cases that
cover inherit and initial. Also updated expected results for certain pixel
repeat cases that were incorrect.
* platform/mac/TestExpectations: Fixed an unrelated syntax error in this file.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscss3scrollsnapscrollsnappropertycomputedstyleexpectedtxt">trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3scrollsnapscrollsnappropertycomputedstylejs">trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.js</a></li>
<li><a href="#trunkLayoutTestscss3scrollsnapscrollsnappropertyparsingexpectedtxt">trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3scrollsnapscrollsnappropertyparsingjs">trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorecssPropertySetCSSStyleDeclarationcpp">trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolverh">trunk/Source/WebCore/css/StyleResolver.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAxisScrollSnapOffsetscpp">trunk/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStylecpp">trunk/Source/WebCore/rendering/style/RenderStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatacpp">trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatah">trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleScrollSnapPointscpp">trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleScrollSnapPointsh">trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/LayoutTests/ChangeLog        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-09-14 Darin Adler <darin@apple.com>
+
+ Scroll snap properties do not handle inherit and initial properly.
+ https://bugs.webkit.org/show_bug.cgi?id=136643
+
+ Reviewed by Beth Dakin.
+
+ * css3/scroll-snap/scroll-snap-property-computed-style-expected.txt: Added
+ expected passing results from new tests.
+ * css3/scroll-snap/scroll-snap-property-computed-style.js: Added new test
+ cases that cover inherit and initial. Before, these would crash or fail.
+
+ * css3/scroll-snap/scroll-snap-property-parsing-expected.txt: Added expected
+ passing results from new tests, and also updated to expect pass rather than
+ fail for the tests that had incorrect expected results.
+
+ * css3/scroll-snap/scroll-snap-property-parsing.js: Added new test cases that
+ cover inherit and initial. Also updated expected results for certain pixel
+ repeat cases that were incorrect.
+
+ * platform/mac/TestExpectations: Fixed an unrelated syntax error in this file.
+
</ins><span class="cx"> 2014-09-16 Youenn Fablet <youenn.fablet@crf.canon.fr>
</span><span class="cx">
</span><span class="cx"> [GStreamer] http/tests/media/video-auth.html is failing
</span></span></pre></div>
<a id="trunkLayoutTestscss3scrollsnapscrollsnappropertycomputedstyleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style-expected.txt (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style-expected.txt        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style-expected.txt        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -34,12 +34,27 @@
</span><span class="cx"> mismatched x coordinate : 50% 100px 75%
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is 'none'
</span><span class="cx">
</span><ins>+inherited type : inherit
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-type') is 'none'
+
+initial type : initial
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-type') is 'none'
+
+none type : none
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-type') is 'none'
+
</ins><span class="cx"> mandatory type : mandatory
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-type') is 'mandatory'
</span><span class="cx">
</span><span class="cx"> proximity type : proximity
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-type') is 'proximity'
</span><span class="cx">
</span><ins>+inherited points along x axis : inherit
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(100%)'
+
+initial points along x axis : initial
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'repeat(100%)'
+
</ins><span class="cx"> element points along x axis : elements
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is 'elements'
</span><span class="cx">
</span><span class="lines">@@ -67,6 +82,12 @@
</span><span class="cx"> pixel points along x axis with pixel repeat : 100px repeat(42px)
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-x') is '100px repeat(42px)'
</span><span class="cx">
</span><ins>+inherited points along y axis : inherit
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'repeat(100%)'
+
+initial points along y axis : initial
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'repeat(100%)'
+
</ins><span class="cx"> element points along y axis : elements
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is 'elements'
</span><span class="cx">
</span><span class="lines">@@ -94,6 +115,12 @@
</span><span class="cx"> pixel points along y axis with pixel repeat : 100px repeat(42px)
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-points-y') is '100px repeat(42px)'
</span><span class="cx">
</span><ins>+inherited destination : inherit
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '0px 0px'
+
+initial destination : initial
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '0px 0px'
+
</ins><span class="cx"> pixel/pixel destination : 10px 50px
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '10px 50px'
</span><span class="cx">
</span><span class="lines">@@ -106,6 +133,15 @@
</span><span class="cx"> percentage/percentage destination : 5% 100%
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-destination') is '5% 100%'
</span><span class="cx">
</span><ins>+inherited coordinate : inherit
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is 'none'
+
+initial coordinate : initial
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is 'none'
+
+no coordinate : none
+PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is 'none'
+
</ins><span class="cx"> single pixel coordinate : 50px 100px
</span><span class="cx"> PASS window.getComputedStyle(document.body).getPropertyValue('-webkit-scroll-snap-coordinate') is '50px 100px'
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestscss3scrollsnapscrollsnappropertycomputedstylejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.js (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.js        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-computed-style.js        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -27,9 +27,14 @@
</span><span class="cx"> testComputedScrollSnapRule("invalid coordinates", "coordinate", "ben bitdiddle", "none")
</span><span class="cx"> testComputedScrollSnapRule("mismatched x coordinate", "coordinate", "50% 100px 75%", "none");
</span><span class="cx">
</span><ins>+testComputedScrollSnapRule("inherited type", "type", "inherit", "none");
+testComputedScrollSnapRule("initial type", "type", "initial", "none");
+testComputedScrollSnapRule("none type", "type", "none", "none");
</ins><span class="cx"> testComputedScrollSnapRule("mandatory type", "type", "mandatory", "mandatory");
</span><span class="cx"> testComputedScrollSnapRule("proximity type", "type", "proximity", "proximity");
</span><span class="cx">
</span><ins>+testComputedScrollSnapRule("inherited points along x axis", "points-x", "inherit", "repeat(100%)");
+testComputedScrollSnapRule("initial points along x axis", "points-x", "initial", "repeat(100%)");
</ins><span class="cx"> testComputedScrollSnapRule("element points along x axis", "points-x", "elements", "elements");
</span><span class="cx"> testComputedScrollSnapRule("percentage points along x axis", "points-x", "100% 50%", "100% 50%");
</span><span class="cx"> testComputedScrollSnapRule("pixel points along x axis", "points-x", "100px 50px", "100px 50px");
</span><span class="lines">@@ -40,6 +45,8 @@
</span><span class="cx"> testComputedScrollSnapRule("percentage points along x axis with pixel repeat", "points-x", "100% 50% repeat(40px)", "100% 50% repeat(40px)");
</span><span class="cx"> testComputedScrollSnapRule("pixel points along x axis with pixel repeat", "points-x", "100px repeat(42px)", "100px repeat(42px)");
</span><span class="cx">
</span><ins>+testComputedScrollSnapRule("inherited points along y axis", "points-y", "inherit", "repeat(100%)");
+testComputedScrollSnapRule("initial points along y axis", "points-y", "initial", "repeat(100%)");
</ins><span class="cx"> testComputedScrollSnapRule("element points along y axis", "points-y", "elements", "elements");
</span><span class="cx"> testComputedScrollSnapRule("percentage points along y axis", "points-y", "100% 50%", "100% 50%");
</span><span class="cx"> testComputedScrollSnapRule("pixel points along y axis", "points-y", "100px 50px", "100px 50px");
</span><span class="lines">@@ -50,11 +57,16 @@
</span><span class="cx"> testComputedScrollSnapRule("percentage points along y axis with pixel repeat", "points-y", "100% 50% repeat(40px)", "100% 50% repeat(40px)");
</span><span class="cx"> testComputedScrollSnapRule("pixel points along y axis with pixel repeat", "points-y", "100px repeat(42px)", "100px repeat(42px)");
</span><span class="cx">
</span><ins>+testComputedScrollSnapRule("inherited destination", "destination", "inherit", "0px 0px");
+testComputedScrollSnapRule("initial destination", "destination", "initial", "0px 0px");
</ins><span class="cx"> testComputedScrollSnapRule("pixel/pixel destination", "destination", "10px 50px", "10px 50px");
</span><span class="cx"> testComputedScrollSnapRule("pixel/percentage destination", "destination", "20px 40%", "20px 40%");
</span><span class="cx"> testComputedScrollSnapRule("percentage/pixel destination", "destination", "0% 0px", "0% 0px");
</span><span class="cx"> testComputedScrollSnapRule("percentage/percentage destination", "destination", "5% 100%", "5% 100%");
</span><span class="cx">
</span><ins>+testComputedScrollSnapRule("inherited coordinate", "coordinate", "inherit", "none");
+testComputedScrollSnapRule("initial coordinate", "coordinate", "initial", "none");
+testComputedScrollSnapRule("no coordinate", "coordinate", "none", "none");
</ins><span class="cx"> testComputedScrollSnapRule("single pixel coordinate", "coordinate", "50px 100px", "50px 100px");
</span><span class="cx"> testComputedScrollSnapRule("single percentage coordinate", "coordinate", "50% 100%", "50% 100%");
</span><span class="cx"> testComputedScrollSnapRule("multiple pixel coordinates", "coordinate", "50px 100px 150px 100px 200px 100px", "50px 100px, 150px 100px, 200px 100px");
</span></span></pre></div>
<a id="trunkLayoutTestscss3scrollsnapscrollsnappropertyparsingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing-expected.txt (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing-expected.txt        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing-expected.txt        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -4,6 +4,56 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><ins>+inherited type : inherit
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-type') is 'inherit'
+
+initial type : initial
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-type') is 'initial'
+
+inherited points-x : inherit
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is 'inherit'
+
+initial points-x : initial
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is 'initial'
+
+inherited points-y : inherit
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is 'inherit'
+
+initial points-y : initial
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-y') is 'initial'
+
+inherited destination : inherit
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-destination') is 'inherit'
+
+initial destination : initial
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-destination') is 'initial'
+
+inherited coordinate : inherit
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-coordinate') is 'inherit'
+
+initial coordinate : initial
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('-webkit-scroll-snap-coordinate') is 'initial'
+
</ins><span class="cx"> mandatory type : mandatory
</span><span class="cx"> PASS cssRule.type is 1
</span><span class="cx"> PASS declaration.length is 1
</span><span class="lines">@@ -107,22 +157,22 @@
</span><span class="cx"> em points along x axis with pixel repeat : 100em repeat(42em)
</span><span class="cx"> PASS cssRule.type is 1
</span><span class="cx"> PASS declaration.length is 1
</span><del>-FAIL declaration.getPropertyValue('-webkit-scroll-snap-points-x') should be 100em repeat 42em. Was 100em repeat(42em).
</del><ins>+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100em repeat(42em)'
</ins><span class="cx">
</span><span class="cx"> mm along x axis with pixel repeat : 100mm repeat(42mm)
</span><span class="cx"> PASS cssRule.type is 1
</span><span class="cx"> PASS declaration.length is 1
</span><del>-FAIL declaration.getPropertyValue('-webkit-scroll-snap-points-x') should be 100mm repeat 42mm. Was 100mm repeat(42mm).
</del><ins>+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100mm repeat(42mm)'
</ins><span class="cx">
</span><span class="cx"> in along x axis with pixel repeat : 100in repeat(42in)
</span><span class="cx"> PASS cssRule.type is 1
</span><span class="cx"> PASS declaration.length is 1
</span><del>-FAIL declaration.getPropertyValue('-webkit-scroll-snap-points-x') should be 100in repeat 42in. Was 100in repeat(42in).
</del><ins>+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100in repeat(42in)'
</ins><span class="cx">
</span><span class="cx"> pt along x axis with pixel repeat : 100pt repeat(42pt)
</span><span class="cx"> PASS cssRule.type is 1
</span><span class="cx"> PASS declaration.length is 1
</span><del>-FAIL declaration.getPropertyValue('-webkit-scroll-snap-points-x') should be 100pt repeat 42pt. Was 100pt repeat(42pt).
</del><ins>+PASS declaration.getPropertyValue('-webkit-scroll-snap-points-x') is '100pt repeat(42pt)'
</ins><span class="cx">
</span><span class="cx"> pixel/pixel destination : 10px 50px
</span><span class="cx"> PASS cssRule.type is 1
</span></span></pre></div>
<a id="trunkLayoutTestscss3scrollsnapscrollsnappropertyparsingjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.js (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.js        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/LayoutTests/css3/scroll-snap/scroll-snap-property-parsing.js        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -20,6 +20,21 @@
</span><span class="cx"> shouldBe("declaration.getPropertyValue('-webkit-scroll-snap-" + snapProperty + "')", "'" + expectedValue + "'");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+testScrollSnapRule("inherited type", "type", "inherit", "inherit");
+testScrollSnapRule("initial type", "type", "initial", "initial");
+
+testScrollSnapRule("inherited points-x", "points-x", "inherit", "inherit");
+testScrollSnapRule("initial points-x", "points-x", "initial", "initial");
+
+testScrollSnapRule("inherited points-y", "points-y", "inherit", "inherit");
+testScrollSnapRule("initial points-y", "points-y", "initial", "initial");
+
+testScrollSnapRule("inherited destination", "destination", "inherit", "inherit");
+testScrollSnapRule("initial destination", "destination", "initial", "initial");
+
+testScrollSnapRule("inherited coordinate", "coordinate", "inherit", "inherit");
+testScrollSnapRule("initial coordinate", "coordinate", "initial", "initial");
+
</ins><span class="cx"> testScrollSnapRule("mandatory type", "type", "mandatory", "mandatory");
</span><span class="cx"> testScrollSnapRule("proximity type", "type", "proximity", "proximity");
</span><span class="cx">
</span><span class="lines">@@ -43,10 +58,10 @@
</span><span class="cx"> testScrollSnapRule("percentage points along y axis with pixel repeat", "points-y", "100% 50% repeat(40px)", "100% 50% repeat(40px)");
</span><span class="cx"> testScrollSnapRule("pixel points along y axis with pixel repeat", "points-y", "100px repeat(42px)", "100px repeat(42px)");
</span><span class="cx">
</span><del>-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");
</del><ins>+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)");
</ins><span class="cx">
</span><span class="cx"> testScrollSnapRule("pixel/pixel destination", "destination", "10px 50px", "10px 50px");
</span><span class="cx"> testScrollSnapRule("pixel/percentage destination", "destination", "20px 40%", "20px 40%");
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/ChangeLog        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -1,3 +1,119 @@
</span><ins>+2014-09-14 Darin Adler <darin@apple.com>
+
+ Scroll snap properties don't handle inherit and initial propertly.
+ https://bugs.webkit.org/show_bug.cgi?id=136643
+
+ Reviewed by Beth Dakin.
+
+ Restructured scroll snap code both to handle inherit and initial, and to reduce the
+ total code size a bit, fixing a few minor bugs along the way. Updated the regression
+ tests to cover the new parts.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::addValuesForNamedGridLinesAtIndex): Use a modern for loop.
+ (WebCore::scrollSnapDestination): Changed to take a LengthSize. Also streamlined.
+ (WebCore::scrollSnapPoints): Changed to to take a ScrollSnapPoints. Also streamlined and
+ added code to handle the "uses elements" case; serialize that as an identifier, not the
+ string "elements", fixing a minor bug.
+ (WebCore::scrollSnapCoordinates): Changed to take a Vector<LengthSize>. Also streamlined
+ and added code to handle the empty vector case; serialize that as an identifier, not the
+ string "none", fixing a minor bug.
+ (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword): Use nullptr.
+ (WebCore::counterToCSSValue): Use nullptr.
+ (WebCore::ComputedStyleExtractor::styledNode): Use nullptr.
+ (WebCore::ComputedStyleExtractor::propertyValue): Use nullptr. Moved CSS_SCROLL_SNAP
+ to a more appropriate section of the switch statement. Made it just call through to
+ the functions above in a more straightforward way.
+ (WebCore::CSSComputedStyleDeclaration::getPropertyValue): Reversed logic to use early
+ return and to call emptyString.
+ (WebCore::CSSComputedStyleDeclaration::item): Use emptyString.
+ (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand): Use nullptr.
+ (WebCore::CSSComputedStyleDeclaration::parentRule): Use nullptr.
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use nullptr.
+ (WebCore::CSSComputedStyleDeclaration::getPropertyPriority): Use emptyString.
+ (WebCore::CSSComputedStyleDeclaration::getPropertyShorthand): Use emptyString.
+
+ * css/DeprecatedStyleBuilder.cpp:
+ (WebCore::ApplyPropertyMarqueeIncrement::applyValue): Use the switch statement for the
+ invalid value as well as for the valid values, rather than a separate if statement.
+ Call convertToLength directly rather than through a StyleResolver static member function.
+
+ * css/PropertySetCSSStyleDeclaration.cpp:
+ (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue): Fixed a formatting mistake.
+
+ * css/StyleResolver.cpp:
+ (WebCore::convertToIntLength): Made this function local to this file instead of a
+ static member function.
+ (WebCore::convertToFloatLength): Ditto.
+ (WebCore::StyleResolver::parseSnapCoordinate): Added. Used to keep snap point parsing
+ code small.
+ (WebCore::StyleResolver::parseSnapCoordinatePair): Ditto.
+ (WebCore::StyleResolver::parseSnapPoints): Added. Parses an entire snap points property.
+ (WebCore::StyleResolver::applyProperty): Removed various bits of redundant code that
+ were not using the primitiveValue value already in a local variable. Added the
+ HANDLE_INHERIT_AND_INITIAL to all the scroll snap properties and updated since the
+ RenderStyle structure now more closely matches the CSS properties.
+
+ * css/StyleResolver.h: Updated for above changes, and removed a redundant "private:".
+
+ * page/scrolling/AxisScrollSnapOffsets.cpp:
+ (WebCore::appendChildSnapOffsets): Use auto& instead of SnapCoordinate since that type
+ is now gone. Updated since coordinates are now LengthSize.
+ (WebCore::updateFromStyle): Changed to take a reference instead of a pointer and
+ also to fetch the data from RenderStyle in a new way that more closely matches the
+ CSS properties.
+ (WebCore::updateSnapOffsetsForScrollableArea): Ditto. Also moved some memory allocation
+ inside if statements so we don't wastefully allocate and destroy.
+
+ * rendering/style/RenderStyle.cpp: Added an include of StyleScrollSnapPoints.h now
+ that the header doesn't include them. Moved the conditional includes out of the main
+ include paragraph (even though I don't think conditional includes are usually a good
+ idea).
+ (WebCore::RenderStyle::initialScrollSnapPointsX): Added.
+ (WebCore::RenderStyle::initialScrollSnapPointsY): Added.
+ (WebCore::RenderStyle::initialScrollSnapDestination): Added.
+ (WebCore::RenderStyle::initialScrollSnapCoordinates): Added.
+ (WebCore::RenderStyle::scrollSnapPointsX): Added.
+ (WebCore::RenderStyle::scrollSnapPointsY): Added.
+ (WebCore::RenderStyle::scrollSnapDestination): Added.
+ (WebCore::RenderStyle::scrollSnapCoordinates): Added.
+ (WebCore::RenderStyle::setScrollSnapPointsX): Added.
+ (WebCore::RenderStyle::setScrollSnapPointsY): Added.
+ (WebCore::RenderStyle::setScrollSnapDestination): Added.
+ (WebCore::RenderStyle::setScrollSnapCoordinates): Added.
+
+ * rendering/style/RenderStyle.h: Replaced the include of StyleScrollSnapPoints.h with
+ a forward declaration of ScrollSnapPoints. Removed getters and setters for the old
+ style properties and replaced them with new ones that match the CSS properties more
+ closely. Tweaked formatting a bit. Added initial value functions for the the scroll snap
+ properties.
+
+ * rendering/style/StyleRareNonInheritedData.cpp: Added include of StyleScrollSnapPoints.h
+ now that RenderStyle.h doesn't include it.
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated since
+ m_scrollSnapType is now unsigned instead of ScrollSnapType.
+
+ * rendering/style/StyleRareNonInheritedData.h: Fixed type of m_scrollSnapType to be
+ unsigned instead of ScrollSnapType. This should have been causing problems on Windows,
+ but I think we got lucky and had no detectable problems.
+
+ * rendering/style/StyleScrollSnapPoints.cpp:
+ (WebCore::ScrollSnapPoints::ScrollSnapPoints): Added.
+ (WebCore::operator==): Added overloads for both ScrollSnapPoints and also for
+ StyleScrollSnapPoints; using a free function for both since both have public data.
+ (WebCore::defaultScrollSnapDestination): Added, replaces a static member function.
+ (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Updated both the default
+ constructor and the copy constructor for the new design.
+
+ * rendering/style/StyleScrollSnapPoints.h: Added a ScrollSnapPoints struct for the
+ type of the snap-points-x and snap-points-y CSS properties. Changed the data members
+ of StyleScrollSnapPoints to match the various CSS properties rather than breaking
+ out all the data into separate data members.
+ (WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Deleted. Replaced by the
+ default constructor for ScrollSnapPoints.
+ (WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Deleted. Replaced by
+ a function inside the .cpp file.
+
</ins><span class="cx"> 2014-09-16 Youenn Fablet <youenn.fablet@crf.canon.fr>
</span><span class="cx">
</span><span class="cx"> [GStreamer] http/tests/media/video-auth.html is failing
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2004 Zack Rusin <zack@kde.org>
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2014 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
</span><span class="cx"> * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
</span><span class="cx"> * Copyright (C) 2011 Sencha, Inc. All rights reserved.
</span><span class="lines">@@ -998,8 +998,8 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> RefPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create();
</span><del>- for (size_t i = 0; i < namedGridLines.size(); ++i)
- lineNames->append(cssValuePool().createValue(namedGridLines[i], CSSPrimitiveValue::CSS_STRING));
</del><ins>+ for (auto& name : namedGridLines)
+ lineNames->append(cssValuePool().createValue(name, CSSPrimitiveValue::CSS_STRING));
</ins><span class="cx"> list.append(lineNames.releaseNonNull());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1088,38 +1088,44 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><del>-static PassRef<CSSValueList> scrollSnapDestination(RenderStyle* style, Length x, Length y)
</del><ins>+
+static PassRef<CSSValueList> scrollSnapDestination(RenderStyle& style, const LengthSize& destination)
</ins><span class="cx"> {
</span><del>- RefPtr<CSSValueList> snapDestinationValue = CSSValueList::createSpaceSeparated();
- snapDestinationValue->append(percentageOrZoomAdjustedValue(x, style));
- snapDestinationValue->append(percentageOrZoomAdjustedValue(y, style));
- return snapDestinationValue.releaseNonNull();
</del><ins>+ auto list = CSSValueList::createSpaceSeparated();
+ list.get().append(percentageOrZoomAdjustedValue(destination.width(), &style));
+ list.get().append(percentageOrZoomAdjustedValue(destination.height(), &style));
+ return list;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static PassRef<CSSValueList> scrollSnapPoints(RenderStyle* style, const Vector<Length>& points, Length repeatPoint, bool hasRepeat)
</del><ins>+static PassRef<CSSValue> scrollSnapPoints(RenderStyle& style, const ScrollSnapPoints& points)
</ins><span class="cx"> {
</span><del>- RefPtr<CSSValueList> snapPointsValue = CSSValueList::createSpaceSeparated();
- for (auto& point : points)
- snapPointsValue->append(percentageOrZoomAdjustedValue(point, style));
-
- if (hasRepeat)
- snapPointsValue->append(cssValuePool().createValue(LengthRepeat::create(percentageOrZoomAdjustedValue(repeatPoint, style))));
-
- return snapPointsValue.releaseNonNull();
</del><ins>+ if (points.usesElements)
+ return cssValuePool().createIdentifierValue(CSSValueElements);
+ auto list = CSSValueList::createSpaceSeparated();
+ for (auto& point : points.offsets)
+ list.get().append(percentageOrZoomAdjustedValue(point, &style));
+ if (points.hasRepeat)
+ list.get().append(cssValuePool().createValue(LengthRepeat::create(percentageOrZoomAdjustedValue(points.repeatOffset, &style))));
+ return WTF::move(list);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static PassRef<CSSValueList> scrollSnapCoordinates(RenderStyle* style, const Vector<SnapCoordinate>& coordinates)
</del><ins>+static PassRef<CSSValue> scrollSnapCoordinates(RenderStyle& style, const Vector<LengthSize>& coordinates)
</ins><span class="cx"> {
</span><del>- RefPtr<CSSValueList> snapCoordinatesValue = CSSValueList::createCommaSeparated();
- for (const auto& coordinate : coordinates) {
- RefPtr<CSSValueList> currentCoordinate = CSSValueList::createSpaceSeparated();
- currentCoordinate->append(percentageOrZoomAdjustedValue(coordinate.first, style));
- currentCoordinate->append(percentageOrZoomAdjustedValue(coordinate.second, style));
</del><ins>+ if (coordinates.isEmpty())
+ return cssValuePool().createIdentifierValue(CSSValueNone);
</ins><span class="cx">
</span><del>- snapCoordinatesValue->append(currentCoordinate.releaseNonNull());
</del><ins>+ auto list = CSSValueList::createCommaSeparated();
+
+ for (auto& coordinate : coordinates) {
+ auto pair = CSSValueList::createSpaceSeparated();
+ pair.get().append(percentageOrZoomAdjustedValue(coordinate.width(), &style));
+ pair.get().append(percentageOrZoomAdjustedValue(coordinate.height(), &style));
+ list.get().append(WTF::move(pair));
</ins><span class="cx"> }
</span><del>- return snapCoordinatesValue.releaseNonNull();
</del><ins>+
+ return WTF::move(list);
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> static PassRef<CSSValueList> getDelayValue(const AnimationList* animList)
</span><span class="lines">@@ -1268,13 +1274,13 @@
</span><span class="cx"> PassRefPtr<CSSPrimitiveValue> ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword() const
</span><span class="cx"> {
</span><span class="cx"> if (!m_node)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> m_node->document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx">
</span><span class="cx"> RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier);
</span><span class="cx"> if (!style)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> if (int keywordSize = style->fontDescription().keywordSize())
</span><span class="cx"> return cssValuePool().createIdentifierValue(cssIdentifierForFontSizeKeyword(keywordSize));
</span><span class="lines">@@ -1464,7 +1470,7 @@
</span><span class="cx"> {
</span><span class="cx"> const CounterDirectiveMap* map = style->counterDirectives();
</span><span class="cx"> if (!map)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</span><span class="cx"> for (CounterDirectiveMap::const_iterator it = map->begin(); it != map->end(); ++it) {
</span><span class="lines">@@ -1622,7 +1628,7 @@
</span><span class="cx"> Node* ComputedStyleExtractor::styledNode() const
</span><span class="cx"> {
</span><span class="cx"> if (!m_node)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> if (!m_node->isElementNode())
</span><span class="cx"> return m_node.get();
</span><span class="cx"> Element* element = toElement(m_node.get());
</span><span class="lines">@@ -1690,10 +1696,10 @@
</span><span class="cx"> {
</span><span class="cx"> Node* styledNode = this->styledNode();
</span><span class="cx"> if (!styledNode)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> RefPtr<RenderStyle> style;
</span><del>- RenderObject* renderer = 0;
</del><ins>+ RenderObject* renderer = nullptr;
</ins><span class="cx"> bool forceFullLayout = false;
</span><span class="cx"> if (updateLayout) {
</span><span class="cx"> Document& document = styledNode->document();
</span><span class="lines">@@ -1728,7 +1734,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!style)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->direction(), style->writingMode());
</span><span class="cx">
</span><span class="lines">@@ -2324,7 +2330,7 @@
</span><span class="cx"> EPageBreak pageBreak = style->pageBreakInside();
</span><span class="cx"> ASSERT(pageBreak != PBALWAYS);
</span><span class="cx"> if (pageBreak == PBALWAYS)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> return cssValuePool().createValue(style->pageBreakInside());
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyPosition:
</span><span class="lines">@@ -2458,7 +2464,7 @@
</span><span class="cx"> return cssValuePool().createValue(style->verticalAlignLength());
</span><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> case CSSPropertyVisibility:
</span><span class="cx"> return cssValuePool().createValue(style->visibility());
</span><span class="cx"> case CSSPropertyWhiteSpace:
</span><span class="lines">@@ -2528,7 +2534,7 @@
</span><span class="cx"> return cssValuePool().createIdentifierValue(CSSValueNone);
</span><span class="cx">
</span><span class="cx"> RefPtr<DashboardRegion> firstRegion;
</span><del>- DashboardRegion* previousRegion = 0;
</del><ins>+ DashboardRegion* previousRegion = nullptr;
</ins><span class="cx"> for (unsigned i = 0; i < count; i++) {
</span><span class="cx"> RefPtr<DashboardRegion> region = DashboardRegion::create();
</span><span class="cx"> StyleDashboardRegion styleRegion = regions[i];
</span><span class="lines">@@ -2898,11 +2904,10 @@
</span><span class="cx"> return getBackgroundShorthandValue();
</span><span class="cx"> case CSSPropertyBorder: {
</span><span class="cx"> RefPtr<CSSValue> value = propertyValue(CSSPropertyBorderTop, DoNotUpdateLayout);
</span><del>- const CSSPropertyID properties[3] = { CSSPropertyBorderRight, CSSPropertyBorderBottom,
- CSSPropertyBorderLeft };
- for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) {
- if (!compareCSSValuePtr<CSSValue>(value, propertyValue(properties[i], DoNotUpdateLayout)))
- return 0;
</del><ins>+ const CSSPropertyID properties[3] = { CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
+ for (auto& property : properties) {
+ if (!compareCSSValuePtr<CSSValue>(value, propertyValue(property, DoNotUpdateLayout)))
+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> return value.release();
</span><span class="cx"> }
</span><span class="lines">@@ -2936,6 +2941,20 @@
</span><span class="cx"> return getCSSPropertyValuesForShorthandProperties(outlineShorthand());
</span><span class="cx"> case CSSPropertyPadding:
</span><span class="cx"> return getCSSPropertyValuesForSidesShorthand(paddingShorthand());
</span><ins>+
+#if ENABLE(CSS_SCROLL_SNAP)
+ case CSSPropertyWebkitScrollSnapType:
+ return cssValuePool().createValue(style->scrollSnapType());
+ case CSSPropertyWebkitScrollSnapDestination:
+ return scrollSnapDestination(*style, style->scrollSnapDestination());
+ case CSSPropertyWebkitScrollSnapPointsX:
+ return scrollSnapPoints(*style, style->scrollSnapPointsX());
+ case CSSPropertyWebkitScrollSnapPointsY:
+ return scrollSnapPoints(*style, style->scrollSnapPointsY());
+ case CSSPropertyWebkitScrollSnapCoordinate:
+ return scrollSnapCoordinates(*style, style->scrollSnapCoordinates());
+#endif
+
</ins><span class="cx"> /* Individual properties not part of the spec */
</span><span class="cx"> case CSSPropertyBackgroundRepeatX:
</span><span class="cx"> case CSSPropertyBackgroundRepeatY:
</span><span class="lines">@@ -3093,38 +3112,18 @@
</span><span class="cx"> case CSSPropertyWritingMode:
</span><span class="cx"> case CSSPropertyWebkitSvgShadow:
</span><span class="cx"> return svgPropertyValue(propertyID, DoNotUpdateLayout);
</span><del>-
-#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
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> logUnimplementedPropertyID(propertyID);
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) const
</span><span class="cx"> {
</span><span class="cx"> RefPtr<CSSValue> value = getPropertyCSSValue(propertyID);
</span><del>- if (value)
- return value->cssText();
- return "";
</del><ins>+ if (!value)
+ return emptyString(); // FIXME: Should this be null instead, as it is in StyleProperties::getPropertyValue?
+ return value->cssText();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned CSSComputedStyleDeclaration::length() const
</span><span class="lines">@@ -3143,7 +3142,7 @@
</span><span class="cx"> String CSSComputedStyleDeclaration::item(unsigned i) const
</span><span class="cx"> {
</span><span class="cx"> if (i >= length())
</span><del>- return "";
</del><ins>+ return emptyString();
</ins><span class="cx">
</span><span class="cx"> return getPropertyNameString(computedProperties[i]);
</span><span class="cx"> }
</span><span class="lines">@@ -3190,7 +3189,7 @@
</span><span class="cx">
</span><span class="cx"> // All 4 properties must be specified.
</span><span class="cx"> if (!topValue || !rightValue || !bottomValue || !leftValue)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> bool showLeft = !compareCSSValuePtr(rightValue, leftValue);
</span><span class="cx"> bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft;
</span><span class="lines">@@ -3231,16 +3230,16 @@
</span><span class="cx">
</span><span class="cx"> CSSRule* CSSComputedStyleDeclaration::parentRule() const
</span><span class="cx"> {
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(const String& propertyName)
</span><span class="cx"> {
</span><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx"> if (!propertyID)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> RefPtr<CSSValue> value = getPropertyCSSValue(propertyID);
</span><del>- return value ? value->cloneForCSSOM() : 0;
</del><ins>+ return value ? value->cloneForCSSOM() : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String CSSComputedStyleDeclaration::getPropertyValue(const String &propertyName)
</span><span class="lines">@@ -3254,12 +3253,12 @@
</span><span class="cx"> String CSSComputedStyleDeclaration::getPropertyPriority(const String&)
</span><span class="cx"> {
</span><span class="cx"> // All computed styles have a priority of not "important".
</span><del>- return "";
</del><ins>+ return emptyString(); // FIXME: Should this sometimes be null instead of empty, to match a normal style declaration?
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String CSSComputedStyleDeclaration::getPropertyShorthand(const String&)
</span><span class="cx"> {
</span><del>- return "";
</del><ins>+ return emptyString(); // FIXME: Should this sometimes be null instead of empty, to match a normal style declaration?
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CSSComputedStyleDeclaration::isPropertyImplicit(const String&)
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -1348,26 +1348,26 @@
</span><span class="cx"> if (!value->isPrimitiveValue())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getValueID()) {
- switch (primitiveValue->getValueID()) {
- case CSSValueSmall:
- styleResolver->style()->setMarqueeIncrement(Length(1, Fixed)); // 1px.
- break;
- case CSSValueNormal:
- styleResolver->style()->setMarqueeIncrement(Length(6, Fixed)); // 6px. The WinIE default.
- break;
- case CSSValueLarge:
- styleResolver->style()->setMarqueeIncrement(Length(36, Fixed)); // 36px.
- break;
- default:
- break;
- }
- } else {
- Length marqueeLength = styleResolver->convertToIntLength(primitiveValue, styleResolver->state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
- if (!marqueeLength.isUndefined())
- styleResolver->style()->setMarqueeIncrement(marqueeLength);
</del><ins>+ CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*value);
+ Length marqueeLength(Undefined);
+ switch (primitiveValue.getValueID()) {
+ case CSSValueSmall:
+ marqueeLength = Length(1, Fixed); // 1px.
+ break;
+ case CSSValueNormal:
+ marqueeLength = Length(6, Fixed); // 6px. The WinIE default.
+ break;
+ case CSSValueLarge:
+ marqueeLength = Length(36, Fixed); // 36px.
+ break;
+ case CSSValueInvalid:
+ marqueeLength = primitiveValue.convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(styleResolver->state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
+ break;
+ default:
+ break;
</ins><span class="cx"> }
</span><ins>+ if (!marqueeLength.isUndefined())
+ styleResolver->style()->setMarqueeIncrement(marqueeLength);
</ins><span class="cx"> }
</span><span class="cx"> static PropertyHandler createHandler()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorecssPropertySetCSSStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx"> return cloneAndCacheForCSSOM(m_propertySet->getPropertyCSSValue(propertyID).get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String PropertySetCSSStyleDeclaration::getPropertyValue(const String &propertyName)
</del><ins>+String PropertySetCSSStyleDeclaration::getPropertyValue(const String& propertyName)
</ins><span class="cx"> {
</span><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx"> if (!propertyID)
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><del>- * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
</del><ins>+ * Copyright (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
</ins><span class="cx"> * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
</span><del>- * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2014 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
</span><span class="cx"> * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
</span><span class="cx"> * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="lines">@@ -121,6 +121,7 @@
</span><span class="cx"> #include "StylePropertyShorthand.h"
</span><span class="cx"> #include "StyleRule.h"
</span><span class="cx"> #include "StyleRuleImport.h"
</span><ins>+#include "StyleScrollSnapPoints.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "StyleSheetList.h"
</span><span class="cx"> #include "Text.h"
</span><span class="lines">@@ -1466,14 +1467,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // -------------------------------------------------------------------------------------
</span><del>-// this is mostly boring stuff on how to apply a certain rule to the renderstyle...
</del><span class="cx">
</span><del>-Length StyleResolver::convertToIntLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData)
</del><ins>+static Length convertToIntLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData)
</ins><span class="cx"> {
</span><span class="cx"> return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(conversionData) : Length(Undefined);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Length StyleResolver::convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData)
</del><ins>+static Length convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData)
</ins><span class="cx"> {
</span><span class="cx"> return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | CalculatedConversion>(conversionData) : Length(Undefined);
</span><span class="cx"> }
</span><span class="lines">@@ -2047,6 +2047,50 @@
</span><span class="cx"> }
</span><span class="cx"> #endif /* ENABLE(CSS_GRID_LAYOUT) */
</span><span class="cx">
</span><ins>+#if ENABLE(CSS_SCROLL_SNAP)
+
+Length StyleResolver::parseSnapCoordinate(CSSPrimitiveValue& value)
+{
+ return value.convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(m_state.cssToLengthConversionData());
+}
+
+Length StyleResolver::parseSnapCoordinate(CSSValueList& valueList, unsigned offset)
+{
+ return parseSnapCoordinate(toCSSPrimitiveValue(*valueList.item(offset)));
+}
+
+LengthSize StyleResolver::parseSnapCoordinatePair(CSSValueList& valueList, unsigned offset)
+{
+ return LengthSize(parseSnapCoordinate(valueList, offset), parseSnapCoordinate(valueList, offset + 1));
+}
+
+ScrollSnapPoints StyleResolver::parseSnapPoints(CSSValue& value)
+{
+ ScrollSnapPoints points;
+
+ if (value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() == CSSValueElements) {
+ points.usesElements = true;
+ return points;
+ }
+
+ points.hasRepeat = false;
+ for (CSSValueListIterator it(&value); it.hasMore(); it.advance()) {
+ auto& itemValue = toCSSPrimitiveValue(*it.value());
+ if (auto* lengthRepeat = itemValue.getLengthRepeatValue()) {
+ if (auto* interval = lengthRepeat->interval()) {
+ points.repeatOffset = parseSnapCoordinate(*interval);
+ points.hasRepeat = true;
+ break;
+ }
+ }
+ points.offsets.append(parseSnapCoordinate(itemValue));
+ }
+
+ return points;
+}
+
+#endif
+
</ins><span class="cx"> void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
</span><span class="cx"> {
</span><span class="cx"> ASSERT_WITH_MESSAGE(!isExpandedShorthand(id), "Shorthand property id = %d wasn't expanded at parsing time", id);
</span><span class="lines">@@ -2782,8 +2826,8 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (value->isPrimitiveValue()) {
- ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone);
</del><ins>+ if (primitiveValue) {
+ ASSERT(primitiveValue->getValueID() == CSSValueNone);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2839,97 +2883,48 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif /* ENABLE(CSS_GRID_LAYOUT) */
</span><del>- case CSSPropertyWebkitJustifySelf: {
</del><ins>+
+ case CSSPropertyWebkitJustifySelf:
</ins><span class="cx"> HANDLE_INHERIT_AND_INITIAL(justifySelf, JustifySelf);
</span><del>- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><span class="cx"> if (Pair* pairValue = primitiveValue->getPairValue()) {
</span><span class="cx"> state.style()->setJustifySelf(*pairValue->first());
</span><span class="cx"> state.style()->setJustifySelfOverflowAlignment(*pairValue->second());
</span><span class="cx"> } else
</span><span class="cx"> state.style()->setJustifySelf(*primitiveValue);
</span><span class="cx"> return;
</span><del>- }
</del><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><del>- case CSSPropertyWebkitScrollSnapType: {
</del><ins>+ case CSSPropertyWebkitScrollSnapType:
+ HANDLE_INHERIT_AND_INITIAL(scrollSnapType, ScrollSnapType);
</ins><span class="cx"> state.style()->setScrollSnapType(*primitiveValue);
</span><span class="cx"> return;
</span><del>- }
</del><span class="cx"> case CSSPropertyWebkitScrollSnapPointsX:
</span><del>- 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);
</del><ins>+ HANDLE_INHERIT_AND_INITIAL(scrollSnapPointsX, ScrollSnapPointsX);
+ state.style()->setScrollSnapPointsX(parseSnapPoints(*value));
</ins><span class="cx"> return;
</span><del>- }
</del><ins>+ case CSSPropertyWebkitScrollSnapPointsY:
+ HANDLE_INHERIT_AND_INITIAL(scrollSnapPointsY, ScrollSnapPointsY);
+ state.style()->setScrollSnapPointsY(parseSnapPoints(*value));
+ break;
</ins><span class="cx"> case CSSPropertyWebkitScrollSnapDestination: {
</span><del>- 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()));
</del><ins>+ HANDLE_INHERIT_AND_INITIAL(scrollSnapDestination, ScrollSnapDestination)
+ state.style()->setScrollSnapDestination(parseSnapCoordinatePair(toCSSValueList(*value), 0));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyWebkitScrollSnapCoordinate: {
</span><del>- Vector<SnapCoordinate> coordinates;
</del><ins>+ HANDLE_INHERIT_AND_INITIAL(scrollSnapCoordinates, ScrollSnapCoordinates)
</ins><span class="cx"> CSSValueList& valueList = toCSSValueList(*value);
</span><del>- 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);
</del><ins>+ ASSERT(!(valueList.length() % 2));
+ size_t pointCount = valueList.length() / 2;
+ Vector<LengthSize> coordinates;
+ coordinates.reserveInitialCapacity(pointCount);
+ for (size_t i = 0; i < pointCount; i++)
+ coordinates.append(parseSnapCoordinatePair(valueList, i * 2));
+ state.style()->setScrollSnapCoordinates(WTF::move(coordinates));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+#endif
+
</ins><span class="cx"> case CSSPropertyWebkitInitialLetter: {
</span><span class="cx"> HANDLE_INHERIT_AND_INITIAL(initialLetter, InitialLetter)
</span><span class="cx"> if (!value->isPrimitiveValue())
</span><span class="lines">@@ -2940,7 +2935,6 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><span class="cx"> Pair* pair = primitiveValue->getPairValue();
</span><span class="cx"> if (!pair || !pair->first() || !pair->second())
</span><span class="cx"> return;
</span><span class="lines">@@ -2949,7 +2943,6 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#endif
</del><span class="cx"> // These properties are aliased and DeprecatedStyleBuilder already applied the property on the prefixed version.
</span><span class="cx"> case CSSPropertyTransitionDelay:
</span><span class="cx"> case CSSPropertyTransitionDuration:
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.h (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.h        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/css/StyleResolver.h        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -458,9 +458,6 @@
</span><span class="cx"> bool applyPropertyToRegularStyle() const { return m_state.applyPropertyToRegularStyle(); }
</span><span class="cx"> bool applyPropertyToVisitedLinkStyle() const { return m_state.applyPropertyToVisitedLinkStyle(); }
</span><span class="cx">
</span><del>- static Length convertToIntLength(const CSSPrimitiveValue*, const CSSToLengthConversionData&);
- static Length convertToFloatLength(const CSSPrimitiveValue*, const CSSToLengthConversionData&);
-
</del><span class="cx"> CSSToStyleMap* styleMap() { return &m_styleMap; }
</span><span class="cx"> InspectorCSSOMWrappers& inspectorCSSOMWrappers() { return m_inspectorCSSOMWrappers; }
</span><span class="cx"> const FontDescription& fontDescription() { return m_state.fontDescription(); }
</span><span class="lines">@@ -476,7 +473,6 @@
</span><span class="cx">
</span><span class="cx"> void cacheBorderAndBackground();
</span><span class="cx">
</span><del>-private:
</del><span class="cx"> bool canShareStyleWithControl(StyledElement*) const;
</span><span class="cx">
</span><span class="cx"> void applyProperty(CSSPropertyID, CSSValue*);
</span><span class="lines">@@ -507,6 +503,10 @@
</span><span class="cx"> bool classNamesAffectedByRules(const SpaceSplitString&) const;
</span><span class="cx"> bool sharingCandidateHasIdenticalStyleAffectingAttributes(StyledElement*) const;
</span><span class="cx">
</span><ins>+ Length parseSnapCoordinate(CSSPrimitiveValue&);
+ Length parseSnapCoordinate(CSSValueList&, unsigned offset);
+ LengthSize parseSnapCoordinatePair(CSSValueList&, unsigned offset);
+ ScrollSnapPoints parseSnapPoints(CSSValue&);
</ins><span class="cx">
</span><span class="cx"> unsigned m_matchedPropertiesCacheAdditionsSinceLastSweep;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAxisScrollSnapOffsetscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "RenderBox.h"
</span><span class="cx"> #include "ScrollableArea.h"
</span><ins>+#include "StyleScrollSnapPoints.h"
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">
</span><span class="lines">@@ -53,12 +54,12 @@
</span><span class="cx"> float left = position.x();
</span><span class="cx"> float top = position.y();
</span><span class="cx"> #endif
</span><del>- for (SnapCoordinate coordinate : box->style().scrollSnapCoordinates()) {
- LayoutUnit lastPotentialSnapPositionX = LayoutUnit(left) + valueForLength(coordinate.first, viewWidth);
</del><ins>+ for (auto& coordinate : box->style().scrollSnapCoordinates()) {
+ LayoutUnit lastPotentialSnapPositionX = LayoutUnit(left) + valueForLength(coordinate.width(), viewWidth);
</ins><span class="cx"> if (shouldAddHorizontalChildOffsets && lastPotentialSnapPositionX > 0)
</span><span class="cx"> horizontalSnapOffsetSubsequence.append(lastPotentialSnapPositionX);
</span><span class="cx">
</span><del>- LayoutUnit lastPotentialSnapPositionY = LayoutUnit(top) + valueForLength(coordinate.second, viewHeight);
</del><ins>+ LayoutUnit lastPotentialSnapPositionY = LayoutUnit(top) + valueForLength(coordinate.height(), viewHeight);
</ins><span class="cx"> if (shouldAddVerticalChildOffsets && lastPotentialSnapPositionY > 0)
</span><span class="cx"> verticalSnapOffsetSubsequence.append(lastPotentialSnapPositionY);
</span><span class="cx"> }
</span><span class="lines">@@ -67,22 +68,24 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void updateFromStyle(Vector<LayoutUnit>* snapOffsets, const RenderStyle& style, ScrollEventAxis axis, LayoutUnit viewSize, LayoutUnit scrollSize, Vector<LayoutUnit>& snapOffsetSubsequence)
</del><ins>+static void updateFromStyle(Vector<LayoutUnit>& snapOffsets, const RenderStyle& style, ScrollEventAxis axis, LayoutUnit viewSize, LayoutUnit scrollSize, Vector<LayoutUnit>& snapOffsetSubsequence)
</ins><span class="cx"> {
</span><span class="cx"> std::sort(snapOffsetSubsequence.begin(), snapOffsetSubsequence.end());
</span><span class="cx"> if (!snapOffsetSubsequence.size())
</span><span class="cx"> snapOffsetSubsequence.append(0);
</span><span class="cx">
</span><span class="cx"> bool isHorizontalAxis = axis == ScrollEventAxis::Horizontal;
</span><del>- bool hasRepeat = isHorizontalAxis ? style.scrollSnapHasRepeatX() : style.scrollSnapHasRepeatY();
- LayoutUnit repeatOffset = valueForLength(isHorizontalAxis ? style.scrollSnapRepeatOffsetX() : style.scrollSnapRepeatOffsetY(), viewSize);
- LayoutUnit destinationOffset = valueForLength(isHorizontalAxis ? style.scrollSnapDestinationX() : style.scrollSnapDestinationY(), viewSize);
</del><ins>+ auto& points = isHorizontalAxis ? style.scrollSnapPointsX() : style.scrollSnapPointsY();
+ auto& destination = style.scrollSnapDestination();
+ bool hasRepeat = points.hasRepeat;
+ LayoutUnit repeatOffset = valueForLength(points.repeatOffset, viewSize);
+ LayoutUnit destinationOffset = valueForLength(isHorizontalAxis ? destination.width() : destination.height(), viewSize);
</ins><span class="cx"> LayoutUnit curSnapPositionShift = 0;
</span><span class="cx"> LayoutUnit maxScrollOffset = scrollSize - viewSize;
</span><span class="cx"> LayoutUnit lastSnapPosition = curSnapPositionShift;
</span><del>- snapOffsets->append(0);
</del><ins>+ snapOffsets.append(0);
</ins><span class="cx"> do {
</span><del>- for (LayoutUnit snapPosition : snapOffsetSubsequence) {
</del><ins>+ for (auto& snapPosition : snapOffsetSubsequence) {
</ins><span class="cx"> LayoutUnit potentialSnapPosition = curSnapPositionShift + snapPosition - destinationOffset;
</span><span class="cx"> if (potentialSnapPosition <= 0)
</span><span class="cx"> continue;
</span><span class="lines">@@ -90,15 +93,15 @@
</span><span class="cx"> if (potentialSnapPosition >= maxScrollOffset)
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- snapOffsets->append(potentialSnapPosition);
</del><ins>+ snapOffsets.append(potentialSnapPosition);
</ins><span class="cx"> lastSnapPosition = potentialSnapPosition + destinationOffset;
</span><span class="cx"> }
</span><span class="cx"> curSnapPositionShift = lastSnapPosition + repeatOffset;
</span><span class="cx"> } while (hasRepeat && curSnapPositionShift < maxScrollOffset);
</span><span class="cx"> // Always put a snap point on the maximum scroll offset.
</span><span class="cx"> // Not a part of the spec, but necessary to prevent unreachable content when snapping.
</span><del>- if (snapOffsets->last() != maxScrollOffset)
- snapOffsets->append(maxScrollOffset);
</del><ins>+ if (snapOffsets.last() != maxScrollOffset)
+ snapOffsets.append(maxScrollOffset);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void updateSnapOffsetsForScrollableArea(ScrollableArea& scrollableArea, HTMLElement& scrollingElement, const RenderBox& scrollingElementBox, const RenderStyle& scrollingElementStyle)
</span><span class="lines">@@ -108,15 +111,16 @@
</span><span class="cx"> scrollableArea.clearVerticalSnapOffsets();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> LayoutUnit viewWidth = scrollingElementBox.width();
</span><span class="cx"> LayoutUnit viewHeight = scrollingElementBox.height();
</span><span class="cx"> LayoutUnit scrollWidth = scrollingElementBox.scrollWidth();
</span><span class="cx"> LayoutUnit scrollHeight = scrollingElementBox.scrollHeight();
</span><span class="cx"> bool canComputeHorizontalOffsets = scrollWidth > 0 && viewWidth > 0 && viewWidth < scrollWidth;
</span><span class="cx"> bool canComputeVerticalOffsets = scrollHeight > 0 && viewHeight > 0 && viewHeight < scrollHeight;
</span><ins>+
</ins><span class="cx"> if (!canComputeHorizontalOffsets)
</span><span class="cx"> scrollableArea.clearHorizontalSnapOffsets();
</span><del>-
</del><span class="cx"> if (!canComputeVerticalOffsets)
</span><span class="cx"> scrollableArea.clearVerticalSnapOffsets();
</span><span class="cx">
</span><span class="lines">@@ -125,30 +129,31 @@
</span><span class="cx">
</span><span class="cx"> Vector<LayoutUnit> horizontalSnapOffsetSubsequence;
</span><span class="cx"> Vector<LayoutUnit> verticalSnapOffsetSubsequence;
</span><del>- if (scrollingElementStyle.scrollSnapUsesElementsX() || scrollingElementStyle.scrollSnapUsesElementsY()) {
- bool shouldAddHorizontalChildOffsets = scrollingElementStyle.scrollSnapUsesElementsX() && canComputeHorizontalOffsets;
- bool shouldAddVerticalChildOffsets = scrollingElementStyle.scrollSnapUsesElementsY() && canComputeVerticalOffsets;
</del><ins>+
+ if (scrollingElementStyle.scrollSnapPointsX().usesElements || scrollingElementStyle.scrollSnapPointsY().usesElements) {
+ bool shouldAddHorizontalChildOffsets = scrollingElementStyle.scrollSnapPointsX().usesElements && canComputeHorizontalOffsets;
+ bool shouldAddVerticalChildOffsets = scrollingElementStyle.scrollSnapPointsY().usesElements && canComputeVerticalOffsets;
</ins><span class="cx"> appendChildSnapOffsets(scrollingElement, shouldAddHorizontalChildOffsets, horizontalSnapOffsetSubsequence, shouldAddVerticalChildOffsets, verticalSnapOffsetSubsequence);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!scrollingElementStyle.scrollSnapUsesElementsX() && canComputeHorizontalOffsets) {
- for (Length snapLength : scrollingElementStyle.scrollSnapOffsetsX())
</del><ins>+ if (!scrollingElementStyle.scrollSnapPointsX().usesElements && canComputeHorizontalOffsets) {
+ for (auto& snapLength : scrollingElementStyle.scrollSnapPointsX().offsets)
</ins><span class="cx"> horizontalSnapOffsetSubsequence.append(valueForLength(snapLength, viewWidth));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!scrollingElementStyle.scrollSnapUsesElementsY() && canComputeVerticalOffsets) {
- for (Length snapLength : scrollingElementStyle.scrollSnapOffsetsY())
</del><ins>+ if (!scrollingElementStyle.scrollSnapPointsY().usesElements && canComputeVerticalOffsets) {
+ for (auto& snapLength : scrollingElementStyle.scrollSnapPointsY().offsets)
</ins><span class="cx"> verticalSnapOffsetSubsequence.append(valueForLength(snapLength, viewHeight));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- std::unique_ptr<Vector<LayoutUnit>> horizontalSnapOffsets = std::make_unique<Vector<LayoutUnit>>();
- std::unique_ptr<Vector<LayoutUnit>> verticalSnapOffsets = std::make_unique<Vector<LayoutUnit>>();
</del><span class="cx"> if (canComputeHorizontalOffsets) {
</span><del>- updateFromStyle(horizontalSnapOffsets.get(), scrollingElementStyle, ScrollEventAxis::Horizontal, viewWidth, scrollWidth, horizontalSnapOffsetSubsequence);
</del><ins>+ auto horizontalSnapOffsets = std::make_unique<Vector<LayoutUnit>>();
+ updateFromStyle(*horizontalSnapOffsets, scrollingElementStyle, ScrollEventAxis::Horizontal, viewWidth, scrollWidth, horizontalSnapOffsetSubsequence);
</ins><span class="cx"> scrollableArea.setHorizontalSnapOffsets(WTF::move(horizontalSnapOffsets));
</span><span class="cx"> }
</span><span class="cx"> if (canComputeVerticalOffsets) {
</span><del>- updateFromStyle(verticalSnapOffsets.get(), scrollingElementStyle, ScrollEventAxis::Vertical, viewHeight, scrollHeight, verticalSnapOffsetSubsequence);
</del><ins>+ auto verticalSnapOffsets = std::make_unique<Vector<LayoutUnit>>();
+ updateFromStyle(*verticalSnapOffsets, scrollingElementStyle, ScrollEventAxis::Vertical, viewHeight, scrollHeight, verticalSnapOffsetSubsequence);
</ins><span class="cx"> scrollableArea.setVerticalSnapOffsets(WTF::move(verticalSnapOffsets));
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2014 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
</span><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -38,9 +38,7 @@
</span><span class="cx"> #include "StyleImage.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><del>-#if ENABLE(TOUCH_EVENTS)
-#include "RenderTheme.h"
-#endif
</del><ins>+#include "StyleScrollSnapPoints.h"
</ins><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <algorithm>
</span><span class="lines">@@ -53,6 +51,10 @@
</span><span class="cx"> #include "TextAutosizer.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+#include "RenderTheme.h"
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> struct SameSizeAsBorderValue {
</span><span class="lines">@@ -1826,4 +1828,76 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(CSS_SCROLL_SNAP)
+
+ScrollSnapPoints RenderStyle::initialScrollSnapPointsX()
+{
+ return ScrollSnapPoints();
+}
+
+ScrollSnapPoints RenderStyle::initialScrollSnapPointsY()
+{
+ return ScrollSnapPoints();
+}
+
+LengthSize RenderStyle::initialScrollSnapDestination()
+{
+ return defaultScrollSnapDestination();
+}
+
+Vector<LengthSize> RenderStyle::initialScrollSnapCoordinates()
+{
+ return Vector<LengthSize>();
+}
+
+const ScrollSnapPoints& RenderStyle::scrollSnapPointsX() const
+{
+ return rareNonInheritedData->m_scrollSnapPoints->xPoints;
+}
+
+const ScrollSnapPoints& RenderStyle::scrollSnapPointsY() const
+{
+ return rareNonInheritedData->m_scrollSnapPoints->yPoints;
+}
+
+const LengthSize& RenderStyle::scrollSnapDestination() const
+{
+ return rareNonInheritedData->m_scrollSnapPoints->destination;
+}
+
+const Vector<LengthSize>& RenderStyle::scrollSnapCoordinates() const
+{
+ return rareNonInheritedData->m_scrollSnapPoints->coordinates;
+}
+
+void RenderStyle::setScrollSnapPointsX(ScrollSnapPoints points)
+{
+ if (rareNonInheritedData->m_scrollSnapPoints->xPoints == points)
+ return;
+ rareNonInheritedData.access()->m_scrollSnapPoints.access()->xPoints = WTF::move(points);
+}
+
+void RenderStyle::setScrollSnapPointsY(ScrollSnapPoints points)
+{
+ if (rareNonInheritedData->m_scrollSnapPoints->yPoints == points)
+ return;
+ rareNonInheritedData.access()->m_scrollSnapPoints.access()->yPoints = WTF::move(points);
+}
+
+void RenderStyle::setScrollSnapDestination(LengthSize destination)
+{
+ if (rareNonInheritedData->m_scrollSnapPoints->destination == destination)
+ return;
+ rareNonInheritedData.access()->m_scrollSnapPoints.access()->destination = WTF::move(destination);
+}
+
+void RenderStyle::setScrollSnapCoordinates(Vector<LengthSize> coordinates)
+{
+ if (rareNonInheritedData->m_scrollSnapPoints->coordinates == coordinates)
+ return;
+ rareNonInheritedData.access()->m_scrollSnapPoints.access()->coordinates = WTF::move(coordinates);
+}
+
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
</span><span class="cx"> * (C) 2000 Antti Koivisto (koivisto@kde.org)
</span><span class="cx"> * (C) 2000 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2014 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
</span><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -84,10 +84,6 @@
</span><span class="cx"> #include "StyleDashboardRegion.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if ENABLE(CSS_SCROLL_SNAP)
-#include "StyleScrollSnapPoints.h"
-#endif
-
</del><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> #include "TextSizeAdjustment.h"
</span><span class="cx"> #endif
</span><span class="lines">@@ -104,10 +100,11 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class FilterOperations;
</del><span class="cx"> class BorderData;
</span><ins>+class ContentData;
</ins><span class="cx"> class CounterContent;
</span><span class="cx"> class CursorList;
</span><ins>+class FilterOperations;
</ins><span class="cx"> class Font;
</span><span class="cx"> class FontMetrics;
</span><span class="cx"> class IntRect;
</span><span class="lines">@@ -118,7 +115,7 @@
</span><span class="cx"> class StyleResolver;
</span><span class="cx"> class TransformationMatrix;
</span><span class="cx">
</span><del>-class ContentData;
</del><ins>+struct ScrollSnapPoints;
</ins><span class="cx">
</span><span class="cx"> typedef Vector<RefPtr<RenderStyle>, 4> PseudoStyleCache;
</span><span class="cx">
</span><span class="lines">@@ -1080,30 +1077,28 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx"> ScrollSnapType scrollSnapType() const { return static_cast<ScrollSnapType>(rareNonInheritedData->m_scrollSnapType); }
</span><del>- 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; }
</del><ins>+ const ScrollSnapPoints& scrollSnapPointsX() const;
+ const ScrollSnapPoints& scrollSnapPointsY() const;
+ const LengthSize& scrollSnapDestination() const;
+ const Vector<LengthSize>& scrollSnapCoordinates() const;
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> bool touchCalloutEnabled() const { return rareInheritedData->touchCalloutEnabled; }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
</span><span class="cx"> bool useTouchOverflowScrolling() const { return rareInheritedData->useTouchOverflowScrolling; }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> TextSizeAdjustment textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
</span><span class="cx">
</span><span class="cx"> WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
</span><span class="lines">@@ -1319,7 +1314,7 @@
</span><span class="cx"> #if ENABLE(CSS3_TEXT)
</span><span class="cx"> void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v); }
</span><span class="cx"> void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustify, v); }
</span><del>-#endif // CSS3_TEXT
</del><ins>+#endif
</ins><span class="cx"> void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
</span><span class="cx"> void setTextDecorationSkip(TextDecorationSkip skip) { SET_VAR(rareInheritedData, m_textDecorationSkip, skip); }
</span><span class="cx"> void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInheritedData, m_textUnderlinePosition, v); }
</span><span class="lines">@@ -1605,32 +1600,29 @@
</span><span class="cx"> void setInitialLetter(const IntSize& size) { SET_VAR(rareNonInheritedData, m_initialLetter, size); }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><del>- 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); }
</del><ins>+ void setScrollSnapType(ScrollSnapType type) { SET_VAR(rareNonInheritedData, m_scrollSnapType, static_cast<unsigned>(type)); }
+ void setScrollSnapPointsX(ScrollSnapPoints);
+ void setScrollSnapPointsY(ScrollSnapPoints);
+ void setScrollSnapDestination(LengthSize);
+ void setScrollSnapCoordinates(Vector<LengthSize>);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> void setTouchCalloutEnabled(bool v) { SET_VAR(rareInheritedData, touchCalloutEnabled, v); }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
</span><span class="cx"> void setUseTouchOverflowScrolling(bool v) { SET_VAR(rareInheritedData, useTouchOverflowScrolling, v); }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> void setTextSizeAdjust(TextSizeAdjustment anAdjustment) { SET_VAR(rareInheritedData, textSizeAdjust, anAdjustment); }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
</span><span class="cx">
</span><span class="cx"> const SVGRenderStyle& svgStyle() const { return *m_svgStyle; }
</span><span class="lines">@@ -1932,8 +1924,13 @@
</span><span class="cx"> static StyleImage* initialBorderImageSource() { return 0; }
</span><span class="cx"> static StyleImage* initialMaskBoxImageSource() { return 0; }
</span><span class="cx"> static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
</span><ins>+
</ins><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx"> static ScrollSnapType initialScrollSnapType() { return ScrollSnapType::None; }
</span><ins>+ static ScrollSnapPoints initialScrollSnapPointsX();
+ static ScrollSnapPoints initialScrollSnapPointsY();
+ static LengthSize initialScrollSnapDestination();
+ static Vector<LengthSize> initialScrollSnapCoordinates();
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "StyleTransformData.h"
</span><span class="cx"> #include "StyleImage.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleScrollSnapPoints.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -68,7 +69,7 @@
</span><span class="cx"> , m_flowThread(RenderStyle::initialFlowThread())
</span><span class="cx"> , m_regionThread(RenderStyle::initialRegionThread())
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><del>- , m_scrollSnapType(RenderStyle::initialScrollSnapType())
</del><ins>+ , m_scrollSnapType(static_cast<unsigned>(RenderStyle::initialScrollSnapType()))
</ins><span class="cx"> #endif
</span><span class="cx"> , m_regionFragment(RenderStyle::initialRegionFragment())
</span><span class="cx"> , m_regionBreakAfter(RenderStyle::NonInheritedFlags::initialPageBreak())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx"> AtomicString m_regionThread;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><del>- ScrollSnapType m_scrollSnapType; // ScrollSnapType
</del><ins>+ unsigned m_scrollSnapType : 2; // ScrollSnapType
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> unsigned m_regionFragment : 1; // RegionFragment
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleScrollSnapPointscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -30,30 +30,36 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+ScrollSnapPoints::ScrollSnapPoints()
+ : repeatOffset(100, Percent)
+ , hasRepeat(true)
+ , usesElements(false)
+{
+}
+
+bool operator==(const ScrollSnapPoints& a, const ScrollSnapPoints& b)
+{
+ return a.repeatOffset == b.repeatOffset
+ && a.hasRepeat == b.hasRepeat
+ && a.usesElements == b.usesElements
+ && a.offsets == b.offsets;
+}
+
+LengthSize defaultScrollSnapDestination()
+{
+ return LengthSize(Length(0, Fixed), Length(0, Fixed));
+}
+
</ins><span class="cx"> StyleScrollSnapPoints::StyleScrollSnapPoints()
</span><del>- : repeatOffsetX(StyleScrollSnapPoints::defaultRepeatOffset())
- , repeatOffsetY(StyleScrollSnapPoints::defaultRepeatOffset())
- , destinationX(StyleScrollSnapPoints::defaultDestinationOffset())
- , destinationY(StyleScrollSnapPoints::defaultDestinationOffset())
- , hasRepeatX(true)
- , hasRepeatY(true)
- , usesElementsX(false)
- , usesElementsY(false)
</del><ins>+ : destination(defaultScrollSnapDestination())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-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)
</del><ins>+inline StyleScrollSnapPoints::StyleScrollSnapPoints(const StyleScrollSnapPoints& other)
+ : xPoints(other.xPoints)
+ , yPoints(other.yPoints)
+ , destination(other.destination)
+ , coordinates(other.coordinates)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -62,20 +68,14 @@
</span><span class="cx"> return adoptRef(*new StyleScrollSnapPoints(*this));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool StyleScrollSnapPoints::operator==(const StyleScrollSnapPoints& o) const
</del><ins>+bool operator==(const StyleScrollSnapPoints& a, const StyleScrollSnapPoints& b)
</ins><span class="cx"> {
</span><del>- 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);
</del><ins>+ return a.xPoints == b.xPoints
+ && a.yPoints == b.yPoints
+ && a.destination == b.destination
+ && a.coordinates == b.coordinates;
</ins><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif /* ENABLE(CSS_SCROLL_SNAP) */
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleScrollSnapPointsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.h (173658 => 173659)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.h        2014-09-16 12:36:41 UTC (rev 173658)
+++ trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.h        2014-09-16 15:58:12 UTC (rev 173659)
</span><span class="lines">@@ -28,57 +28,46 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">
</span><del>-#include "Length.h"
-
-#include <wtf/PassRefPtr.h>
</del><ins>+#include "LengthSize.h"
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-typedef std::pair<Length, Length> SnapCoordinate;
</del><ins>+struct ScrollSnapPoints {
+ Length repeatOffset;
+ bool hasRepeat;
+ bool usesElements;
+ Vector<Length> offsets;
</ins><span class="cx">
</span><ins>+ ScrollSnapPoints();
+};
+
+bool operator==(const ScrollSnapPoints&, const ScrollSnapPoints&);
+inline bool operator!=(const ScrollSnapPoints& a, const ScrollSnapPoints& b) { return !(a == b); }
+
+LengthSize defaultScrollSnapDestination();
+
</ins><span class="cx"> class StyleScrollSnapPoints : public RefCounted<StyleScrollSnapPoints> {
</span><span class="cx"> public:
</span><span class="cx"> static PassRef<StyleScrollSnapPoints> create() { return adoptRef(*new StyleScrollSnapPoints); }
</span><del>-
- static Length defaultRepeatOffset()
- {
- return Length(100, Percent);
- }
-
- static Length defaultDestinationOffset()
- {
- return Length(0, Fixed);
- }
-
</del><span class="cx"> PassRef<StyleScrollSnapPoints> copy() const;
</span><del>-
- 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;
-
</del><ins>+
+ ScrollSnapPoints xPoints;
+ ScrollSnapPoints yPoints;
+ LengthSize destination;
+ Vector<LengthSize> coordinates;
+
</ins><span class="cx"> private:
</span><span class="cx"> StyleScrollSnapPoints();
</span><span class="cx"> StyleScrollSnapPoints(const StyleScrollSnapPoints&);
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+bool operator==(const StyleScrollSnapPoints&, const StyleScrollSnapPoints&);
+inline bool operator!=(const StyleScrollSnapPoints& a, const StyleScrollSnapPoints& b) { return !(a == b); }
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><del>-#endif /* ENABLE(CSS_SCROLL_SNAP) */
</del><ins>+#endif // ENABLE(CSS_SCROLL_SNAP)
</ins><span class="cx">
</span><span class="cx"> #endif // StyleScrollSnapPoints_h
</span></span></pre>
</div>
</div>
</body>
</html>