W3C home > Mailing lists > Public > public-digipub-ig@w3.org > November 2015

Re: Is there a CSS media query for EPUB (or, later, PWP)?

From: Zheng Xu <zxu@kobo.com>
Date: Sun, 1 Nov 2015 03:23:16 +0000
To: Ivan Herman <ivan@w3.org>, Florian Rivoal <florian@rivoal.net>
CC: Dave Cramer <Dave.Cramer@hbgusa.com>, Elika Etemad <fantasai@inkedblade.net>, W3C Digital Publishing IG <public-digipub-ig@w3.org>
Message-ID: <SN1PR0501MB17268E354CA147B108BC4D33CB2D0@SN1PR0501MB1726.namprd05.prod.outlook.com>
I worked around how to convert some html to epub a while before. Also encountered same problem. Some publisher (web creator) wrote website with something like table of content in their web page which we could not convert those table of content into TOC in epub perspective.

I don't know if the following use case is described exactly, but I think we need a way to say "this part of content is for TOC in epub, so, on epub we can easily turn it off in rendering engine and put it into another TOC file".
And I think how to turn it off in rendering engine is something we can handle in media query.

Now just went through MediaQuery (https://drafts.csswg.org/mediaqueries/#mf-dimensions ) again but I think still need something more to cover epub case.
The current media specified in Media Query spec is still to display html in different media type and they just need to think about where to display table of content because they have not a TOC concept like epub. But, fortunately or not, epub defined this TOC concept, in a different nav file.

From: Ivan Herman <ivan@w3.org>
Sent: October 31, 2015 8:15 PM
To: Florian Rivoal
Cc: Dave Cramer; Elika Etemad; W3C Digital Publishing IG
Subject: Re: Is there a CSS media query for EPUB (or, later, PWP)?

> On 31 Oct 2015, at 11:43, Florian Rivoal <florian@rivoal.net> wrote:
>> On 31 Oct 2015, at 06:56, Ivan Herman <ivan@w3.org> wrote:
>> MQ4 does include media types and media features and I think it is a legitimate question whether there is a way to characterize and EPUB or, eventually, similar publications. Is it a print media? An EPUB should probably be considered as a screen media type, so the question is whether there are (and whether there should be) media features that differentiate them from other presentations.
> The CSS WG considers media types to be a failed idea. Quoting from the level 4 media queries spec:
>> media types have proven insufficient as a way of discriminating between devices with different styling needs. Some categories which were originally quite distinct, such as screen and handheld, have blended significantly in the years since their invention. Others, such as tty or tv, expose useful differences from the norm of a full-featured computer monitor, and so are potentially useful to target with different styling, but the definition of media types as mutually exclusive makes it difficult to use them in a reasonable manner; instead, their exclusive aspects are better expressed as media features such as grid or scan.

Good to know, thanks. (And the arguments sound perfectly clear to me:-)

> Another thing that makes media features far superior to media types is that they are future proof, as they enable authors to write styles that work well on devices they have not anticipated, by reacting to the relevant characteristics of these devices.
> The CSS WG will not add more media types, and is actively deprecating most of the existing ones. So an "epub" media type is pretty much out of question. On the other hand, media features to expose what makes an epub reader different from another medium are very much in scope.
> We already have a few media features that should help authors make their styles conditional on distinctive aspects of (some) epub readers:
> - scripting: tell apart UAs with and without javascript support
> - pointer / hover: react to the type of pointing device
> - update-frequency: differentiate between media that never changes once rendered (paper), those that can change but not animate (e-ink), and those that can change in real time (regular screens)
> - overflow-block / overflow:inline: are we in a paged medium, or a scroll medium (plus additional subtleties)
> I encourage you (and other people in the IG) to look at section 4,5,6,7,8 and 9 of the media queries level 4 specification (https://drafts.csswg.org/mediaqueries/#mf-dimensions). If you think that there are distinctive aspects of epub reading systems that authors would like to react to, but are not covered by the media features already specified, this would be valuable feedback to the CSSWG.

I will certainly do that (although the coming few days are a bit hectic for me), but, most probably, you guys who have more experience in the down-to-Earth issues when using CSS for publishing would have much more to contribute...

> Based on your original mail, I suppose you'd like to see a media feature that would let you react to the UA/environment providing a table of contents. This might be worth looking into. We should probably start by gathering various use cases to see how the different media with TOCs behave, to figure out if this is an on/off switch, or if there are more variants (or if this is the correct axis at all). For example, we should look at different epub readers, pdf renderers, assistive technologies…

That was indeed my initial issue that triggered my question but, obviously, there may be other use cases.

Thanks a lot Florian


> - Florian

Ivan Herman, W3C
Digital Publishing Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
ORCID ID: http://orcid.org/0000-0003-0782-2704
Received on Sunday, 1 November 2015 03:23:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 25 April 2017 10:44:34 UTC