[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:22:14 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit b3f2bc91e41717f07b5df83a4742472f064b5d91
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Jun 29 23:28:43 2002 +0000
WebCore:
WebCore part of fix for:
Radar 2942074 - JavaScript size, positioning and feature
parameters to window.open are ignored
* kwq/WebCoreBridge.h: Add new calls needed for window
size/position/feature getting and setting.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Set properties on window
after creating it using new bridge calls; make it visible.
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall): Support scrollbars feature too.
* kwq/kparts/browserextension.h: Include scrollbar setting stuff.
WebKit:
WebKit part of fix for:
Radar 2942074 - JavaScript size, positioning and feature
parameters to window.open are ignored
Also, renamed IFScriptContextHandler protocol to IFWindowContext,
and made it a settable handler like the others rather than
something implemented by the controller, so it can be used w/o
subclassing.
* WebCoreSupport.subproj/IFWebCoreBridge.mm:
(-[IFWebCoreBridge openNewWindowWithURL:]): Forward to the WindowContext.
(-[IFWebCoreBridge areToolbarsVisisble]): Likewise.
(-[IFWebCoreBridge setToolbarsVisible:]): Likewise.
(-[IFWebCoreBridge areScrollbarsVisible]): Likewise.
(-[IFWebCoreBridge setScrollbarsVisible:]): Likewise.
(-[IFWebCoreBridge isStatusBarVisisble]): Likewise.
(-[IFWebCoreBridge setStatusBarVisible:]): Likewise.
(-[IFWebCoreBridge setWindowFrame:]): Likewise.
(-[IFWebCoreBridge window]): Likewise.
* WebView.subproj/IFWebController.h:
* WebView.subproj/IFWebController.mm:
(-[IFWebController setWindowContext:]): Setter for new WindowContext handler
(-[IFWebController windowContext]): Likewise.
* WebView.subproj/IFWebControllerPrivate.h:
* WebView.subproj/IFWebControllerPrivate.mm:
(-[IFWebControllerPrivate dealloc]): Release window context.
* WebView.subproj/IFWebFrame.mm:
(-[IFWebFrame frameNamed:]): Open new windows via WindowContext.
WebBrowser:
WebBrowser part of fix for:
Radar 2942074 - JavaScript size, positioning and feature
parameters to window.open are ignored
* BrowserDocument.m:
(-[BrowserDocument init]): Set the WebController as it's own WindowContext too.
* BrowserWindow.h:
* BrowserWindow.m:
(-[BrowserWindow _saveFrameIfAllowed]): Don't save the frame if the last
(-[BrowserWindow setFrameWithoutAutosaving:]): Change window size
and position but without saving the frame; if this is a size
change and not just a move, avoid saving the frame until the next
user resize.
(-[BrowserWindow windowDidResize:]): More stuff for the above.
(-[BrowserWindow isFavoritesBarVisible]): Implemented.
(-[BrowserWindow setFavoritesBarVisible:]): Implemented.
(-[BrowserWindow isStatusBarVisible]): Implemented.
(-[BrowserWindow setStatusBarVisible:]): Implemented.
(-[BrowserWindow isToolbarVisible]): Implemented.
(-[BrowserWindow setToolbarVisible:]): Implemented.
* WebController.h:
* WebController.m:
(-[BrowserWebController openNewWindowWithURL:]): Don't initially
show the window even if no URL is set, so initial parameters can
be set properly.
(-[BrowserWebController areToolbarsVisible]): Implemented.
(-[BrowserWebController setToolbarsVisible:]): Implemented.
(-[BrowserWebController isStatusBarVisible]): Implemented.
(-[BrowserWebController setStatusBarVisible:]): Implemented.
(-[BrowserWebController window]): Implemented.
(-[BrowserWebController setFrame:]): Implemented.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 09b2a82..6b47db0 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,19 @@
+2002-06-29 Maciej Stachowiak <mjs at apple.com>
+
+ WebCore part of fix for:
+
+ Radar 2942074 - JavaScript size, positioning and feature
+ parameters to window.open are ignored
+
+ * kwq/WebCoreBridge.h: Add new calls needed for window
+ size/position/feature getting and setting.
+ * kwq/KWQKHTMLPartBrowserExtension.mm:
+ (KHTMLPartBrowserExtension::createNewWindow): Set properties on window
+ after creating it using new bridge calls; make it visible.
+ * khtml/ecma/kjs_window.cpp:
+ (WindowFunc::tryCall): Support scrollbars feature too.
+ * kwq/kparts/browserextension.h: Include scrollbar setting stuff.
+
2002-06-28 Richard Williamson <rjw at apple.com>
Use float character measurement to determine selection
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 09b2a82..6b47db0 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,19 @@
+2002-06-29 Maciej Stachowiak <mjs at apple.com>
+
+ WebCore part of fix for:
+
+ Radar 2942074 - JavaScript size, positioning and feature
+ parameters to window.open are ignored
+
+ * kwq/WebCoreBridge.h: Add new calls needed for window
+ size/position/feature getting and setting.
+ * kwq/KWQKHTMLPartBrowserExtension.mm:
+ (KHTMLPartBrowserExtension::createNewWindow): Set properties on window
+ after creating it using new bridge calls; make it visible.
+ * khtml/ecma/kjs_window.cpp:
+ (WindowFunc::tryCall): Support scrollbars feature too.
+ * kwq/kparts/browserextension.h: Include scrollbar setting stuff.
+
2002-06-28 Richard Williamson <rjw at apple.com>
Use float character measurement to determine selection
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 09b2a82..6b47db0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,19 @@
+2002-06-29 Maciej Stachowiak <mjs at apple.com>
+
+ WebCore part of fix for:
+
+ Radar 2942074 - JavaScript size, positioning and feature
+ parameters to window.open are ignored
+
+ * kwq/WebCoreBridge.h: Add new calls needed for window
+ size/position/feature getting and setting.
+ * kwq/KWQKHTMLPartBrowserExtension.mm:
+ (KHTMLPartBrowserExtension::createNewWindow): Set properties on window
+ after creating it using new bridge calls; make it visible.
+ * khtml/ecma/kjs_window.cpp:
+ (WindowFunc::tryCall): Support scrollbars feature too.
+ * kwq/kparts/browserextension.h: Include scrollbar setting stuff.
+
2002-06-28 Richard Williamson <rjw at apple.com>
Use float character measurement to determine selection
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index bb2c6e9..4cb0224 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -1014,6 +1014,9 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
winargs.menuBarVisible = false;
winargs.toolBarsVisible = false;
winargs.statusBarVisible = false;
+#ifdef APPLE_CHANGES
+ winargs.scrollbarsVisible = false;
+#endif
QStringList flist = QStringList::split(',', features);
QStringList::ConstIterator it = flist.begin();
while (it != flist.end()) {
@@ -1031,22 +1034,34 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
winargs.x = val.toInt() + screen.x();
if (winargs.x < screen.x() || winargs.x > screen.right())
winargs.x = screen.x(); // only safe choice until size is determined
+#ifdef APPLE_CHANGES
+ winargs.xSet = true;
+#endif
} else if (key == "top" || key == "screeny") {
winargs.y = val.toInt() + screen.y();
if (winargs.y < screen.y() || winargs.y > screen.bottom())
winargs.y = screen.y(); // only safe choice until size is determined
+#ifdef APPLE_CHANGES
+ winargs.ySet = true;
+#endif
} else if (key == "height") {
winargs.height = val.toInt() + 2*qApp->style().pixelMetric( QStyle::PM_DefaultFrameWidth ) + 2;
if (winargs.height > screen.height()) // should actually check workspace
winargs.height = screen.height();
if (winargs.height < 100)
winargs.height = 100;
+#ifdef APPLE_CHANGES
+ winargs.heightSet = true;
+#endif
} else if (key == "width") {
winargs.width = val.toInt() + 2*qApp->style().pixelMetric( QStyle::PM_DefaultFrameWidth ) + 2;
if (winargs.width > screen.width()) // should actually check workspace
winargs.width = screen.width();
if (winargs.width < 100)
winargs.width = 100;
+#ifdef APPLE_CHANGES
+ winargs.widthSet = true;
+#endif
} else {
goto boolargs;
}
@@ -1069,6 +1084,10 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
winargs.resizable = (val == "1" || val == "yes");
else if (key == "fullscreen")
winargs.fullscreen = (val == "1" || val == "yes");
+#ifdef APPLE_CHANGES
+ else if (key == "scrollbars")
+ winargs.scrollbarsVisible = (val == "1" || val == "yes");
+#endif
}
}
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index 7fcd03e..4db7347 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -59,7 +59,53 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
KParts::ReadOnlyPart **partResult)
{
WebCoreBridge *bridge = [m_part->impl->getBridge() openNewWindowWithURL:url.getNSURL()];
-
+
+ if (!winArgs.toolBarsVisible) {
+ [bridge setToolbarsVisible:NO];
+ }
+
+ if (!winArgs.statusBarVisible) {
+ [bridge setStatusBarVisible:NO];
+ }
+
+ if (!winArgs.scrollbarsVisible) {
+ [bridge setScrollbarsVisible:NO];
+ }
+
+ if (!winArgs.resizable) {
+ [[bridge window] setShowsResizeIndicator:NO];
+ }
+
+ if (winArgs.xSet || winArgs.ySet || winArgs.widthSet || winArgs.heightSet) {
+
+ NSRect screenFrame = [[[bridge window] screen] frame];
+ NSRect frame = [[bridge window] frame];
+
+ if (winArgs.xSet) {
+ frame.origin.x = winArgs.x;
+ }
+
+ if (winArgs.ySet) {
+ if (winArgs.heightSet) {
+ frame.origin.y = screenFrame.size.height - winArgs.y + frame.size.height - winArgs.height;
+ } else {
+ frame.origin.y = screenFrame.size.height - winArgs.y;
+ }
+ }
+
+ if (winArgs.widthSet) {
+ frame.size.width = winArgs.width;
+ }
+
+ if (winArgs.heightSet) {
+ frame.size.height = winArgs.height;
+ }
+
+ [bridge setWindowFrame:frame];
+ }
+
+ [[[bridge window] windowController] showWindow:nil];
+
// We can't return a KHTMLPart in all cases, because the new window might not even
// have HTML in it. And we don't create the KHTMLPart until we become "committed".
// So it's better not to try to return the KHTMLPart, and no callers currently need it.
diff --git a/WebCore/kwq/KWQKPartsBrowserExtension.h b/WebCore/kwq/KWQKPartsBrowserExtension.h
index 7ac2dad..5a37f89 100644
--- a/WebCore/kwq/KWQKPartsBrowserExtension.h
+++ b/WebCore/kwq/KWQKPartsBrowserExtension.h
@@ -58,6 +58,7 @@ struct WindowArgs {
bool menuBarVisible;
bool statusBarVisible;
bool toolBarsVisible;
+ bool scrollbarsVisible;
bool resizable;
bool fullscreen;
bool xSet;
@@ -65,7 +66,7 @@ struct WindowArgs {
bool widthSet;
bool heightSet;
- 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) { }
+ WindowArgs() : x(0), y(0), width(0), height(0), menuBarVisible(false), statusBarVisible(true), toolBarsVisible(true), scrollbarsVisible(true), resizable(true), fullscreen(true), xSet(false), ySet(false), widthSet(false), heightSet(false) { }
};
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 4b3190c..41fe9f4 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -109,6 +109,14 @@ typedef khtml::RenderPart KHTMLRenderPart;
allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
- (WebCoreBridge *)openNewWindowWithURL:(NSURL *)URL;
+- (BOOL)areToolbarsVisisble;
+- (void)setToolbarsVisible:(BOOL)visible;
+- (BOOL)isStatusBarVisisble;
+- (void)setStatusBarVisible:(BOOL)visible;
+- (BOOL)areScrollbarsVisible;
+- (void)setScrollbarsVisible:(BOOL)visible;
+- (NSWindow *)window;
+- (void)setWindowFrame:(NSRect)frame;
- (IFURLHandle *)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL;
diff --git a/WebCore/kwq/kparts/browserextension.h b/WebCore/kwq/kparts/browserextension.h
index 7ac2dad..5a37f89 100644
--- a/WebCore/kwq/kparts/browserextension.h
+++ b/WebCore/kwq/kparts/browserextension.h
@@ -58,6 +58,7 @@ struct WindowArgs {
bool menuBarVisible;
bool statusBarVisible;
bool toolBarsVisible;
+ bool scrollbarsVisible;
bool resizable;
bool fullscreen;
bool xSet;
@@ -65,7 +66,7 @@ struct WindowArgs {
bool widthSet;
bool heightSet;
- 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) { }
+ WindowArgs() : x(0), y(0), width(0), height(0), menuBarVisible(false), statusBarVisible(true), toolBarsVisible(true), scrollbarsVisible(true), resizable(true), fullscreen(true), xSet(false), ySet(false), widthSet(false), heightSet(false) { }
};
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index cfcabda..2159c3b 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,35 @@
+2002-06-29 Maciej Stachowiak <mjs at apple.com>
+
+ WebKit part of fix for:
+
+ Radar 2942074 - JavaScript size, positioning and feature
+ parameters to window.open are ignored
+
+ Also, renamed IFScriptContextHandler protocol to IFWindowContext,
+ and made it a settable handler like the others rather than
+ something implemented by the controller, so it can be used w/o
+ subclassing.
+
+ * WebCoreSupport.subproj/IFWebCoreBridge.mm:
+ (-[IFWebCoreBridge openNewWindowWithURL:]): Forward to the WindowContext.
+ (-[IFWebCoreBridge areToolbarsVisisble]): Likewise.
+ (-[IFWebCoreBridge setToolbarsVisible:]): Likewise.
+ (-[IFWebCoreBridge areScrollbarsVisible]): Likewise.
+ (-[IFWebCoreBridge setScrollbarsVisible:]): Likewise.
+ (-[IFWebCoreBridge isStatusBarVisisble]): Likewise.
+ (-[IFWebCoreBridge setStatusBarVisible:]): Likewise.
+ (-[IFWebCoreBridge setWindowFrame:]): Likewise.
+ (-[IFWebCoreBridge window]): Likewise.
+ * WebView.subproj/IFWebController.h:
+ * WebView.subproj/IFWebController.mm:
+ (-[IFWebController setWindowContext:]): Setter for new WindowContext handler
+ (-[IFWebController windowContext]): Likewise.
+ * WebView.subproj/IFWebControllerPrivate.h:
+ * WebView.subproj/IFWebControllerPrivate.mm:
+ (-[IFWebControllerPrivate dealloc]): Release window context.
+ * WebView.subproj/IFWebFrame.mm:
+ (-[IFWebFrame frameNamed:]): Open new windows via WindowContext.
+
2002-06-28 Darin Adler <darin at apple.com>
* WebCoreSupport.subproj/IFImageRenderer.h: Renamed statusOfCache to
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index cfcabda..2159c3b 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,35 @@
+2002-06-29 Maciej Stachowiak <mjs at apple.com>
+
+ WebKit part of fix for:
+
+ Radar 2942074 - JavaScript size, positioning and feature
+ parameters to window.open are ignored
+
+ Also, renamed IFScriptContextHandler protocol to IFWindowContext,
+ and made it a settable handler like the others rather than
+ something implemented by the controller, so it can be used w/o
+ subclassing.
+
+ * WebCoreSupport.subproj/IFWebCoreBridge.mm:
+ (-[IFWebCoreBridge openNewWindowWithURL:]): Forward to the WindowContext.
+ (-[IFWebCoreBridge areToolbarsVisisble]): Likewise.
+ (-[IFWebCoreBridge setToolbarsVisible:]): Likewise.
+ (-[IFWebCoreBridge areScrollbarsVisible]): Likewise.
+ (-[IFWebCoreBridge setScrollbarsVisible:]): Likewise.
+ (-[IFWebCoreBridge isStatusBarVisisble]): Likewise.
+ (-[IFWebCoreBridge setStatusBarVisible:]): Likewise.
+ (-[IFWebCoreBridge setWindowFrame:]): Likewise.
+ (-[IFWebCoreBridge window]): Likewise.
+ * WebView.subproj/IFWebController.h:
+ * WebView.subproj/IFWebController.mm:
+ (-[IFWebController setWindowContext:]): Setter for new WindowContext handler
+ (-[IFWebController windowContext]): Likewise.
+ * WebView.subproj/IFWebControllerPrivate.h:
+ * WebView.subproj/IFWebControllerPrivate.mm:
+ (-[IFWebControllerPrivate dealloc]): Release window context.
+ * WebView.subproj/IFWebFrame.mm:
+ (-[IFWebFrame frameNamed:]): Open new windows via WindowContext.
+
2002-06-28 Darin Adler <darin at apple.com>
* WebCoreSupport.subproj/IFImageRenderer.h: Renamed statusOfCache to
diff --git a/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm b/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
index 7063b93..91b96a9 100644
--- a/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
+++ b/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
@@ -89,7 +89,7 @@
- (WebCoreBridge *)openNewWindowWithURL:(NSURL *)url
{
- IFWebController *newController = [[dataSource controller] openNewWindowWithURL:url];
+ IFWebController *newController = [[[dataSource controller] windowContext] openNewWindowWithURL:url];
IFWebDataSource *newDataSource;
newDataSource = [[newController mainFrame] provisionalDataSource];
@@ -99,6 +99,47 @@
return nil;
}
+- (BOOL)areToolbarsVisisble
+{
+ return [[[dataSource controller] windowContext] areToolbarsVisible];
+}
+
+- (void)setToolbarsVisible:(BOOL)visible
+{
+ [[[dataSource controller] windowContext] setToolbarsVisible:visible];
+}
+
+- (BOOL)areScrollbarsVisible
+{
+ return [[[dataSource webFrame] webView] allowsScrolling];
+}
+
+- (void)setScrollbarsVisible:(BOOL)visible
+{
+ return [[[dataSource webFrame] webView] setAllowsScrolling:visible];
+}
+
+- (BOOL)isStatusBarVisisble
+{
+ return [[[dataSource controller] windowContext] isStatusBarVisible];
+}
+
+- (void)setStatusBarVisible:(BOOL)visible
+{
+ [[[dataSource controller] windowContext] setStatusBarVisible:visible];
+}
+
+- (void)setWindowFrame:(NSRect)frame
+{
+ [[[dataSource controller] windowContext] setFrame:frame];
+}
+
+
+- (NSWindow *)window
+{
+ return [[[dataSource controller] windowContext] window];
+}
+
- (void)setTitle:(NSString *)title
{
WEBKIT_ASSERT(dataSource);
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 7063b93..91b96a9 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -89,7 +89,7 @@
- (WebCoreBridge *)openNewWindowWithURL:(NSURL *)url
{
- IFWebController *newController = [[dataSource controller] openNewWindowWithURL:url];
+ IFWebController *newController = [[[dataSource controller] windowContext] openNewWindowWithURL:url];
IFWebDataSource *newDataSource;
newDataSource = [[newController mainFrame] provisionalDataSource];
@@ -99,6 +99,47 @@
return nil;
}
+- (BOOL)areToolbarsVisisble
+{
+ return [[[dataSource controller] windowContext] areToolbarsVisible];
+}
+
+- (void)setToolbarsVisible:(BOOL)visible
+{
+ [[[dataSource controller] windowContext] setToolbarsVisible:visible];
+}
+
+- (BOOL)areScrollbarsVisible
+{
+ return [[[dataSource webFrame] webView] allowsScrolling];
+}
+
+- (void)setScrollbarsVisible:(BOOL)visible
+{
+ return [[[dataSource webFrame] webView] setAllowsScrolling:visible];
+}
+
+- (BOOL)isStatusBarVisisble
+{
+ return [[[dataSource controller] windowContext] isStatusBarVisible];
+}
+
+- (void)setStatusBarVisible:(BOOL)visible
+{
+ [[[dataSource controller] windowContext] setStatusBarVisible:visible];
+}
+
+- (void)setWindowFrame:(NSRect)frame
+{
+ [[[dataSource controller] windowContext] setFrame:frame];
+}
+
+
+- (NSWindow *)window
+{
+ return [[[dataSource controller] windowContext] window];
+}
+
- (void)setTitle:(NSString *)title
{
WEBKIT_ASSERT(dataSource);
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index 1c620ed..ba5b9ce 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -102,22 +102,33 @@ typedef enum {
/*
=============================================================================
- A class that implements IFScriptContextHandler provides all the state information
- that may be used by Javascript (AppleScript?).
+ A class that implements IFWindowContext provides window-related methods
+ that may be used by Javascript, plugins and other aspects of web pages.
=============================================================================
*/
- at protocol IFScriptContextHandler <NSObject>
+ at protocol IFWindowContext <NSObject>
-// setStatusText and statusText are used by Javascript's status bar text methods.
+- (IFWebController *)openNewWindowWithURL:(NSURL *)url;
+
+#if 0
- (void)setStatusText: (NSString *)text forDataSource: (IFWebDataSource *)dataSource;
- (NSString *)statusTextForDataSource: (IFWebDataSource *)dataSource;
+#endif
-// Need API for things like window size and position, window ids,
-// screen goemetry. Essentially all the 'view' items that are
+- (BOOL)areToolbarsVisible;
+- (void)setToolbarsVisible:(BOOL)visible;
+
+- (BOOL)isStatusBarVisible;
+- (void)setStatusBarVisible:(BOOL)visible;
+
+// Even though a caller could set the frame directly using the NSWindow,
+// this method is provided so implementors of this protocol can do special
+// things on programmatic move/resize, like avoiding autosaving of the size.
+- (void)setFrame:(NSRect)frame;
+
+- (NSWindow *)window;
-// FIXME: not strictly a scripting issue
-- (IFWebController *)openNewWindowWithURL:(NSURL *)url;
@end
/*
@@ -130,7 +141,7 @@ typedef enum {
=============================================================================
*/
- at interface IFWebController : NSObject <IFScriptContextHandler>
+ at interface IFWebController : NSObject
{
@private
IFWebControllerPrivate *_private;
@@ -142,6 +153,9 @@ typedef enum {
// Designated initializer.
- initWithView: (IFWebView *)view provisionalDataSource: (IFWebDataSource *)dataSource;
+- (void)setWindowContext: (id<IFWindowContext>)context;
+- (id<IFWindowContext>)windowContext;
+
- (void)setResourceProgressHandler: (id<IFResourceProgressHandler>)handler;
- (id<IFResourceProgressHandler>)resourceProgressHandler;
diff --git a/WebKit/WebView.subproj/IFWebController.mm b/WebKit/WebView.subproj/IFWebController.mm
index 6ba18bd..109eae0 100644
--- a/WebKit/WebView.subproj/IFWebController.mm
+++ b/WebKit/WebView.subproj/IFWebController.mm
@@ -73,29 +73,17 @@
}
-
-// ---------------------------------------------------------------------
-// IFScriptContextHandler
-// ---------------------------------------------------------------------
-- (void)setStatusText: (NSString *)text forDataSource: (IFWebDataSource *)dataSource
+- (void)setWindowContext: (id<IFWindowContext>)context
{
- [NSException raise:IFMethodNotYetImplemented format:@"IFWebController::setStatusText:forDataSource: is not implemented"];
+ [_private->windowContext autorelease];
+ _private->windowContext = [context retain];
}
-
-- (NSString *)statusTextForDataSource: (IFWebDataSource *)dataSource
+- (id<IFWindowContext>)windowContext
{
- [NSException raise:IFMethodNotYetImplemented format:@"IFWebController::statusTextForDataSource: is not implemented"];
- return nil;
+ return _private->windowContext;
}
-
-- (IFWebController *)openNewWindowWithURL:(NSURL *)url
-{
- return nil;
-}
-
-
- (void)setResourceProgressHandler: (id<IFResourceProgressHandler>)handler
{
[_private->resourceProgressHandler autorelease];
diff --git a/WebKit/WebView.subproj/IFWebControllerPrivate.h b/WebKit/WebView.subproj/IFWebControllerPrivate.h
index bc7cf25..bc31c42 100644
--- a/WebKit/WebView.subproj/IFWebControllerPrivate.h
+++ b/WebKit/WebView.subproj/IFWebControllerPrivate.h
@@ -12,6 +12,7 @@
@interface IFWebControllerPrivate : NSObject
{
IFWebFrame *mainFrame;
+ id<IFWindowContext> windowContext;
id<IFResourceProgressHandler> resourceProgressHandler;
id<IFWebControllerPolicyHandler> policyHandler;
}
diff --git a/WebKit/WebView.subproj/IFWebControllerPrivate.mm b/WebKit/WebView.subproj/IFWebControllerPrivate.mm
index 94edac1..2839b55 100644
--- a/WebKit/WebView.subproj/IFWebControllerPrivate.mm
+++ b/WebKit/WebView.subproj/IFWebControllerPrivate.mm
@@ -53,6 +53,7 @@
[mainFrame reset];
[mainFrame autorelease];
+ [windowContext autorelease];
[resourceProgressHandler autorelease];
[policyHandler autorelease];
diff --git a/WebKit/WebView.subproj/IFWebFrame.mm b/WebKit/WebView.subproj/IFWebFrame.mm
index ae986fd..5becb9b 100644
--- a/WebKit/WebView.subproj/IFWebFrame.mm
+++ b/WebKit/WebView.subproj/IFWebFrame.mm
@@ -263,7 +263,7 @@
}
else if ([name isEqualToString:@"_blank"]){
- IFWebController *newController = [[self controller] openNewWindowWithURL: nil];
+ IFWebController *newController = [[[self controller] windowContext] openNewWindowWithURL: nil];
return [newController mainFrame];
}
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index 1c620ed..ba5b9ce 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -102,22 +102,33 @@ typedef enum {
/*
=============================================================================
- A class that implements IFScriptContextHandler provides all the state information
- that may be used by Javascript (AppleScript?).
+ A class that implements IFWindowContext provides window-related methods
+ that may be used by Javascript, plugins and other aspects of web pages.
=============================================================================
*/
- at protocol IFScriptContextHandler <NSObject>
+ at protocol IFWindowContext <NSObject>
-// setStatusText and statusText are used by Javascript's status bar text methods.
+- (IFWebController *)openNewWindowWithURL:(NSURL *)url;
+
+#if 0
- (void)setStatusText: (NSString *)text forDataSource: (IFWebDataSource *)dataSource;
- (NSString *)statusTextForDataSource: (IFWebDataSource *)dataSource;
+#endif
-// Need API for things like window size and position, window ids,
-// screen goemetry. Essentially all the 'view' items that are
+- (BOOL)areToolbarsVisible;
+- (void)setToolbarsVisible:(BOOL)visible;
+
+- (BOOL)isStatusBarVisible;
+- (void)setStatusBarVisible:(BOOL)visible;
+
+// Even though a caller could set the frame directly using the NSWindow,
+// this method is provided so implementors of this protocol can do special
+// things on programmatic move/resize, like avoiding autosaving of the size.
+- (void)setFrame:(NSRect)frame;
+
+- (NSWindow *)window;
-// FIXME: not strictly a scripting issue
-- (IFWebController *)openNewWindowWithURL:(NSURL *)url;
@end
/*
@@ -130,7 +141,7 @@ typedef enum {
=============================================================================
*/
- at interface IFWebController : NSObject <IFScriptContextHandler>
+ at interface IFWebController : NSObject
{
@private
IFWebControllerPrivate *_private;
@@ -142,6 +153,9 @@ typedef enum {
// Designated initializer.
- initWithView: (IFWebView *)view provisionalDataSource: (IFWebDataSource *)dataSource;
+- (void)setWindowContext: (id<IFWindowContext>)context;
+- (id<IFWindowContext>)windowContext;
+
- (void)setResourceProgressHandler: (id<IFResourceProgressHandler>)handler;
- (id<IFResourceProgressHandler>)resourceProgressHandler;
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index 6ba18bd..109eae0 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -73,29 +73,17 @@
}
-
-// ---------------------------------------------------------------------
-// IFScriptContextHandler
-// ---------------------------------------------------------------------
-- (void)setStatusText: (NSString *)text forDataSource: (IFWebDataSource *)dataSource
+- (void)setWindowContext: (id<IFWindowContext>)context
{
- [NSException raise:IFMethodNotYetImplemented format:@"IFWebController::setStatusText:forDataSource: is not implemented"];
+ [_private->windowContext autorelease];
+ _private->windowContext = [context retain];
}
-
-- (NSString *)statusTextForDataSource: (IFWebDataSource *)dataSource
+- (id<IFWindowContext>)windowContext
{
- [NSException raise:IFMethodNotYetImplemented format:@"IFWebController::statusTextForDataSource: is not implemented"];
- return nil;
+ return _private->windowContext;
}
-
-- (IFWebController *)openNewWindowWithURL:(NSURL *)url
-{
- return nil;
-}
-
-
- (void)setResourceProgressHandler: (id<IFResourceProgressHandler>)handler
{
[_private->resourceProgressHandler autorelease];
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.h b/WebKit/WebView.subproj/WebControllerPrivate.h
index bc7cf25..bc31c42 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.h
+++ b/WebKit/WebView.subproj/WebControllerPrivate.h
@@ -12,6 +12,7 @@
@interface IFWebControllerPrivate : NSObject
{
IFWebFrame *mainFrame;
+ id<IFWindowContext> windowContext;
id<IFResourceProgressHandler> resourceProgressHandler;
id<IFWebControllerPolicyHandler> policyHandler;
}
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index 94edac1..2839b55 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -53,6 +53,7 @@
[mainFrame reset];
[mainFrame autorelease];
+ [windowContext autorelease];
[resourceProgressHandler autorelease];
[policyHandler autorelease];
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index ae986fd..5becb9b 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -263,7 +263,7 @@
}
else if ([name isEqualToString:@"_blank"]){
- IFWebController *newController = [[self controller] openNewWindowWithURL: nil];
+ IFWebController *newController = [[[self controller] windowContext] openNewWindowWithURL: nil];
return [newController mainFrame];
}
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 1c620ed..ba5b9ce 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -102,22 +102,33 @@ typedef enum {
/*
=============================================================================
- A class that implements IFScriptContextHandler provides all the state information
- that may be used by Javascript (AppleScript?).
+ A class that implements IFWindowContext provides window-related methods
+ that may be used by Javascript, plugins and other aspects of web pages.
=============================================================================
*/
- at protocol IFScriptContextHandler <NSObject>
+ at protocol IFWindowContext <NSObject>
-// setStatusText and statusText are used by Javascript's status bar text methods.
+- (IFWebController *)openNewWindowWithURL:(NSURL *)url;
+
+#if 0
- (void)setStatusText: (NSString *)text forDataSource: (IFWebDataSource *)dataSource;
- (NSString *)statusTextForDataSource: (IFWebDataSource *)dataSource;
+#endif
-// Need API for things like window size and position, window ids,
-// screen goemetry. Essentially all the 'view' items that are
+- (BOOL)areToolbarsVisible;
+- (void)setToolbarsVisible:(BOOL)visible;
+
+- (BOOL)isStatusBarVisible;
+- (void)setStatusBarVisible:(BOOL)visible;
+
+// Even though a caller could set the frame directly using the NSWindow,
+// this method is provided so implementors of this protocol can do special
+// things on programmatic move/resize, like avoiding autosaving of the size.
+- (void)setFrame:(NSRect)frame;
+
+- (NSWindow *)window;
-// FIXME: not strictly a scripting issue
-- (IFWebController *)openNewWindowWithURL:(NSURL *)url;
@end
/*
@@ -130,7 +141,7 @@ typedef enum {
=============================================================================
*/
- at interface IFWebController : NSObject <IFScriptContextHandler>
+ at interface IFWebController : NSObject
{
@private
IFWebControllerPrivate *_private;
@@ -142,6 +153,9 @@ typedef enum {
// Designated initializer.
- initWithView: (IFWebView *)view provisionalDataSource: (IFWebDataSource *)dataSource;
+- (void)setWindowContext: (id<IFWindowContext>)context;
+- (id<IFWindowContext>)windowContext;
+
- (void)setResourceProgressHandler: (id<IFResourceProgressHandler>)handler;
- (id<IFResourceProgressHandler>)resourceProgressHandler;
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 6ba18bd..109eae0 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -73,29 +73,17 @@
}
-
-// ---------------------------------------------------------------------
-// IFScriptContextHandler
-// ---------------------------------------------------------------------
-- (void)setStatusText: (NSString *)text forDataSource: (IFWebDataSource *)dataSource
+- (void)setWindowContext: (id<IFWindowContext>)context
{
- [NSException raise:IFMethodNotYetImplemented format:@"IFWebController::setStatusText:forDataSource: is not implemented"];
+ [_private->windowContext autorelease];
+ _private->windowContext = [context retain];
}
-
-- (NSString *)statusTextForDataSource: (IFWebDataSource *)dataSource
+- (id<IFWindowContext>)windowContext
{
- [NSException raise:IFMethodNotYetImplemented format:@"IFWebController::statusTextForDataSource: is not implemented"];
- return nil;
+ return _private->windowContext;
}
-
-- (IFWebController *)openNewWindowWithURL:(NSURL *)url
-{
- return nil;
-}
-
-
- (void)setResourceProgressHandler: (id<IFResourceProgressHandler>)handler
{
[_private->resourceProgressHandler autorelease];
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index bc7cf25..bc31c42 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -12,6 +12,7 @@
@interface IFWebControllerPrivate : NSObject
{
IFWebFrame *mainFrame;
+ id<IFWindowContext> windowContext;
id<IFResourceProgressHandler> resourceProgressHandler;
id<IFWebControllerPolicyHandler> policyHandler;
}
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 94edac1..2839b55 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -53,6 +53,7 @@
[mainFrame reset];
[mainFrame autorelease];
+ [windowContext autorelease];
[resourceProgressHandler autorelease];
[policyHandler autorelease];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list