| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // the same codepath in this class. | 67 // the same codepath in this class. |
| 68 , m_needsWidgetUpdate(!createdByParser) | 68 , m_needsWidgetUpdate(!createdByParser) |
| 69 , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPrefe
rPlugInsForImages) | 69 , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPrefe
rPlugInsForImages) |
| 70 , m_displayState(Playing) | 70 , m_displayState(Playing) |
| 71 { | 71 { |
| 72 setHasCustomStyleCallbacks(); | 72 setHasCustomStyleCallbacks(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 HTMLPlugInElement::~HTMLPlugInElement() | 75 HTMLPlugInElement::~HTMLPlugInElement() |
| 76 { | 76 { |
| 77 ASSERT(m_pluginWrapper.hasNoValue()); // cleared in detach() | 77 ASSERT(!m_pluginWrapper); // cleared in detach() |
| 78 ASSERT(!m_isDelayingLoadEvent); | 78 ASSERT(!m_isDelayingLoadEvent); |
| 79 | 79 |
| 80 if (m_NPObject) { | 80 if (m_NPObject) { |
| 81 _NPN_ReleaseObject(m_NPObject); | 81 _NPN_ReleaseObject(m_NPObject); |
| 82 m_NPObject = 0; | 82 m_NPObject = 0; |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool HTMLPlugInElement::canProcessDrag() const | 86 bool HTMLPlugInElement::canProcessDrag() const |
| 87 { | 87 { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 setNeedsWidgetUpdate(true); | 202 setNeedsWidgetUpdate(true); |
| 203 if (inDocument()) | 203 if (inDocument()) |
| 204 setNeedsStyleRecalc(); | 204 setNeedsStyleRecalc(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void HTMLPlugInElement::resetInstance() | 207 void HTMLPlugInElement::resetInstance() |
| 208 { | 208 { |
| 209 m_pluginWrapper.clear(); | 209 m_pluginWrapper.clear(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 ScriptValue HTMLPlugInElement::pluginWrapper() | 212 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() |
| 213 { | 213 { |
| 214 Frame* frame = document().frame(); | 214 Frame* frame = document().frame(); |
| 215 if (!frame) | 215 if (!frame) |
| 216 return ScriptValue(); | 216 return 0; |
| 217 | 217 |
| 218 // If the host dynamically turns off JavaScript (or Java) we will still | 218 // If the host dynamically turns off JavaScript (or Java) we will still |
| 219 // return the cached allocated Bindings::Instance. Not supporting this | 219 // return the cached allocated Bindings::Instance. Not supporting this |
| 220 // edge-case is OK. | 220 // edge-case is OK. |
| 221 if (m_pluginWrapper.hasNoValue()) { | 221 if (!m_pluginWrapper) { |
| 222 if (Widget* widget = pluginWidget()) | 222 if (Widget* widget = pluginWidget()) |
| 223 m_pluginWrapper = frame->script().createPluginWrapper(widget); | 223 m_pluginWrapper = frame->script().createPluginWrapper(widget); |
| 224 } | 224 } |
| 225 return m_pluginWrapper; | 225 return m_pluginWrapper.get(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 bool HTMLPlugInElement::dispatchBeforeLoadEvent(const String& sourceURL) | 228 bool HTMLPlugInElement::dispatchBeforeLoadEvent(const String& sourceURL) |
| 229 { | 229 { |
| 230 // FIXME: Our current plug-in loading design can't guarantee the following | 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, | 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! | 232 // and synchronous layout can be initiated in a beforeload event handler! |
| 233 // See <http://webkit.org/b/71264>. | 233 // See <http://webkit.org/b/71264>. |
| 234 // ASSERT(!m_inBeforeLoadEventHandler); | 234 // ASSERT(!m_inBeforeLoadEventHandler); |
| 235 m_inBeforeLoadEventHandler = true; | 235 m_inBeforeLoadEventHandler = true; |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 if (root.isOldestAuthorShadowRoot()) | 525 if (root.isOldestAuthorShadowRoot()) |
| 526 lazyReattachIfAttached(); | 526 lazyReattachIfAttached(); |
| 527 } | 527 } |
| 528 | 528 |
| 529 bool HTMLPlugInElement::useFallbackContent() const | 529 bool HTMLPlugInElement::useFallbackContent() const |
| 530 { | 530 { |
| 531 return hasAuthorShadowRoot(); | 531 return hasAuthorShadowRoot(); |
| 532 } | 532 } |
| 533 | 533 |
| 534 } | 534 } |
| OLD | NEW |