Chromium Code Reviews| Index: third_party/WebKit/Source/core/style/GridArea.h |
| diff --git a/third_party/WebKit/Source/core/style/GridArea.h b/third_party/WebKit/Source/core/style/GridArea.h |
| index 52c3d0337cdc15a9636cff286f231158ac05fb9a..38d63f79dbff8898c1a47881b721d78ebf2f8632 100644 |
| --- a/third_party/WebKit/Source/core/style/GridArea.h |
| +++ b/third_party/WebKit/Source/core/style/GridArea.h |
| @@ -147,6 +147,8 @@ public: |
| ASSERT(m_endLine > 0); |
| } |
| + void adjustForDroppedTracks(size_t numDroppedTracks); |
|
Manuel Rego
2016/06/21 21:57:38
Why the implementation is not here like for the re
svillar
2016/06/23 08:09:42
Because it's kind of a non-written rule of the pro
|
| + |
| private: |
| enum GridSpanType {UntranslatedDefinite, TranslatedDefinite, Indefinite}; |
| @@ -178,6 +180,15 @@ private: |
| GridSpanType m_type; |
| }; |
| +void inline GridSpan::adjustForDroppedTracks(size_t numDroppedTracks) |
| +{ |
| + DCHECK(isTranslatedDefinite()); |
| + DCHECK_GE(static_cast<size_t>(m_startLine), numDroppedTracks); |
|
Manuel Rego
2016/06/21 21:57:38
You can use startLine() to avoid the manual cast h
svillar
2016/06/23 08:09:43
awesome
|
| + DCHECK_GE(static_cast<size_t>(m_endLine), numDroppedTracks); |
|
Manuel Rego
2016/06/21 21:57:38
m_endLine is always greater than m_startLine,
so t
svillar
2016/06/23 08:09:43
Acknowledged.
|
| + m_startLine -= numDroppedTracks; |
| + m_endLine -= numDroppedTracks; |
| +} |
| + |
| // This represents a grid area that spans in both rows' and columns' direction. |
| struct GridArea { |
| USING_FAST_MALLOC(GridArea); |
| @@ -205,10 +216,20 @@ public: |
| return !(*this == o); |
| } |
| + void adjustForDroppedTracks(size_t numDroppedColumns, size_t numDroppedRows); |
|
Manuel Rego
2016/06/21 21:57:38
Ditto.
|
| + |
| GridSpan columns; |
| GridSpan rows; |
| }; |
| +void inline GridArea::adjustForDroppedTracks(size_t numDroppedColumns, size_t numDroppedRows) |
| +{ |
| + if (numDroppedColumns) |
| + columns.adjustForDroppedTracks(numDroppedColumns); |
| + if (numDroppedRows) |
| + rows.adjustForDroppedTracks(numDroppedRows); |
| +} |
| + |
| typedef HashMap<String, GridArea> NamedGridAreaMap; |
| } // namespace blink |