Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutText.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp |
| index a6d33292f4d42ba5d7b67eaa06d11309ddbcdacb..accd371a13741e984dee2709c023f2af743922d5 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutText.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp |
| @@ -1404,6 +1404,29 @@ void applyTextTransform(const ComputedStyle* style, String& text, UChar previous |
| } |
| } |
| +void LayoutText::applyTextTransformFromTo(int from, int len, const ComputedStyle* style) |
| +{ |
| + if (!style) |
| + return; |
| + |
| + String textToCapitalize; |
| + switch (style->textTransform()) { |
| + case TTNONE: |
|
rhogan
2016/09/05 18:00:33
I decided to not try and adapt the previous functi
eae
2016/09/05 20:53:34
I agree. Thanks for the clarification.
|
| + break; |
| + case CAPITALIZE: |
| + textToCapitalize = m_text.substring(from, len); |
| + makeCapitalized(&textToCapitalize, previousCharacter()); |
| + m_text = m_text.replace(from, len, textToCapitalize); |
| + break; |
| + case UPPERCASE: |
| + m_text = m_text.replace(from, len, m_text.substring(from, len).upper(style->locale())); |
| + break; |
| + case LOWERCASE: |
| + m_text = m_text.replace(from, len, m_text.substring(from, len).lower(style->locale())); |
| + break; |
| + } |
| +} |
| + |
| void LayoutText::setTextInternal(PassRefPtr<StringImpl> text) |
| { |
| ASSERT(text); |