Changeset 69237 in webkit


Ignore:
Timestamp:
Oct 6, 2010 3:09:04 PM (14 years ago)
Author:
Chris Fleizach
Message:

REGRESSION (r53857): AREA tag with tabindex="-1" displays focus ring after multiple mouse clicks.
https://bugs.webkit.org/show_bug.cgi?id=45832

Reviewed by Beth Dakin.

WebCore:

Test: fast/events/mouse-focus-imagemap.html

  • html/HTMLAreaElement.cpp:

(WebCore::HTMLAreaElement::isKeyboardFocusable):
(WebCore::HTMLAreaElement::isMouseFocusable):
(WebCore::HTMLAreaElement::isFocusable):
(WebCore::HTMLAreaElement::updateFocusAppearance):

  • html/HTMLAreaElement.h:

LayoutTests:

  • fast/events/mouse-focus-imagemap-expected.txt: Added.
  • fast/events/mouse-focus-imagemap.html: Added.
  • fast/events/resources/tabindex-focus-blur-all.js:

(testProgrammaticFocus):

  • fast/events/tabindex-focus-blur-all-expected.txt:

Update test to reflect that AREA with tabindex=-1 should not be focusable.

Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69231 r69237  
     12010-10-06  Chris Fleizach  <cfleizach@apple.com>
     2
     3        Reviewed by Beth Dakin.
     4
     5        REGRESSION (r53857): AREA tag with tabindex="-1" displays focus ring after multiple mouse clicks.
     6        https://bugs.webkit.org/show_bug.cgi?id=45832
     7
     8        * fast/events/mouse-focus-imagemap-expected.txt: Added.
     9        * fast/events/mouse-focus-imagemap.html: Added.
     10        * fast/events/resources/tabindex-focus-blur-all.js:
     11        (testProgrammaticFocus):
     12        * fast/events/tabindex-focus-blur-all-expected.txt:
     13            Update test to reflect that AREA with tabindex=-1 should not be focusable.
     14
    1152010-10-06  Albert J. Wong  <ajwong@chromium.org>
    216
  • trunk/LayoutTests/fast/events/resources/tabindex-focus-blur-all.js

    r53857 r69237  
    5353    homeBase[0].focus();
    5454
    55     var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 337 / 337 ";
     55    var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 331 / 331 ";
    5656    resultSummary += (focusCount==blurCount) ? "<span style='color:green'>PASSED</span><br>" : "<span style='color:red'>FAILED</span><br>";
    5757    resultSummary += "Total of "+failedTestCount+" focus test(s) failed.";
     
    111111        elemThatShouldFocus = null;
    112112
     113    // AREA elements with tabindex = -1 should not be focusable.
     114    if (elem.tabIndex == -1 && elem.tagName == "AREA")
     115        elemThatShouldFocus = null;
     116
    113117    if (tagNamesTransferFocused.find(elem.tagName)) {
    114118        elemThatShouldFocus = null;
  • trunk/LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt

    r64712 r69237  
    1 333 focus / 333 blur events dispatched, and should be 337 / 337 PASSED
     1331 focus / 331 blur events dispatched, and should be 331 / 331 PASSED
    22Total of 0 focus test(s) failed. PASSED
  • trunk/WebCore/ChangeLog

    r69235 r69237  
     12010-10-06  Chris Fleizach  <cfleizach@apple.com>
     2
     3        Reviewed by Beth Dakin.
     4
     5        REGRESSION (r53857): AREA tag with tabindex="-1" displays focus ring after multiple mouse clicks.
     6        https://bugs.webkit.org/show_bug.cgi?id=45832
     7
     8        Test: fast/events/mouse-focus-imagemap.html
     9
     10        * html/HTMLAreaElement.cpp:
     11        (WebCore::HTMLAreaElement::isKeyboardFocusable):
     12        (WebCore::HTMLAreaElement::isMouseFocusable):
     13        (WebCore::HTMLAreaElement::isFocusable):
     14        (WebCore::HTMLAreaElement::updateFocusAppearance):
     15        * html/HTMLAreaElement.h:
     16
    1172010-10-06  David Hyatt  <hyatt@apple.com>
    218
  • trunk/WebCore/html/HTMLAreaElement.cpp

    r65916 r69237  
    175175bool HTMLAreaElement::isKeyboardFocusable(KeyboardEvent*) const
    176176{
    177     return supportsFocus();
     177    return isFocusable();
     178}
     179   
     180bool HTMLAreaElement::isMouseFocusable() const
     181{
     182    return isFocusable();
    178183}
    179184
    180185bool HTMLAreaElement::isFocusable() const
    181186{
    182     return supportsFocus();
     187    return supportsFocus() && Element::tabIndex() >= 0;
    183188}
    184189   
     
    193198void HTMLAreaElement::updateFocusAppearance(bool restorePreviousSelection)
    194199{
     200    if (!isFocusable())
     201        return;
     202   
    195203    Node* parent = parentNode();
    196204    if (!parent || !parent->hasTagName(mapTag))
  • trunk/WebCore/html/HTMLAreaElement.h

    r66057 r69237  
    5555    virtual String target() const;
    5656    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
     57    virtual bool isMouseFocusable() const;
    5758    virtual bool isFocusable() const;
    5859    virtual void updateFocusAppearance(bool /*restorePreviousSelection*/);
Note: See TracChangeset for help on using the changeset viewer.