Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
fast/events/tabindex-focus-blur-all.html<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2013-09-08 04:22:45 +00:00
|
|
|
<script src="../resources/js-test-pre.js"></script>
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32292">bug 32292</a>:
|
|
|
|
"Unable to focus on embedded plugins such as Flash via javascript focus()"</p>
|
|
|
|
<p>This tests focusing Embeds and Objects. See LayoutTests/java for Applet elements.</p>
|
|
|
|
<div id=embedOwner>
|
Make tabIndex IDL attribute reflect its content attribute
https://bugs.webkit.org/show_bug.cgi?id=199606
<rdar://problem/52811448>
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaselined now that test cases for summary are passing.
Source/WebCore:
This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
content attribute with some elements having 0 as the default tab index (see r248784):
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
editing host in HTML5 spec term), body element in design mode, and media elements with
media controls would start returning -1 instead of 0.
Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
when supportsFocus returned true. The effect, if any, this patch has on each element which
overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):
HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
HTMLAreaElement -> Ditto.
HTMLBodyElement -> Changes to return -1 in design mode.
HTMLElement -> Changes to return -1 on a root editable element.
HTMLFormControlElement
HTMLButtonElement -> No effect since defaultTabIndex returns 0.
HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFormControlElementWithState
HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
HTMLSelectElement -> Ditto.
HTMLTextFormControlElement -> Ditto.
HTMLInputElement -> Ditto.
HTMLTextAreaElement -> Ditto.
HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
to returns 0.
HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
HTMLMediaElement - Changes to return -1 when media controls is present.
HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
supportsFocus as well as the HTML5 specification.
MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
SVGAElement - No effect since defaultTabIndex returns 0.
SVGClipPathElement - No effect since it always returns false.
SVGDefsElement - No effect since it always returns false.
Tests: fast/dom/tabindex-defaults.html
plugins/focus.html
* dom/Element.cpp:
(WebCore::Element::tabIndexForBindings const): Made the change.
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
* html/HTMLFrameElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
* html/HTMLIFrameElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
* html/HTMLObjectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
is the active summary element of the details element.
* html/HTMLSummaryElement.h:
LayoutTests:
Added test cases and assertions.
* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html: Added test cases for iframe, frame, object, video, summary, and SVG elements.
Also blur the active element to avoid any race conditions.
* plugins/focus-expected.txt:
* plugins/focus.html:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Made the sequential navigation code not rely on tabIndex IDL attribute.
Canonical link: https://commits.webkit.org/214934@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-29 03:14:24 +00:00
|
|
|
<embed id="embedElem" type="application/x-webkit-test-netscape" width=100 height=100 shouldFocus=true data-expected-tabindex=-1></embed>
|
|
|
|
<object id="objectElem" type="application/x-webkit-test-netscape" windowedPlugin="false" width=100 height=100 shouldFocus=true data-expected-tabindex=0></object>
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
|
Make tabIndex IDL attribute reflect its content attribute
https://bugs.webkit.org/show_bug.cgi?id=199606
<rdar://problem/52811448>
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaselined now that test cases for summary are passing.
Source/WebCore:
This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
content attribute with some elements having 0 as the default tab index (see r248784):
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
editing host in HTML5 spec term), body element in design mode, and media elements with
media controls would start returning -1 instead of 0.
Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
when supportsFocus returned true. The effect, if any, this patch has on each element which
overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):
HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
HTMLAreaElement -> Ditto.
HTMLBodyElement -> Changes to return -1 in design mode.
HTMLElement -> Changes to return -1 on a root editable element.
HTMLFormControlElement
HTMLButtonElement -> No effect since defaultTabIndex returns 0.
HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFormControlElementWithState
HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
HTMLSelectElement -> Ditto.
HTMLTextFormControlElement -> Ditto.
HTMLInputElement -> Ditto.
HTMLTextAreaElement -> Ditto.
HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
to returns 0.
HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
HTMLMediaElement - Changes to return -1 when media controls is present.
HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
supportsFocus as well as the HTML5 specification.
MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
SVGAElement - No effect since defaultTabIndex returns 0.
SVGClipPathElement - No effect since it always returns false.
SVGDefsElement - No effect since it always returns false.
Tests: fast/dom/tabindex-defaults.html
plugins/focus.html
* dom/Element.cpp:
(WebCore::Element::tabIndexForBindings const): Made the change.
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
* html/HTMLFrameElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
* html/HTMLIFrameElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
* html/HTMLObjectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
is the active summary element of the details element.
* html/HTMLSummaryElement.h:
LayoutTests:
Added test cases and assertions.
* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html: Added test cases for iframe, frame, object, video, summary, and SVG elements.
Also blur the active element to avoid any race conditions.
* plugins/focus-expected.txt:
* plugins/focus.html:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Made the sequential navigation code not rely on tabIndex IDL attribute.
Canonical link: https://commits.webkit.org/214934@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-29 03:14:24 +00:00
|
|
|
<embed id="embedElemWithFallbackContents" type="application/x-webkit-test-netscape" width=100 height=100 shouldFocus=true data-expected-tabindex=-1>Fallback contents.</embed>
|
|
|
|
<object id="objectElemWithFallbackContents" type="application/x-webkit-test-netscape" windowedPlugin="false" width=100 height=100 shouldFocus=true data-expected-tabindex=0>Fallback contents.</object>
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
|
Make tabIndex IDL attribute reflect its content attribute
https://bugs.webkit.org/show_bug.cgi?id=199606
<rdar://problem/52811448>
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaselined now that test cases for summary are passing.
Source/WebCore:
This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
content attribute with some elements having 0 as the default tab index (see r248784):
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
editing host in HTML5 spec term), body element in design mode, and media elements with
media controls would start returning -1 instead of 0.
Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
when supportsFocus returned true. The effect, if any, this patch has on each element which
overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):
HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
HTMLAreaElement -> Ditto.
HTMLBodyElement -> Changes to return -1 in design mode.
HTMLElement -> Changes to return -1 on a root editable element.
HTMLFormControlElement
HTMLButtonElement -> No effect since defaultTabIndex returns 0.
HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFormControlElementWithState
HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
HTMLSelectElement -> Ditto.
HTMLTextFormControlElement -> Ditto.
HTMLInputElement -> Ditto.
HTMLTextAreaElement -> Ditto.
HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
to returns 0.
HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
HTMLMediaElement - Changes to return -1 when media controls is present.
HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
supportsFocus as well as the HTML5 specification.
MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
SVGAElement - No effect since defaultTabIndex returns 0.
SVGClipPathElement - No effect since it always returns false.
SVGDefsElement - No effect since it always returns false.
Tests: fast/dom/tabindex-defaults.html
plugins/focus.html
* dom/Element.cpp:
(WebCore::Element::tabIndexForBindings const): Made the change.
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
* html/HTMLFrameElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
* html/HTMLIFrameElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
* html/HTMLObjectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
is the active summary element of the details element.
* html/HTMLSummaryElement.h:
LayoutTests:
Added test cases and assertions.
* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html: Added test cases for iframe, frame, object, video, summary, and SVG elements.
Also blur the active element to avoid any race conditions.
* plugins/focus-expected.txt:
* plugins/focus.html:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Made the sequential navigation code not rely on tabIndex IDL attribute.
Canonical link: https://commits.webkit.org/214934@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-29 03:14:24 +00:00
|
|
|
<embed id="noPluginEmbedElem" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 shouldFocus=false data-expected-tabindex=-1></embed>
|
|
|
|
<object id="noPluginObjectElem" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 shouldFocus=false data-expected-tabindex=0></object>
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
|
Make tabIndex IDL attribute reflect its content attribute
https://bugs.webkit.org/show_bug.cgi?id=199606
<rdar://problem/52811448>
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaselined now that test cases for summary are passing.
Source/WebCore:
This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
content attribute with some elements having 0 as the default tab index (see r248784):
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
editing host in HTML5 spec term), body element in design mode, and media elements with
media controls would start returning -1 instead of 0.
Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
when supportsFocus returned true. The effect, if any, this patch has on each element which
overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):
HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
HTMLAreaElement -> Ditto.
HTMLBodyElement -> Changes to return -1 in design mode.
HTMLElement -> Changes to return -1 on a root editable element.
HTMLFormControlElement
HTMLButtonElement -> No effect since defaultTabIndex returns 0.
HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFormControlElementWithState
HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
HTMLSelectElement -> Ditto.
HTMLTextFormControlElement -> Ditto.
HTMLInputElement -> Ditto.
HTMLTextAreaElement -> Ditto.
HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
to returns 0.
HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
HTMLMediaElement - Changes to return -1 when media controls is present.
HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
supportsFocus as well as the HTML5 specification.
MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
SVGAElement - No effect since defaultTabIndex returns 0.
SVGClipPathElement - No effect since it always returns false.
SVGDefsElement - No effect since it always returns false.
Tests: fast/dom/tabindex-defaults.html
plugins/focus.html
* dom/Element.cpp:
(WebCore::Element::tabIndexForBindings const): Made the change.
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
* html/HTMLFrameElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
* html/HTMLIFrameElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
* html/HTMLObjectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
is the active summary element of the details element.
* html/HTMLSummaryElement.h:
LayoutTests:
Added test cases and assertions.
* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html: Added test cases for iframe, frame, object, video, summary, and SVG elements.
Also blur the active element to avoid any race conditions.
* plugins/focus-expected.txt:
* plugins/focus.html:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Made the sequential navigation code not rely on tabIndex IDL attribute.
Canonical link: https://commits.webkit.org/214934@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-29 03:14:24 +00:00
|
|
|
<embed id="noPluginEmbedElemWithFallbackContents" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 shouldFocus=false data-expected-tabindex=-1>Fallback contents.</embed>
|
|
|
|
<object id="noPluginObjectElemWithFallbackContents" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 shouldFocus=false data-expected-tabindex=0>Fallback contents.</object>
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
|
Make tabIndex IDL attribute reflect its content attribute
https://bugs.webkit.org/show_bug.cgi?id=199606
<rdar://problem/52811448>
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaselined now that test cases for summary are passing.
Source/WebCore:
This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
content attribute with some elements having 0 as the default tab index (see r248784):
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
editing host in HTML5 spec term), body element in design mode, and media elements with
media controls would start returning -1 instead of 0.
Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
when supportsFocus returned true. The effect, if any, this patch has on each element which
overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):
HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
HTMLAreaElement -> Ditto.
HTMLBodyElement -> Changes to return -1 in design mode.
HTMLElement -> Changes to return -1 on a root editable element.
HTMLFormControlElement
HTMLButtonElement -> No effect since defaultTabIndex returns 0.
HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFormControlElementWithState
HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
HTMLSelectElement -> Ditto.
HTMLTextFormControlElement -> Ditto.
HTMLInputElement -> Ditto.
HTMLTextAreaElement -> Ditto.
HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
to returns 0.
HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
HTMLMediaElement - Changes to return -1 when media controls is present.
HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
supportsFocus as well as the HTML5 specification.
MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
SVGAElement - No effect since defaultTabIndex returns 0.
SVGClipPathElement - No effect since it always returns false.
SVGDefsElement - No effect since it always returns false.
Tests: fast/dom/tabindex-defaults.html
plugins/focus.html
* dom/Element.cpp:
(WebCore::Element::tabIndexForBindings const): Made the change.
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
* html/HTMLFrameElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
* html/HTMLIFrameElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
* html/HTMLObjectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
is the active summary element of the details element.
* html/HTMLSummaryElement.h:
LayoutTests:
Added test cases and assertions.
* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html: Added test cases for iframe, frame, object, video, summary, and SVG elements.
Also blur the active element to avoid any race conditions.
* plugins/focus-expected.txt:
* plugins/focus.html:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Made the sequential navigation code not rely on tabIndex IDL attribute.
Canonical link: https://commits.webkit.org/214934@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-29 03:14:24 +00:00
|
|
|
<embed id="noPluginEmbedElemWithTabindex" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 tabindex=-1 shouldFocus=true data-expected-tabindex=-1></embed>
|
|
|
|
<object id="noPluginObjectElemWithTabindex" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 tabindex=-1 shouldFocus=true data-expected-tabindex=-1></object>
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
|
Make tabIndex IDL attribute reflect its content attribute
https://bugs.webkit.org/show_bug.cgi?id=199606
<rdar://problem/52811448>
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaselined now that test cases for summary are passing.
Source/WebCore:
This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
content attribute with some elements having 0 as the default tab index (see r248784):
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
editing host in HTML5 spec term), body element in design mode, and media elements with
media controls would start returning -1 instead of 0.
Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
when supportsFocus returned true. The effect, if any, this patch has on each element which
overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):
HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
HTMLAreaElement -> Ditto.
HTMLBodyElement -> Changes to return -1 in design mode.
HTMLElement -> Changes to return -1 on a root editable element.
HTMLFormControlElement
HTMLButtonElement -> No effect since defaultTabIndex returns 0.
HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFormControlElementWithState
HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
HTMLSelectElement -> Ditto.
HTMLTextFormControlElement -> Ditto.
HTMLInputElement -> Ditto.
HTMLTextAreaElement -> Ditto.
HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
to returns 0.
HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
HTMLMediaElement - Changes to return -1 when media controls is present.
HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
supportsFocus as well as the HTML5 specification.
MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
SVGAElement - No effect since defaultTabIndex returns 0.
SVGClipPathElement - No effect since it always returns false.
SVGDefsElement - No effect since it always returns false.
Tests: fast/dom/tabindex-defaults.html
plugins/focus.html
* dom/Element.cpp:
(WebCore::Element::tabIndexForBindings const): Made the change.
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
* html/HTMLFrameElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
* html/HTMLIFrameElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
* html/HTMLObjectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
is the active summary element of the details element.
* html/HTMLSummaryElement.h:
LayoutTests:
Added test cases and assertions.
* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html: Added test cases for iframe, frame, object, video, summary, and SVG elements.
Also blur the active element to avoid any race conditions.
* plugins/focus-expected.txt:
* plugins/focus.html:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Made the sequential navigation code not rely on tabIndex IDL attribute.
Canonical link: https://commits.webkit.org/214934@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-29 03:14:24 +00:00
|
|
|
<embed id="noPluginEmbedElemWithContenteditable" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 contenteditable=true shouldFocus=true data-expected-tabindex=-1></embed>
|
|
|
|
<object id="noPluginObjectElemWithContenteditable" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 contenteditable=true shouldFocus=true data-expected-tabindex=0></object>
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
description("Test for Embed and Object for bug 32292: Unable to focus on embedded plugins such as Flash via javascript focus().");
|
|
|
|
|
|
|
|
function RunTest() {
|
|
|
|
var owner = document.getElementById("embedOwner");
|
|
|
|
for (var i = 0; i < owner.childNodes.length; ++i) {
|
|
|
|
pluginElement = owner.childNodes[i];
|
|
|
|
if (pluginElement.id) {
|
|
|
|
pluginElement.focus();
|
|
|
|
shouldBe('"' + pluginElement.id + '"; document.activeElement === pluginElement',
|
|
|
|
pluginElement.getAttribute("shouldFocus").toString());
|
Make tabIndex IDL attribute reflect its content attribute
https://bugs.webkit.org/show_bug.cgi?id=199606
<rdar://problem/52811448>
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaselined now that test cases for summary are passing.
Source/WebCore:
This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
content attribute with some elements having 0 as the default tab index (see r248784):
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
editing host in HTML5 spec term), body element in design mode, and media elements with
media controls would start returning -1 instead of 0.
Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
when supportsFocus returned true. The effect, if any, this patch has on each element which
overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):
HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
HTMLAreaElement -> Ditto.
HTMLBodyElement -> Changes to return -1 in design mode.
HTMLElement -> Changes to return -1 on a root editable element.
HTMLFormControlElement
HTMLButtonElement -> No effect since defaultTabIndex returns 0.
HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFormControlElementWithState
HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
HTMLSelectElement -> Ditto.
HTMLTextFormControlElement -> Ditto.
HTMLInputElement -> Ditto.
HTMLTextAreaElement -> Ditto.
HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
to returns 0.
HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
HTMLMediaElement - Changes to return -1 when media controls is present.
HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
supportsFocus as well as the HTML5 specification.
MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
SVGAElement - No effect since defaultTabIndex returns 0.
SVGClipPathElement - No effect since it always returns false.
SVGDefsElement - No effect since it always returns false.
Tests: fast/dom/tabindex-defaults.html
plugins/focus.html
* dom/Element.cpp:
(WebCore::Element::tabIndexForBindings const): Made the change.
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
* html/HTMLFrameElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
* html/HTMLIFrameElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
* html/HTMLObjectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
is the active summary element of the details element.
* html/HTMLSummaryElement.h:
LayoutTests:
Added test cases and assertions.
* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html: Added test cases for iframe, frame, object, video, summary, and SVG elements.
Also blur the active element to avoid any race conditions.
* plugins/focus-expected.txt:
* plugins/focus.html:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Made the sequential navigation code not rely on tabIndex IDL attribute.
Canonical link: https://commits.webkit.org/214934@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-29 03:14:24 +00:00
|
|
|
shouldBe('pluginElement.tabIndex', 'parseInt(pluginElement.getAttribute("data-expected-tabindex"))');
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
pluginElement.blur();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", RunTest, false);
|
|
|
|
|
|
|
|
</script>
|
2013-09-08 04:22:45 +00:00
|
|
|
<script src="../resources/js-test-post.js"></script>
|
Unable to focus on embedded plugins such as Flash via javascript focus()
https://bugs.webkit.org/show_bug.cgi?id=32292
Patch by Dave Michael <dmichael@chromium.org> on 2013-04-03
Reviewed by Ryosuke Niwa.
Source/WebCore:
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
java/focus.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::supportsFocus):
Overridden to return true except when the plugin content has failed to load.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::useFallbackContent):
Moved up from HTMLPlugInImageElement.
(WebCore::HTMLPlugInElement::supportsFocus):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInImageElement::useFallbackContent):
Removed. Now the implementation is inherited from HTMLPlugInElement.
LayoutTests:
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.
Canonical link: https://commits.webkit.org/132250@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-03 22:35:36 +00:00
|
|
|
</body>
|
|
|
|
</html>
|