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

Unified Diff: Source/WebCore/rendering/InlineIterator.h

Issue 11886025: Merge 139213 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/InlineIterator.h
===================================================================
--- Source/WebCore/rendering/InlineIterator.h (revision 139650)
+++ Source/WebCore/rendering/InlineIterator.h (working copy)
@@ -85,6 +85,7 @@
return (m_obj && m_obj->isBR()) || atTextParagraphSeparator();
}
+ UChar characterAt(unsigned) const;
UChar current() const;
UChar previousInSameNode() const;
ALWAYS_INLINE WTF::Unicode::Direction direction() const;
@@ -352,25 +353,29 @@
return !m_obj;
}
-inline UChar InlineIterator::current() const
+inline UChar InlineIterator::characterAt(unsigned index) const
{
if (!m_obj || !m_obj->isText())
return 0;
RenderText* text = toRenderText(m_obj);
- if (m_pos >= text->textLength())
+ if (index >= text->textLength())
return 0;
- return text->characterAt(m_pos);
+ return text->characterAt(index);
}
+inline UChar InlineIterator::current() const
+{
+ return characterAt(m_pos);
+}
+
inline UChar InlineIterator::previousInSameNode() const
{
- if (!m_obj || !m_obj->isText() || !m_pos)
+ if (!m_pos)
return 0;
- RenderText* text = toRenderText(m_obj);
- return text->characterAt(m_pos - 1);
+ return characterAt(m_pos - 1);
}
ALWAYS_INLINE WTF::Unicode::Direction InlineIterator::direction() const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698