haikuwebkit/LayoutTests/plugins/focus.html

54 lines
3.4 KiB
HTML
Raw Permalink Normal View History

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">
Change LayoutTests' m*-p* files to use pre and post js files in LayoutTests/resources. https://bugs.webkit.org/show_bug.cgi?id=120899. Rubber stamped by Filip Pizlo. * media/W3C/w3cwrapper.js: * media/network-no-source-const-shadow.html: * media/nodesFromRect-shadowContent.html: * media/track/track-node-add-remove.html: * media/video-buffered-too-few-arguments.html: * media/video-canvas-source.html: * networkinformation/add-listener-from-callback.html: * networkinformation/basic-all-types-of-events.html: * networkinformation/basic-operation.html: * networkinformation/event-after-navigation.html: * networkinformation/multiple-frames.html: * networkinformation/updates.html: * networkinformation/window-property.html: * platform/blackberry/editing/text-iterator/findString-markers.html: * platform/blackberry/external/search-provider/search-provider-installed.html: * platform/gtk/accessibility/aria-listbox-crash.html: * platform/gtk/accessibility/aria-options-and-menuitems-crash.html: * platform/gtk/accessibility/aria-roles-unignored.html: * platform/gtk/accessibility/aria-slider-required-attributes.html: * platform/gtk/accessibility/aria-table-hierarchy.html: * platform/gtk/accessibility/aria-toggle-button-role.html: * platform/gtk/accessibility/button-accessible-name.html: * platform/gtk/accessibility/caret-browsing-select-focus.html: * platform/gtk/accessibility/caret-browsing-text-focus.html: * platform/gtk/accessibility/combo-box-collapsed-selection-changed.html: * platform/gtk/accessibility/entry-and-password.html: * platform/gtk/accessibility/list-items-always-exposed.html: * platform/gtk/accessibility/media-controls-panel-title.html: * platform/gtk/accessibility/name-from-label.html: * platform/gtk/accessibility/object-attributes.html: * platform/gtk/accessibility/object-with-title.html: * platform/gtk/accessibility/remapped-aria-crash.html: * platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html: * platform/gtk/accessibility/spans-paragraphs-and-divs.html: * platform/gtk/accessibility/spans.html: * platform/gtk/accessibility/table-hierarchy.html: * platform/gtk/accessibility/title-and-alt.html: * platform/gtk/accessibility/unknown-roles-not-exposed.html: * platform/gtk/editing/pasteboard/middle-click-onpaste.html: * platform/gtk/editing/pasteboard/script-tests/TEMPLATE.html: * platform/gtk/editing/selection/caret-mode-document-begin-end.html: * platform/iphone-simulator/accessibility/accessibility-aria-table-children.html: * platform/iphone-simulator/accessibility/accessibility-crash-in-axcontainer.html: * platform/iphone-simulator/accessibility/accessibility-hint.html: * platform/iphone-simulator/accessibility/aria-label-with-internal-text.html: * platform/iphone-simulator/accessibility/aria-pressed-state.html: * platform/iphone-simulator/accessibility/centerpoint.html: * platform/iphone-simulator/accessibility/dom-focus-fires-on-correct-element.html: * platform/iphone-simulator/accessibility/element-paths.html: * platform/iphone-simulator/accessibility/file-upload-button.html: * platform/iphone-simulator/accessibility/focus-change-notifications.html: * platform/iphone-simulator/accessibility/header-elements.html: * platform/iphone-simulator/accessibility/identifier.html: * platform/iphone-simulator/accessibility/internal-link.html: * platform/iphone-simulator/accessibility/landmark-type.html: * platform/iphone-simulator/accessibility/link-with-images-text.html: * platform/iphone-simulator/accessibility/link-with-only-image.html: * platform/iphone-simulator/accessibility/math.html: * platform/iphone-simulator/accessibility/mixed-checkboxes.html: * platform/iphone-simulator/accessibility/password-value.html: * platform/iphone-simulator/accessibility/placeholder-value.html: * platform/iphone-simulator/accessibility/popup-button-value-label.html: * platform/iphone-simulator/accessibility/progressbar.html: * platform/iphone-simulator/accessibility/radio-button.html: * platform/iphone-simulator/accessibility/selected-buttons.html: * platform/iphone-simulator/accessibility/selected-text.html: * platform/iphone-simulator/accessibility/svg-group-element-with-title.html: * platform/iphone-simulator/accessibility/svg-path-crash.html: * platform/iphone-simulator/accessibility/tab-role.html: * platform/iphone-simulator/accessibility/table-cell-for-row-col.html: * platform/iphone-simulator/accessibility/table-cell-ranges.html: * platform/iphone-simulator/accessibility/tables-lists.html: * platform/iphone-simulator/accessibility/text-line-no-ignored-elements.html: * platform/iphone-simulator/accessibility/text-marker-list-item.html: * platform/iphone-simulator/accessibility/text-marker-validation.html: * platform/iphone-simulator/accessibility/text-role.html: * platform/iphone-simulator/accessibility/textfield-in-axvalue.html: * platform/iphone-simulator/accessibility/url-test.html: * platform/mac-wk2/plugins/asychronous-deadlock-with-timer-and-evaluate.html: * platform/mac-wk2/plugins/asynchronous-destroy-before-initialization.html: * platform/mac-wk2/plugins/contents-scale-factor.html: * platform/mac-wk2/plugins/destroy-during-async-npp-new.html: * platform/mac-wk2/plugins/npp-setwindow-called-on-scroll.html: * platform/mac-wk2/plugins/npruntime/remove-property-from-javascript.html: * platform/mac-wk2/plugins/script-object-access-fails-during-slow-initialization.html: * platform/mac-wk2/plugins/slow/asynchronous-plugin-initialization-multiple.html: * platform/mac-wk2/plugins/slow/asynchronous-plugin-initialization.html: * platform/mac-wk2/plugins/slow/resources/asynchronous-plugin-initialization-multiple-finish.html: * platform/mac/accessibility/area-with-aria-label.html: * platform/mac/accessibility/aria-alerts.html: * platform/mac/accessibility/aria-columnrowheaders.html: * platform/mac/accessibility/aria-directory.html: * platform/mac/accessibility/aria-divs-not-ignored.html: * platform/mac/accessibility/aria-drag-drop.html: * platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html: * platform/mac/accessibility/aria-expanded-notifications.html: * platform/mac/accessibility/aria-expanded-standard-items.html: * platform/mac/accessibility/aria-flowto.html: * platform/mac/accessibility/aria-grid-with-strange-hierarchy.html: * platform/mac/accessibility/aria-grouping-roles.html: * platform/mac/accessibility/aria-hidden-changes-for-non-ignored-elements.html: * platform/mac/accessibility/aria-image-emits-object-replacement.html: * platform/mac/accessibility/aria-label-overrides-visible-text.html: * platform/mac/accessibility/aria-listbox-selectedchildren-change.html: * platform/mac/accessibility/aria-liveregion-marquee-default.html: * platform/mac/accessibility/aria-liveregion-on-image.html: * platform/mac/accessibility/aria-liveregions-addedelement.html: * platform/mac/accessibility/aria-liveregions-attributes.html: * platform/mac/accessibility/aria-liveregions-changedalt.html: * platform/mac/accessibility/aria-liveregions-changedtext.html: * platform/mac/accessibility/aria-liveregions-notifications-always-sent.html: * platform/mac/accessibility/aria-liveregions-notifications.html: * platform/mac/accessibility/aria-liveregions-removedelement.html: * platform/mac/accessibility/aria-menu-role-descriptions.html: * platform/mac/accessibility/aria-menubar.html: * platform/mac/accessibility/aria-menuitem-checked-value.html: * platform/mac/accessibility/aria-multiline.html: * platform/mac/accessibility/aria-multiselectable.html: * platform/mac/accessibility/aria-owns.html: * platform/mac/accessibility/aria-popup-buttons-on-native-elements.html: * platform/mac/accessibility/aria-popup.html: * platform/mac/accessibility/aria-radiobutton-text.html: * platform/mac/accessibility/aria-radiogroup.html: * platform/mac/accessibility/aria-required-popup-button.html: * platform/mac/accessibility/aria-setsize-posinset.html: * platform/mac/accessibility/aria-slider-value-change.html: * platform/mac/accessibility/aria-spinbutton-crash.html: * platform/mac/accessibility/aria-table-with-colspan-cells.html: * platform/mac/accessibility/aria-toolbar.html: * platform/mac/accessibility/aria-tree-activedescendant.html: * platform/mac/accessibility/aria-tree-index-of-items.html: * platform/mac/accessibility/aria-tree.html: * platform/mac/accessibility/aria-treegrid.html: * platform/mac/accessibility/aria-valuetext-on-native-slider.html: * platform/mac/accessibility/aria-valuetext.html: * platform/mac/accessibility/attributed-string-includes-highlighting.html: * platform/mac/accessibility/attributed-string-includes-misspelled-with-selection.html: * platform/mac/accessibility/button-shouldnot-have-axvalue.html: * platform/mac/accessibility/clipped-text-under-element.html: * platform/mac/accessibility/combobox-activedescendant-notifications.html: * platform/mac/accessibility/combox-box-value.html: * platform/mac/accessibility/content-editable-range-properties.html: * platform/mac/accessibility/crash-in-element-for-text-marker.html: * platform/mac/accessibility/crash-invalid-text-marker-node.html: * platform/mac/accessibility/css-content-attribute.html: * platform/mac/accessibility/css-speech-speak.html: * platform/mac/accessibility/definition-list-term.html: * platform/mac/accessibility/div-containing-div-with-aria.html: * platform/mac/accessibility/document-title-used-for-description.html: * platform/mac/accessibility/editable-webarea-context-menu-point.html: * platform/mac/accessibility/element-focus.html: * platform/mac/accessibility/element-for-text-marker.html: * platform/mac/accessibility/element-is-ignored.html: * platform/mac/accessibility/element-level.html: * platform/mac/accessibility/element-paths.html: * platform/mac/accessibility/estimated-progress.html: * platform/mac/accessibility/file-upload-button-subrole.html: * platform/mac/accessibility/footer-roledescription.html: * platform/mac/accessibility/footer.html: * platform/mac/accessibility/form-control-value-settable.html: * platform/mac/accessibility/frame-with-title.html: * platform/mac/accessibility/header.html: * platform/mac/accessibility/heading-clickpoint.html: * platform/mac/accessibility/html-section-elements.html: * platform/mac/accessibility/html-slider-indicator.html: * platform/mac/accessibility/html-with-aria-label.html: * platform/mac/accessibility/html5-input-number.html: * platform/mac/accessibility/iframe-aria-hidden.html: * platform/mac/accessibility/iframe-with-title-correct-hierarchy.html: * platform/mac/accessibility/inherited-presentational-lists.html: * platform/mac/accessibility/input-title.html: * platform/mac/accessibility/internal-link-when-document-has-fragment.html: * platform/mac/accessibility/label-element-with-hidden-control.html: * platform/mac/accessibility/link-with-title.html: * platform/mac/accessibility/list-items-ignored.html: * platform/mac/accessibility/listbox-hit-test.html: * platform/mac/accessibility/listmarker-suffix.html: * platform/mac/accessibility/live-region-on-span.html: * platform/mac/accessibility/main-element.html: * platform/mac/accessibility/math-alttext.html: * platform/mac/accessibility/mathml-elements.html: * platform/mac/accessibility/mathml-line-fraction.html: * platform/mac/accessibility/mathml-multiscript.html: * platform/mac/accessibility/misspelled-attributed-string.html: * platform/mac/accessibility/mixed-checkbox.html: * platform/mac/accessibility/native-vs-nonnative-checkboxes.html: * platform/mac/accessibility/no-unknown-objects-when-title-attribute-present.html: * platform/mac/accessibility/option-with-arialabel.html: * platform/mac/accessibility/option-with-lang.html: * platform/mac/accessibility/parent-of-table-row-is-table.html: * platform/mac/accessibility/popup-button-exposes-axvalue.html: * platform/mac/accessibility/press-action-is-first.html: * platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler.html: * platform/mac/accessibility/progressbar.html: * platform/mac/accessibility/range-alter-by-step.html: * platform/mac/accessibility/range-for-line-textarea.html: * platform/mac/accessibility/range-for-position.html: * platform/mac/accessibility/removing-textarea-after-edit-crash.html: * platform/mac/accessibility/role-subrole-roledescription.html: * platform/mac/accessibility/rowheader-outside-table-role.html: * platform/mac/accessibility/scroll-to-visible-action.html: * platform/mac/accessibility/scrollbars.html: * platform/mac/accessibility/seamless-iframe.html: * platform/mac/accessibility/search-field-cancel-button.html: * platform/mac/accessibility/search-predicate.html: * platform/mac/accessibility/search-subrole.html: * platform/mac/accessibility/search-when-element-starts-in-table.html: * platform/mac/accessibility/search-with-frames.html: * platform/mac/accessibility/select-element-selection-with-optgroups.html: * platform/mac/accessibility/selected-rows-table.html: * platform/mac/accessibility/selected-tab-crash.html: * platform/mac/accessibility/selected-text-range-for-empty-textarea.html: * platform/mac/accessibility/selection-value-changes-for-aria-textbox.html: * platform/mac/accessibility/slider-allows-title-ui-element.html: * platform/mac/accessibility/slider-supports-actions.html: * platform/mac/accessibility/spinbutton-valuedescription.html: * platform/mac/accessibility/stale-table-rows.html: * platform/mac/accessibility/stale-textmarker-crash.html: * platform/mac/accessibility/static-text-role-uses-text-under-element.html: * platform/mac/accessibility/static-text-with-aria-label.html: * platform/mac/accessibility/string-range-contains-listmarker.html: * platform/mac/accessibility/submit-button-default-value.html: * platform/mac/accessibility/supports-focus-setting.html: * platform/mac/accessibility/table-with-row-col-of-headers.html: * platform/mac/accessibility/table-with-zebra-rows.html: * platform/mac/accessibility/text-marker-length.html: * platform/mac/accessibility/textbox-role-reports-line-number.html: * platform/mac/accessibility/textbox-role-reports-notifications.html: * platform/mac/accessibility/textmarker-for-index-out-of-bounds-crash.html: * platform/mac/accessibility/textmarker-routines.html: * platform/mac/accessibility/title-attribute-not-used-as-axtitle.html: * platform/mac/accessibility/title-attribute-used-as-last-resort.html: * platform/mac/accessibility/unexpected-help-text.html: * platform/mac/accessibility/unsupported-attribute-does-not-crash.html: * platform/mac/accessibility/update-children-when-aria-role-changes.html: * platform/mac/accessibility/updating-attribute-in-table-row-crash.html: * platform/mac/accessibility/visible-position-crash-for-text-node.html: * platform/mac/accessibility/webarea-can-set-focus.html: * platform/mac/accessibility/webarea-size-equals-content-size.html: * platform/mac/accessibility/webkit-scrollarea-position.html: * platform/mac/accessibility/webkit-scrollarea.html: * platform/mac/editing/deleting/id-in-deletebutton.html: * platform/mac/editing/input/edit-dictated-text-with-alternative.html: * platform/mac/editing/input/firstrectforcharacterrange-caret-in-br.html: * platform/mac/editing/input/firstrectforcharacterrange-vertical.html: * platform/mac/editing/input/insert-dictated-text.html: * platform/mac/editing/input/maxlength.html: * platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache.html: * platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html: * platform/mac/editing/selection/script-tests/TEMPLATE.html: * platform/mac/editing/spelling/autocorrection-blockquote-crash.html: * platform/mac/editing/spelling/autocorrection-respets-undo.html: * platform/mac/editing/spelling/click-autocorrected-word.html: * platform/mac/editing/spelling/delete-into-autocorrected-word.html: * platform/mac/editing/spelling/forward-delete-into-autocorrected-word.html: * platform/mac/editing/spelling/move-cursor-to-autocorrected-word.html: * platform/mac/editing/spelling/move-cursor-to-beginning-of-autocorrected-word.html: * platform/mac/fast/css/dashboard-region-parser.html: * platform/mac/fast/dom/objc-wrapper-identity.html: * platform/mac/fast/dom/wrapper-classes-objc.html: * platform/mac/fast/dom/wrapper-round-tripping.html: * platform/mac/fast/encoding/xnextstep-decoding.html: * platform/mac/fast/events/non-roman-key-code.html: * platform/mac/fast/events/numpad-keycode-mapping.html: * platform/mac/fast/forms/focus-option-control-on-page.html: * platform/mac/fast/forms/input-appearance-spinbutton-size.html: * platform/mac/fast/forms/input-number-click.html: * platform/mac/fast/objc/dom-html-select-live-pseudo-selectors.html: * platform/mac/fast/objc/script-tests/TEMPLATE.html: * platform/mac/fast/objc/webScriptObject-hasWebScriptKey.html: * platform/mac/fast/speechsynthesis/speech-synthesis-boundary-events.html: * platform/mac/fast/speechsynthesis/speech-synthesis-cancel-crash.html: * platform/mac/fast/speechsynthesis/speech-synthesis-cancel.html: * platform/mac/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance.html: * platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time.html: * platform/mac/fast/speechsynthesis/speech-synthesis-pause-resume.html: * platform/mac/fast/speechsynthesis/speech-synthesis-speak.html: * platform/mac/fast/speechsynthesis/speech-synthesis-utterance-uses-voice.html: * platform/mac/fast/speechsynthesis/speech-synthesis-voices.html: * platform/mac/fast/text/ligature-subdivision.html: * platform/mac/fast/text/script-tests/TEMPLATE.html: * platform/mac/plugins/bindings-objc-long-method-name.html: * platform/mac/plugins/bindings-objc-method-name-conversion.html: * platform/qt/fast/spatial-navigation/resources/ensure-scrolls-with-scrollbars-disabled-by-webkit.html: * platform/win/accessibility/detached-object-notification-crash.html: * platform/win/accessibility/document-enabled-state.html: * platform/win/accessibility/heading-elements.html: * platform/win/accessibility/img-alt-attribute.html: * platform/win/accessibility/linked-elements.html: * platform/win/accessibility/list-item-role.html: * platform/win/accessibility/list-marker-role.html: * platform/win/accessibility/list-role.html: * platform/win/accessibility/multiple-select-element-role.html: * platform/win/accessibility/option-element-position-and-size.html: * platform/win/accessibility/parent-element.html: * platform/win/accessibility/select-element-role.html: * platform/win/accessibility/selection-and-focus.html: * platform/win/accessibility/single-select-children-changed.html: * platform/win/accessibility/single-select-children.html: * platform/win/accessibility/text-role.html: * platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html: * platform/win/editing/selection/script-tests/TEMPLATE.html: * platform/win/fast/events/context-click-events.html: * platform/win/fast/events/panScroll-click-hyperlink.html: * platform/win/fast/events/script-tests/TEMPLATE.html: * platform/win/fast/forms/file/drag-and-drop-files.html: * plugins/destroy-stream-twice.html: * plugins/focus.html: * plugins/navigator-mimeTypes-length.html: * plugins/navigator-plugins.html: * plugins/npp-new-fails.html: * plugins/npruntime/browser-object-identity.html: * plugins/npruntime/evaluate.html: * plugins/npruntime/identifier-conversion.html: * plugins/npruntime/npruntime.html: * plugins/npruntime/object-from-destroyed-plugin-in-subframe.html: * plugins/npruntime/object-from-destroyed-plugin.html: * plugins/npruntime/plugin-scriptable-object-invoke-default.html: * plugins/npruntime/remove-property.html: * plugins/npruntime/script-tests/TEMPLATE.html: * plugins/npruntime/tostring.html: * plugins/npruntime/valueof.html: * plugins/private-browsing-mode-2.html: * plugins/private-browsing-mode.html: * plugins/return-error-from-new-stream-doesnt-invoke-destroy-stream.html: * plugins/return-negative-one-from-write.html: * printing/allowed-page-breaks.html: * printing/no-content-empty-pages.html: * printing/numberOfPages.html: * printing/page-break-after-avoid.html: * printing/page-break-always.html: * printing/page-break-avoid.html: * printing/page-break-before-avoid.html: * printing/page-break-display-none.html: * printing/page-break-inside-avoid.html: * printing/page-break-margin-collapsed.html: * printing/page-break-orphans-and-widows.html: * printing/page-break-orphans.html: * printing/page-break-widows.html: * printing/page-count-percentage-height.html: * printing/page-format-data.html: * printing/page-rule-selection.html: * printing/pageNumerForElementById.html: * printing/script-tests/TEMPLATE.html: * printing/stretch-to-view-height.html: * proximity/add-listener-from-callback.html: * proximity/basic-operation.html: * proximity/check-event-deviceproximity.html: * proximity/create-event-deviceproximity.html: * proximity/create-event.html: * proximity/event-after-navigation.html: * proximity/multiple-frames.html: * proximity/no-page-cache.html: * proximity/optional-event-properties.html: * proximity/updates.html: * proximity/window-property.html: Canonical link: https://commits.webkit.org/138886@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
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>
Change LayoutTests' m*-p* files to use pre and post js files in LayoutTests/resources. https://bugs.webkit.org/show_bug.cgi?id=120899. Rubber stamped by Filip Pizlo. * media/W3C/w3cwrapper.js: * media/network-no-source-const-shadow.html: * media/nodesFromRect-shadowContent.html: * media/track/track-node-add-remove.html: * media/video-buffered-too-few-arguments.html: * media/video-canvas-source.html: * networkinformation/add-listener-from-callback.html: * networkinformation/basic-all-types-of-events.html: * networkinformation/basic-operation.html: * networkinformation/event-after-navigation.html: * networkinformation/multiple-frames.html: * networkinformation/updates.html: * networkinformation/window-property.html: * platform/blackberry/editing/text-iterator/findString-markers.html: * platform/blackberry/external/search-provider/search-provider-installed.html: * platform/gtk/accessibility/aria-listbox-crash.html: * platform/gtk/accessibility/aria-options-and-menuitems-crash.html: * platform/gtk/accessibility/aria-roles-unignored.html: * platform/gtk/accessibility/aria-slider-required-attributes.html: * platform/gtk/accessibility/aria-table-hierarchy.html: * platform/gtk/accessibility/aria-toggle-button-role.html: * platform/gtk/accessibility/button-accessible-name.html: * platform/gtk/accessibility/caret-browsing-select-focus.html: * platform/gtk/accessibility/caret-browsing-text-focus.html: * platform/gtk/accessibility/combo-box-collapsed-selection-changed.html: * platform/gtk/accessibility/entry-and-password.html: * platform/gtk/accessibility/list-items-always-exposed.html: * platform/gtk/accessibility/media-controls-panel-title.html: * platform/gtk/accessibility/name-from-label.html: * platform/gtk/accessibility/object-attributes.html: * platform/gtk/accessibility/object-with-title.html: * platform/gtk/accessibility/remapped-aria-crash.html: * platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html: * platform/gtk/accessibility/spans-paragraphs-and-divs.html: * platform/gtk/accessibility/spans.html: * platform/gtk/accessibility/table-hierarchy.html: * platform/gtk/accessibility/title-and-alt.html: * platform/gtk/accessibility/unknown-roles-not-exposed.html: * platform/gtk/editing/pasteboard/middle-click-onpaste.html: * platform/gtk/editing/pasteboard/script-tests/TEMPLATE.html: * platform/gtk/editing/selection/caret-mode-document-begin-end.html: * platform/iphone-simulator/accessibility/accessibility-aria-table-children.html: * platform/iphone-simulator/accessibility/accessibility-crash-in-axcontainer.html: * platform/iphone-simulator/accessibility/accessibility-hint.html: * platform/iphone-simulator/accessibility/aria-label-with-internal-text.html: * platform/iphone-simulator/accessibility/aria-pressed-state.html: * platform/iphone-simulator/accessibility/centerpoint.html: * platform/iphone-simulator/accessibility/dom-focus-fires-on-correct-element.html: * platform/iphone-simulator/accessibility/element-paths.html: * platform/iphone-simulator/accessibility/file-upload-button.html: * platform/iphone-simulator/accessibility/focus-change-notifications.html: * platform/iphone-simulator/accessibility/header-elements.html: * platform/iphone-simulator/accessibility/identifier.html: * platform/iphone-simulator/accessibility/internal-link.html: * platform/iphone-simulator/accessibility/landmark-type.html: * platform/iphone-simulator/accessibility/link-with-images-text.html: * platform/iphone-simulator/accessibility/link-with-only-image.html: * platform/iphone-simulator/accessibility/math.html: * platform/iphone-simulator/accessibility/mixed-checkboxes.html: * platform/iphone-simulator/accessibility/password-value.html: * platform/iphone-simulator/accessibility/placeholder-value.html: * platform/iphone-simulator/accessibility/popup-button-value-label.html: * platform/iphone-simulator/accessibility/progressbar.html: * platform/iphone-simulator/accessibility/radio-button.html: * platform/iphone-simulator/accessibility/selected-buttons.html: * platform/iphone-simulator/accessibility/selected-text.html: * platform/iphone-simulator/accessibility/svg-group-element-with-title.html: * platform/iphone-simulator/accessibility/svg-path-crash.html: * platform/iphone-simulator/accessibility/tab-role.html: * platform/iphone-simulator/accessibility/table-cell-for-row-col.html: * platform/iphone-simulator/accessibility/table-cell-ranges.html: * platform/iphone-simulator/accessibility/tables-lists.html: * platform/iphone-simulator/accessibility/text-line-no-ignored-elements.html: * platform/iphone-simulator/accessibility/text-marker-list-item.html: * platform/iphone-simulator/accessibility/text-marker-validation.html: * platform/iphone-simulator/accessibility/text-role.html: * platform/iphone-simulator/accessibility/textfield-in-axvalue.html: * platform/iphone-simulator/accessibility/url-test.html: * platform/mac-wk2/plugins/asychronous-deadlock-with-timer-and-evaluate.html: * platform/mac-wk2/plugins/asynchronous-destroy-before-initialization.html: * platform/mac-wk2/plugins/contents-scale-factor.html: * platform/mac-wk2/plugins/destroy-during-async-npp-new.html: * platform/mac-wk2/plugins/npp-setwindow-called-on-scroll.html: * platform/mac-wk2/plugins/npruntime/remove-property-from-javascript.html: * platform/mac-wk2/plugins/script-object-access-fails-during-slow-initialization.html: * platform/mac-wk2/plugins/slow/asynchronous-plugin-initialization-multiple.html: * platform/mac-wk2/plugins/slow/asynchronous-plugin-initialization.html: * platform/mac-wk2/plugins/slow/resources/asynchronous-plugin-initialization-multiple-finish.html: * platform/mac/accessibility/area-with-aria-label.html: * platform/mac/accessibility/aria-alerts.html: * platform/mac/accessibility/aria-columnrowheaders.html: * platform/mac/accessibility/aria-directory.html: * platform/mac/accessibility/aria-divs-not-ignored.html: * platform/mac/accessibility/aria-drag-drop.html: * platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html: * platform/mac/accessibility/aria-expanded-notifications.html: * platform/mac/accessibility/aria-expanded-standard-items.html: * platform/mac/accessibility/aria-flowto.html: * platform/mac/accessibility/aria-grid-with-strange-hierarchy.html: * platform/mac/accessibility/aria-grouping-roles.html: * platform/mac/accessibility/aria-hidden-changes-for-non-ignored-elements.html: * platform/mac/accessibility/aria-image-emits-object-replacement.html: * platform/mac/accessibility/aria-label-overrides-visible-text.html: * platform/mac/accessibility/aria-listbox-selectedchildren-change.html: * platform/mac/accessibility/aria-liveregion-marquee-default.html: * platform/mac/accessibility/aria-liveregion-on-image.html: * platform/mac/accessibility/aria-liveregions-addedelement.html: * platform/mac/accessibility/aria-liveregions-attributes.html: * platform/mac/accessibility/aria-liveregions-changedalt.html: * platform/mac/accessibility/aria-liveregions-changedtext.html: * platform/mac/accessibility/aria-liveregions-notifications-always-sent.html: * platform/mac/accessibility/aria-liveregions-notifications.html: * platform/mac/accessibility/aria-liveregions-removedelement.html: * platform/mac/accessibility/aria-menu-role-descriptions.html: * platform/mac/accessibility/aria-menubar.html: * platform/mac/accessibility/aria-menuitem-checked-value.html: * platform/mac/accessibility/aria-multiline.html: * platform/mac/accessibility/aria-multiselectable.html: * platform/mac/accessibility/aria-owns.html: * platform/mac/accessibility/aria-popup-buttons-on-native-elements.html: * platform/mac/accessibility/aria-popup.html: * platform/mac/accessibility/aria-radiobutton-text.html: * platform/mac/accessibility/aria-radiogroup.html: * platform/mac/accessibility/aria-required-popup-button.html: * platform/mac/accessibility/aria-setsize-posinset.html: * platform/mac/accessibility/aria-slider-value-change.html: * platform/mac/accessibility/aria-spinbutton-crash.html: * platform/mac/accessibility/aria-table-with-colspan-cells.html: * platform/mac/accessibility/aria-toolbar.html: * platform/mac/accessibility/aria-tree-activedescendant.html: * platform/mac/accessibility/aria-tree-index-of-items.html: * platform/mac/accessibility/aria-tree.html: * platform/mac/accessibility/aria-treegrid.html: * platform/mac/accessibility/aria-valuetext-on-native-slider.html: * platform/mac/accessibility/aria-valuetext.html: * platform/mac/accessibility/attributed-string-includes-highlighting.html: * platform/mac/accessibility/attributed-string-includes-misspelled-with-selection.html: * platform/mac/accessibility/button-shouldnot-have-axvalue.html: * platform/mac/accessibility/clipped-text-under-element.html: * platform/mac/accessibility/combobox-activedescendant-notifications.html: * platform/mac/accessibility/combox-box-value.html: * platform/mac/accessibility/content-editable-range-properties.html: * platform/mac/accessibility/crash-in-element-for-text-marker.html: * platform/mac/accessibility/crash-invalid-text-marker-node.html: * platform/mac/accessibility/css-content-attribute.html: * platform/mac/accessibility/css-speech-speak.html: * platform/mac/accessibility/definition-list-term.html: * platform/mac/accessibility/div-containing-div-with-aria.html: * platform/mac/accessibility/document-title-used-for-description.html: * platform/mac/accessibility/editable-webarea-context-menu-point.html: * platform/mac/accessibility/element-focus.html: * platform/mac/accessibility/element-for-text-marker.html: * platform/mac/accessibility/element-is-ignored.html: * platform/mac/accessibility/element-level.html: * platform/mac/accessibility/element-paths.html: * platform/mac/accessibility/estimated-progress.html: * platform/mac/accessibility/file-upload-button-subrole.html: * platform/mac/accessibility/footer-roledescription.html: * platform/mac/accessibility/footer.html: * platform/mac/accessibility/form-control-value-settable.html: * platform/mac/accessibility/frame-with-title.html: * platform/mac/accessibility/header.html: * platform/mac/accessibility/heading-clickpoint.html: * platform/mac/accessibility/html-section-elements.html: * platform/mac/accessibility/html-slider-indicator.html: * platform/mac/accessibility/html-with-aria-label.html: * platform/mac/accessibility/html5-input-number.html: * platform/mac/accessibility/iframe-aria-hidden.html: * platform/mac/accessibility/iframe-with-title-correct-hierarchy.html: * platform/mac/accessibility/inherited-presentational-lists.html: * platform/mac/accessibility/input-title.html: * platform/mac/accessibility/internal-link-when-document-has-fragment.html: * platform/mac/accessibility/label-element-with-hidden-control.html: * platform/mac/accessibility/link-with-title.html: * platform/mac/accessibility/list-items-ignored.html: * platform/mac/accessibility/listbox-hit-test.html: * platform/mac/accessibility/listmarker-suffix.html: * platform/mac/accessibility/live-region-on-span.html: * platform/mac/accessibility/main-element.html: * platform/mac/accessibility/math-alttext.html: * platform/mac/accessibility/mathml-elements.html: * platform/mac/accessibility/mathml-line-fraction.html: * platform/mac/accessibility/mathml-multiscript.html: * platform/mac/accessibility/misspelled-attributed-string.html: * platform/mac/accessibility/mixed-checkbox.html: * platform/mac/accessibility/native-vs-nonnative-checkboxes.html: * platform/mac/accessibility/no-unknown-objects-when-title-attribute-present.html: * platform/mac/accessibility/option-with-arialabel.html: * platform/mac/accessibility/option-with-lang.html: * platform/mac/accessibility/parent-of-table-row-is-table.html: * platform/mac/accessibility/popup-button-exposes-axvalue.html: * platform/mac/accessibility/press-action-is-first.html: * platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler.html: * platform/mac/accessibility/progressbar.html: * platform/mac/accessibility/range-alter-by-step.html: * platform/mac/accessibility/range-for-line-textarea.html: * platform/mac/accessibility/range-for-position.html: * platform/mac/accessibility/removing-textarea-after-edit-crash.html: * platform/mac/accessibility/role-subrole-roledescription.html: * platform/mac/accessibility/rowheader-outside-table-role.html: * platform/mac/accessibility/scroll-to-visible-action.html: * platform/mac/accessibility/scrollbars.html: * platform/mac/accessibility/seamless-iframe.html: * platform/mac/accessibility/search-field-cancel-button.html: * platform/mac/accessibility/search-predicate.html: * platform/mac/accessibility/search-subrole.html: * platform/mac/accessibility/search-when-element-starts-in-table.html: * platform/mac/accessibility/search-with-frames.html: * platform/mac/accessibility/select-element-selection-with-optgroups.html: * platform/mac/accessibility/selected-rows-table.html: * platform/mac/accessibility/selected-tab-crash.html: * platform/mac/accessibility/selected-text-range-for-empty-textarea.html: * platform/mac/accessibility/selection-value-changes-for-aria-textbox.html: * platform/mac/accessibility/slider-allows-title-ui-element.html: * platform/mac/accessibility/slider-supports-actions.html: * platform/mac/accessibility/spinbutton-valuedescription.html: * platform/mac/accessibility/stale-table-rows.html: * platform/mac/accessibility/stale-textmarker-crash.html: * platform/mac/accessibility/static-text-role-uses-text-under-element.html: * platform/mac/accessibility/static-text-with-aria-label.html: * platform/mac/accessibility/string-range-contains-listmarker.html: * platform/mac/accessibility/submit-button-default-value.html: * platform/mac/accessibility/supports-focus-setting.html: * platform/mac/accessibility/table-with-row-col-of-headers.html: * platform/mac/accessibility/table-with-zebra-rows.html: * platform/mac/accessibility/text-marker-length.html: * platform/mac/accessibility/textbox-role-reports-line-number.html: * platform/mac/accessibility/textbox-role-reports-notifications.html: * platform/mac/accessibility/textmarker-for-index-out-of-bounds-crash.html: * platform/mac/accessibility/textmarker-routines.html: * platform/mac/accessibility/title-attribute-not-used-as-axtitle.html: * platform/mac/accessibility/title-attribute-used-as-last-resort.html: * platform/mac/accessibility/unexpected-help-text.html: * platform/mac/accessibility/unsupported-attribute-does-not-crash.html: * platform/mac/accessibility/update-children-when-aria-role-changes.html: * platform/mac/accessibility/updating-attribute-in-table-row-crash.html: * platform/mac/accessibility/visible-position-crash-for-text-node.html: * platform/mac/accessibility/webarea-can-set-focus.html: * platform/mac/accessibility/webarea-size-equals-content-size.html: * platform/mac/accessibility/webkit-scrollarea-position.html: * platform/mac/accessibility/webkit-scrollarea.html: * platform/mac/editing/deleting/id-in-deletebutton.html: * platform/mac/editing/input/edit-dictated-text-with-alternative.html: * platform/mac/editing/input/firstrectforcharacterrange-caret-in-br.html: * platform/mac/editing/input/firstrectforcharacterrange-vertical.html: * platform/mac/editing/input/insert-dictated-text.html: * platform/mac/editing/input/maxlength.html: * platform/mac/editing/input/unconfirmed-text-navigation-with-page-cache.html: * platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html: * platform/mac/editing/selection/script-tests/TEMPLATE.html: * platform/mac/editing/spelling/autocorrection-blockquote-crash.html: * platform/mac/editing/spelling/autocorrection-respets-undo.html: * platform/mac/editing/spelling/click-autocorrected-word.html: * platform/mac/editing/spelling/delete-into-autocorrected-word.html: * platform/mac/editing/spelling/forward-delete-into-autocorrected-word.html: * platform/mac/editing/spelling/move-cursor-to-autocorrected-word.html: * platform/mac/editing/spelling/move-cursor-to-beginning-of-autocorrected-word.html: * platform/mac/fast/css/dashboard-region-parser.html: * platform/mac/fast/dom/objc-wrapper-identity.html: * platform/mac/fast/dom/wrapper-classes-objc.html: * platform/mac/fast/dom/wrapper-round-tripping.html: * platform/mac/fast/encoding/xnextstep-decoding.html: * platform/mac/fast/events/non-roman-key-code.html: * platform/mac/fast/events/numpad-keycode-mapping.html: * platform/mac/fast/forms/focus-option-control-on-page.html: * platform/mac/fast/forms/input-appearance-spinbutton-size.html: * platform/mac/fast/forms/input-number-click.html: * platform/mac/fast/objc/dom-html-select-live-pseudo-selectors.html: * platform/mac/fast/objc/script-tests/TEMPLATE.html: * platform/mac/fast/objc/webScriptObject-hasWebScriptKey.html: * platform/mac/fast/speechsynthesis/speech-synthesis-boundary-events.html: * platform/mac/fast/speechsynthesis/speech-synthesis-cancel-crash.html: * platform/mac/fast/speechsynthesis/speech-synthesis-cancel.html: * platform/mac/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance.html: * platform/mac/fast/speechsynthesis/speech-synthesis-elapsed-time.html: * platform/mac/fast/speechsynthesis/speech-synthesis-pause-resume.html: * platform/mac/fast/speechsynthesis/speech-synthesis-speak.html: * platform/mac/fast/speechsynthesis/speech-synthesis-utterance-uses-voice.html: * platform/mac/fast/speechsynthesis/speech-synthesis-voices.html: * platform/mac/fast/text/ligature-subdivision.html: * platform/mac/fast/text/script-tests/TEMPLATE.html: * platform/mac/plugins/bindings-objc-long-method-name.html: * platform/mac/plugins/bindings-objc-method-name-conversion.html: * platform/qt/fast/spatial-navigation/resources/ensure-scrolls-with-scrollbars-disabled-by-webkit.html: * platform/win/accessibility/detached-object-notification-crash.html: * platform/win/accessibility/document-enabled-state.html: * platform/win/accessibility/heading-elements.html: * platform/win/accessibility/img-alt-attribute.html: * platform/win/accessibility/linked-elements.html: * platform/win/accessibility/list-item-role.html: * platform/win/accessibility/list-marker-role.html: * platform/win/accessibility/list-role.html: * platform/win/accessibility/multiple-select-element-role.html: * platform/win/accessibility/option-element-position-and-size.html: * platform/win/accessibility/parent-element.html: * platform/win/accessibility/select-element-role.html: * platform/win/accessibility/selection-and-focus.html: * platform/win/accessibility/single-select-children-changed.html: * platform/win/accessibility/single-select-children.html: * platform/win/accessibility/text-role.html: * platform/win/editing/selection/doubleclick-should-not-expand-across-lines.html: * platform/win/editing/selection/script-tests/TEMPLATE.html: * platform/win/fast/events/context-click-events.html: * platform/win/fast/events/panScroll-click-hyperlink.html: * platform/win/fast/events/script-tests/TEMPLATE.html: * platform/win/fast/forms/file/drag-and-drop-files.html: * plugins/destroy-stream-twice.html: * plugins/focus.html: * plugins/navigator-mimeTypes-length.html: * plugins/navigator-plugins.html: * plugins/npp-new-fails.html: * plugins/npruntime/browser-object-identity.html: * plugins/npruntime/evaluate.html: * plugins/npruntime/identifier-conversion.html: * plugins/npruntime/npruntime.html: * plugins/npruntime/object-from-destroyed-plugin-in-subframe.html: * plugins/npruntime/object-from-destroyed-plugin.html: * plugins/npruntime/plugin-scriptable-object-invoke-default.html: * plugins/npruntime/remove-property.html: * plugins/npruntime/script-tests/TEMPLATE.html: * plugins/npruntime/tostring.html: * plugins/npruntime/valueof.html: * plugins/private-browsing-mode-2.html: * plugins/private-browsing-mode.html: * plugins/return-error-from-new-stream-doesnt-invoke-destroy-stream.html: * plugins/return-negative-one-from-write.html: * printing/allowed-page-breaks.html: * printing/no-content-empty-pages.html: * printing/numberOfPages.html: * printing/page-break-after-avoid.html: * printing/page-break-always.html: * printing/page-break-avoid.html: * printing/page-break-before-avoid.html: * printing/page-break-display-none.html: * printing/page-break-inside-avoid.html: * printing/page-break-margin-collapsed.html: * printing/page-break-orphans-and-widows.html: * printing/page-break-orphans.html: * printing/page-break-widows.html: * printing/page-count-percentage-height.html: * printing/page-format-data.html: * printing/page-rule-selection.html: * printing/pageNumerForElementById.html: * printing/script-tests/TEMPLATE.html: * printing/stretch-to-view-height.html: * proximity/add-listener-from-callback.html: * proximity/basic-operation.html: * proximity/check-event-deviceproximity.html: * proximity/create-event-deviceproximity.html: * proximity/create-event.html: * proximity/event-after-navigation.html: * proximity/multiple-frames.html: * proximity/no-page-cache.html: * proximity/optional-event-properties.html: * proximity/updates.html: * proximity/window-property.html: Canonical link: https://commits.webkit.org/138886@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
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>