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 2eb6bc5..1d02d40 100644 (file)
@@ -1,5 +1,33 @@
 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:
         (DOM::Selection::modify):
         initialize xPos to make compiler happy in deployment builds
index 837ba31..d59dadb 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 68dd6fd..f4250ce 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 79842ea..518a294 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 cd93f28..be9eb3e 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 4ab71fa..a482c5b 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 33e77cf..7ef9c9c 100644 (file)
@@ -1,5 +1,18 @@
 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:
         (-[WebHTMLView doCommandBySelector:]):
         Commented out part of previous change; it breaks Mail editing until Mail
index e7775b1..e750339 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;
     }
 }