On Fri, 01 Mar 2013 13:00:14 +0100, Hadrien Gardeur
<
hadrien...@feedbooks.com> wrote:
> I see where you're coming from (REST and in particular HATEOAS) but it
> doesn't really apply here, especially since you admit yourself than a
> centralized ToC is necessary anyway.
The centralized ToC that I think we should retain in addition to
link@rel=next navigation is the one that doesn't necessarily follow
reading order. This one needs to be explicit to provide access to all
parts of the book, and needs to be independent of whatever it is we use to
set the reading order, since it doesn't have to follow it.
> The difference between a publication and a set of Web resources, is
> essentially the "glue", how we link these document together (reading
> order
> and ToC) and what they represent when we group them together
> (publication's
> metadata). To be truely stateless, not only would you have to rely on
> reading order discovery (link@rel="next"), you'd also have to repeat the
> ToC and the publication's metadata too.
>
> What you're advocating for is a mixed model where some information is
> stocked between states (publication metadata, ToC) and others are
> discovered whenever we fetch a resource (reading order).
> It doesn't make much sense.
That's not the way I see it. Of course, if the book is split into several
files, you won't have all the information about everything without going
through all the files, and if we store publication metadata in the
index.html, then you have to load that to read it. As long as we're
considering a format made of several files, this is inevitable, and I
don't see that as a mixed model.
However, this is not what I referred to when I said state. I was thinking
of the information that the ebook UA must have in memory to be able to
interact with the book and respond to user actions, and in particular,
navigation commands. With link@rel=next, you can respond to the "turn
page" action only based on information contained in the page. With an ol
in index.html, you can't.
> Forcing content creators to embed everything in HTML seems like an even
> worse restriction to me than what we currently have in EPUB3 (XHTML or
> SVG).
> For a 100 pages long comics, you'd need a 100 HTML documents that will
> contain little information at all,
I agree this is inconvenient, but I'd be willing to live with it though.
While I am fine with adding new mechanisms for things that are completely
missing from the vanilla web platform, I am less enthusiastic about adding
mechanisms for things that are there, but that we deem imperfect. First,
for simplicity's sake. Second, because having two mechanism in place for
similar but subtly different things risks causing weird behavior when both
are used simultaneously. Also, because the web platform may gradually add
more functionality on top of its existing building blocks, and if we went
some other route, we'll either miss out, or have to duplicate it.
> just for the sake of supporting
> something that can't be stateless anyway.
See above for what I meant by stateless.
As I mentioned, I see a problem due to the statefulness of <ol> in
index.html. Here are 4 possible ways we could want to access that state:
- when opening the book, open index.html, extract the information about
the reading order and the ToC from the <ol> without running any javacript
first, and remember that forever.
- when opening the book, open index.html, run whatever javascript is
associated with the onload event, extract the information about the
reading order and the ToC from the <ol>, and remember that forever.
- whenever a navigation command (next, previous, etc) is issued, open
index.html, run the whatever javascript is associated with the onload
event, extract the relevant info from <ol>, act on it, and forget it.
- when opening the book, load index.html in a persistent environment, with
an active DOM, and let any javascript embedded in the page run in it for
as long as it wants to. Whenever a navigation command (next, previous,
etc) is issued, open index.html, extract the relevant info from the
current version of <ol> in the DOM, act on it, and forget it.
Because of the ability of javascript to act on the <ol> through the DOM,
these 4 methods can all yield different results. In the vast majority of
books, this won't be an issue, but it can be, so we have to specify which
way we want it.
It can be dealt with, but I'd rather not have to.
- Florian