W3C home > Mailing lists > Public > www-style@w3.org > April 2011

Re: canvas origin?

From: Alan Gresley <alan@css-class.com>
Date: Sat, 09 Apr 2011 03:31:06 +1000
Message-ID: <4D9F465A.1080603@css-class.com>
To: Jack Smiley <zxcv_890@hotmail.com>
CC: www-style@w3.org
On 9/04/2011 2:50 AM, Jack Smiley wrote:
>
>> On 07/04/2011 22:14, Anton Prowse wrote:
>
>>> I suppose the canvas origin is where the top-left corner of the margin
>>> area box of the root element would be if it had position:static, and the
>>> ICB's top-left corner is incident with that point.
>>
>> That was rather careless.  How about: ...if it had position:static and
>> non-auto margin-left, in ltr mode; and in rtl mode it's the top-right
>> corners and margin-right that we consider.
>
> Thank
>   you for your response. I'm not clear about your stipulation about
> margin-left having to be "non-auto". Can you explain what you mean by
> this?
>
> By saying "non-auto", are you implying that it's
> permissible for the left-margin property of the html element to be
> specified as any positive or negative number, so that the canvas origin
> would then be wherever the top-left corner of the html (root) block is?
> (assuming ltr mode) For example, if I do html: {margin-left: -50px},
> would the canvas origin be 50px to the left of the top left corner of
> the viewport? And since the ICB is coincident with that point, its top
> left corner would be at that point as well?


That is correct.


> The problem with this is
> that it means that the ICB would be larger than the viewport (when the
> spec says that the ICB is the same dimensions as the viewport).


The ICB can be larger than the viewport. If you have a div (position 
static) in normal flow with an absolute width.

  <div style="width: 1000px"> .... </div>


As you narrowed the viewport to below 1016px, the ICB is will become 
wider than the viewport for floats. For elements with position absolute, 
the viewport will still use the viewpoint in calculating it's ICB.


> This is
> because the right margin edge of the html block extends to the right
> edge of the viewport, which must mean that the ICB (html's containing
> block) extends to the right edge as well. I'm finding this very
> confusing.


Please remember that the ICB is calculated differently for elements that 
are not in normal flow (ie. floats, position absolute).

The ICB for floated elements and absolutely positioned elements (with 
offset values of auto) are formed by the content edge of the root element.

The ICB for absolutely positioned elements with offset values of 0 (or 
any positive or negative integer) is formed by the viewport in most cases.

These test cases (set of 4 for floats and set of 8 for ap.) may help you 
understand (you need to scroll with some).


http://css-class.com/test/css/bidi/visible-overflow-containing-block-ltr.htm

http://css-class.com/test/css/bidi/visible-overflow-containing-block-ltr-ap-left.htm


As a guide the background-color for <body> is white and the 
background-color for <html> is blue.


>>> This should probably be made a little clearer in the spec.
>
> I agree. How can we make that happen?


By having patience with oneself. Those specs are not easy absorbed 
overnight. :-)


-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Friday, 8 April 2011 17:31:34 GMT

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