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

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

Issue 50453004: Finding an <object> element by name only works it has no children other than <param> elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unnecessary include Created 7 years, 2 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/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 b4bb9b462cf8c0f377a2b08f4c27de37b05cb105..542a2bcdba48bfae9878e63aa4284ebc68a0d805 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -50,7 +50,6 @@ using namespace HTMLNames;
inline HTMLObjectElement::HTMLObjectElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form, bool createdByParser)
: HTMLPlugInElement(tagName, document, createdByParser, ShouldNotPreferPlugInsForImages)
- , m_docNamedItem(true)
, m_useFallbackContent(false)
{
ASSERT(hasTagName(objectTag));
@@ -335,7 +334,6 @@ void HTMLObjectElement::removedFrom(ContainerNode* insertionPoint)
void HTMLObjectElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
- updateDocNamedItem();
if (inDocument() && !useFallbackContent()) {
setNeedsWidgetUpdate(true);
setNeedsStyleRecalc();
@@ -414,40 +412,6 @@ static bool isRecognizedTagName(const QualifiedName& tagName)
return tagList.contains(tagName.localName().impl());
}
-void HTMLObjectElement::updateDocNamedItem()
-{
- // The rule is "<object> elements with no children other than
- // <param> elements, unknown elements and whitespace can be
- // found by name in a document, and other <object> elements cannot."
- bool wasNamedItem = m_docNamedItem;
- bool isNamedItem = true;
- Node* child = firstChild();
- while (child && isNamedItem) {
- if (child->isElementNode()) {
- Element* element = toElement(child);
- // FIXME: Use of isRecognizedTagName is almost certainly wrong here.
- if (isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag))
- isNamedItem = false;
- } else if (child->isTextNode()) {
- if (!toText(child)->containsOnlyWhitespace())
- isNamedItem = false;
- } else
- isNamedItem = false;
- child = child->nextSibling();
- }
- if (isNamedItem != wasNamedItem && document().isHTMLDocument()) {
- HTMLDocument& document = toHTMLDocument(this->document());
- if (isNamedItem) {
- document.addNamedItem(getNameAttribute());
- document.addExtraNamedItem(getIdAttribute());
- } else {
- document.removeNamedItem(getNameAttribute());
- document.removeExtraNamedItem(getIdAttribute());
- }
- }
- m_docNamedItem = isNamedItem;
-}
-
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