<http://webkit.org/b/78972>
Reviewed by Antti Koivisto.
Add a StylePropertySet::shrinkToFit() and call it at the end of updateStyleAttribute()
to minimize the amount of wasted space.
* css/StylePropertySet.h:
(WebCore::StylePropertySet::shrinkToFit):
* dom/StyledElement.cpp:
(WebCore::StyledElement::updateAttributeStyle):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108350
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-21 Andreas Kling <awesomekling@apple.com>
+
+ Shrink attribute style property sets after populating them.
+ <http://webkit.org/b/78972>
+
+ Reviewed by Antti Koivisto.
+
+ Add a StylePropertySet::shrinkToFit() and call it at the end of updateStyleAttribute()
+ to minimize the amount of wasted space.
+
+ * css/StylePropertySet.h:
+ (WebCore::StylePropertySet::shrinkToFit):
+ * dom/StyledElement.cpp:
+ (WebCore::StyledElement::updateAttributeStyle):
+
2012-02-21 Antti Koivisto <antti@apple.com>
Remove stylesheet pointer from StylePropertySet
bool isEmpty() const { return m_properties.isEmpty(); }
const CSSProperty& propertyAt(unsigned index) const { return m_properties[index]; }
+ void shrinkToFit() { m_properties.shrinkToFit(); }
+
PassRefPtr<CSSValue> getPropertyCSSValue(int propertyID) const;
String getPropertyValue(int propertyID) const;
bool propertyIsImportant(int propertyID) const;
if (style->isEmpty())
attributeData()->setAttributeStyle(0);
- else
+ else {
+ style->shrinkToFit();
attributeData()->setAttributeStyle(style.release());
+ }
}
}