| Index: third_party/WebKit/Source/core/frame/LayoutSubtreeRootList.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/LayoutSubtreeRootList.cpp b/third_party/WebKit/Source/core/frame/LayoutSubtreeRootList.cpp
|
| index d41fc493325a74c4d71f16896957959420efdaac..1a6375308f47085286a24454dfad6f7c69f0af17 100644
|
| --- a/third_party/WebKit/Source/core/frame/LayoutSubtreeRootList.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/LayoutSubtreeRootList.cpp
|
| @@ -6,51 +6,20 @@
|
|
|
| #include "core/layout/LayoutObject.h"
|
| #include "core/layout/LayoutView.h"
|
| -#include <algorithm>
|
|
|
| namespace blink {
|
|
|
| -unsigned LayoutSubtreeRootList::LayoutSubtree::determineDepth(LayoutObject* object)
|
| -{
|
| - unsigned depth = 1;
|
| - for (LayoutObject* parent = object->parent(); parent; parent = parent->parent())
|
| - ++depth;
|
| - return depth;
|
| -}
|
| -
|
| -void LayoutSubtreeRootList::removeRoot(LayoutObject& object)
|
| -{
|
| - auto root = m_roots.find(&object);
|
| - ASSERT(root == m_roots.end() || m_orderedRoots.isEmpty());
|
| - m_roots.remove(root);
|
| -}
|
| -
|
| void LayoutSubtreeRootList::clearAndMarkContainingBlocksForLayout()
|
| {
|
| - for (auto& iter : m_roots)
|
| + for (auto& iter : unordered())
|
| iter->markContainerChainForLayout(false);
|
| - m_roots.clear();
|
| + clear();
|
| }
|
|
|
| LayoutObject* LayoutSubtreeRootList::randomRoot()
|
| {
|
| ASSERT(!isEmpty());
|
| - return *m_roots.begin();
|
| -}
|
| -
|
| -LayoutObject* LayoutSubtreeRootList::takeDeepestRoot()
|
| -{
|
| - if (m_orderedRoots.isEmpty()) {
|
| - if (m_roots.isEmpty())
|
| - return 0;
|
| -
|
| - copyToVector(m_roots, m_orderedRoots);
|
| - std::sort(m_orderedRoots.begin(), m_orderedRoots.end());
|
| - m_roots.clear();
|
| - }
|
| - LayoutObject* root = m_orderedRoots.last().object;
|
| - m_orderedRoots.removeLast();
|
| - return root;
|
| + return *unordered().begin();
|
| }
|
|
|
| void LayoutSubtreeRootList::countObjectsNeedingLayoutInRoot(const LayoutObject* object, unsigned& needsLayoutObjects, unsigned& totalObjects)
|
| @@ -65,7 +34,7 @@ void LayoutSubtreeRootList::countObjectsNeedingLayoutInRoot(const LayoutObject*
|
| void LayoutSubtreeRootList::countObjectsNeedingLayout(unsigned& needsLayoutObjects, unsigned& totalObjects)
|
| {
|
| // TODO(leviw): This will double-count nested roots crbug.com/509141
|
| - for (auto& root : m_roots)
|
| + for (auto& root : unordered())
|
| countObjectsNeedingLayoutInRoot(root, needsLayoutObjects, totalObjects);
|
| }
|
|
|
|
|