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

Unified Diff: Source/core/editing/CompositionUnderlineRangeFilter.h

Issue 1325563002: Avoid style clobbering in setCompositionFromExistingText. (2nd land) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Release Range on document detach and remove selectionStart/End Created 5 years, 3 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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/editing/CompositionUnderlineRangeFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/CompositionUnderlineRangeFilter.h
diff --git a/Source/core/editing/CompositionUnderlineRangeFilter.h b/Source/core/editing/CompositionUnderlineRangeFilter.h
deleted file mode 100644
index e4103015bc9eba7dc4e83d911c596e7374c9fef0..0000000000000000000000000000000000000000
--- a/Source/core/editing/CompositionUnderlineRangeFilter.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef CompositionUnderlineRangeFilter_h
-#define CompositionUnderlineRangeFilter_h
-
-#include "core/CoreExport.h"
-#include "core/editing/CompositionUnderline.h"
-#include "wtf/Allocator.h"
-#include "wtf/NotFound.h"
-#include "wtf/Vector.h"
-
-namespace blink {
-
-// A visitor class to yield elements of a sorted (by startOffset) list of
-// underlines, visiting only elements that intersect with specified *inclusive*
-// range [indexLo, indexHi].
-class CORE_EXPORT CompositionUnderlineRangeFilter {
- DISALLOW_ALLOCATION();
- WTF_MAKE_NONCOPYABLE(CompositionUnderlineRangeFilter);
-public:
- class ConstIterator {
- DISALLOW_ALLOCATION();
- public:
- ConstIterator(): m_filter(nullptr), m_index(0) { }
- const CompositionUnderline& operator*()
- {
- ASSERT(m_index != kNotFound);
- return m_filter->m_underlines[m_index];
- }
- ConstIterator& operator++()
- {
- if (m_index != kNotFound)
- m_index = m_filter->seekValidIndex(m_index + 1);
- return *this;
- }
- const CompositionUnderline* operator->()
- {
- ASSERT(m_index != kNotFound);
- return &m_filter->m_underlines[m_index];
- }
- bool operator==(const ConstIterator& other)
- {
- return other.m_index == m_index && other.m_filter == m_filter;
- }
- bool operator!=(const ConstIterator& other) { return !operator==(other); }
-
- private:
- friend class CompositionUnderlineRangeFilter;
-
- ConstIterator(CompositionUnderlineRangeFilter* filter, size_t index)
- : m_filter(filter)
- , m_index(index) { }
- CompositionUnderlineRangeFilter* m_filter;
- size_t m_index;
- };
-
- CompositionUnderlineRangeFilter(const Vector<CompositionUnderline>& underlines, size_t indexLo, size_t indexHi);
-
- ConstIterator begin() { return ConstIterator(this, seekValidIndex(0)); }
- const ConstIterator& end() { return m_theEnd; }
-
-private:
- friend class ConstIterator;
-
- // Returns |index| if |m_underlines[index]| intersects with range
- // [m_indexLo, m_indexHi]. Otherwise returns the index of the next
- // intersecting interval, or END if there are none left.
- size_t seekValidIndex(size_t index);
-
- // Assume that elements of |m_underlines| are sorted by |.startOffset|.
- const Vector<CompositionUnderline>& m_underlines;
- // The "query range" is the inclusive range [m_indexLo, m_indexHi].
- const size_t m_indexLo;
- const size_t m_indexHi;
- const ConstIterator m_theEnd;
-};
-
-} // namespace blink
-
-#endif
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/editing/CompositionUnderlineRangeFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698