Commit 4caaa081 authored by Kevin McNee's avatar Kevin McNee Committed by Commit Bot

Remove tabindex from the GuestViewContainer element.

A tabindex of -1 on the GuestViewContainer element allows it to be
focusable but not reachable via sequential keyboard navigation.

There does not appear to be any further need for the GuestViewContainer
element itself to be focusable given that we override the focus method.
Previously, we had a focus event listener on the GuestViewContainer
element in order to propagate the focus to the internal element which
would explain why this was needed.

See
https://crrev.com/6476573b7d9099b04002736d90a078550c8651eb
https://crrev.com/53ba951bb6ed4df0998240520fed9d00a7ffff67

Bug: 231664, 803274
Change-Id: If6ffb6f7282db86a1a7ab9e856785e6f51d79a80
Reviewed-on: https://chromium-review.googlesource.com/1170988Reviewed-by: default avatarEhsan Karamad <ekaramad@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582294}
parent 7162372f
...@@ -24,7 +24,6 @@ function GuestViewContainer(element, viewType) { ...@@ -24,7 +24,6 @@ function GuestViewContainer(element, viewType) {
this.setupAttributes(); this.setupAttributes();
privates(this).internalElement = this.createInternalElement$(); privates(this).internalElement = this.createInternalElement$();
this.setupFocusPropagation();
var shadowRoot = this.element.createShadowRoot(); var shadowRoot = this.element.createShadowRoot();
shadowRoot.appendChild(privates(this).internalElement); shadowRoot.appendChild(privates(this).internalElement);
...@@ -102,16 +101,6 @@ GuestViewContainer.prototype.createInternalElement$ = function() { ...@@ -102,16 +101,6 @@ GuestViewContainer.prototype.createInternalElement$ = function() {
GuestViewContainer.prototype.prepareForReattach_ = function() {}; GuestViewContainer.prototype.prepareForReattach_ = function() {};
GuestViewContainer.prototype.setupFocusPropagation = function() {
if (!this.element.hasAttribute('tabIndex')) {
// GuestViewContainer needs a tabIndex in order to be focusable.
// TODO(fsamuel): It would be nice to avoid exposing a tabIndex attribute
// to allow GuestViewContainer to be focusable.
// See http://crbug.com/231664.
this.element.setAttribute('tabIndex', -1);
}
};
GuestViewContainer.prototype.focus = function() { GuestViewContainer.prototype.focus = function() {
// Focus the internal element when focus() is called on the GuestView element. // Focus the internal element when focus() is called on the GuestView element.
privates(this).internalElement.focus(); privates(this).internalElement.focus();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment