Changeset 48106 in webkit


Ignore:
Timestamp:
Sep 6, 2009 10:10:12 PM (15 years ago)
Author:
abarth@webkit.org
Message:

2009-09-06 Erik Arvidsson <arv@chromium.org>

Reviewed by Eric Seidel.

Tests for https://bugs.webkit.org/show_bug.cgi?id=27099
Make hidden elements not focusable. This is important becaue we should
not allow tabbing to a hidden element.

The patch also makes a element without href behave like generic elements
when it comes to focus. Added tests that asserts that this works as
expected.

  • fast/events/click-focus-anchor-expected.txt: Added.
  • fast/events/click-focus-anchor.html: Added.
  • fast/events/resources/tabindex-focus-blur-all.js: (test): (testProgrammaticFocus):
  • fast/events/tab-focus-anchor-expected.txt: Added.
  • fast/events/tab-focus-anchor.html: Added.
  • fast/events/tab-focus-hidden-expected.txt: Added.
  • fast/events/tab-focus-hidden.html: Added.
  • fast/events/tabindex-focus-blur-all-expected.txt:

2009-09-06 Erik Arvidsson <arv@chromium.org>

Reviewed by Eric Seidel.

Make hidden elements not focusable.

Clean up supportsFocus and isFocusable.
supportsFocus now strictly means that the node can be focused by default.
This is true for links, form controls and content editable elements for example.
isFocusable means that the user can actually focus it.
All (2) calls to supportsFocus have been updated to take this into account.

Make a elements without href work correctly as well.

https://bugs.webkit.org/show_bug.cgi?id=27099

Tests: fast/events/click-focus-anchor.html

fast/events/tab-focus-anchor.html
fast/events/tab-focus-hidden.html

  • dom/Element.cpp: (WebCore::Element::focus):
  • dom/Node.cpp: (WebCore::Node::supportsFocus): (WebCore::Node::isFocusable):
  • dom/Node.h:
  • html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): (WebCore::HTMLAnchorElement::isMouseFocusable): (WebCore::HTMLAnchorElement::isKeyboardFocusable):
  • html/HTMLAnchorElement.h:
  • html/HTMLAreaElement.cpp: (WebCore::HTMLAreaElement::supportsFocus):
  • html/HTMLAreaElement.h:
  • html/HTMLElement.cpp: (WebCore::HTMLElement::supportsFocus):
  • html/HTMLElement.h:
  • html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::supportsFocus):
  • html/HTMLFieldSetElement.h:
  • html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::supportsFocus): (WebCore::HTMLFormControlElement::isFocusable):
  • html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::supportsFocus):
  • html/HTMLFrameElementBase.h:
  • html/HTMLLegendElement.cpp: (WebCore::HTMLLegendElement::supportsFocus):
  • html/HTMLLegendElement.h:
  • html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::supportsFocus): (WebCore::HTMLOptGroupElement::isFocusable):
  • html/HTMLOptGroupElement.h:
  • html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::supportsFocus): (WebCore::HTMLOptionElement::isFocusable):
  • html/HTMLOptionElement.h:
  • page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent):
  • page/FocusController.cpp: (WebCore::FocusController::advanceFocus):
  • svg/SVGAElement.cpp: (WebCore::SVGAElement::supportsFocus): (WebCore::SVGAElement::isFocusable):
  • wml/WMLAElement.cpp: (WebCore::WMLAElement::supportsFocus):
  • wml/WMLAElement.h:
  • wml/WMLFormControlElement.cpp: (WebCore::WMLFormControlElement::supportsFocus): (WebCore::WMLFormControlElement::isFocusable):
  • wml/WMLFormControlElement.h:
