-
Notifications
You must be signed in to change notification settings - Fork 715
[css-ui] Outline rects of an inline #6981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The CSS Working Group just discussed The full IRC log of that discussion<emeyer> Topic: [css-ui] Outline rects of an inline<emeyer> Github: https://github.com//issues/6981 <emeyer> emilio: When you have an outline around inlines, the spec was ambiguous about what an outline should draw around. We’ve changed Gecko to match WebKit, but missed a case where Blink does something different. <emeyer> …There is a special code path for outlines of inlines. Can we resolve on what outline actually does and fully spec it? <smfr> i’d love to see some pictuers in the issue <emeyer> iank_: Does this cover auto outlines? <emeyer> …I think engines have different code paths. <emeyer> emilio: How do they differ? <emeyer> smfr: What I remember is we only respect border radius for auto outlines. <Rossen_> q <Rossen_> ack emilio <emeyer> iank_: I believe things differ for auto versus non-auto. If you have an inline block, we do something different to capture more of the visual overflow. <emeyer> …The special case we had for non-auto outlines, I agree our behavior looks broken for one of the cases on the issue. <emeyer> smfr: I’d love to see these and web platform tests. <emeyer> iank_: I’ll try to create test cases where everyone does different things. I’ll be reluctant to change the auto outline case because of accessibility, but the non-auto outline case is difficult because people often force the outlines to be different. <emeyer> emilio: I find the auto versus non-auto distinction quite weird. It should be about whether the element is focused. If we want to have focus outlines versus non-focus outlines, that’s another topic. But documenting the differences would be great, so we can agree on behavior. <emeyer> Rossen: let’s take this back to the issue and create as many test cases as we can. I’ll +1 smfr’s suggestion to make the test cases WPT test cases. |
Came across this while experimenting with nice styling for multi-selectable cells in a sudoku grid. I made a demo here: https://observablehq.com/@supermikal/css-outline-rects-demo The styles are a bit messy due to several iterations of trial and error, so it might not be a minimal repro but it's_something.jpg Screenshot from Chrome for Android 98.0.4758.101: Firefox for Android 97.2.0 (Build #2015863827), fc8bbf84c+ : |
As a web developer, the behavior of Blink is surprising to me here. When I draw outside of the border box for some reason, I expect outline to draw around the border box and not around the stuff I drew outside of that box. My (potentially incorrect) understanding of outline is that it is similar to a border, but it doesn't consume space (thus making it a good tool for hover/focus as it won't trigger reflow like adding a border will). The situation that caused me to spend a couple hours debugging was something like this: <style>
my-element {
outline: auto;
outline-color: red;
border: 1px solid blue;
display: inline-flex;
flex-direction: column;
}
my-element::after {
height: 0;
content: 'words';
visibility: hidden;
}
</style>
<my-element>More Text</my-element> In this example note that the A potential middle ground that would address this specific issue would be to treat |
You may find some screenshots for this issue in MediaWiki. |
Context:
text-indent: -9999px
or so to hide text on some controls.So given that browsers are agreeing now to draw the outline around the border area, not including descendants, except for this Blink special-case, can we spec outline rects finally?
I think I'd prefer agreeing on the Gecko + WebKit behavior, since it's consistent with borders and outlines on all other boxes.
The text was updated successfully, but these errors were encountered: