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

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

Issue 201293002: Add Traversal<*Element>::firstAncestor() API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Slight clean up 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 5e0fb91eb85a043537f3ec574a8915ffcf587089..2a0b3004763e3c4c9c5e2d0fdaf7a437937a56a7 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -414,8 +414,8 @@ void HTMLObjectElement::renderFallbackContent()
bool HTMLObjectElement::isExposed() const
{
// http://www.whatwg.org/specs/web-apps/current-work/#exposed
- for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
- if (isHTMLObjectElement(*ancestor) && toHTMLObjectElement(ancestor)->isExposed())
+ for (HTMLObjectElement* ancestor = Traversal<HTMLObjectElement>::firstAncestor(*this); ancestor; ancestor = Traversal<HTMLObjectElement>::firstAncestor(*ancestor)) {
+ if (ancestor->isExposed())
return false;
}
for (HTMLElement* element = Traversal<HTMLElement>::firstWithin(*this); element; element = Traversal<HTMLElement>::next(*element, this)) {

Powered by Google App Engine
This is Rietveld 408576698