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

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: TestExpectations Created 4 years, 12 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..7b8b1eae7c2724c5214b3a49e346f034c296d3a7
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/OrthogonalWritingModeRootList.cpp
@@ -0,0 +1,40 @@
+// Copyright 2015 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))
+ return object;
+ }
+
+ m_isIterating = false;
+ return nullptr;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698