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

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

Issue 75273004: Add 'exposed' objects and embeds to a document's named properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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/HTMLObjectElement.h ('k') | no next file » | 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 1d9a87adf4b710dde3c07f6c878c1e374f067b53..2851b34422bfea489ca82abb21e11f86c2c03595 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -386,6 +386,22 @@ void HTMLObjectElement::renderFallbackContent()
reattachFallbackContent();
}
+bool HTMLObjectElement::isExposed() const
+{
+ // http://www.whatwg.org/specs/web-apps/current-work/#exposed
+ for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
abarth-chromium 2013/11/18 17:38:58 Are these ancestor traversals correct w.r.t. shado
sof 2013/11/18 20:37:35 Thanks. Does https://codereview.chromium.org/75
+ if (ancestor->hasTagName(objectTag) && toHTMLObjectElement(ancestor)->isExposed())
+ return false;
+ }
+ if (hasFallbackContent() && !useFallbackContent())
+ return true;
+ for (Node* node = firstChild(); node; node = NodeTraversal::next(*node, this)) {
+ if (node->hasTagName(objectTag) || node->hasTagName(embedTag))
+ return false;
+ }
+ return true;
+}
+
bool HTMLObjectElement::containsJavaApplet() const
{
if (MIMETypeRegistry::isJavaAppletMIMEType(getAttribute(typeAttr)))
« no previous file with comments | « Source/core/html/HTMLObjectElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698