Changeset 133982 in webkit


Ignore:
Timestamp:
Nov 8, 2012, 5:33:26 PM (13 years ago)
Author:
tkent@chromium.org
Message:

[Chromium] WebElement::hasHTMLTagName returns true for non-HTML elements
https://bugs.webkit.org/show_bug.cgi?id=101537

Reviewed by Abhishek Arya.

We should not do ignore-case comparison for tagName, which is always
upper-case and createElementNS(xhtmlNS, "INPUT") doesn't create an
HTMLInputElement object. We need to check if localName is equal to
"input" in this case.

  • src/WebElement.cpp:

(WebKit::WebElement::hasHTMLTagName):

Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r133963 r133982  
     12012-11-07  Kent Tamura  <tkent@chromium.org>
     2
     3        [Chromium] WebElement::hasHTMLTagName returns true for non-HTML elements
     4        https://bugs.webkit.org/show_bug.cgi?id=101537
     5
     6        Reviewed by Abhishek Arya.
     7
     8        We should not do ignore-case comparison for tagName, which is always
     9        upper-case and createElementNS(xhtmlNS, "INPUT") doesn't create an
     10        HTMLInputElement object. We need to check if localName is equal to
     11        "input" in this case.
     12
     13        * src/WebElement.cpp:
     14        (WebKit::WebElement::hasHTMLTagName):
     15
    1162012-11-08  Joshua Bell  <jsbell@chromium.org>
    217
  • trunk/Source/WebKit/chromium/src/WebElement.cpp

    r130847 r133982  
    6767bool WebElement::hasHTMLTagName(const WebString& tagName) const
    6868{
     69    // How to create                     class              nodeName localName
     70    // createElement('input')            HTMLInputElement   INPUT    input
     71    // createElement('INPUT')            HTMLInputElement   INPUT    input
     72    // createElementNS(xhtmlNS, 'input') HTMLInputElement   INPUT    input
     73    // createElementNS(xhtmlNS, 'INPUT') HTMLUnknownElement INPUT    INPUT
    6974    const Element* element = constUnwrap<Element>();
    70     return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && equalIgnoringCase(element->tagName(), String(tagName));
     75    return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && element->localName() == String(tagName).lower();
    7176}
    7277
Note: See TracChangeset for help on using the changeset viewer.