• commit-queue@webkit.org's avatar
    Unable to focus on embedded plugins such as Flash via javascript focus() · fefc6dd6
    commit-queue@webkit.org authored
    Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
    Reviewed by Ryosuke Niwa.
    Make embed, object, and applet elements support focus() when
    appropriate. Prior to this patch, javascript focus() had no effect on
    embed, object, or applet elements unless tabindex or contenteditable is
    set. With this patch, focus() will focus the element unless the plugin
    content has failed to load (i.e., we are showing either fallback content
    or an unavailable plugin indicator).
    Test: plugins/focus.html
    * html/HTMLPlugInElement.cpp:
    Overridden to return true except when the plugin content has failed to load.
    * html/HTMLPlugInElement.h:
    Moved up from HTMLPlugInImageElement.
    * html/HTMLPlugInElement.h:
    Removed. Now the implementation is inherited from HTMLPlugInElement.
    Add/update testing to ensure embed, object, and applet tags now support
    focus except when plugin content did not load.
    * fast/events/resources/tabindex-focus-blur-all-frame1.html: Change embed and object
        elements to reference an invalid plugin, to be consistent with applet. These
        element types are not focusable when there is valid plugin content.
    * fast/events/resources/tabindex-focus-blur-all-frame2.html: Same as above.
    * fast/events/resources/tabindex-focus-blur-all-iframe1.html: Same as above.
    * fast/events/resources/tabindex-focus-blur-all-iframe2.html: Same as above.
    * java/focus-expected.txt: Added.
    * java/focus.html: Added.
    * plugins/focus-expected.txt: Added.
    * plugins/focus.html: Added.
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc