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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 2317303002: Revert of Apply first-line transform-text style (Closed)
Patch Set: Created 4 years, 3 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 /* 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
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 = m_text.replace(from, len, textToCapitalize);
1420 break;
1421 case UPPERCASE:
1422 m_text = m_text.replace(from, len, m_text.substring(from, len).upper(sty le->locale()));
1423 break;
1424 case LOWERCASE:
1425 m_text = m_text.replace(from, len, m_text.substring(from, len).lower(sty le->locale()));
1426 break;
1427 }
1428 }
1429
1430 void LayoutText::setTextInternal(PassRefPtr<StringImpl> text) 1407 void LayoutText::setTextInternal(PassRefPtr<StringImpl> text)
1431 { 1408 {
1432 ASSERT(text); 1409 ASSERT(text);
1433 m_text = text; 1410 m_text = text;
1434 1411
1435 if (style()) { 1412 if (style()) {
1436 applyTextTransform(style(), m_text, previousCharacter()); 1413 applyTextTransform(style(), m_text, previousCharacter());
1437 1414
1438 // We use the same characters here as for list markers. 1415 // We use the same characters here as for list markers.
1439 // See the listMarkerText function in LayoutListMarker.cpp. 1416 // See the listMarkerText function in LayoutListMarker.cpp.
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1757 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
1781 paintInvalidator.invalidateDisplayItemClient(*box, invalidationReason); 1758 paintInvalidator.invalidateDisplayItemClient(*box, invalidationReason);
1782 if (box->truncation() != cNoTruncation) { 1759 if (box->truncation() != cNoTruncation) {
1783 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) 1760 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox())
1784 paintInvalidator.invalidateDisplayItemClient(*ellipsisBox, inval idationReason); 1761 paintInvalidator.invalidateDisplayItemClient(*ellipsisBox, inval idationReason);
1785 } 1762 }
1786 } 1763 }
1787 } 1764 }
1788 1765
1789 } // namespace blink 1766 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.h ('k') | third_party/WebKit/Source/core/layout/api/LineLayoutText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698