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

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

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Mon, 25 Feb 2008 16:58:54 -0800
Message-ID: <c9e12660802251658s6eb16694o18391866545f8b14@mail.gmail.com>
To: "Bert Bos" <bert@w3.org>
Cc: Www-style <www-style@w3.org>

The spec has standardized Microsoft properties in a way that is both
inconsistent with Microsoft properties and what browsers do

The definition for offsetParent is wrong.
http://www.w3.org/TR/2008/WD-cssom-view-20080222/#offset-attributes

offsetParent is the nearest positioned containingBlock, when it is
offset by left/top or margin, or nearest TABLE.

That includes body.

"#If the offsetParent of element A is null or the HTML body element
return the distance, as number of CSS pixels, between the top border
edge of element A and the canvas origin and stop this algorithm."

This is not right because body can be positioned. In fact, it's a
useful technique to have -

body {
  position: relative;
}

- to make the body a containing block. This avoids the problem of
having to add another relative #main-content div.

In Internet Explorer 7, documentElement can be an offsetParent when
body has position: static.
http://dhtmlkitchen.com/ape/test/tests/dom/inline-offsetTop.html

offsetLeft and offsetTop are wrong, too.
"Return the distance as number of CSS pixels between the top border
edge of the offsetParent of element A and the top border edge of
element A."

This is wrong. Only Opera does this.

Other browsers try to fultill the spec, but it's contradictory because
BODY cannot be offsetParent.

The problem with this spec is that it attempts to standardize Internet
Explorer properties in ways that are inconsistent with what Internet
Explorer actually does.

The spec should either create completely new properties, or exactly
copy what internet explorer does. Before writing such spec, it makes
sense to gather some test cases.

It contradicts CSS 2.1 containing blocks and contradicts what browsers
really do - and they all act differently WRT body element.

CSSOM, as it is, is breaking the web.

Garrett

On Mon, Feb 25, 2008 at 2:17 PM, Bert Bos <bert@w3.org> wrote:
>
>  The CSS WG published a new working draft:
>
>      CSSOM View Module
>
>      The APIs introduced by this specification provide authors with a way
>      to inspect and manipulate the view information of a document. This
>      includes getting the position of element layout boxes, obtaining the
>      width of the viewport through script, and also scrolling an element.
>
>      http://www.w3.org/TR/2008/WD-cssom-view-20080222
>
>  This is the first publication of this module.
>
>  Comments are welcome, preferably on this mailing list,
>  <www-style@w3.org>. Please, start the Subject with [cssom-view] (as I
>  did on this message).
>
>
>
>  For the CSS WG,
>  Bert
>  --
>    Bert Bos                                ( W 3 C ) http://www.w3.org/
>    http://www.w3.org/people/bos                               W3C/ERCIM
>    bert@w3.org                             2004 Rt des Lucioles / BP 93
>    +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
>
>
Received on Tuesday, 26 February 2008 00:59:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:01 GMT