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

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:15:48 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 7b37be2420d848fd441284a19a940f2ea86ad808
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri May 31 00:41:12 2002 +0000

    WebCore:
    	WebCore part of fixes for:
    
    	Radar 2926169 - no support for window.open
    	Radar 2890469 - Preference to prevent JavaScript from automatically
    	opening new windows doesn't work
    	Radar 2938569 - link cursor does not appear on some pages
    
    	* khtml/ecma/kjs_window.cpp:
    	(WindowFunc::tryCall): #ifdef'd out some parts of this code that are
    	broken (but fortunately also unnecessary) in our project.
    	* kwq/KWQKConfigBase.mm:
    	(KConfig::KConfig): Changes to support JavaScript window opening pref.
    	(KConfig::readUnsignedNumEntry): Likewise.
    	* kwq/KWQKHTMLPart.mm:
    	(KHTMLPart::openURLInFrame): Implemented.
    	* kwq/KWQKHTMLPartBrowserExtension.mm:
    	(KHTMLPartBrowserExtension::KHTMLPartBrowserExtension): Implemented.
    	(KHTMLPartBrowserExtension::openURLRequest): Implemented by
    	calling openURLInFrame on the part.
    	(KHTMLPartBrowserExtension::createNewWindow): Implemented by
    	calling new WebController openNewWindowWIthURL method.
    	* kwq/KWQKHTMLSettings.mm:
    	(KHTMLSettings::isJavaScriptEnabled): Handle renaming of pref.
    	* kwq/KWQView.mm:
    	(-[KWQHTMLView setCursor:]): Fixes to set cursor properly even if
    	none was set.
    	* kwq/external.h: Declare some new WebKit methods.
    	* kwq/kparts/browserextension.h: Make formerly empty methods pure virtual.
    	* kwq/khtml/khtml_ext.h: Declare some virtual methods.
    
    WebKit:
    	WebKit parts of fixes for:
    
    	Radar 2926169 - no support for window.open
    	Radar 2890469 - Preference to prevent JavaScript from automatically
    	opening new windows doesn't work
    	Radar 2938569 - link cursor does not appear on some pages
    
    	* WebView.subproj/IFWebController.h:
    	Added openNewWindowWithURL: method for the benefit of JavaScript.
    	* WebView.subproj/IFBaseWebController.mm:
    	(-[IFBaseWebController openNewWindowWithURL:]): No-op default
    	implementation.
    	* WebView.subproj/IFDynamicScrollBarsView.h:
    	* WebView.subproj/IFDynamicScrollBarsView.m:
    	(-[IFDynamicScrollBarsView setCursor:]): Fix cursor handling.
    	(-[IFDynamicScrollBarsView resetCursorRects]): Likewise.
    	* WebView.subproj/IFWebView.mm:
    	(-[IFWebView mouseMovedNotification:]): Likewise.
    	(-[IFWebView setCursor:]): Likewise.
    	* WebView.subproj/IFPreferences.h:
    	* WebView.subproj/IFPreferences.mm:
    	(-[IFPreferences javaScriptEnabled]): Renamed from jScriptEnabled.
    	(-[IFPreferences setJavaScriptEnabled:]): Renamed from setJScriptEnabled.
    	(-[IFPreferences javaScriptCanOpenWindowsAutomatically]): New method.
    	(-[IFPreferences setJavaScriptCanOpenWindowsAutomatically:]): Likewise.
    	* WebView.subproj/IFWebFrame.mm:
    	(-[IFWebFrame initWithName:view:provisionalDataSource:controller:]): Create
    	a dummy provisional data source if none is provided, so we always have a part
    	for the frame.
    
    WebBrowser:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1241 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 6e6071a..7d07f97 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,35 @@
+2002-05-30  Maciej Stachowiak  <mjs at apple.com>
+
+	WebCore part of fixes for:
+
+	Radar 2926169 - no support for window.open
+	Radar 2890469 - Preference to prevent JavaScript from automatically
+	opening new windows doesn't work
+	Radar 2938569 - link cursor does not appear on some pages
+	
+	* khtml/ecma/kjs_window.cpp:
+	(WindowFunc::tryCall): #ifdef'd out some parts of this code that are
+	broken (but fortunately also unnecessary) in our project.
+	* kwq/KWQKConfigBase.mm:
+	(KConfig::KConfig): Changes to support JavaScript window opening pref.
+	(KConfig::readUnsignedNumEntry): Likewise.
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::openURLInFrame): Implemented.
+	* kwq/KWQKHTMLPartBrowserExtension.mm:
+	(KHTMLPartBrowserExtension::KHTMLPartBrowserExtension): Implemented.
+	(KHTMLPartBrowserExtension::openURLRequest): Implemented by
+	calling openURLInFrame on the part.
+	(KHTMLPartBrowserExtension::createNewWindow): Implemented by
+	calling new WebController openNewWindowWIthURL method.
+	* kwq/KWQKHTMLSettings.mm:
+	(KHTMLSettings::isJavaScriptEnabled): Handle renaming of pref.
+	* kwq/KWQView.mm:
+	(-[KWQHTMLView setCursor:]): Fixes to set cursor properly even if
+	none was set.	
+	* kwq/external.h: Declare some new WebKit methods.
+	* kwq/kparts/browserextension.h: Make formerly empty methods pure virtual.
+	* kwq/khtml/khtml_ext.h: Declare some virtual methods.
+
 2002-05-30  Darin Adler  <darin at apple.com>
 
 	Cut down our copied and pasted code even more.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 6e6071a..7d07f97 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,35 @@
+2002-05-30  Maciej Stachowiak  <mjs at apple.com>
+
+	WebCore part of fixes for:
+
+	Radar 2926169 - no support for window.open
+	Radar 2890469 - Preference to prevent JavaScript from automatically
+	opening new windows doesn't work
+	Radar 2938569 - link cursor does not appear on some pages
+	
+	* khtml/ecma/kjs_window.cpp:
+	(WindowFunc::tryCall): #ifdef'd out some parts of this code that are
+	broken (but fortunately also unnecessary) in our project.
+	* kwq/KWQKConfigBase.mm:
+	(KConfig::KConfig): Changes to support JavaScript window opening pref.
+	(KConfig::readUnsignedNumEntry): Likewise.
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::openURLInFrame): Implemented.
+	* kwq/KWQKHTMLPartBrowserExtension.mm:
+	(KHTMLPartBrowserExtension::KHTMLPartBrowserExtension): Implemented.
+	(KHTMLPartBrowserExtension::openURLRequest): Implemented by
+	calling openURLInFrame on the part.
+	(KHTMLPartBrowserExtension::createNewWindow): Implemented by
+	calling new WebController openNewWindowWIthURL method.
+	* kwq/KWQKHTMLSettings.mm:
+	(KHTMLSettings::isJavaScriptEnabled): Handle renaming of pref.
+	* kwq/KWQView.mm:
+	(-[KWQHTMLView setCursor:]): Fixes to set cursor properly even if
+	none was set.	
+	* kwq/external.h: Declare some new WebKit methods.
+	* kwq/kparts/browserextension.h: Make formerly empty methods pure virtual.
+	* kwq/khtml/khtml_ext.h: Declare some virtual methods.
+
 2002-05-30  Darin Adler  <darin at apple.com>
 
 	Cut down our copied and pasted code even more.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 6e6071a..7d07f97 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,35 @@
