Index: public/web/WebTextDirection.h |
diff --git a/public/web/WebTextDirection.h b/public/web/WebTextDirection.h |
index a236c86c6bf536aca7824a101b99d3a685a72ec3..cd350c9620e10a0e3ca847851b8eb4715d7673f6 100644 |
--- a/public/web/WebTextDirection.h |
+++ b/public/web/WebTextDirection.h |
@@ -31,6 +31,10 @@ |
#ifndef WebTextDirection_h |
#define WebTextDirection_h |
+#if BLINK_IMPLEMENTATION |
+#include "platform/text/TextDirection.h" |
+#endif |
+ |
namespace blink { |
// Represents text directions (or writing directions) of a DOM node. |
@@ -41,6 +45,20 @@ enum WebTextDirection { |
WebTextDirectionLast = WebTextDirectionRightToLeft |
}; |
+#if BLINK_IMPLEMENTATION |
+inline WebTextDirection toWebTextDirection(TextDirection direction) |
+{ |
+ switch (direction) { |
+ case LTR: |
+ return WebTextDirectionLeftToRight; |
+ case RTL: |
+ return WebTextDirectionRightToLeft; |
+ } |
+ ASSERT_NOT_REACHED(); |
+ return WebTextDirectionDefault; |
+} |
+#endif |
+ |
} // namespace blink |
#endif |