Changeset 39596 in webkit


Ignore:
Timestamp:
Jan 5, 2009 12:39:12 AM (15 years ago)
Author:
dsmith@webkit.org
Message:

2009-01-04 David Smith <catfish.man@gmail.com>

Reviewed by Oliver Hunt.

Avoid redundant AtomicString conversions

  • dom/Node.cpp: (WebCore::Node::getElementsByTagName): Pass starAtom instead of "*" (WebCore::Node::getElementsByTagNameNS): Take an AtomicString for the namespace URI (WebCore::Node::isDefaultNamespace): Ditto (WebCore::Node::lookupPrefix): Ditto (WebCore::Node::lookupNamespacePrefix): Ditto
  • dom/Node.h: Ditto
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r39595 r39596  
     12009-01-04  David Smith  <catfish.man@gmail.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Avoid redundant AtomicString conversions
     6
     7        * dom/Node.cpp:
     8        (WebCore::Node::getElementsByTagName): Pass starAtom instead of "*"
     9        (WebCore::Node::getElementsByTagNameNS): Take an AtomicString for the namespace URI
     10        (WebCore::Node::isDefaultNamespace): Ditto
     11        (WebCore::Node::lookupPrefix): Ditto
     12        (WebCore::Node::lookupNamespacePrefix): Ditto
     13        * dom/Node.h: Ditto
     14
    1152009-01-04  Darin Adler  <darin@apple.com>
    216
  • trunk/WebCore/dom/Node.cpp

    r39563 r39596  
    13771377PassRefPtr<NodeList> Node::getElementsByTagName(const String& name)
    13781378{
    1379     return getElementsByTagNameNS("*", name);
     1379    return getElementsByTagNameNS(starAtom, name);
    13801380}
    13811381 
    1382 PassRefPtr<NodeList> Node::getElementsByTagNameNS(const String& namespaceURI, const String& localName)
     1382PassRefPtr<NodeList> Node::getElementsByTagNameNS(const AtomicString& namespaceURI, const String& localName)
    13831383{
    13841384    if (localName.isNull())
     
    13991399        result.first->second = new DynamicNodeList::Caches;
    14001400   
    1401     return TagNodeList::create(this, namespaceURI.isEmpty() ? nullAtom : AtomicString(namespaceURI), name, result.first->second);
     1401    return TagNodeList::create(this, namespaceURI.isEmpty() ? nullAtom : namespaceURI, name, result.first->second);
    14021402}
    14031403
     
    16151615}
    16161616
    1617 bool Node::isDefaultNamespace(const String &namespaceURI) const
     1617bool Node::isDefaultNamespace(const AtomicString &namespaceURI) const
    16181618{
    16191619    // Implemented according to
     
    16651665}
    16661666
    1667 String Node::lookupPrefix(const String &namespaceURI) const
     1667String Node::lookupPrefix(const AtomicString &namespaceURI) const
    16681668{
    16691669    // Implemented according to
     
    17601760}
    17611761
    1762 String Node::lookupNamespacePrefix(const String &_namespaceURI, const Element *originalElement) const
     1762String Node::lookupNamespacePrefix(const AtomicString &_namespaceURI, const Element *originalElement) const
    17631763{
    17641764    if (_namespaceURI.isNull())
  • trunk/WebCore/dom/Node.h

    r39504 r39596  
    143143    bool isSameNode(Node* other) const { return this == other; }
    144144    bool isEqualNode(Node*) const;
    145     bool isDefaultNamespace(const String& namespaceURI) const;
    146     String lookupPrefix(const String& namespaceURI) const;
     145    bool isDefaultNamespace(const AtomicString& namespaceURI) const;
     146    String lookupPrefix(const AtomicString& namespaceURI) const;
    147147    String lookupNamespaceURI(const String& prefix) const;
    148     String lookupNamespacePrefix(const String& namespaceURI, const Element* originalElement) const;
     148    String lookupNamespacePrefix(const AtomicString& namespaceURI, const Element* originalElement) const;
    149149   
    150150    String textContent(bool convertBRsToNewlines = false) const;
     
    482482   
    483483    PassRefPtr<NodeList> getElementsByTagName(const String&);
    484     PassRefPtr<NodeList> getElementsByTagNameNS(const String& namespaceURI, const String& localName);
     484    PassRefPtr<NodeList> getElementsByTagNameNS(const AtomicString& namespaceURI, const String& localName);
    485485    PassRefPtr<NodeList> getElementsByName(const String& elementName);
    486486    PassRefPtr<NodeList> getElementsByClassName(const String& classNames);
Note: See TracChangeset for help on using the changeset viewer.