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

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: Add firstAncestorOrSelf() 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/HTMLFrameSetElement.cpp ('k') | Source/core/html/HTMLOptGroupElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLObjectElement.cpp
diff --git a/Source/core/html/HTMLObjectElement.cpp b/Source/core/html/HTMLObjectElement.cpp
index 5b5c0344366aeb0c36d3801b5454dc5647cbbeee..38797a16826675fe4cba1a1c62dbc55638fa1dd0 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -420,8 +420,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)) {
« no previous file with comments | « Source/core/html/HTMLFrameSetElement.cpp ('k') | Source/core/html/HTMLOptGroupElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698