Live data from Hacker News

Your ePub Is fine

andreklein.net

11–20 of 322 posts

Re: Your ePub Is fine

#11
> When I started out, I dreaded the moment when I hit the validate button on my finished book after months of work, because it would always find something to cry about.

I remembered one particular master student on the verge of tears trying to compile his LaTeX thesis draft, he took the “write and think about formatting later” too literally and was trying to compile it for the first time very close to the deadline.

Re: Your ePub Is fine

#12

>but it can’t validate CSS against a renderer which is fundamentally broken! The epub standard doesn't say what version of CSS must be supported. There were no guarantees modern CSS would work so I wouldn't call the renderer broken.

If the renderer completely fails because of a minor issue when parsing the css, that is broken.

Re: Your ePub Is fine

#13

>but it can’t validate CSS against a renderer which is fundamentally broken! The epub standard doesn't say what version of CSS must be supported. There were no guarantees modern CSS would work so I wouldn't call the renderer broken.

No, the CSS spec is specifically designed to be forwards compatible because of exactly this issue. Any invalid CSS rule should only cause that specific line to be ignored, not the whole stylesheet. And certainly even if your CSS parser chokes in some specific case, it shouldn't cause your ereader to fail to load the entire book!

Re: Your ePub Is fine

#14

>but it can’t validate CSS against a renderer which is fundamentally broken! The epub standard doesn't say what version of CSS must be supported. There were no guarantees modern CSS would work so I wouldn't call the renderer broken.

You are of course correct that ePub nowadays doesn’t mandate a given version of CSS (though earlier versions did!), but that doesn’t matter in this case: it’s non-conforming according to even CSS level 1 (1996), per https://www.w3.org/TR/REC-CSS1-961217#forward-compatible-par...

> illegal values, or values with illegal parts, are treated as if the declaration weren't there at all

So a conforming implementation would ignore that max-width property declaration, not raise an error.

And those earlier versions of ePub which defined a required subset of given CSS standards? The forwards-compatible parsing rules were part of their subset.

Re: Your ePub Is fine

#15
post #7
post #4

Earlier quoted context omitted.

An epub is just a plain html webpage compressed into a zip and its extension changed from .zip to ".epub". Assuming you have a web browser, you have something that will almost certainly render your epubs contents. PDF is not nearly as pleasant under the hood. It's down right lovecraftian.

The lovecraftian horror of pdf mostly comes into play through the sheer amount of software that supply almost correct pdf. It's not enough to be able to read pdf anymore, you also have to be able to deal with software that emits subtly wrong documents.

Adobe really have perfected act of making the most shoddy software that is still possible to sell

Re: Your ePub Is fine

#16

>but it can’t validate CSS against a renderer which is fundamentally broken! The epub standard doesn't say what version of CSS must be supported. There were no guarantees modern CSS would work so I wouldn't call the renderer broken.

The parser is broken. The CSS standard says that parsers MUST ignore properties they don't recognize.

Re: Your ePub Is fine

#17
Unfortunately, epub and epubcheck isn't the great uncontroversial resource the author makes it out to be. When W3C, Inc. took over maintenance of the EPub spec around when 3.1 was current, they just referenced WHATWG HTML and other ever-expanding browser specs ([1]). Being "living standards", these have no versioning or QA. As a consequence of being based on a version of HTML that redefined headers and sectioning, Epub 3.2 just made existing epubs non-conforming. Which is why Calibre and other tool still recommend 3.1 or better yet 2.

The case mentioned where the CSS min() function is rejected is another place where bulk import of the extremely complex CSS spec is just not helpful. Ebook readers aren't evergreen browsers after all.

[1]: https://news.ycombinator.com/item?id=41326179

Re: Your ePub Is fine

#20
Adobe has always been like this, too. They squandered an enormous marketshare with Flash because the alternative would've been spending a couple million on QA and they managed to unite all of the browser manufacturers in agreement that the web was better off without such an unreliable partner.

I shipped a couple of things on Flash back in the day but it was staggeringly bad software — random crashes, various heisenbugs where changes in one area would affect unrelated functionality in other modules, etc. — and while it cost something like $800, it was completely unsupported: I filed a number of trivially reproducible bugs with reduced test cases but never heard anything back until the next release came out and they sent automated suggestions that the bug might be fixed so I should buy a full-price license and find out.

Post reply on HN