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

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

Issue 1824143003: [All-In-One] Introduce BackspaceStateMachine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to HEAD Created 4 years, 9 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 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 } 1649 }
1650 1650
1651 unsigned LayoutText::resolvedTextLength() const 1651 unsigned LayoutText::resolvedTextLength() const
1652 { 1652 {
1653 int len = 0; 1653 int len = 0;
1654 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 1654 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
1655 len += box->len(); 1655 len += box->len();
1656 return len; 1656 return len;
1657 } 1657 }
1658 1658
1659 int LayoutText::previousOffsetForBackwardDeletion(int current) const
1660 {
1661 // Delete by one code point. Ideally we should delete grapheme where that
1662 // makes sense. https://crbug.com/587241
1663 if (U16_IS_TRAIL(m_text[--current]))
1664 --current;
1665 if (current < 0)
1666 current = 0;
1667 return current;
1668 }
1669
1670 bool LayoutText::computeCanUseSimpleFontCodePath() const 1659 bool LayoutText::computeCanUseSimpleFontCodePath() const
1671 { 1660 {
1672 if (m_text.is8Bit()) 1661 if (m_text.is8Bit())
1673 return true; 1662 return true;
1674 return Character::characterRangeCodePath(characters16(), length()) == Simple Path; 1663 return Character::characterRangeCodePath(characters16(), length()) == Simple Path;
1675 } 1664 }
1676 1665
1677 #if ENABLE(ASSERT) 1666 #if ENABLE(ASSERT)
1678 1667
1679 void LayoutText::checkConsistency() const 1668 void LayoutText::checkConsistency() const
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1705 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
1717 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason); 1706 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason);
1718 if (box->truncation() != cNoTruncation) { 1707 if (box->truncation() != cNoTruncation) {
1719 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) 1708 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox())
1720 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason); 1709 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason);
1721 } 1710 }
1722 } 1711 }
1723 } 1712 }
1724 1713
1725 } // namespace blink 1714 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698