Location:
trunk
Files:
6 added
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r48101 r48106  
     12009-09-06  Erik Arvidsson  <arv@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Tests for https://bugs.webkit.org/show_bug.cgi?id=27099
     6        Make hidden elements not focusable. This is important becaue we should
     7        not allow tabbing to a hidden element.
     8       
     9        The patch also makes a element without href behave like generic elements
     10        when it comes to focus. Added tests that asserts that this works as
     11        expected.
     12
     13        * fast/events/click-focus-anchor-expected.txt: Added.
     14        * fast/events/click-focus-anchor.html: Added.
     15        * fast/events/resources/tabindex-focus-blur-all.js:
     16        (test):
     17        (testProgrammaticFocus):
     18        * fast/events/tab-focus-anchor-expected.txt: Added.
     19        * fast/events/tab-focus-anchor.html: Added.
     20        * fast/events/tab-focus-hidden-expected.txt: Added.
     21        * fast/events/tab-focus-hidden.html: Added.
     22        * fast/events/tabindex-focus-blur-all-expected.txt:
     23
    1242009-09-06  Martin Robinson  <martin.james.robinson@gmail.com>
    225
  • trunk/LayoutTests/fast/events/resources/tabindex-focus-blur-all.js

    r32769 r48106  
    1919                             "TEXTAREA"];
    2020
    21 var tagNamesTransferFocused = ["LABEL"]; // lables always transfer focus to the labeled element
     21var tagNamesTransferFocused = ["LABEL"]; // labels always transfer focus to the labeled element
    2222
    2323function printToConsole(str)
     
    5050    homeBase[0].focus();
    5151
    52     var resultSummary = focusCount+" focus / "+blurCount+" blur events disatched, and should be 335 / 335 ";
     52    var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 335 / 335 ";
    5353    resultSummary += (focusCount==blurCount) ? "<span style='color:green'>PASSED</span><br>" : "<span style='color:red'>FAILED</span><br>";
    5454    resultSummary += "Total of "+failedTestCount+" focus test(s) failed.";
     
    104104        elemThatShouldFocus = elem;
    105105   
    106     if (elem.tagName == "INPUT" && elem.type == "hidden") // obviously since <input type=hidden> isn't rendered, it can't be focused
     106    // Hidden elements should not be focusable. https://bugs.webkit.org/show_bug.cgi?id=27099
     107    if (document.defaultView.getComputedStyle(elem).display == "none")
    107108        elemThatShouldFocus = null;
     109
    108110    if (tagNamesTransferFocused.find(elem.tagName)) {
    109111        elemThatShouldFocus = null;
  • trunk/LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt

    r32664 r48106  
    1 335 focus / 335 blur events disatched, and should be 335 / 335 PASSED
     1329 focus / 329 blur events dispatched, and should be 335 / 335 PASSED
    22Total of 0 focus test(s) failed. PASSED
  • trunk/WebCore/ChangeLog

    r48105 r48106  
     12009-09-06  Erik Arvidsson  <arv@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Make hidden elements not focusable.
     6
     7        Clean up supportsFocus and isFocusable.
     8        supportsFocus now strictly means that the node can be focused by default.
     9        This is true for links, form controls and content editable elements for example.
     10        isFocusable means that the user can actually focus it.
     11        All (2) calls to supportsFocus have been updated to take this into account.
     12       
     13        Make a elements without href work correctly as well.
     14
     15        https://bugs.webkit.org/show_bug.cgi?id=27099
     16
     17        Tests: fast/events/click-focus-anchor.html
     18               fast/events/tab-focus-anchor.html
     19               fast/events/tab-focus-hidden.html
     20
     21        * dom/Element.cpp:
     22        (WebCore::Element::focus):
     23        * dom/Node.cpp:
     24        (WebCore::Node::supportsFocus):
     25        (WebCore::Node::isFocusable):
     26        * dom/Node.h:
     27        * html/HTMLAnchorElement.cpp:
     28        (WebCore::HTMLAnchorElement::supportsFocus):
     29        (WebCore::HTMLAnchorElement::isMouseFocusable):
     30        (WebCore::HTMLAnchorElement::isKeyboardFocusable):
     31        * html/HTMLAnchorElement.h:
     32        * html/HTMLAreaElement.cpp:
     33        (WebCore::HTMLAreaElement::supportsFocus):
     34        * html/HTMLAreaElement.h:
     35        * html/HTMLElement.cpp:
     36        (WebCore::HTMLElement::supportsFocus):
     37        * html/HTMLElement.h:
     38        * html/HTMLFieldSetElement.cpp:
     39        (WebCore::HTMLFieldSetElement::supportsFocus):
     40        * html/HTMLFieldSetElement.h:
     41        * html/HTMLFormControlElement.cpp:
     42        (WebCore::HTMLFormControlElement::supportsFocus):
     43        (WebCore::HTMLFormControlElement::isFocusable):
     44        * html/HTMLFrameElementBase.cpp:
     45        (WebCore::HTMLFrameElementBase::supportsFocus):
     46        * html/HTMLFrameElementBase.h:
     47        * html/HTMLLegendElement.cpp:
     48        (WebCore::HTMLLegendElement::supportsFocus):
     49        * html/HTMLLegendElement.h:
     50        * html/HTMLOptGroupElement.cpp:
     51        (WebCore::HTMLOptGroupElement::supportsFocus):
     52        (WebCore::HTMLOptGroupElement::isFocusable):
     53        * html/HTMLOptGroupElement.h:
     54        * html/HTMLOptionElement.cpp:
     55        (WebCore::HTMLOptionElement::supportsFocus):
     56        (WebCore::HTMLOptionElement::isFocusable):
     57        * html/HTMLOptionElement.h:
     58        * page/EventHandler.cpp:
     59        (WebCore::EventHandler::dispatchMouseEvent):
     60        * page/FocusController.cpp:
     61        (WebCore::FocusController::advanceFocus):
     62        * svg/SVGAElement.cpp:
     63        (WebCore::SVGAElement::supportsFocus):
     64        (WebCore::SVGAElement::isFocusable):
     65        * wml/WMLAElement.cpp:
     66        (WebCore::WMLAElement::supportsFocus):
     67        * wml/WMLAElement.h:
     68        * wml/WMLFormControlElement.cpp:
     69        (WebCore::WMLFormControlElement::supportsFocus):
     70        (WebCore::WMLFormControlElement::isFocusable):
     71        * wml/WMLFormControlElement.h:
     72
    1732009-09-06  Joel Stanley  <joel@jms.id.au>
    274
  • trunk/WebCore/dom/Element.cpp

    r47910 r48106  
    12221222        return;
    12231223
    1224     doc->updateLayoutIgnorePendingStylesheets();
    1225    
    12261224    if (!supportsFocus())
    12271225        return;
    1228    
     1226
     1227    // If the stylesheets have already been loaded we can reliably check isFocusable.
     1228    // If not, we continue and set the focused node on the focus controller below so
     1229    // that it can be updated soon after attach.
     1230    if (doc->haveStylesheetsLoaded()) {
     1231        doc->updateLayoutIgnorePendingStylesheets();
     1232        if (!isFocusable())
     1233            return;
     1234    }
     1235
    12291236    if (Page* page = doc->page())
    12301237        page->focusController()->setFocusedNode(this, doc->frame());
     1238
     1239    // Setting the focused node above might have invalidated the layout due to scripts.
     1240    doc->updateLayoutIgnorePendingStylesheets();
    12311241
    12321242    if (!isFocusable()) {
  • trunk/WebCore/dom/Node.cpp

    r48055 r48106  
    830830    return rareData()->isFocused();
    831831}
     832
     833bool Node::supportsFocus() const
     834{
     835    return hasRareData() && rareData()->tabIndexSetExplicitly();
     836}
    832837   
    833838bool Node::isFocusable() const
    834839{
    835     return hasRareData() && rareData()->tabIndexSetExplicitly();
     840    if (!inDocument() || !supportsFocus())
     841        return false;
     842   
     843    if (renderer())
     844        ASSERT(!renderer()->needsLayout());
     845    else
     846        ASSERT(!needsStyleRecalc());
     847   
     848    // FIXME: Even if we are not visible, we might have a child that is visible.
     849    // Hyatt wants to fix that some day with a "has visible content" flag or the like.
     850    if (!renderer() || renderer()->style()->visibility() != VISIBLE)
     851        return false;
     852
     853    return true;
    836854}
    837855
  • trunk/WebCore/dom/Node.h

    r47843 r48106  
    292292    virtual short tabIndex() const;
    293293
    294     /**
    295      * Whether this node can receive the keyboard focus.
    296      */
    297     virtual bool supportsFocus() const { return isFocusable(); }
     294    // Whether this kind of node can receive focus by default. Most nodes are
     295    // not focusable but some elements, such as form controls and links are.
     296    virtual bool supportsFocus() const;
     297    // Whether the node can actually be focused.
    298298    virtual bool isFocusable() const;
    299299    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
  • trunk/WebCore/html/HTMLAnchorElement.cpp

    r48063 r48106  
    6161    if (isContentEditable())
    6262        return HTMLElement::supportsFocus();
    63     return isFocusable() || (isLink() && document() && !document()->haveStylesheetsLoaded());
    64 }
    65 
    66 bool HTMLAnchorElement::isFocusable() const
    67 {
    68     if (isContentEditable())
    69         return HTMLElement::isFocusable();
    70 
    71     // FIXME: Even if we are not visible, we might have a child that is visible.
    72     // Dave wants to fix that some day with a "has visible content" flag or the like.
    73     if (!(isLink() && renderer() && renderer()->style()->visibility() == VISIBLE))
    74         return false;
    75 
    76     return true;
     63    // If not a link we should still be able to focus the element if it has tabIndex.
     64    return isLink() || HTMLElement::supportsFocus();
    7765}
    7866
    7967bool HTMLAnchorElement::isMouseFocusable() const
    8068{
    81 #if PLATFORM(GTK)
     69    // Anchor elements should be mouse focusable, https://bugs.webkit.org/show_bug.cgi?id=26856
     70#if !PLATFORM(GTK)
     71    if (isLink())
     72        return false;
     73#endif
     74    // Allow tab index etc to control focus.
    8275    return HTMLElement::isMouseFocusable();
    83 #else
    84     return false;
    85 #endif
    8676}
    8777
    8878bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const
    8979{
     80    if (!isLink())
     81        return HTMLElement::isKeyboardFocusable(event);
     82
    9083    if (!isFocusable())
    9184        return false;
  • trunk/WebCore/html/HTMLAnchorElement.h

    r47688 r48106  
    6363    virtual bool isMouseFocusable() const;
    6464    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
    65     virtual bool isFocusable() const;
    6665    virtual void defaultEventHandler(Event*);
    6766    virtual void setActive(bool active = true, bool pause = false);
  • trunk/WebCore/html/HTMLAreaElement.cpp

    r47688 r48106  
    163163}
    164164
    165 bool HTMLAreaElement::isFocusable() const
     165bool HTMLAreaElement::supportsFocus() const
    166166{
    167     return HTMLElement::isFocusable();
     167    // Skip HTMLAnchorElements isLink() check.
     168    return HTMLElement::supportsFocus();
    168169}
    169170
  • trunk/WebCore/html/HTMLAreaElement.h

    r47688 r48106  
    5454    virtual int tagPriority() const { return 0; }
    5555    virtual void parseMappedAttribute(MappedAttribute*);
    56     virtual bool isFocusable() const;
     56    virtual bool supportsFocus() const;
    5757    virtual String target() const;
    5858
  • trunk/WebCore/html/HTMLElement.cpp

    r47688 r48106  
    602602}
    603603
    604 bool HTMLElement::isFocusable() const
    605 {
    606     return Element::isFocusable() || (isContentEditable() && parent() && !parent()->isContentEditable());
     604bool HTMLElement::supportsFocus() const
     605{
     606    return Element::supportsFocus() || (isContentEditable() && parent() && !parent()->isContentEditable());
    607607}
    608608
  • trunk/WebCore/html/HTMLElement.h

    r47688 r48106  
    5757    void insertAdjacentText(const String& where, const String& text, ExceptionCode&);
    5858
     59    virtual bool supportsFocus() const;
     60   
    5961    virtual bool isContentEditable() const;
    6062    virtual bool isContentRichlyEditable() const;
     
    8789    virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
    8890    virtual void parseMappedAttribute(MappedAttribute*);
    89 
    90     virtual bool isFocusable() const;
    9191
    9292    virtual bool childAllowed(Node* newChild); // Error-checking during parsing that checks the DTD
  • trunk/WebCore/html/HTMLFieldSetElement.cpp

    r45747 r48106  
    4949}
    5050
    51 bool HTMLFieldSetElement::isFocusable() const
     51bool HTMLFieldSetElement::supportsFocus() const
    5252{
    53     return HTMLElement::isFocusable();
     53    return HTMLElement::supportsFocus();
    5454}
    5555
  • trunk/WebCore/html/HTMLFieldSetElement.h

    r43367 r48106  
    4545    virtual bool checkDTD(const Node* newChild);
    4646
    47     virtual bool isFocusable() const;
     47    virtual bool supportsFocus() const;
    4848    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    4949    virtual const AtomicString& formControlType() const;
  • trunk/WebCore/html/HTMLFormControlElement.cpp

    r47655 r48106  
    233233}
    234234
     235bool HTMLFormControlElement::supportsFocus() const
     236{
     237    return !disabled();
     238}
     239
    235240bool HTMLFormControlElement::isFocusable() const
    236241{
    237     if (disabled() || !renderer() ||
    238         (renderer()->style() && renderer()->style()->visibility() != VISIBLE) ||
     242    if (!renderer() ||
    239243        !renderer()->isBox() || toRenderBox(renderer())->size().isEmpty())
    240244        return false;
    241     return true;
     245    // HTMLElement::isFocusable handles visibility and calls suportsFocus which
     246    // will cover the disabled case.
     247    return HTMLElement::isFocusable();
    242248}
    243249
     
    303309
    304310    HTMLElement::dispatchBlurEvent();
    305 }
    306 
    307 bool HTMLFormControlElement::supportsFocus() const
    308 {
    309     return isFocusable() || (!disabled() && !document()->haveStylesheetsLoaded());
    310311}
    311312
  • trunk/WebCore/html/HTMLFrameElementBase.cpp

    r47469 r48106  
    213213}
    214214
    215 bool HTMLFrameElementBase::isFocusable() const
    216 {
    217     return renderer();
     215bool HTMLFrameElementBase::supportsFocus() const
     216{
     217    return true;
    218218}
    219219
  • trunk/WebCore/html/HTMLFrameElementBase.h

    r47688 r48106  
    5858    virtual bool canLazyAttach() { return false; }
    5959
    60     virtual bool isFocusable() const;
     60    virtual bool supportsFocus() const;
    6161    virtual void setFocus(bool);
    6262   
  • trunk/WebCore/html/HTMLLegendElement.cpp

    r43367 r48106  
    4343}
    4444
    45 bool HTMLLegendElement::isFocusable() const
     45bool HTMLLegendElement::supportsFocus() const
    4646{
    47     return HTMLElement::isFocusable();
     47    return HTMLElement::supportsFocus();
    4848}
    4949
  • trunk/WebCore/html/HTMLLegendElement.h

    r43367 r48106  
    3434    virtual ~HTMLLegendElement();
    3535
    36     virtual bool isFocusable() const;
     36    virtual bool supportsFocus() const;
    3737    virtual const AtomicString& formControlType() const;
    3838    virtual void accessKeyAction(bool sendToAnyElement);
  • trunk/WebCore/html/HTMLOptGroupElement.cpp

    r43367 r48106  
    4545}
    4646
     47bool HTMLOptGroupElement::supportsFocus() const
     48{
     49    return HTMLElement::supportsFocus();
     50}
     51
    4752bool HTMLOptGroupElement::isFocusable() const
    4853{
    49     return HTMLElement::isFocusable();
     54    // Optgroup elements do not have a renderer so we check the renderStyle instead.
     55    return supportsFocus() && renderStyle() && renderStyle()->display() != NONE;
    5056}
    5157
  • trunk/WebCore/html/HTMLOptGroupElement.h

    r43367 r48106  
    3838    virtual bool checkDTD(const Node*);
    3939    virtual const AtomicString& formControlType() const;
     40    virtual bool supportsFocus() const;
    4041    virtual bool isFocusable() const;
    4142    virtual void parseMappedAttribute(MappedAttribute*);
  • trunk/WebCore/html/HTMLOptionElement.cpp

    r47313 r48106  
    6767}
    6868
     69bool HTMLOptionElement::supportsFocus() const
     70{
     71    return HTMLElement::supportsFocus();
     72}
     73
    6974bool HTMLOptionElement::isFocusable() const
    7075{
    71     return HTMLElement::isFocusable();
     76    // Option elements do not have a renderer so we check the renderStyle instead.
     77    return supportsFocus() && renderStyle() && renderStyle()->display() != NONE;
    7278}
    7379
  • trunk/WebCore/html/HTMLOptionElement.h

    r44243 r48106  
    4343    virtual int tagPriority() const { return 2; }
    4444    virtual bool checkDTD(const Node* newChild);
     45    virtual bool supportsFocus() const;
    4546    virtual bool isFocusable() const;
    4647    virtual bool rendererIsNeeded(RenderStyle*) { return false; }
  • trunk/WebCore/page/EventHandler.cpp

    r47594 r48106  
    16801680   
    16811681    if (!swallowEvent && eventType == eventNames().mousedownEvent) {
     1682        // The layout needs to be up to date to determine if an element is focusable.
     1683        m_frame->document()->updateLayoutIgnorePendingStylesheets();
     1684
    16821685        // Blur current focus node when a link/button is clicked; this
    16831686        // is expected by some sites that rely on onChange handlers running
     
    16851688        Node* node = m_nodeUnderMouse.get();
    16861689        RenderObject* renderer = node ? node->renderer() : 0;
    1687                
     1690
    16881691        // Walk up the render tree to search for a node to focus.
    16891692        // Walking up the DOM tree wouldn't work for shadow trees, like those behind the engine-based text fields.
  • trunk/WebCore/page/FocusController.cpp

    r45663 r48106  
    147147        currentNode = frame->selection()->start().node();
    148148
     149    document->updateLayoutIgnorePendingStylesheets();
     150
    149151    Node* node = (direction == FocusDirectionForward)
    150152        ? document->nextFocusableNode(currentNode, event)
  • trunk/WebCore/svg/SVGAElement.cpp

    r45947 r48106  
    166166    if (isContentEditable())
    167167        return SVGStyledTransformableElement::supportsFocus();
    168     return isFocusable() || (document() && !document()->haveStylesheetsLoaded());
     168    return true;
    169169}
    170170
    171171bool SVGAElement::isFocusable() const
    172172{
    173     if (isContentEditable())
    174         return SVGStyledTransformableElement::isFocusable();
     173    if (renderer() && renderer()->absoluteClippedOverflowRect().isEmpty())
     174        return false;
    175175   
    176     // FIXME: Even if we are not visible, we might have a child that is visible.
    177     // Dave wants to fix that some day with a "has visible content" flag or the like.
    178     if (!renderer() || !(renderer()->style()->visibility() == VISIBLE))
    179         return false;
    180    
    181     return !renderer()->absoluteClippedOverflowRect().isEmpty();
     176    return SVGElement::isFocusable();
    182177}
    183178
  • trunk/WebCore/wml/WMLAElement.cpp

    r45947 r48106  
    7474bool WMLAElement::supportsFocus() const
    7575{
    76     return isFocusable() || (isLink() && document() && !document()->haveStylesheetsLoaded());
    77 }
    78 
    79 bool WMLAElement::isFocusable() const
    80 {
    81     // FIXME: Even if we are not visible, we might have a child that is visible.
    82     // Dave wants to fix that some day with a "has visible content" flag or the like.
    83     if (!(isLink() && renderer() && renderer()->style()->visibility() == VISIBLE))
    84         return false;
    85 
    86     return true;
     76    return isLink() || WMLElement::supportsFocus();
    8777}
    8878
  • trunk/WebCore/wml/WMLAElement.h

    r39432 r48106  
    3737
    3838    virtual bool supportsFocus() const;
    39     virtual bool isFocusable() const;
    4039    virtual bool isMouseFocusable() const;
    4140    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
  • trunk/WebCore/wml/WMLFormControlElement.cpp

    r44283 r48106  
    4040}
    4141
     42bool WMLFormControlElement::supportsFocus() const
     43{
     44    return true;
     45}
     46
    4247bool WMLFormControlElement::isFocusable() const
    4348{
     
    4752    if (toRenderBox(renderer())->size().isEmpty())
    4853        return false;
    49 
    50     if (RenderStyle* style = renderer()->style()) {
    51         if (style->visibility() != VISIBLE)
    52             return false;
    53     }
    54 
    55     return true;
     54   
     55    return WMLElement::isFocusable();
    5656}
     57   
    5758
    5859void WMLFormControlElement::attach()
  • trunk/WebCore/wml/WMLFormControlElement.h

    r44283 r48106  
    3939    virtual void setFormControlValueMatchesRenderer(bool b = true) { m_valueMatchesRenderer = b; }
    4040
     41    virtual bool supportsFocus() const;
    4142    virtual bool isFocusable() const;
    4243
Note: See TracChangeset for help on using the changeset viewer.