[CSS Grid Layout] Add GridSpan::iterator
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 08:28:59 +0000 (08:28 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 08:28:59 +0000 (08:28 +0000)
commit321974bb9daa92277d1114178f599d27405b361a
tree4cafa35d0119f8f19186ccabc0d5c569f68f472c
parent910ef4de5419dbfe569f8e7607b5f88c0857d6a9
[CSS Grid Layout] Add GridSpan::iterator
https://bugs.webkit.org/show_bug.cgi?id=134058

Reviewed by Bem Jones-Bey.

Once that GridResolvedPosition has been introduced in r169934, this
patch adds a GridSpan::iterator which allows to simplify the loops over
GridResolvedPositions.
From now on we could use range-based for loops.

No new tests as it is already covered by current tests
(fast/css-grid-layout/).

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeNormalizedFractionBreadth): Change loop to
ranged-based for.
(WebCore::RenderGrid::insertItemIntoGrid): Ditto.
(WebCore::RenderGrid::gridAreaBreadthForChild): Ditto.
* rendering/style/GridCoordinate.h: Define GridSpan::iterator.
(WebCore::GridSpan::begin): Return resolved initial position.
(WebCore::GridSpan::end): Return next to resolved final position.
* rendering/style/GridResolvedPosition.h:
(WebCore::GridResolvedPosition::operator*): Add operator required by
range-based for loops.
(WebCore::GridResolvedPosition::operator!=): Add not equal operator.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/style/GridCoordinate.h
Source/WebCore/rendering/style/GridResolvedPosition.h