+2002-05-30  Maciej Stachowiak  <mjs at apple.com>
+
+	WebCore part of fixes for:
+
+	Radar 2926169 - no support for window.open
+	Radar 2890469 - Preference to prevent JavaScript from automatically
+	opening new windows doesn't work
+	Radar 2938569 - link cursor does not appear on some pages
+	
+	* khtml/ecma/kjs_window.cpp:
+	(WindowFunc::tryCall): #ifdef'd out some parts of this code that are
+	broken (but fortunately also unnecessary) in our project.
+	* kwq/KWQKConfigBase.mm:
+	(KConfig::KConfig): Changes to support JavaScript window opening pref.
+	(KConfig::readUnsignedNumEntry): Likewise.
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::openURLInFrame): Implemented.
+	* kwq/KWQKHTMLPartBrowserExtension.mm:
+	(KHTMLPartBrowserExtension::KHTMLPartBrowserExtension): Implemented.
+	(KHTMLPartBrowserExtension::openURLRequest): Implemented by
+	calling openURLInFrame on the part.
+	(KHTMLPartBrowserExtension::createNewWindow): Implemented by
+	calling new WebController openNewWindowWIthURL method.
+	* kwq/KWQKHTMLSettings.mm:
+	(KHTMLSettings::isJavaScriptEnabled): Handle renaming of pref.
+	* kwq/KWQView.mm:
+	(-[KWQHTMLView setCursor:]): Fixes to set cursor properly even if
+	none was set.	
+	* kwq/external.h: Declare some new WebKit methods.
+	* kwq/kparts/browserextension.h: Make formerly empty methods pure virtual.
+	* kwq/khtml/khtml_ext.h: Declare some virtual methods.
+
 2002-05-30  Darin Adler  <darin at apple.com>
 
 	Cut down our copied and pasted code even more.
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index 4de52d9..a481275 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -1098,12 +1098,21 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
       // request window (new or existing if framename is set)
       KParts::ReadOnlyPart *newPart = 0L;
       emit part->browserExtension()->createNewWindow("", uargs,winargs,newPart);
+
+#ifdef APPLE_CHANGES
+      // We don't implement QObject::inherits, but we can assume this
+      // part will be an html part.
+      if (newPart) {
+#else
       if (newPart && newPart->inherits("KHTMLPart")) {
+#endif
         KHTMLPart *khtmlpart = static_cast<KHTMLPart*>(newPart);
         //qDebug("opener set to %p (this Window's part) in new Window %p  (this Window=%p)",part,win,window);
         khtmlpart->setOpener(part);
         khtmlpart->setOpenedByJS(true);
         if (khtmlpart->document().isNull()) {
+#ifndef APPLE_CHANGES
+	  // FIXME: need to figure out and emulate point of this code.
           khtmlpart->begin();
           khtmlpart->write("<HTML><BODY>");
           khtmlpart->end();
@@ -1112,6 +1121,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
             khtmlpart->docImpl()->setDomain( part->docImpl()->domain(), true );
             khtmlpart->docImpl()->setBaseURL( part->docImpl()->baseURL() );
           }
+#endif
         }
         uargs.serviceType = QString::null;
         if (uargs.frameName == "_blank")
@@ -1119,7 +1129,12 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
         if (!url.isEmpty())
           emit khtmlpart->browserExtension()->openURLRequest(url,uargs);
         return Window::retrieve(khtmlpart); // global object
+#ifdef APPLE_CHANGES
+	// Make braces match for the benefit of prepare-ChangeLog
+      } else
+#else
       } else
+#endif
         return Undefined();
     }
   }
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index e16989f..6eeb7ad 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -3713,10 +3713,11 @@ QPtrList<KParts::ReadOnlyPart> KHTMLPart::frames() const
 #endif
 }
 
-#ifndef APPLE_CHANGES
-
 bool KHTMLPart::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs )
 {
+#ifdef APPLE_CHANGES
+  return impl->openURLInFrame(url, urlArgs);
+#else
   FrameIt it = d->m_frames.find( urlArgs.frameName );
 
   if ( it == d->m_frames.end() )
@@ -3729,9 +3730,9 @@ bool KHTMLPart::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs
   requestObject( &(*it), url, urlArgs );
 
   return true;
+#endif
 }
 
