diff options
Diffstat (limited to 'WebCore/html/HTMLObjectElement.cpp')
-rw-r--r-- | WebCore/html/HTMLObjectElement.cpp | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp index 5989ec7..de1ed91 100644 --- a/WebCore/html/HTMLObjectElement.cpp +++ b/WebCore/html/HTMLObjectElement.cpp @@ -86,7 +86,7 @@ void HTMLObjectElement::parseMappedAttribute(Attribute* attr) m_needWidgetUpdate = true; if (renderer() && isImageType()) { if (!m_imageLoader) - m_imageLoader.set(new HTMLImageLoader(this)); + m_imageLoader = adoptPtr(new HTMLImageLoader(this)); m_imageLoader->updateFromElementIgnoringPreviousError(); } } else if (attr->name() == classidAttr) { @@ -152,7 +152,7 @@ void HTMLObjectElement::attach() if (isImage && renderer() && !m_useFallbackContent) { if (!m_imageLoader) - m_imageLoader.set(new HTMLImageLoader(this)); + m_imageLoader = adoptPtr(new HTMLImageLoader(this)); m_imageLoader->updateFromElement(); } } @@ -262,6 +262,32 @@ void HTMLObjectElement::renderFallbackContent() attach(); } +// FIXME: This should be removed, all callers are almost certainly wrong. +static bool isRecognizedTagName(const QualifiedName& tagName) +{ + DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ()); + if (tagList.isEmpty()) { + size_t tagCount = 0; + QualifiedName** tags = HTMLNames::getHTMLTags(&tagCount); + for (size_t i = 0; i < tagCount; i++) { + if (*tags[i] == bgsoundTag + || *tags[i] == commandTag + || *tags[i] == detailsTag + || *tags[i] == figcaptionTag + || *tags[i] == figureTag + || *tags[i] == summaryTag + || *tags[i] == trackTag) { + // Even though we have atoms for these tags, we don't want to + // treat them as "recognized tags" for the purpose of parsing + // because that changes how we parse documents. + continue; + } + tagList.add(tags[i]->localName().impl()); + } + } + return tagList.contains(tagName.localName().impl()); +} + void HTMLObjectElement::updateDocNamedItem() { // The rule is "<object> elements with no children other than @@ -273,7 +299,8 @@ void HTMLObjectElement::updateDocNamedItem() while (child && isNamedItem) { if (child->isElementNode()) { Element* element = static_cast<Element*>(child); - if (HTMLElement::isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag)) + // FIXME: Use of isRecognizedTagName is almost certainly wrong here. + if (isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag)) isNamedItem = false; } else if (child->isTextNode()) { if (!static_cast<Text*>(child)->containsOnlyWhitespace()) |