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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 1833653002: Move LayoutObject::nextOffset/previousOffset() to editing utility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added test cases. 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 side-by-side diff with in-line comments
Download patch
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 3099e448e86b5b3c0ef131b5caadacacbff463b6..579918a3fa12f6b0488d529e499c00da932e5da0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -1656,24 +1656,6 @@ unsigned LayoutText::resolvedTextLength() const
return len;
}
-int LayoutText::previousOffset(int current) const
-{
- if (m_text.is8Bit())
- return current - 1;
-
- StringImpl* textImpl = m_text.impl();
- TextBreakIterator* iterator = cursorMovementIterator(textImpl->characters16(), textImpl->length());
- if (!iterator)
- return current - 1;
-
- long result = iterator->preceding(current);
- if (result == TextBreakDone)
- result = current - 1;
-
-
- return result;
-}
-
int LayoutText::previousOffsetForBackwardDeletion(int current) const
{
// Delete by one code point. Ideally we should delete grapheme where that
@@ -1685,23 +1667,6 @@ int LayoutText::previousOffsetForBackwardDeletion(int current) const
return current;
}
-int LayoutText::nextOffset(int current) const
-{
- if (m_text.is8Bit())
- return current + 1;
-
- StringImpl* textImpl = m_text.impl();
- TextBreakIterator* iterator = cursorMovementIterator(textImpl->characters16(), textImpl->length());
- if (!iterator)
- return current + 1;
-
- long result = iterator->following(current);
- if (result == TextBreakDone)
- result = current + 1;
-
- return result;
-}
-
bool LayoutText::computeCanUseSimpleFontCodePath() const
{
if (m_text.is8Bit())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.h ('k') | third_party/WebKit/Source/core/layout/api/LineLayoutItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698