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

Side by Side Diff: third_party/WebKit/Source/core/editing/CompositionUnderline.cpp

Issue 2611813002: Add support for persisting CompositionUnderlines in InputMethodController (Closed)
Patch Set: Try one more time Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/CompositionUnderline.h" 5 #include "core/editing/CompositionUnderline.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 CompositionUnderline::CompositionUnderline(unsigned startOffset, 9 CompositionUnderline::CompositionUnderline(unsigned startOffset,
10 unsigned endOffset, 10 unsigned endOffset,
11 const Color& color, 11 const Color& color,
12 bool thick, 12 bool thick,
13 const Color& backgroundColor) 13 const Color& backgroundColor,
14 : m_color(color), m_thick(thick), m_backgroundColor(backgroundColor) { 14 bool persist)
15 : m_color(color),
16 m_thick(thick),
17 m_backgroundColor(backgroundColor),
18 m_persist(persist) {
15 // Sanitize offsets by ensuring a valid range corresponding to the last 19 // Sanitize offsets by ensuring a valid range corresponding to the last
16 // possible position. 20 // possible position.
17 // TODO(wkorman): Consider replacing with DCHECK_LT(startOffset, endOffset). 21 // TODO(wkorman): Consider replacing with DCHECK_LT(startOffset, endOffset).
18 m_startOffset = 22 m_startOffset =
19 std::min(startOffset, std::numeric_limits<unsigned>::max() - 1u); 23 std::min(startOffset, std::numeric_limits<unsigned>::max() - 1u);
20 m_endOffset = std::max(m_startOffset + 1u, endOffset); 24 m_endOffset = std::max(m_startOffset + 1u, endOffset);
21 } 25 }
22 26
23 } // namespace blink 27 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698