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

Re: [CSS21] Does 10.6.7 apply to the root element?

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Fri, 7 Apr 2006 17:40:28 -0700
Message-ID: <c9e12660604071740j11018099sc8a9f19171eca18b@mail.gmail.com>
To: www-style@w3.org

MS DHTML properties commentary:

In both browsers, clientHeight/offsetHeight should return the correct
properties of the element, even if it is the root (our case).

Currently mozilla is correct on offsetHeight for root, it gets
clientHeight wrong, instead returning the height of the viewport's
visible area (or approximately).

So why should overflow not apply to the viewport?

The confusion origniates from MSIE. Microsoft implemented the HTML
element as the ICB in IE 6 (it was BODY in previous versions). This
allowing the developer to turn off scrollbars by specifying overflow:
hidden on that element.

Mozilla tried to implement the MSIE properties, but did a bad job.
This is because MSIE treated BODY (prior to IE6) HTML (IE6) as the
ICB, but Mozilla treated the viewport as the ICB.

Mozilla is correct, and the CSS2.1 spec finally made some distinction
about that.

If overflow applies to the viewport, then why not border? That's what
IE does, after all.

Is the goal of the CSS WG to copy IE's buggy behavior?



On 4/7/06, Garrett Smith <dhtmlkitchen@gmail.com> wrote:
> My previous example was not the best. documentElement.clientHeight
> returns the height of the viewport, not the documentElement.
>
> Regardless, the root node is not the ICB. The overflow property, when
> applied to the root, should not affect the ICB.
>
> I realize that the current behavior of browsers is to implement IE's bug.
>
> I believe that bugs should not become specs.
>
> root = documentElement
> ICB (initial containing block) = viewport
>
> The root is not the ICB.
>
> Garrett
>
> On 4/7/06, Garrett Smith <dhtmlkitchen@gmail.com> wrote:
> > Most people think that root is the ICB, and in fact, IE behaves as if
> > it were. For example, in IE, documentElement.clientHeight will return
> > the viewport's height, but in mozilla, the root's height will grow to
> > accomodate it's children.
> >
> > Mozilla's behavior is correct, because in reality, the root is not the
> > ICB. The root is the root and the ICB is the viewport.
> >
> > If overflow on the root is applyied to the viewport instead, this will
> > further add to confusion and misunderstanding about the ICB and the
> > root.
> >
> >
> > Garrett
> >
> >
> > On 4/7/06, L. David Baron <dbaron@dbaron.org> wrote:
> > > On Friday 2006-04-07 15:50 +0200, Anne van Kesteren wrote:
> > > > Reading 10.6.6
> > > > http://www.w3.org/TR/2004/CR-CSS21-20040225/visudet.html#q22 and given
> > > > that 'overflow'
> > > > http://www.w3.org/TR/2004/CR-CSS21-20040225/visufx.html#overflow acts like
> > > > 'auto' when applied to the root element does
> > >
> > > 'overflow' effectively never applies to the root element since when it's
> > > set on the root element, it applies to the viewport instead.  This is
> > > clarified in changes we've made since the last public draft, so the rule
> > > that overflow on the root should be propagated to the viewport is no
> > > longer specific to HTML UAs, and is now a must instead of a should.
> > >
> > > > http://www.w3.org/TR/2004/CR-CSS21-20040225/visudet.html#root-height apply
> > > > to the root element? Testcase:
> > > >
> > > >  http://dump.testsuite.org/2006/www-style/001.htm
> > >
> > > I think that's a bug in Mozilla.
> > >
> > > -David
> > >
> > > --
> > > L. David Baron                                <URL: http://dbaron.org/ >
> > >            Technical Lead, Layout & CSS, Mozilla Corporation
> > >
> > >
> > >
> >
> >
> > --
> > http://dhtmlkitchen.com/
> >
>
>
> --
> http://dhtmlkitchen.com/
>


--
http://dhtmlkitchen.com/
Received on Saturday, 8 April 2006 00:40:59 GMT

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