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

Side by Side Diff: Source/core/html/HTMLPlugInElement.cpp

Issue 205523003: Remove beforeload events. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove more tests Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/core/html/HTMLScriptElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 namespace WebCore { 53 namespace WebCore {
54 54
55 using namespace HTMLNames; 55 using namespace HTMLNames;
56 56
57 HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& doc , bool createdByParser, PreferPlugInsForImagesOption preferPlugInsForImagesOptio n) 57 HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& doc , bool createdByParser, PreferPlugInsForImagesOption preferPlugInsForImagesOptio n)
58 : HTMLFrameOwnerElement(tagName, doc) 58 : HTMLFrameOwnerElement(tagName, doc)
59 , m_isDelayingLoadEvent(false) 59 , m_isDelayingLoadEvent(false)
60 , m_NPObject(0) 60 , m_NPObject(0)
61 , m_isCapturingMouseEvents(false) 61 , m_isCapturingMouseEvents(false)
62 , m_inBeforeLoadEventHandler(false)
63 // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay 62 // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay
64 // widget updates until after all children are parsed. For HTMLEmbedElement 63 // widget updates until after all children are parsed. For HTMLEmbedElement
65 // this delay is unnecessary, but it is simpler to make both classes share 64 // this delay is unnecessary, but it is simpler to make both classes share
66 // the same codepath in this class. 65 // the same codepath in this class.
67 , m_needsWidgetUpdate(!createdByParser) 66 , m_needsWidgetUpdate(!createdByParser)
68 , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPrefe rPlugInsForImages) 67 , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPrefe rPlugInsForImages)
69 , m_displayState(Playing) 68 , m_displayState(Playing)
70 { 69 {
71 setHasCustomStyleCallbacks(); 70 setHasCustomStyleCallbacks();
72 } 71 }
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // If the host dynamically turns off JavaScript (or Java) we will still 217 // If the host dynamically turns off JavaScript (or Java) we will still
219 // return the cached allocated Bindings::Instance. Not supporting this 218 // return the cached allocated Bindings::Instance. Not supporting this
220 // edge-case is OK. 219 // edge-case is OK.
221 if (!m_pluginWrapper) { 220 if (!m_pluginWrapper) {
222 if (Widget* widget = pluginWidget()) 221 if (Widget* widget = pluginWidget())
223 m_pluginWrapper = frame->script().createPluginWrapper(widget); 222 m_pluginWrapper = frame->script().createPluginWrapper(widget);
224 } 223 }
225 return m_pluginWrapper.get(); 224 return m_pluginWrapper.get();
226 } 225 }
227 226
228 bool HTMLPlugInElement::dispatchBeforeLoadEvent(const String& sourceURL)
229 {
230 // FIXME: Our current plug-in loading design can't guarantee the following
231 // assertion is true, since plug-in loading can be initiated during layout,
232 // and synchronous layout can be initiated in a beforeload event handler!
233 // See <http://webkit.org/b/71264>.
234 // ASSERT(!m_inBeforeLoadEventHandler);
235 m_inBeforeLoadEventHandler = true;
236 bool beforeLoadAllowedLoad = HTMLFrameOwnerElement::dispatchBeforeLoadEvent( sourceURL);
237 m_inBeforeLoadEventHandler = false;
238 return beforeLoadAllowedLoad;
239 }
240
241 Widget* HTMLPlugInElement::pluginWidget() const 227 Widget* HTMLPlugInElement::pluginWidget() const
242 { 228 {
243 if (m_inBeforeLoadEventHandler) {
244 // The plug-in hasn't loaded yet, and it makes no sense to try to load
245 // if beforeload handler happened to touch the plug-in element. That
246 // would recursively call beforeload for the same element.
247 return 0;
248 }
249
250 if (RenderWidget* renderWidget = renderWidgetForJSBindings()) 229 if (RenderWidget* renderWidget = renderWidgetForJSBindings())
251 return renderWidget->widget(); 230 return renderWidget->widget();
252 return 0; 231 return 0;
253 } 232 }
254 233
255 bool HTMLPlugInElement::isPresentationAttribute(const QualifiedName& name) const 234 bool HTMLPlugInElement::isPresentationAttribute(const QualifiedName& name) const
256 { 235 {
257 if (name == widthAttr || name == heightAttr || name == vspaceAttr || name == hspaceAttr || name == alignAttr) 236 if (name == widthAttr || name == heightAttr || name == vspaceAttr || name == hspaceAttr || name == alignAttr)
258 return true; 237 return true;
259 return HTMLFrameOwnerElement::isPresentationAttribute(name); 238 return HTMLFrameOwnerElement::isPresentationAttribute(name);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 if (root.isOldestAuthorShadowRoot()) 503 if (root.isOldestAuthorShadowRoot())
525 lazyReattachIfAttached(); 504 lazyReattachIfAttached();
526 } 505 }
527 506
528 bool HTMLPlugInElement::useFallbackContent() const 507 bool HTMLPlugInElement::useFallbackContent() const
529 { 508 {
530 return hasAuthorShadowRoot(); 509 return hasAuthorShadowRoot();
531 } 510 }
532 511
533 } 512 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/core/html/HTMLScriptElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698