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

Side by Side Diff: Source/core/html/HTMLEmbedElement.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/HTMLAttributeNames.in ('k') | Source/core/html/HTMLFrameElementBase.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, 2008, 2009, 2011 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // <object> which modifies url and serviceType before calling these. 139 // <object> which modifies url and serviceType before calling these.
140 if (!allowedToLoadFrameURL(m_url)) 140 if (!allowedToLoadFrameURL(m_url))
141 return; 141 return;
142 142
143 // FIXME: These should be joined into a PluginParameters class. 143 // FIXME: These should be joined into a PluginParameters class.
144 Vector<String> paramNames; 144 Vector<String> paramNames;
145 Vector<String> paramValues; 145 Vector<String> paramValues;
146 parametersForPlugin(paramNames, paramValues); 146 parametersForPlugin(paramNames, paramValues);
147 147
148 RefPtr<HTMLEmbedElement> protect(this); // Loading the plugin might remove u s from the document. 148 RefPtr<HTMLEmbedElement> protect(this); // Loading the plugin might remove u s from the document.
149 bool beforeLoadAllowedLoad = dispatchBeforeLoadEvent(m_url); 149
150 if (!beforeLoadAllowedLoad) { 150 // FIXME: Can we not have renderer here now that beforeload events are gone?
151 if (document().isPluginDocument()) { 151 if (!renderer())
152 // Plugins inside plugin documents load differently than other plugi ns. By the time
153 // we are here in a plugin document, the load of the plugin (which i s the plugin document's
154 // main resource) has already started. We need to explicitly cancel the main resource load here.
155 toPluginDocument(document()).cancelManualPluginLoad();
156 }
157 return;
158 }
159 if (!renderer()) // Do not load the plugin if beforeload removed this elemen t or its renderer.
160 return; 152 return;
161 153
162 // FIXME: beforeLoad could have detached the renderer! Just like in the <ob ject> case above.
163 requestObject(m_url, m_serviceType, paramNames, paramValues); 154 requestObject(m_url, m_serviceType, paramNames, paramValues);
164 } 155 }
165 156
166 bool HTMLEmbedElement::rendererIsNeeded(const RenderStyle& style) 157 bool HTMLEmbedElement::rendererIsNeeded(const RenderStyle& style)
167 { 158 {
168 if (isImageType()) 159 if (isImageType())
169 return HTMLPlugInElement::rendererIsNeeded(style); 160 return HTMLPlugInElement::rendererIsNeeded(style);
170 161
171 LocalFrame* frame = document().frame(); 162 LocalFrame* frame = document().frame();
172 if (!frame) 163 if (!frame)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 { 200 {
210 // http://www.whatwg.org/specs/web-apps/current-work/#exposed 201 // http://www.whatwg.org/specs/web-apps/current-work/#exposed
211 for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNod e()) { 202 for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNod e()) {
212 if (isHTMLObjectElement(*ancestor) && toHTMLObjectElement(*ancestor).isE xposed()) 203 if (isHTMLObjectElement(*ancestor) && toHTMLObjectElement(*ancestor).isE xposed())
213 return false; 204 return false;
214 } 205 }
215 return true; 206 return true;
216 } 207 }
217 208
218 } 209 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAttributeNames.in ('k') | Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698