[webkit-changes] cvs commit: WebKit/WebView.subproj WebHTMLView.m
WebPDFView.m
John
sullivan at opensource.apple.com
Mon Dec 5 15:48:34 PST 2005
sullivan 05/12/05 15:48:34
Modified: . ChangeLog
WebView.subproj WebHTMLView.m WebPDFView.m
Log:
Reviewed by Tim Omernick.
- WebKit part of fix for
<rdar://problem/4365690> Find > Jump to Selection does nothing on plain-text documents (inc. source HTML)
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView jumpToSelection:]):
Reimplement jumpToSelection: to call centerSelectionInVisibleArea:, and added a comment explaining why
jumpToSelection: exists at all. Note that centerSelectionInVisibleArea: was already implemented here; it
was added as part of HTML editing implementation without us realizing that it was the API replacement
for jumpToSelection:.
(-[WebHTMLView validateUserInterfaceItem:]):
validate centerSelectionInVisibleArea: the same way we validate jumpToSelection: (we should have done
this when centerSelectionInVisibleArea: was implemented)
* WebView.subproj/WebPDFView.m:
(-[WebPDFView centerSelectionInVisibleArea:]):
new method, same code that jumpToSelection: used to have
(-[WebPDFView jumpToSelection:]):
now calls centerSelectionInVisibleArea:, and there's now a comment about why it exists at all.
(-[WebPDFView validateUserInterfaceItem:]):
validate centerSelectionInVisibleArea: the same way we validate jumpToSelection:
Revision Changes Path
1.3382 +25 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3381
retrieving revision 1.3382
diff -u -r1.3381 -r1.3382
--- ChangeLog 5 Dec 2005 22:31:02 -0000 1.3381
+++ ChangeLog 5 Dec 2005 23:48:23 -0000 1.3382
@@ -1,3 +1,28 @@
+2005-12-05 John Sullivan <sullivan at apple.com>
+
+ Reviewed by Tim Omernick.
+
+ - WebKit part of fix for
+ <rdar://problem/4365690> Find > Jump to Selection does nothing on plain-text documents (inc. source HTML)
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView jumpToSelection:]):
+ Reimplement jumpToSelection: to call centerSelectionInVisibleArea:, and added a comment explaining why
+ jumpToSelection: exists at all. Note that centerSelectionInVisibleArea: was already implemented here; it
+ was added as part of HTML editing implementation without us realizing that it was the API replacement
+ for jumpToSelection:.
+ (-[WebHTMLView validateUserInterfaceItem:]):
+ validate centerSelectionInVisibleArea: the same way we validate jumpToSelection: (we should have done
+ this when centerSelectionInVisibleArea: was implemented)
+
+ * WebView.subproj/WebPDFView.m:
+ (-[WebPDFView centerSelectionInVisibleArea:]):
+ new method, same code that jumpToSelection: used to have
+ (-[WebPDFView jumpToSelection:]):
+ now calls centerSelectionInVisibleArea:, and there's now a comment about why it exists at all.
+ (-[WebPDFView validateUserInterfaceItem:]):
+ validate centerSelectionInVisibleArea: the same way we validate jumpToSelection:
+
2005-12-04 Tim Omernick <timo at apple.com>
Reviewed by Dave Harrison, John Sullivan.
1.483 +7 -1 WebKit/WebView.subproj/WebHTMLView.m
Index: WebHTMLView.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebHTMLView.m,v
retrieving revision 1.482
retrieving revision 1.483
diff -u -r1.482 -r1.483
--- WebHTMLView.m 1 Dec 2005 21:59:14 -0000 1.482
+++ WebHTMLView.m 5 Dec 2005 23:48:32 -0000 1.483
@@ -1817,9 +1817,14 @@
[self selectAll];
}
+// jumpToSelection is the old name for what AppKit now calls centerSelectionInVisibleArea. Safari
+// was using the old jumpToSelection selector in its menu. Newer versions of Safari will us the
+// selector centerSelectionInVisibleArea. We'll leave this old selector in place for two reasons:
+// (1) compatibility between older Safari and newer WebKit; (2) other WebKit-based applications
+// might be using the jumpToSelection: selector, and we don't want to break them.
- (void)jumpToSelection:(id)sender
{
- [[self _bridge] jumpToSelection];
+ [self centerSelectionInVisibleArea:sender];
}
- (NSRect)selectionRect
@@ -1923,6 +1928,7 @@
} else if (action == @selector(delete:)) {
return [self _canDelete];
} else if (action == @selector(_ignoreSpellingFromMenu:)
+ || action == @selector(centerSelectionInVisibleArea:)
|| action == @selector(jumpToSelection:)
|| action == @selector(_learnSpellingFromMenu:)
|| action == @selector(takeFindStringFromSelection:)) {
1.28 +12 -2 WebKit/WebView.subproj/WebPDFView.m
Index: WebPDFView.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebPDFView.m,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- WebPDFView.m 20 Sep 2005 22:31:06 -0000 1.27
+++ WebPDFView.m 5 Dec 2005 23:48:32 -0000 1.28
@@ -494,15 +494,25 @@
[NSPasteboard _web_setFindPasteboardString:[[PDFSubview currentSelection] string] withOwner:self];
}
-- (void)jumpToSelection:(id)sender
+- (void)centerSelectionInVisibleArea:(id)sender
{
[PDFSubview scrollSelectionToVisible:nil];
}
+// jumpToSelection is the old name for what AppKit now calls centerSelectionInVisibleArea. Safari
+// was using the old jumpToSelection selector in its menu. Newer versions of Safari will us the
+// selector centerSelectionInVisibleArea. We'll leave this old selector in place for two reasons:
+// (1) compatibility between older Safari and newer WebKit; (2) other WebKit-based applications
+// might be using the jumpToSelection: selector, and we don't want to break them.
+- (void)jumpToSelection:(id)sender
+{
+ [self centerSelectionInVisibleArea:nil];
+}
+
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
SEL action = [item action];
- if (action == @selector(takeFindStringFromSelection:) || action == @selector(jumpToSelection:)) {
+ if (action == @selector(takeFindStringFromSelection:) || action == @selector(centerSelectionInVisibleArea:) || action == @selector(jumpToSelection:)) {
return [PDFSubview currentSelection] != nil;
}
return YES;
More information about the webkit-changes
mailing list