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

Unified Diff: Source/core/html/HTMLNameCollection.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: Remove extraneous empty line in expected output Created 7 years 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/HTMLEmbedElement.cpp ('k') | Source/core/html/HTMLObjectElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLNameCollection.cpp
diff --git a/Source/core/html/HTMLNameCollection.cpp b/Source/core/html/HTMLNameCollection.cpp
index b11ca18dd1733f2afd1c7008f92cc83e43dcb2cd..9941f554c5191b8492263245955535ad84a8c25f 100644
--- a/Source/core/html/HTMLNameCollection.cpp
+++ b/Source/core/html/HTMLNameCollection.cpp
@@ -27,6 +27,7 @@
#include "core/dom/Element.h"
#include "core/dom/ElementTraversal.h"
#include "core/dom/NodeRareData.h"
+#include "core/html/HTMLEmbedElement.h"
#include "core/html/HTMLObjectElement.h"
namespace WebCore {
@@ -79,16 +80,15 @@ Element* HTMLNameCollection::virtualItemAfter(unsigned& offsetInArray, Element*
// find images, forms, applets, embeds, objects and iframes by name,
// applets and object by id, and images by id but only if they have
// a name attribute (this very strange rule matches IE)
- if (current->hasTagName(formTag) || current->hasTagName(embedTag) || current->hasTagName(iframeTag)) {
+ if (current->hasTagName(formTag)
+ || current->hasTagName(iframeTag)
+ || (current->hasTagName(embedTag) && toHTMLEmbedElement(current)->isExposed())) {
if (current->getNameAttribute() == m_name)
return current;
- } else if (current->hasTagName(appletTag)) {
+ } else if (current->hasTagName(appletTag)
+ || (current->hasTagName(objectTag) && toHTMLObjectElement(current)->isExposed())) {
if (current->getNameAttribute() == m_name || current->getIdAttribute() == m_name)
return current;
- } else if (current->hasTagName(objectTag)) {
- if ((current->getNameAttribute() == m_name || current->getIdAttribute() == m_name)
- && toHTMLObjectElement(current)->isDocNamedItem())
- return current;
} else if (current->hasTagName(imgTag)) {
if (current->getNameAttribute() == m_name || (current->getIdAttribute() == m_name && current->hasName()))
return current;
« no previous file with comments | « Source/core/html/HTMLEmbedElement.cpp ('k') | Source/core/html/HTMLObjectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698