Title: [132829] branches/chromium/1271/Source/WebKit/chromium
Revision
132829
Author
[email protected]
Date
2012-10-29 11:22:57 -0700 (Mon, 29 Oct 2012)

Log Message

Merge 130847
BUG=154465
Review URL: https://codereview.chromium.org/11273084

Modified Paths

Diff

Modified: branches/chromium/1271/Source/WebKit/chromium/public/WebElement.h (132828 => 132829)


--- branches/chromium/1271/Source/WebKit/chromium/public/WebElement.h	2012-10-29 18:18:56 UTC (rev 132828)
+++ branches/chromium/1271/Source/WebKit/chromium/public/WebElement.h	2012-10-29 18:22:57 UTC (rev 132829)
@@ -51,8 +51,15 @@
 
         WEBKIT_EXPORT bool isFormControlElement() const;
         WEBKIT_EXPORT bool isTextFormControlElement() const;
+        // Returns the qualified name, which may contain a prefix and a colon.
         WEBKIT_EXPORT WebString tagName() const;
+        // Check if this element has the specified qualified name. This function
+        // doesn't makes much sense because we have no ways to check namespace
+        // URI. Do not use this.
         WEBKIT_EXPORT bool hasTagName(const WebString&) const;
+        // Check if this element has the specified local tag name, and the HTML
+        // namespace. Tag name matching is case-insensitive.
+        WEBKIT_EXPORT bool hasHTMLTagName(const WebString&) const;
         WEBKIT_EXPORT bool hasAttribute(const WebString&) const;
         WEBKIT_EXPORT WebString getAttribute(const WebString&) const;
         WEBKIT_EXPORT bool setAttribute(const WebString& name, const WebString& value);

Modified: branches/chromium/1271/Source/WebKit/chromium/src/WebElement.cpp (132828 => 132829)


--- branches/chromium/1271/Source/WebKit/chromium/src/WebElement.cpp	2012-10-29 18:18:56 UTC (rev 132828)
+++ branches/chromium/1271/Source/WebKit/chromium/src/WebElement.cpp	2012-10-29 18:22:57 UTC (rev 132829)
@@ -65,6 +65,12 @@
                              tagName.operator String());
 }
 
+bool WebElement::hasHTMLTagName(const WebString& tagName) const
+{
+    const Element* element = constUnwrap<Element>();
+    return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && equalIgnoringCase(element->tagName(), String(tagName));
+}
+
 bool WebElement::hasAttribute(const WebString& attrName) const
 {
     return constUnwrap<Element>()->hasAttribute(attrName);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to