calibre-devs team mailing list archive
-
calibre-devs team
-
Mailing list archive
-
Message #00085
Re: CSS normalization
-
To:
calibre-devs@xxxxxxxxxxxxxxxxxxx
-
From:
Kovid Goyal <kovid@xxxxxxxxxxxxxx>
-
Date:
Mon, 26 Jan 2009 01:29:19 -0800
-
In-reply-to:
<f337701d0901252008y5af399caicec34a0d8a5dc473@mail.gmail.com>
-
User-agent:
KMail/1.11.0 (Linux/2.6.26-gentoo-r3; KDE/4.1.96; i686; ; )
Ah, I get it now. What's the performance like, since this algorithm will
require a lot of XPath queries?
If the performance is acceptable, we can change the CSS handling in any2epub
when we do the modularization of the conversion pipeline.
Kovid.
On Sunday 25 January 2009 20:08:04 you wrote:
> On Sun, Jan 25, 2009 at 10:51 PM, Kovid Goyal <kovid@xxxxxxxxxxxxxx> wrote:
> > In that case how do you handle the case of file.html linking to
> > file1.css while file2.html links to file1.css and file2.css? Wont the
> > rules in file2.css override the rules in file1.css and therefore mess
> > up the formatting of file1.html?
>
> I'm using Stylizer to compute exactly the CSS which applies to each
> element, following all precedence rules etc. For each element, I
> extract just the CSS which is directly applied by a rule (not properties
> applied via inheritance). If there's an already-generated rule with
> exactly the same properties, the element is assigned the @class
> associated with that rule. If not, I generate a new class derived from
> the current @class of the element (if it has one, and exactly the
> element's @class if it as yet has no associated rule). End result is
> that every element has exactly one @class which fully provides all CSS
> properties for that element specified in the original source.
>
> -Marshall
>
> !DSPAM:3,497d372675721730218143!
--
_____________________________________
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
_____________________________________
Follow ups
References