<!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 &quot;uses elements&quot; case; serialize that as an identifier, not the
string &quot;elements&quot;, fixing a minor bug.
(WebCore::scrollSnapCoordinates): Changed to take a Vector&lt;LengthSize&gt;. Also streamlined
and added code to handle the empty vector case; serialize that as an identifier, not the
string &quot;none&quot;, 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 &quot;private:&quot;.

* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::appendChildSnapOffsets): Use auto&amp; 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  &lt;darin@apple.com&gt;
+
+        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  &lt;youenn.fablet@crf.canon.fr&gt;
</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(&quot;invalid coordinates&quot;, &quot;coordinate&quot;, &quot;ben bitdiddle&quot;, &quot;none&quot;)
</span><span class="cx"> testComputedScrollSnapRule(&quot;mismatched x coordinate&quot;, &quot;coordinate&quot;, &quot;50% 100px 75%&quot;, &quot;none&quot;);
</span><span class="cx"> 
</span><ins>+testComputedScrollSnapRule(&quot;inherited type&quot;, &quot;type&quot;, &quot;inherit&quot;, &quot;none&quot;);
+testComputedScrollSnapRule(&quot;initial type&quot;, &quot;type&quot;, &quot;initial&quot;, &quot;none&quot;);
+testComputedScrollSnapRule(&quot;none type&quot;, &quot;type&quot;, &quot;none&quot;, &quot;none&quot;);
</ins><span class="cx"> testComputedScrollSnapRule(&quot;mandatory type&quot;, &quot;type&quot;, &quot;mandatory&quot;, &quot;mandatory&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;proximity type&quot;, &quot;type&quot;, &quot;proximity&quot;, &quot;proximity&quot;);
</span><span class="cx"> 
</span><ins>+testComputedScrollSnapRule(&quot;inherited points along x axis&quot;, &quot;points-x&quot;, &quot;inherit&quot;, &quot;repeat(100%)&quot;);
+testComputedScrollSnapRule(&quot;initial points along x axis&quot;, &quot;points-x&quot;, &quot;initial&quot;, &quot;repeat(100%)&quot;);
</ins><span class="cx"> testComputedScrollSnapRule(&quot;element points along x axis&quot;, &quot;points-x&quot;, &quot;elements&quot;, &quot;elements&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;percentage points along x axis&quot;, &quot;points-x&quot;, &quot;100% 50%&quot;, &quot;100% 50%&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;pixel points along x axis&quot;, &quot;points-x&quot;, &quot;100px 50px&quot;, &quot;100px 50px&quot;);
</span><span class="lines">@@ -40,6 +45,8 @@
</span><span class="cx"> testComputedScrollSnapRule(&quot;percentage points along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100% 50% repeat(40px)&quot;, &quot;100% 50% repeat(40px)&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;pixel points along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100px repeat(42px)&quot;, &quot;100px repeat(42px)&quot;);
</span><span class="cx"> 
</span><ins>+testComputedScrollSnapRule(&quot;inherited points along y axis&quot;, &quot;points-y&quot;, &quot;inherit&quot;, &quot;repeat(100%)&quot;);
+testComputedScrollSnapRule(&quot;initial points along y axis&quot;, &quot;points-y&quot;, &quot;initial&quot;, &quot;repeat(100%)&quot;);
</ins><span class="cx"> testComputedScrollSnapRule(&quot;element points along y axis&quot;, &quot;points-y&quot;, &quot;elements&quot;, &quot;elements&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;percentage points along y axis&quot;, &quot;points-y&quot;, &quot;100% 50%&quot;, &quot;100% 50%&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;pixel points along y axis&quot;, &quot;points-y&quot;, &quot;100px 50px&quot;, &quot;100px 50px&quot;);
</span><span class="lines">@@ -50,11 +57,16 @@
</span><span class="cx"> testComputedScrollSnapRule(&quot;percentage points along y axis with pixel repeat&quot;, &quot;points-y&quot;, &quot;100% 50% repeat(40px)&quot;, &quot;100% 50% repeat(40px)&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;pixel points along y axis with pixel repeat&quot;, &quot;points-y&quot;, &quot;100px repeat(42px)&quot;, &quot;100px repeat(42px)&quot;);
</span><span class="cx"> 
</span><ins>+testComputedScrollSnapRule(&quot;inherited destination&quot;, &quot;destination&quot;, &quot;inherit&quot;, &quot;0px 0px&quot;);
+testComputedScrollSnapRule(&quot;initial destination&quot;, &quot;destination&quot;, &quot;initial&quot;, &quot;0px 0px&quot;);
</ins><span class="cx"> testComputedScrollSnapRule(&quot;pixel/pixel destination&quot;, &quot;destination&quot;, &quot;10px 50px&quot;, &quot;10px 50px&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;pixel/percentage destination&quot;, &quot;destination&quot;, &quot;20px 40%&quot;, &quot;20px 40%&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;percentage/pixel destination&quot;, &quot;destination&quot;, &quot;0% 0px&quot;, &quot;0% 0px&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;percentage/percentage destination&quot;, &quot;destination&quot;, &quot;5% 100%&quot;, &quot;5% 100%&quot;);
</span><span class="cx"> 
</span><ins>+testComputedScrollSnapRule(&quot;inherited coordinate&quot;, &quot;coordinate&quot;, &quot;inherit&quot;, &quot;none&quot;);
+testComputedScrollSnapRule(&quot;initial coordinate&quot;, &quot;coordinate&quot;, &quot;initial&quot;, &quot;none&quot;);
+testComputedScrollSnapRule(&quot;no coordinate&quot;, &quot;coordinate&quot;, &quot;none&quot;, &quot;none&quot;);
</ins><span class="cx"> testComputedScrollSnapRule(&quot;single pixel coordinate&quot;, &quot;coordinate&quot;, &quot;50px 100px&quot;, &quot;50px 100px&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;single percentage coordinate&quot;, &quot;coordinate&quot;, &quot;50% 100%&quot;, &quot;50% 100%&quot;);
</span><span class="cx"> testComputedScrollSnapRule(&quot;multiple pixel coordinates&quot;, &quot;coordinate&quot;, &quot;50px 100px 150px 100px 200px 100px&quot;, &quot;50px 100px, 150px 100px, 200px 100px&quot;);
</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(&quot;declaration.getPropertyValue('-webkit-scroll-snap-&quot; + snapProperty + &quot;')&quot;, &quot;'&quot; + expectedValue + &quot;'&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+testScrollSnapRule(&quot;inherited type&quot;, &quot;type&quot;, &quot;inherit&quot;, &quot;inherit&quot;);
+testScrollSnapRule(&quot;initial type&quot;, &quot;type&quot;, &quot;initial&quot;, &quot;initial&quot;);
+
+testScrollSnapRule(&quot;inherited points-x&quot;, &quot;points-x&quot;, &quot;inherit&quot;, &quot;inherit&quot;);
+testScrollSnapRule(&quot;initial points-x&quot;, &quot;points-x&quot;, &quot;initial&quot;, &quot;initial&quot;);
+
+testScrollSnapRule(&quot;inherited points-y&quot;, &quot;points-y&quot;, &quot;inherit&quot;, &quot;inherit&quot;);
+testScrollSnapRule(&quot;initial points-y&quot;, &quot;points-y&quot;, &quot;initial&quot;, &quot;initial&quot;);
+
+testScrollSnapRule(&quot;inherited destination&quot;, &quot;destination&quot;, &quot;inherit&quot;, &quot;inherit&quot;);
+testScrollSnapRule(&quot;initial destination&quot;, &quot;destination&quot;, &quot;initial&quot;, &quot;initial&quot;);
+
+testScrollSnapRule(&quot;inherited coordinate&quot;, &quot;coordinate&quot;, &quot;inherit&quot;, &quot;inherit&quot;);
+testScrollSnapRule(&quot;initial coordinate&quot;, &quot;coordinate&quot;, &quot;initial&quot;, &quot;initial&quot;);
+
</ins><span class="cx"> testScrollSnapRule(&quot;mandatory type&quot;, &quot;type&quot;, &quot;mandatory&quot;, &quot;mandatory&quot;);
</span><span class="cx"> testScrollSnapRule(&quot;proximity type&quot;, &quot;type&quot;, &quot;proximity&quot;, &quot;proximity&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -43,10 +58,10 @@
</span><span class="cx"> testScrollSnapRule(&quot;percentage points along y axis with pixel repeat&quot;, &quot;points-y&quot;, &quot;100% 50% repeat(40px)&quot;, &quot;100% 50% repeat(40px)&quot;);
</span><span class="cx"> testScrollSnapRule(&quot;pixel points along y axis with pixel repeat&quot;, &quot;points-y&quot;, &quot;100px repeat(42px)&quot;, &quot;100px repeat(42px)&quot;);
</span><span class="cx"> 
</span><del>-testScrollSnapRule(&quot;em points along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100em repeat(42em)&quot;, &quot;100em repeat 42em&quot;);
-testScrollSnapRule(&quot;mm along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100mm repeat(42mm)&quot;, &quot;100mm repeat 42mm&quot;);
-testScrollSnapRule(&quot;in along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100in repeat(42in)&quot;, &quot;100in repeat 42in&quot;);
-testScrollSnapRule(&quot;pt along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100pt repeat(42pt)&quot;, &quot;100pt repeat 42pt&quot;);
</del><ins>+testScrollSnapRule(&quot;em points along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100em repeat(42em)&quot;, &quot;100em repeat(42em)&quot;);
+testScrollSnapRule(&quot;mm along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100mm repeat(42mm)&quot;, &quot;100mm repeat(42mm)&quot;);
+testScrollSnapRule(&quot;in along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100in repeat(42in)&quot;, &quot;100in repeat(42in)&quot;);
+testScrollSnapRule(&quot;pt along x axis with pixel repeat&quot;, &quot;points-x&quot;, &quot;100pt repeat(42pt)&quot;, &quot;100pt repeat(42pt)&quot;);
</ins><span class="cx"> 
</span><span class="cx"> testScrollSnapRule(&quot;pixel/pixel destination&quot;, &quot;destination&quot;, &quot;10px 50px&quot;, &quot;10px 50px&quot;);
</span><span class="cx"> testScrollSnapRule(&quot;pixel/percentage destination&quot;, &quot;destination&quot;, &quot;20px 40%&quot;, &quot;20px 40%&quot;);
</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  &lt;darin@apple.com&gt;
+
+        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 &quot;uses elements&quot; case; serialize that as an identifier, not the
+        string &quot;elements&quot;, fixing a minor bug.
+        (WebCore::scrollSnapCoordinates): Changed to take a Vector&lt;LengthSize&gt;. Also streamlined
+        and added code to handle the empty vector case; serialize that as an identifier, not the
+        string &quot;none&quot;, 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 &quot;private:&quot;.
+
+        * page/scrolling/AxisScrollSnapOffsets.cpp:
+        (WebCore::appendChildSnapOffsets): Use auto&amp; 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  &lt;youenn.fablet@crf.canon.fr&gt;
</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 &lt;zack@kde.org&gt;
</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 &lt;ap@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2007 Nicholas Shanks &lt;webkit@nickshanks.com&gt;
</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&lt;CSSGridLineNamesValue&gt; lineNames = CSSGridLineNamesValue::create();
</span><del>-    for (size_t i = 0; i &lt; namedGridLines.size(); ++i)
-        lineNames-&gt;append(cssValuePool().createValue(namedGridLines[i], CSSPrimitiveValue::CSS_STRING));
</del><ins>+    for (auto&amp; name : namedGridLines)
+        lineNames-&gt;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&lt;CSSValueList&gt; scrollSnapDestination(RenderStyle* style, Length x, Length y)
</del><ins>+
+static PassRef&lt;CSSValueList&gt; scrollSnapDestination(RenderStyle&amp; style, const LengthSize&amp; destination)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;CSSValueList&gt; snapDestinationValue = CSSValueList::createSpaceSeparated();
-    snapDestinationValue-&gt;append(percentageOrZoomAdjustedValue(x, style));
-    snapDestinationValue-&gt;append(percentageOrZoomAdjustedValue(y, style));
-    return snapDestinationValue.releaseNonNull();
</del><ins>+    auto list = CSSValueList::createSpaceSeparated();
+    list.get().append(percentageOrZoomAdjustedValue(destination.width(), &amp;style));
+    list.get().append(percentageOrZoomAdjustedValue(destination.height(), &amp;style));
+    return list;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static PassRef&lt;CSSValueList&gt; scrollSnapPoints(RenderStyle* style, const Vector&lt;Length&gt;&amp; points, Length repeatPoint, bool hasRepeat)
</del><ins>+static PassRef&lt;CSSValue&gt; scrollSnapPoints(RenderStyle&amp; style, const ScrollSnapPoints&amp; points)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;CSSValueList&gt; snapPointsValue = CSSValueList::createSpaceSeparated();
-    for (auto&amp; point : points)
-        snapPointsValue-&gt;append(percentageOrZoomAdjustedValue(point, style));
-
-    if (hasRepeat)
-        snapPointsValue-&gt;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&amp; point : points.offsets)
+        list.get().append(percentageOrZoomAdjustedValue(point, &amp;style));
+    if (points.hasRepeat)
+        list.get().append(cssValuePool().createValue(LengthRepeat::create(percentageOrZoomAdjustedValue(points.repeatOffset, &amp;style))));
+    return WTF::move(list);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static PassRef&lt;CSSValueList&gt; scrollSnapCoordinates(RenderStyle* style, const Vector&lt;SnapCoordinate&gt;&amp; coordinates)
</del><ins>+static PassRef&lt;CSSValue&gt; scrollSnapCoordinates(RenderStyle&amp; style, const Vector&lt;LengthSize&gt;&amp; coordinates)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;CSSValueList&gt; snapCoordinatesValue = CSSValueList::createCommaSeparated();
-    for (const auto&amp; coordinate : coordinates) {
-        RefPtr&lt;CSSValueList&gt; currentCoordinate = CSSValueList::createSpaceSeparated();
-        currentCoordinate-&gt;append(percentageOrZoomAdjustedValue(coordinate.first, style));
-        currentCoordinate-&gt;append(percentageOrZoomAdjustedValue(coordinate.second, style));
</del><ins>+    if (coordinates.isEmpty())
+        return cssValuePool().createIdentifierValue(CSSValueNone);
</ins><span class="cx"> 
</span><del>-        snapCoordinatesValue-&gt;append(currentCoordinate.releaseNonNull());
</del><ins>+    auto list = CSSValueList::createCommaSeparated();
+
+    for (auto&amp; coordinate : coordinates) {
+        auto pair = CSSValueList::createSpaceSeparated();
+        pair.get().append(percentageOrZoomAdjustedValue(coordinate.width(), &amp;style));
+        pair.get().append(percentageOrZoomAdjustedValue(coordinate.height(), &amp;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&lt;CSSValueList&gt; getDelayValue(const AnimationList* animList)
</span><span class="lines">@@ -1268,13 +1274,13 @@
</span><span class="cx"> PassRefPtr&lt;CSSPrimitiveValue&gt; 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-&gt;document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RenderStyle&gt; style = m_node-&gt;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-&gt;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-&gt;counterDirectives();
</span><span class="cx">     if (!map)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
</span><span class="cx">     for (CounterDirectiveMap::const_iterator it = map-&gt;begin(); it != map-&gt;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-&gt;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-&gt;styledNode();
</span><span class="cx">     if (!styledNode)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RenderStyle&gt; 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&amp; document = styledNode-&gt;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-&gt;direction(), style-&gt;writingMode());
</span><span class="cx"> 
</span><span class="lines">@@ -2324,7 +2330,7 @@
</span><span class="cx">             EPageBreak pageBreak = style-&gt;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-&gt;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-&gt;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-&gt;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&lt;DashboardRegion&gt; firstRegion;
</span><del>-            DashboardRegion* previousRegion = 0;
</del><ins>+            DashboardRegion* previousRegion = nullptr;
</ins><span class="cx">             for (unsigned i = 0; i &lt; count; i++) {
</span><span class="cx">                 RefPtr&lt;DashboardRegion&gt; 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&lt;CSSValue&gt; value = propertyValue(CSSPropertyBorderTop, DoNotUpdateLayout);
</span><del>-            const CSSPropertyID properties[3] = { CSSPropertyBorderRight, CSSPropertyBorderBottom,
-                                        CSSPropertyBorderLeft };
-            for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(properties); ++i) {
-                if (!compareCSSValuePtr&lt;CSSValue&gt;(value, propertyValue(properties[i], DoNotUpdateLayout)))
-                    return 0;
</del><ins>+            const CSSPropertyID properties[3] = { CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
+            for (auto&amp; property : properties) {
+                if (!compareCSSValuePtr&lt;CSSValue&gt;(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-&gt;scrollSnapType());
+        case CSSPropertyWebkitScrollSnapDestination:
+            return scrollSnapDestination(*style, style-&gt;scrollSnapDestination());
+        case CSSPropertyWebkitScrollSnapPointsX:
+            return scrollSnapPoints(*style, style-&gt;scrollSnapPointsX());
+        case CSSPropertyWebkitScrollSnapPointsY:
+            return scrollSnapPoints(*style, style-&gt;scrollSnapPointsY());
+        case CSSPropertyWebkitScrollSnapCoordinate:
+            return scrollSnapCoordinates(*style, style-&gt;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-&gt;scrollSnapType());
-        case CSSPropertyWebkitScrollSnapDestination:
-            return scrollSnapDestination(style.get(), style-&gt;scrollSnapDestinationX(), style-&gt;scrollSnapDestinationY());
-        case CSSPropertyWebkitScrollSnapPointsX:
-            if (style-&gt;scrollSnapUsesElementsX())
-                return cssValuePool().createValue(&quot;elements&quot;, CSSPrimitiveValue::CSS_STRING);
-            return scrollSnapPoints(style.get(), style-&gt;scrollSnapOffsetsX(), style-&gt;scrollSnapRepeatOffsetX(), style-&gt;scrollSnapHasRepeatX());
-        case CSSPropertyWebkitScrollSnapPointsY:
-            if (style-&gt;scrollSnapUsesElementsY())
-                return cssValuePool().createValue(&quot;elements&quot;, CSSPrimitiveValue::CSS_STRING);
-            return scrollSnapPoints(style.get(), style-&gt;scrollSnapOffsetsY(), style-&gt;scrollSnapRepeatOffsetY(), style-&gt;scrollSnapHasRepeatY());
-        case CSSPropertyWebkitScrollSnapCoordinate:
-            Vector&lt;SnapCoordinate&gt; coords = style-&gt;scrollSnapCoordinates();
-            if (!coords.size())
-                return cssValuePool().createValue(&quot;none&quot;, 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&lt;CSSValue&gt; value = getPropertyCSSValue(propertyID);
</span><del>-    if (value)
-        return value-&gt;cssText();
-    return &quot;&quot;;
</del><ins>+    if (!value)
+        return emptyString(); // FIXME: Should this be null instead, as it is in StyleProperties::getPropertyValue?
+    return value-&gt;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 &gt;= length())
</span><del>-        return &quot;&quot;;
</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&lt;CSSValue&gt; CSSComputedStyleDeclaration::getPropertyCSSValue(const String&amp; 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&lt;CSSValue&gt; value = getPropertyCSSValue(propertyID);
</span><del>-    return value ? value-&gt;cloneForCSSOM() : 0;
</del><ins>+    return value ? value-&gt;cloneForCSSOM() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String CSSComputedStyleDeclaration::getPropertyValue(const String &amp;propertyName)
</span><span class="lines">@@ -3254,12 +3253,12 @@
</span><span class="cx"> String CSSComputedStyleDeclaration::getPropertyPriority(const String&amp;)
</span><span class="cx"> {
</span><span class="cx">     // All computed styles have a priority of not &quot;important&quot;.
</span><del>-    return &quot;&quot;;
</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&amp;)
</span><span class="cx"> {
</span><del>-    return &quot;&quot;;
</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&amp;)
</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-&gt;isPrimitiveValue())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        if (primitiveValue-&gt;getValueID()) {
-            switch (primitiveValue-&gt;getValueID()) {
-            case CSSValueSmall:
-                styleResolver-&gt;style()-&gt;setMarqueeIncrement(Length(1, Fixed)); // 1px.
-                break;
-            case CSSValueNormal:
-                styleResolver-&gt;style()-&gt;setMarqueeIncrement(Length(6, Fixed)); // 6px. The WinIE default.
-                break;
-            case CSSValueLarge:
-                styleResolver-&gt;style()-&gt;setMarqueeIncrement(Length(36, Fixed)); // 36px.
-                break;
-            default:
-                break;
-            }
-        } else {
-            Length marqueeLength = styleResolver-&gt;convertToIntLength(primitiveValue, styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
-            if (!marqueeLength.isUndefined())
-                styleResolver-&gt;style()-&gt;setMarqueeIncrement(marqueeLength);
</del><ins>+        CSSPrimitiveValue&amp; 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&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
+            break;
+        default:
+            break;
</ins><span class="cx">         }
</span><ins>+        if (!marqueeLength.isUndefined())
+            styleResolver-&gt;style()-&gt;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-&gt;getPropertyCSSValue(propertyID).get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String PropertySetCSSStyleDeclaration::getPropertyValue(const String &amp;propertyName)
</del><ins>+String PropertySetCSSStyleDeclaration::getPropertyValue(const String&amp; 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 &lt;ap@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2007, 2008 Eric Seidel &lt;eric@webkit.org&gt;
</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 &quot;StylePropertyShorthand.h&quot;
</span><span class="cx"> #include &quot;StyleRule.h&quot;
</span><span class="cx"> #include &quot;StyleRuleImport.h&quot;
</span><ins>+#include &quot;StyleScrollSnapPoints.h&quot;
</ins><span class="cx"> #include &quot;StyleSheetContents.h&quot;
</span><span class="cx"> #include &quot;StyleSheetList.h&quot;
</span><span class="cx"> #include &quot;Text.h&quot;
</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&amp; conversionData)
</del><ins>+static Length convertToIntLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData&amp; conversionData)
</ins><span class="cx"> {
</span><span class="cx">     return primitiveValue ? primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(conversionData) : Length(Undefined);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Length StyleResolver::convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData&amp; conversionData)
</del><ins>+static Length convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData&amp; conversionData)
</ins><span class="cx"> {
</span><span class="cx">     return primitiveValue ? primitiveValue-&gt;convertToLength&lt;FixedFloatConversion | PercentConversion | CalculatedConversion&gt;(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&amp; value)
+{
+    return value.convertToLength&lt;FixedIntegerConversion | PercentConversion | AutoConversion&gt;(m_state.cssToLengthConversionData());
+}
+
+Length StyleResolver::parseSnapCoordinate(CSSValueList&amp; valueList, unsigned offset)
+{
+    return parseSnapCoordinate(toCSSPrimitiveValue(*valueList.item(offset)));
+}
+
+LengthSize StyleResolver::parseSnapCoordinatePair(CSSValueList&amp; valueList, unsigned offset)
+{
+    return LengthSize(parseSnapCoordinate(valueList, offset), parseSnapCoordinate(valueList, offset + 1));
+}
+
+ScrollSnapPoints StyleResolver::parseSnapPoints(CSSValue&amp; value)
+{
+    ScrollSnapPoints points;
+
+    if (value.isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(value).getValueID() == CSSValueElements) {
+        points.usesElements = true;
+        return points;
+    }
+
+    points.hasRepeat = false;
+    for (CSSValueListIterator it(&amp;value); it.hasMore(); it.advance()) {
+        auto&amp; itemValue = toCSSPrimitiveValue(*it.value());
+        if (auto* lengthRepeat = itemValue.getLengthRepeatValue()) {
+            if (auto* interval = lengthRepeat-&gt;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), &quot;Shorthand property id = %d wasn't expanded at parsing time&quot;, 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-&gt;isPrimitiveValue()) {
-            ASSERT(toCSSPrimitiveValue(value)-&gt;getValueID() == CSSValueNone);
</del><ins>+        if (primitiveValue) {
+            ASSERT(primitiveValue-&gt;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-&gt;getPairValue()) {
</span><span class="cx">             state.style()-&gt;setJustifySelf(*pairValue-&gt;first());
</span><span class="cx">             state.style()-&gt;setJustifySelfOverflowAlignment(*pairValue-&gt;second());
</span><span class="cx">         } else
</span><span class="cx">             state.style()-&gt;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()-&gt;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-&gt;setScrollSnapHasRepeatX(false);
-        else
-            renderStyle-&gt;setScrollSnapHasRepeatY(false);
-
-        if (primitiveValue &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueElements) {
-            if (id == CSSPropertyWebkitScrollSnapPointsX)
-                renderStyle-&gt;setScrollSnapUsesElementsX(true);
-            else
-                renderStyle-&gt;setScrollSnapUsesElementsY(true);
-            return;
-        }
-        if (id == CSSPropertyWebkitScrollSnapPointsX)
-            renderStyle-&gt;setScrollSnapUsesElementsX(false);
-        else
-            renderStyle-&gt;setScrollSnapUsesElementsY(false);
-
-        Vector&lt;Length&gt; offsets;
-        for (CSSValueListIterator it(value); it.hasMore(); it.advance()) {
-            RefPtr&lt;CSSValue&gt; rawItemValue = it.value();
-            CSSPrimitiveValue* primitiveItemValue = toCSSPrimitiveValue(rawItemValue.get());
-            if (primitiveItemValue-&gt;isLengthRepeat()) {
-                LengthRepeat* lengthRepeat = primitiveItemValue-&gt;getLengthRepeatValue();
-                if (lengthRepeat &amp;&amp; lengthRepeat-&gt;interval()) {
-                    if (id == CSSPropertyWebkitScrollSnapPointsX) {
-                        renderStyle-&gt;setScrollSnapRepeatOffsetX(lengthRepeat-&gt;interval()-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | AutoConversion&gt;(state.cssToLengthConversionData()));
-                        renderStyle-&gt;setScrollSnapHasRepeatX(true);
-                    } else {
-                        renderStyle-&gt;setScrollSnapRepeatOffsetY(lengthRepeat-&gt;interval()-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | AutoConversion&gt;(state.cssToLengthConversionData()));
-                        renderStyle-&gt;setScrollSnapHasRepeatY(true);
-                    }
-                    break;
-                }
-            } else
-                offsets.append(primitiveItemValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | AutoConversion&gt;(state.cssToLengthConversionData()));
-        }
-        if (id == CSSPropertyWebkitScrollSnapPointsX)
-            renderStyle-&gt;setScrollSnapOffsetsX(offsets);
-        else
-            renderStyle-&gt;setScrollSnapOffsetsY(offsets);
</del><ins>+        HANDLE_INHERIT_AND_INITIAL(scrollSnapPointsX, ScrollSnapPointsX);
+        state.style()-&gt;setScrollSnapPointsX(parseSnapPoints(*value));
</ins><span class="cx">         return;
</span><del>-    }
</del><ins>+    case CSSPropertyWebkitScrollSnapPointsY:
+        HANDLE_INHERIT_AND_INITIAL(scrollSnapPointsY, ScrollSnapPointsY);
+        state.style()-&gt;setScrollSnapPointsY(parseSnapPoints(*value));
+        break;
</ins><span class="cx">     case CSSPropertyWebkitScrollSnapDestination: {
</span><del>-        CSSValueList&amp; position = toCSSValueList(*value);
-        RefPtr&lt;CSSValue&gt; xCoordinate = position.item(0);
-        RefPtr&lt;CSSPrimitiveValue&gt; xCoordinateValue = toCSSPrimitiveValue(xCoordinate.get());
-        state.style()-&gt;setScrollSnapDestinationX(xCoordinateValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | AutoConversion&gt;(state.cssToLengthConversionData()));
-
-        RefPtr&lt;CSSValue&gt; yCoordinate = position.item(1);
-        RefPtr&lt;CSSPrimitiveValue&gt; yCoordinateValue = toCSSPrimitiveValue(yCoordinate.get());
-        state.style()-&gt;setScrollSnapDestinationY(yCoordinateValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | AutoConversion&gt;(state.cssToLengthConversionData()));
</del><ins>+        HANDLE_INHERIT_AND_INITIAL(scrollSnapDestination, ScrollSnapDestination)
+        state.style()-&gt;setScrollSnapDestination(parseSnapCoordinatePair(toCSSValueList(*value), 0));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     case CSSPropertyWebkitScrollSnapCoordinate: {
</span><del>-        Vector&lt;SnapCoordinate&gt; coordinates;
</del><ins>+        HANDLE_INHERIT_AND_INITIAL(scrollSnapCoordinates, ScrollSnapCoordinates)
</ins><span class="cx">         CSSValueList&amp; 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 &lt; pointCount; i++) {
-            RefPtr&lt;CSSValue&gt; xCoordinate = valueList.item(i * 2);
-            RefPtr&lt;CSSValue&gt; yCoordinate = valueList.item((i * 2) + 1);
-            RefPtr&lt;CSSPrimitiveValue&gt; xCoordinateValue = toCSSPrimitiveValue(xCoordinate.get());
-            RefPtr&lt;CSSPrimitiveValue&gt; yCoordinateValue = toCSSPrimitiveValue(yCoordinate.get());
-            coordinates.append(SnapCoordinate(xCoordinateValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | AutoConversion&gt;(state.cssToLengthConversionData()), yCoordinateValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | AutoConversion&gt;(state.cssToLengthConversionData())));
-        }
-        state.style()-&gt;setScrollSnapCoordinates(coordinates);
</del><ins>+        ASSERT(!(valueList.length() % 2));
+        size_t pointCount = valueList.length() / 2;
+        Vector&lt;LengthSize&gt; coordinates;
+        coordinates.reserveInitialCapacity(pointCount);
+        for (size_t i = 0; i &lt; pointCount; i++)
+            coordinates.append(parseSnapCoordinatePair(valueList, i * 2));
+        state.style()-&gt;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-&gt;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-&gt;getPairValue();
</span><span class="cx">         if (!pair || !pair-&gt;first() || !pair-&gt;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&amp;);
-    static Length convertToFloatLength(const CSSPrimitiveValue*, const CSSToLengthConversionData&amp;);
-
</del><span class="cx">     CSSToStyleMap* styleMap() { return &amp;m_styleMap; }
</span><span class="cx">     InspectorCSSOMWrappers&amp; inspectorCSSOMWrappers() { return m_inspectorCSSOMWrappers; }
</span><span class="cx">     const FontDescription&amp; 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&amp;) const;
</span><span class="cx">     bool sharingCandidateHasIdenticalStyleAffectingAttributes(StyledElement*) const;
</span><span class="cx"> 
</span><ins>+    Length parseSnapCoordinate(CSSPrimitiveValue&amp;);
+    Length parseSnapCoordinate(CSSValueList&amp;, unsigned offset);
+    LengthSize parseSnapCoordinatePair(CSSValueList&amp;, unsigned offset);
+    ScrollSnapPoints parseSnapPoints(CSSValue&amp;);
</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 &quot;HTMLElement.h&quot;
</span><span class="cx"> #include &quot;RenderBox.h&quot;
</span><span class="cx"> #include &quot;ScrollableArea.h&quot;
</span><ins>+#include &quot;StyleScrollSnapPoints.h&quot;
</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-&gt;style().scrollSnapCoordinates()) {
-                LayoutUnit lastPotentialSnapPositionX = LayoutUnit(left) + valueForLength(coordinate.first, viewWidth);
</del><ins>+            for (auto&amp; coordinate : box-&gt;style().scrollSnapCoordinates()) {
+                LayoutUnit lastPotentialSnapPositionX = LayoutUnit(left) + valueForLength(coordinate.width(), viewWidth);
</ins><span class="cx">                 if (shouldAddHorizontalChildOffsets &amp;&amp; lastPotentialSnapPositionX &gt; 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 &amp;&amp; lastPotentialSnapPositionY &gt; 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&lt;LayoutUnit&gt;* snapOffsets, const RenderStyle&amp; style, ScrollEventAxis axis, LayoutUnit viewSize, LayoutUnit scrollSize, Vector&lt;LayoutUnit&gt;&amp; snapOffsetSubsequence)
</del><ins>+static void updateFromStyle(Vector&lt;LayoutUnit&gt;&amp; snapOffsets, const RenderStyle&amp; style, ScrollEventAxis axis, LayoutUnit viewSize, LayoutUnit scrollSize, Vector&lt;LayoutUnit&gt;&amp; 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&amp; points = isHorizontalAxis ? style.scrollSnapPointsX() : style.scrollSnapPointsY();
+    auto&amp; 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-&gt;append(0);
</del><ins>+    snapOffsets.append(0);
</ins><span class="cx">     do {
</span><del>-        for (LayoutUnit snapPosition : snapOffsetSubsequence) {
</del><ins>+        for (auto&amp; snapPosition : snapOffsetSubsequence) {
</ins><span class="cx">             LayoutUnit potentialSnapPosition = curSnapPositionShift + snapPosition - destinationOffset;
</span><span class="cx">             if (potentialSnapPosition &lt;= 0)
</span><span class="cx">                 continue;
</span><span class="lines">@@ -90,15 +93,15 @@
</span><span class="cx">             if (potentialSnapPosition &gt;= maxScrollOffset)
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><del>-            snapOffsets-&gt;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 &amp;&amp; curSnapPositionShift &lt; 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-&gt;last() != maxScrollOffset)
-        snapOffsets-&gt;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&amp; scrollableArea, HTMLElement&amp; scrollingElement, const RenderBox&amp; scrollingElementBox, const RenderStyle&amp; 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 &gt; 0 &amp;&amp; viewWidth &gt; 0 &amp;&amp; viewWidth &lt; scrollWidth;
</span><span class="cx">     bool canComputeVerticalOffsets = scrollHeight &gt; 0 &amp;&amp; viewHeight &gt; 0 &amp;&amp; viewHeight &lt; 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&lt;LayoutUnit&gt; horizontalSnapOffsetSubsequence;
</span><span class="cx">     Vector&lt;LayoutUnit&gt; verticalSnapOffsetSubsequence;
</span><del>-    if (scrollingElementStyle.scrollSnapUsesElementsX() || scrollingElementStyle.scrollSnapUsesElementsY()) {
-        bool shouldAddHorizontalChildOffsets = scrollingElementStyle.scrollSnapUsesElementsX() &amp;&amp; canComputeHorizontalOffsets;
-        bool shouldAddVerticalChildOffsets = scrollingElementStyle.scrollSnapUsesElementsY() &amp;&amp; canComputeVerticalOffsets;
</del><ins>+
+    if (scrollingElementStyle.scrollSnapPointsX().usesElements || scrollingElementStyle.scrollSnapPointsY().usesElements) {
+        bool shouldAddHorizontalChildOffsets = scrollingElementStyle.scrollSnapPointsX().usesElements &amp;&amp; canComputeHorizontalOffsets;
+        bool shouldAddVerticalChildOffsets = scrollingElementStyle.scrollSnapPointsY().usesElements &amp;&amp; canComputeVerticalOffsets;
</ins><span class="cx">         appendChildSnapOffsets(scrollingElement, shouldAddHorizontalChildOffsets, horizontalSnapOffsetSubsequence, shouldAddVerticalChildOffsets, verticalSnapOffsetSubsequence);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!scrollingElementStyle.scrollSnapUsesElementsX() &amp;&amp; canComputeHorizontalOffsets) {
-        for (Length snapLength : scrollingElementStyle.scrollSnapOffsetsX())
</del><ins>+    if (!scrollingElementStyle.scrollSnapPointsX().usesElements &amp;&amp; canComputeHorizontalOffsets) {
+        for (auto&amp; 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() &amp;&amp; canComputeVerticalOffsets) {
-        for (Length snapLength : scrollingElementStyle.scrollSnapOffsetsY())
</del><ins>+    if (!scrollingElementStyle.scrollSnapPointsY().usesElements &amp;&amp; canComputeVerticalOffsets) {
+        for (auto&amp; 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&lt;Vector&lt;LayoutUnit&gt;&gt; horizontalSnapOffsets = std::make_unique&lt;Vector&lt;LayoutUnit&gt;&gt;();
-    std::unique_ptr&lt;Vector&lt;LayoutUnit&gt;&gt; verticalSnapOffsets = std::make_unique&lt;Vector&lt;LayoutUnit&gt;&gt;();
</del><span class="cx">     if (canComputeHorizontalOffsets) {
</span><del>-        updateFromStyle(horizontalSnapOffsets.get(), scrollingElementStyle, ScrollEventAxis::Horizontal, viewWidth, scrollWidth, horizontalSnapOffsetSubsequence);
</del><ins>+        auto horizontalSnapOffsets = std::make_unique&lt;Vector&lt;LayoutUnit&gt;&gt;();
+        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&lt;Vector&lt;LayoutUnit&gt;&gt;();
+        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 &quot;StyleImage.h&quot;
</span><span class="cx"> #include &quot;StyleInheritedData.h&quot;
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><del>-#if ENABLE(TOUCH_EVENTS)
-#include &quot;RenderTheme.h&quot;
-#endif
</del><ins>+#include &quot;StyleScrollSnapPoints.h&quot;
</ins><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;algorithm&gt;
</span><span class="lines">@@ -53,6 +51,10 @@
</span><span class="cx"> #include &quot;TextAutosizer.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+#include &quot;RenderTheme.h&quot;
+#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&lt;LengthSize&gt; RenderStyle::initialScrollSnapCoordinates()
+{
+    return Vector&lt;LengthSize&gt;();
+}
+
+const ScrollSnapPoints&amp; RenderStyle::scrollSnapPointsX() const
+{
+    return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;xPoints;
+}
+
+const ScrollSnapPoints&amp; RenderStyle::scrollSnapPointsY() const
+{
+    return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;yPoints;
+}
+
+const LengthSize&amp; RenderStyle::scrollSnapDestination() const
+{
+    return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;destination;
+}
+
+const Vector&lt;LengthSize&gt;&amp; RenderStyle::scrollSnapCoordinates() const
+{
+    return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;coordinates;
+}
+
+void RenderStyle::setScrollSnapPointsX(ScrollSnapPoints points)
+{
+    if (rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;xPoints == points)
+        return;
+    rareNonInheritedData.access()-&gt;m_scrollSnapPoints.access()-&gt;xPoints = WTF::move(points);
+}
+
+void RenderStyle::setScrollSnapPointsY(ScrollSnapPoints points)
+{
+    if (rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;yPoints == points)
+        return;
+    rareNonInheritedData.access()-&gt;m_scrollSnapPoints.access()-&gt;yPoints = WTF::move(points);
+}
+
+void RenderStyle::setScrollSnapDestination(LengthSize destination)
+{
+    if (rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;destination == destination)
+        return;
+    rareNonInheritedData.access()-&gt;m_scrollSnapPoints.access()-&gt;destination = WTF::move(destination);
+}
+
+void RenderStyle::setScrollSnapCoordinates(Vector&lt;LengthSize&gt; coordinates)
+{
+    if (rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;coordinates == coordinates)
+        return;
+    rareNonInheritedData.access()-&gt;m_scrollSnapPoints.access()-&gt;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 &quot;StyleDashboardRegion.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_SCROLL_SNAP)
-#include &quot;StyleScrollSnapPoints.h&quot;
-#endif
-
</del><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> #include &quot;TextSizeAdjustment.h&quot;
</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&lt;RefPtr&lt;RenderStyle&gt;, 4&gt; 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&lt;ScrollSnapType&gt;(rareNonInheritedData-&gt;m_scrollSnapType); }
</span><del>-    Vector&lt;Length&gt; scrollSnapOffsetsX() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;offsetsX; }
-    Vector&lt;Length&gt; scrollSnapOffsetsY() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;offsetsY; }
-    Length scrollSnapRepeatOffsetX() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;repeatOffsetX; }
-    Length scrollSnapRepeatOffsetY() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;repeatOffsetY; }
-    bool scrollSnapHasRepeatX() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;hasRepeatX; }
-    bool scrollSnapHasRepeatY() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;hasRepeatY; }
-    Length scrollSnapDestinationX() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;destinationX; }
-    Length scrollSnapDestinationY() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;destinationY; }
-    Vector&lt;SnapCoordinate&gt; scrollSnapCoordinates() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;coordinates; }
-    bool scrollSnapUsesElementsX() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;usesElementsX; }
-    bool scrollSnapUsesElementsY() const { return rareNonInheritedData-&gt;m_scrollSnapPoints-&gt;usesElementsY; }
</del><ins>+    const ScrollSnapPoints&amp; scrollSnapPointsX() const;
+    const ScrollSnapPoints&amp; scrollSnapPointsY() const;
+    const LengthSize&amp; scrollSnapDestination() const;
+    const Vector&lt;LengthSize&gt;&amp; 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-&gt;tapHighlightColor; }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     bool touchCalloutEnabled() const { return rareInheritedData-&gt;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-&gt;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-&gt;textSizeAdjust; }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx">     ETextSecurity textSecurity() const { return static_cast&lt;ETextSecurity&gt;(rareInheritedData-&gt;textSecurity); }
</span><span class="cx"> 
</span><span class="cx">     WritingMode writingMode() const { return static_cast&lt;WritingMode&gt;(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&amp; 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&lt;Length&gt;&amp; offsets) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, offsetsX, offsets); }
-    void setScrollSnapOffsetsY(Vector&lt;Length&gt;&amp; offsets) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, offsetsY, offsets); }
-    void setScrollSnapRepeatOffsetX(Length repeatOffset) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, repeatOffsetX, repeatOffset); }
-    void setScrollSnapRepeatOffsetY(Length repeatOffset) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, repeatOffsetY, repeatOffset); }
-    void setScrollSnapHasRepeatX(bool hasRepeat) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, hasRepeatX, hasRepeat); }
-    void setScrollSnapHasRepeatY(bool hasRepeat) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, hasRepeatY, hasRepeat); }
-    void setScrollSnapDestinationX(Length destination) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, destinationX, destination); }
-    void setScrollSnapDestinationY(Length destination) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, destinationY, destination); }
-    void setScrollSnapCoordinates(Vector&lt;SnapCoordinate&gt;&amp; coordinates) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, coordinates, coordinates); }
-    void setScrollSnapUsesElementsX(bool usesElements) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, usesElementsX, usesElements); }
-    void setScrollSnapUsesElementsY(bool usesElements) { SET_VAR(rareNonInheritedData.access()-&gt;m_scrollSnapPoints, usesElementsY, usesElements); }
</del><ins>+    void setScrollSnapType(ScrollSnapType type) { SET_VAR(rareNonInheritedData, m_scrollSnapType, static_cast&lt;unsigned&gt;(type)); }
+    void setScrollSnapPointsX(ScrollSnapPoints);
+    void setScrollSnapPointsY(ScrollSnapPoints);
+    void setScrollSnapDestination(LengthSize);
+    void setScrollSnapCoordinates(Vector&lt;LengthSize&gt;);
</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&amp; 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&amp; 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&lt;LengthSize&gt; 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 &quot;StyleTransformData.h&quot;
</span><span class="cx"> #include &quot;StyleImage.h&quot;
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><ins>+#include &quot;StyleScrollSnapPoints.h&quot;
</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&lt;unsigned&gt;(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&amp; a, const ScrollSnapPoints&amp; b)
+{
+    return a.repeatOffset == b.repeatOffset
+        &amp;&amp; a.hasRepeat == b.hasRepeat
+        &amp;&amp; a.usesElements == b.usesElements
+        &amp;&amp; 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&amp; 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&amp; 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&amp; o) const
</del><ins>+bool operator==(const StyleScrollSnapPoints&amp; a, const StyleScrollSnapPoints&amp; b)
</ins><span class="cx"> {
</span><del>-    return (offsetsX == o.offsetsX
-        &amp;&amp; offsetsY == o.offsetsY
-        &amp;&amp; repeatOffsetX == o.repeatOffsetX
-        &amp;&amp; hasRepeatX == o.hasRepeatX
-        &amp;&amp; hasRepeatY == o.hasRepeatY
-        &amp;&amp; destinationX == o.destinationX
-        &amp;&amp; destinationY == o.destinationY
-        &amp;&amp; coordinates == o.coordinates
-        &amp;&amp; usesElementsX == o.usesElementsX
-        &amp;&amp; usesElementsY == o.usesElementsY);
</del><ins>+    return a.xPoints == b.xPoints
+        &amp;&amp; a.yPoints == b.yPoints
+        &amp;&amp; a.destination == b.destination
+        &amp;&amp; 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 &quot;Length.h&quot;
-
-#include &lt;wtf/PassRefPtr.h&gt;
</del><ins>+#include &quot;LengthSize.h&quot;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-typedef std::pair&lt;Length, Length&gt; SnapCoordinate;
</del><ins>+struct ScrollSnapPoints {
+    Length repeatOffset;
+    bool hasRepeat;
+    bool usesElements;
+    Vector&lt;Length&gt; offsets;
</ins><span class="cx"> 
</span><ins>+    ScrollSnapPoints();
+};
+
+bool operator==(const ScrollSnapPoints&amp;, const ScrollSnapPoints&amp;);
+inline bool operator!=(const ScrollSnapPoints&amp; a, const ScrollSnapPoints&amp; b) { return !(a == b); }
+
+LengthSize defaultScrollSnapDestination();
+
</ins><span class="cx"> class StyleScrollSnapPoints : public RefCounted&lt;StyleScrollSnapPoints&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static PassRef&lt;StyleScrollSnapPoints&gt; 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&lt;StyleScrollSnapPoints&gt; copy() const;
</span><del>-    
-    bool operator==(const StyleScrollSnapPoints&amp;) const;
-    bool operator!=(const StyleScrollSnapPoints&amp; o) const
-    {
-        return !(*this == o);
-    }
-    
-    Length repeatOffsetX;
-    Length repeatOffsetY;
-    Length destinationX;
-    Length destinationY;
-    bool hasRepeatX;
-    bool hasRepeatY;
-    bool usesElementsX;
-    bool usesElementsY;
-    Vector&lt;Length&gt; offsetsX;
-    Vector&lt;Length&gt; offsetsY;
-    Vector&lt;SnapCoordinate&gt; coordinates;
-    
</del><ins>+
+    ScrollSnapPoints xPoints;
+    ScrollSnapPoints yPoints;
+    LengthSize destination;
+    Vector&lt;LengthSize&gt; coordinates;
+
</ins><span class="cx"> private:
</span><span class="cx">     StyleScrollSnapPoints();
</span><span class="cx">     StyleScrollSnapPoints(const StyleScrollSnapPoints&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+bool operator==(const StyleScrollSnapPoints&amp;, const StyleScrollSnapPoints&amp;);
+inline bool operator!=(const StyleScrollSnapPoints&amp; a, const StyleScrollSnapPoints&amp; 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>