Title: [139651] branches/chromium/1364/Source/WebCore/rendering/InlineIterator.h
- Revision
- 139651
- Author
- cev...@google.com
- Date
- 2013-01-14 13:16:15 -0800 (Mon, 14 Jan 2013)
Log Message
Merge 139213
BUG=156096
Review URL: https://codereview.chromium.org/11886025
Modified Paths
Diff
Modified: branches/chromium/1364/Source/WebCore/rendering/InlineIterator.h (139650 => 139651)
--- branches/chromium/1364/Source/WebCore/rendering/InlineIterator.h 2013-01-14 21:14:31 UTC (rev 139650)
+++ branches/chromium/1364/Source/WebCore/rendering/InlineIterator.h 2013-01-14 21:16:15 UTC (rev 139651)
@@ -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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes