Commit 844a6c59 authored by eric@webkit.org's avatar eric@webkit.org

2010-05-29 Anton Muhin <antonm@chromium.org>

        Reviewed by Darin Adler.

        Make NodeList getters take AtomicString instead of plain String
        https://bugs.webkit.org/show_bug.cgi?id=39892

        Those methods turn String into AtomicString later.  And this conversion
        is faster if underlying string is already atomic.
        That buys small (~2-3%) speed up for Chromium on Dromaeo DOM Core.
        I don't know if Safari benefits from it.

        * dom/Node.cpp:
        (WebCore::Node::getElementsByTagName):
        (WebCore::Node::getElementsByTagNameNS):
        * dom/Node.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c2484acd
2010-05-29 Anton Muhin <antonm@chromium.org>
Reviewed by Darin Adler.
Make NodeList getters take AtomicString instead of plain String
https://bugs.webkit.org/show_bug.cgi?id=39892
Those methods turn String into AtomicString later. And this conversion
is faster if underlying string is already atomic.
That buys small (~2-3%) speed up for Chromium on Dromaeo DOM Core.
I don't know if Safari benefits from it.
* dom/Node.cpp:
(WebCore::Node::getElementsByTagName):
(WebCore::Node::getElementsByTagNameNS):
* dom/Node.h:
2010-05-29 Justin Schuh <jschuh@chromium.org>
Reviewed by Adam Barth.
......
......@@ -1561,12 +1561,12 @@ bool Node::inSameContainingBlockFlowElement(Node *n)
// FIXME: End of obviously misplaced HTML editing functions. Try to move these out of Node.
PassRefPtr<NodeList> Node::getElementsByTagName(const String& name)
PassRefPtr<NodeList> Node::getElementsByTagName(const AtomicString& name)
{
return getElementsByTagNameNS(starAtom, name);
}
PassRefPtr<NodeList> Node::getElementsByTagNameNS(const AtomicString& namespaceURI, const String& localName)
PassRefPtr<NodeList> Node::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
{
if (localName.isNull())
return 0;
......
......@@ -533,8 +533,8 @@ public:
void removeCachedTagNodeList(TagNodeList*, const QualifiedName&);
void removeCachedLabelsNodeList(DynamicNodeList*);
PassRefPtr<NodeList> getElementsByTagName(const String&);
PassRefPtr<NodeList> getElementsByTagNameNS(const AtomicString& namespaceURI, const String& localName);
PassRefPtr<NodeList> getElementsByTagName(const AtomicString&);
PassRefPtr<NodeList> getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName);
PassRefPtr<NodeList> getElementsByName(const String& elementName);
PassRefPtr<NodeList> getElementsByClassName(const String& classNames);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment