Bug 140144

Summary: AX: Add support for CSS4 :focus-within pseudo
Product: WebKit Reporter: James Craig <jcraig>
Component: CSSAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: 50167214, benjamin, commit-queue, fesch, koivisto, webkit-bug-importer, webkit
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
URL: https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo
Attachments:
Description Flags
Patch
none
Patch none

James Craig
Reported 2015-01-06 13:29:38 PST
AX: Add support for CSS4 :focus-within pseudo http://dev.w3.org/csswg/selectors-4/#focus-within-pseudo
Attachments
Patch (49.24 KB, patch)
2016-06-21 20:21 PDT, Benjamin Poulain
no flags
Patch (67.82 KB, patch)
2016-06-22 15:31 PDT, Benjamin Poulain
no flags
Radar WebKit Bug Importer
Comment 1 2015-01-06 13:29:54 PST
James Craig
Comment 2 2015-01-06 13:32:41 PST
This would be a good addition for accessibility and full keyboard access.
James Craig
Comment 3 2015-01-06 13:35:26 PST
Seems like it's equivalent to the recently-removed CSS4 subject selector. "!* *:focus" == "*:focus-within"
Benjamin Poulain
Comment 4 2016-06-21 20:21:15 PDT
Antti Koivisto
Comment 5 2016-06-22 14:04:49 PDT
Comment on attachment 281810 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=281810&action=review > Source/WebCore/dom/ContainerNode.cpp:108 > - if (!child.renderer() && !child.isNamedFlowContentNode() && !childIsHTMLSlotElement) > + bool isElement = is<Element>(child); > + if (!child.renderer() && !childIsHTMLSlotElement > + && !(isElement && downcast<Element>(child).isNamedFlowContentElement())) It would have been nicer to do the NamedFlow bit freeing dance separately. > Source/WebCore/dom/Element.h:761 > +inline void Element::setHasFocusWithin(bool flag) > +{ > + setFlag(flag, HasFocusWithin); > + if (styleAffectedByFocusWithin()) > + setNeedsStyleRecalc(); > +} Would it be sufficient to invalidate only when the flag value changes? > LayoutTests/fast/css/css-selector-text.html:313 > +testSelectorRoundTrip("a[b]:default"); > +testSelectorRoundTrip("a.b:default"); > +testSelectorRoundTrip("a#b:default"); > +testSelectorRoundTrip("a[b].c#d:default"); Is there anything sufficiently complicated here to test the SelectorChecker path?
Antti Koivisto
Comment 6 2016-06-22 14:07:13 PDT
> Is there anything sufficiently complicated here to test the SelectorChecker > path? Quoted wrong test but the question still applies.
Benjamin Poulain
Comment 7 2016-06-22 15:31:06 PDT
WebKit Commit Bot
Comment 8 2016-06-22 16:35:39 PDT
Comment on attachment 281878 [details] Patch Clearing flags on attachment: 281878 Committed r202358: <http://trac.webkit.org/changeset/202358>
WebKit Commit Bot
Comment 9 2016-06-22 16:35:43 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.