[webkit-changes] cvs commit: WebKit/WebView.subproj WebHTMLView.m
Timothy
thatcher at opensource.apple.com
Mon Dec 12 16:36:02 PST 2005
thatcher 05/12/12 16:36:01
Modified: . Tag: Safari-1-3-branch ChangeLog
WebView.subproj Tag: Safari-1-3-branch WebHTMLView.m
Log:
Merged fix from TOT to Safari-1-3-branch
2005-12-06 David Harrison <harrison at apple.com>
Reviewed by Darin.
- fix <rdar://problem/4365308> Glendale Regression: Floating dictionary doesn't work well in Safari text areas/fields
Add use of NSAccessibilityHitTest to the list of exceptions.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView hitTest:]): check for NSFlagsChanged event.
Revision Changes Path
No revision
No revision
1.3120.2.24 +35 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3120.2.23
retrieving revision 1.3120.2.24
diff -u -r1.3120.2.23 -r1.3120.2.24
--- ChangeLog 4 Dec 2005 22:01:24 -0000 1.3120.2.23
+++ ChangeLog 13 Dec 2005 00:35:44 -0000 1.3120.2.24
@@ -1,3 +1,38 @@
+2005-12-12 Timothy Hatcher <timothy at apple.com>
+
+ Merged fix from TOT to Safari-1-3-branch
+
+ 2005-12-06 David Harrison <harrison at apple.com>
+
+ Reviewed by Darin.
+
+ - fix <rdar://problem/4365308> Glendale Regression: Floating dictionary doesn't work well in Safari text areas/fields
+
+ Add use of NSAccessibilityHitTest to the list of exceptions.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView hitTest:]): check for NSFlagsChanged event.
+
+2005-12-01 Timothy Hatcher <timothy at apple.com>
+
+ Merged fix from TOT to Safari-1-3-branch
+
+ 2005-12-01 Darin Adler <darin at apple.com>
+
+ Reviewed by Vicki.
+
+ - fix <rdar://problem/4349721> Regression: Hovering over menu item doesn't highlight menu item or
+ mousing up on menu item in applet does not open URL in new window at smartmoney.com
+
+ Since Java depends on doing a hit test inside it's mouse moved handling, let hit testing on Java
+ applets go through the standard NSView code path. Since this should only happen for Java, add a global
+ so that we can Use our own WebHTMLView hit testing when calling from _updateMouseoverWithEvent.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView _hitViewForEvent:]): rename forceRealHitTest to forceNSViewHitTest
+ (-[WebHTMLView _updateMouseoverWithEvent:]): set global variable to force a WebHTMLView-style hit test from here
+ (-[WebHTMLView hitTest:]): perform the appropriate hit test based on global variables
+
=== WebKit-312.7 ===
2005-11-28 Timothy Hatcher <timothy at apple.com>
No revision
No revision
1.437.6.2 +42 -8 WebKit/WebView.subproj/WebHTMLView.m
Index: WebHTMLView.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebHTMLView.m,v
retrieving revision 1.437.6.1
retrieving revision 1.437.6.2
diff -u -r1.437.6.1 -r1.437.6.2
--- WebHTMLView.m 11 Nov 2005 05:12:48 -0000 1.437.6.1
+++ WebHTMLView.m 13 Dec 2005 00:35:59 -0000 1.437.6.2
@@ -148,7 +148,11 @@
forwardDeleteKeyAction
} WebDeletionAction;
-static BOOL forceRealHitTest = NO;
+// if YES, do the standard NSView hit test (which can't give the right result when HTML overlaps a view)
+static BOOL forceNSViewHitTest = NO;
+
+// if YES, do the "top WebHTMLView" it test (which we'd like to do all the time but can't because of Java requirements [see bug 4349721])
+static BOOL forceWebHTMLViewHitTest = NO;
// Used to avoid linking with ApplicationServices framework for _DCMDictionaryServiceWindowShow
void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
@@ -557,9 +561,9 @@
{
// Usually, we hack AK's hitTest method to catch all events at the topmost WebHTMLView.
// Callers of this method, however, want to query the deepest view instead.
- forceRealHitTest = YES;
+ forceNSViewHitTest = YES;
NSView *hitView = [[[self window] contentView] hitTest:[event locationInWindow]];
- forceRealHitTest = NO;
+ forceNSViewHitTest = NO;
return hitView;
}
@@ -841,15 +845,43 @@
- (NSView *)hitTest:(NSPoint)point
{
- // WebHTMLView objects handle all left mouse clicks for objects inside them.
- // That does not include left mouse clicks with the control key held down.
+ // WebHTMLView objects handle all events for objects inside them.
+ // To get those events, we prevent hit testing from AppKit.
+
+ // But there are four exceptions to this:
+ // 1) For right mouse clicks and control clicks we don't yet have an implementation
+ // that works for nested views, so we let the hit testing go through the
+ // standard NSView code path (needs to be fixed, see bug 4361618).
+ // 2) Java depends on doing a hit test inside it's mouse moved handling,
+ // so we let the hit testing go through the standard NSView code path
+ // when the current event is a mouse move (except when we are calling
+ // from _updateMouseoverWithEvent, so we have to use a global,
+ // forceWebHTMLViewHitTest, for that)
+ // 3) The acceptsFirstMouse: and shouldDelayWindowOrderingForEvent: methods
+ // both need to figure out which view to check with inside the WebHTMLView.
+ // They use a global to change the behavior of hitTest: so they can get the
+ // right view. The global is forceNSViewHitTest and the method they use to
+ // do the hit testing is _hitViewForEvent:. (But this does not work correctly
+ // when there is HTML overlapping the view, see bug 4361626)
+ // 4) NSAccessibilityHitTest relies on this for checking the cursor position.
+ // Our check for that is whether the event is NSFlagsChanged. This works
+ // for VoiceOver's cntl-opt-f5 command (move focus to item under cursor)
+ // and Dictionary's cmd-cntl-D (open dictionary popup for item under cursor).
+ // This is of course a hack.
+
BOOL captureHitsOnSubviews;
- if (forceRealHitTest) {
+ if (forceNSViewHitTest)
captureHitsOnSubviews = NO;
- } else {
+ else if (forceWebHTMLViewHitTest)
+ captureHitsOnSubviews = YES;
+ else {
NSEvent *event = [[self window] currentEvent];
- captureHitsOnSubviews = !([event type] == NSRightMouseDown || ([event type] == NSLeftMouseDown && ([event modifierFlags] & NSControlKeyMask) != 0));
+ captureHitsOnSubviews = !([event type] == NSMouseMoved
+ || [event type] == NSRightMouseDown
+ || ([event type] == NSLeftMouseDown && ([event modifierFlags] & NSControlKeyMask) != 0)
+ || [event type] == NSFlagsChanged);
}
+
if (!captureHitsOnSubviews)
return [super hitTest:point];
if ([[self superview] mouse:point inRect:[self frame]])
@@ -975,7 +1007,9 @@
- (void)_updateMouseoverWithEvent:(NSEvent *)event
{
WebHTMLView *view = nil;
+ forceWebHTMLViewHitTest = YES;
NSView *hitView = [[[event window] contentView] hitTest:[event locationInWindow]];
+ forceWebHTMLViewHitTest = NO;
if ([hitView isKindOfClass:[WebHTMLView class]])
view = (WebHTMLView *)hitView;
More information about the webkit-changes
mailing list