WebCore:
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Sep 2004 22:09:48 +0000 (22:09 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Sep 2004 22:09:48 +0000 (22:09 +0000)
        Reviewed by Darin.

        - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135):
        Option-tab doesn't always work as expected

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::tabsToAllControls):
        reworked logic to match what we promise in the UI; this worked correctly
        before for regular tabbing, but not for option-tabbing.

        * kwq/KWQButton.mm:
        (QButton::focusPolicy):
        check tabsToAllControls() rather than just WebCoreKeyboardAccessFull

        * kwq/KWQComboBox.mm:
        (QComboBox::focusPolicy):
        ditto

        * kwq/KWQFileButton.mm:
        (KWQFileButton::focusPolicy):
        ditto

        * kwq/KWQListBox.mm:
        (QListBox::focusPolicy):
        ditto

WebKit:

        Reviewed by Darin.

        - WebKit part of fix for <rdar://problem/3618274> REGRESSION (125-135):
        Option-tab doesn't always work as expected

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]):
        Don't set WebCoreKeyboardAccessFull when setting WebCoreKeyboardAccessTabsToLinks
        after all; these need to be tested independently to get the option-tab behavior
        correct.

WebBrowser:

Fixed: <rdar://problem/3807365> REGRSSION (8A259): drag bookmark to Finder does not appear in Finder

        Reviewed by john.

        * BookmarksViewController.m:
        (-[BookmarksViewController outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:]): new, must implement this method on Tiger for promised drags to work

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7622 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQButton.mm
WebCore/kwq/KWQComboBox.mm
WebCore/kwq/KWQFileButton.mm
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/KWQListBox.mm
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m

index 2eb6bc54b303fdb5f522cf7a95f9b43c85c934f6..1d02d400160777ad7d05fd595a8723282c4940c2 100644 (file)
@@ -1,3 +1,31 @@
+2004-09-21  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Darin.
+        
+        - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135): 
+        Option-tab doesn't always work as expected
+
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::tabsToAllControls):
+        reworked logic to match what we promise in the UI; this worked correctly
+        before for regular tabbing, but not for option-tabbing.
+
+        * kwq/KWQButton.mm:
+        (QButton::focusPolicy):
+        check tabsToAllControls() rather than just WebCoreKeyboardAccessFull
+        
+        * kwq/KWQComboBox.mm:
+        (QComboBox::focusPolicy):
+        ditto
+        
+        * kwq/KWQFileButton.mm:
+        (KWQFileButton::focusPolicy):
+        ditto
+        
+        * kwq/KWQListBox.mm:
+        (QListBox::focusPolicy):
+        ditto
+
 2004-09-21  John Sullivan  <sullivan@apple.com>
 
         * khtml/xml/dom_selection.cpp:
