WebCore:
authoralice.liu@apple.com <alice.liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Apr 2008 01:18:52 +0000 (01:18 +0000)
committeralice.liu@apple.com <alice.liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Apr 2008 01:18:52 +0000 (01:18 +0000)
commit50f22da6edcc1dfcdbe80427fd9b8b7f827019d0
tree461399918a57b1d5f327158502ca0eca067c45ed
parentb044338fda240840b43b63fe3804f24b7313af1d
WebCore:

2008-04-28  Alice Liu  <alice.liu@apple.com>

        Reviewed by Darin.

        Fix <rdar://problem/4911289> Add tabindex property to all children
        of HTMLElement (7138)
        http://bugs.webkit.org/show_bug.cgi?id=7138

        Test: fast/events/tabindex-focus-blur-all.html

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOMPrivate.h:
        -DOMHTMLLabelElementPrivate.h and DOMHTMLLegendElementPrivate.h are no
         longer needed

        * bindings/objc/PublicDOMInterfaces.h:
        -Moving focus, blur, tabindex to HTMLElement from its descendants.

        * dom/Node.cpp:
        (WebCore::Node::Node):
        (WebCore::Node::isFocusable):
        (WebCore::Node::isKeyboardFocusable):
        -The concept of being focusable now needs to account for tabindex
        attribute.

        * dom/Node.h:
        -Need to use a bit to keep track of whether tabindex was explicitly set
         to 0 or was just initialized to 0.
        (WebCore::Node::tabIndex):
        -Make this virtual so that Anchors and GenericFormElements can determine
         tabindex without accounting for focusability
        (WebCore::Node::setTabIndexExplicitly):
        -Renamed setTabIndex() to setTabIndexExplicitly() so as not to hide
         behind and/or be confused for HTMLElement::setTabIndex

        * html/HTMLAnchorElement.cpp:
        * html/HTMLAnchorElement.h:
        (WebCore::HTMLAnchorElement::tabIndex):
        * html/HTMLGenericFormElement.cpp:
        * html/HTMLGenericFormElement.h:
        (WebCore::HTMLGenericFormElement::tabIndex):
        -Anchors and form elements are normally focusable, and need to avert the
         check for focusability in HTMLElement::tabIndex
         because tabIndex could be queried before a first layout happens.

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::parseMappedAttribute):
        -Function Node::setTabIndex changed to Node::setTabIndexExplicitly
        (WebCore::HTMLElement::isFocusable):
        -The concept of being focusable now needs to account for tabindex
         attribute.
        (WebCore::HTMLElement::tabIndex):
        -HTML5 specifies that querying tabindex for elements that aren't
         focusable shall return -1
        (WebCore::HTMLElement::setTabIndex):
        -New default implementation
        * html/HTMLElement.h:

        * html/HTMLLegendElement.cpp:
        (WebCore::HTMLLegendElement::focus):
        -Now with HTML5's enhanced specification of tabindex, legend elements
         themselves shall focus (if they should), and not the first form element
         they encapsulate.  This matches Firefox behavior.  HTMLLabelElements
         still forward focus to the encapsulated element.  This also matches
         other browsers.

        * html/HTMLAreaElement.cpp:
        (WebCore::HTMLAreaElement::isFocusable):
        * html/HTMLAreaElement.h:
        -HTMLAreaElement isn't subject to the same focusability requirements as
         its parent, HTMLAnchorElement. Default HTMLElement implementation is
         desired.

        * html/HTMLFieldSetElement.cpp:
        (WebCore::HTMLFieldSetElement::isFocusable):
        * html/HTMLLegendElement.cpp:
        (WebCore::HTMLLegendElement::isFocusable):
        * html/HTMLOptGroupElement.cpp:
        (WebCore::HTMLOptGroupElement::isFocusable):
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::isFocusable):
        -These elements aren't subject to the same focusability requirements as
         their parent, HTMLGenericFormElement. Default HTMLElement
         implementation is desired.

        * html/HTMLAnchorElement.idl:
        * html/HTMLAreaElement.idl:
        * html/HTMLButtonElement.idl:
        * html/HTMLElement.idl:
        * html/HTMLInputElement.idl:
        * html/HTMLLabelElement.idl:
        * html/HTMLLegendElement.idl:
        * html/HTMLObjectElement.idl:
        * html/HTMLSelectElement.idl:
        * html/HTMLTextAreaElement.idl:
        -Moving tabindex attribute, focus and blur methods from descendants of
         HTMLElement to HTMLElement

