← Back to team overview

calibre-devs team mailing list archive

Re: CSS normalization

 

On Tuesday 27 January 2009 05:37:03 Marshall T. Vandegrift wrote:
> On Tue, Jan 27, 2009 at 2:22 AM, Kovid Goyal <kovid@xxxxxxxxxxxxxx> wrote:
> > Yeah I agree. The only remaining drawback I can think of is that it
> > will mess up class based javascript selectors. I know EPUB isn't
> > supposed to support javascript, but I believe that will
> > change. However, if I understand the algorithm correctly, that will
> > only happen for tags that have style attributes, so it shouldn't be
> > too big a deal.
>
> Well actually, it gets applied to all elements.  I should have pointed
> this out earlier, but what I'm describing is what's implemented in
> calibre.ebooks.oeb.transforms.flatcss.CSSFlattener, so you can check out
> what I'm talking about.  Global CSS-simplification and font-size
> normalization in one smooth step.
>

Cool, I'm looking forward to starting work on the modularization. Hopefully in 
a few more weeks, once oeb2mobi is stabilized and I've submitted my thesis. 

> As for keeping the source @class values in the DOM, that wouldn't be too
> much of a change to the algorithm.  Instead of re-using existing element
> @class names and generating variants as necessary, it would instead use
> all generated names, give every elements their original @class values
> and a generated one, and write all CSS rules in terms of the generated
> names.
>

The modification is a good idea in any case on the principle of changing the 
input as little as possible. We're just going to have to agree to disagree on 
the utility of Javascript in books :)

Kovid.

-- 
_____________________________________

Kovid Goyal  MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125

cell  : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid@xxxxxxxxxxxxxxxxxx
web   : http://www.kovidgoyal.net
_____________________________________




References