Title: [96496] trunk/Source/WebCore
Revision
96496
Author
[email protected]
Date
2011-10-03 07:16:46 -0700 (Mon, 03 Oct 2011)

Log Message

Shrink HTMLLIElement.
https://bugs.webkit.org/show_bug.cgi?id=69250

Patch by Andreas Kling <[email protected]> on 2011-10-03
Reviewed by Antti Koivisto.

Don't cache the explicit "value" attribute on the HTMLLIElement,
but fetch it with fastGetAttribute when needed.
This shrinks HTMLLIElement by one CPU word.

* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::HTMLLIElement):
(WebCore::HTMLLIElement::parseMappedAttribute):
(WebCore::HTMLLIElement::attach):
* html/HTMLLIElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96495 => 96496)


--- trunk/Source/WebCore/ChangeLog	2011-10-03 14:13:19 UTC (rev 96495)
+++ trunk/Source/WebCore/ChangeLog	2011-10-03 14:16:46 UTC (rev 96496)
@@ -1,3 +1,20 @@
+2011-10-03  Andreas Kling  <[email protected]>
+
+        Shrink HTMLLIElement.
+        https://bugs.webkit.org/show_bug.cgi?id=69250
+
+        Reviewed by Antti Koivisto.
+
+        Don't cache the explicit "value" attribute on the HTMLLIElement,
+        but fetch it with fastGetAttribute when needed.
+        This shrinks HTMLLIElement by one CPU word.
+
+        * html/HTMLLIElement.cpp:
+        (WebCore::HTMLLIElement::HTMLLIElement):
+        (WebCore::HTMLLIElement::parseMappedAttribute):
+        (WebCore::HTMLLIElement::attach):
+        * html/HTMLLIElement.h:
+
 2011-10-03  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Add support for backend search in script content.

Modified: trunk/Source/WebCore/html/HTMLLIElement.cpp (96495 => 96496)


--- trunk/Source/WebCore/html/HTMLLIElement.cpp	2011-10-03 14:13:19 UTC (rev 96495)
+++ trunk/Source/WebCore/html/HTMLLIElement.cpp	2011-10-03 14:16:46 UTC (rev 96496)
@@ -35,7 +35,6 @@
 
 HTMLLIElement::HTMLLIElement(const QualifiedName& tagName, Document* document)
     : HTMLElement(tagName, document)
-    , m_requestedValue(0)
 {
     ASSERT(hasTagName(liTag));
 }
@@ -63,10 +62,10 @@
 void HTMLLIElement::parseMappedAttribute(Attribute* attr)
 {
     if (attr->name() == valueAttr) {
-        m_requestedValue = attr->value().toInt();
         if (renderer() && renderer()->isListItem()) {
-            if (m_requestedValue > 0)
-                toRenderListItem(renderer())->setExplicitValue(m_requestedValue);
+            int requestedValue = attr->value().toInt();
+            if (requestedValue > 0)
+                toRenderListItem(renderer())->setExplicitValue(requestedValue);
             else
                 toRenderListItem(renderer())->clearExplicitValue();
         }
@@ -109,10 +108,16 @@
         if (!listNode)
             render->setNotInList(true);
 
-        if (m_requestedValue > 0)
-            render->setExplicitValue(m_requestedValue);
-        else
+        const AtomicString& requestedValueString = fastGetAttribute(valueAttr);
+        if (requestedValueString.isNull())
             render->clearExplicitValue();
+        else {
+            int requestedValue = requestedValueString.toInt();
+            if (requestedValue > 0)
+                render->setExplicitValue(requestedValue);
+            else
+                render->clearExplicitValue();
+        }
     }
 }
 

Modified: trunk/Source/WebCore/html/HTMLLIElement.h (96495 => 96496)


--- trunk/Source/WebCore/html/HTMLLIElement.h	2011-10-03 14:13:19 UTC (rev 96495)
+++ trunk/Source/WebCore/html/HTMLLIElement.h	2011-10-03 14:16:46 UTC (rev 96496)
@@ -39,8 +39,6 @@
     virtual void parseMappedAttribute(Attribute*);
 
     virtual void attach();
-
-    int m_requestedValue;
 };
 
 } //namespace
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to