-
Notifications
You must be signed in to change notification settings - Fork 785
Add outline-offset: inset #13765
Description
While implementing appearance: base for <select> I noticed that outline doesn't work as-is for the option elements shown in ::picker(select). That's because it has overflow: auto by default, clipping the outline.
So instead we need to draw the outline in the other direction (assuming we don't want to invent a new type of outline that's not clipped).
Now for auto outlines there's no width so you can't use a negative outline-offset and even though in practice you could it would not be a cross-platform value. So ideally you have something like inset, which negates the used auto outline width.
WebKit trunk uses such a value now for this purpose. It computes to an actual width so it doesn't violate the outline-offset contract, but I think if it were standardized we would want to compute to inset so we don't reveal the actual auto outline width value used.
For non-auto outlines just negating the used width suffices.
A concern in whatwg/html#12286 was that user style sheets might have very large outline values and this would obscure their appearance: base <option>s. I think I can live with that, but I would also be okay with always imposing an upper limit of 5 CSS pixels or some such. But maybe we should only do that if it's actually becoming a problem. Not sure how many user style sheets there still are and users could also adjust outline-width on <option> if they wanted to.