Summary: | AX: Add support for CSS4 :focus-within pseudo | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | James Craig <jcraig> | ||||||
Component: | CSS | Assignee: | 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
James Craig
2015-01-06 13:29:38 PST
This would be a good addition for accessibility and full keyboard access. Seems like it's equivalent to the recently-removed CSS4 subject selector. "!* *:focus" == "*:focus-within" Created attachment 281810 [details]
Patch
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? > Is there anything sufficiently complicated here to test the SelectorChecker
> path?
Quoted wrong test but the question still applies.
Created attachment 281878 [details]
Patch
Comment on attachment 281878 [details] Patch Clearing flags on attachment: 281878 Committed r202358: <http://trac.webkit.org/changeset/202358> All reviewed patches have been landed. Closing bug. |