Index: third_party/WebKit/Source/core/dom/ElementRareData.h |
diff --git a/third_party/WebKit/Source/core/dom/ElementRareData.h b/third_party/WebKit/Source/core/dom/ElementRareData.h |
index 5e27cfe6ef0a797ef74015199dba900aba584b20..511f8de1a73cb94b58333801c831416180904677 100644 |
--- a/third_party/WebKit/Source/core/dom/ElementRareData.h |
+++ b/third_party/WebKit/Source/core/dom/ElementRareData.h |
@@ -27,6 +27,7 @@ |
#include "core/dom/DatasetDOMStringMap.h" |
#include "core/dom/NamedNodeMap.h" |
#include "core/dom/NodeRareData.h" |
+#include "core/dom/ProxiedPropertyCounts.h" |
#include "core/dom/PseudoElement.h" |
#include "core/dom/custom/CustomElementDefinition.h" |
#include "core/dom/shadow/ElementShadow.h" |
@@ -38,6 +39,7 @@ |
namespace blink { |
class HTMLElement; |
+class ProxiedPropertyCounts; |
class ElementRareData : public NodeRareData { |
public: |
@@ -110,13 +112,9 @@ public: |
bool hasPseudoElements() const; |
void clearPseudoElements(); |
- uint32_t incrementProxyCount() { return ++m_proxyCount; } |
- uint32_t decrementProxyCount() |
- { |
- ASSERT(m_proxyCount); |
- return --m_proxyCount; |
- } |
- uint32_t proxyCount() const { return m_proxyCount; } |
+ void incrementProxiedPropertyCounts(uint32_t properties); |
+ void decrementProxiedPropertyCounts(uint32_t properties); |
+ ProxiedPropertyCounts* proxiedPropertyCounts() const { return m_proxiedProperties.get(); } |
void setCustomElementDefinition(PassRefPtrWillBeRawPtr<CustomElementDefinition> definition) { m_customElementDefinition = definition; } |
CustomElementDefinition* customElementDefinition() const { return m_customElementDefinition.get(); } |
@@ -128,10 +126,10 @@ public: |
DECLARE_TRACE_AFTER_DISPATCH(); |
private: |
+ ProxiedPropertyCounts& ensureProxiedPropertyCounts(); |
+ void clearProxiedPropertyCounts() { m_proxiedProperties = nullptr; } |
+ |
short m_tabindex; |
- // As m_proxyCount usually doesn't exceed 10bits (1024), if you want to add some booleans you |
- // can steal some bits from m_proxyCount by using bitfields to prevent ElementRareData bloat. |
- unsigned short m_proxyCount; |
LayoutSize m_minimumSizeForResizing; |
IntSize m_savedLayerScrollOffset; |
@@ -143,6 +141,7 @@ private: |
OwnPtrWillBeMember<AttrNodeList> m_attrNodeList; |
PersistentWillBeMember<ElementAnimations> m_elementAnimations; |
OwnPtrWillBeMember<InlineCSSStyleDeclaration> m_cssomWrapper; |
+ OwnPtrWillBeMember<ProxiedPropertyCounts> m_proxiedProperties; |
RefPtr<ComputedStyle> m_computedStyle; |
RefPtrWillBeMember<CustomElementDefinition> m_customElementDefinition; |
@@ -163,7 +162,6 @@ inline LayoutSize defaultMinimumSizeForResizing() |
inline ElementRareData::ElementRareData(LayoutObject* layoutObject) |
: NodeRareData(layoutObject) |
, m_tabindex(0) |
- , m_proxyCount(0) |
, m_minimumSizeForResizing(defaultMinimumSizeForResizing()) |
{ |
m_isElementRareData = true; |
@@ -239,6 +237,25 @@ inline PseudoElement* ElementRareData::pseudoElement(PseudoId pseudoId) const |
} |
} |
+inline void ElementRareData::incrementProxiedPropertyCounts(uint32_t properties) |
+{ |
+ ensureProxiedPropertyCounts().increment(properties); |
+} |
+ |
+inline void ElementRareData::decrementProxiedPropertyCounts(uint32_t properties) |
+{ |
+ m_proxiedProperties->decrement(properties); |
+ if (m_proxiedProperties->empty()) |
+ clearProxiedPropertyCounts(); |
+} |
+ |
+inline ProxiedPropertyCounts& ElementRareData::ensureProxiedPropertyCounts() |
+{ |
+ if (!m_proxiedProperties) |
+ m_proxiedProperties = ProxiedPropertyCounts::create(); |
+ return *m_proxiedProperties; |
+} |
+ |
} // namespace |
#endif // ElementRareData_h |