Re: [cssom-view] New WD "CSSOM View Module"

On Tue, Feb 26, 2008 at 4:38 AM, Anne van Kesteren <annevk@opera.com> wrote:
> On Tue, 26 Feb 2008 01:58:54 +0100, Garrett Smith <dhtmlkitchen@gmail.com>
>  wrote:
>
> > The spec has standardized Microsoft properties in a way that is both
>  > inconsistent with Microsoft properties and what browsers do
>
>  As a general note. The specification has been based on tests. Some of
>  those are here:
>
>    http://dump.testsuite.org/2006/dom/style/offset/
>

<!DOCTYPE html>
quirks mode.

Where are the tests in CSS1Compat mode?

>  I have not reverse engineered one specific browser. For instance, reverse
>  engineering Internet Explorer would make this dependent on hasLayout and
>  several other quirks Internet Explorer has. That would not be good.

Making tests for CSS1Compat mode would avoid that problem.

Your testing approach makes it harder to see whats going on.

What's needed is an automated test. I've already gotten started on
one, but I want to host it not on my site, but somewhere with a
repository so tests can be CRUD'd by multiple users.



>  > It contradicts CSS 2.1 containing blocks and contradicts what browsers
>  > really do - and they all act differently WRT body element.
>
>  Yes, this specification tries to find a middle ground.

As a result, it is broken/useless.

I'm not sure what
>  you mean with contradicting CSS 2.1. Where does that happen?

The part that contradicts CSS2.1 the CSSOM spec says:
"If any of the following holds true return null and stop this algorithm:
...
" A is the HTML body element."

CSS2.1, 10.1 Definition of "containing block"
"... if the element's position is 'relative' or 'static', the
containing block is formed by the content edge of the nearest
block-level, table cell or inline-block ancestor box."

It is contradictory because:
A positioned element forms an offsetParent. If body has position
static, it is not a positioned element. How can BODY be an
offsetParent?

Your confusion probably comes from a few things:
1) tests are in quirks mode
2) IE treats the ROOT node as the ICB. (This should not affect the standard)
3) In IE, quirks mode BODY is root.
4) misunderstanding what the ICB is

"The containing block in which the root element lives is a rectangle
with the dimensions of the viewport, anchored at the canvas origin for
continuous media, and the page area for paged media. This containing
block is called the initial containing block. "

So to add clarification, the root is treated as ICB in IE. In IE in
quirks mode, root is (for all practical purposes) BODY. The tests are
all done in quirks mode, which leaves BODY being treated as the ICB
for IE. That is probably the source your confusion.


>  > CSSOM, as it is, is breaking the web.
>
>  It's a first public Working Draft, with several oustanding issues, that
>  tries to define how various layout related attributes should work. It
>  seems a bit of an overstatement to say that it breaks the Web...

Not when browsers try implement it, it's not. All of the browsers try
(and fail because the spec is broken). Not just Opera, but Safari and
Mozilla.

Mozilla: Add a border to body and body's offsetTop will be negative
the border width. This comes down to a few factors related to people
wanting to figure out the coordinate position of [any_element].

Safari: Add a border to static body and an absolutely positioned child
Here's a quote from my previous email to you (which was quite cordial
in contrast):

"...
One inconsistency is the special treatment of BODY as if it were the
documentElement (doc says BODY is always an offsetParent). This is a
real pain. In safari, for example:

#aDiv { position : absolute; top 0 }
body { border: 10px solid red; }

aDiv.offsetTop => -10
..."

The difference between what I'm saying now and what I said in my
earlier email is that now it is a public debate, so not as easy to
ignore.

Write a function to determing the position of [any_element]. Body can
have position, left, top, margin, padding, border. This will help you
to come closer to understanding the significance of the damage created
by CSSOM drafts.


Garrett

>  --
>  Anne van Kesteren
>  <http://annevankesteren.nl/>
>  <http://www.opera.com/>
>

Received on Tuesday, 26 February 2008 22:09:31 UTC