OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 break; | 1397 break; |
1398 case UPPERCASE: | 1398 case UPPERCASE: |
1399 text = text.upper(style->locale()); | 1399 text = text.upper(style->locale()); |
1400 break; | 1400 break; |
1401 case LOWERCASE: | 1401 case LOWERCASE: |
1402 text = text.lower(style->locale()); | 1402 text = text.lower(style->locale()); |
1403 break; | 1403 break; |
1404 } | 1404 } |
1405 } | 1405 } |
1406 | 1406 |
| 1407 void LayoutText::applyTextTransformFromTo(int from, int len, const ComputedStyle
* style) |
| 1408 { |
| 1409 if (!style) |
| 1410 return; |
| 1411 |
| 1412 String textToCapitalize; |
| 1413 switch (style->textTransform()) { |
| 1414 case TTNONE: |
| 1415 break; |
| 1416 case CAPITALIZE: |
| 1417 textToCapitalize = m_text.substring(from, len); |
| 1418 makeCapitalized(&textToCapitalize, previousCharacter()); |
| 1419 m_text.replace(from, len, textToCapitalize); |
| 1420 break; |
| 1421 case UPPERCASE: |
| 1422 m_text.replace(from, len, m_text.substring(from, len).upper(style->local
e())); |
| 1423 break; |
| 1424 case LOWERCASE: |
| 1425 m_text.replace(from, len, m_text.substring(from, len).lower(style->local
e())); |
| 1426 break; |
| 1427 } |
| 1428 } |
| 1429 |
1407 void LayoutText::setTextInternal(PassRefPtr<StringImpl> text) | 1430 void LayoutText::setTextInternal(PassRefPtr<StringImpl> text) |
1408 { | 1431 { |
1409 ASSERT(text); | 1432 ASSERT(text); |
1410 m_text = std::move(text); | 1433 m_text = std::move(text); |
1411 | 1434 |
1412 if (style()) { | 1435 if (style()) { |
1413 applyTextTransform(style(), m_text, previousCharacter()); | 1436 applyTextTransform(style(), m_text, previousCharacter()); |
1414 | 1437 |
1415 // We use the same characters here as for list markers. | 1438 // We use the same characters here as for list markers. |
1416 // See the listMarkerText function in LayoutListMarker.cpp. | 1439 // See the listMarkerText function in LayoutListMarker.cpp. |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { | 1780 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { |
1758 paintInvalidator.invalidateDisplayItemClient(*box, invalidationReason); | 1781 paintInvalidator.invalidateDisplayItemClient(*box, invalidationReason); |
1759 if (box->truncation() != cNoTruncation) { | 1782 if (box->truncation() != cNoTruncation) { |
1760 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) | 1783 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) |
1761 paintInvalidator.invalidateDisplayItemClient(*ellipsisBox, inval
idationReason); | 1784 paintInvalidator.invalidateDisplayItemClient(*ellipsisBox, inval
idationReason); |
1762 } | 1785 } |
1763 } | 1786 } |
1764 } | 1787 } |
1765 | 1788 |
1766 } // namespace blink | 1789 } // namespace blink |
OLD | NEW |