summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/dom/Element.cpp
diff options
context:
space:
mode:
authorKulanthaivel Palanichamy <kulanthaivel@codeaurora.org>2012-08-15 17:14:48 -0700
committerSteve Kondik <shade@chemlab.org>2013-01-20 18:38:34 -0800
commit91437969ddb28bc81b3652986a67aae7e2465db2 (patch)
tree4d09df4e02a483e573700d8bfacb6fec8b658a7c /Source/WebCore/dom/Element.cpp
parent0f5d4355d7a384679722338d55f65bbb92350cfc (diff)
downloadexternal_webkit-91437969ddb28bc81b3652986a67aae7e2465db2.zip
external_webkit-91437969ddb28bc81b3652986a67aae7e2465db2.tar.gz
external_webkit-91437969ddb28bc81b3652986a67aae7e2465db2.tar.bz2
[WebKit] Browsermark DomAdvSearch and DomSearch optimizations
This patch is a combination of the following optimizations. Optimize appendCharactersReplacingEntities [Performance] Optimize innerHTML and outerHTML https://bugs.webkit.org/show_bug.cgi?id=81214 Optimize Dromaeo/dom-query.html by caching NodeRareData on Document https://bugs.webkit.org/show_bug.cgi?id=90059 Optimize Dromaeo/dom-attr.html by speeding up Element::getAttribute() https://bugs.webkit.org/show_bug.cgi?id=90174 Change argument types of Element::getAttribute*() from String to AtomicString https://bugs.webkit.org/show_bug.cgi?id=90246 Conflicts: Source/WebCore/ChangeLog Source/WebCore/dom/Document.cpp Source/WebCore/dom/Document.h Conflicts: Source/WebCore/ChangeLog Change-Id: I9ca3d2e883155e2ad08c3cb0c5912b935ebe9406
Diffstat (limited to 'Source/WebCore/dom/Element.cpp')
-rw-r--r--Source/WebCore/dom/Element.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 5fb6cdc..4b9de49 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -622,7 +622,7 @@ static inline bool shouldIgnoreAttributeCase(const Element* e)
return e && e->document()->isHTMLDocument() && e->isHTMLElement();
}
-const AtomicString& Element::getAttribute(const String& name) const
+const AtomicString& Element::getAttribute(const AtomicString& name) const
{
bool ignoreCase = shouldIgnoreAttributeCase(this);
@@ -645,7 +645,7 @@ const AtomicString& Element::getAttribute(const String& name) const
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));
}
@@ -1471,11 +1471,11 @@ void Element::setAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
setAttribute(qName, value, ec);
}
-void Element::removeAttribute(const String& name, ExceptionCode& ec)
+void Element::removeAttribute(const AtomicString& name, ExceptionCode& ec)
{
InspectorInstrumentation::willModifyDOMAttr(document(), this);
- String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
+ AtomicString localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
if (m_attributeMap) {
m_attributeMap->removeNamedItem(localName, ec);
@@ -1486,21 +1486,21 @@ void Element::removeAttribute(const String& name, ExceptionCode& ec)
InspectorInstrumentation::didModifyDOMAttr(document(), this);
}
-void Element::removeAttributeNS(const String& namespaceURI, const String& localName, ExceptionCode& ec)
+void Element::removeAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName, ExceptionCode& ec)
{
removeAttribute(QualifiedName(nullAtom, localName, namespaceURI), ec);
}
-PassRefPtr<Attr> Element::getAttributeNode(const String& name)
+PassRefPtr<Attr> Element::getAttributeNode(const AtomicString& name)
{
NamedNodeMap* attrs = attributes(true);
if (!attrs)
return 0;
- String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
+ AtomicString localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
return static_pointer_cast<Attr>(attrs->getNamedItem(localName));
}
-PassRefPtr<Attr> Element::getAttributeNodeNS(const String& namespaceURI, const String& localName)
+PassRefPtr<Attr> Element::getAttributeNodeNS(const AtomicString& namespaceURI, const AtomicString& localName)
{
NamedNodeMap* attrs = attributes(true);
if (!attrs)
@@ -1508,7 +1508,7 @@ PassRefPtr<Attr> Element::getAttributeNodeNS(const String& namespaceURI, const S
return static_pointer_cast<Attr>(attrs->getNamedItem(QualifiedName(nullAtom, localName, namespaceURI)));
}
-bool Element::hasAttribute(const String& name) const
+bool Element::hasAttribute(const AtomicString& name) const
{
NamedNodeMap* attrs = attributes(true);
if (!attrs)
@@ -1516,11 +1516,11 @@ bool Element::hasAttribute(const String& name) const
// This call to String::lower() seems to be required but
// there may be a way to remove it.
- String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
+ AtomicString localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
return attrs->getAttributeItem(localName, false);
}
-bool Element::hasAttributeNS(const String& namespaceURI, const String& localName) const
+bool Element::hasAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName) const
{
NamedNodeMap* attrs = attributes(true);
if (!attrs)