-#endif
 
 void KHTMLPart::setDNDEnabled( bool b )
 {
diff --git a/WebCore/kwq/KWQKConfigBase.mm b/WebCore/kwq/KWQKConfigBase.mm
index 081f0bb..0e9339f 100644
--- a/WebCore/kwq/KWQKConfigBase.mm
+++ b/WebCore/kwq/KWQKConfigBase.mm
@@ -34,6 +34,7 @@ class KWQKConfigImpl
 {
 public:
     bool isPluginInfo;
+    bool isKonquerorRC;
     int pluginIndex;
 };
 
@@ -41,6 +42,7 @@ KConfig::KConfig(const QString &n, bool bReadOnly, bool bUseKDEGlobals)
 {
     impl = new KWQKConfigImpl;
     impl->isPluginInfo = n.contains("pluginsinfo");
+    impl->isKonquerorRC = (n == "konquerorrc");
     impl->pluginIndex = 0;
 }
 
@@ -108,6 +110,13 @@ int KConfig::readNumEntry(const char *pKey, int nDefault) const
 
 unsigned int KConfig::readUnsignedNumEntry(const char *pKey, unsigned int nDefault) const
 {
+    if (impl->isKonquerorRC && QString(pKey) == "WindowOpenPolicy") {
+	if ([[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitJavaScriptCanOpenWindowsAutomatically"]) {
+	    return 0;
+	} else {
+	    return 3;
+	}
+    }
     _logNotYetImplemented();
     return nDefault;
 }
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 89ebf10..504b72f 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -39,6 +39,7 @@ public:
     
     void setView(KHTMLView *view);
 
+    bool openURLInFrame(const KURL &, const KParts::URLArgs &);
     void openURL(const KURL &);
     void begin(const KURL &, int xOffset, int yOffset);
     void write(const char *str, int len);
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index d14e9d0..ae60823 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -105,6 +105,33 @@ KWQKHTMLPartImpl::~KWQKHTMLPartImpl()
     killTimer(m_redirectionTimer);
 }
 
+bool KWQKHTMLPartImpl::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs )
+{
+  IFWebDataSource *oldDataSource, *newDataSource;
+  IFWebFrame *frame;
+
+
+  if (!urlArgs.frameName.isEmpty()) {
+    frame = [[getDataSource() controller] frameNamed: QSTRING_TO_NSSTRING(urlArgs.frameName)];
+    oldDataSource = [frame dataSource];
+  } else {
+      oldDataSource = getDataSource();
+      frame = [oldDataSource webFrame];
+  }
+
+  if (frame == nil) {
+    frame = [[getDataSource() controller] mainFrame];
+  }
+
+  newDataSource = WCIFWebDataSourceMake(url.getNSURL(), nil, 0);
+  [newDataSource _setParent: [oldDataSource parent]];
+
+  [frame setProvisionalDataSource: newDataSource];
+  [frame startLoading];
+
+  return true;
+}
+
 void KWQKHTMLPartImpl::openURL(const KURL &url)
 {
     d->m_workingURL = url;
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.h b/WebCore/kwq/KWQKHTMLPartBrowserExtension.h
index c9c30f0..7878213 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.h
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.h
@@ -26,13 +26,32 @@
 #include <kparts/browserextension.h>
 
 class QWidget;
+class KHTMLPart;
 
 class KHTMLPartBrowserExtension : public KParts::BrowserExtension {
 public:
-    KHTMLPartBrowserExtension(KHTMLPart *) { }
+    KHTMLPartBrowserExtension(KHTMLPart *);
     void editableWidgetFocused(QWidget *) { }
     void editableWidgetBlurred(QWidget *) { }
     void setLocationBarURL(const QString &) { }
+    
+    virtual void openURLRequest(const KURL &, 
+				const KParts::URLArgs &args = KParts::URLArgs());
+     
+    virtual void createNewWindow(const KURL &url, 
+				 const KParts::URLArgs &urlArgs = KParts::URLArgs());
+    virtual void createNewWindow(const KURL &url,
+				 const KParts::URLArgs &urlArgs, 
+				 const KParts::WindowArgs &winArgs, 
+				 KParts::ReadOnlyPart *&part);
+    
+private:
+     void createNewWindow(const KURL &url, 
+			  const KParts::URLArgs &urlArgs, 
+			  const KParts::WindowArgs &winArgs, 
+			  KParts::ReadOnlyPart **part);
+
+     KHTMLPart *m_part;
 };
 
 class KHTMLPartBrowserHostExtension {
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index e69de29..cf2c769 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -0,0 +1,68 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ * Copyright (C) 2001, 2002 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import <khtml/khtml_ext.h>
+#import <khtml_part.h>
+#import <external.h>
+#import <KWQKHTMLPartImpl.h>
+
+KHTMLPartBrowserExtension::KHTMLPartBrowserExtension(KHTMLPart *part)
+{
+    m_part = part;
+}
+
+void KHTMLPartBrowserExtension::openURLRequest(const KURL &url, 
+					       const KParts::URLArgs &args)
+{
+    m_part->openURLInFrame(url, args);
+}
+
+
+void KHTMLPartBrowserExtension::createNewWindow(const KURL &url, 
+						const KParts::URLArgs &urlArgs) 
+{
+    createNewWindow(url, urlArgs, KParts::WindowArgs(), NULL);
+}
+
+void KHTMLPartBrowserExtension::createNewWindow(const KURL &url, 
+						const KParts::URLArgs &urlArgs, 
+						const KParts::WindowArgs &winArgs, 
+						KParts::ReadOnlyPart *&part)
+{
+    createNewWindow(url, urlArgs, winArgs, &part);
+}
+
+void KHTMLPartBrowserExtension::createNewWindow(const KURL &url, 
+						const KParts::URLArgs &urlArgs, 
+						const KParts::WindowArgs &winArgs, 
+						KParts::ReadOnlyPart **part)
+{ 
+    id<IFWebController> newController = [[m_part->impl->getDataSource() controller] openNewWindowWithURL:url.getNSURL()];
+    if (part != NULL) {
+	*part = [[[newController mainFrame] provisionalDataSource] _part];
+    }
+}
+
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 89ebf10..504b72f 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -39,6 +39,7 @@ public:
     
     void setView(KHTMLView *view);
 
+    bool openURLInFrame(const KURL &, const KParts::URLArgs &);
     void openURL(const KURL &);
     void begin(const KURL &, int xOffset, int yOffset);
     void write(const char *str, int len);
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index d14e9d0..ae60823 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -105,6 +105,33 @@ KWQKHTMLPartImpl::~KWQKHTMLPartImpl()
     killTimer(m_redirectionTimer);
 }
 
+bool KWQKHTMLPartImpl::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs )
+{
+  IFWebDataSource *oldDataSource, *newDataSource;
+  IFWebFrame *frame;
+
+
+  if (!urlArgs.frameName.isEmpty()) {
+    frame = [[getDataSource() controller] frameNamed: QSTRING_TO_NSSTRING(urlArgs.frameName)];
+    oldDataSource = [frame dataSource];
+  } else {
+      oldDataSource = getDataSource();
+      frame = [oldDataSource webFrame];
+  }
+
+  if (frame == nil) {
+    frame = [[getDataSource() controller] mainFrame];
+  }
+
+  newDataSource = WCIFWebDataSourceMake(url.getNSURL(), nil, 0);
+  [newDataSource _setParent: [oldDataSource parent]];
+
+  [frame setProvisionalDataSource: newDataSource];
+  [frame startLoading];
+
+  return true;
+}
+
 void KWQKHTMLPartImpl::openURL(const KURL &url)
 {
     d->m_workingURL = url;
diff --git a/WebCore/kwq/KWQKHTMLSettings.mm b/WebCore/kwq/KWQKHTMLSettings.mm
index 50ed298..6aeda76 100644
--- a/WebCore/kwq/KWQKHTMLSettings.mm
+++ b/WebCore/kwq/KWQKHTMLSettings.mm
@@ -153,7 +153,7 @@ bool KHTMLSettings::isJavaScriptEnabled(QString const&) const
 
 bool KHTMLSettings::isJavaScriptEnabled() const
 {
-    return [[[NSUserDefaults standardUserDefaults] objectForKey:@"WebKitJScriptEnabled"] boolValue];
+    return [[[NSUserDefaults standardUserDefaults] objectForKey:@"WebKitJavaScriptEnabled"] boolValue];
 }
 
 bool KHTMLSettings::isJavaScriptDebugEnabled() const
diff --git a/WebCore/kwq/KWQKPartsBrowserExtension.h b/WebCore/kwq/KWQKPartsBrowserExtension.h
index b3fc7ab..9b10811 100644
--- a/WebCore/kwq/KWQKPartsBrowserExtension.h
+++ b/WebCore/kwq/KWQKPartsBrowserExtension.h
@@ -61,22 +61,29 @@ struct WindowArgs {
     bool toolBarsVisible;
     bool resizable;
     bool fullscreen;
+    bool xSet;
+    bool ySet;
+    bool widthSet;
+    bool heightSet;
 
-    WindowArgs() : x(0), y(0), width(0), height(0), menuBarVisible(false), statusBarVisible(false), toolBarsVisible(false), resizable(false), fullscreen(false) { }
+    WindowArgs() : x(0), y(0), width(0), height(0), menuBarVisible(false), statusBarVisible(true), toolBarsVisible(true), resizable(true), fullscreen(true), xSet(false), ySet(false), widthSet(false), heightSet(false) { }
 
 };
 
 class BrowserExtension : public QObject {
 public:
+     BrowserExtension() {}
      BrowserInterface *browserInterface() const { return 0; }
      
-     void openURLRequest(const KURL &) { }
-     void openURLRequest(const KURL &, const KParts::URLArgs &args) { }
+     virtual void openURLRequest(const KURL &, const KParts::URLArgs &args = KParts::URLArgs()) = 0;
      
-     void createNewWindow(const KURL &) { }
-     void createNewWindow(const KURL &, const KParts::URLArgs &) { }
-     void createNewWindow(const KURL &, const KParts::URLArgs &, 
-        const KParts::WindowArgs &, KParts::ReadOnlyPart *&) { }
+     virtual void createNewWindow(const KURL &url, 
+				  const KParts::URLArgs &urlArgs = KParts::URLArgs()) = 0;
+
+     virtual void createNewWindow(const KURL &url, 
+				  const KParts::URLArgs &urlArgs, 
+				  const KParts::WindowArgs &winArgs, 
+				  KParts::ReadOnlyPart *&part) = 0;
 
      void setIconURL(const KURL &) { }
      
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index f98dbc7..db1c647 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -309,6 +309,18 @@
 {
     [cursor release];
     cursor = [cur retain];
+
+
+    // We have to make both of these calls, because:
+    // - Just setting a cursor rect will have no effect, if the mouse cursor is already
+    //   inside the area of the rect.
+    // - Just calling invalidateCursorRectsForView will not call resetCursorRects if
+    //   there is no cursor rect set currently and the view has no subviews.
+    // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
+    // at all, if we are going to want one, and then invalidateCursorRectsForView: to
+    // call resetCursorRects from the proper context that will
+    // actually result in updating the cursor.
+    [self resetCursorRects];
     [[self window] invalidateCursorRectsForView:self];
 }
 
diff --git a/WebCore/kwq/external.h b/WebCore/kwq/external.h
index 39be02c..cbca4eb 100644
--- a/WebCore/kwq/external.h
+++ b/WebCore/kwq/external.h
@@ -27,6 +27,7 @@
 #define __EXTERNAL_H_
 
 #import <WebFoundation/WebFoundation.h>
+#include <misc/loader.h>
 
 class KHTMLPart;
 class QWidget;
@@ -45,7 +46,8 @@ namespace khtml {
 @protocol IFWebController
 - (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource inScrollView: (BOOL)inScrollView;
 - (IFWebFrame *)frameNamed: (NSString *)name;
-- (void)openNewWindowWithURL: (NSURL *)url;
+- (IFWebFrame *)mainFrame;
+- (id<IFWebController>)openNewWindowWithURL: (NSURL *)url;
 @end
 
 @interface IFBaseWebController
@@ -91,6 +93,7 @@ namespace khtml {
 - initWithName: (NSString *)n view: v dataSource: (IFWebDataSource *)d;
 - view;
 - (IFWebDataSource *)dataSource;
+- (IFWebDataSource *)provisionalDataSource;
 - (void)setProvisionalDataSource: (IFWebDataSource *)ds;
 - (void)_setRenderFramePart: (void *)p;
 - (void *)_renderFramePart;
diff --git a/WebCore/kwq/khtml/khtml_ext.h b/WebCore/kwq/khtml/khtml_ext.h
index c9c30f0..7878213 100644
--- a/WebCore/kwq/khtml/khtml_ext.h
+++ b/WebCore/kwq/khtml/khtml_ext.h
@@ -26,13 +26,32 @@
 #include <kparts/browserextension.h>
 
 class QWidget;
+class KHTMLPart;
 
 class KHTMLPartBrowserExtension : public KParts::BrowserExtension {
 public:
-    KHTMLPartBrowserExtension(KHTMLPart *) { }
+    KHTMLPartBrowserExtension(KHTMLPart *);
     void editableWidgetFocused(QWidget *) { }
     void editableWidgetBlurred(QWidget *) { }
     void setLocationBarURL(const QString &) { }
+    
+    virtual void openURLRequest(const KURL &, 
+				const KParts::URLArgs &args = KParts::URLArgs());
+     
+    virtual void createNewWindow(const KURL &url, 
+				 const KParts::URLArgs &urlArgs = KParts::URLArgs());
+    virtual void createNewWindow(const KURL &url,
+				 const KParts::URLArgs &urlArgs, 
+				 const KParts::WindowArgs &winArgs, 
+				 KParts::ReadOnlyPart *&part);
+    
+private:
+     void createNewWindow(const KURL &url, 
+			  const KParts::URLArgs &urlArgs, 
+			  const KParts::WindowArgs &winArgs, 
+			  KParts::ReadOnlyPart **part);
+
+     KHTMLPart *m_part;
 };
 
 class KHTMLPartBrowserHostExtension {
diff --git a/WebCore/kwq/kparts/browserextension.h b/WebCore/kwq/kparts/browserextension.h
index b3fc7ab..9b10811 100644
--- a/WebCore/kwq/kparts/browserextension.h
+++ b/WebCore/kwq/kparts/browserextension.h
@@ -61,22 +61,29 @@ struct WindowArgs {
     bool toolBarsVisible;
     bool resizable;
     bool fullscreen;
+    bool xSet;
+    bool ySet;
+    bool widthSet;
+    bool heightSet;
 
-    WindowArgs() : x(0), y(0), width(0), height(0), menuBarVisible(false), statusBarVisible(false), toolBarsVisible(false), resizable(false), fullscreen(false) { }
+    WindowArgs() : x(0), y(0), width(0), height(0), menuBarVisible(false), statusBarVisible(true), toolBarsVisible(true), resizable(true), fullscreen(true), xSet(false), ySet(false), widthSet(false), heightSet(false) { }
 
 };
 
 class BrowserExtension : public QObject {
 public:
+     BrowserExtension() {}
      BrowserInterface *browserInterface() const { return 0; }
      
-     void openURLRequest(const KURL &) { }
-     void openURLRequest(const KURL &, const KParts::URLArgs &args) { }
+     virtual void openURLRequest(const KURL &, const KParts::URLArgs &args = KParts::URLArgs()) = 0;
      
-     void createNewWindow(const KURL &) { }
-     void createNewWindow(const KURL &, const KParts::URLArgs &) { }
-     void createNewWindow(const KURL &, const KParts::URLArgs &, 
-        const KParts::WindowArgs &, KParts::ReadOnlyPart *&) { }
+     virtual void createNewWindow(const KURL &url, 
+				  const KParts::URLArgs &urlArgs = KParts::URLArgs()) = 0;
+
+     virtual void createNewWindow(const KURL &url, 
+				  const KParts::URLArgs &urlArgs, 
+				  const KParts::WindowArgs &winArgs, 
+				  KParts::ReadOnlyPart *&part) = 0;
 
      void setIconURL(const KURL &) { }
      
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 9056623..ccc874d 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,35 @@
+2002-05-30  Maciej Stachowiak  <mjs at apple.com>
+
+	WebKit parts of fixes for:
+
+	Radar 2926169 - no support for window.open
+	Radar 2890469 - Preference to prevent JavaScript from automatically
+	opening new windows doesn't work
+	Radar 2938569 - link cursor does not appear on some pages
+	
+	* WebView.subproj/IFWebController.h:
+	Added openNewWindowWithURL: method for the benefit of JavaScript.
+	* WebView.subproj/IFBaseWebController.mm:
+	(-[IFBaseWebController openNewWindowWithURL:]): No-op default
+	implementation.
+	* WebView.subproj/IFDynamicScrollBarsView.h:
+	* WebView.subproj/IFDynamicScrollBarsView.m:
+	(-[IFDynamicScrollBarsView setCursor:]): Fix cursor handling.
+	(-[IFDynamicScrollBarsView resetCursorRects]): Likewise.
+	* WebView.subproj/IFWebView.mm:
+	(-[IFWebView mouseMovedNotification:]): Likewise.
+	(-[IFWebView setCursor:]): Likewise.
+	* WebView.subproj/IFPreferences.h:
+	* WebView.subproj/IFPreferences.mm:
+	(-[IFPreferences javaScriptEnabled]): Renamed from jScriptEnabled.
+	(-[IFPreferences setJavaScriptEnabled:]): Renamed from setJScriptEnabled.
+	(-[IFPreferences javaScriptCanOpenWindowsAutomatically]): New method.
+	(-[IFPreferences setJavaScriptCanOpenWindowsAutomatically:]): Likewise.
+	* WebView.subproj/IFWebFrame.mm:
+	(-[IFWebFrame initWithName:view:provisionalDataSource:controller:]): Create
+	a dummy provisional data source if none is provided, so we always have a part
+	for the frame.
+	
 2002-05-30  Darin Adler  <darin at apple.com>
 
 	Use methods in KWQKHTMLPartImpl that were moved there from KHTMLPart.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 9056623..ccc874d 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,35 @@
+2002-05-30  Maciej Stachowiak  <mjs at apple.com>
+
+	WebKit parts of fixes for:
+
+	Radar 2926169 - no support for window.open
+	Radar 2890469 - Preference to prevent JavaScript from automatically
+	opening new windows doesn't work
+	Radar 2938569 - link cursor does not appear on some pages
+	
+	* WebView.subproj/IFWebController.h:
+	Added openNewWindowWithURL: method for the benefit of JavaScript.
+	* WebView.subproj/IFBaseWebController.mm:
+	(-[IFBaseWebController openNewWindowWithURL:]): No-op default
+	implementation.
+	* WebView.subproj/IFDynamicScrollBarsView.h:
+	* WebView.subproj/IFDynamicScrollBarsView.m:
+	(-[IFDynamicScrollBarsView setCursor:]): Fix cursor handling.
+	(-[IFDynamicScrollBarsView resetCursorRects]): Likewise.
+	* WebView.subproj/IFWebView.mm:
+	(-[IFWebView mouseMovedNotification:]): Likewise.
+	(-[IFWebView setCursor:]): Likewise.
+	* WebView.subproj/IFPreferences.h:
+	* WebView.subproj/IFPreferences.mm:
+	(-[IFPreferences javaScriptEnabled]): Renamed from jScriptEnabled.
+	(-[IFPreferences setJavaScriptEnabled:]): Renamed from setJScriptEnabled.
+	(-[IFPreferences javaScriptCanOpenWindowsAutomatically]): New method.
+	(-[IFPreferences setJavaScriptCanOpenWindowsAutomatically:]): Likewise.
+	* WebView.subproj/IFWebFrame.mm:
+	(-[IFWebFrame initWithName:view:provisionalDataSource:controller:]): Create
+	a dummy provisional data source if none is provided, so we always have a part
+	for the frame.
+	
 2002-05-30  Darin Adler  <darin at apple.com>
 
 	Use methods in KWQKHTMLPartImpl that were moved there from KHTMLPart.
diff --git a/WebKit/WebView.subproj/IFBaseWebController.mm b/WebKit/WebView.subproj/IFBaseWebController.mm
index 697c410..0124ff5 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.mm
+++ b/WebKit/WebView.subproj/IFBaseWebController.mm
@@ -92,9 +92,9 @@
 }
 
 
-- (void)openNewWindowWithURL:(NSURL *)url
+- (id<IFWebController>)openNewWindowWithURL:(NSURL *)url
 {
-    // Default implementation does nothing
+    return nil;
 }
 
 
diff --git a/WebKit/WebView.subproj/IFDynamicScrollBarsView.h b/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
index 9e570ea..fcef782 100644
--- a/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
+++ b/WebKit/WebView.subproj/IFDynamicScrollBarsView.h
@@ -11,6 +11,7 @@
 @interface IFDynamicScrollBarsView : NSScrollView 
 {
     bool breakRecursionCycle;
+    NSCursor *cursor;
 }
 
 @end
diff --git a/WebKit/WebView.subproj/IFDynamicScrollBarsView.m b/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
index fe04c34..26c8b57 100644
--- a/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
+++ b/WebKit/WebView.subproj/IFDynamicScrollBarsView.m
@@ -36,4 +36,29 @@
     [super reflectScrolledClipView: clipView];
 }
 
+- (void)setCursor:(NSCursor *)cur
+{
+    [cur release];
+    cursor = [cur retain];
+
+    // We have to make both of these calls, because:
+    // - Just setting a cursor rect will have no effect, if the mouse cursor is already
+    //   inside the area of the rect.
+    // - Just calling invalidateCursorRectsForView will not call resetCursorRects if
+    //   there is no cursor rect set currently and the view has no subviews.
+    // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
+    // at all, if we are going to want one, and then invalidateCursorRectsForView: to
+    // call resetCursorRects from the proper context that will
+    // actually result in updating the cursor.
+    [self resetCursorRects];
+    [[self window] invalidateCursorRectsForView:self];
+}
+
+- (void)resetCursorRects
+{
+    if (cursor != nil && cursor != [NSCursor arrowCursor]) {
+        [self addCursorRect:[self visibleRect] cursor:cursor];
+    }
+}
+
 @end
diff --git a/WebKit/WebView.subproj/IFPreferences.h b/WebKit/WebView.subproj/IFPreferences.h
index d415a75..961396b 100644
--- a/WebKit/WebView.subproj/IFPreferences.h
+++ b/WebKit/WebView.subproj/IFPreferences.h
@@ -38,8 +38,11 @@
 - (BOOL)javaEnabled;
 - (void)setJavaEnabled:(BOOL)flag;
 
-- (BOOL)jScriptEnabled;
-- (void)setJScriptEnabled:(BOOL)flag;
+- (BOOL)javaScriptEnabled;
+- (void)setJavaScriptEnabled:(BOOL)flag;
+
+- (BOOL)javaScriptCanOpenWindowsAutomatically;
+- (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)flag;
 
 - (BOOL)pluginsEnabled;
 - (void)setPluginsEnabled:(BOOL)flag;
diff --git a/WebKit/WebView.subproj/IFPreferences.mm b/WebKit/WebView.subproj/IFPreferences.mm
index 2a31df7..4cdf6a0 100644
--- a/WebKit/WebView.subproj/IFPreferences.mm
+++ b/WebKit/WebView.subproj/IFPreferences.mm
@@ -17,7 +17,8 @@
 #define	WebKitMinimumFontSizePreferenceKey	@"WebKitMinimumFontSize"
 #define	WebKitMediumFontSizePreferenceKey	@"WebKitMediumFontSize"
 #define	WebKitJavaEnabledPreferenceKey		@"WebKitJavaEnabled"
-#define	WebKitJScriptEnabledPreferenceKey	@"WebKitJScriptEnabled"
+#define	WebKitJavaScriptEnabledPreferenceKey	@"WebKitJavaScriptEnabled"
+#define	WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey	@"WebKitJavaScriptCanOpenWindowsAutomatically"
 #define	WebKitPluginsEnabledPreferenceKey	@"WebKitPluginsEnabled"
 #define	WebKitInitialTimedLayoutDelayPreferenceKey	@"WebKitInitialTimedLayoutDelay"
 #define	WebKitInitialTimedLayoutSizePreferenceKey	@"WebKitInitialTimedLayoutSize"
@@ -47,7 +48,8 @@ static IFPreferences *_standardPreferences = nil;
 
     NSNumber *pluginsEnabled = [NSNumber numberWithBool:TRUE];
     NSNumber *javaEnabled = [NSNumber numberWithBool:FALSE];
-    NSNumber *jScriptEnabled = [NSNumber numberWithBool:TRUE];
+    NSNumber *javaScriptEnabled = [NSNumber numberWithBool:TRUE];
+    NSNumber *javaScriptCanOpenWindows = [NSNumber numberWithBool:TRUE];
     NSNumber *timedLayoutEnabled = [NSNumber numberWithBool:TRUE];
     NSNumber *resourceTimedLayoutEnabled = [NSNumber numberWithBool:TRUE];
     NSNumber *allowAnimatedImages = [NSNumber numberWithBool:TRUE];
@@ -69,7 +71,8 @@ static IFPreferences *_standardPreferences = nil;
         timedLayoutEnabled,		WebKitInitialTimedLayoutEnabledPreferenceKey,
         resourceTimedLayoutEnabled,	WebKitResourceTimedLayoutEnabledPreferenceKey,
         javaEnabled,			WebKitJavaEnabledPreferenceKey,
-        jScriptEnabled,			WebKitJScriptEnabledPreferenceKey,
+        javaScriptEnabled,		WebKitJavaScriptEnabledPreferenceKey,
+        javaScriptCanOpenWindows,	WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
         pluginsEnabled,			WebKitPluginsEnabledPreferenceKey,
         allowAnimatedImages,    WebKitAllowAnimatedImagesPreferenceKey,
         allowAnimatedImageLooping,    WebKitAllowAnimatedImageLoopingPreferenceKey,
@@ -171,14 +174,24 @@ static IFPreferences *_standardPreferences = nil;
     [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJavaEnabledPreferenceKey];
 }
 
-- (BOOL)jScriptEnabled
+- (BOOL)javaScriptEnabled
 {
-    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJScriptEnabledPreferenceKey];
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJavaScriptEnabledPreferenceKey];
 }
 
-- (void)setJScriptEnabled:(BOOL)flag
+- (void)setJavaScriptEnabled:(BOOL)flag
 {
-    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJScriptEnabledPreferenceKey];
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJavaScriptEnabledPreferenceKey];
+}
+
+- (BOOL)javaScriptCanOpenWindowsAutomatically
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey];
+}
+
+- (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)flag
+{
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey];
 }
 
 - (BOOL)pluginsEnabled
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index 4198d90..a4d8a66 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -33,6 +33,8 @@
 @class IFLoadProgress;
 @class IFWebDataSource;
 @class IFWebFrame;
