[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:15:12 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 628afda0a5310b303aaa308e1f932b9da2d66035
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 1 22:44:54 2003 +0000

    WebKit:
    	Moved grungy polling code from WebKit to the JavaPlugin.
    
            Reviewed by Chris.
    
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge pollForAppletInView:]):
    
    WebCore:
    Fixed parameter passing to applet.  Child elements are NOT valid in setStyle().  So we now either create the widget before needed with createWidgetIfNecessary.  This either happens when doing the first layout, or when JavaScript first references the applet element.
    
    Fixed early delete of the the main applet instance.  When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance.  This caused the applet instance cached on the applet element to be invalid.  The applet instance is the only Java object not to be cleaned up by the JS collector.
    
    Added support for getting at Java object fields.
    
            Reviewed by Chris.
    
            * khtml/ecma/kjs_html.cpp:
            (KJS::HTMLElement::tryGet):
            * khtml/html/html_objectimpl.cpp:
            (HTMLAppletElementImpl::createRenderer):
            (HTMLAppletElementImpl::getAppletInstance):
            * khtml/html/html_objectimpl.h:
            * khtml/rendering/render_applet.cpp:
            (RenderApplet::createWidgetIfNecessary):
            (RenderApplet::layout):
            * khtml/rendering/render_applet.h:
            (khtml::RenderApplet::renderName):
    
    JavaScriptCore:
    Fixed parameter passing to applet.  Child elements are NOT valid in setStyle().  So we now create the widget before needed with createWidgetIfNecessary.  This either happens when doing the first layout, or when JavaScript first references the applet element.
    
    Fixed early delete of the the main applet instance.  When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance.  This caused the applet instance cached on the applet element to be invalid.  The applet instance is the only Java object not to be cleaned up by the JS collector.
    
    Added support for getting at Java object fields.
    
            Reviewed by Chris.
    
            * JavaScriptCore.pbproj/project.pbxproj:
            * Makefile.am:
            * bindings/jni/jni_instance.cpp:
            (JObjectWrapper::JObjectWrapper):
            * bindings/jni/jni_instance.h:
            (Bindings::JObjectWrapper::~JObjectWrapper):
            * bindings/jni/jni_runtime.cpp:
            (JavaField::valueFromInstance):
            * bindings/runtime_object.cpp:
            (RuntimeObjectImp::~RuntimeObjectImp):
            (RuntimeObjectImp::RuntimeObjectImp):
            (RuntimeObjectImp::get):
            (RuntimeObjectImp::deleteProperty):
            * bindings/runtime_object.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5638 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 3cc44b1..865215b 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,28 @@
+2003-12-01  Richard Williamson   <rjw at apple.com>
+
+Fixed parameter passing to applet.  Child elements are NOT valid in setStyle().  So we now create the widget before needed with createWidgetIfNecessary.  This either happens when doing the first layout, or when JavaScript first references the applet element.
+
+Fixed early delete of the the main applet instance.  When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance.  This caused the applet instance cached on the applet element to be invalid.  The applet instance is the only Java object not to be cleaned up by the JS collector.
+
+Added support for getting at Java object fields.
+
+        Reviewed by Chris.
+
+        * JavaScriptCore.pbproj/project.pbxproj:
+        * Makefile.am:
+        * bindings/jni/jni_instance.cpp:
+        (JObjectWrapper::JObjectWrapper):
+        * bindings/jni/jni_instance.h:
+        (Bindings::JObjectWrapper::~JObjectWrapper):
+        * bindings/jni/jni_runtime.cpp:
+        (JavaField::valueFromInstance):
+        * bindings/runtime_object.cpp:
+        (RuntimeObjectImp::~RuntimeObjectImp):
+        (RuntimeObjectImp::RuntimeObjectImp):
+        (RuntimeObjectImp::get):
+        (RuntimeObjectImp::deleteProperty):
+        * bindings/runtime_object.h:
+
 === Safari-115 ===
 
 2003-11-21  Maciej Stachowiak  <mjs at apple.com>
