Commit 0e7b0652 authored by tkent@chromium.org's avatar tkent@chromium.org

Remove WebElement::hasTagName.

There are no callsites in Chromium.  This function is unsafe because it
ignores namespace URI.

BUG=

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176895

Review URL: https://codereview.chromium.org/354763002

git-svn-id: svn://svn.chromium.org/blink/trunk@177049 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 77f25d9b
...@@ -62,12 +62,6 @@ WebString WebElement::tagName() const ...@@ -62,12 +62,6 @@ WebString WebElement::tagName() const
return constUnwrap<Element>()->tagName(); return constUnwrap<Element>()->tagName();
} }
bool WebElement::hasTagName(const WebString& tagName) const
{
return equalIgnoringCase(constUnwrap<Element>()->tagName(),
tagName.operator String());
}
bool WebElement::hasHTMLTagName(const WebString& tagName) const bool WebElement::hasHTMLTagName(const WebString& tagName) const
{ {
// How to create class nodeName localName // How to create class nodeName localName
......
...@@ -358,14 +358,14 @@ TEST_F(WebViewTest, HitTestResultAtWithPageScale) ...@@ -358,14 +358,14 @@ TEST_F(WebViewTest, HitTestResultAtWithPageScale)
// Image is at top left quandrant, so should not hit it. // Image is at top left quandrant, so should not hit it.
WebHitTestResult negativeResult = webView->hitTestResultAt(hitPoint); WebHitTestResult negativeResult = webView->hitTestResultAt(hitPoint);
ASSERT_EQ(WebNode::ElementNode, negativeResult.node().nodeType()); ASSERT_EQ(WebNode::ElementNode, negativeResult.node().nodeType());
EXPECT_FALSE(negativeResult.node().to<WebElement>().hasTagName("img")); EXPECT_FALSE(negativeResult.node().to<WebElement>().hasHTMLTagName("img"));
negativeResult.reset(); negativeResult.reset();
// Scale page up 2x so image should occupy the whole viewport. // Scale page up 2x so image should occupy the whole viewport.
webView->setPageScaleFactor(2.0f); webView->setPageScaleFactor(2.0f);
WebHitTestResult positiveResult = webView->hitTestResultAt(hitPoint); WebHitTestResult positiveResult = webView->hitTestResultAt(hitPoint);
ASSERT_EQ(WebNode::ElementNode, positiveResult.node().nodeType()); ASSERT_EQ(WebNode::ElementNode, positiveResult.node().nodeType());
EXPECT_TRUE(positiveResult.node().to<WebElement>().hasTagName("img")); EXPECT_TRUE(positiveResult.node().to<WebElement>().hasHTMLTagName("img"));
positiveResult.reset(); positiveResult.reset();
} }
......
...@@ -54,10 +54,6 @@ struct WebRect; ...@@ -54,10 +54,6 @@ struct WebRect;
BLINK_EXPORT bool isTextFormControlElement() const; BLINK_EXPORT bool isTextFormControlElement() const;
// Returns the qualified name, which may contain a prefix and a colon. // Returns the qualified name, which may contain a prefix and a colon.
BLINK_EXPORT WebString tagName() const; BLINK_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.
BLINK_EXPORT bool hasTagName(const WebString&) const;
// Check if this element has the specified local tag name, and the HTML // Check if this element has the specified local tag name, and the HTML
// namespace. Tag name matching is case-insensitive. // namespace. Tag name matching is case-insensitive.
BLINK_EXPORT bool hasHTMLTagName(const WebString&) const; BLINK_EXPORT bool hasHTMLTagName(const WebString&) const;
......
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