3 ms·
The code in question can be mostly boiled down to: outline: inset 100px green; outline-offset: -125px; The issue is: - spec is deliberately liberal about
by lucideer 8y ago
The code in question can be mostly boiled down to:
outline: inset 100px green;
outline-offset: -125px;
The issue is:
- spec is deliberately liberal about how outline should look (this is kind of a similar case to forms and scrollbars, the styling of which varies not just by browser, but by OS/toolkit)
- inset is a keyword rarely if ever applied to outlines (and I'm not sure why it's even valid or what it's purpose would be)
- outline-offset is a useful property, with well defined behaviour in most cases: inset outlines are the exception where its behaviour is ill-defined
Edge's behaviour is probably technically "closest" to what I would expect, but I'm not sure if "correct" is the right term. It's an odd case, and what it should look like is debatable. IE's and Safari's could be "correct" either, and in fact IE's kind of looks truest to the intent of outlines as a thing.
Chrome is doing very bizarre things and I can't really fathom why. They look like rendering bugs.
Edited after a 2nd look, IE's and Safari's make a bit more sense after some consideration.
- LukeShu 8y agoFiddling with it: Firefox's mistake is definitely that it isn't handling having outline-offset less than "-min(width, height)/2" in a sane way. (In the demo, width and height are both 100px; it starts do do funny things when outline-offset goes below -50px). That said, I'm not entirely sure that there is a sane way. IE is totally ignoring the outline-offset property; it isn't implemented in IE.