w3c / dpub-pwp-ucr

Use Cases and Requirements for (Packaged) Web Publications
https://w3c.github.io/dpub-pwp-ucr/
Other
11 stars 19 forks source link

Resource mixing and CSS counters across HTML pages #215

Closed francofaa closed 5 years ago

francofaa commented 5 years ago

Layout requirement contradicts example given.

For the purposes of layout, each resource of a Web Publication is treated as a separate document. User agents must not mix content from multiple resources in the same rendering (e.g., CSS floats or absolutely positioned elements from one resource cannot intrude or overlap with content from an other resource).

Maeve is authoring an internal work document for her company as a Web Publication. This Web Publication spans several resources / documents, and she would like to use decimal-dot notation to indicate the section numbers. The CSS counter should be able to accumulate across the multiple resources to provide an accurate count.

Setting aside the contradiction, does the requirement that resources be treated separately from each other need to be included as a requirement since this is already how the web works?

Is the use case presented necessary since this is not currently possible in CSS? Should this be included? If this is introduced into CSS later, would be it be safe to assume that the capability of tracking list item, section, and page number across HTML pages would also be available in Web Publications (and even EPUB)?

laudrain commented 5 years ago

@francofaa I don't see a contradiction between laying out a resource in a single rendering and accumulating CSS counters across multiple resources. But this text may perhaps be improved like this in the example:

Maeve is authoring an internal work document for her company as a Web Publication. This Web Publication spans several resources / documents, and she would like to use decimal-dot notation to indicate the section numbers. The CSS counter should be able to accumulate across the multiple resources to provide an accurate count when layout in each separate resource.

iherman commented 5 years ago

This issue was discussed in a meeting.

atyposh commented 5 years ago

It is unreasonable to expect both

As an author of a 15-chapter book (a WP consisting of 15 chapter resources) I should accept that the HTML/CSS of each chapter resource needs to be hard-coded (or populated with a simple build tool) with its chapter number, shouldn't I?

llemeurfr commented 5 years ago

Wouldn't a smart system use the reading order to infer that the last "page" number of a resource (totally dynamic because Web Publications are reflowable) is incremented by 1 for the first page of the next resource?

atyposh commented 5 years ago

Wouldn't a smart system use the reading order to infer that the last "page" number of a resource (totally dynamic because Web Publications are reflowable) is incremented by 1 for the first page of the next resource?

@llemeurfr, indeed a WP UA should do this for dynamic (reflowed) page numbers (as most EPUB readers currently do). However, the CSS counter issue is more complicated. It's about dynamically generating list counters within the content, AFAIK.

For example, imagine a legal document marked up with chapters, sections, subsections, and paragraphs. Every paragraph would have a CSS-generated label like "12.5.3.2". The "12" is the chapter number. If every chapter in the WP is its own document, then the CSS counter logic would either: