WebKit:
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 May 2004 01:16:40 +0000 (01:16 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 May 2004 01:16:40 +0000 (01:16 +0000)
Finished implementation of windowScriptObject.

        Reviewed by Maciej.

        * WebView.subproj/WebView.m:
        (-[WebView windowScriptObject]):

WebCore:
Finished implementing support for windowScriptObject.

        Reviewed by Maciej.

        * khtml/khtml_part.cpp:
        (KHTMLPart::begin):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart):
        (KWQKHTMLPart::~KWQKHTMLPart):
        (KWQKHTMLPart::windowScriptObject):
        * kwq/WebCoreBridge.mm:
        (updateRenderingForBindings):

JavaScriptCore:
Finsished implementing support for windowScriptObject.
Had to make WebScriptObjectPrivate.h accessible from
WebCore.

        Reviewed by Maciej.

        * JavaScriptCore.pbproj/project.pbxproj:
        * bindings/objc/WebScriptObjectPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6629 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
JavaScriptCore/bindings/objc/WebScriptObjectPrivate.h
WebCore/ChangeLog-2005-08-23
WebCore/khtml/khtml_part.cpp
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.mm
WebKit/ChangeLog
WebKit/WebView.subproj/WebView.m

index 10ff84b010135dfcf8f4fd9d99e1b1b3b6ee4efa..79ec588ad38f15208158f1570cda3e615f8851ab 100644 (file)
@@ -1,3 +1,14 @@
+2004-05-18  Richard Williamson   <rjw@apple.com>
+
+       Finsished implementing support for windowScriptObject.
+       Had to make WebScriptObjectPrivate.h accessible from
+       WebCore.
+
+        Reviewed by Maciej.
+
+        * JavaScriptCore.pbproj/project.pbxproj:
+        * bindings/objc/WebScriptObjectPrivate.h:
+
 2004-05-18  Richard Williamson   <rjw@apple.com>
 
        Use KVC to set/get values instead of directly accessing
index 518987346441faa2598bd3a08d8ca1f0b357e0d7..59035c81764e75b2c3b8470b2982bb3cb1409b1f 100644 (file)
                        fileRef = 700DA117065984CE00747C0B;
                        isa = PBXBuildFile;
                        settings = {
+                               ATTRIBUTES = (
+                                       Private,
+                               );
                        };
                };
                704FD35305697E6D003DBED9 = {
index bf062accf16f407b11bd38dd6fe7c42da51b137f..480aecc754e822c05b8c6bbba5853ce817eeb807 100644 (file)
@@ -4,7 +4,7 @@
 #ifndef _WEB_SCRIPT_OBJECT_PRIVATE_H_
 #define _WEB_SCRIPT_OBJECT_PRIVATE_H_
 
-#import <WebScriptObject.h>
+#import <JavaScriptCore/WebScriptObject.h>
 
 #include <JavaScriptCore/internal.h>
 #include <JavaScriptCore/list.h>
index 3c1df7052d1b3d1eb0185a918fe363200915d7dd..f2f0e4513fe8a0f7958cb02cdda9454e4543cf29 100644 (file)
@@ -1,3 +1,19 @@
+2004-05-18  Richard Williamson   <rjw@apple.com>
+
+       Finished implementing support for windowScriptObject.
+
+        Reviewed by Maciej.
+
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::begin):
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::KWQKHTMLPart):
+        (KWQKHTMLPart::~KWQKHTMLPart):
+        (KWQKHTMLPart::windowScriptObject):
+        * kwq/WebCoreBridge.mm:
+        (updateRenderingForBindings):
+
 2004-05-18  Richard Williamson   <rjw@apple.com>
 
        Added stubs to get the WebScriptObject for the window
index 5098d839f50d6485ad3e32eeefd94c8b6c4d978e..2abddd65c7bcb9ef693c3c70009c91c9d3fcf6b5 100644 (file)
@@ -1420,7 +1420,7 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
 
   clear();
 
-#if APPLE_CHANGE
+#if APPLE_CHANGES
   KWQ(this)->partClearedInBegin();
 #endif
 
