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

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

Issue 198553002: Use new is*Element() helper functions even more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | Source/core/html/HTMLFieldSetElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLEmbedElement.cpp
diff --git a/Source/core/html/HTMLEmbedElement.cpp b/Source/core/html/HTMLEmbedElement.cpp
index 37fc29337b2512617bf2033cd0ba8b5899bf9deb..3d366eefbb05bc2a8a4d529984fdd9af777ec0ef 100644
--- a/Source/core/html/HTMLEmbedElement.cpp
+++ b/Source/core/html/HTMLEmbedElement.cpp
@@ -54,10 +54,11 @@ PassRefPtr<HTMLEmbedElement> HTMLEmbedElement::create(Document& document, bool c
static inline RenderWidget* findWidgetRenderer(const Node* n)
{
- if (!n->renderer())
- do
+ if (!n->renderer()) {
+ do {
n = n->parentNode();
- while (n && !n->hasTagName(objectTag));
+ } while (n && !isHTMLObjectElement(*n));
+ }
if (n && n->renderer() && n->renderer()->isWidget())
return toRenderWidget(n->renderer());
@@ -174,7 +175,7 @@ bool HTMLEmbedElement::rendererIsNeeded(const RenderStyle& style)
// If my parent is an <object> and is not set to use fallback content, I
// should be ignored and not get a renderer.
ContainerNode* p = parentNode();
- if (p && p->hasTagName(objectTag)) {
+ if (isHTMLObjectElement(p)) {
ASSERT(p->renderer());
if (!toHTMLObjectElement(p)->useFallbackContent()) {
ASSERT(!p->renderer()->isEmbeddedObject());
@@ -203,7 +204,7 @@ bool HTMLEmbedElement::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;
}
return true;
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | Source/core/html/HTMLFieldSetElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698