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

Unified Diff: third_party/WebKit/Source/core/frame/OrthogonalWritingModeRootList.cpp

Issue 1549153002: Fix preferred logical widths of orthogonal writing modes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (merge conflict resolved) Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/OrthogonalWritingModeRootList.cpp
diff --git a/third_party/WebKit/Source/core/frame/OrthogonalWritingModeRootList.cpp b/third_party/WebKit/Source/core/frame/OrthogonalWritingModeRootList.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5f2bd3f95b1ac0e0223b381e31b7b47e45dae9b3
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/OrthogonalWritingModeRootList.cpp
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/frame/OrthogonalWritingModeRootList.h"
+
+#include "core/layout/LayoutObject.h"
+#include <algorithm>
+
+namespace blink {
+
+LayoutObject* OrthogonalWritingModeRootList::takeDeepestRoot()
+{
+ if (!m_isIterating) {
+ if (m_roots.isEmpty())
+ return nullptr;
+
+ if (m_isOrderedListDirty) {
+ copyToVector(m_roots, m_orderedRoots);
+ std::sort(m_orderedRoots.begin(), m_orderedRoots.end());
+ m_isOrderedListDirty = m_isAnyRemoved = false;
+ }
+
+ m_isIterating = true;
+ m_lastTaken = m_orderedRoots.rbegin();
+ return m_lastTaken->object;
+ }
+
+ for (++m_lastTaken; m_lastTaken != m_orderedRoots.rend(); ++m_lastTaken) {
+ LayoutObject* object = m_lastTaken->object;
+ // Check removals while iterating.
+ if (!m_isAnyRemoved || m_roots.contains(object))
esprehn 2016/01/31 00:44:56 what is this? How can the list be mutated while it
kojii 2016/01/31 01:12:20 Just mimic'ed what LayoutSubtreeRootList does, I'l
+ return object;
+ }
+
+ m_isIterating = false;
+ return nullptr;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698