Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_box_iterator.cc

Issue 2237623002: Demo patch that demonstrates simple block layout using Layout NG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed NGBlockLayoutAlgorithmTest Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_box_iterator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_box_iterator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698