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(LayoutObject* layoutObject) |
| 11 : m_layoutObject(layoutObject) {} |
| 12 |
| 13 NGBoxIterator::iterator& NGBoxIterator::iterator::operator=( |
| 14 const NGBoxIterator::iterator& otherValue) { |
| 15 m_layoutObject = otherValue.m_layoutObject; |
| 16 return (*this); |
| 17 } |
| 18 |
| 19 NGBoxIterator::iterator& NGBoxIterator::iterator::operator++() { |
| 20 if (m_layoutObject) |
| 21 m_layoutObject = m_layoutObject->nextSibling(); |
| 22 return (*this); |
| 23 } |
| 24 |
| 25 bool NGBoxIterator::iterator::operator!=(const iterator& other) { |
| 26 return m_layoutObject != other.m_layoutObject; |
| 27 } |
| 28 |
| 29 NGBox NGBoxIterator::iterator::operator*() { |
| 30 return NGBox(m_layoutObject); |
| 31 } |
| 32 |
| 33 NGBoxIterator::iterator NGBoxIterator::begin() const { |
| 34 if (m_layoutObject) |
| 35 return iterator(m_layoutObject->slowFirstChild()); |
| 36 return iterator(nullptr); |
| 37 } |
| 38 |
| 39 } // namespace blink |
OLD | NEW |