<!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>[210320] 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/210320">210320</a></dd>
<dt>Author</dt> <dd>rego@igalia.com</dd>
<dt>Date</dt> <dd>2017-01-04 23:03:09 -0800 (Wed, 04 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-grid] Fix crash clamping grid lines
https://bugs.webkit.org/show_bug.cgi?id=166637

Reviewed by Darin Adler.

Source/WebCore:

Avoid issues with very big values for the grid lines clamping them on GridPosition.

Test: fast/css-grid-layout/grid-position-crash.html

* rendering/style/GridArea.h: Move kGridMaxTracks definition to GridPosition.
* rendering/style/GridPosition.h:
(WebCore::GridPosition::setExplicitPosition): Use new setIntegerPosition().
(WebCore::GridPosition::setSpanPosition): Ditto.
(WebCore::GridPosition::setIntegerPosition): Clamp the position using kGridMaxTracks.

Tools:

Creates new unit test to verify that the maximum tracks limit
is used in GridPosition too.

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/GridPosition.cpp: Added.
(TestWebKitAPI::TEST):

LayoutTests:

* fast/css-grid-layout/grid-position-crash-expected.txt: Added.
* fast/css-grid-layout/grid-position-crash.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleGridAreah">trunk/Source/WebCore/rendering/style/GridArea.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleGridPositionh">trunk/Source/WebCore/rendering/style/GridPosition.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformEflcmake">trunk/Tools/TestWebKitAPI/PlatformEfl.cmake</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformGTKcmake">trunk/Tools/TestWebKitAPI/PlatformGTK.cmake</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformWincmake">trunk/Tools/TestWebKitAPI/PlatformWin.cmake</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridpositioncrashexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-position-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridpositioncrashhtml">trunk/LayoutTests/fast/css-grid-layout/grid-position-crash.html</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreGridPositioncpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/GridPosition.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/LayoutTests/ChangeLog        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-01-04  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix crash clamping grid lines
+        https://bugs.webkit.org/show_bug.cgi?id=166637
+
+        Reviewed by Darin Adler.
+
+        * fast/css-grid-layout/grid-position-crash-expected.txt: Added.
+        * fast/css-grid-layout/grid-position-crash.html: Added.
+
</ins><span class="cx"> 2017-01-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove runtime flag for variation fonts
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridpositioncrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-position-crash-expected.txt (0 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-position-crash-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-position-crash-expected.txt        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+This test passes if it does not crash and you see a green &quot;PASS&quot; below.
+
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridpositioncrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-position-crash.html (0 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-position-crash.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-position-crash.html        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+}
+&lt;/script&gt;
+&lt;p&gt;This test passes if it does not crash and you see a green &quot;PASS&quot; below.&lt;/p&gt;
+&lt;div style=&quot;display: grid; color: green;&quot;&gt;
+    &lt;div style=&quot;grid-column-start: 5000000000 foo;&quot;&gt;PASS&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/Source/WebCore/ChangeLog        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2017-01-04  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix crash clamping grid lines
+        https://bugs.webkit.org/show_bug.cgi?id=166637
+
+        Reviewed by Darin Adler.
+
+        Avoid issues with very big values for the grid lines clamping them on GridPosition.
+
+        Test: fast/css-grid-layout/grid-position-crash.html
+
+        * rendering/style/GridArea.h: Move kGridMaxTracks definition to GridPosition.
+        * rendering/style/GridPosition.h:
+        (WebCore::GridPosition::setExplicitPosition): Use new setIntegerPosition().
+        (WebCore::GridPosition::setSpanPosition): Ditto.
+        (WebCore::GridPosition::setIntegerPosition): Clamp the position using kGridMaxTracks.
+
</ins><span class="cx"> 2017-01-04  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove PassRefPtr use from the &quot;html&quot; directory, other improvements
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleGridAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/GridArea.h (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/GridArea.h        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/Source/WebCore/rendering/style/GridArea.h        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -39,9 +39,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-// Recommended maximum size for both explicit and implicit grids.
-const int kGridMaxTracks = 1000000;
-
</del><span class="cx"> // A span in a single direction (either rows or columns). Note that |startLine|
</span><span class="cx"> // and |endLine| are grid lines' indexes.
</span><span class="cx"> // Despite line numbers in the spec start in &quot;1&quot;, the indexes here start in &quot;0&quot;.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleGridPositionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/GridPosition.h (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/GridPosition.h        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/Source/WebCore/rendering/style/GridPosition.h        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -37,6 +37,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+// Recommended maximum size for both explicit and implicit grids.
+const int kGridMaxTracks = 1000000;
+
</ins><span class="cx"> enum GridPositionType {
</span><span class="cx">     AutoPosition,
</span><span class="cx">     ExplicitPosition, // [ &lt;integer&gt; || &lt;string&gt; ]
</span><span class="lines">@@ -69,7 +72,7 @@
</span><span class="cx">     void setExplicitPosition(int position, const String&amp; namedGridLine)
</span><span class="cx">     {
</span><span class="cx">         m_type = ExplicitPosition;
</span><del>-        m_integerPosition = position;
</del><ins>+        setIntegerPosition(position);
</ins><span class="cx">         m_namedGridLine = namedGridLine;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -85,7 +88,7 @@
</span><span class="cx">     void setSpanPosition(int position, const String&amp; namedGridLine)
</span><span class="cx">     {
</span><span class="cx">         m_type = SpanPosition;
</span><del>-        m_integerPosition = position;
</del><ins>+        setIntegerPosition(position);
</ins><span class="cx">         m_namedGridLine = namedGridLine;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -122,7 +125,13 @@
</span><span class="cx">     {
</span><span class="cx">         return isAuto() || isSpan();
</span><span class="cx">     }
</span><ins>+
</ins><span class="cx"> private:
</span><ins>+    void setIntegerPosition(int integerPosition)
+    {
+        m_integerPosition = clampTo(integerPosition, -kGridMaxTracks, kGridMaxTracks);
+    }
+
</ins><span class="cx">     GridPositionType m_type;
</span><span class="cx">     int m_integerPosition;
</span><span class="cx">     String m_namedGridLine;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/Tools/ChangeLog        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2017-01-04  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix crash clamping grid lines
+        https://bugs.webkit.org/show_bug.cgi?id=166637
+
+        Reviewed by Darin Adler.
+
+        Creates new unit test to verify that the maximum tracks limit
+        is used in GridPosition too.
+
+        * TestWebKitAPI/PlatformEfl.cmake:
+        * TestWebKitAPI/PlatformGTK.cmake:
+        * TestWebKitAPI/PlatformWin.cmake:
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebCore/GridPosition.cpp: Added.
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2017-01-04  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move editing history scripts to WebCore PrivateHeaders
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformEfl.cmake (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformEfl.cmake        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/Tools/TestWebKitAPI/PlatformEfl.cmake        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> set(test_webcore_BINARIES
</span><span class="cx">     CSSParser
</span><ins>+    GridPosition
</ins><span class="cx">     HTMLParserIdioms
</span><span class="cx">     LayoutUnit
</span><span class="cx">     URL
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformGTK.cmake (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformGTK.cmake        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/Tools/TestWebKitAPI/PlatformGTK.cmake        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -132,6 +132,7 @@
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/TestsController.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileSystem.cpp
</span><ins>+    ${TESTWEBKITAPI_DIR}/Tests/WebCore/GridPosition.cpp
</ins><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformWin.cmake (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformWin.cmake        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/Tools/TestWebKitAPI/PlatformWin.cmake        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatRect.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatPoint.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatSize.cpp
</span><ins>+    ${TESTWEBKITAPI_DIR}/Tests/WebCore/GridPosition.cpp
</ins><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntRect.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntPoint.cpp
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (210319 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-01-05 06:45:48 UTC (rev 210319)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -430,6 +430,7 @@
</span><span class="cx">                 835CF9671D25FCD6001A65D4 /* RestoreSessionStateWithoutNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 835CF9661D25FCD6001A65D4 /* RestoreSessionStateWithoutNavigation.cpp */; };
</span><span class="cx">                 837A35F11D9A1E7D00663C57 /* DownloadRequestBlobURL.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 837A35F01D9A1E6400663C57 /* DownloadRequestBlobURL.html */; };
</span><span class="cx">                 83CF1C301C4F1B8B00688447 /* StringUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83CF1C2C1C4F19AE00688447 /* StringUtilities.mm */; };
</span><ins>+                8E4A85371E1D1AB200F53B0F /* GridPosition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E4A85361E1D1AA100F53B0F /* GridPosition.cpp */; };
</ins><span class="cx">                 930AD402150698D00067970F /* lots-of-text.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 930AD401150698B30067970F /* lots-of-text.html */; };
</span><span class="cx">                 9329AA291DE3F81E003ABD07 /* TextBreakIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9329AA281DE3F81E003ABD07 /* TextBreakIterator.cpp */; };
</span><span class="cx">                 932AE53D1D371047005DFFAF /* focus-inputs.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 93575C551D30366E000D604D /* focus-inputs.html */; };
</span><span class="lines">@@ -1086,6 +1087,7 @@
</span><span class="cx">                 8A3AF93A16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReloadPageAfterCrash.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8AA28C1916D2FA7B002FF4DB /* LoadPageOnCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadPageOnCrash.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */ = {isa = PBXFileReference; explicitFileType = &quot;compiled.mach-o.executable&quot;; includeInIndex = 0; path = TestWebKitAPI; sourceTree = BUILT_PRODUCTS_DIR; };
</span><ins>+                8E4A85361E1D1AA100F53B0F /* GridPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GridPosition.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 930AD401150698B30067970F /* lots-of-text.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;lots-of-text.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9329AA281DE3F81E003ABD07 /* TextBreakIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBreakIterator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9331407B17B4419000F083B1 /* DidNotHandleKeyDown.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DidNotHandleKeyDown.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1542,6 +1544,7 @@
</span><span class="cx">                 440A1D3614A01000008A66F2 /* WebCore */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                8E4A85361E1D1AA100F53B0F /* GridPosition.cpp */,
</ins><span class="cx">                                 CD89D0371C4EDB1300040A04 /* cocoa */,
</span><span class="cx">                                 7A909A6F1D877475007E10F8 /* AffineTransform.cpp */,
</span><span class="cx">                                 7A909A701D877475007E10F8 /* FloatPoint.cpp */,
</span><span class="lines">@@ -2618,6 +2621,7 @@
</span><span class="cx">                                 7CCE7F0E1A411AE600447C4C /* ResizeReversePaginatedWebView.cpp in Sources */,
</span><span class="cx">                                 7CCE7F0F1A411AE600447C4C /* ResizeWindowAfterCrash.cpp in Sources */,
</span><span class="cx">                                 7CCE7F101A411AE600447C4C /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */,
</span><ins>+                                8E4A85371E1D1AB200F53B0F /* GridPosition.cpp in Sources */,
</ins><span class="cx">                                 7CCE7F111A411AE600447C4C /* RestoreSessionStateContainingFormData.cpp in Sources */,
</span><span class="cx">                                 7A909A811D877480007E10F8 /* IntPoint.cpp in Sources */,
</span><span class="cx">                                 835CF9671D25FCD6001A65D4 /* RestoreSessionStateWithoutNavigation.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreGridPositioncpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebCore/GridPosition.cpp (0 => 210320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/GridPosition.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/GridPosition.cpp        2017-01-05 07:03:09 UTC (rev 210320)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2017 Igalia, S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#include &lt;WebCore/GridPosition.h&gt;
+
+namespace TestWebKitAPI {
+
+TEST(GridPositionTest, GridPositionLimits)
+{
+#if ENABLE(CSS_GRID_LAYOUT)
+
+    WebCore::GridPosition gridPosition;
+
+    gridPosition.setExplicitPosition(999999, &quot;&quot;);
+    EXPECT_EQ(gridPosition.integerPosition(), 999999);
+    gridPosition.setExplicitPosition(1000000, &quot;&quot;);
+    EXPECT_EQ(gridPosition.integerPosition(), 1000000);
+    gridPosition.setExplicitPosition(1000001, &quot;&quot;);
+    EXPECT_EQ(gridPosition.integerPosition(), 1000000);
+    gridPosition.setExplicitPosition(INT_MAX, &quot;&quot;);
+    EXPECT_EQ(gridPosition.integerPosition(), 1000000);
+    gridPosition.setExplicitPosition(-999999, &quot;&quot;);
+    EXPECT_EQ(gridPosition.integerPosition(), -999999);
+    gridPosition.setExplicitPosition(-1000000, &quot;&quot;);
+    EXPECT_EQ(gridPosition.integerPosition(), -1000000);
+    gridPosition.setExplicitPosition(-1000001, &quot;&quot;);
+    EXPECT_EQ(gridPosition.integerPosition(), -1000000);
+    gridPosition.setExplicitPosition(INT_MIN, &quot;&quot;);
+    EXPECT_EQ(gridPosition.integerPosition(), -1000000);
+
+    gridPosition.setSpanPosition(999999, &quot;&quot;);
+    EXPECT_EQ(gridPosition.spanPosition(), 999999);
+    gridPosition.setSpanPosition(1000000, &quot;&quot;);
+    EXPECT_EQ(gridPosition.spanPosition(), 1000000);
+    gridPosition.setSpanPosition(1000001, &quot;&quot;);
+    EXPECT_EQ(gridPosition.spanPosition(), 1000000);
+    gridPosition.setSpanPosition(INT_MAX, &quot;&quot;);
+    EXPECT_EQ(gridPosition.spanPosition(), 1000000);
+    gridPosition.setSpanPosition(-999999, &quot;&quot;);
+    EXPECT_EQ(gridPosition.spanPosition(), -999999);
+    gridPosition.setSpanPosition(-1000000, &quot;&quot;);
+    EXPECT_EQ(gridPosition.spanPosition(), -1000000);
+    gridPosition.setSpanPosition(-1000001, &quot;&quot;);
+    EXPECT_EQ(gridPosition.spanPosition(), -1000000);
+    gridPosition.setSpanPosition(INT_MIN, &quot;&quot;);
+    EXPECT_EQ(gridPosition.spanPosition(), -1000000);
+
+#endif // ENABLE(CSS_GRID_LAYOUT)
+}
+
+} // namespace TestWebKitAPI
</ins></span></pre>
</div>
</div>

</body>
</html>