Bug 154769 - Contents inside a shadow host with a negative tabindex should not be tab focusable
Summary: Contents inside a shadow host with a negative tabindex should not be tab focu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 151379
  Show dependency treegraph
 
Reported: 2016-02-26 19:18 PST by Ryosuke Niwa
Modified: 2016-03-01 21:31 PST (History)
9 users (show)

See Also:


Attachments
Fixes the bug (14.02 KB, patch)
2016-02-26 19:45 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixes the bug (14.16 KB, patch)
2016-02-29 14:58 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Minor cleanup (14.15 KB, patch)
2016-02-29 14:59 PST, Ryosuke Niwa
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2016-02-26 19:18:57 PST
We shouldn't tab-focus a focusable element inside a shadow host with a negative tab index
per discussion on https://github.com/w3c/webcomponents/issues/399.
Comment 1 Ryosuke Niwa 2016-02-26 19:45:43 PST
Created attachment 272393 [details]
Fixes the bug
Comment 2 Ryosuke Niwa 2016-02-26 20:22:41 PST
Comment on attachment 272393 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=272393&action=review

> LayoutTests/fast/shadow-dom/negative-tabindex-on-shadow-host-expected.txt:7
> +2. Shadow host with a positive tabindex

WTF is this. There's some weird bug somewhere...
Comment 3 Ryosuke Niwa 2016-02-29 14:58:09 PST
Created attachment 272521 [details]
Fixes the bug
Comment 4 Ryosuke Niwa 2016-02-29 14:59:48 PST
Created attachment 272522 [details]
Minor cleanup
Comment 5 Antti Koivisto 2016-03-01 13:28:10 PST
Comment on attachment 272522 [details]
Minor cleanup

View in context: https://bugs.webkit.org/attachment.cgi?id=272522&action=review

> Source/WebCore/dom/Element.cpp:222
> +bool Element::tabIndexSetExplicitly() const
> +{
> +    return hasRareData() && elementRareData()->tabIndexSetExplicitly();
> +}
> +
>  bool Element::supportsFocus() const
>  {
>      return hasRareData() && elementRareData()->tabIndexSetExplicitly();

supportsFocus() should probably just call tabIndexSetExplicitly()
Comment 6 Ryosuke Niwa 2016-03-01 21:29:48 PST
(In reply to comment #5)
> Comment on attachment 272522 [details]
> Minor cleanup
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=272522&action=review
> 
> > Source/WebCore/dom/Element.cpp:222
> > +bool Element::tabIndexSetExplicitly() const
> > +{
> > +    return hasRareData() && elementRareData()->tabIndexSetExplicitly();
> > +}
> > +
> >  bool Element::supportsFocus() const
> >  {
> >      return hasRareData() && elementRareData()->tabIndexSetExplicitly();
> 
> supportsFocus() should probably just call tabIndexSetExplicitly()

Done that.  Thanks for the review!
Comment 7 Ryosuke Niwa 2016-03-01 21:31:17 PST
Committed r197439: <http://trac.webkit.org/changeset/197439>