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