Changeset 95381 in webkit


Ignore:
Timestamp:
Sep 17, 2011 3:57:17 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Override supportsFocus() for HTMLMediaElement.
https://bugs.webkit.org/show_bug.cgi?id=67190

Patch by Deepak Sherveghar <bpwv64@motorola.com> on 2011-09-17
Reviewed by Antonio Gomes.

Source/WebCore:

Tests: fast/events/media-element-focus-tab.html

fast/spatial-navigation/snav-media-elements.html

Return true from supportsFocus() if control's attribute is present or a tabindex is specified.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::supportsFocus):

  • html/HTMLMediaElement.h:

LayoutTests:

For media elements be able to receive focus without tabindex if
control attribute is present, hence changed
tabindex-focus-blur-all.js and tabindex-focus-blur-all-expected.txt.

  • fast/events/media-element-focus-tab-expected.txt: Added.
  • fast/events/media-element-focus-tab.html: Added.
  • fast/events/resources/tabindex-focus-blur-all.js:

(test):

  • fast/events/tabindex-focus-blur-all-expected.txt:
  • fast/spatial-navigation/snav-media-elements-expected.txt: Added.
  • fast/spatial-navigation/snav-media-elements.html: Added.
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95378 r95381  
     12011-09-17  Deepak Sherveghar  <bpwv64@motorola.com>
     2
     3        Override supportsFocus() for HTMLMediaElement.
     4        https://bugs.webkit.org/show_bug.cgi?id=67190
     5
     6        Reviewed by Antonio Gomes.
     7
     8        For media elements be able to receive focus without tabindex if
     9        control attribute is present, hence changed
     10        tabindex-focus-blur-all.js and tabindex-focus-blur-all-expected.txt.
     11
     12        * fast/events/media-element-focus-tab-expected.txt: Added.
     13        * fast/events/media-element-focus-tab.html: Added.
     14        * fast/events/resources/tabindex-focus-blur-all.js:
     15        (test):
     16        * fast/events/tabindex-focus-blur-all-expected.txt:
     17        * fast/spatial-navigation/snav-media-elements-expected.txt: Added.
     18        * fast/spatial-navigation/snav-media-elements.html: Added.
     19
    1202011-09-17  Csaba Osztrogonác  <ossy@webkit.org>
    221
  • trunk/LayoutTests/fast/events/resources/tabindex-focus-blur-all.js

    r69237 r95381  
    1818                             "ISINDEX",
    1919                             "SELECT",
    20                              "TEXTAREA"];
     20                             "TEXTAREA",
     21                             "AUDIO",
     22                             "VIDEO"];
    2123
    2224var tagNamesTransferFocused = ["LABEL"]; // labels always transfer focus to the labeled element
     
    5355    homeBase[0].focus();
    5456
    55     var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 331 / 331 ";
     57    var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 333 / 333 ";
    5658    resultSummary += (focusCount==blurCount) ? "<span style='color:green'>PASSED</span><br>" : "<span style='color:red'>FAILED</span><br>";
    5759    resultSummary += "Total of "+failedTestCount+" focus test(s) failed.";
  • trunk/LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt

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

    r95373 r95381  
     12011-09-17  Deepak Sherveghar  <bpwv64@motorola.com>
     2
     3        Override supportsFocus() for HTMLMediaElement.
     4        https://bugs.webkit.org/show_bug.cgi?id=67190
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Tests: fast/events/media-element-focus-tab.html
     9               fast/spatial-navigation/snav-media-elements.html
     10
     11        Return true from supportsFocus() if control's attribute is present or a tabindex is specified.
     12
     13        * html/HTMLMediaElement.cpp:
     14        (WebCore::HTMLMediaElement::supportsFocus):
     15        * html/HTMLMediaElement.h:
     16
    1172011-09-16  Adam Barth  <abarth@webkit.org>
    218
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r94787 r95381  
    244244    document()->registerForMediaVolumeCallbacks(this);
    245245    HTMLElement::didMoveToNewOwnerDocument();
     246}
     247
     248bool HTMLMediaElement::supportsFocus() const
     249{
     250    // If no controls specified, we should still be able to focus the element if it has tabIndex.
     251    return controls() ||  HTMLElement::supportsFocus();
    246252}
    247253
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r94787 r95381  
    250250    void createMediaPlayer();
    251251
     252    virtual bool supportsFocus() const;
    252253    virtual void attributeChanged(Attribute*, bool preserveDecls);
    253254    virtual bool rendererIsNeeded(const NodeRenderingContext&);
Note: See TracChangeset for help on using the changeset viewer.