[webkit-reviews] review granted: [Bug 17725] XPath should be case insensitive for HTML : [Attachment 30701] proposed fix

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 27 09:29:35 PDT 2009


Darin Adler <darin at apple.com> has granted Alexey Proskuryakov <ap at webkit.org>'s
request for review:
Bug 17725: XPath should be case insensitive for HTML
https://bugs.webkit.org/show_bug.cgi?id=17725

Attachment 30701: proposed fix
https://bugs.webkit.org/attachment.cgi?id=30701&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
> +	       if (node->nodeType() != Node::ELEMENT_NODE)
> +		   return false;

How about isElementNode() instead?

> +	       if (node->isHTMLElement() && node->document()->isHTMLDocument())
{
> +		   // Paths without namespaces should match HTML elements in
HTML documents despite those having an XHTML namespace. Names are compared
case-insensitively.
> +		   return
equalIgnoringCase(static_cast<Element*>(node)->localName(), name) &&
(namespaceURI.isNull() || namespaceURI == node->namespaceURI());
> +	       } else
> +		   return static_cast<Element*>(node)->hasLocalName(name) &&
namespaceURI == node->namespaceURI();

We normally don't do else after return.

r=me


More information about the webkit-reviews mailing list