<!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>[259981] 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/259981">259981</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2020-04-12 09:34:57 -0700 (Sun, 12 Apr 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>[LFC][TFC] Introduce dedicated SlotPosition/CellSpan structs
https://bugs.webkit.org/show_bug.cgi?id=210399

Reviewed by Antti Koivisto.

SlotPosition.column/row and CellSpan.column/row read better.

* layout/LayoutUnits.h:
(WebCore::Layout::SlotPosition::SlotPosition):
(WebCore::Layout::operator==):
(WTF::SlotPositionHash::hash):
(WTF::SlotPositionHash::equal):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::setRowSpan):
(WebCore::Layout::Box::setColumnSpan):
(WebCore::Layout::Box::rowSpan const):
(WebCore::Layout::Box::columnSpan const):
* layout/layouttree/LayoutBox.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Cell::Cell):
(WebCore::Layout::TableGrid::appendCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Cell::startColumn const):
(WebCore::Layout::TableGrid::Cell::endColumn const):
(WebCore::Layout::TableGrid::Cell::startRow const):
(WebCore::Layout::TableGrid::Cell::endRow const):
(WebCore::Layout::TableGrid::Cell::columnSpan const):
(WebCore::Layout::TableGrid::Cell::rowSpan const):
(WebCore::Layout::TableGrid::Cell::span const):
(WebCore::Layout::TableGrid::Cell::size const): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorelayoutLayoutUnitsh">trunk/Source/WebCore/layout/LayoutUnits.h</a></li>
<li><a href="#trunkSourceWebCorelayoutlayouttreeLayoutBoxcpp">trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutlayouttreeLayoutBoxh">trunk/Source/WebCore/layout/layouttree/LayoutBox.h</a></li>
<li><a href="#trunkSourceWebCorelayouttableformattingTableFormattingContextcpp">trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorelayouttableformattingTableGridcpp">trunk/Source/WebCore/layout/tableformatting/TableGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorelayouttableformattingTableGridh">trunk/Source/WebCore/layout/tableformatting/TableGrid.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (259980 => 259981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2020-04-12 16:05:26 UTC (rev 259980)
+++ trunk/Source/WebCore/ChangeLog      2020-04-12 16:34:57 UTC (rev 259981)
</span><span class="lines">@@ -1,5 +1,43 @@
</span><span class="cx"> 2020-04-12  Zalan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><ins>+        [LFC][TFC] Introduce dedicated SlotPosition/CellSpan structs
+        https://bugs.webkit.org/show_bug.cgi?id=210399
+
+        Reviewed by Antti Koivisto.
+
+        SlotPosition.column/row and CellSpan.column/row read better.
+
+        * layout/LayoutUnits.h:
+        (WebCore::Layout::SlotPosition::SlotPosition):
+        (WebCore::Layout::operator==):
+        (WTF::SlotPositionHash::hash):
+        (WTF::SlotPositionHash::equal):
+        (WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue):
+        (WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue):
+        (WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue):
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::setRowSpan):
+        (WebCore::Layout::Box::setColumnSpan):
+        (WebCore::Layout::Box::rowSpan const):
+        (WebCore::Layout::Box::columnSpan const):
+        * layout/layouttree/LayoutBox.h:
+        * layout/tableformatting/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
+        * layout/tableformatting/TableGrid.cpp:
+        (WebCore::Layout::TableGrid::Cell::Cell):
+        (WebCore::Layout::TableGrid::appendCell):
+        * layout/tableformatting/TableGrid.h:
+        (WebCore::Layout::TableGrid::Cell::startColumn const):
+        (WebCore::Layout::TableGrid::Cell::endColumn const):
+        (WebCore::Layout::TableGrid::Cell::startRow const):
+        (WebCore::Layout::TableGrid::Cell::endRow const):
+        (WebCore::Layout::TableGrid::Cell::columnSpan const):
+        (WebCore::Layout::TableGrid::Cell::rowSpan const):
+        (WebCore::Layout::TableGrid::Cell::span const):
+        (WebCore::Layout::TableGrid::Cell::size const): Deleted.
+
+2020-04-12  Zalan Bujtas  <zalan@apple.com>
+
</ins><span class="cx">         [LFC][TFC] Add table support to BlockFormattingContext::Geometry::inFlowWidthAndMargin
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=210400
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutLayoutUnitsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/LayoutUnits.h (259980 => 259981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/LayoutUnits.h        2020-04-12 16:05:26 UTC (rev 259980)
+++ trunk/Source/WebCore/layout/LayoutUnits.h   2020-04-12 16:34:57 UTC (rev 259981)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> #include "LayoutPoint.h"
</span><span class="cx"> #include "LayoutRect.h"
</span><span class="cx"> #include "MarginTypes.h"
</span><ins>+#include <wtf/HashFunctions.h>
+#include <wtf/HashTraits.h>
</ins><span class="cx"> #include <wtf/Optional.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -209,6 +211,48 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+struct SlotPosition {
+    SlotPosition() = default;
+    SlotPosition(size_t column, size_t row);
+
+    size_t column { 0 };
+    size_t row { 0 };
+};
+
+inline SlotPosition::SlotPosition(size_t column, size_t row)
+    : column(column)
+    , row(row)
+{
</ins><span class="cx"> }
</span><ins>+
+inline bool operator==(const SlotPosition& a, const SlotPosition& b)
+{
+    return a.column == b.column && a.row == b.row;
</ins><span class="cx"> }
</span><ins>+
+struct CellSpan {
+    size_t column { 1 };
+    size_t row { 1 };
+};
+
+}
+}
+
+namespace WTF {
+struct SlotPositionHash {
+    static unsigned hash(const WebCore::Layout::SlotPosition& slotPosition) { return pairIntHash(slotPosition.column, slotPosition.row); }
+    static bool equal(const WebCore::Layout::SlotPosition& a, const WebCore::Layout::SlotPosition& b) { return a == b; }
+    static const bool safeToCompareToEmptyOrDeleted = true;
+};
+template<> struct HashTraits<WebCore::Layout::SlotPosition> : GenericHashTraits<WebCore::Layout::SlotPosition> {
+    static WebCore::Layout::SlotPosition emptyValue() { return WebCore::Layout::SlotPosition(0, WebCore::intMinForLayoutUnit); }
+
+    static void constructDeletedValue(WebCore::Layout::SlotPosition& slot) { slot = WebCore::Layout::SlotPosition(WebCore::intMinForLayoutUnit, 0); }
+    static bool isDeletedValue(const WebCore::Layout::SlotPosition& slot) { return slot == WebCore::Layout::SlotPosition(WebCore::intMinForLayoutUnit, 0); }
+};
+template<> struct DefaultHash<WebCore::Layout::SlotPosition> {
+    typedef SlotPositionHash Hash;
+};
+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutlayouttreeLayoutBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (259980 => 259981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp     2020-04-12 16:05:26 UTC (rev 259980)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp        2020-04-12 16:34:57 UTC (rev 259981)
</span><span class="lines">@@ -387,28 +387,28 @@
</span><span class="cx">         && !isTableColumn();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Box::setRowSpan(unsigned rowSpan)
</del><ins>+void Box::setRowSpan(size_t rowSpan)
</ins><span class="cx"> {
</span><del>-    ensureRareData().rowSpan = rowSpan;
</del><ins>+    ensureRareData().tableCellSpan.row = rowSpan;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Box::setColumnSpan(unsigned columnSpan)
</del><ins>+void Box::setColumnSpan(size_t columnSpan)
</ins><span class="cx"> {
</span><del>-    ensureRareData().columnSpan = columnSpan;
</del><ins>+    ensureRareData().tableCellSpan.column = columnSpan;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned Box::rowSpan() const
</del><ins>+size_t Box::rowSpan() const
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRareData())
</span><span class="cx">         return 1;
</span><del>-    return rareData().rowSpan;
</del><ins>+    return rareData().tableCellSpan.row;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned Box::columnSpan() const
</del><ins>+size_t Box::columnSpan() const
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRareData())
</span><span class="cx">         return 1;
</span><del>-    return rareData().columnSpan;
</del><ins>+    return rareData().tableCellSpan.column;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Box::setColumnWidth(LayoutUnit columnWidth)
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutlayouttreeLayoutBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.h (259980 => 259981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/layouttree/LayoutBox.h       2020-04-12 16:05:26 UTC (rev 259980)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.h  2020-04-12 16:34:57 UTC (rev 259981)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
</span><span class="cx"> 
</span><ins>+#include "LayoutUnits.h"
</ins><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include <wtf/IsoMalloc.h>
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="lines">@@ -150,11 +151,11 @@
</span><span class="cx">     const RenderStyle& style() const { return m_style; }
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Find a better place for random DOM things.
</span><del>-    void setRowSpan(unsigned);
-    unsigned rowSpan() const;
</del><ins>+    void setRowSpan(size_t);
+    size_t rowSpan() const;
</ins><span class="cx"> 
</span><del>-    void setColumnSpan(unsigned);
-    unsigned columnSpan() const;
</del><ins>+    void setColumnSpan(size_t);
+    size_t columnSpan() const;
</ins><span class="cx"> 
</span><span class="cx">     void setColumnWidth(LayoutUnit);
</span><span class="cx">     Optional<LayoutUnit> columnWidth() const;
</span><span class="lines">@@ -178,8 +179,7 @@
</span><span class="cx">     public:
</span><span class="cx">         BoxRareData() = default;
</span><span class="cx"> 
</span><del>-        unsigned rowSpan { 1 };
-        unsigned columnSpan { 1 };
</del><ins>+        CellSpan tableCellSpan;
</ins><span class="cx">         Optional<LayoutUnit> columnWidth;
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorelayouttableformattingTableFormattingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp (259980 => 259981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp   2020-04-12 16:05:26 UTC (rev 259980)
+++ trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp      2020-04-12 16:34:57 UTC (rev 259981)
</span><span class="lines">@@ -259,21 +259,21 @@
</span><span class="cx">             formattingState.setIntrinsicWidthConstraintsForBox(cellBox, *intrinsicWidth);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        auto columnSpan = cell->size().width();
</del><ins>+        auto columnSpan = cell->span().column;
</ins><span class="cx">         auto slotIntrinsicWidth = FormattingContext::IntrinsicWidthConstraints { intrinsicWidth->minimum / columnSpan, intrinsicWidth->maximum / columnSpan };
</span><span class="cx">         auto initialPosition = cell->position();
</span><del>-        for (auto i = 0; i < columnSpan; ++i)
-            grid.slot({ initialPosition.x() + i, initialPosition.y() })->widthConstraints = slotIntrinsicWidth;
</del><ins>+        for (size_t i = 0; i < columnSpan; ++i)
+            grid.slot({ initialPosition.column + i, initialPosition.row })->widthConstraints = slotIntrinsicWidth;
</ins><span class="cx">     }
</span><span class="cx">     // 2. For each column, determine a maximum and minimum column width from the cells that span only that column.
</span><span class="cx">     //    The minimum is that required by the cell with the largest minimum cell width (or the column 'width', whichever is larger).
</span><span class="cx">     //    The maximum is that required by the cell with the largest maximum cell width (or the column 'width', whichever is larger).
</span><span class="cx">     auto& columnList = grid.columns().list();
</span><del>-    int numberOfRows = grid.rows().size();
-    int numberOfColumns = columnList.size();
-    for (int columnIndex = 0; columnIndex < numberOfColumns; ++columnIndex) {
</del><ins>+    auto numberOfRows = grid.rows().size();
+    auto numberOfColumns = columnList.size();
+    for (size_t columnIndex = 0; columnIndex < numberOfColumns; ++columnIndex) {
</ins><span class="cx">         auto columnIntrinsicWidths = FormattingContext::IntrinsicWidthConstraints { };
</span><del>-        for (int rowIndex = 0; rowIndex < numberOfRows; ++rowIndex) {
</del><ins>+        for (size_t rowIndex = 0; rowIndex < numberOfRows; ++rowIndex) {
</ins><span class="cx">             auto* slot = grid.slot({ columnIndex, rowIndex });
</span><span class="cx">             columnIntrinsicWidths.minimum = std::max(slot->widthConstraints.minimum, columnIntrinsicWidths.minimum);
</span><span class="cx">             columnIntrinsicWidths.maximum = std::max(slot->widthConstraints.maximum, columnIntrinsicWidths.maximum);
</span></span></pre></div>
<a id="trunkSourceWebCorelayouttableformattingTableGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/tableformatting/TableGrid.cpp (259980 => 259981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/tableformatting/TableGrid.cpp        2020-04-12 16:05:26 UTC (rev 259980)
+++ trunk/Source/WebCore/layout/tableformatting/TableGrid.cpp   2020-04-12 16:34:57 UTC (rev 259981)
</span><span class="lines">@@ -108,10 +108,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-TableGrid::Cell::Cell(const Box& cellBox, SlotPosition position, CellSize size)
</del><ins>+TableGrid::Cell::Cell(const Box& cellBox, SlotPosition position, CellSpan span)
</ins><span class="cx">     : m_layoutBox(makeWeakPtr(cellBox))
</span><span class="cx">     , m_position(position)
</span><del>-    , m_size(size)
</del><ins>+    , m_span(span)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -131,8 +131,8 @@
</span><span class="cx"> 
</span><span class="cx"> void TableGrid::appendCell(const Box& cellBox)
</span><span class="cx"> {
</span><del>-    int rowSpan = cellBox.rowSpan();
-    int columnSpan = cellBox.columnSpan();
</del><ins>+    auto rowSpan = cellBox.rowSpan();
+    auto columnSpan = cellBox.columnSpan();
</ins><span class="cx">     auto isInNewRow = !cellBox.previousSibling();
</span><span class="cx">     auto initialSlotPosition = SlotPosition { };
</span><span class="cx"> 
</span><span class="lines">@@ -141,28 +141,28 @@
</span><span class="cx">         auto lastSlotPosition = lastCell->position();
</span><span class="cx">         // First table cell in this row?
</span><span class="cx">         if (isInNewRow)
</span><del>-            initialSlotPosition = SlotPosition { 0, lastSlotPosition.y() + 1 };
</del><ins>+            initialSlotPosition = SlotPosition { 0, lastSlotPosition.row + 1 };
</ins><span class="cx">         else
</span><del>-            initialSlotPosition = SlotPosition { lastSlotPosition.x() + 1, lastSlotPosition.y() };
</del><ins>+            initialSlotPosition = SlotPosition { lastSlotPosition.column + 1, lastSlotPosition.row };
</ins><span class="cx"> 
</span><span class="cx">         // Pick the next available slot by avoiding row and column spanners.
</span><span class="cx">         while (true) {
</span><span class="cx">             if (!m_slotMap.contains(initialSlotPosition))
</span><span class="cx">                 break;
</span><del>-            initialSlotPosition.move(1, 0);
</del><ins>+            ++initialSlotPosition.column;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    auto cell = makeUnique<Cell>(cellBox, initialSlotPosition, CellSize { columnSpan, rowSpan });
</del><ins>+    auto cell = makeUnique<Cell>(cellBox, initialSlotPosition, CellSpan { columnSpan, rowSpan });
</ins><span class="cx">     // Row and column spanners create additional slots.
</span><del>-    for (int row = 1; row <= rowSpan; ++row) {
-        for (int column = 1; column <= columnSpan; ++column) {
-            auto position = SlotPosition { initialSlotPosition.x() + column - 1, initialSlotPosition.y() + row - 1 };
</del><ins>+    for (size_t row = 1; row <= rowSpan; ++row) {
+        for (size_t column = 1; column <= columnSpan; ++column) {
+            auto position = SlotPosition { initialSlotPosition.column + column - 1, initialSlotPosition.row + row - 1 };
</ins><span class="cx">             ASSERT(!m_slotMap.contains(position));
</span><span class="cx">             m_slotMap.add(position, makeUnique<Slot>(*cell));
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     // Initialize columns/rows if needed.
</span><del>-    auto missingNumberOfColumns = std::max<int>(0, initialSlotPosition.x() + columnSpan - m_columns.size()); 
</del><ins>+    auto missingNumberOfColumns = std::max<int>(0, initialSlotPosition.column + columnSpan - m_columns.size());
</ins><span class="cx">     for (auto column = 0; column < missingNumberOfColumns; ++column)
</span><span class="cx">         m_columns.addAnonymousColumn();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorelayouttableformattingTableGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/layout/tableformatting/TableGrid.h (259980 => 259981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/tableformatting/TableGrid.h  2020-04-12 16:05:26 UTC (rev 259980)
+++ trunk/Source/WebCore/layout/tableformatting/TableGrid.h     2020-04-12 16:34:57 UTC (rev 259981)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
</span><span class="cx"> 
</span><span class="cx"> #include "FormattingContext.h"
</span><del>-#include "IntPointHash.h"
</del><ins>+#include "LayoutUnits.h"
</ins><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/IsoMalloc.h>
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="lines">@@ -138,25 +138,23 @@
</span><span class="cx">         RowList m_rowList;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    using SlotPosition = IntPoint;
-    using CellSize = IntSize;
</del><span class="cx">     // Cell represents a <td> or <th>. It can span multiple slots in the grid.
</span><span class="cx">     class Cell : public CanMakeWeakPtr<Cell> {
</span><span class="cx">         WTF_MAKE_ISO_ALLOCATED_INLINE(Cell);
</span><span class="cx">     public:
</span><del>-        Cell(const Box&, SlotPosition, CellSize);
</del><ins>+        Cell(const Box&, SlotPosition, CellSpan);
</ins><span class="cx"> 
</span><del>-        size_t startColumn() const { return m_position.x(); }
-        size_t endColumn() const { return m_position.x() + m_size.width(); }
</del><ins>+        size_t startColumn() const { return m_position.column; }
+        size_t endColumn() const { return m_position.column + m_span.column; }
</ins><span class="cx"> 
</span><del>-        size_t startRow() const { return m_position.y(); }
-        size_t endRow() const { return m_position.y() + m_size.height(); }
</del><ins>+        size_t startRow() const { return m_position.row; }
+        size_t endRow() const { return m_position.row + m_span.row; }
</ins><span class="cx"> 
</span><del>-        size_t columnSpan() const { return m_size.width(); }
-        size_t rowSpan() const { return m_size.height(); }
</del><ins>+        size_t columnSpan() const { return m_span.column; }
+        size_t rowSpan() const { return m_span.row; }
</ins><span class="cx"> 
</span><span class="cx">         SlotPosition position() const { return m_position; }
</span><del>-        CellSize size() const { return m_size; }
</del><ins>+        CellSpan span() const { return m_span; }
</ins><span class="cx"> 
</span><span class="cx">         const Box& box() const { return *m_layoutBox.get(); }
</span><span class="cx"> 
</span><span class="lines">@@ -163,7 +161,7 @@
</span><span class="cx">     private:
</span><span class="cx">         WeakPtr<const Box> m_layoutBox;
</span><span class="cx">         SlotPosition m_position;
</span><del>-        CellSize m_size;
</del><ins>+        CellSpan m_span;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     struct Slot {
</span><span class="lines">@@ -201,4 +199,5 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>