diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 13:02:20 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-26 15:21:41 +0100 |
commit | a94275402997c11dd2e778633dacf4b7e630a35d (patch) | |
tree | e66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebCore/html/HTMLEmbedElement.cpp | |
parent | 09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff) | |
download | external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2 |
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebCore/html/HTMLEmbedElement.cpp')
-rw-r--r-- | WebCore/html/HTMLEmbedElement.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/WebCore/html/HTMLEmbedElement.cpp b/WebCore/html/HTMLEmbedElement.cpp index e88ee81..c4f007c 100644 --- a/WebCore/html/HTMLEmbedElement.cpp +++ b/WebCore/html/HTMLEmbedElement.cpp @@ -25,13 +25,16 @@ #include "HTMLEmbedElement.h" #include "Attribute.h" -#include "CSSHelper.h" #include "CSSPropertyNames.h" +#include "DocumentLoader.h" #include "Frame.h" #include "HTMLDocument.h" #include "HTMLImageLoader.h" #include "HTMLNames.h" #include "HTMLObjectElement.h" +#include "HTMLParserIdioms.h" +#include "MainResourceLoader.h" +#include "PluginDocument.h" #include "RenderEmbeddedObject.h" #include "RenderImage.h" #include "RenderWidget.h" @@ -94,9 +97,9 @@ void HTMLEmbedElement::parseMappedAttribute(Attribute* attr) if (!isImageType() && m_imageLoader) m_imageLoader.clear(); } else if (attr->name() == codeAttr) - m_url = deprecatedParseURL(value.string()); + m_url = stripLeadingAndTrailingHTMLSpaces(value.string()); else if (attr->name() == srcAttr) { - m_url = deprecatedParseURL(value.string()); + m_url = stripLeadingAndTrailingHTMLSpaces(value.string()); if (renderer() && isImageType()) { if (!m_imageLoader) m_imageLoader = adoptPtr(new HTMLImageLoader(this)); @@ -158,8 +161,20 @@ void HTMLEmbedElement::updateWidget(bool onlyCreateNonNetscapePlugins) Vector<String> paramValues; parametersForPlugin(paramNames, paramValues); - if (!dispatchBeforeLoadEvent(m_url)) + ASSERT(!m_inBeforeLoadEventHandler); + m_inBeforeLoadEventHandler = true; + bool beforeLoadAllowedLoad = dispatchBeforeLoadEvent(m_url); + m_inBeforeLoadEventHandler = false; + + if (!beforeLoadAllowedLoad) { + if (document()->isPluginDocument()) { + // Plugins inside plugin documents load differently than other plugins. By the time + // we are here in a plugin document, the load of the plugin (which is the plugin document's + // main resource) has already started. We need to explicitly cancel the main resource load here. + toPluginDocument(document())->cancelManualPluginLoad(); + } return; + } SubframeLoader* loader = document()->frame()->loader()->subframeLoader(); // FIXME: beforeLoad could have detached the renderer! Just like in the <object> case above. @@ -177,7 +192,7 @@ bool HTMLEmbedElement::rendererIsNeeded(RenderStyle* style) // If my parent is an <object> and is not set to use fallback content, I // should be ignored and not get a renderer. - Node* p = parentNode(); + ContainerNode* p = parentNode(); if (p && p->hasTagName(objectTag)) { ASSERT(p->renderer()); if (!static_cast<HTMLObjectElement*>(p)->useFallbackContent()) { |