OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/layout/DepthOrderedLayoutObjectList.h" | 5 #include "core/layout/DepthOrderedLayoutObjectList.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
8 #include "core/layout/LayoutObject.h" | 9 #include "core/layout/LayoutObject.h" |
9 #include <algorithm> | |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 struct DepthOrderedLayoutObjectListData { | 13 struct DepthOrderedLayoutObjectListData { |
14 // LayoutObjects sorted by depth (deepest first). This structure is only | 14 // LayoutObjects sorted by depth (deepest first). This structure is only |
15 // populated at the beginning of enumerations. See ordered(). | 15 // populated at the beginning of enumerations. See ordered(). |
16 Vector<DepthOrderedLayoutObjectList::LayoutObjectWithDepth> m_orderedObjects; | 16 Vector<DepthOrderedLayoutObjectList::LayoutObjectWithDepth> m_orderedObjects; |
17 | 17 |
18 // Outside of layout, LayoutObjects can be added and removed as needed such | 18 // Outside of layout, LayoutObjects can be added and removed as needed such |
19 // as when style was changed or destroyed. They're kept in this hashset to | 19 // as when style was changed or destroyed. They're kept in this hashset to |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 DepthOrderedLayoutObjectList::ordered() { | 73 DepthOrderedLayoutObjectList::ordered() { |
74 if (m_data->m_objects.isEmpty() || !m_data->m_orderedObjects.isEmpty()) | 74 if (m_data->m_objects.isEmpty() || !m_data->m_orderedObjects.isEmpty()) |
75 return m_data->m_orderedObjects; | 75 return m_data->m_orderedObjects; |
76 | 76 |
77 copyToVector(m_data->m_objects, m_data->m_orderedObjects); | 77 copyToVector(m_data->m_objects, m_data->m_orderedObjects); |
78 std::sort(m_data->m_orderedObjects.begin(), m_data->m_orderedObjects.end()); | 78 std::sort(m_data->m_orderedObjects.begin(), m_data->m_orderedObjects.end()); |
79 return m_data->m_orderedObjects; | 79 return m_data->m_orderedObjects; |
80 } | 80 } |
81 | 81 |
82 } // namespace blink | 82 } // namespace blink |
OLD | NEW |