<!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>[198210] trunk/Source/WebCore</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/198210">198210</a></dd>
<dt>Author</dt> <dd>rego@igalia.com</dd>
<dt>Date</dt> <dd>2016-03-15 08:10:07 -0700 (Tue, 15 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[css-grid] Rename GridCoordinate to GridArea
https://bugs.webkit.org/show_bug.cgi?id=155489
Reviewed by Sergio Villar Senin.
As the comment in GridCoordinate states,
it actually represents a grid area as it stores
the initial and final positions in both axis (columns and rows).
Someone can think about a grid coordinate just like a single cell.
However this class was representing an area of several cells.
On top of that the "grid area" concept is defined in the spec:
https://drafts.csswg.org/css-grid/#grid-area-concept
No new tests, no change of behavior.
* WebCore.xcodeproj/project.pbxproj:
* css/CSSGridTemplateAreasValue.cpp:
(WebCore::stringForPosition):
* css/CSSGridTemplateAreasValue.h:
* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateAreasRow):
* css/CSSParser.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
(WebCore::RenderGrid::insertItemIntoGrid):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::clearGrid):
(WebCore::RenderGrid::cachedGridArea):
(WebCore::RenderGrid::cachedGridSpan):
* rendering/RenderGrid.h:
* rendering/style/GridArea.h: Renamed from Source/WebCore/rendering/style/GridCoordinate.h.
(WebCore::GridSpan::untranslatedDefiniteGridSpan):
(WebCore::GridSpan::translatedDefiniteGridSpan):
(WebCore::GridSpan::indefiniteGridSpan):
(WebCore::GridSpan::operator==):
(WebCore::GridSpan::integerSpan):
(WebCore::GridSpan::untranslatedResolvedInitialPosition):
(WebCore::GridSpan::untranslatedResolvedFinalPosition):
(WebCore::GridSpan::resolvedInitialPosition):
(WebCore::GridSpan::resolvedFinalPosition):
(WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
(WebCore::GridSpan::GridSpanIterator::operator unsigned&):
(WebCore::GridSpan::GridSpanIterator::operator*):
(WebCore::GridSpan::begin):
(WebCore::GridSpan::end):
(WebCore::GridSpan::isTranslatedDefinite):
(WebCore::GridSpan::isIndefinite):
(WebCore::GridSpan::translate):
(WebCore::GridSpan::GridSpan):
(WebCore::GridArea::GridArea):
(WebCore::GridArea::operator==):
(WebCore::GridArea::operator!=):
* rendering/style/GridPositionsResolver.cpp:
* rendering/style/StyleGridData.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSGridTemplateAreasValuecpp">trunk/Source/WebCore/css/CSSGridTemplateAreasValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSGridTemplateAreasValueh">trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridh">trunk/Source/WebCore/rendering/RenderGrid.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleGridPositionsResolvercpp">trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleGridDatah">trunk/Source/WebCore/rendering/style/StyleGridData.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderingstyleGridAreah">trunk/Source/WebCore/rendering/style/GridArea.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderingstyleGridCoordinateh">trunk/Source/WebCore/rendering/style/GridCoordinate.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/ChangeLog        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -1,3 +1,66 @@
</span><ins>+2016-03-15 Manuel Rego Casasnovas <rego@igalia.com>
+
+ [css-grid] Rename GridCoordinate to GridArea
+ https://bugs.webkit.org/show_bug.cgi?id=155489
+
+ Reviewed by Sergio Villar Senin.
+
+ As the comment in GridCoordinate states,
+ it actually represents a grid area as it stores
+ the initial and final positions in both axis (columns and rows).
+
+ Someone can think about a grid coordinate just like a single cell.
+ However this class was representing an area of several cells.
+
+ On top of that the "grid area" concept is defined in the spec:
+ https://drafts.csswg.org/css-grid/#grid-area-concept
+
+ No new tests, no change of behavior.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSGridTemplateAreasValue.cpp:
+ (WebCore::stringForPosition):
+ * css/CSSGridTemplateAreasValue.h:
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseGridTemplateAreasRow):
+ * css/CSSParser.h:
+ * rendering/RenderGrid.cpp:
+ (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
+ (WebCore::RenderGrid::insertItemIntoGrid):
+ (WebCore::RenderGrid::placeItemsOnGrid):
+ (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
+ (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
+ (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
+ (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
+ (WebCore::RenderGrid::clearGrid):
+ (WebCore::RenderGrid::cachedGridArea):
+ (WebCore::RenderGrid::cachedGridSpan):
+ * rendering/RenderGrid.h:
+ * rendering/style/GridArea.h: Renamed from Source/WebCore/rendering/style/GridCoordinate.h.
+ (WebCore::GridSpan::untranslatedDefiniteGridSpan):
+ (WebCore::GridSpan::translatedDefiniteGridSpan):
+ (WebCore::GridSpan::indefiniteGridSpan):
+ (WebCore::GridSpan::operator==):
+ (WebCore::GridSpan::integerSpan):
+ (WebCore::GridSpan::untranslatedResolvedInitialPosition):
+ (WebCore::GridSpan::untranslatedResolvedFinalPosition):
+ (WebCore::GridSpan::resolvedInitialPosition):
+ (WebCore::GridSpan::resolvedFinalPosition):
+ (WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
+ (WebCore::GridSpan::GridSpanIterator::operator unsigned&):
+ (WebCore::GridSpan::GridSpanIterator::operator*):
+ (WebCore::GridSpan::begin):
+ (WebCore::GridSpan::end):
+ (WebCore::GridSpan::isTranslatedDefinite):
+ (WebCore::GridSpan::isIndefinite):
+ (WebCore::GridSpan::translate):
+ (WebCore::GridSpan::GridSpan):
+ (WebCore::GridArea::GridArea):
+ (WebCore::GridArea::operator==):
+ (WebCore::GridArea::operator!=):
+ * rendering/style/GridPositionsResolver.cpp:
+ * rendering/style/StyleGridData.h:
+
</ins><span class="cx"> 2016-03-15 Joonghun Park <jh718.park@samsung.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Remove duplicate HashMap traversal and unneeded reference count churn in DataObjectGtk::forClipboard
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -6039,7 +6039,7 @@
</span><span class="cx">                 CD3A496217A9D01B00274E42 /* SourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495917A9D01B00274E42 /* SourceBuffer.h */; };
</span><span class="cx">                 CD3A496417A9D01B00274E42 /* SourceBufferList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3A495B17A9D01B00274E42 /* SourceBufferList.cpp */; };
</span><span class="cx">                 CD3A496517A9D01B00274E42 /* SourceBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495C17A9D01B00274E42 /* SourceBufferList.h */; };
</span><del>-                CD3E251C18046B0600E27F56 /* GridCoordinate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3E251B18046B0600E27F56 /* GridCoordinate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                CD3E251C18046B0600E27F56 /* GridArea.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3E251B18046B0600E27F56 /* GridArea.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 CD3E252318046BCD00E27F56 /* CSSGridTemplateAreasValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3E252118046BCD00E27F56 /* CSSGridTemplateAreasValue.cpp */; };
</span><span class="cx">                 CD3E252418046BCD00E27F56 /* CSSGridTemplateAreasValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3E252218046BCD00E27F56 /* CSSGridTemplateAreasValue.h */; };
</span><span class="cx">                 CD4AC52A1496AE9A0087C4EF /* Composite.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD4AC5281496AE2F0087C4EF /* Composite.wav */; };
</span><span class="lines">@@ -14011,7 +14011,7 @@
</span><span class="cx">                 CD3A495B17A9D01B00274E42 /* SourceBufferList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceBufferList.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CD3A495C17A9D01B00274E42 /* SourceBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferList.h; sourceTree = "<group>"; };
</span><span class="cx">                 CD3A495D17A9D01B00274E42 /* SourceBufferList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SourceBufferList.idl; sourceTree = "<group>"; };
</span><del>-                CD3E251B18046B0600E27F56 /* GridCoordinate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GridCoordinate.h; sourceTree = "<group>"; };
</del><ins>+                CD3E251B18046B0600E27F56 /* GridArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GridArea.h; sourceTree = "<group>"; };
</ins><span class="cx">                 CD3E252118046BCD00E27F56 /* CSSGridTemplateAreasValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSGridTemplateAreasValue.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CD3E252218046BCD00E27F56 /* CSSGridTemplateAreasValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGridTemplateAreasValue.h; sourceTree = "<group>"; };
</span><span class="cx">                 CD4097FF1A8C855F004C65E9 /* CFNSURLConnectionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNSURLConnectionSPI.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -22560,7 +22560,7 @@
</span><span class="cx">                                 BC22746E0E83664500E7F975 /* DataRef.h */,
</span><span class="cx">                                 BC5EB69C0E81DAEB00B25965 /* FillLayer.cpp */,
</span><span class="cx">                                 BC5EB69D0E81DAEB00B25965 /* FillLayer.h */,
</span><del>-                                CD3E251B18046B0600E27F56 /* GridCoordinate.h */,
</del><ins>+                                CD3E251B18046B0600E27F56 /* GridArea.h */,
</ins><span class="cx">                                 CDEF4FD617E85C8F00AEE24B /* GridLength.h */,
</span><span class="cx">                                 A12705C21656BD6500C2E27C /* GridPosition.h */,
</span><span class="cx">                                 CDF7483C18FEBCEC0006ECC0 /* GridPositionsResolver.cpp */,
</span><span class="lines">@@ -26146,7 +26146,7 @@
</span><span class="cx">                                 CEC337AF1A46086D009B8523 /* GraphicsServicesSPI.h in Headers */,
</span><span class="cx">                                 B2A015AB0AF6CD53006BCE0E /* GraphicsTypes.h in Headers */,
</span><span class="cx">                                 77A17A7B12F2890B004E02F6 /* GraphicsTypes3D.h in Headers */,
</span><del>-                                CD3E251C18046B0600E27F56 /* GridCoordinate.h in Headers */,
</del><ins>+                                CD3E251C18046B0600E27F56 /* GridArea.h in Headers */,
</ins><span class="cx">                                 CDEF4FD717E85C8F00AEE24B /* GridLength.h in Headers */,
</span><span class="cx">                                 A12705C31656BD6500C2E27C /* GridPosition.h in Headers */,
</span><span class="cx">                                 CDF7483F18FEBCEC0006ECC0 /* GridPositionsResolver.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGridTemplateAreasValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGridTemplateAreasValue.cpp (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGridTemplateAreasValue.cpp        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/css/CSSGridTemplateAreasValue.cpp        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">
</span><del>-#include "GridCoordinate.h"
</del><ins>+#include "GridArea.h"
</ins><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -54,14 +54,14 @@
</span><span class="cx"> Vector<String> candidates;
</span><span class="cx">
</span><span class="cx"> for (const auto& it : gridAreaMap) {
</span><del>- const GridCoordinate& coordinate = it.value;
- if (row >= coordinate.rows.resolvedInitialPosition() && row < coordinate.rows.resolvedFinalPosition())
</del><ins>+ const GridArea& area = it.value;
+ if (row >= area.rows.resolvedInitialPosition() && row < area.rows.resolvedFinalPosition())
</ins><span class="cx"> candidates.append(it.key);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (const auto& it : gridAreaMap) {
</span><del>- const GridCoordinate& coordinate = it.value;
- if (column >= coordinate.columns.resolvedInitialPosition() && column < coordinate.columns.resolvedFinalPosition() && candidates.contains(it.key))
</del><ins>+ const GridArea& area = it.value;
+ if (column >= area.columns.resolvedInitialPosition() && column < area.columns.resolvedFinalPosition() && candidates.contains(it.key))
</ins><span class="cx"> return it.key;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGridTemplateAreasValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">
</span><span class="cx"> #include "CSSValue.h"
</span><del>-#include "GridCoordinate.h"
</del><ins>+#include "GridArea.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> #include "Counter.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "FloatConversion.h"
</span><del>-#include "GridCoordinate.h"
</del><ins>+#include "GridArea.h"
</ins><span class="cx"> #include "HTMLParserIdioms.h"
</span><span class="cx"> #include "HashTools.h"
</span><span class="cx"> #include "MediaList.h"
</span><span class="lines">@@ -6249,24 +6249,24 @@
</span><span class="cx">
</span><span class="cx"> auto gridAreaIterator = gridAreaMap.find(gridAreaName);
</span><span class="cx"> if (gridAreaIterator == gridAreaMap.end())
</span><del>- gridAreaMap.add(gridAreaName, GridCoordinate(GridSpan::translatedDefiniteGridSpan(rowCount, rowCount + 1), GridSpan::translatedDefiniteGridSpan(currentColumn, lookAheadColumn)));
</del><ins>+ gridAreaMap.add(gridAreaName, GridArea(GridSpan::translatedDefiniteGridSpan(rowCount, rowCount + 1), GridSpan::translatedDefiniteGridSpan(currentColumn, lookAheadColumn)));
</ins><span class="cx"> else {
</span><del>- GridCoordinate& gridCoordinate = gridAreaIterator->value;
</del><ins>+ GridArea& gridArea = gridAreaIterator->value;
</ins><span class="cx">
</span><span class="cx"> // The following checks test that the grid area is a single filled-in rectangle.
</span><span class="cx"> // 1. The new row is adjacent to the previously parsed row.
</span><del>- if (rowCount != gridCoordinate.rows.resolvedFinalPosition())
</del><ins>+ if (rowCount != gridArea.rows.resolvedFinalPosition())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // 2. The new area starts at the same position as the previously parsed area.
</span><del>- if (currentColumn != gridCoordinate.columns.resolvedInitialPosition())
</del><ins>+ if (currentColumn != gridArea.columns.resolvedInitialPosition())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // 3. The new area ends at the same position as the previously parsed area.
</span><del>- if (lookAheadColumn != gridCoordinate.columns.resolvedFinalPosition())
</del><ins>+ if (lookAheadColumn != gridArea.columns.resolvedFinalPosition())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- gridCoordinate.rows = GridSpan::translatedDefiniteGridSpan(gridCoordinate.rows.resolvedInitialPosition(), gridCoordinate.rows.resolvedFinalPosition() + 1);
</del><ins>+ gridArea.rows = GridSpan::translatedDefiniteGridSpan(gridArea.rows.resolvedInitialPosition(), gridArea.rows.resolvedFinalPosition() + 1);
</ins><span class="cx"> }
</span><span class="cx"> currentColumn = lookAheadColumn - 1;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/css/CSSParser.h        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> #include <wtf/text/TextPosition.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><del>-#include "GridCoordinate.h"
</del><ins>+#include "GridArea.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">
</span><del>-#include "GridCoordinate.h"
</del><ins>+#include "GridArea.h"
</ins><span class="cx"> #include "GridPositionsResolver.h"
</span><span class="cx"> #include "LayoutRepainter.h"
</span><span class="cx"> #include "RenderLayer.h"
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- std::unique_ptr<GridCoordinate> nextEmptyGridArea(unsigned fixedTrackSpan, unsigned varyingTrackSpan)
</del><ins>+ std::unique_ptr<GridArea> nextEmptyGridArea(unsigned fixedTrackSpan, unsigned varyingTrackSpan)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(fixedTrackSpan >= 1 && varyingTrackSpan >= 1);
</span><span class="cx">
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx"> const unsigned endOfVaryingTrackIndex = (m_direction == ForColumns) ? m_grid.size() : m_grid[0].size();
</span><span class="cx"> for (; varyingTrackIndex < endOfVaryingTrackIndex; ++varyingTrackIndex) {
</span><span class="cx"> if (isEmptyAreaEnough(rowSpan, columnSpan)) {
</span><del>- std::unique_ptr<GridCoordinate> result = std::make_unique<GridCoordinate>(GridSpan::translatedDefiniteGridSpan(m_rowIndex, m_rowIndex + rowSpan), GridSpan::translatedDefiniteGridSpan(m_columnIndex, m_columnIndex + columnSpan));
</del><ins>+ std::unique_ptr<GridArea> result = std::make_unique<GridArea>(GridSpan::translatedDefiniteGridSpan(m_rowIndex, m_rowIndex + rowSpan), GridSpan::translatedDefiniteGridSpan(m_columnIndex, m_columnIndex + columnSpan));
</ins><span class="cx"> // Advance the iterator to avoid an infinite loop where we would return the same grid area over and over.
</span><span class="cx"> ++varyingTrackIndex;
</span><span class="cx"> return result;
</span><span class="lines">@@ -1139,13 +1139,13 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RenderGrid::insertItemIntoGrid(RenderBox& child, const GridCoordinate& coordinate)
</del><ins>+void RenderGrid::insertItemIntoGrid(RenderBox& child, const GridArea& area)
</ins><span class="cx"> {
</span><del>- ASSERT(coordinate.rows.isTranslatedDefinite() && coordinate.columns.isTranslatedDefinite());
- ensureGridSize(coordinate.rows.resolvedFinalPosition(), coordinate.columns.resolvedFinalPosition());
</del><ins>+ ASSERT(area.rows.isTranslatedDefinite() && area.columns.isTranslatedDefinite());
+ ensureGridSize(area.rows.resolvedFinalPosition(), area.columns.resolvedFinalPosition());
</ins><span class="cx">
</span><del>- for (auto row : coordinate.rows) {
- for (auto column : coordinate.columns)
</del><ins>+ for (auto row : area.rows) {
+ for (auto column : area.columns)
</ins><span class="cx"> m_grid[row][column].append(&child);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -1153,7 +1153,7 @@
</span><span class="cx"> void RenderGrid::placeItemsOnGrid()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!gridWasPopulated());
</span><del>- ASSERT(m_gridItemCoordinate.isEmpty());
</del><ins>+ ASSERT(m_gridItemArea.isEmpty());
</ins><span class="cx">
</span><span class="cx"> populateExplicitGridAndOrderIterator();
</span><span class="cx">
</span><span class="lines">@@ -1163,23 +1163,23 @@
</span><span class="cx"> if (child->isOutOfFlowPositioned())
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- GridCoordinate coordinate = cachedGridCoordinate(*child);
- if (!coordinate.rows.isIndefinite())
- coordinate.rows.translate(std::abs(m_smallestRowStart));
- if (!coordinate.columns.isIndefinite())
- coordinate.columns.translate(std::abs(m_smallestColumnStart));
- m_gridItemCoordinate.set(child, coordinate);
</del><ins>+ GridArea area = cachedGridArea(*child);
+ if (!area.rows.isIndefinite())
+ area.rows.translate(std::abs(m_smallestRowStart));
+ if (!area.columns.isIndefinite())
+ area.columns.translate(std::abs(m_smallestColumnStart));
+ m_gridItemArea.set(child, area);
</ins><span class="cx">
</span><del>- if (coordinate.rows.isIndefinite() || coordinate.columns.isIndefinite()) {
</del><ins>+ if (area.rows.isIndefinite() || area.columns.isIndefinite()) {
</ins><span class="cx"> bool majorAxisDirectionIsForColumns = autoPlacementMajorAxisDirection() == ForColumns;
</span><del>- if ((majorAxisDirectionIsForColumns && coordinate.columns.isIndefinite())
- || (!majorAxisDirectionIsForColumns && coordinate.rows.isIndefinite()))
</del><ins>+ if ((majorAxisDirectionIsForColumns && area.columns.isIndefinite())
+ || (!majorAxisDirectionIsForColumns && area.rows.isIndefinite()))
</ins><span class="cx"> autoMajorAxisAutoGridItems.append(child);
</span><span class="cx"> else
</span><span class="cx"> specifiedMajorAxisAutoGridItems.append(child);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- insertItemIntoGrid(*child, GridCoordinate(coordinate.rows, coordinate.columns));
</del><ins>+ insertItemIntoGrid(*child, GridArea(area.rows, area.columns));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT(gridRowCount() >= GridPositionsResolver::explicitGridRowCount(style()));
</span><span class="lines">@@ -1193,8 +1193,8 @@
</span><span class="cx"> if (child->isOutOfFlowPositioned())
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- GridCoordinate coordinate = cachedGridCoordinate(*child);
- ASSERT(coordinate.rows.isTranslatedDefinite() && coordinate.columns.isTranslatedDefinite());
</del><ins>+ GridArea area = cachedGridArea(*child);
+ ASSERT(area.rows.isTranslatedDefinite() && area.columns.isTranslatedDefinite());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="lines">@@ -1232,7 +1232,7 @@
</span><span class="cx"> maximumColumnIndex = std::max(maximumColumnIndex, spanSize);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- m_gridItemCoordinate.set(child, GridCoordinate(rowPositions, columnPositions));
</del><ins>+ m_gridItemArea.set(child, GridArea(rowPositions, columnPositions));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_grid.grow(maximumRowIndex + std::abs(m_smallestRowStart));
</span><span class="lines">@@ -1240,13 +1240,13 @@
</span><span class="cx"> column.grow(maximumColumnIndex + std::abs(m_smallestColumnStart));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<GridCoordinate> RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid(const RenderBox& gridItem, GridTrackSizingDirection specifiedDirection, const GridSpan& specifiedPositions) const
</del><ins>+std::unique_ptr<GridArea> RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid(const RenderBox& gridItem, GridTrackSizingDirection specifiedDirection, const GridSpan& specifiedPositions) const
</ins><span class="cx"> {
</span><span class="cx"> GridTrackSizingDirection crossDirection = specifiedDirection == ForColumns ? ForRows : ForColumns;
</span><span class="cx"> const unsigned endOfCrossDirection = crossDirection == ForColumns ? gridColumnCount() : gridRowCount();
</span><span class="cx"> unsigned crossDirectionSpanSize = GridPositionsResolver::spanSizeForAutoPlacedItem(style(), gridItem, crossDirection);
</span><span class="cx"> GridSpan crossDirectionPositions = GridSpan::translatedDefiniteGridSpan(endOfCrossDirection, endOfCrossDirection + crossDirectionSpanSize);
</span><del>- return std::make_unique<GridCoordinate>(specifiedDirection == ForColumns ? crossDirectionPositions : specifiedPositions, specifiedDirection == ForColumns ? specifiedPositions : crossDirectionPositions);
</del><ins>+ return std::make_unique<GridArea>(specifiedDirection == ForColumns ? crossDirectionPositions : specifiedPositions, specifiedDirection == ForColumns ? specifiedPositions : crossDirectionPositions);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderGrid::placeSpecifiedMajorAxisItemsOnGrid(const Vector<RenderBox*>& autoGridItems)
</span><span class="lines">@@ -1267,11 +1267,11 @@
</span><span class="cx"> unsigned majorAxisInitialPosition = majorAxisPositions.resolvedInitialPosition();
</span><span class="cx">
</span><span class="cx"> GridIterator iterator(m_grid, autoPlacementMajorAxisDirection(), majorAxisPositions.resolvedInitialPosition(), isGridAutoFlowDense ? 0 : minorAxisCursors.get(majorAxisInitialPosition));
</span><del>- std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea(majorAxisPositions.integerSpan(), minorAxisSpanSize);
</del><ins>+ std::unique_ptr<GridArea> emptyGridArea = iterator.nextEmptyGridArea(majorAxisPositions.integerSpan(), minorAxisSpanSize);
</ins><span class="cx"> if (!emptyGridArea)
</span><span class="cx"> emptyGridArea = createEmptyGridAreaAtSpecifiedPositionsOutsideGrid(*autoGridItem, autoPlacementMajorAxisDirection(), majorAxisPositions);
</span><span class="cx">
</span><del>- m_gridItemCoordinate.set(autoGridItem, *emptyGridArea);
</del><ins>+ m_gridItemArea.set(autoGridItem, *emptyGridArea);
</ins><span class="cx"> insertItemIntoGrid(*autoGridItem, *emptyGridArea);
</span><span class="cx">
</span><span class="cx"> if (!isGridAutoFlowDense)
</span><span class="lines">@@ -1303,7 +1303,7 @@
</span><span class="cx"> unsigned majorAxisAutoPlacementCursor = autoPlacementMajorAxisDirection() == ForColumns ? autoPlacementCursor.second : autoPlacementCursor.first;
</span><span class="cx"> unsigned minorAxisAutoPlacementCursor = autoPlacementMajorAxisDirection() == ForColumns ? autoPlacementCursor.first : autoPlacementCursor.second;
</span><span class="cx">
</span><del>- std::unique_ptr<GridCoordinate> emptyGridArea;
</del><ins>+ std::unique_ptr<GridArea> emptyGridArea;
</ins><span class="cx"> GridSpan minorAxisPositions = cachedGridSpan(gridItem, autoPlacementMinorAxisDirection());
</span><span class="cx"> if (minorAxisPositions.isTranslatedDefinite()) {
</span><span class="cx"> // Move to the next track in major axis if initial position in minor axis is before auto-placement cursor.
</span><span class="lines">@@ -1344,7 +1344,7 @@
</span><span class="cx"> emptyGridArea = createEmptyGridAreaAtSpecifiedPositionsOutsideGrid(gridItem, autoPlacementMinorAxisDirection(), GridSpan::translatedDefiniteGridSpan(0, minorAxisSpanSize));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- m_gridItemCoordinate.set(&gridItem, *emptyGridArea);
</del><ins>+ m_gridItemArea.set(&gridItem, *emptyGridArea);
</ins><span class="cx"> insertItemIntoGrid(gridItem, *emptyGridArea);
</span><span class="cx"> autoPlacementCursor.first = emptyGridArea->rows.resolvedInitialPosition();
</span><span class="cx"> autoPlacementCursor.second = emptyGridArea->columns.resolvedInitialPosition();
</span><span class="lines">@@ -1363,7 +1363,7 @@
</span><span class="cx"> void RenderGrid::clearGrid()
</span><span class="cx"> {
</span><span class="cx"> m_grid.clear();
</span><del>- m_gridItemCoordinate.clear();
</del><ins>+ m_gridItemArea.clear();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static const StyleContentAlignmentData& normalValueBehaviorGrid()
</span><span class="lines">@@ -1542,16 +1542,16 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-GridCoordinate RenderGrid::cachedGridCoordinate(const RenderBox& gridItem) const
</del><ins>+GridArea RenderGrid::cachedGridArea(const RenderBox& gridItem) const
</ins><span class="cx"> {
</span><del>- ASSERT(m_gridItemCoordinate.contains(&gridItem));
- return m_gridItemCoordinate.get(&gridItem);
</del><ins>+ ASSERT(m_gridItemArea.contains(&gridItem));
+ return m_gridItemArea.get(&gridItem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> GridSpan RenderGrid::cachedGridSpan(const RenderBox& gridItem, GridTrackSizingDirection direction) const
</span><span class="cx"> {
</span><del>- GridCoordinate coordinate = cachedGridCoordinate(gridItem);
- return direction == ForColumns ? coordinate.columns : coordinate.rows;
</del><ins>+ GridArea area = cachedGridArea(gridItem);
+ return direction == ForColumns ? area.columns : area.rows;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutUnit RenderGrid::gridAreaBreadthForChild(const RenderBox& child, GridTrackSizingDirection direction, const Vector<GridTrack>& tracks) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.h (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.h        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/rendering/RenderGrid.h        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class GridCoordinate;
</del><ins>+class GridArea;
</ins><span class="cx"> class GridSpan;
</span><span class="cx"> class GridTrack;
</span><span class="cx"> class GridItemWithSpan;
</span><span class="lines">@@ -77,10 +77,10 @@
</span><span class="cx"> void resolveContentBasedTrackSizingFunctions(GridTrackSizingDirection, GridSizingData&);
</span><span class="cx">
</span><span class="cx"> void ensureGridSize(unsigned maximumRowSize, unsigned maximumColumnSize);
</span><del>- void insertItemIntoGrid(RenderBox&, const GridCoordinate&);
</del><ins>+ void insertItemIntoGrid(RenderBox&, const GridArea&);
</ins><span class="cx"> void placeItemsOnGrid();
</span><span class="cx"> void populateExplicitGridAndOrderIterator();
</span><del>- std::unique_ptr<GridCoordinate> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid(const RenderBox&, GridTrackSizingDirection, const GridSpan&) const;
</del><ins>+ std::unique_ptr<GridArea> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid(const RenderBox&, GridTrackSizingDirection, const GridSpan&) const;
</ins><span class="cx"> void placeSpecifiedMajorAxisItemsOnGrid(const Vector<RenderBox*>&);
</span><span class="cx"> void placeAutoMajorAxisItemsOnGrid(const Vector<RenderBox*>&);
</span><span class="cx"> typedef std::pair<unsigned, unsigned> AutoPlacementCursor;
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> LayoutUnit rowAxisOffsetForChild(const RenderBox&) const;
</span><span class="cx"> ContentAlignmentData computeContentPositionAndDistributionOffset(GridTrackSizingDirection, const LayoutUnit& availableFreeSpace, unsigned numberOfGridTracks) const;
</span><span class="cx"> LayoutPoint findChildLogicalPosition(const RenderBox&) const;
</span><del>- GridCoordinate cachedGridCoordinate(const RenderBox&) const;
</del><ins>+ GridArea cachedGridArea(const RenderBox&) const;
</ins><span class="cx"> GridSpan cachedGridSpan(const RenderBox&, GridTrackSizingDirection) const;
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx"> Vector<Vector<Vector<RenderBox*, 1>>> m_grid;
</span><span class="cx"> Vector<LayoutUnit> m_columnPositions;
</span><span class="cx"> Vector<LayoutUnit> m_rowPositions;
</span><del>- HashMap<const RenderBox*, GridCoordinate> m_gridItemCoordinate;
</del><ins>+ HashMap<const RenderBox*, GridArea> m_gridItemArea;
</ins><span class="cx"> OrderIterator m_orderIterator;
</span><span class="cx">
</span><span class="cx"> Optional<LayoutUnit> m_minContentHeight;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleGridAreahfromrev198209trunkSourceWebCorerenderingstyleGridCoordinateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/rendering/style/GridArea.h (from rev 198209, trunk/Source/WebCore/rendering/style/GridCoordinate.h) (0 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/GridArea.h         (rev 0)
+++ trunk/Source/WebCore/rendering/style/GridArea.h        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -0,0 +1,212 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014, 2016 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GridArea_h
+#define GridArea_h
+
+#if ENABLE(CSS_GRID_LAYOUT)
+
+#include "GridPositionsResolver.h"
+#include <wtf/HashMap.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+// Recommended maximum size for both explicit and implicit grids.
+const int kGridMaxTracks = 1000000;
+
+// A span in a single direction (either rows or columns). Note that |resolvedInitialPosition|
+// and |resolvedFinalPosition| are grid lines' indexes.
+// Iterating over the span shouldn't include |resolvedFinalPosition| to be correct.
+class GridSpan {
+public:
+
+ static GridSpan untranslatedDefiniteGridSpan(int resolvedInitialPosition, int resolvedFinalPosition)
+ {
+ return GridSpan(resolvedInitialPosition, resolvedFinalPosition, UntranslatedDefinite);
+ }
+
+ static GridSpan translatedDefiniteGridSpan(unsigned resolvedInitialPosition, unsigned resolvedFinalPosition)
+ {
+ return GridSpan(resolvedInitialPosition, resolvedFinalPosition, TranslatedDefinite);
+ }
+
+ static GridSpan indefiniteGridSpan()
+ {
+ return GridSpan(0, 1, Indefinite);
+ }
+
+ bool operator==(const GridSpan& o) const
+ {
+ return m_type == o.m_type && m_resolvedInitialPosition == o.m_resolvedInitialPosition && m_resolvedFinalPosition == o.m_resolvedFinalPosition;
+ }
+
+ unsigned integerSpan() const
+ {
+ ASSERT(isTranslatedDefinite());
+ return m_resolvedFinalPosition - m_resolvedInitialPosition;
+ }
+
+ int untranslatedResolvedInitialPosition() const
+ {
+ ASSERT(m_type == UntranslatedDefinite);
+ return m_resolvedInitialPosition;
+ }
+
+ int untranslatedResolvedFinalPosition() const
+ {
+ ASSERT(m_type == UntranslatedDefinite);
+ return m_resolvedFinalPosition;
+ }
+
+ unsigned resolvedInitialPosition() const
+ {
+ ASSERT(isTranslatedDefinite());
+ ASSERT(m_resolvedFinalPosition >= 0);
+ return m_resolvedInitialPosition;
+ }
+
+ unsigned resolvedFinalPosition() const
+ {
+ ASSERT(isTranslatedDefinite());
+ ASSERT(m_resolvedFinalPosition > 0);
+ return m_resolvedFinalPosition;
+ }
+
+ struct GridSpanIterator {
+ GridSpanIterator(unsigned value)
+ : value(value)
+ {
+ }
+
+ operator unsigned&() { return value; }
+ unsigned operator*() const { return value; }
+
+ unsigned value;
+ };
+
+ GridSpanIterator begin() const
+ {
+ ASSERT(isTranslatedDefinite());
+ return m_resolvedInitialPosition;
+ }
+
+ GridSpanIterator end() const
+ {
+ ASSERT(isTranslatedDefinite());
+ return m_resolvedFinalPosition;
+ }
+
+ bool isTranslatedDefinite() const
+ {
+ return m_type == TranslatedDefinite;
+ }
+
+ bool isIndefinite() const
+ {
+ return m_type == Indefinite;
+ }
+
+ void translate(unsigned offset)
+ {
+ ASSERT(m_type == UntranslatedDefinite);
+
+ m_type = TranslatedDefinite;
+ m_resolvedInitialPosition += offset;
+ m_resolvedFinalPosition += offset;
+
+ ASSERT(m_resolvedInitialPosition >= 0);
+ ASSERT(m_resolvedFinalPosition > 0);
+ }
+
+private:
+
+ enum GridSpanType {UntranslatedDefinite, TranslatedDefinite, Indefinite};
+
+ GridSpan(int resolvedInitialPosition, int resolvedFinalPosition, GridSpanType type)
+ : m_type(type)
+ {
+#if ENABLE(ASSERT)
+ ASSERT(resolvedInitialPosition < resolvedFinalPosition);
+ if (type == TranslatedDefinite) {
+ ASSERT(resolvedInitialPosition >= 0);
+ ASSERT(resolvedFinalPosition > 0);
+ }
+#endif
+
+ m_resolvedInitialPosition = std::max(-kGridMaxTracks, std::min(resolvedInitialPosition, kGridMaxTracks - 1));
+ m_resolvedFinalPosition = std::max(-kGridMaxTracks + 1, std::min(resolvedFinalPosition, kGridMaxTracks));
+ }
+
+ int m_resolvedInitialPosition;
+ int m_resolvedFinalPosition;
+ GridSpanType m_type;
+
+
+};
+
+// This represents a grid area that spans in both rows' and columns' direction.
+class GridArea {
+public:
+ // HashMap requires a default constuctor.
+ GridArea()
+ : columns(GridSpan::indefiniteGridSpan())
+ , rows(GridSpan::indefiniteGridSpan())
+ {
+ }
+
+ GridArea(const GridSpan& r, const GridSpan& c)
+ : columns(c)
+ , rows(r)
+ {
+ }
+
+ bool operator==(const GridArea& o) const
+ {
+ return columns == o.columns && rows == o.rows;
+ }
+
+ bool operator!=(const GridArea& o) const
+ {
+ return !(*this == o);
+ }
+
+ GridSpan columns;
+ GridSpan rows;
+};
+
+typedef HashMap<String, GridArea> NamedGridAreaMap;
+
+} // namespace WebCore
+
+#endif /* ENABLE(CSS_GRID_LAYOUT) */
+
+#endif // GridArea_h
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleGridCoordinateh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/rendering/style/GridCoordinate.h (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/GridCoordinate.h        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/rendering/style/GridCoordinate.h        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -1,212 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2013, 2014 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GridCoordinate_h
-#define GridCoordinate_h
-
-#if ENABLE(CSS_GRID_LAYOUT)
-
-#include "GridPositionsResolver.h"
-#include <wtf/HashMap.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-// Recommended maximum size for both explicit and implicit grids.
-const int kGridMaxTracks = 1000000;
-
-// A span in a single direction (either rows or columns). Note that |resolvedInitialPosition|
-// and |resolvedFinalPosition| are grid lines' indexes.
-// Iterating over the span shouldn't include |resolvedFinalPosition| to be correct.
-class GridSpan {
-public:
-
- static GridSpan untranslatedDefiniteGridSpan(int resolvedInitialPosition, int resolvedFinalPosition)
- {
- return GridSpan(resolvedInitialPosition, resolvedFinalPosition, UntranslatedDefinite);
- }
-
- static GridSpan translatedDefiniteGridSpan(unsigned resolvedInitialPosition, unsigned resolvedFinalPosition)
- {
- return GridSpan(resolvedInitialPosition, resolvedFinalPosition, TranslatedDefinite);
- }
-
- static GridSpan indefiniteGridSpan()
- {
- return GridSpan(0, 1, Indefinite);
- }
-
- bool operator==(const GridSpan& o) const
- {
- return m_type == o.m_type && m_resolvedInitialPosition == o.m_resolvedInitialPosition && m_resolvedFinalPosition == o.m_resolvedFinalPosition;
- }
-
- unsigned integerSpan() const
- {
- ASSERT(isTranslatedDefinite());
- return m_resolvedFinalPosition - m_resolvedInitialPosition;
- }
-
- int untranslatedResolvedInitialPosition() const
- {
- ASSERT(m_type == UntranslatedDefinite);
- return m_resolvedInitialPosition;
- }
-
- int untranslatedResolvedFinalPosition() const
- {
- ASSERT(m_type == UntranslatedDefinite);
- return m_resolvedFinalPosition;
- }
-
- unsigned resolvedInitialPosition() const
- {
- ASSERT(isTranslatedDefinite());
- ASSERT(m_resolvedFinalPosition >= 0);
- return m_resolvedInitialPosition;
- }
-
- unsigned resolvedFinalPosition() const
- {
- ASSERT(isTranslatedDefinite());
- ASSERT(m_resolvedFinalPosition > 0);
- return m_resolvedFinalPosition;
- }
-
- struct GridSpanIterator {
- GridSpanIterator(unsigned value)
- : value(value)
- {
- }
-
- operator unsigned&() { return value; }
- unsigned operator*() const { return value; }
-
- unsigned value;
- };
-
- GridSpanIterator begin() const
- {
- ASSERT(isTranslatedDefinite());
- return m_resolvedInitialPosition;
- }
-
- GridSpanIterator end() const
- {
- ASSERT(isTranslatedDefinite());
- return m_resolvedFinalPosition;
- }
-
- bool isTranslatedDefinite() const
- {
- return m_type == TranslatedDefinite;
- }
-
- bool isIndefinite() const
- {
- return m_type == Indefinite;
- }
-
- void translate(unsigned offset)
- {
- ASSERT(m_type == UntranslatedDefinite);
-
- m_type = TranslatedDefinite;
- m_resolvedInitialPosition += offset;
- m_resolvedFinalPosition += offset;
-
- ASSERT(m_resolvedInitialPosition >= 0);
- ASSERT(m_resolvedFinalPosition > 0);
- }
-
-private:
-
- enum GridSpanType {UntranslatedDefinite, TranslatedDefinite, Indefinite};
-
- GridSpan(int resolvedInitialPosition, int resolvedFinalPosition, GridSpanType type)
- : m_type(type)
- {
-#if ENABLE(ASSERT)
- ASSERT(resolvedInitialPosition < resolvedFinalPosition);
- if (type == TranslatedDefinite) {
- ASSERT(resolvedInitialPosition >= 0);
- ASSERT(resolvedFinalPosition > 0);
- }
-#endif
-
- m_resolvedInitialPosition = std::max(-kGridMaxTracks, std::min(resolvedInitialPosition, kGridMaxTracks - 1));
- m_resolvedFinalPosition = std::max(-kGridMaxTracks + 1, std::min(resolvedFinalPosition, kGridMaxTracks));
- }
-
- int m_resolvedInitialPosition;
- int m_resolvedFinalPosition;
- GridSpanType m_type;
-
-
-};
-
-// This represents a grid area that spans in both rows' and columns' direction.
-class GridCoordinate {
-public:
- // HashMap requires a default constuctor.
- GridCoordinate()
- : columns(GridSpan::indefiniteGridSpan())
- , rows(GridSpan::indefiniteGridSpan())
- {
- }
-
- GridCoordinate(const GridSpan& r, const GridSpan& c)
- : columns(c)
- , rows(r)
- {
- }
-
- bool operator==(const GridCoordinate& o) const
- {
- return columns == o.columns && rows == o.rows;
- }
-
- bool operator!=(const GridCoordinate& o) const
- {
- return !(*this == o);
- }
-
- GridSpan columns;
- GridSpan rows;
-};
-
-typedef HashMap<String, GridCoordinate> NamedGridAreaMap;
-
-} // namespace WebCore
-
-#endif /* ENABLE(CSS_GRID_LAYOUT) */
-
-#endif // GridCoordinate_h
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleGridPositionsResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">
</span><del>-#include "GridCoordinate.h"
</del><ins>+#include "GridArea.h"
</ins><span class="cx"> #include "RenderBox.h"
</span><span class="cx"> #include <cstdlib>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleGridDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleGridData.h (198209 => 198210)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleGridData.h        2016-03-15 14:21:49 UTC (rev 198209)
+++ trunk/Source/WebCore/rendering/style/StyleGridData.h        2016-03-15 15:10:07 UTC (rev 198210)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">
</span><del>-#include "GridCoordinate.h"
</del><ins>+#include "GridArea.h"
</ins><span class="cx"> #include "GridTrackSize.h"
</span><span class="cx"> #include "RenderStyleConstants.h"
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span></span></pre>
</div>
</div>
</body>
</html>