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

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineIterator.h

Issue 2473863003: Fix BiDi directionality for surrogate pair characters (Closed)
Patch Set: eae review: add </td> and </tr> to tests Created 4 years, 1 month 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 | « third_party/WebKit/Source/core/layout/LayoutText.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/line/InlineIterator.h
diff --git a/third_party/WebKit/Source/core/layout/line/InlineIterator.h b/third_party/WebKit/Source/core/layout/line/InlineIterator.h
index c6d961171597b8da268f8cad680a104d33c100e9..b3ea8c91d05a50ed6b05682747069a5225ceebdc 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineIterator.h
+++ b/third_party/WebKit/Source/core/layout/line/InlineIterator.h
@@ -120,6 +120,8 @@ class InlineIterator {
UChar characterAt(unsigned) const;
UChar current() const;
UChar previousInSameNode() const;
+ UChar32 codepointAt(unsigned) const;
+ UChar32 currentCodepoint() const;
ALWAYS_INLINE WTF::Unicode::CharDirection direction() const;
private:
@@ -494,8 +496,18 @@ inline UChar InlineIterator::previousInSameNode() const {
return characterAt(m_pos - 1);
}
+inline UChar32 InlineIterator::codepointAt(unsigned index) const {
+ if (!m_lineLayoutItem || !m_lineLayoutItem.isText())
+ return 0;
+ return LineLayoutText(m_lineLayoutItem).codepointAt(index);
+}
+
+inline UChar32 InlineIterator::currentCodepoint() const {
+ return codepointAt(m_pos);
+}
+
ALWAYS_INLINE WTF::Unicode::CharDirection InlineIterator::direction() const {
- if (UChar c = current())
+ if (UChar32 c = currentCodepoint())
return WTF::Unicode::direction(c);
if (m_lineLayoutItem && m_lineLayoutItem.isListMarker())
« 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