W3C home > Mailing lists > Public > www-style@w3.org > February 2012

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

From: Brad Kemper <brad.kemper@gmail.com>
Date: Sun, 19 Feb 2012 12:40:41 -0800
Cc: fantasai <fantasai.lists@inkedblade.net>, "Tab Atkins Jr." <jackalmage@gmail.com>, www-style@w3.org
Message-Id: <0A6E81F4-982A-4DD4-9C94-12186A208091@gmail.com>
To: Leif Arne Storset <lstorset@opera.com>

On Feb 16, 2012, at 2:10 AM, Leif Arne Storset wrote:

> 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.

Safari (at least on the Mac) has a UA stylesheet with 	
	outline-style: auto;
	outline-width: 5px;

...where 'auto' creates a glow effect similar to a box-shadow with no offsets. I think the floor should be the lowest value that will draw at least 1px of the outline-width. Thus, if the outline-width is more than element width or height, you could still see some of the glow.
Received on Sunday, 19 February 2012 20:41:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:50 GMT