+ at protocol IFWebController;
+
 
 /*
    ============================================================================= 
@@ -76,10 +78,9 @@
 
 // Need API for things like window size and position, window ids,
 // screen goemetry.  Essentially all the 'view' items that are
-// accessible from Javascript.
 
 // FIXME: not strictly a scripting issue
-- (void)openNewWindowWithURL:(NSURL *)url;
+- (id<IFWebController>)openNewWindowWithURL:(NSURL *)url;
 @end
 
 /*
diff --git a/WebKit/WebView.subproj/IFWebFrame.mm b/WebKit/WebView.subproj/IFWebFrame.mm
index f426bad..a4e0cfe 100644
--- a/WebKit/WebView.subproj/IFWebFrame.mm
+++ b/WebKit/WebView.subproj/IFWebFrame.mm
@@ -37,8 +37,21 @@
 
     [self setController: c];
 
+    if (d == nil) {
+	// set a dummy data source so that the main from for a
+	// newly-created empty window has a KHTMLPart. JavaScript
+	// always creates new windows initially empty, and then wants
+	// to use the main frame's part to make the new window load
+	// it's URL, so we need to make sure empty frames have a part.
+	// However, we don't want to do the spinner, so we do this
+	// weird thing:
+
+	IFWebDataSource *dummyDataSource = [[IFWebDataSource alloc] initWithURL:nil];
+        [dummyDataSource _setController: [self controller]];
+        [_private setProvisionalDataSource: dummyDataSource];
+
     // Allow controller to override?
-    if (d && [self setProvisionalDataSource: d] == NO){
+    } else if ([self setProvisionalDataSource: d] == NO){
         [self autorelease];
         return nil;
     }
@@ -215,4 +228,4 @@
     }
 }
 
- at end
\ No newline at end of file
+ at end
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index 7312664..9916e3e 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -544,9 +544,10 @@
 {
     NSEvent *event = [(NSDictionary *)[notification userInfo] objectForKey: @"NSEvent"];
     NSPoint p = [event locationInWindow];
-    NSRect frame = [self frame];
 
-    if (p.x >= frame.origin.x && frame.origin.y >= 0 && p.x <= frame.size.width && p.y <= frame.size.height ) {
+    // Only act on the mouse move event if it's inside this view (and
+    // not inside a subview)
+    if ([[[self window] contentView] hitTest:p] == self) {
 	QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), 0, 0);
 	KHTMLView *widget = _private->widget;
 	if (widget != 0l) {
@@ -594,6 +595,17 @@
 {
     [_private->cursor release];
     _private->cursor = [cursor retain];
+
+    // We have to make both of these calls, because:
+    // - Just setting a cursor rect will have no effect, if the mouse cursor is already
+    //   inside the area of the rect.
+    // - Just calling invalidateCursorRectsForView will not call resetCursorRects if
+    //   there is no cursor rect set currently and the view has no subviews.
+    // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
+    // at all, if we are going to want one, and then invalidateCursorRectsForView: to
+    // call resetCursorRects from the proper context that will
+    // actually result in updating the cursor.
+    [self resetCursorRects];
     [[self window] invalidateCursorRectsForView:self];
 }
 
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index 4198d90..a4d8a66 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -33,6 +33,8 @@
 @class IFLoadProgress;
 @class IFWebDataSource;
 @class IFWebFrame;
+ at protocol IFWebController;
+
 
 /*
    ============================================================================= 
@@ -76,10 +78,9 @@
 
 // Need API for things like window size and position, window ids,
 // screen goemetry.  Essentially all the 'view' items that are
-// accessible from Javascript.
 
 // FIXME: not strictly a scripting issue
-- (void)openNewWindowWithURL:(NSURL *)url;
+- (id<IFWebController>)openNewWindowWithURL:(NSURL *)url;
 @end
 
 /*
diff --git a/WebKit/WebView.subproj/WebDynamicScrollBarsView.h b/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
index 9e570ea..fcef782 100644
--- a/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
+++ b/WebKit/WebView.subproj/WebDynamicScrollBarsView.h
@@ -11,6 +11,7 @@
 @interface IFDynamicScrollBarsView : NSScrollView 
 {
     bool breakRecursionCycle;
+    NSCursor *cursor;
 }
 
 @end
diff --git a/WebKit/WebView.subproj/WebDynamicScrollBarsView.m b/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
index fe04c34..26c8b57 100644
--- a/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
+++ b/WebKit/WebView.subproj/WebDynamicScrollBarsView.m
@@ -36,4 +36,29 @@
     [super reflectScrolledClipView: clipView];
 }
 
+- (void)setCursor:(NSCursor *)cur
+{
+    [cur release];
+    cursor = [cur retain];
+
+    // We have to make both of these calls, because:
+    // - Just setting a cursor rect will have no effect, if the mouse cursor is already
+    //   inside the area of the rect.
+    // - Just calling invalidateCursorRectsForView will not call resetCursorRects if
+    //   there is no cursor rect set currently and the view has no subviews.
+    // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
+    // at all, if we are going to want one, and then invalidateCursorRectsForView: to
+    // call resetCursorRects from the proper context that will
+    // actually result in updating the cursor.
+    [self resetCursorRects];
+    [[self window] invalidateCursorRectsForView:self];
+}
+
+- (void)resetCursorRects
+{
+    if (cursor != nil && cursor != [NSCursor arrowCursor]) {
+        [self addCursorRect:[self visibleRect] cursor:cursor];
+    }
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index f426bad..a4e0cfe 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -37,8 +37,21 @@
 
     [self setController: c];
 
+    if (d == nil) {
+	// set a dummy data source so that the main from for a
+	// newly-created empty window has a KHTMLPart. JavaScript
+	// always creates new windows initially empty, and then wants
+	// to use the main frame's part to make the new window load
+	// it's URL, so we need to make sure empty frames have a part.
+	// However, we don't want to do the spinner, so we do this
+	// weird thing:
+
+	IFWebDataSource *dummyDataSource = [[IFWebDataSource alloc] initWithURL:nil];
+        [dummyDataSource _setController: [self controller]];
+        [_private setProvisionalDataSource: dummyDataSource];
+
     // Allow controller to override?
-    if (d && [self setProvisionalDataSource: d] == NO){
+    } else if ([self setProvisionalDataSource: d] == NO){
         [self autorelease];
         return nil;
     }
@@ -215,4 +228,4 @@
     }
 }
 
- at end
\ No newline at end of file
+ at end
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 7312664..9916e3e 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -544,9 +544,10 @@
 {
     NSEvent *event = [(NSDictionary *)[notification userInfo] objectForKey: @"NSEvent"];
     NSPoint p = [event locationInWindow];
-    NSRect frame = [self frame];
 
-    if (p.x >= frame.origin.x && frame.origin.y >= 0 && p.x <= frame.size.width && p.y <= frame.size.height ) {
+    // Only act on the mouse move event if it's inside this view (and
+    // not inside a subview)
+    if ([[[self window] contentView] hitTest:p] == self) {
 	QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), 0, 0);
 	KHTMLView *widget = _private->widget;
 	if (widget != 0l) {
@@ -594,6 +595,17 @@
 {
     [_private->cursor release];
     _private->cursor = [cursor retain];
+
+    // We have to make both of these calls, because:
+    // - Just setting a cursor rect will have no effect, if the mouse cursor is already
+    //   inside the area of the rect.
+    // - Just calling invalidateCursorRectsForView will not call resetCursorRects if
+    //   there is no cursor rect set currently and the view has no subviews.
+    // Therefore we have to call resetCursorRects to ensure that a cursor rect is set
+    // at all, if we are going to want one, and then invalidateCursorRectsForView: to
+    // call resetCursorRects from the proper context that will
+    // actually result in updating the cursor.
+    [self resetCursorRects];
     [[self window] invalidateCursorRectsForView:self];
 }
 
diff --git a/WebKit/WebView.subproj/WebPreferences.h b/WebKit/WebView.subproj/WebPreferences.h
index d415a75..961396b 100644
--- a/WebKit/WebView.subproj/WebPreferences.h
+++ b/WebKit/WebView.subproj/WebPreferences.h
@@ -38,8 +38,11 @@
 - (BOOL)javaEnabled;
 - (void)setJavaEnabled:(BOOL)flag;
 
-- (BOOL)jScriptEnabled;
-- (void)setJScriptEnabled:(BOOL)flag;
+- (BOOL)javaScriptEnabled;
+- (void)setJavaScriptEnabled:(BOOL)flag;
+
+- (BOOL)javaScriptCanOpenWindowsAutomatically;
+- (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)flag;
 
 - (BOOL)pluginsEnabled;
 - (void)setPluginsEnabled:(BOOL)flag;
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
index 2a31df7..4cdf6a0 100644
--- a/WebKit/WebView.subproj/WebPreferences.m
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -17,7 +17,8 @@
 #define	WebKitMinimumFontSizePreferenceKey	@"WebKitMinimumFontSize"
 #define	WebKitMediumFontSizePreferenceKey	@"WebKitMediumFontSize"
 #define	WebKitJavaEnabledPreferenceKey		@"WebKitJavaEnabled"
-#define	WebKitJScriptEnabledPreferenceKey	@"WebKitJScriptEnabled"
+#define	WebKitJavaScriptEnabledPreferenceKey	@"WebKitJavaScriptEnabled"
+#define	WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey	@"WebKitJavaScriptCanOpenWindowsAutomatically"
 #define	WebKitPluginsEnabledPreferenceKey	@"WebKitPluginsEnabled"
 #define	WebKitInitialTimedLayoutDelayPreferenceKey	@"WebKitInitialTimedLayoutDelay"
 #define	WebKitInitialTimedLayoutSizePreferenceKey	@"WebKitInitialTimedLayoutSize"
@@ -47,7 +48,8 @@ static IFPreferences *_standardPreferences = nil;
 
     NSNumber *pluginsEnabled = [NSNumber numberWithBool:TRUE];
     NSNumber *javaEnabled = [NSNumber numberWithBool:FALSE];
-    NSNumber *jScriptEnabled = [NSNumber numberWithBool:TRUE];
+    NSNumber *javaScriptEnabled = [NSNumber numberWithBool:TRUE];
+    NSNumber *javaScriptCanOpenWindows = [NSNumber numberWithBool:TRUE];
     NSNumber *timedLayoutEnabled = [NSNumber numberWithBool:TRUE];
     NSNumber *resourceTimedLayoutEnabled = [NSNumber numberWithBool:TRUE];
     NSNumber *allowAnimatedImages = [NSNumber numberWithBool:TRUE];
@@ -69,7 +71,8 @@ static IFPreferences *_standardPreferences = nil;
         timedLayoutEnabled,		WebKitInitialTimedLayoutEnabledPreferenceKey,
         resourceTimedLayoutEnabled,	WebKitResourceTimedLayoutEnabledPreferenceKey,
         javaEnabled,			WebKitJavaEnabledPreferenceKey,
-        jScriptEnabled,			WebKitJScriptEnabledPreferenceKey,
+        javaScriptEnabled,		WebKitJavaScriptEnabledPreferenceKey,
+        javaScriptCanOpenWindows,	WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
         pluginsEnabled,			WebKitPluginsEnabledPreferenceKey,
         allowAnimatedImages,    WebKitAllowAnimatedImagesPreferenceKey,
         allowAnimatedImageLooping,    WebKitAllowAnimatedImageLoopingPreferenceKey,
@@ -171,14 +174,24 @@ static IFPreferences *_standardPreferences = nil;
     [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJavaEnabledPreferenceKey];
 }
 
-- (BOOL)jScriptEnabled
+- (BOOL)javaScriptEnabled
 {
-    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJScriptEnabledPreferenceKey];
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJavaScriptEnabledPreferenceKey];
 }
 
-- (void)setJScriptEnabled:(BOOL)flag
+- (void)setJavaScriptEnabled:(BOOL)flag
 {
-    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJScriptEnabledPreferenceKey];
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJavaScriptEnabledPreferenceKey];
+}
+
+- (BOOL)javaScriptCanOpenWindowsAutomatically
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey];
+}
+
+- (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)flag
+{
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey];
 }
 
 - (BOOL)pluginsEnabled
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 4198d90..a4d8a66 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -33,6 +33,8 @@
 @class IFLoadProgress;
 @class IFWebDataSource;
 @class IFWebFrame;
+ at protocol IFWebController;
+
 
 /*
    ============================================================================= 
@@ -76,10 +78,9 @@
 
 // Need API for things like window size and position, window ids,
 // screen goemetry.  Essentially all the 'view' items that are
-// accessible from Javascript.
 
 // FIXME: not strictly a scripting issue
-- (void)openNewWindowWithURL:(NSURL *)url;
+- (id<IFWebController>)openNewWindowWithURL:(NSURL *)url;
 @end
 
 /*

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list