WebKit/mac:

2008-04-28  Alice Liu  <alice.liu@apple.com>

        Reviewed by Darin.

        Fix <rdar://problem/4911289> Add tabindex property to all children
        of HTMLElement (7138)
        http://bugs.webkit.org/show_bug.cgi?id=7138

        * MigrateHeaders.make:
        Removing DOMHTMLLabelElementPrivate.h and DOMHTMLLegendElementPrivate.h
        because now that focus() has been moved to DOMHTMLElement.h, these
        files are no longer needed.

LayoutTests:

2008-04-28  Alice Liu  <alice.liu@apple.com>

        Reviewed by Sam Weinig.

        Fix <rdar://problem/4911289> Add tabindex property to all children
        of HTMLElement (7138)
        http://bugs.webkit.org/show_bug.cgi?id=7138

        minor updates to these existing tests:
        * fast/dom/domListEnumeration-expected.txt:
        * fast/dom/plugin-attributes-enumeration-expected.txt:
        * fast/dom/resources/domListEnumeration.js:

        * fast/events/resources/abe.png: Added.
        * fast/events/resources/tabindex-focus-blur-all-frame1.html: Added.
        * fast/events/resources/tabindex-focus-blur-all-frame2.html: Added.
        * fast/events/resources/tabindex-focus-blur-all-iframe1.html: Added.
        * fast/events/resources/tabindex-focus-blur-all-iframe2.html: Added.
        * fast/events/resources/tabindex-focus-blur-all.js: Added.
        * fast/events/tabindex-focus-blur-all-expected.txt: Added.
        * fast/events/tabindex-focus-blur-all.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
42 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/domListEnumeration-expected.txt
LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt
LayoutTests/fast/dom/resources/domListEnumeration.js
LayoutTests/fast/events/resources/abe.png [new file with mode: 0644]
LayoutTests/fast/events/resources/tabindex-focus-blur-all-frame1.html [new file with mode: 0644]
LayoutTests/fast/events/resources/tabindex-focus-blur-all-frame2.html [new file with mode: 0644]
LayoutTests/fast/events/resources/tabindex-focus-blur-all-iframe1.html [new file with mode: 0644]
LayoutTests/fast/events/resources/tabindex-focus-blur-all-iframe2.html [new file with mode: 0644]
LayoutTests/fast/events/resources/tabindex-focus-blur-all.js [new file with mode: 0644]
LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/tabindex-focus-blur-all.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOMPrivate.h
WebCore/bindings/objc/PublicDOMInterfaces.h
WebCore/dom/Node.cpp
WebCore/dom/Node.h
WebCore/html/HTMLAnchorElement.cpp
WebCore/html/HTMLAnchorElement.h
WebCore/html/HTMLAnchorElement.idl
WebCore/html/HTMLAreaElement.cpp
WebCore/html/HTMLAreaElement.h
WebCore/html/HTMLAreaElement.idl
WebCore/html/HTMLButtonElement.idl
WebCore/html/HTMLElement.cpp
WebCore/html/HTMLElement.h
WebCore/html/HTMLElement.idl
WebCore/html/HTMLFieldSetElement.cpp
WebCore/html/HTMLGenericFormElement.cpp
WebCore/html/HTMLGenericFormElement.h
WebCore/html/HTMLInputElement.idl
WebCore/html/HTMLLabelElement.idl
WebCore/html/HTMLLegendElement.cpp
WebCore/html/HTMLLegendElement.idl
WebCore/html/HTMLObjectElement.idl
WebCore/html/HTMLOptGroupElement.cpp
WebCore/html/HTMLOptionElement.cpp
WebCore/html/HTMLSelectElement.idl
WebCore/html/HTMLTextAreaElement.idl
WebKit/mac/ChangeLog
WebKit/mac/MigrateHeaders.make