Re: [css3-ui] Negative values in outline-offset?

Tab Atkins Jr. <jackalmage@gmail.com> skreiv Wed, 15 Feb 2012 22:45:07  
+0100

> On Wed, Feb 15, 2012 at 7:33 AM, fantasai  
> <fantasai.lists@inkedblade.net> wrote:
>> On 02/15/2012 03:02 AM, Kang-Hao (Kenny) Lu wrote:
>>>
>>> (An old thread about outline-offset being negative)
>>>
>>> (11/05/02 20:49), Boris Zbarsky wrote:
>>>>
>>>> No, it just means that some implementations may not support all
>>>> negative values for some properties even though per spec they really
>>>> should.
>>>
>>>
>>> What should happen when the absolute value is bigger than half of the
>>> smaller outer border edge than? Test case:
>>>
>>> data:text/html,<p style="outline: solid; outline-offset: -2em;">Test
>>>
>>> WebKit browsers draw no outline in this case and Firefox....  I can't
>>> quite describe it... it's something like a normal outline without two
>>> top corners.
>>>
>>> I suggest we either explicitly mark it undefined (this case is  
>>> contrived
>>> anyway) or spec WebKit's behavior.
>>
>>
>> IMO the UA should floor it at the least offset it can support. It  
>> shouldn't
>> *not* draw the outline.
>
> Yes, our behavior sounds like a silly bug.  We can floor it instead.
> That should be an easy thing to change.

Just to make sure I understand: The new suggested behavior would be to  
floor the outline-offset to the lowest value that will draw the entire  
outline. In Kenny's test case, this would draw an "outline" in the middle  
of the element - sort of like strikethrough, only it would be a few pixels  
tall, invert the text by default, start after the start of the text and  
extend almost to the width of the P element.

An illustration of this boundary condition, based on Kenny's TC:

data:text/html,<p style="height: 20px; outline: solid; outline-offset:  
-10px;">Test

No objections to the change, if I have understood it correctly; the  
outline should reliably be visible.

-- 
Leif Arne Storset
Core Technology Developer, Opera Software
Oslo, Norway

Received on Thursday, 16 February 2012 10:11:12 UTC