Re: [csswg-drafts] [css-ui] consider requiring that descendants do not contribute to outline (#2846)

> changing the sentence ... to 
> The outline should be influenced only by the primary box of the element; it should not be affected by descendant boxes.

This would get the spec in line with what Chrome does, so it sounds fine.

I am reimplementing outline painting in Chrome for LayoutNG. While on this topic, here are some things I've learned, and thought about.

Chrome has two types of outlines
1. standard outline
    * painted when there is an `outline` property && outline != auto.
    * does not include descendants.
2) focus outline
    * painted when Element is in focus, or has outline:auto property.
    * does include descendants.
    * important use case is a11y.

I have a [personal test page](https://atotic.github.io/personal-tests/layoutng/outline/outline.html) where I've tested differences between standard and focus outlines. You can tab through the page to see the differences.

Differences between standard and focus outlines have caused implementation pain in edge cases. For example, zero width/height elements might be optimized away during layout, but would have to be regenerated if ascendant got a focus outline, just so we can show their outline. 

Frequent use of outline:0 has also [caused problems](https://a11yproject.com/posts/never-remove-css-outlines/) for a11y community.

-- 
GitHub Notification of comment by atotic
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2846#issuecomment-466885560 using your GitHub account

Received on Monday, 25 February 2019 06:17:02 UTC