| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // new frame and set it as the LayoutPart's FrameViewBase, causing what was | 146 // new frame and set it as the LayoutPart's FrameViewBase, causing what was |
| 147 // previously in the FrameViewBase to be torn down. | 147 // previously in the FrameViewBase to be torn down. |
| 148 return loadOrRedirectSubframe(completedURL, getNameAttribute(), true); | 148 return loadOrRedirectSubframe(completedURL, getNameAttribute(), true); |
| 149 } | 149 } |
| 150 | 150 |
| 151 return loadPlugin(completedURL, mimeType, paramNames, paramValues, | 151 return loadPlugin(completedURL, mimeType, paramNames, paramValues, |
| 152 useFallback, true); | 152 useFallback, true); |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool HTMLPlugInElement::canProcessDrag() const { | 155 bool HTMLPlugInElement::canProcessDrag() const { |
| 156 return pluginWidget() && pluginWidget()->isPluginView() && | 156 return pluginWidget() && pluginWidget()->canProcessDrag(); |
| 157 toPluginView(pluginWidget())->canProcessDrag(); | |
| 158 } | 157 } |
| 159 | 158 |
| 160 bool HTMLPlugInElement::canStartSelection() const { | 159 bool HTMLPlugInElement::canStartSelection() const { |
| 161 return useFallbackContent() && Node::canStartSelection(); | 160 return useFallbackContent() && Node::canStartSelection(); |
| 162 } | 161 } |
| 163 | 162 |
| 164 bool HTMLPlugInElement::willRespondToMouseClickEvents() { | 163 bool HTMLPlugInElement::willRespondToMouseClickEvents() { |
| 165 if (isDisabledFormControl()) | 164 if (isDisabledFormControl()) |
| 166 return false; | 165 return false; |
| 167 LayoutObject* r = layoutObject(); | 166 LayoutObject* r = layoutObject(); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 326 |
| 328 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() { | 327 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() { |
| 329 LocalFrame* frame = document().frame(); | 328 LocalFrame* frame = document().frame(); |
| 330 if (!frame) | 329 if (!frame) |
| 331 return nullptr; | 330 return nullptr; |
| 332 | 331 |
| 333 // If the host dynamically turns off JavaScript (or Java) we will still | 332 // If the host dynamically turns off JavaScript (or Java) we will still |
| 334 // return the cached allocated Bindings::Instance. Not supporting this | 333 // return the cached allocated Bindings::Instance. Not supporting this |
| 335 // edge-case is OK. | 334 // edge-case is OK. |
| 336 if (!m_pluginWrapper) { | 335 if (!m_pluginWrapper) { |
| 337 FrameViewBase* plugin; | 336 PluginView* plugin; |
| 338 | 337 |
| 339 if (m_persistedPlugin) | 338 if (m_persistedPlugin) |
| 340 plugin = m_persistedPlugin.get(); | 339 plugin = m_persistedPlugin.get(); |
| 341 else | 340 else |
| 342 plugin = pluginWidget(); | 341 plugin = pluginWidget(); |
| 343 | 342 |
| 344 if (plugin) | 343 if (plugin) |
| 345 m_pluginWrapper = frame->script().createPluginWrapper(plugin); | 344 m_pluginWrapper = frame->script().createPluginWrapper(*plugin); |
| 346 } | 345 } |
| 347 return m_pluginWrapper.get(); | 346 return m_pluginWrapper.get(); |
| 348 } | 347 } |
| 349 | 348 |
| 350 FrameViewBase* HTMLPlugInElement::pluginWidget() const { | 349 PluginView* HTMLPlugInElement::pluginWidget() const { |
| 351 if (LayoutPart* layoutPart = layoutPartForJSBindings()) | 350 LayoutPart* layoutPart = layoutPartForJSBindings(); |
| 352 return layoutPart->frameViewBase(); | 351 if (layoutPart && layoutPart->frameViewBase() && |
| 352 layoutPart->frameViewBase()->isPluginView()) |
| 353 return toPluginView(layoutPart->frameViewBase()); |
| 353 return nullptr; | 354 return nullptr; |
| 354 } | 355 } |
| 355 | 356 |
| 356 bool HTMLPlugInElement::isPresentationAttribute( | 357 bool HTMLPlugInElement::isPresentationAttribute( |
| 357 const QualifiedName& name) const { | 358 const QualifiedName& name) const { |
| 358 if (name == widthAttr || name == heightAttr || name == vspaceAttr || | 359 if (name == widthAttr || name == heightAttr || name == vspaceAttr || |
| 359 name == hspaceAttr || name == alignAttr) | 360 name == hspaceAttr || name == alignAttr) |
| 360 return true; | 361 return true; |
| 361 return HTMLFrameOwnerElement::isPresentationAttribute(name); | 362 return HTMLFrameOwnerElement::isPresentationAttribute(name); |
| 362 } | 363 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // FIXME: Check if dispatching events here is safe. | 418 // FIXME: Check if dispatching events here is safe. |
| 418 document().updateStyleAndLayoutIgnorePendingStylesheets( | 419 document().updateStyleAndLayoutIgnorePendingStylesheets( |
| 419 Document::RunPostLayoutTasksSynchronously); | 420 Document::RunPostLayoutTasksSynchronously); |
| 420 return existingLayoutPart(); | 421 return existingLayoutPart(); |
| 421 } | 422 } |
| 422 | 423 |
| 423 bool HTMLPlugInElement::isKeyboardFocusable() const { | 424 bool HTMLPlugInElement::isKeyboardFocusable() const { |
| 424 if (HTMLFrameOwnerElement::isKeyboardFocusable()) | 425 if (HTMLFrameOwnerElement::isKeyboardFocusable()) |
| 425 return true; | 426 return true; |
| 426 return document().isActive() && pluginWidget() && | 427 return document().isActive() && pluginWidget() && |
| 427 pluginWidget()->isPluginView() && | 428 pluginWidget()->supportsKeyboardFocus(); |
| 428 toPluginView(pluginWidget())->supportsKeyboardFocus(); | |
| 429 } | 429 } |
| 430 | 430 |
| 431 bool HTMLPlugInElement::hasCustomFocusLogic() const { | 431 bool HTMLPlugInElement::hasCustomFocusLogic() const { |
| 432 return !useFallbackContent(); | 432 return !useFallbackContent(); |
| 433 } | 433 } |
| 434 | 434 |
| 435 bool HTMLPlugInElement::isPluginElement() const { | 435 bool HTMLPlugInElement::isPluginElement() const { |
| 436 return true; | 436 return true; |
| 437 } | 437 } |
| 438 | 438 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 658 |
| 659 void HTMLPlugInElement::lazyReattachIfNeeded() { | 659 void HTMLPlugInElement::lazyReattachIfNeeded() { |
| 660 if (!useFallbackContent() && needsPluginUpdate() && layoutObject() && | 660 if (!useFallbackContent() && needsPluginUpdate() && layoutObject() && |
| 661 !isImageType()) { | 661 !isImageType()) { |
| 662 lazyReattachIfAttached(); | 662 lazyReattachIfAttached(); |
| 663 setPersistedPlugin(nullptr); | 663 setPersistedPlugin(nullptr); |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 | 666 |
| 667 } // namespace blink | 667 } // namespace blink |
| OLD | NEW |