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

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

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
Index: Source/core/editing/CompositionUnderlineRangeFilter.cpp
diff --git a/Source/core/editing/CompositionUnderlineRangeFilter.cpp b/Source/core/editing/CompositionUnderlineRangeFilter.cpp
deleted file mode 100644
index 083b35bd8847b9fb37f34f1625d75b72783d733c..0000000000000000000000000000000000000000
--- a/Source/core/editing/CompositionUnderlineRangeFilter.cpp
+++ /dev/null
@@ -1,39 +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.
-
-#include "config.h"
-#include "core/editing/CompositionUnderlineRangeFilter.h"
-
-namespace blink {
-
-CompositionUnderlineRangeFilter::CompositionUnderlineRangeFilter(const Vector<CompositionUnderline>& underlines, size_t indexLo, size_t indexHi)
- : m_underlines(underlines)
- , m_indexLo(indexLo)
- , m_indexHi(indexHi)
- , m_theEnd(this, kNotFound) { }
-
-size_t CompositionUnderlineRangeFilter::seekValidIndex(size_t index)
-{
- if (index == kNotFound)
- return kNotFound;
-
- size_t numUnderlines = m_underlines.size();
- while (index < numUnderlines) {
- const CompositionUnderline& underline = m_underlines[index];
-
- if (underline.endOffset <= m_indexLo) {
- // |underline| lies before the query range: keep on looking.
- ++index;
- } else if (underline.startOffset <= m_indexHi) {
- // |underline| intersects with the query range: valid, so return.
- return index;
- } else {
- // |underline| is completely after the query range: bail.
- break;
- }
- }
- return kNotFound;
-}
-
-} // namespace blink
« no previous file with comments | « Source/core/editing/CompositionUnderlineRangeFilter.h ('k') | Source/core/editing/CompositionUnderlineRangeFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698