[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 06:18:43 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit ff1f9adedb96754a023ba80358be06e171416cdf
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jun 14 19:58:07 2002 +0000
* WebView.subproj/IFHTMLView.mm:
(-[IFHTMLView initWithFrame:]):
Added notification so we can intelligently add/remove
mouse move observation when the window becomes/resigns
main. Also added window close observation so we can
clean up other observers.
(-[IFHTMLView viewWillStartLiveResize]):\
Backed out removal of scroll bars during resize.
(-[IFHTMLView viewDidEndLiveResize]):
Backed out removal of scroll bars during resize.
(-[IFHTMLView windowWillClose:]):
Clean up observers.
(-[IFHTMLView windowDidBecomeMain:]):
Add mouse move observer.
(-[IFHTMLView windowDidResignMain:]):
Remove mouse move observer.
(-[IFHTMLView mouseMovedNotification:]):
Only pay attention to mouse moves for this window.
* WebView.subproj/IFImageView.m:
(-[IFImageView layout]):
Removed unnecessary scroll view setDrawBackground calls.
* WebView.subproj/IFWebFramePrivate.mm:
(-[IFWebFrame _setState:]):
Added calls to scroll view setDrawBackground when the view
rect is valid.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4bc9592..9de8306 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,31 @@
+2002-06-14 Richard Williamson <rjw at apple.com>
+
+ * WebView.subproj/IFHTMLView.mm:
+ (-[IFHTMLView initWithFrame:]):
+ Added notification so we can intelligently add/remove
+ mouse move observation when the window becomes/resigns
+ main. Also added window close observation so we can
+ clean up other observers.
+ (-[IFHTMLView viewWillStartLiveResize]):\
+ Backed out removal of scroll bars during resize.
+ (-[IFHTMLView viewDidEndLiveResize]):
+ Backed out removal of scroll bars during resize.
+ (-[IFHTMLView windowWillClose:]):
+ Clean up observers.
+ (-[IFHTMLView windowDidBecomeMain:]):
+ Add mouse move observer.
+ (-[IFHTMLView windowDidResignMain:]):
+ Remove mouse move observer.
+ (-[IFHTMLView mouseMovedNotification:]):
+ Only pay attention to mouse moves for this window.
+ * WebView.subproj/IFImageView.m:
+ (-[IFImageView layout]):
+ Removed unnecessary scroll view setDrawBackground calls.
+ * WebView.subproj/IFWebFramePrivate.mm:
+ (-[IFWebFrame _setState:]):
+ Added calls to scroll view setDrawBackground when the view
+ rect is valid.
+
2002-06-14 Chris Blumenberg <cblu at apple.com>
Enabled displaying of text, images and RTF
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 4bc9592..9de8306 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,31 @@
+2002-06-14 Richard Williamson <rjw at apple.com>
+
+ * WebView.subproj/IFHTMLView.mm:
+ (-[IFHTMLView initWithFrame:]):
+ Added notification so we can intelligently add/remove
+ mouse move observation when the window becomes/resigns
+ main. Also added window close observation so we can
+ clean up other observers.
+ (-[IFHTMLView viewWillStartLiveResize]):\
+ Backed out removal of scroll bars during resize.
+ (-[IFHTMLView viewDidEndLiveResize]):
+ Backed out removal of scroll bars during resize.
+ (-[IFHTMLView windowWillClose:]):
+ Clean up observers.
+ (-[IFHTMLView windowDidBecomeMain:]):
+ Add mouse move observer.
+ (-[IFHTMLView windowDidResignMain:]):
+ Remove mouse move observer.
+ (-[IFHTMLView mouseMovedNotification:]):
+ Only pay attention to mouse moves for this window.
+ * WebView.subproj/IFImageView.m:
+ (-[IFImageView layout]):
+ Removed unnecessary scroll view setDrawBackground calls.
+ * WebView.subproj/IFWebFramePrivate.mm:
+ (-[IFWebFrame _setState:]):
+ Added calls to scroll view setDrawBackground when the view
+ rect is valid.
+
2002-06-14 Chris Blumenberg <cblu at apple.com>
Enabled displaying of text, images and RTF
diff --git a/WebKit/WebView.subproj/IFHTMLView.mm b/WebKit/WebView.subproj/IFHTMLView.mm
index d8fd936..dfce461 100644
--- a/WebKit/WebView.subproj/IFHTMLView.mm
+++ b/WebKit/WebView.subproj/IFHTMLView.mm
@@ -42,9 +42,21 @@
_private->canDragTo = YES;
_private->canDragFrom = YES;
- [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
+ // We added add/remove this view as a mouse moved observer when it's window becomes/resigns main.
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowDidBecomeMain:) name: NSWindowDidBecomeMainNotification object: nil];
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowDidResignMain:) name: NSWindowDidResignMainNotification object: nil];
+
+ // Add this view initially as a mouse move observer. Subsequently we will add/remove this view
+ // when the window becomes/resigns main.
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseMovedNotification:) name: NSMouseMovedNotification object: nil];
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
+
+ // We remove this view as an observer from all window notifications when the window
+ // is closed. This may be redundant, but ensures that the view has no outstanding
+ // references.
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowWillClose:) name: NSWindowWillCloseNotification object: nil];
+
return self;
}
@@ -395,21 +407,31 @@
- (void)viewWillStartLiveResize
{
- id scrollView = [[self superview] superview];
- _private->liveAllowsScrolling = [scrollView allowsScrolling];
- [scrollView setAllowsScrolling: NO];
+ //id scrollView = [[self superview] superview];
+ //_private->liveAllowsScrolling = [scrollView allowsScrolling];
+ //[scrollView setAllowsScrolling: NO];
}
- (void)viewDidEndLiveResize
{
id scrollView = [[self superview] superview];
- [scrollView setAllowsScrolling: _private->liveAllowsScrolling];
+ //[scrollView setAllowsScrolling: _private->liveAllowsScrolling];
[self setNeedsLayout: YES];
[self setNeedsDisplay: YES];
[scrollView updateScrollers];
}
+- (void)windowWillClose: (NSNotification *)notification
+{
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResizeNotification object: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowWillCloseNotification object: nil];
+}
+
+
- (void)windowResized: (NSNotification *)notification
{
if ([notification object] == [self window]){
@@ -419,6 +441,21 @@
}
+- (void)windowDidBecomeMain: (NSNotification *)notification
+{
+ if ([notification object] == [self window])
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseMovedNotification:) name: NSMouseMovedNotification object: nil];
+
+}
+
+
+- (void)windowDidResignMain: (NSNotification *)notification
+{
+ if ([notification object] == [self window])
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
+}
+
+
- (void)_addModifiers:(unsigned)modifiers toState:(int *)state
{
if (modifiers & NSControlKeyMask)
@@ -498,15 +535,18 @@
{
NSEvent *event = [(NSDictionary *)[notification userInfo] objectForKey: @"NSEvent"];
NSPoint p = [event locationInWindow];
-
+ NSWindow *thisWindow = [self window];
+
// 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) {
- widget->viewportMouseMoveEvent(&kEvent);
- }
+ if ([thisWindow isMainWindow] &&
+ [[[notification userInfo] objectForKey: @"NSEvent"] window] == thisWindow &&
+ [[thisWindow contentView] hitTest:p] == self) {
+ QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), 0, 0);
+ KHTMLView *widget = _private->widget;
+ if (widget != 0l) {
+ widget->viewportMouseMoveEvent(&kEvent);
+ }
}
}
diff --git a/WebKit/WebView.subproj/IFImageView.m b/WebKit/WebView.subproj/IFImageView.m
index fbb416c..050e5d7 100644
--- a/WebKit/WebView.subproj/IFImageView.m
+++ b/WebKit/WebView.subproj/IFImageView.m
@@ -42,13 +42,6 @@
}
}
-- (void)removeFromSuperview
-{
- NSView *scrollView = [self _IF_superviewWithName:@"IFDynamicScrollBarsView"];
- [(NSScrollView *)scrollView setDrawsBackground:NO];
- [super removeFromSuperview];
-}
-
- (void)provisionalDataSourceChanged:(IFWebDataSource *)dataSource
{
@@ -74,13 +67,10 @@
IFImageRenderer *image = [representation image];
if(image){
- NSView *scrollView = [self _IF_superviewWithName:@"IFDynamicScrollBarsView"];
NSSize imageSize = [image size];
[self setFrameSize:imageSize];
[image setFlipped:YES];
- [(NSScrollView *)scrollView setDrawsBackground:YES];
- [(NSScrollView *)scrollView setBackgroundColor:[NSColor whiteColor]];
}
}
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index d0079d3..a9b38b8 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -287,6 +287,14 @@ static const char * const stateNames[6] = {
[[NSNotificationCenter defaultCenter] postNotificationName:IFFrameStateChangedNotification object:self userInfo:userInfo];
_private->state = newState;
+
+ if (_private->state == IFWEBFRAMESTATE_PROVISIONAL){
+ [[[self view] frameScrollView] setDrawsBackground: NO];
+ }
+
+ if (_private->state == IFWEBFRAMESTATE_COMPLETE){
+ [[[self view] frameScrollView] setDrawsBackground: YES];
+ }
}
- (void)_isLoadComplete
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index d0079d3..a9b38b8 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -287,6 +287,14 @@ static const char * const stateNames[6] = {
[[NSNotificationCenter defaultCenter] postNotificationName:IFFrameStateChangedNotification object:self userInfo:userInfo];
_private->state = newState;
+
+ if (_private->state == IFWEBFRAMESTATE_PROVISIONAL){
+ [[[self view] frameScrollView] setDrawsBackground: NO];
+ }
+
+ if (_private->state == IFWEBFRAMESTATE_COMPLETE){
+ [[[self view] frameScrollView] setDrawsBackground: YES];
+ }
}
- (void)_isLoadComplete
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index d8fd936..dfce461 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -42,9 +42,21 @@
_private->canDragTo = YES;
_private->canDragFrom = YES;
- [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
+ // We added add/remove this view as a mouse moved observer when it's window becomes/resigns main.
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowDidBecomeMain:) name: NSWindowDidBecomeMainNotification object: nil];
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowDidResignMain:) name: NSWindowDidResignMainNotification object: nil];
+
+ // Add this view initially as a mouse move observer. Subsequently we will add/remove this view
+ // when the window becomes/resigns main.
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseMovedNotification:) name: NSMouseMovedNotification object: nil];
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
+
+ // We remove this view as an observer from all window notifications when the window
+ // is closed. This may be redundant, but ensures that the view has no outstanding
+ // references.
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowWillClose:) name: NSWindowWillCloseNotification object: nil];
+
return self;
}
@@ -395,21 +407,31 @@
- (void)viewWillStartLiveResize
{
- id scrollView = [[self superview] superview];
- _private->liveAllowsScrolling = [scrollView allowsScrolling];
- [scrollView setAllowsScrolling: NO];
+ //id scrollView = [[self superview] superview];
+ //_private->liveAllowsScrolling = [scrollView allowsScrolling];
+ //[scrollView setAllowsScrolling: NO];
}
- (void)viewDidEndLiveResize
{
id scrollView = [[self superview] superview];
- [scrollView setAllowsScrolling: _private->liveAllowsScrolling];
+ //[scrollView setAllowsScrolling: _private->liveAllowsScrolling];
[self setNeedsLayout: YES];
[self setNeedsDisplay: YES];
[scrollView updateScrollers];
}
+- (void)windowWillClose: (NSNotification *)notification
+{
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResignMainNotification object: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowDidResizeNotification object: nil];
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSWindowWillCloseNotification object: nil];
+}
+
+
- (void)windowResized: (NSNotification *)notification
{
if ([notification object] == [self window]){
@@ -419,6 +441,21 @@
}
+- (void)windowDidBecomeMain: (NSNotification *)notification
+{
+ if ([notification object] == [self window])
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mouseMovedNotification:) name: NSMouseMovedNotification object: nil];
+
+}
+
+
+- (void)windowDidResignMain: (NSNotification *)notification
+{
+ if ([notification object] == [self window])
+ [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
+}
+
+
- (void)_addModifiers:(unsigned)modifiers toState:(int *)state
{
if (modifiers & NSControlKeyMask)
@@ -498,15 +535,18 @@
{
NSEvent *event = [(NSDictionary *)[notification userInfo] objectForKey: @"NSEvent"];
NSPoint p = [event locationInWindow];
-
+ NSWindow *thisWindow = [self window];
+
// 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) {
- widget->viewportMouseMoveEvent(&kEvent);
- }
+ if ([thisWindow isMainWindow] &&
+ [[[notification userInfo] objectForKey: @"NSEvent"] window] == thisWindow &&
+ [[thisWindow contentView] hitTest:p] == self) {
+ QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), 0, 0);
+ KHTMLView *widget = _private->widget;
+ if (widget != 0l) {
+ widget->viewportMouseMoveEvent(&kEvent);
+ }
}
}
diff --git a/WebKit/WebView.subproj/WebImageView.m b/WebKit/WebView.subproj/WebImageView.m
index fbb416c..050e5d7 100644
--- a/WebKit/WebView.subproj/WebImageView.m
+++ b/WebKit/WebView.subproj/WebImageView.m
@@ -42,13 +42,6 @@
}
}
-- (void)removeFromSuperview
-{
- NSView *scrollView = [self _IF_superviewWithName:@"IFDynamicScrollBarsView"];
- [(NSScrollView *)scrollView setDrawsBackground:NO];
- [super removeFromSuperview];
-}
-
- (void)provisionalDataSourceChanged:(IFWebDataSource *)dataSource
{
@@ -74,13 +67,10 @@
IFImageRenderer *image = [representation image];
if(image){
- NSView *scrollView = [self _IF_superviewWithName:@"IFDynamicScrollBarsView"];
NSSize imageSize = [image size];
[self setFrameSize:imageSize];
[image setFlipped:YES];
- [(NSScrollView *)scrollView setDrawsBackground:YES];
- [(NSScrollView *)scrollView setBackgroundColor:[NSColor whiteColor]];
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list