OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/layout/ng/ng_box_iterator.h" |
| 6 #include "core/layout/ng/ng_box.h" |
| 7 |
| 8 namespace blink { |
| 9 |
| 10 NGBoxIterator::NGBoxIterator(const LayoutObject* layoutObject) |
| 11 : m_layoutObject(layoutObject), m_currentChild(nullptr) {} |
| 12 |
| 13 NGBox NGBoxIterator::first() { |
| 14 reset(); |
| 15 return next(); |
| 16 } |
| 17 |
| 18 NGBox NGBoxIterator::next() { |
| 19 if (!m_currentChild) { |
| 20 m_currentChild = m_layoutObject->slowFirstChild(); |
| 21 } else { |
| 22 m_currentChild = m_layoutObject->nextSibling(); |
| 23 } |
| 24 return NGBox(m_currentChild); |
| 25 } |
| 26 |
| 27 void NGBoxIterator::reset() { |
| 28 m_currentChild = nullptr; |
| 29 } |
| 30 |
| 31 } // namespace blink |
OLD | NEW |