OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/rendering/OrderIterator.h" | 32 #include "core/rendering/OrderIterator.h" |
33 | 33 |
34 #include "core/rendering/RenderFlexibleBox.h" | 34 #include "core/rendering/RenderFlexibleBox.h" |
| 35 #include "core/rendering/RenderGrid.h" |
35 | 36 |
36 namespace WebCore { | 37 namespace WebCore { |
37 | 38 |
38 OrderIterator::OrderIterator(const RenderFlexibleBox* flexibleBox) | 39 OrderIterator::OrderIterator(const RenderBox* containerBox) |
39 : m_flexibleBox(flexibleBox) | 40 : m_containerBox(containerBox) |
40 , m_currentChild(0) | 41 , m_currentChild(0) |
41 , m_orderValuesIterator(0) | 42 , m_orderValuesIterator(0) |
42 { | 43 { |
43 } | 44 } |
44 | 45 |
45 void OrderIterator::setOrderValues(Vector<int>& orderValues) | 46 void OrderIterator::setOrderValues(Vector<int>& orderValues) |
46 { | 47 { |
47 reset(); | 48 reset(); |
48 m_orderValues.clear(); | 49 m_orderValues.clear(); |
49 | 50 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 if (m_orderValuesIterator == m_orderValues.end()) | 85 if (m_orderValuesIterator == m_orderValues.end()) |
85 return 0; | 86 return 0; |
86 if (m_orderValuesIterator) { | 87 if (m_orderValuesIterator) { |
87 ++m_orderValuesIterator; | 88 ++m_orderValuesIterator; |
88 if (m_orderValuesIterator == m_orderValues.end()) | 89 if (m_orderValuesIterator == m_orderValues.end()) |
89 return 0; | 90 return 0; |
90 } else { | 91 } else { |
91 m_orderValuesIterator = m_orderValues.begin(); | 92 m_orderValuesIterator = m_orderValues.begin(); |
92 } | 93 } |
93 | 94 |
94 m_currentChild = m_flexibleBox->firstChildBox(); | 95 m_currentChild = m_containerBox->firstChildBox(); |
95 } else { | 96 } else { |
96 m_currentChild = m_currentChild->nextSiblingBox(); | 97 m_currentChild = m_currentChild->nextSiblingBox(); |
97 } | 98 } |
98 } while (!m_currentChild || m_currentChild->style()->order() != *m_orderValu
esIterator); | 99 } while (!m_currentChild || m_currentChild->style()->order() != *m_orderValu
esIterator); |
99 | 100 |
100 return m_currentChild; | 101 return m_currentChild; |
101 } | 102 } |
102 | 103 |
103 void OrderIterator::reset() | 104 void OrderIterator::reset() |
104 { | 105 { |
105 m_currentChild = 0; | 106 m_currentChild = 0; |
106 m_orderValuesIterator = 0; | 107 m_orderValuesIterator = 0; |
107 } | 108 } |
108 | 109 |
109 } // namespace WebCore | 110 } // namespace WebCore |
OLD | NEW |