| OLD | NEW |
| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 292 |
| 293 void HTMLPlugInElement::resetInstance() | 293 void HTMLPlugInElement::resetInstance() |
| 294 { | 294 { |
| 295 m_pluginWrapper.clear(); | 295 m_pluginWrapper.clear(); |
| 296 } | 296 } |
| 297 | 297 |
| 298 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() | 298 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() |
| 299 { | 299 { |
| 300 LocalFrame* frame = document().frame(); | 300 LocalFrame* frame = document().frame(); |
| 301 if (!frame) | 301 if (!frame) |
| 302 return 0; | 302 return nullptr; |
| 303 | 303 |
| 304 // If the host dynamically turns off JavaScript (or Java) we will still | 304 // If the host dynamically turns off JavaScript (or Java) we will still |
| 305 // return the cached allocated Bindings::Instance. Not supporting this | 305 // return the cached allocated Bindings::Instance. Not supporting this |
| 306 // edge-case is OK. | 306 // edge-case is OK. |
| 307 if (!m_pluginWrapper) { | 307 if (!m_pluginWrapper) { |
| 308 Widget* plugin; | 308 Widget* plugin; |
| 309 | 309 |
| 310 if (m_persistedPluginWidget) | 310 if (m_persistedPluginWidget) |
| 311 plugin = m_persistedPluginWidget.get(); | 311 plugin = m_persistedPluginWidget.get(); |
| 312 else | 312 else |
| 313 plugin = pluginWidget(); | 313 plugin = pluginWidget(); |
| 314 | 314 |
| 315 if (plugin) | 315 if (plugin) |
| 316 m_pluginWrapper = frame->script().createPluginWrapper(plugin); | 316 m_pluginWrapper = frame->script().createPluginWrapper(plugin); |
| 317 } | 317 } |
| 318 return m_pluginWrapper.get(); | 318 return m_pluginWrapper.get(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 Widget* HTMLPlugInElement::pluginWidget() const | 321 Widget* HTMLPlugInElement::pluginWidget() const |
| 322 { | 322 { |
| 323 if (RenderPart* renderPart = renderPartForJSBindings()) | 323 if (RenderPart* renderPart = renderPartForJSBindings()) |
| 324 return renderPart->widget(); | 324 return renderPart->widget(); |
| 325 return 0; | 325 return nullptr; |
| 326 } | 326 } |
| 327 | 327 |
| 328 bool HTMLPlugInElement::isPresentationAttribute(const QualifiedName& name) const | 328 bool HTMLPlugInElement::isPresentationAttribute(const QualifiedName& name) const |
| 329 { | 329 { |
| 330 if (name == widthAttr || name == heightAttr || name == vspaceAttr || name ==
hspaceAttr || name == alignAttr) | 330 if (name == widthAttr || name == heightAttr || name == vspaceAttr || name ==
hspaceAttr || name == alignAttr) |
| 331 return true; | 331 return true; |
| 332 return HTMLFrameOwnerElement::isPresentationAttribute(name); | 332 return HTMLFrameOwnerElement::isPresentationAttribute(name); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void HTMLPlugInElement::collectStyleForPresentationAttribute(const QualifiedName
& name, const AtomicString& value, MutableStylePropertySet* style) | 335 void HTMLPlugInElement::collectStyleForPresentationAttribute(const QualifiedName
& name, const AtomicString& value, MutableStylePropertySet* style) |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } | 434 } |
| 435 | 435 |
| 436 return Image::supportsType(m_serviceType); | 436 return Image::supportsType(m_serviceType); |
| 437 } | 437 } |
| 438 | 438 |
| 439 RenderEmbeddedObject* HTMLPlugInElement::renderEmbeddedObject() const | 439 RenderEmbeddedObject* HTMLPlugInElement::renderEmbeddedObject() const |
| 440 { | 440 { |
| 441 // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers | 441 // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers |
| 442 // when using fallback content. | 442 // when using fallback content. |
| 443 if (!renderer() || !renderer()->isEmbeddedObject()) | 443 if (!renderer() || !renderer()->isEmbeddedObject()) |
| 444 return 0; | 444 return nullptr; |
| 445 return toRenderEmbeddedObject(renderer()); | 445 return toRenderEmbeddedObject(renderer()); |
| 446 } | 446 } |
| 447 | 447 |
| 448 // We don't use m_url, as it may not be the final URL that the object loads, | 448 // We don't use m_url, as it may not be the final URL that the object loads, |
| 449 // depending on <param> values. | 449 // depending on <param> values. |
| 450 bool HTMLPlugInElement::allowedToLoadFrameURL(const String& url) | 450 bool HTMLPlugInElement::allowedToLoadFrameURL(const String& url) |
| 451 { | 451 { |
| 452 KURL completeURL = document().completeURL(url); | 452 KURL completeURL = document().completeURL(url); |
| 453 if (contentFrame() && protocolIsJavaScript(completeURL) | 453 if (contentFrame() && protocolIsJavaScript(completeURL) |
| 454 && !document().securityOrigin()->canAccess(contentDocument()->securityOr
igin())) | 454 && !document().securityOrigin()->canAccess(contentDocument()->securityOr
igin())) |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 return hasAuthorShadowRoot(); | 646 return hasAuthorShadowRoot(); |
| 647 } | 647 } |
| 648 | 648 |
| 649 void HTMLPlugInElement::lazyReattachIfNeeded() | 649 void HTMLPlugInElement::lazyReattachIfNeeded() |
| 650 { | 650 { |
| 651 if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate()
&& renderer() && !isImageType()) | 651 if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate()
&& renderer() && !isImageType()) |
| 652 lazyReattachIfAttached(); | 652 lazyReattachIfAttached(); |
| 653 } | 653 } |
| 654 | 654 |
| 655 } | 655 } |
| OLD | NEW |