index 10db20bb0c4268fd78508b12801ef69e094bef42..51ee91699b17ec861d3b0dd2446c4683a85944dd 100644 (file)
@@ -342,6 +342,7 @@ private:
     friend class KHTMLPart;
 
     QPtrList<KJS::Bindings::RootObject> rootObjects;
+    WebScriptObject *_windowScriptObject;
 };
 
 inline KWQKHTMLPart *KWQ(KHTMLPart *part) { return static_cast<KWQKHTMLPart *>(part); }
index 8a6b1bd9d7738a2d233c2b0cff1a887157688e2c..defd9cac491851fea1c80a0ba7ebfb4263e7153d 100644 (file)
@@ -62,7 +62,7 @@
 #import <JavaScriptCore/property_map.h>
 #import <JavaScriptCore/runtime.h>
 #import <JavaScriptCore/runtime_root.h>
-#import <JavaScriptCore/WebScriptObject.h>
+#import <JavaScriptCore/WebScriptObjectPrivate.h>
 
 #undef _KWQ_TIMING
 
@@ -176,6 +176,7 @@ KWQKHTMLPart::KWQKHTMLPart()
     , _windowWidget(NULL)
     , _usesInactiveTextBackgroundColor(false)
     , _showsFirstResponder(true)
+    , _windowScriptObject(0)
 {
     // Must init the cache before connecting to any signals
     Cache::init();
@@ -200,6 +201,9 @@ KWQKHTMLPart::~KWQKHTMLPart()
     // exceptions.
     [_formValuesAboutToBeSubmitted release];
     [_formAboutToBeSubmitted release];
+    
+    [_windowScriptObject release];
+    
     delete _windowWidget;
 }
 
@@ -1133,8 +1137,16 @@ bool KWQKHTMLPart::tabsToAllControls() const
 
 WebScriptObject *KWQKHTMLPart::windowScriptObject()
 {
-    // FIXME:  Create a WindowScriptObject wrapper.
-    return 0;
+    if (!_windowScriptObject) {
+        KJS::Bindings::RootObject *root = new KJS::Bindings::RootObject(0);    // The root gets deleted by JavaScriptCore.
+        KJS::ObjectImp *win = static_cast<KJS::ObjectImp *>(KJS::Window::retrieveWindow(this));
+        root->setRootObjectImp (win);
+        root->setInterpreter (KJSProxy::proxy(this)->interpreter());
+        addPluginRootObject (root);
+        _windowScriptObject = [[WebScriptObject alloc] _initWithObjectImp:win root:root];
+    }
+
+    return _windowScriptObject;
 }
 
 void KWQKHTMLPart::bindObject(void *object, QString name)
index f9f84a01c3123d9fa962a6a7c532f35f93352f5e..b2b4f6b21b0952f474eda2d20f693d76c0e43589 100644 (file)
@@ -164,7 +164,8 @@ static void updateRenderingForBindings (KJS::ExecState *exec, KJS::ObjectImp *ro
         return;
         
     DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl*>(window->part()->document().handle());
-    doc->updateRendering();
+    if (doc)
+        doc->updateRendering();
 }
 
 
index da03e3dbd97f25c7bdfae591294db6b93b528666..c796d8f4528ea169e34d2634be48d252f8988bbf 100644 (file)
@@ -1,3 +1,12 @@
+2004-05-18  Richard Williamson   <rjw@apple.com>
+
+               Finished implementation of windowScriptObject.
+               
+        Reviewed by Maciej.
+
+        * WebView.subproj/WebView.m:
+        (-[WebView windowScriptObject]):
+
 2004-05-18  Richard Williamson   <rjw@apple.com>
 
                Added WebKit portion of webView:windowScriptObjectAvailable:
index 60e42be03f5c2a62e4c806bd8e0238f8460377a0..c14f79f80e15af1d8ad637b9b12193590d3e9660 100644 (file)
@@ -1620,8 +1620,7 @@ NS_ENDHANDLER
 
 - (WebScriptObject *)windowScriptObject
 {
-    NSLog (@"%s:%d:  not yet implemented", __PRETTY_FUNCTION__, __LINE__);
-    return nil;
+    return [[[self mainFrame] _bridge] windowScriptObject];
 }