Changeset 15093 in webkit
- Timestamp:
- Jun 29, 2006, 11:18:42 AM (19 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r15091 r15093 1 2006-06-29 Timothy Hatcher <timothy@apple.com> 2 3 Reviewed by Harrison. 4 5 Smart insert and delete, continuous spell checking and autoscroll 6 can now be used for any WebView, not just editable ones. All of 7 these make sense for documents that might contain content editable 8 areas or our new text fields. Autoscroll is usefull for dragging 9 for file input controls also. 10 11 Added a SPI to toggle WebViews tab key behavior, tabKeyCyclesThroughElements. 12 WebHTMLView's _interceptEditingKeyEvent now uses WebView's 13 tabKeyCyclesThroughElements state to determine whether or not 14 to process tab key events. The idea here is that tabKeyCyclesThroughElements 15 will be YES when this WebView is being used in a browser, and we 16 desire the behavior where tab moves to the next element in tab order. 17 If tabKeyCyclesThroughElements is NO, it is likely that the WebView 18 is being embedded as the whole view, as in Mail, and tabs should input 19 tabs as expected in a text editor. Using Option-Tab always cycles 20 through elements. 21 22 * WebView/WebHTMLRepresentation.m: 23 (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): 24 * WebView/WebHTMLView.m: 25 (-[NSArray _interceptEditingKeyEvent:]): 26 * WebView/WebView.m: 27 (-[WebViewPrivate init]): 28 (-[WebView _autoscrollForDraggingInfo:timeDelta:]): 29 (-[WebView _shouldAutoscrollForDraggingInfo:]): 30 (-[WebView validateUserInterfaceItem:]): 31 (-[WebView toggleSmartInsertDelete:]): 32 (-[WebView toggleContinuousSpellChecking:]): 33 (-[WebView setTabKeyCyclesThroughElements:]): 34 (-[WebView tabKeyCyclesThroughElements]): 35 * WebView/WebViewPrivate.h: 36 1 37 2006-06-29 Anders Carlsson <acarlsson@apple.com> 2 38 -
trunk/WebKit/WebKit.xcodeproj/project.pbxproj
r15091 r15093 279 279 /* End PBXBuildFile section */ 280 280 281 /* Begin PBXBuildStyle section */282 BCEED1470A53334500443D9A /* Development */ = {283 isa = PBXBuildStyle;284 buildSettings = {285 COPY_PHASE_STRIP = NO;286 };287 name = Development;288 };289 BCEED1480A53334500443D9A /* Deployment */ = {290 isa = PBXBuildStyle;291 buildSettings = {292 COPY_PHASE_STRIP = YES;293 };294 name = Deployment;295 };296 /* End PBXBuildStyle section */297 298 281 /* Begin PBXFileReference section */ 299 282 1C0706620A431E01001078F6 /* WebScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugServer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 1248 1231 isa = PBXProject; 1249 1232 buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */; 1250 buildSettings = {1251 };1252 buildStyles = (1253 BCEED1470A53334500443D9A /* Development */,1254 BCEED1480A53334500443D9A /* Deployment */,1255 );1256 1233 hasScannedForEncodings = 1; 1257 1234 knownRegions = ( -
trunk/WebKit/WebView/WebHTMLRepresentation.m
r14811 r15093 193 193 194 194 WebView *webView = [frame webView]; 195 if ([webView isEditable]) {195 if ([webView isEditable]) 196 196 [_private->bridge applyEditingStyleToBodyElement]; 197 }198 197 } 199 198 } -
trunk/WebKit/WebView/WebHTMLView.m
r14987 r15093 3473 3473 - (BOOL)_interceptEditingKeyEvent:(NSEvent *)event 3474 3474 { 3475 // Use the isEditable state to determine whether or not to process tab key events. 3476 // The idea here is that isEditable will be NO when this WebView is being used 3477 // in a browser, and we desire the behavior where tab moves to the next element 3478 // in tab order. If isEditable is YES, it is likely that the WebView is being 3479 // embedded as the whole view, as in Mail, and tabs should input tabs as expected 3480 // in a text editor. 3481 if (![[self _webView] isEditable] && [event _web_isTabKeyEvent]) 3475 // Use WebView's tabKeyCyclesThroughElements state to determine whether or not 3476 // to process tab key events. The idea here is that tabKeyCyclesThroughElements 3477 // will be YES when this WebView is being used in a browser, and we desire the 3478 // behavior where tab moves to the next element in tab order. If tabKeyCyclesThroughElements 3479 // is NO, it is likely that the WebView is being embedded as the whole view, as in Mail, 3480 // and tabs should input tabs as expected in a text editor. Using Option-Tab always cycles 3481 // through elements. 3482 3483 if ([[self _webView] tabKeyCyclesThroughElements] && [event _web_isTabKeyEvent]) 3482 3484 return NO; 3483 3485 3486 if (![[self _webView] tabKeyCyclesThroughElements] && [event _web_isOptionTabKeyEvent]) 3487 return NO; 3488 3484 3489 // Now process the key normally 3485 3490 [self interpretKeyEvents:[NSArray arrayWithObject:event]]; -
trunk/WebKit/WebView/WebView.m
r15049 r15093 276 276 BOOL editable; 277 277 BOOL initiatedDrag; 278 278 BOOL tabKeyCyclesThroughElements; 279 279 280 NSString *mediaStyle; 280 281 … … 375 376 settings = [[WebCoreSettings alloc] init]; 376 377 dashboardBehaviorAllowWheelScrolling = YES; 378 tabKeyCyclesThroughElements = YES; 377 379 378 380 return self; … … 2231 2233 - (void)_autoscrollForDraggingInfo:(id)draggingInfo timeDelta:(NSTimeInterval)repeatDelta 2232 2234 { 2233 if (![self isEditable])2234 return;2235 2236 2235 NSView <WebDocumentView> *documentView = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]]; 2237 2236 [documentView _autoscrollForDraggingInfo:draggingInfo timeDelta:repeatDelta]; … … 2240 2239 - (BOOL)_shouldAutoscrollForDraggingInfo:(id)draggingInfo 2241 2240 { 2242 if (![self isEditable])2243 return NO;2244 2245 2241 NSView <WebDocumentView> *documentView = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]]; 2246 2242 return [documentView _shouldAutoscrollForDraggingInfo:draggingInfo]; … … 2609 2605 BOOL checkMark = NO; 2610 2606 BOOL retVal = NO; 2611 if ([self isEditable] && [self_continuousCheckingAllowed]) {2607 if ([self _continuousCheckingAllowed]) { 2612 2608 checkMark = [self isContinuousSpellCheckingEnabled]; 2613 2609 retVal = YES; … … 2696 2692 - (void)toggleSmartInsertDelete:(id)sender 2697 2693 { 2698 if ([self isEditable]) { 2699 [self setSmartInsertDeleteEnabled:![self smartInsertDeleteEnabled]]; 2700 } 2694 [self setSmartInsertDeleteEnabled:![self smartInsertDeleteEnabled]]; 2701 2695 } 2702 2696 2703 2697 - (IBAction)toggleContinuousSpellChecking:(id)sender 2704 2698 { 2705 if ([self isEditable]) { 2706 [self setContinuousSpellCheckingEnabled:![self isContinuousSpellCheckingEnabled]]; 2707 } 2699 [self setContinuousSpellCheckingEnabled:![self isContinuousSpellCheckingEnabled]]; 2708 2700 } 2709 2701 … … 2746 2738 BOOL notAlreadyStandard = _private->textSizeMultiplier != 1.0; 2747 2739 [self _performTextSizingSelector:@selector(_makeTextStandardSize:) withObject:sender onTrackingDocs:notAlreadyStandard selForNonTrackingDocs:@selector(_canMakeTextStandardSize) newScaleFactor:1.0]; 2740 } 2741 2742 - (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements 2743 { 2744 _private->tabKeyCyclesThroughElements = cyclesElements; 2745 } 2746 2747 - (BOOL)tabKeyCyclesThroughElements 2748 { 2749 return _private->tabKeyCyclesThroughElements; 2748 2750 } 2749 2751 -
trunk/WebKit/WebView/WebViewPrivate.h
r15049 r15093 93 93 - (IBAction)makeTextStandardSize:(id)sender; 94 94 95 - (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements; 96 - (BOOL)tabKeyCyclesThroughElements; 97 95 98 // If true, the selection will be maintained even when the first responder is outside 96 99 // of the webview. Returns true only if self is editable at this level. Subclasses can
Note:
See TracChangeset
for help on using the changeset viewer.