Re: [CSS 2.1] cases that do not pass in any browser

On Thu, Aug 12, 2010 at 04:32:07PM -0700, Tab Atkins Jr. wrote:
> On Mon, Aug 2, 2010 at 6:44 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> > On 8/2/10 6:34 PM, Arron Eicholz wrote:
> >>
> >>
> >> http://test.csswg.org/source/contributors/mozilla/submitted/css2.1/selectors/first-line-floats-002.htm
> >
> > This is a very interesting testcase that I wrote because the spec is pretty
> > clear here but the behavior of some UA's didn't make sense.  The testcase is
> > basically:
> >
> >  <style>
> >    div { color: red; }
> >    div:first-line { color: green }
> >  </style>
> >  <div>
> >    <span>
> >      <span style="float: left">This should be green</span>
> >    </span>
> >  </div>
> >
> > Ignoring the first-line business for the moment, the float inherits its
> > color from the outer <span>.  But section 5.12.1 explicitly says that this
> > markup should behave just like this markup:
> >
> >  <div style="color: red">
> >    <div:first-line style="color: green">
> >      <span>
> >        <span style="float: left">This should be green</span>
> >      </span>
> >    </div:first-line>
> >  </div>
> 
> Agreed; the spec is very clear that this is the correct element-tree.
> The color of the float then follows naturally.

If a user agent doesn't consider the float to be part of the first line,
then it's probably because of the following from section 5.12.1:

  # The "first formatted line" of an element may occur inside a block-level
  # descendant in the same flow (i.e., a block-level descendant that is not
  # positioned and not a float)

Presumably people are reading that as saying that the first formatted line of
an element can't occur inside a descendent that is a float;
which does seem like a reasonable guess as to the intent of that text.

pjrm.

Received on Friday, 13 August 2010 07:49:08 UTC