W3C home > Mailing lists > Public > www-style@w3.org > January 2016

Re: [css-page-floats] Fallback behavior of clear:block-start/etc

From: Shinyu Murakami <murakami@vivliostyle.com>
Date: Sun, 24 Jan 2016 16:43:19 +0900
To: www-style@w3.org
Message-Id: <20160124164317.5212.3B6C55AB@vivliostyle.com>
Hi,

I think "clear: block-start" and "clear: block-end" will be useful 
for normal block-level elements or inline floats if they have the 
following meanings:

(my proposal)

block-start
    If applied to a block-level element (or inline floats), 
    it ensures that any floats preceding the block in document order 
    don't exceed the beginning of the block, 
    and when the block has force column/region/page break-before, 
    it ensures that any floats preceding the block don't appear 
    in the same or following column/region/page.

    If applied to a page float, ....

block-end
    If applied to a block-level element (or inline floats), 
    it ensures that any floats preceding or within the block 
    in document order don't exceed the end of the block.
    (This can be used for "clearfix".)

    If applied to a page float, ....

both-inline
    Behave like inline-start and inline-end.
both-block
    Behave like block-start and block-end.
both
    Behave like both-inline.
all
    Behave like both-block and both-inline.

Example:
  article {
    clear: all;
  }

  <article>
    <h1>First article</h1>
    ...
    <figure>...</figure>
    ...
  </article>
  <article>
    <h1>Second article</h1>
    ...
  </article>

The "clear: all" ensures that the figures in the first article don't 
intrude into the second article even if the figures have any float 
properties (float-defer, etc.).


-- 
Shinyu Murakami


Johannes Wilm <johannes@fiduswriter.org> wrote on 2016/01/24 4:21:18
> On Fri, Jan 22, 2016 at 10:50 PM, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
> 
> > "clear: block-start" only has useful behavior for page floats. For
> > other elements, it's currently defined to act identically to "clear:
> > inline-start".  (And "block-end" falls back to acting like
> > "inline-end".)  This seems arbitrary and weird - the axises arent'
> > interchangeable!
> 
> 
> > "block-start/end" should either fall back to "both" (if you want to
> > preserve the fact that it's clearing) or "none" (because the author
> > messed up and tried to do an invalid clear).  I'm not sure which one
> > is better.  fantasai prefers "none".
> >
> 
> I would be fine with either one, probably better to use "none". Should we
> also use "none" if a user tries to float an inline-float to the block-start?
> 
> 
> > ~TJ and fantasai
> >
> >
> 
> 
> -- 
> Johannes Wilm
> Fidus Writer
> http://www.fiduswriter.org
Received on Sunday, 24 January 2016 07:43:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:59 UTC