Index: third_party/WebKit/Source/core/dom/ElementData.h |
diff --git a/third_party/WebKit/Source/core/dom/ElementData.h b/third_party/WebKit/Source/core/dom/ElementData.h |
index 6f7d43770fd4cc05e8ff0b264f96ed75448565e4..9ba2991f9d130038d025b8e1680974cfe4d75dc7 100644 |
--- a/third_party/WebKit/Source/core/dom/ElementData.h |
+++ b/third_party/WebKit/Source/core/dom/ElementData.h |
@@ -44,6 +44,15 @@ class ShareableElementData; |
class StylePropertySet; |
class UniqueElementData; |
+enum class CachedTextDirection { |
+ NotAutoOrNotCached, |
+ AutoLTR, |
+ AutoRTL, |
+ // This should also have a state like AutoInherit as it is possible for |
+ // an element with dir=auto to end up inheriting its parent's directionality |
+ // but we currently don't handle that correctly. |
+}; |
+ |
// ElementData represents very common, but not necessarily unique to an element, |
// data such as attributes, inline style, and parsed class names and ids. |
class ElementData : public GarbageCollectedFinalized<ElementData> { |
@@ -72,6 +81,9 @@ public: |
bool isUnique() const { return m_isUnique; } |
+ CachedTextDirection directionality() const { return static_cast<CachedTextDirection>(m_directionality); } |
+ void setDirectionality(CachedTextDirection directionality) const { m_directionality = static_cast<int>(directionality); } |
+ |
DECLARE_TRACE_AFTER_DISPATCH(); |
DECLARE_TRACE(); |
@@ -82,7 +94,8 @@ protected: |
// Keep the type in a bitfield instead of using virtual destructors to avoid adding a vtable. |
unsigned m_isUnique : 1; |
- unsigned m_arraySize : 28; |
+ unsigned m_arraySize : 26; |
+ mutable unsigned m_directionality : 2; |
mutable unsigned m_presentationAttributeStyleIsDirty : 1; |
mutable unsigned m_styleAttributeIsDirty : 1; |
mutable unsigned m_animatedSVGAttributesAreDirty : 1; |