index 837ba31544381516616a3b33cbf19646071ccd6e..d59dadb96717901a66d6d216a05f408565461510 100644 (file)
@@ -322,12 +322,10 @@ QWidget::FocusPolicy QButton::focusPolicy() const
 {
     KWQ_BLOCK_EXCEPTIONS;
 
-    // Add an additional check here.
-    // For now, buttons are only focused when full
-    // keyboard access is turned on.
-    unsigned keyboardUIMode = [KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode];
-    if ((keyboardUIMode & WebCoreKeyboardAccessFull) == 0)
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(this);
+    if (!bridge || ![bridge part] || ![bridge part]->tabsToAllControls()) {
         return NoFocus;
+    }
     
     KWQ_UNBLOCK_EXCEPTIONS;
 
index 68dd6fd1417e25ed2825035c7a9c525f663b6693..f4250ce982103a24349886ac4d028bea7c6d147a 100644 (file)
@@ -323,10 +323,10 @@ QWidget::FocusPolicy QComboBox::focusPolicy() const
 {
     KWQ_BLOCK_EXCEPTIONS;
     
-    // Menus are only focused when full keyboard access is turned on.
-    unsigned keyboardUIMode = [KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode];
-    if ((keyboardUIMode & WebCoreKeyboardAccessFull) == 0)
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(this);
+    if (!bridge || ![bridge part] || ![bridge part]->tabsToAllControls()) {
         return NoFocus;
+    }
     
     KWQ_UNBLOCK_EXCEPTIONS;
     
index 79842ea69035f2255281abc7a8a7fb244460a12d..518a2943fd0178ba9165763ac66326c7ccca7c03 100644 (file)
@@ -133,12 +133,10 @@ QWidget::FocusPolicy KWQFileButton::focusPolicy() const
 {
     KWQ_BLOCK_EXCEPTIONS;
     
-    // Add an additional check here.
-    // For now, file buttons are only focused when full
-    // keyboard access is turned on.
-    unsigned keyboardUIMode = [KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode];
-    if ((keyboardUIMode & WebCoreKeyboardAccessFull) == 0)
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(this);
+    if (!bridge || ![bridge part] || ![bridge part]->tabsToAllControls()) {
         return NoFocus;
+    }
     
     KWQ_UNBLOCK_EXCEPTIONS;
     
index cd93f2806adbd5f8de4acc20cbe165e03d062f37..be9eb3eea49ad7aed0f5dfa474e3d6681084e193 100644 (file)
@@ -1255,10 +1255,25 @@ bool KWQKHTMLPart::tabsToLinks() const
 
 bool KWQKHTMLPart::tabsToAllControls() const
 {
-    if ([_bridge keyboardUIMode] & WebCoreKeyboardAccessFull)
-        return !KWQKHTMLPart::currentEventIsKeyboardOptionTab();
-    else
-        return KWQKHTMLPart::currentEventIsKeyboardOptionTab();
+    WebCoreKeyboardUIMode keyboardUIMode = [_bridge keyboardUIMode];
+    BOOL handlingOptionTab = KWQKHTMLPart::currentEventIsKeyboardOptionTab();
+
+    // If tab-to-links is off, option-tab always highlights all controls
+    if ((keyboardUIMode & WebCoreKeyboardAccessTabsToLinks) == 0 && handlingOptionTab) {
+        return YES;
+    }
+    
+    // If system preferences say to include all controls, we always include all controls
+    if (keyboardUIMode & WebCoreKeyboardAccessFull) {
+        return YES;
+    }
+    
+    // Otherwise tab-to-links includes all controls, unless the sense is flipped via option-tab.
+    if (keyboardUIMode & WebCoreKeyboardAccessTabsToLinks) {
+        return !handlingOptionTab;
+    }
+    
+    return handlingOptionTab;
 }
 
 KJS::Bindings::RootObject *KWQKHTMLPart::bindingRootObject()
index 4ab71fa21a2bd9d6c235d13c3dfc05a13cd59125..a482c5baa321ad86250f354b6b16e6673c72e9a2 100644 (file)
@@ -301,10 +301,10 @@ QWidget::FocusPolicy QListBox::focusPolicy() const
 {
     KWQ_BLOCK_EXCEPTIONS;
     
-    // Lists are only focused when full keyboard access is turned on.
-    unsigned keyboardUIMode = [KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode];
-    if ((keyboardUIMode & WebCoreKeyboardAccessFull) == 0)
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(this);
+    if (!bridge || ![bridge part] || ![bridge part]->tabsToAllControls()) {
         return NoFocus;
+    }
     
     KWQ_UNBLOCK_EXCEPTIONS;
     
index 33e77cfd8f4a5b5d0ae960f1640f0a2701e597b4..7ef9c9c9716fb819f8868d6bcba8945e6f57faa6 100644 (file)
@@ -1,3 +1,16 @@
+2004-09-21  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Darin.
+
+        - WebKit part of fix for <rdar://problem/3618274> REGRESSION (125-135): 
+        Option-tab doesn't always work as expected
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]):
+        Don't set WebCoreKeyboardAccessFull when setting WebCoreKeyboardAccessTabsToLinks
+        after all; these need to be tested independently to get the option-tab behavior
+        correct.
+
 2004-09-21  John Sullivan  <sullivan@apple.com>
 
         * WebView.subproj/WebHTMLView.m:
index e7775b1a3e78bce5008287330596104dd28102b9..e7503399a9f8cb573869e9eb78f5c9ae9ed73f50 100644 (file)
@@ -1212,11 +1212,9 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     // turns on both bits.
     _keyboardUIMode = (mode & 0x2) ? WebCoreKeyboardAccessFull : WebCoreKeyboardAccessDefault;
     
-    // check for tabbing to links; also, we always do full keyboard access when this preference is set,
-    // regardless of the system preferences setting
+    // check for tabbing to links
     if ([[WebPreferences standardPreferences] tabsToLinks]) {
         _keyboardUIMode |= WebCoreKeyboardAccessTabsToLinks;
-        _keyboardUIMode |= WebCoreKeyboardAccessFull;
     }
 }