Index: Source/platform/text/BidiResolver.h |
diff --git a/Source/platform/text/BidiResolver.h b/Source/platform/text/BidiResolver.h |
index 52e7f2b22dc99becc3199256efe6b97d2d6ce170..cc5eb275720c30ebb5ea1db50dd117418916e6d0 100644 |
--- a/Source/platform/text/BidiResolver.h |
+++ b/Source/platform/text/BidiResolver.h |
@@ -25,6 +25,7 @@ |
#include "platform/text/BidiContext.h" |
#include "platform/text/BidiRunList.h" |
#include "platform/text/TextDirection.h" |
+#include "wtf/HashMap.h" |
#include "wtf/Noncopyable.h" |
#include "wtf/PassRefPtr.h" |
#include "wtf/Vector.h" |
@@ -225,6 +226,9 @@ public: |
TextDirection determineParagraphDirectionality(bool* hasStrongDirectionality = 0); |
+ void setMidpointStateForIsolatedRun(Run*, const MidpointState<Iterator>&); |
+ MidpointState<Iterator> midpointStateForIsolatedRun(Run*); |
+ |
protected: |
void increment() { m_current.increment(); } |
// FIXME: Instead of InlineBidiResolvers subclassing this method, we should |
@@ -262,6 +266,7 @@ private: |
void reorderRunsFromLevels(); |
Vector<BidiEmbedding, 8> m_currentExplicitEmbeddingSequence; |
+ HashMap<Run *, MidpointState<Iterator> > m_midpointStateForIsolatedRun; |
}; |
#ifndef NDEBUG |
@@ -957,6 +962,20 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis |
endOfLine = Iterator(); |
} |
+template <class Iterator, class Run> |
+void BidiResolver<Iterator, Run>::setMidpointStateForIsolatedRun(Run* run, const MidpointState<Iterator>& midpoint) |
+{ |
+ ASSERT(!m_midpointStateForIsolatedRun.contains(run)); |
+ m_midpointStateForIsolatedRun.add(run, midpoint); |
+} |
+ |
+template<class Iterator, class Run> |
+MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun(Run* run) |
+{ |
+ return m_midpointStateForIsolatedRun.take(run); |
+} |
+ |
+ |
} // namespace WebCore |
#endif // BidiResolver_h |