OLD | NEW |
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/testing/MockHyphenation.h" | 5 #include "core/testing/MockHyphenation.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 size_t MockHyphenation::lastHyphenLocation(const StringView& text, | 9 size_t MockHyphenation::lastHyphenLocation(const StringView& text, |
10 size_t beforeIndex) const | 10 size_t beforeIndex) const |
11 { | 11 { |
12 RefPtr<StringImpl> str = text.toString(); | 12 String str = text.toString(); |
13 if (str->endsWithIgnoringASCIICase("phenation", 9)) { | 13 if (str.endsWith("phenation", TextCaseASCIIInsensitive)) { |
14 if (beforeIndex - (str->length() - 9) > 4) | 14 if (beforeIndex - (str.length() - 9) > 4) |
15 return 4 + (str->length() - 9); | 15 return 4 + (str.length() - 9); |
16 if (str->endsWithIgnoringASCIICase("hyphenation", 11) | 16 if (str.endsWith("hyphenation", TextCaseASCIIInsensitive) |
17 && beforeIndex - (str->length() - 11) > 2) { | 17 && beforeIndex - (str.length() - 11) > 2) { |
18 return 2 + (str->length() - 11); | 18 return 2 + (str.length() - 11); |
19 } | 19 } |
20 } | 20 } |
21 return 0; | 21 return 0; |
22 } | 22 } |
23 | 23 |
24 } // namespace blink | 24 } // namespace blink |
OLD | NEW |