W3C home > Mailing lists > Public > www-style@w3.org > July 2014

Re: [css-gcpm] Footnotes as Regions

From: Brad Kemper <brad.kemper@gmail.com>
Date: Mon, 28 Jul 2014 12:18:53 -0700
Cc: Dave Cramer <dauwhe@gmail.com>, "www-style@w3.org" <www-style@w3.org>
Message-Id: <90475A0F-8967-4DBF-BDCD-63CE372F3AD2@gmail.com>
To: Håkon Wium Lie <howcome@opera.com>


Brad Kemper
> On Jul 28, 2014, at 2:07 AM, Håkon Wium Lie <howcome@opera.com> wrote:
> 
> Dave Cramer wrote:
> 
>> During the Seoul F2F, we discussed the idea of implementing footnotes (and
>> running heads) using regions [1]
> 
>   ...
> 
>> We could also adopt some box-creation mechanism such as CSS Pagination
>> Templates [2], and use those in the page context:
>> 
>> @page {
>>  @slot footnote { flow-from: footnote }
>> }
> 
> IMHO, using @slot or some other CSS-based syntax makes much more sense
> than using element-based regions.

Agreed, but regions are not just element based, they are a general mechanism that can be used with elements, pseudo-elements, etc. They are still standard regions (using the standard 'flow-from' property) in this proposed footnote syntax, but the container is created via the mechanisms of the pagination templates draft (I.e. '@slot'). I like that approach too. 

> CSS Books [1] uses CSS-based syntax to create "named areas" (to
> complement "named pages"). The basic syntax is:
> 
>  @page {
>    @area footnotes { /* position the area */ }
>  }
>  span.fn { flow: footnotes }
> 
> It should be possible to converge @slot and @area. Let's investigate.

I think pagination templates has the general idea of defining areas that can be filled via the 'flow-from' property of the regions draft. If we can do that and also have it fulfill all the functionality provided by @area, then I also think that is a great idea to investigate. I don't really care if the containers are called "slots" or "areas". 

>> This would allow us to have multiple footnote areas, which is more common
>> than you think:
>> 
>> @page {
>>  @slot footnote1 { flow-from: footnote1 }
>>  @slot footnote2 { flow-from: footnote2 }
>> }
>> 
>> The pagination templates spec also has a "required-flow" property, which
>> could perhaps be at the slot level rather than the template level to say
>> "don't create this slot unless there's a footnote on the page."
> 
> Named areas are not created unless they have content. This seems like a better default.

@slot is also useful for creating areas of the page, such as sidebars, that the author might still want styled even when there is no content to flow into them. It seems reasonable for there to be some sort of switch for that (such as 'required-flow'), while still maintaining @slot as the general mechanism. 

>> @page {
>>  @slot footnote {
>>    flow-from: footnote;
>>    required-flow: footnote;
>>    height: auto;
>>  }
>> }
>> 
>> This region could also be an exclusion, so that it carves the necessary
>> space from the main text area on a page. But there are still lots of issues
>> to deal with.
>> 
>> A. We need a reference to the footnote's original location, before it was
>> removed from the flow, so we can insert a reference mark. GCPM has a
>> ::footnote-call pseudo-element, but in Seoul there was some talk of a
>> general-purpose solution.
> 
> CSS Books calls this: "::call"
> 
>  http://books.spec.whatwg.org/#note-calls:-::call
> 
>> Right now the book.js folks use three nested
>> spans for footnotes, which is a burden for document authors. So if
>> span.footnote was moved to a region, we'd leave behind
>> 
>> span.footnote::place-holder {
>>  content: counter(footnote);
>>  font-variant-position: super;
>> }
>> 
>> Of course, much bikeshedding would be required. This idea would potentially
>> be useful for figures, side notes, and any other content that was floated
>> or moved to a region.
> 
> Indeed, footnotes and sidenotes are quite similar and it makes sense
> to address them in the same specification. Figures have their own issues,
> but they're on the same page, so to say.
> 
>> B. We need to express the constraint that the footnote appear on the same
>> page as its reference, and how to handle footnotes (or portions of
>> footnotes) that won't fit on the original page. This is where the serious
>> magic happens.
>> 
>> C. The interaction between footnotes and columns is complex. In particular,
>> how would you specify that a footnote be displayed at the bottom of the
>> column that contains the reference?
> 
> Prince addresses this by having a separate value on float:
> 
>   float: column-footnote
> 
> in addition to the normal:
> 
>   float: footnote

So far, the pagination templates draft has a different approach than using new float values, and seems to get by without them. It seems to have a more top-down approach to laying out the page in predetermined ways, rather than the somewhat more organic layout creation approach of floating to the bottom of something (of a page, or of a column). 

I think both have merits, and could even coexist. I'd most love to see the templates ideas advance, using regions and maybe exclusions too. 

In this particular case, floating to the bottom of a column seems somewhat simpler than creating some sort of "column template" with a 'required-flow' slot in it, but I'd like to hear Dave Cramer or Alan Stearn's thoughts about how'd he'd approach this use case. 

> The corresponding footnote areas would be defined with:
> 
>  @page {
>    @column-footnote {
>      float: bottom;
>      float-reference: page; 
>    }
>  }
> 
> In addition to the existing:
> 
>  @page {
>    @footnote {
>      float: bottom;
>      float-reference: column; 
>    }
>  }
> 
>  http://figures.spec.whatwg.org/#setting-the-page-float-reference:-float-reference
> 
>> D. Footnotes are sometimes displayed inline to save space. The document
>> author could easily do this by setting the display value on the footnote,
>> but in some cases we'd like the user agent to set short footnotes inline,
>> and longer footnotes as blocks.
>> 
>> span.footnote {
>> flow-into: footnote;
>> bikeshed-display: compact;
>> }
> 
> We could add properties for this, but it may be easier to add support
> for many variations in footnote formatting by using a functional
> notation. E.g.:
> 
>  float: footnote;                 /* default: block-level, bottom of page */
>  float: footnote(inline)          /* inline footnotes, bottom of page */
>  float: footnote(compact)         /* conditional block/inline, bottom of page */
>  float: footnote(column)          /* block-level, bottom of column */
>  float: footnote(compact column)  /* conditional block/inline, bottom of column */

Having lots of variations on float values seems more complicated that using 'flow-from' and 'flow-into' to put it into a slot/area.  Maybe the equivalent using regions and templates only would be to add another component value to 'flow-into', like 'flow-into:  footnotes compact'. 

Does 'compact' mean that the UA would decide on its own whether to make the footnote inline or block, based on the length? Or something? It sounds kind of sketchy to me, regardless of it it is using floats or regions. 
Received on Monday, 28 July 2014 19:19:23 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC