[webkit-changes] cvs commit: WebCore/kwq KWQNSViewExtras.m
Adele
adele at opensource.apple.com
Wed Jul 13 17:16:31 PDT 2005
adele 05/07/13 17:16:30
Modified: . Tag: Safari-1-3-branch ChangeLog
WebCore.pbproj Tag: Safari-1-3-branch project.pbxproj
kwq Tag: Safari-1-3-branch KWQNSViewExtras.m
Log:
Merged fix from TOT to Safari-1-3-branch
2005-07-13 Adele Peterson <adele at apple.com>
Reviewed by John.
Fixed <rdar://problem/4170963> Focusing a field unnecessarily horizontally scrolls
Horizontal scrolling while tabbing through forms can be surprising, and distracting. This
change will minimize that scrolling if we're not explicitly trying to center a rectangle in
_KWQ_scrollRectToVisible.
Test cases added: None. This test case involves tabbing to form controls and scrolling.
* kwq/KWQNSViewExtras.m: (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]):
Revision Changes Path
No revision
No revision
1.4108.4.44 +18 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4108.4.43
retrieving revision 1.4108.4.44
diff -u -r1.4108.4.43 -r1.4108.4.44
--- ChangeLog 13 Jul 2005 23:46:08 -0000 1.4108.4.43
+++ ChangeLog 14 Jul 2005 00:16:18 -0000 1.4108.4.44
@@ -1,3 +1,21 @@
+2005-07-13 Adele Peterson <adele at apple.com>
+
+ Merged fix from TOT to Safari-1-3-branch
+
+ 2005-07-13 Adele Peterson <adele at apple.com>
+
+ Reviewed by John.
+
+ Fixed <rdar://problem/4170963> Focusing a field unnecessarily horizontally scrolls
+
+ Horizontal scrolling while tabbing through forms can be surprising, and distracting. This
+ change will minimize that scrolling if we're not explicitly trying to center a rectangle in
+ _KWQ_scrollRectToVisible.
+
+ Test cases added: None. This test case involves tabbing to form controls and scrolling.
+
+ * kwq/KWQNSViewExtras.m: (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]):
+
=== WebCore-315.8 ===
2005-07-13 Adele Peterson <adele at apple.com>
No revision
No revision
1.528.2.9 +3 -3 WebCore/WebCore.pbproj/project.pbxproj
Index: project.pbxproj
===================================================================
RCS file: /cvs/root/WebCore/WebCore.pbproj/project.pbxproj,v
retrieving revision 1.528.2.8
retrieving revision 1.528.2.9
diff -u -r1.528.2.8 -r1.528.2.9
--- project.pbxproj 13 Jul 2005 22:45:21 -0000 1.528.2.8
+++ project.pbxproj 14 Jul 2005 00:16:26 -0000 1.528.2.9
@@ -176,7 +176,7 @@
<key>CFBundleExecutable</key>
<string>WebCore</string>
<key>CFBundleGetInfoString</key>
- <string>315.8, Copyright 2005 Apple Computer, Inc.; Copyright 1997 Martin Jones <mjones at kde.org>; Copyright 1998, 1999 Torben Weis <weis at kde.org>; Copyright 1998, 1999, 2002 Waldo Bastian <bastian at kde.org>; Copyright 1998-2000 Lars Knoll <knoll at kde.org>; Copyright 1999, 2001 Antti Koivisto <koivisto at kde.org>; Copyright 1999-2001 Harri Porten <porten at kde.org>; Copyright 2000 Simon Hausmann <hausmann at kde.org>; Copyright 2000, 2001 Dirk Mueller <mueller at kde.org>; Copyright 2000, 2001 Peter Kelly <pmk at post.com>; Copyright 2000 Daniel Molkentin <molkentin at kde.org>; Copyright 2000 Stefan Schimanski <schimmi at kde.org>; Copyright 1998-2000 Netscape Communications Corporation; Copyright 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper; Copyright 2001, 2002 Expat maintainers.</string>
+ <string>312.1, Copyright 2005 Apple Computer, Inc.; Copyright 1997 Martin Jones <mjones at kde.org>; Copyright 1998, 1999 Torben Weis <weis at kde.org>; Copyright 1998, 1999, 2002 Waldo Bastian <bastian at kde.org>; Copyright 1998-2000 Lars Knoll <knoll at kde.org>; Copyright 1999, 2001 Antti Koivisto <koivisto at kde.org>; Copyright 1999-2001 Harri Porten <porten at kde.org>; Copyright 2000 Simon Hausmann <hausmann at kde.org>; Copyright 2000, 2001 Dirk Mueller <mueller at kde.org>; Copyright 2000, 2001 Peter Kelly <pmk at post.com>; Copyright 2000 Daniel Molkentin <molkentin at kde.org>; Copyright 2000 Stefan Schimanski <schimmi at kde.org>; Copyright 1998-2000 Netscape Communications Corporation; Copyright 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper; Copyright 2001, 2002 Expat maintainers.</string>
<key>CFBundleIdentifier</key>
<string>com.apple.WebCore</string>
<key>CFBundleInfoDictionaryVersion</key>
@@ -186,9 +186,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>315.8</string>
+ <string>312.1</string>
<key>CFBundleVersion</key>
- <string>315.8</string>
+ <string>312.1</string>
</dict>
</plist>
";
No revision
No revision
1.5.8.1 +11 -5 WebCore/kwq/KWQNSViewExtras.m
Index: KWQNSViewExtras.m
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQNSViewExtras.m,v
retrieving revision 1.5
retrieving revision 1.5.8.1
diff -u -r1.5 -r1.5.8.1
--- KWQNSViewExtras.m 29 Sep 2004 14:16:35 -0000 1.5
+++ KWQNSViewExtras.m 14 Jul 2005 00:16:30 -0000 1.5.8.1
@@ -25,6 +25,8 @@
#import "KWQNSViewExtras.h"
+#define MIN_INTERSECT_FOR_REVEAL 32
+
@implementation NSView (KWQNSViewExtras)
- (void)_KWQ_scrollFrameToVisible
@@ -64,8 +66,13 @@
NSRect visibleRect = [self bounds];
if (forceCentering || !NSContainsRect(visibleRect, exposeRect)) {
- // Make an expose rectangle that will end up centering the passed-in rectangle horizontally.
- if (exposeRect.size.width >= visibleRect.size.width) {
+
+ // First check whether enough of the desired rect is already visible horizontally. If so, and we're not forcing centering,
+ // we don't want to scroll horizontally because doing so is surprising.
+ if (!forceCentering && NSIntersectionRect(visibleRect, exposeRect).size.width >= MIN_INTERSECT_FOR_REVEAL) {
+ exposeRect.origin.x = visibleRect.origin.x;
+ exposeRect.size.width = visibleRect.size.width;
+ } else if (exposeRect.size.width >= visibleRect.size.width) {
if (forceCentering) {
float expLeft = exposeRect.origin.x;
float expRight = exposeRect.origin.x + exposeRect.size.width;
@@ -88,12 +95,11 @@
}
}
exposeRect.size.width = visibleRect.size.width;
- }
- else {
+ } else {
exposeRect.origin.x -= (visibleRect.size.width - exposeRect.size.width) / 2.0;
exposeRect.size.width += (visibleRect.size.width - exposeRect.size.width);
}
-
+
// Make an expose rectangle that will end up centering the passed-in rectangle vertically.
if (exposeRect.size.height >= visibleRect.size.height) {
if (forceCentering) {
More information about the webkit-changes
mailing list