LayoutTests:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Nov 2006 02:00:10 +0000 (02:00 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Nov 2006 02:00:10 +0000 (02:00 +0000)
commit493742f5433984a897d8dc34ada0e3a4c3be828a
tree992af9faa0e0bd82ee2748262d4b6761c4cd61ba
parent2c0ffb4e1677c5bfb30030d032fa6799f9b9f500
LayoutTests:

        Reviewed by Anders.

        - added test for option-tab

        * fast/events/option-tab.html: Added.
        * fast/events/option-tab-expected.txt: Added.

WebCore:

        Reviewed by Anders.

        - added event parameters to focus-related functions so we can
          implement the "option-tab to all links" behavior without relying
          on a global "current event" -- also makes it work with DOM events

        * page/Frame.h: Removed unneeded includes. Moved some functions
        that were misplaced into the appropriate sections.
        * page/Frame.cpp:
        (WebCore::Frame::doTextFieldCommandFromEvent): Changed parameter from
        PlatformKeyboardEvent to the DOM keyboard event class.
        (WebCore::Frame::tabsToLinks): Added event parameter.
        (WebCore::Frame::tabsToAllControls): Ditto.
        (WebCore::scanForForm): Fixed code that incorrectly assumes
        that an iframe is an HTMLFrameElement (no longer true since Geoff
        changed the class hierarchy a bit).
        (WebCore::Frame::hitTestResultAtPoint): Ditto.

        * bridge/mac/FrameMac.h: Removed unneeded includes. Moved some functions
        that were misplaced into the appropriate sections.
        * bridge/mac/FrameMac.mm:
        (WebCore::selectorForKeyEvent): Changed to use a DOM event instead of
        a PlatformKeyboardEvent.
        (WebCore::FrameMac::nextKeyViewInFrame): Changed to use currentKeyboardEvent()
        and pass event into next/previousFocusNode.
        (WebCore::FrameMac::currentKeyboardEvent): Added. Creates a DOM event from
        the AppKit current event, if it's a keyboard event. Really just a hack that's
        needed to preserve some code we can remove once we deal with the last NSView-
        based form control.
        (WebCore::isKeyboardOptionTab): Added.
        (WebCore::FrameMac::tabsToLinks): Added event parameter, used to check if the
        option (alt) key is down.
        (WebCore::FrameMac::tabsToAllControls): Ditto.
        (WebCore::FrameMac::keyEvent): Changed call to prepareForUserAction() to just
        call resetMultipleFormSubmissionProtection() explicitly instead.
        (WebCore::FrameMac::mouseDown): Ditto.

        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject accessibilityDescription]): Fixed code that incorrectly
        assumes that an iframe is an HTMLFrameElement (no longer true since Geoff
        changed the class hierarchy a bit).
        (-[WebCoreAXObject accessibilityPerformAction:]): Changed call to
        prepareForUserAction() to call resetMultipleFormSubmissionProtection()
        explicitly instead.

        * page/FrameView.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::advanceFocus): Changed function to take an
        event parameter, and decide the direction based on the shift key
        modifier instead of a passed-in boolean.

        * dom/Document.h:
        * dom/Document.cpp:
        (WebCore::Document::nextFocusNode): Added event parameter.
        (WebCore::Document::previousFocusNode): Ditto.
        * dom/Node.h:
        * dom/Node.cpp:
        (WebCore::Node::isKeyboardFocusable): Ditto.
        * html/HTMLAnchorElement.h:
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::isKeyboardFocusable): Ditto.
        * html/HTMLGenericFormElement.h:
        * html/HTMLGenericFormElement.cpp:
        (WebCore::HTMLGenericFormElement::isKeyboardFocusable): Ditto.
        * html/HTMLInputElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::isKeyboardFocusable): Ditto.
        (WebCore::HTMLInputElement::defaultEventHandler): Ditto.
        * html/HTMLSelectElement.h:
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::isKeyboardFocusable): Ditto.
        * html/HTMLTextAreaElement.h:
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::isKeyboardFocusable): Ditto.

        * dom/EventTargetNode.cpp:
        (WebCore::EventTargetNode::defaultEventHandler): Pass event to the
        advanceFocus function.

        * platform/TextField.h:
        * platform/mac/TextFieldMac.mm: Removed the non-search field code.

        * platform/mac/WebCoreTextField.h:
        * platform/mac/WebCoreTextField.mm: Removed the non-search field code.
        (-[WebCoreTextFieldController controlTextDidChange:]): Removed the
        call to FrameMac::handleKeyboardOptionTabInView, which is no longer
        needed since the default handler in HTMLInputElement takes care of
        option-tab.

        * platform/mac/SliderMac.mm:
        (-[WebCoreSlider canBecomeKeyView]): Changed to use currentKeyboardEvent()
        and pass event into tabsToAllControls.
        (Slider::focusPolicy): Ditto.

        * rendering/RenderLineEdit.cpp:
        (WebCore::RenderLineEdit::RenderLineEdit): Removed the non-search field code.
        (WebCore::RenderLineEdit::updateFromElement): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/option-tab-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/option-tab.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/dom/EventTargetNode.cpp
WebCore/dom/Node.cpp
WebCore/dom/Node.h
WebCore/html/HTMLAnchorElement.cpp
WebCore/html/HTMLAnchorElement.h
WebCore/html/HTMLGenericFormElement.cpp
WebCore/html/HTMLGenericFormElement.h
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLInputElement.h
WebCore/html/HTMLSelectElement.cpp
WebCore/html/HTMLSelectElement.h
WebCore/html/HTMLTextAreaElement.cpp
WebCore/html/HTMLTextAreaElement.h
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebCore/platform/TextField.h
WebCore/platform/mac/SliderMac.mm
WebCore/platform/mac/TextFieldMac.mm
WebCore/platform/mac/WebCoreTextField.h
WebCore/platform/mac/WebCoreTextField.mm
WebCore/rendering/RenderLineEdit.cpp