Title: [108350] trunk/Source/WebCore
Revision
108350
Author
[email protected]
Date
2012-02-21 06:37:51 -0800 (Tue, 21 Feb 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (108349 => 108350)


--- trunk/Source/WebCore/ChangeLog	2012-02-21 14:20:04 UTC (rev 108349)
+++ trunk/Source/WebCore/ChangeLog	2012-02-21 14:37:51 UTC (rev 108350)
@@ -1,3 +1,18 @@
+2012-02-21  Andreas Kling  <[email protected]>
+
+        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  <[email protected]>
 
         Remove stylesheet pointer from StylePropertySet

Modified: trunk/Source/WebCore/css/StylePropertySet.h (108349 => 108350)


--- trunk/Source/WebCore/css/StylePropertySet.h	2012-02-21 14:20:04 UTC (rev 108349)
+++ trunk/Source/WebCore/css/StylePropertySet.h	2012-02-21 14:37:51 UTC (rev 108350)
@@ -55,6 +55,8 @@
     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;

Modified: trunk/Source/WebCore/dom/StyledElement.cpp (108349 => 108350)


--- trunk/Source/WebCore/dom/StyledElement.cpp	2012-02-21 14:20:04 UTC (rev 108349)
+++ trunk/Source/WebCore/dom/StyledElement.cpp	2012-02-21 14:37:51 UTC (rev 108350)
@@ -166,8 +166,10 @@
 
     if (style->isEmpty())
         attributeData()->setAttributeStyle(0);
-    else
+    else {
+        style->shrinkToFit();
         attributeData()->setAttributeStyle(style.release());
+    }
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to