HTMLMetaElement: Don't cache "http-equiv" and "content" attributes.
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Aug 2011 17:19:11 +0000 (17:19 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Aug 2011 17:19:11 +0000 (17:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67040

Reviewed by Darin Adler.

* html/HTMLMetaElement.h: Remove m_equiv and m_content members,
shrinking HTMLMetaElement by 16 bytes (on 64-bit.)
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::parseMappedAttribute):
(WebCore::HTMLMetaElement::process): Implemented using fastGetAttribute().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93884 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMetaElement.cpp
Source/WebCore/html/HTMLMetaElement.h

index 5bd7648..4592190 100644 (file)
@@ -1,3 +1,16 @@
+2011-08-26  Andreas Kling  <kling@webkit.org>
+
+        HTMLMetaElement: Don't cache "http-equiv" and "content" attributes.
+        https://bugs.webkit.org/show_bug.cgi?id=67040
+
+        Reviewed by Darin Adler.
+
+        * html/HTMLMetaElement.h: Remove m_equiv and m_content members,
+        shrinking HTMLMetaElement by 16 bytes (on 64-bit.)
+        * html/HTMLMetaElement.cpp:
+        (WebCore::HTMLMetaElement::parseMappedAttribute):
+        (WebCore::HTMLMetaElement::process): Implemented using fastGetAttribute().
+
 2011-08-26  Pavel Feldman  <pfeldman@google.com>
 
         Web Inspector: [REGRESSION] No way to expand hovered objects while debugging.
index e3968af..108a98c 100644 (file)
@@ -44,13 +44,11 @@ PassRefPtr<HTMLMetaElement> HTMLMetaElement::create(const QualifiedName& tagName
 
 void HTMLMetaElement::parseMappedAttribute(Attribute* attr)
 {
-    if (attr->name() == http_equivAttr) {
-        m_equiv = attr->value();
+    if (attr->name() == http_equivAttr)
         process();
-    } else if (attr->name() == contentAttr) {
-        m_content = attr->value();
+    else if (attr->name() == contentAttr)
         process();
-    else if (attr->name() == nameAttr) {
+    else if (attr->name() == nameAttr) {
         // Do nothing.
     } else
         HTMLElement::parseMappedAttribute(attr);
@@ -64,16 +62,21 @@ void HTMLMetaElement::insertedIntoDocument()
 
 void HTMLMetaElement::process()
 {
-    if (!inDocument() || m_content.isNull())
+    if (!inDocument())
+        return;
+
+    const AtomicString& contentValue = fastGetAttribute(contentAttr);
+    if (contentValue.isNull())
         return;
 
     if (equalIgnoringCase(name(), "viewport"))
-        document()->processViewport(m_content);
+        document()->processViewport(contentValue);
 
     // Get the document to process the tag, but only if we're actually part of DOM tree (changing a meta tag while
     // it's not in the tree shouldn't have any effect on the document)
-    if (!m_equiv.isNull())
-        document()->processHttpEquiv(m_equiv, m_content);
+    const AtomicString& httpEquivValue = fastGetAttribute(http_equivAttr);
+    if (!httpEquivValue.isNull())
+        document()->processHttpEquiv(httpEquivValue, contentValue);
 }
 
 String HTMLMetaElement::content() const
index 9b0178e..8f6f1be 100644 (file)
@@ -42,9 +42,6 @@ private:
     virtual void insertedIntoDocument();
 
     void process();
-
-    String m_equiv;
-    String m_content;
 };
 
 } //namespace