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

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

Issue 1839613002: Move LayoutObject::previousOffsetForBackwardDeletion() to editing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace CHECK with DCHECK Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 } 1643 }
1644 1644
1645 unsigned LayoutText::resolvedTextLength() const 1645 unsigned LayoutText::resolvedTextLength() const
1646 { 1646 {
1647 int len = 0; 1647 int len = 0;
1648 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 1648 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
1649 len += box->len(); 1649 len += box->len();
1650 return len; 1650 return len;
1651 } 1651 }
1652 1652
1653 int LayoutText::previousOffsetForBackwardDeletion(int current) const
1654 {
1655 // Delete by one code point. Ideally we should delete grapheme where that
1656 // makes sense. https://crbug.com/587241
1657 if (U16_IS_TRAIL(m_text[--current]))
1658 --current;
1659 if (current < 0)
1660 current = 0;
1661 return current;
1662 }
1663
1664 bool LayoutText::computeCanUseSimpleFontCodePath() const 1653 bool LayoutText::computeCanUseSimpleFontCodePath() const
1665 { 1654 {
1666 if (m_text.is8Bit()) 1655 if (m_text.is8Bit())
1667 return true; 1656 return true;
1668 return Character::characterRangeCodePath(characters16(), length()) == Simple Path; 1657 return Character::characterRangeCodePath(characters16(), length()) == Simple Path;
1669 } 1658 }
1670 1659
1671 #if ENABLE(ASSERT) 1660 #if ENABLE(ASSERT)
1672 1661
1673 void LayoutText::checkConsistency() const 1662 void LayoutText::checkConsistency() const
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1699 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
1711 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason); 1700 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason);
1712 if (box->truncation() != cNoTruncation) { 1701 if (box->truncation() != cNoTruncation) {
1713 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) 1702 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox())
1714 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason); 1703 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason);
1715 } 1704 }
1716 } 1705 }
1717 } 1706 }
1718 1707
1719 } // namespace blink 1708 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698