Reviewed by Tim O.
Add USE defines for the generic JavaScriptCore bindings as well as NPAPI bindings.
* bindings/js/kjs_binding.cpp:
(KJS::ScriptInterpreter::createLanguageInstanceForValue):
* bindings/js/kjs_dom.cpp:
(KJS::getRuntimeObject):
* bridge/mac/FrameMac.h:
* config.h:
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::~HTMLAppletElement):
(WebCore::HTMLAppletElement::detach):
* html/HTMLAppletElement.h:
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::~HTMLEmbedElement):
(WebCore::HTMLEmbedElement::detach):
* html/HTMLEmbedElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::~HTMLObjectElement):
(WebCore::HTMLObjectElement::detach):
* html/HTMLObjectElement.h:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::HTMLPlugInElement):
(WebCore::HTMLPlugInElement::~HTMLPlugInElement):
(WebCore::HTMLPlugInElement::createNPObject):
* html/HTMLPlugInElement.h:
* page/Frame.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16353
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-14 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by Tim O.
+
+ Add USE defines for the generic JavaScriptCore bindings as well as NPAPI bindings.
+
+ * bindings/js/kjs_binding.cpp:
+ (KJS::ScriptInterpreter::createLanguageInstanceForValue):
+ * bindings/js/kjs_dom.cpp:
+ (KJS::getRuntimeObject):
+ * bridge/mac/FrameMac.h:
+ * config.h:
+ * html/HTMLAppletElement.cpp:
+ (WebCore::HTMLAppletElement::~HTMLAppletElement):
+ (WebCore::HTMLAppletElement::detach):
+ * html/HTMLAppletElement.h:
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::~HTMLEmbedElement):
+ (WebCore::HTMLEmbedElement::detach):
+ * html/HTMLEmbedElement.h:
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::~HTMLObjectElement):
+ (WebCore::HTMLObjectElement::detach):
+ * html/HTMLObjectElement.h:
+ * html/HTMLPlugInElement.cpp:
+ (WebCore::HTMLPlugInElement::HTMLPlugInElement):
+ (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
+ (WebCore::HTMLPlugInElement::createNPObject):
+ * html/HTMLPlugInElement.h:
+ * page/Frame.h:
+
2006-09-13 David Hyatt <hyatt@apple.com>
Clean up the XBL and XSLT ifdefs to be consistent with the SVG
{
void *result = 0;
-#if __APPLE__
+#if PLATFORM(MAC)
// FIXME: Need to implement bindings support.
if (language == Bindings::Instance::ObjectiveCLanguage)
result = createObjcInstanceForValue (exec, value, origin, current);
-
+#endif
+#if USE(JAVASCRIPTCORE_BINDINGS)
if (!result)
result = Interpreter::createLanguageInstanceForValue (exec, language, value, origin, current);
#endif
#include "SVGElement.h"
#endif
-#if __APPLE__
+#if USE(JAVASCRIPTCORE_BINDINGS)
#include <JavaScriptCore/runtime_object.h>
#endif
if (!n)
return 0;
-#if __APPLE__
+#if USE(JAVASCRIPTCORE_BINDINGS)
if (n->hasTagName(objectTag) || n->hasTagName(embedTag) || n->hasTagName(appletTag)) {
HTMLPlugInElement* plugInElement = static_cast<HTMLPlugInElement*>(n);
if (plugInElement->getInstance())
virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*);
virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*);
virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*);
+ virtual KJS::Bindings::RootObject* bindingRootObject();
void addPluginRootObject(KJS::Bindings::RootObject* root);
virtual void registerCommandForUndo(PassRefPtr<EditCommand>);
virtual bool isSecureKeyboardEntry();
KJS::Bindings::RootObject* executionContextForDOM();
- KJS::Bindings::RootObject* bindingRootObject();
WebScriptObject* windowScriptObject();
NPObject* windowScriptNPObject();
#if !COMPILER(MSVC) // can't get this to compile on Visual C++ yet
#define AVOID_STATIC_CONSTRUCTORS 1
#endif
+
+#if PLATFORM(MAC)
+#define KXMLCORE_USE_JAVASCRIPTCORE_BINDINGS 1
+#define KXMLCORE_USE_NPOBJECT 1
+#endif
HTMLAppletElement::~HTMLAppletElement()
{
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
// m_instance should have been cleaned up in detach().
assert(!m_instance);
#endif
return new (document()->renderArena()) RenderInline(this);
}
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
KJS::Bindings::Instance *HTMLAppletElement::getInstance() const
{
Frame *frame = document()->frame();
void HTMLAppletElement::detach()
{
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
m_instance = 0;
#endif
HTMLPlugInElement::detach();
#include "HTMLPlugInElement.h"
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
#include <JavaScriptCore/runtime.h>
#else
namespace KJS { namespace Bindings { class Instance; } }
virtual void closeRenderer();
virtual void detach();
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
virtual KJS::Bindings::Instance* getInstance() const;
#endif
HTMLEmbedElement::~HTMLEmbedElement()
{
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
// m_instance should have been cleaned up in detach().
assert(!m_instance);
#endif
}
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
KJS::Bindings::Instance *HTMLEmbedElement::getInstance() const
{
Frame* frame = document()->frame();
void HTMLEmbedElement::detach()
{
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
m_instance = 0;
#endif
HTMLPlugInElement::detach();
#include "HTMLPlugInElement.h"
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
#include <JavaScriptCore/runtime.h>
#else
namespace KJS { namespace Bindings { class Instance; } }
virtual bool isURLAttribute(Attribute*) const;
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
virtual KJS::Bindings::Instance* getInstance() const;
#endif
HTMLObjectElement::~HTMLObjectElement()
{
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
// m_instance should have been cleaned up in detach().
assert(!m_instance);
#endif
delete m_imageLoader;
}
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
KJS::Bindings::Instance *HTMLObjectElement::getInstance() const
{
Frame* frame = document()->frame();
needWidgetUpdate = true;
}
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
m_instance = 0;
#endif
HTMLPlugInElement::detach();
#include "HTMLPlugInElement.h"
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
#include <JavaScriptCore/runtime.h>
#else
namespace KJS { namespace Bindings { class Instance; } }
void renderFallbackContent();
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
virtual KJS::Bindings::Instance* getInstance() const;
#endif
#include "kjs_dom.h"
#include "kjs_proxy.h"
-#if PLATFORM(MAC)
-#include "FrameMac.h"
+#if USE(NPOBJECT)
#include <JavaScriptCore/npruntime_impl.h>
#include <JavaScriptCore/NP_jsobject.h>
#endif
HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document* doc)
: HTMLElement(tagName, doc)
-#if PLATFORM(MAC)
+#if USE(NPOBJECT)
, m_NPObject(0)
#endif
{
HTMLPlugInElement::~HTMLPlugInElement()
{
-#if PLATFORM(MAC)
+#if USE(NPOBJECT)
if (m_NPObject) {
_NPN_ReleaseObject(m_NPObject);
m_NPObject = 0;
HTMLElement::detach();
}
-#if PLATFORM(MAC)
+#if USE(NPOBJECT)
NPObject* HTMLPlugInElement::createNPObject()
{
return _NPN_CreateNoScriptObject();
// Wrap the JSObject in an NPObject
- const RootObject *executionContext = Mac(frame)->bindingRootObject();
+ const RootObject *executionContext = frame->bindingRootObject();
return _NPN_CreateScriptObject(0, jsElementValue->getObject(), executionContext, executionContext);
}
return m_NPObject;
}
-#endif /* PLATFORM(MAC) */
+#endif /* USE(NPOBJECT) */
}
#define HTMLPlugInElement_H
#include "HTMLElement.h"
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
#include <JavaScriptCore/runtime.h>
+#endif
+#if USE(NPOBJECT)
#include <JavaScriptCore/npruntime.h>
#endif
String width() const;
void setWidth(const String&);
-
-#if PLATFORM(MAC)
+
+#if USE(JAVASCRIPTCORE_BINDINGS)
virtual KJS::Bindings::Instance* getInstance() const = 0;
+#endif
+#if USE(NPOBJECT)
virtual NPObject* getNPObject();
#endif
void setFrameName(const AtomicString& frameName) { m_frameName = frameName; }
private:
-#if PLATFORM(MAC)
+#if USE(NPOBJECT)
NPObject* createNPObject();
#endif
protected:
String oldNameAttr;
-#if PLATFORM(MAC)
+#if USE(JAVASCRIPTCORE_BINDINGS)
mutable RefPtr<KJS::Bindings::Instance> m_instance;
+#endif
+#if USE(NPOBJECT)
NPObject* m_NPObject;
#endif
private:
namespace Bindings {
class Instance;
+ class RootObject;
}
}
virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*) = 0;
virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*) = 0;
virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*) = 0;
+ virtual KJS::Bindings::RootObject* bindingRootObject() = 0;
+
virtual void markMisspellingsInAdjacentWords(const VisiblePosition&) = 0;
virtual void markMisspellings(const Selection&) = 0;
virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID) = 0;