- Revision
- 121520
- Author
- [email protected]
- Date
- 2012-06-28 23:20:34 -0700 (Thu, 28 Jun 2012)
Log Message
Change argument types of Element::getAttribute*() from String to AtomicString
https://bugs.webkit.org/show_bug.cgi?id=90246
Reviewed by Ryosuke Niwa.
This is a follow-up patch for r121439. r121439 changed an argument type of
Element::getAttribute() from String to AtomicString, which optimized
performance of Dromaeo/dom-attr.html. This patch changes other argument types
of Element::getAttribute*() from String to AtomicString. See the ChangeLog in
http://trac.webkit.org/changeset/121439 for more details about why this change
optimizes performance.
No tests. No change in behavior.
* dom/DatasetDOMStringMap.cpp:
(WebCore::convertPropertyNameToAttributeName):
* dom/Element.cpp:
(WebCore::Element::getAttributeNS):
(WebCore::Element::removeAttribute):
(WebCore::Element::removeAttributeNS):
(WebCore::Element::getAttributeNode):
(WebCore::Element::getAttributeNodeNS):
(WebCore::Element::hasAttribute):
(WebCore::Element::hasAttributeNS):
* dom/Element.h:
(Element):
* dom/ElementAttributeData.cpp:
(WebCore::ElementAttributeData::getAttributeNode):
* dom/ElementAttributeData.h:
(ElementAttributeData):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (121519 => 121520)
--- trunk/Source/WebCore/ChangeLog 2012-06-29 06:12:22 UTC (rev 121519)
+++ trunk/Source/WebCore/ChangeLog 2012-06-29 06:20:34 UTC (rev 121520)
@@ -1,3 +1,36 @@
+2012-06-28 Kentaro Hara <[email protected]>
+
+ Change argument types of Element::getAttribute*() from String to AtomicString
+ https://bugs.webkit.org/show_bug.cgi?id=90246
+
+ Reviewed by Ryosuke Niwa.
+
+ This is a follow-up patch for r121439. r121439 changed an argument type of
+ Element::getAttribute() from String to AtomicString, which optimized
+ performance of Dromaeo/dom-attr.html. This patch changes other argument types
+ of Element::getAttribute*() from String to AtomicString. See the ChangeLog in
+ http://trac.webkit.org/changeset/121439 for more details about why this change
+ optimizes performance.
+
+ No tests. No change in behavior.
+
+ * dom/DatasetDOMStringMap.cpp:
+ (WebCore::convertPropertyNameToAttributeName):
+ * dom/Element.cpp:
+ (WebCore::Element::getAttributeNS):
+ (WebCore::Element::removeAttribute):
+ (WebCore::Element::removeAttributeNS):
+ (WebCore::Element::getAttributeNode):
+ (WebCore::Element::getAttributeNodeNS):
+ (WebCore::Element::hasAttribute):
+ (WebCore::Element::hasAttributeNS):
+ * dom/Element.h:
+ (Element):
+ * dom/ElementAttributeData.cpp:
+ (WebCore::ElementAttributeData::getAttributeNode):
+ * dom/ElementAttributeData.h:
+ (ElementAttributeData):
+
2012-06-28 Kent Tamura <[email protected]>
REGRESSION(r106388): Form hidden element values being restored
Modified: trunk/Source/WebCore/dom/DatasetDOMStringMap.cpp (121519 => 121520)
--- trunk/Source/WebCore/dom/DatasetDOMStringMap.cpp 2012-06-29 06:12:22 UTC (rev 121519)
+++ trunk/Source/WebCore/dom/DatasetDOMStringMap.cpp 2012-06-29 06:20:34 UTC (rev 121520)
@@ -110,7 +110,7 @@
return true;
}
-static String convertPropertyNameToAttributeName(const String& name)
+static const String convertPropertyNameToAttributeName(const String& name)
{
StringBuilder builder;
builder.append("data-");
Modified: trunk/Source/WebCore/dom/Element.cpp (121519 => 121520)
--- trunk/Source/WebCore/dom/Element.cpp 2012-06-29 06:12:22 UTC (rev 121519)
+++ trunk/Source/WebCore/dom/Element.cpp 2012-06-29 06:20:34 UTC (rev 121520)
@@ -630,7 +630,7 @@
return nullAtom;
}
-const AtomicString& Element::getAttributeNS(const String& namespaceURI, const String& localName) const
+const AtomicString& Element::getAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName) const
{
return getAttribute(QualifiedName(nullAtom, localName, namespaceURI));
}
@@ -1459,7 +1459,7 @@
attributeData()->removeAttribute(index, this);
}
-void Element::removeAttribute(const String& name)
+void Element::removeAttribute(const AtomicString& name)
{
ElementAttributeData* attributeData = this->attributeData();
if (!attributeData)
@@ -1473,12 +1473,12 @@
attributeData->removeAttribute(index, this);
}
-void Element::removeAttributeNS(const String& namespaceURI, const String& localName)
+void Element::removeAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName)
{
removeAttribute(QualifiedName(nullAtom, localName, namespaceURI));
}
-PassRefPtr<Attr> Element::getAttributeNode(const String& name)
+PassRefPtr<Attr> Element::getAttributeNode(const AtomicString& name)
{
ElementAttributeData* attributeData = updatedAttributeData();
if (!attributeData)
@@ -1486,7 +1486,7 @@
return attributeData->getAttributeNode(name, shouldIgnoreAttributeCase(this), this);
}
-PassRefPtr<Attr> Element::getAttributeNodeNS(const String& namespaceURI, const String& localName)
+PassRefPtr<Attr> Element::getAttributeNodeNS(const AtomicString& namespaceURI, const AtomicString& localName)
{
ElementAttributeData* attributeData = updatedAttributeData();
if (!attributeData)
@@ -1494,7 +1494,7 @@
return attributeData->getAttributeNode(QualifiedName(nullAtom, localName, namespaceURI), this);
}
-bool Element::hasAttribute(const String& name) const
+bool Element::hasAttribute(const AtomicString& name) const
{
ElementAttributeData* attributeData = updatedAttributeData();
if (!attributeData)
@@ -1506,7 +1506,7 @@
return attributeData->getAttributeItem(localName, false);
}
-bool Element::hasAttributeNS(const String& namespaceURI, const String& localName) const
+bool Element::hasAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName) const
{
ElementAttributeData* attributeData = updatedAttributeData();
if (!attributeData)
Modified: trunk/Source/WebCore/dom/Element.h (121519 => 121520)
--- trunk/Source/WebCore/dom/Element.h 2012-06-29 06:12:22 UTC (rev 121519)
+++ trunk/Source/WebCore/dom/Element.h 2012-06-29 06:20:34 UTC (rev 121520)
@@ -139,11 +139,11 @@
// in style attribute or one of the SVG animation attributes.
bool hasAttributesWithoutUpdate() const;
- bool hasAttribute(const String& name) const;
- bool hasAttributeNS(const String& namespaceURI, const String& localName) const;
+ bool hasAttribute(const AtomicString& name) const;
+ bool hasAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName) const;
const AtomicString& getAttribute(const AtomicString& name) const;
- const AtomicString& getAttributeNS(const String& namespaceURI, const String& localName) const;
+ const AtomicString& getAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName) const;
void setAttribute(const AtomicString& name, const AtomicString& value, ExceptionCode&);
void setAttributeNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, const AtomicString& value, ExceptionCode&, FragmentScriptingPermission = AllowScriptingContent);
@@ -197,13 +197,13 @@
// Returns the absolute bounding box translated into screen coordinates:
IntRect screenRect() const;
- void removeAttribute(const String& name);
- void removeAttributeNS(const String& namespaceURI, const String& localName);
+ void removeAttribute(const AtomicString& name);
+ void removeAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName);
PassRefPtr<Attr> detachAttribute(size_t index);
- PassRefPtr<Attr> getAttributeNode(const String& name);
- PassRefPtr<Attr> getAttributeNodeNS(const String& namespaceURI, const String& localName);
+ PassRefPtr<Attr> getAttributeNode(const AtomicString& name);
+ PassRefPtr<Attr> getAttributeNodeNS(const AtomicString& namespaceURI, const AtomicString& localName);
PassRefPtr<Attr> setAttributeNode(Attr*, ExceptionCode&);
PassRefPtr<Attr> setAttributeNodeNS(Attr*, ExceptionCode&);
PassRefPtr<Attr> removeAttributeNode(Attr*, ExceptionCode&);
Modified: trunk/Source/WebCore/dom/ElementAttributeData.cpp (121519 => 121520)
--- trunk/Source/WebCore/dom/ElementAttributeData.cpp 2012-06-29 06:12:22 UTC (rev 121519)
+++ trunk/Source/WebCore/dom/ElementAttributeData.cpp 2012-06-29 06:20:34 UTC (rev 121520)
@@ -299,7 +299,7 @@
element->didModifyAttribute(attribute);
}
-PassRefPtr<Attr> ElementAttributeData::getAttributeNode(const String& name, bool shouldIgnoreAttributeCase, Element* element) const
+PassRefPtr<Attr> ElementAttributeData::getAttributeNode(const AtomicString& name, bool shouldIgnoreAttributeCase, Element* element) const
{
ASSERT(element);
Attribute* attribute = getAttributeItem(name, shouldIgnoreAttributeCase);
Modified: trunk/Source/WebCore/dom/ElementAttributeData.h (121519 => 121520)
--- trunk/Source/WebCore/dom/ElementAttributeData.h 2012-06-29 06:12:22 UTC (rev 121519)
+++ trunk/Source/WebCore/dom/ElementAttributeData.h 2012-06-29 06:20:34 UTC (rev 121520)
@@ -75,7 +75,7 @@
size_t length() const { return m_attributes.size(); }
bool isEmpty() const { return m_attributes.isEmpty(); }
- PassRefPtr<Attr> getAttributeNode(const String&, bool shouldIgnoreAttributeCase, Element*) const;
+ PassRefPtr<Attr> getAttributeNode(const AtomicString&, bool shouldIgnoreAttributeCase, Element*) const;
PassRefPtr<Attr> getAttributeNode(const QualifiedName&, Element*) const;
// Internal interface.