Re: [CSS3, Backgrounds and Borders Module] some questions about border-radius

Brad Kemper wrote:
> 
> On Aug 22, 2009, at 9:41 PM, Andrew Fedoniouk wrote:
> 
>> Brad Kemper wrote:
>>> On Aug 22, 2009, at 8:30 PM, Andrew Fedoniouk wrote:
>>>> Reading this document
>>>> http://www.w3.org/TR/2008/WD-css3-background-20080910/#the-border-radius 
>>>>
>>>> got couple of questions.
>>>>
>>>> Phrase after [Example XXI]:
>>>>
>>>> "(In such cases its center might not coincide with that of the outer 
>>>> border curve.)"
>>>>
>>>> Not clear what it means. Center of circle having radius zero? It's a 
>>>> point then. Has no center... Or is this about something else?
>>> That is how I read it. A point does have a center (it's the same point).
>>
>> Mathematically speaking - yes, someone can say that point is a circle of
>> radius zero but that is pretty unusual way of saying "point".
>>
>>> That point would no longer align with the center of the center of the 
>>> circle describing the outside of the border, when the border 
>>> thickness is thicker than the corner-radius. There may be a better 
>>> way to say this...
>>
>> In case of borders of different thickness centers of outer and inner 
>> circles are different. Is this what you are trying to say?
> 
> No. But given that fact, if you have, say a 20px border and a 10px 
> border-radius, the inner "circle" (actually a corner), will not be at 
> the center of the 10px circle. I believe that's what it is saying, 
> although it seems kind of self evident to me. I can't really imagine it 
> some other way.

Sorry, this is somehow hard to understand.

"will not be at the center of the 10px circle" but where?

> 
>>
>>>> [...]
>>>> And the main question:
>>>>
>>>> "Other effects that clip to the border or padding edge (such as 
>>>> ‘overflow’) also must clip to the curve."
>>>>
>>>> Clipping of content on such border may lead to information lost.
>>>> Text behind rounded corner will not be seen at all [top-left corner,
>>>> case #8 above].
>>> Text that goes outside its boundaries is also "information lost" when 
>>> overflow is 'hidden'. Thus it is within the author's ability to 
>>> obscure text with overflow, as always. If I don't want the text to be 
>>> clipped by the corners, then I can add padding.
>>
>> It is about overflow:auto rather than hidden.
>> You cannot see that portion even with overflow:auto. That is the point.
> 
> If I consider that a problem when I'm authoring, then I will add padding 
> to prevent it. CSS does not prevent authors from hiding content that 
> users can't get to. It happens all the time with negative absolute 
> positioning, for instance, or can happen with overflow:hidden. It can 
> also happen with black text on top of a black border with border-radius. 
> So instead of trying to prevent authors from creating unreadable text, 
> let us just be responsible for our own design decisions. I think it is 
> completely reasonable and expected that any border that would clip 
> content should also do so at the curved corners.

Take a look on this case:
http://www.terrainformatica.com/w3/border-radius-text.png
Paddings will not help you here.

> 
>> I think we just need to remove "Other effects that clip to the border 
>> or padding edge (such as ‘overflow’) also must clip to the curve."
>> statement. It does not create solutions - just problems.
> 
> I disagree.

Could you provide some usable case then where you will need overflow 
clipping of content on rounded border?

> 
>> Technically it is even not possible to do such clipping if 
>> antialiasing is used. Border should be drawn on top of content but not 
>> underneath as the spec mandates.
> 
> I don't see how that prevents you from clipping the content (including 
> antialiasing) to the same path as what is under the content.
> 

Ok, technically *and* practically. I don't know modern platform that
has clipping with antialiasing exposed in public API.
There is simply no need for such function.

-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Sunday, 23 August 2009 06:59:39 UTC