diff --git a/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
index cc368a8..68ca1ca 100644
--- a/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
@@ -538,6 +538,8 @@
 			fileRef = 517D5348056BFB5D003851BD;
 			isa = PBXBuildFile;
 			settings = {
+				ATTRIBUTES = (
+				);
 			};
 		};
 		51856D8F0562EE95008B9D83 = {
diff --git a/JavaScriptCore/Makefile.am b/JavaScriptCore/Makefile.am
index c676cf5..991cd6b 100644
--- a/JavaScriptCore/Makefile.am
+++ b/JavaScriptCore/Makefile.am
@@ -9,7 +9,7 @@ kjs_testkjs_DEPENDENCIES = JavaScriptCore-stamp
 kjs_testkjs_LDFLAGS = -F$(SYMROOTS) -framework JavaScriptCore
 
 all-am: JavaScriptCore-stamp
-JavaScriptCore-stamp: kjs/*.cpp kjs/*.h pcre/*.c pcre/*.h bindings/*.h bindings/jni/*.cpp bindings/jni/*.h
+JavaScriptCore-stamp: kjs/*.cpp kjs/*.h pcre/*.c pcre/*.h bindings/*.h bindings/*.cpp bindings/jni/*.cpp bindings/jni/*.h
 	pbxbuild -buildstyle $(BUILDSTYLE) OBJROOT=$(SYMROOTS) SYMROOT=$(SYMROOTS) DSTROOT=$(SYMROOTS) && touch $@
 clean-am:
 	pbxbuild clean OBJROOT=$(SYMROOTS) SYMROOT=$(SYMROOTS) DSTROOT=$(SYMROOTS)
diff --git a/JavaScriptCore/bindings/jni/jni_instance.cpp b/JavaScriptCore/bindings/jni/jni_instance.cpp
index e9ce787..9c3475d 100644
--- a/JavaScriptCore/bindings/jni/jni_instance.cpp
+++ b/JavaScriptCore/bindings/jni/jni_instance.cpp
@@ -50,3 +50,19 @@ Class *JavaInstance::getClass() const
 {
     return JavaClass::classForInstance (_instance->_instance);
 }
+
+
+JObjectWrapper::JObjectWrapper(jobject instance)
+{
+    _ref = 1;
+    // Cache the JNIEnv used to get the global ref for this java instanace.
+    // It'll be used to delete the reference.
+    _env = getJNIEnv();
+    
+    _instance = _env->NewGlobalRef (instance);
+    _env->DeleteLocalRef (instance);
+    
+    if  (_instance == NULL) {
+        fprintf (stderr, "%s:  could not get GlobalRef for %p\n", __PRETTY_FUNCTION__, instance);
+    }
+}
diff --git a/JavaScriptCore/bindings/jni/jni_instance.h b/JavaScriptCore/bindings/jni/jni_instance.h
index dcd8be9..ef79d4d 100644
--- a/JavaScriptCore/bindings/jni/jni_instance.h
+++ b/JavaScriptCore/bindings/jni/jni_instance.h
@@ -29,10 +29,7 @@
 
 #include <JavaVM/jni.h>
 
-#include <runtime.h>
-
-#include <jni_instance.h>
-#include <jni_utility.h>
+#include <JavaScriptCore/runtime.h>
 
 namespace Bindings {
 
@@ -43,23 +40,7 @@ class JObjectWrapper
 friend class JavaInstance;
 
 protected:
-    JObjectWrapper(jobject instance) : _ref(1) {
-        // Cache the JNIEnv used to get the global ref for this java instanace.
-        // It'll be used to delete the reference.
-        _env = getJNIEnv();
-        
-        _instance = _env->NewGlobalRef (instance);
-        _env->DeleteLocalRef (instance);
-        
-        if  (_instance == NULL) {
-            fprintf (stderr, "%s:  could not get GlobalRef for %p\n", __PRETTY_FUNCTION__, instance);
-        }
-    }
-    
-    ~JObjectWrapper() {
-        _env->DeleteGlobalRef (_instance);
-    }
-    
+    JObjectWrapper(jobject instance);    
     void ref() { _ref++; }
     void deref() { 
         _ref--;
@@ -67,6 +48,10 @@ protected:
             delete this;
     }
     
+    ~JObjectWrapper() {
+        _env->DeleteGlobalRef (_instance);
+    }
+
     jobject _instance;
 
 private:
diff --git a/JavaScriptCore/bindings/jni/jni_runtime.cpp b/JavaScriptCore/bindings/jni/jni_runtime.cpp
index e986dbb..637e966 100644
--- a/JavaScriptCore/bindings/jni/jni_runtime.cpp
+++ b/JavaScriptCore/bindings/jni/jni_runtime.cpp
@@ -27,7 +27,9 @@
 
 #include <jni_utility.h>
 #include <jni_runtime.h>
- 
+
+#include <runtime_object.h>
+
 using namespace KJS;
 using namespace Bindings;
 
@@ -55,8 +57,8 @@ KJS::Value JavaField::valueFromInstance(const Instance *i) const
 
     switch (_primitiveType) {
         case object_type: {
-            //jobject value = callJNIObjectMethod(_field->javaInstance(), "get", "(Ljava/lang/Object;)Ljava/lang/Object;", jinstace);
-            return KJS::Value(0);
+            jobject anObject = callJNIObjectMethod(_field->javaInstance(), "get", "(Ljava/lang/Object;)Ljava/lang/Object;", jinstance);
+            return KJS::Object(new RuntimeObjectImp(new JavaInstance ((jobject)anObject)));
         }
         break;
             
@@ -69,7 +71,12 @@ KJS::Value JavaField::valueFromInstance(const Instance *i) const
         case byte_type:
         case char_type:
         case short_type:
+        
         case int_type:
+            jint value;
+            value = callJNIIntMethod(fieldJInstance, "getInt", "(Ljava/lang/Object;)D", jinstance);
+            return Number((int)value);
+
         case long_type:
         case float_type:
         case double_type: {
diff --git a/JavaScriptCore/bindings/runtime_object.cpp b/JavaScriptCore/bindings/runtime_object.cpp
index cc2c6b8..8a82aa6 100644
--- a/JavaScriptCore/bindings/runtime_object.cpp
+++ b/JavaScriptCore/bindings/runtime_object.cpp
@@ -54,11 +54,13 @@ RuntimeObjectImp::RuntimeObjectImp(ObjectImp *proto)
 
 RuntimeObjectImp::~RuntimeObjectImp()
 {
-    delete instance;
+    if (ownsInstance)
+        delete instance;
 }
 
-RuntimeObjectImp::RuntimeObjectImp(Bindings::Instance *i) : ObjectImp ((ObjectImp *)0)
+RuntimeObjectImp::RuntimeObjectImp(Bindings::Instance *i, bool oi) : ObjectImp ((ObjectImp *)0)
 {
+    ownsInstance = oi;
     instance = i;
     _initializeClassInfoFromInstance();
 }
@@ -70,10 +72,13 @@ Value RuntimeObjectImp::get(ExecState *exec, const Identifier &propertyName) con
     
     Field *aField = instance->getClass()->fieldNamed(propertyName.ascii());
     if (aField){
-        printf ("%s: found field = %p, type = %s\n", __PRETTY_FUNCTION__, aField, aField->type());
+        printf ("%s: found %s(%p), type = %s\n", __PRETTY_FUNCTION__, propertyName.ascii(), aField, aField->type());
         return instance->getValueOfField (aField); 
     }
     
+    // Now check if a method with specified name exists, if so return a function object for
+    // that method.
+    
     return Undefined();
 }
 
@@ -103,8 +108,7 @@ bool RuntimeObjectImp::hasProperty(ExecState *exec,
 bool RuntimeObjectImp::deleteProperty(ExecState *exec,
                             const Identifier &propertyName)
 {
-    printf ("%s: NOT YET IMPLEMENTED %p: propertyName %s\n", __PRETTY_FUNCTION__, instance, propertyName.ascii());
-    // Can never remove a propert of a RuntimeObject.
+    // Can never remove a property of a RuntimeObject.
     return false;
 }
 
diff --git a/JavaScriptCore/bindings/runtime_object.h b/JavaScriptCore/bindings/runtime_object.h
index d400e89..aa1a0b0 100644
--- a/JavaScriptCore/bindings/runtime_object.h
+++ b/JavaScriptCore/bindings/runtime_object.h
@@ -38,7 +38,7 @@ public:
     
     ~RuntimeObjectImp();
     
-    RuntimeObjectImp(Bindings::Instance *i);
+    RuntimeObjectImp(Bindings::Instance *i, bool ownsInstance = true);
 
     const ClassInfo *classInfo() const;
 
@@ -66,6 +66,7 @@ private:
     
     ClassInfo _classInfo;
     Bindings::Instance *instance;
+    bool ownsInstance;
 };
     
 }; // namespace
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a770b20..4ede275 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,25 @@
+2003-12-01  Richard Williamson   <rjw at apple.com>
+
+Fixed parameter passing to applet.  Child elements are NOT valid in setStyle().  So we now either create the widget before needed with createWidgetIfNecessary.  This either happens when doing the first layout, or when JavaScript first references the applet element.
+
+Fixed early delete of the the main applet instance.  When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance.  This caused the applet instance cached on the applet element to be invalid.  The applet instance is the only Java object not to be cleaned up by the JS collector.
+
+Added support for getting at Java object fields.
+
+        Reviewed by Chris.
+
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::HTMLElement::tryGet):
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLAppletElementImpl::createRenderer):
+        (HTMLAppletElementImpl::getAppletInstance):
+        * khtml/html/html_objectimpl.h:
+        * khtml/rendering/render_applet.cpp:
+        (RenderApplet::createWidgetIfNecessary):
+        (RenderApplet::layout):
+        * khtml/rendering/render_applet.h:
+        (khtml::RenderApplet::renderName):
+
 2003-12-01  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index cd3b6b7..0b50aca 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -1116,8 +1116,8 @@ Value KJS::HTMLElement::tryGet(ExecState *exec, const Identifier &propertyName)
         DOM::HTMLAppletElementImpl *appletElement = static_cast<DOM::HTMLAppletElementImpl *>(element.handle());
         
         if (appletElement->getAppletInstance()) {
-            RuntimeObjectImp valueForApplet(appletElement->getAppletInstance());
-            printf ("%s:  ID_APPLET %p, propertyName %s\n", __PRETTY_FUNCTION__, appletElement->getAppletInstance(), propertyName.ascii());
+            // The instance is owned by the applet element.
+            RuntimeObjectImp valueForApplet(appletElement->getAppletInstance(), false);
             return valueForApplet.get(exec,propertyName);
         }
     }
diff --git a/WebCore/khtml/html/html_objectimpl.cpp b/WebCore/khtml/html/html_objectimpl.cpp
index 8c6df7f..f767a83 100644
--- a/WebCore/khtml/html/html_objectimpl.cpp
+++ b/WebCore/khtml/html/html_objectimpl.cpp
@@ -124,16 +124,9 @@ RenderObject *HTMLAppletElementImpl::createRenderer(RenderArena *arena, RenderSt
 	    args.insert( "archive", archive.string() );
 
 	args.insert( "baseURL", getDocument()->baseURL() );
-#if APPLE_CHANGES
-        NodeImpl *child = firstChild();
-        while (child) {
-            if (child->id() == ID_PARAM) {
-                HTMLParamElementImpl *p = static_cast<HTMLParamElementImpl *>(child);
-                args.insert(p->name(), p->value());
-            }
-            child = child->nextSibling();
-        }
-#endif
+
+        // Other arguments (from <PARAM> tags are added later.
+        
         return new (getDocument()->renderArena()) RenderApplet(this, args);
     }
 
@@ -182,6 +175,7 @@ Bindings::Instance *HTMLAppletElementImpl::getAppletInstance() const
         return appletInstance;
     
     RenderApplet *r = static_cast<RenderApplet*>(m_render);
+    r->createWidgetIfNecessary();
     if (r && r->widget()){
         // Call into the part (and over the bridge) to pull the Bindings::Instance
         // from the guts of the Java VM.
diff --git a/WebCore/khtml/html/html_objectimpl.h b/WebCore/khtml/html/html_objectimpl.h
index fd514ca..738daf3 100644
--- a/WebCore/khtml/html/html_objectimpl.h
+++ b/WebCore/khtml/html/html_objectimpl.h
@@ -65,11 +65,9 @@ public:
 
 protected:
     khtml::VAlign valign;
-    
+
 private:
-#if APPLE_CHANGES
     mutable Bindings::Instance *appletInstance;
-#endif
 };
 
 // -------------------------------------------------------------------------
diff --git a/WebCore/khtml/rendering/render_applet.cpp b/WebCore/khtml/rendering/render_applet.cpp
index c54bf9d..256b5e1 100644
--- a/WebCore/khtml/rendering/render_applet.cpp
+++ b/WebCore/khtml/rendering/render_applet.cpp
@@ -71,15 +71,6 @@ RenderApplet::~RenderApplet()
 {
 }
 
-void RenderApplet::setStyle(RenderStyle *_style)
-{   
-    RenderWidget::setStyle(_style);
-    // FIXME?  What about percent and variable widths/heights?
-    // FIXME?  What about padding and margins?
-    QSize size = QSize(style()->width().value, style()->height().value);        
-    setQWidget(new KJavaAppletWidget(size, m_context, m_args));
-}
-
 short RenderApplet::intrinsicWidth() const
 {
     int rval = 150;
@@ -100,6 +91,24 @@ int RenderApplet::intrinsicHeight() const
     return rval > 10 ? rval : 50;
 }
 
+void RenderApplet::createWidgetIfNecessary()
+{
+    if (!m_widget) {
+        QSize size = QSize(style()->width().value, style()->height().value);        
+    
+        NodeImpl *child = element()->firstChild();
+        while (child) {
+            if (child->id() == ID_PARAM) {
+                HTMLParamElementImpl *p = static_cast<HTMLParamElementImpl *>(child);
+                m_args.insert(p->name(), p->value());
+            }
+            child = child->nextSibling();
+        }
+    
+        setQWidget(new KJavaAppletWidget(size, m_context, m_args));
+    }
+}
+
 void RenderApplet::layout()
 {
     //kdDebug(6100) << "RenderApplet::layout" << endl;
@@ -111,12 +120,18 @@ void RenderApplet::layout()
     calcHeight();
 
     KJavaAppletWidget *tmp = static_cast<KJavaAppletWidget*>(m_widget);
-    if ( tmp ) {
 #if APPLE_CHANGES
+    // Applet QWidget get creates lazily upon first layout.
+    if (!tmp) {
+        createWidgetIfNecessary();
+    }
+    else {
         m_widget->setFrameGeometry(QRect(xPos(), yPos(),
                                    m_width-marginLeft()-marginRight()-paddingLeft()-paddingRight(),
                                    m_height-marginTop()-marginBottom()-paddingTop()-paddingBottom()));
+    }
 #else 
+    if ( tmp ) {
         NodeImpl *child = element()->firstChild();
 
         while(child) {
@@ -132,8 +147,8 @@ void RenderApplet::layout()
         m_widget->resize(m_width-marginLeft()-marginRight()-paddingLeft()-paddingRight(),
                          m_height-marginTop()-marginBottom()-paddingTop()-paddingBottom());
         tmp->showApplet();
-#endif
     }
+#endif
     setNeedsLayout(false);
 }
 
diff --git a/WebCore/khtml/rendering/render_applet.h b/WebCore/khtml/rendering/render_applet.h
index e3f8fce..d492ba7 100644
--- a/WebCore/khtml/rendering/render_applet.h
+++ b/WebCore/khtml/rendering/render_applet.h
@@ -41,10 +41,12 @@ class RenderApplet : public RenderWidget
 public:
     RenderApplet(DOM::HTMLElementImpl* node, const QMap<QString, QString> &args);
     virtual ~RenderApplet();
+
+    virtual const char *renderName() const { return "RenderApplet"; }
+
 #if APPLE_CHANGES
-    virtual void setStyle(RenderStyle *style);
+    void createWidgetIfNecessary();
 #endif
-    virtual const char *renderName() const { return "RenderApplet"; }
 
     virtual void layout();
     virtual short intrinsicWidth() const;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f1ce313..5c92ef7 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,12 @@
+2003-12-01  Richard Williamson   <rjw at apple.com>
+
+	Moved grungy polling code from WebKit to the JavaPlugin.
+
+        Reviewed by Chris.
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge pollForAppletInView:]):
+
 2003-12-01  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by John
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 01481b8..da4cfa8 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -66,9 +66,7 @@
 @end
 
 @interface NSView (JavaPluginSecrets)
-- (void *)getApplet;
-- (BOOL)mayActivate;
-- (void)activateApplet:(id)unused;
+- (jobject)pollForAppletInWindow: (NSWindow *)window;
 @end
 
 
@@ -1073,33 +1071,21 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     }
 }
 
-#define MAX_GET_APPLET_POLL_TIME 20
-#define GET_APPLET_POLL_INTERVAL    1
-
-// pollGetApplet: will poll until getApplet on the plugin view returns non-nil,
-// or MAX_GET_APPLET_POLL_TIME is exceeded.
+// NOTE: pollForAppletInView: will block until the block is ready to use, or
+// until a timeout is exceeded.  It will return nil if the timeour is
+// exceeded.
 - (jobject)pollForAppletInView: (NSView *)view
 {
     jobject applet = 0;
     
-    if ([view respondsToSelector: @selector(getApplet)]) {
-        NSTimeInterval timeUsed = 0;
-
-        while (!applet && timeUsed  < MAX_GET_APPLET_POLL_TIME) {
-            applet = [view getApplet];
-            [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:GET_APPLET_POLL_INTERVAL]];
-            timeUsed += GET_APPLET_POLL_INTERVAL;
-            NSLog (@"%s:  applet = %p", __PRETTY_FUNCTION__, applet);
-            
-            if ([view mayActivate]){
-                [view activateApplet:nil];
-            }
-            
-            // Give the run loop a spin.  This will cause any delayed or performOnMainThread:
-            // methods to fire.  The plugin does this during initialization.
-            [[NSApplication sharedApplication] nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:NO];
-        }
+    if ([view respondsToSelector: @selector(pollForAppletInWindow:)]) {
+        // The Java VM needs the containing window of the view to
+        // initialize.  The view may not yet be in the window's view 
+        // hierarchy, so we have to pass the window when requesting
+        // the applet.
+        applet = [view pollForAppletInWindow:[[_frame webView] window]];
     }
+    
     return applet;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list