Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: Source/core/html/HTMLObjectElement.cpp

Issue 195813003: Use new is*Element() helper functions further more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix bad assertion Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLObjectElement.cpp
diff --git a/Source/core/html/HTMLObjectElement.cpp b/Source/core/html/HTMLObjectElement.cpp
index 17f8fa7e4391db3769810b2f360ba65571d1d3ee..5e0fb91eb85a043537f3ec574a8915ffcf587089 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -212,8 +212,9 @@ bool HTMLObjectElement::hasFallbackContent() const
if (child->isTextNode()) {
if (!toText(child)->containsOnlyWhitespace())
return true;
- } else if (!child->hasTagName(paramTag))
+ } else if (!isHTMLParamElement(*child)) {
return true;
+ }
}
return false;
}
@@ -414,11 +415,11 @@ bool HTMLObjectElement::isExposed() const
{
// http://www.whatwg.org/specs/web-apps/current-work/#exposed
for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
- if (ancestor->hasTagName(objectTag) && toHTMLObjectElement(ancestor)->isExposed())
+ if (isHTMLObjectElement(*ancestor) && toHTMLObjectElement(ancestor)->isExposed())
return false;
}
- for (Element* element = ElementTraversal::firstWithin(*this); element; element = ElementTraversal::next(*element, this)) {
- if (element->hasTagName(objectTag) || element->hasTagName(embedTag))
+ for (HTMLElement* element = Traversal<HTMLElement>::firstWithin(*this); element; element = Traversal<HTMLElement>::next(*element, this)) {
+ if (isHTMLObjectElement(*element) || isHTMLEmbedElement(*element))
return false;
}
return true;
@@ -429,14 +430,14 @@ bool HTMLObjectElement::containsJavaApplet() const
if (MIMETypeRegistry::isJavaAppletMIMEType(getAttribute(typeAttr)))
return true;
- for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSkippingChildren(*child, this)) {
- if (child->hasTagName(paramTag)
+ for (HTMLElement* child = Traversal<HTMLElement>::firstWithin(*this); child; child = Traversal<HTMLElement>::nextSkippingChildren(*child, this)) {
+ if (isHTMLParamElement(*child)
&& equalIgnoringCase(child->getNameAttribute(), "type")
&& MIMETypeRegistry::isJavaAppletMIMEType(child->getAttribute(valueAttr).string()))
return true;
- if (child->hasTagName(objectTag) && toHTMLObjectElement(child)->containsJavaApplet())
+ if (isHTMLObjectElement(*child) && toHTMLObjectElement(*child).containsJavaApplet())
return true;
- if (child->hasTagName(appletTag))
+ if (isHTMLAppletElement(*child))
return true;
}

Powered by Google App Engine
This is Rietveld 408576698