+2003-11-20 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by John
+
+ Fix for this bug:
+
+ <rdar://problem/3482159>: Tabbing to links gets "stuck" in "style switcher" on zeldman.com
+
+ * Misc.subproj/WebNSEventExtras.h: Added.
+ * Misc.subproj/WebNSEventExtras.m: Added.
+ (-[NSEvent _isTabKeyEvent]): New helper.
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView keyDown:]): Pass the key event to super unconditionally
+ if it is a tab key. This fixes the bug.
+
2003-11-19 John Sullivan <sullivan@apple.com>
- WebKit part of fix for:
--- /dev/null
+/*
+ WebNSEventExtras.m
+ Copyright (c) 2003, Apple, Inc. All rights reserved.
+*/
+
+#import <WebKit/WebNSEventExtras.h>
+
+@implementation NSEvent (WebExtras)
+
+-(BOOL)_isTabKeyEvent
+{
+ if ([self type] != NSKeyDown) {
+ return NO;
+ }
+
+ NSString *chars = [self charactersIgnoringModifiers];
+ if ([chars length] != 1)
+ return NO;
+
+ const unichar tabKey = 0x0009;
+ const unichar shiftTabKey = 0x0019;
+ unichar c = [chars characterAtIndex:0];
+ if (c != tabKey && c != shiftTabKey)
+ return NO;
+
+ return YES;
+}
+
+@end
BE26F18F05517E0800BFA0C3,
BECD142B0565830A005BB09C,
65A7D44B0568AB2600E70EF6,
+ BE887C01056D3A6E009BB3E7,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
65DA2609052CC18700A97B31,
BE26F19005517E0800BFA0C3,
BECD142C0565830A005BB09C,
+ BE887C02056D3A6E009BB3E7,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
9345DDB30365FFD0008635CE,
BECD14290565830A005BB09C,
BECD142A0565830A005BB09C,
+ BE887BFF056D3A6E009BB3E7,
+ BE887C00056D3A6E009BB3E7,
8398847A03426FB000BC5F5E,
8398847B03426FB000BC5F5E,
ED2B2474033A2DA800C1A526,
settings = {
};
};
+ BE887BFF056D3A6E009BB3E7 = {
+ expectedFileType = sourcecode.c.h;
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = WebNSEventExtras.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ BE887C00056D3A6E009BB3E7 = {
+ expectedFileType = sourcecode.c.objc;
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = WebNSEventExtras.m;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ BE887C01056D3A6E009BB3E7 = {
+ fileRef = BE887BFF056D3A6E009BB3E7;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ BE887C02056D3A6E009BB3E7 = {
+ fileRef = BE887C00056D3A6E009BB3E7;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
BECD14290565830A005BB09C = {
expectedFileType = sourcecode.c.h;
fileEncoding = 4;
#import <WebKit/WebImageRenderer.h>
#import <WebKit/WebKitNSStringExtras.h>
+#import <WebKit/WebNSEventExtras.h>
#import <WebKit/WebNSImageExtras.h>
#import <WebKit/WebNSURLExtras.h>
#import <WebKit/WebPreferences.h>
- (void)keyDown:(NSEvent *)event
{
- if (![[self _bridge] interceptKeyEvent:event toView:self]) {
+ BOOL intercepted = [[self _bridge] interceptKeyEvent:event toView:self];
+ if (!intercepted || [event _isTabKeyEvent]) {
[super keyDown:event];
}
}