Gnus development mailing list
 help / color / mirror / Atom feed
* Cascading styles
@ 2010-11-25  1:20 Lars Magne Ingebrigtsen
  2010-11-25  9:41 ` Julien Danjou
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-11-25  1:20 UTC (permalink / raw)
  To: ding

We should probably implement (at least) text-decoration, text-transform
and font-style, and do the cascading thing.  But a thing just occurred
to me.

<p style="color: black;"><p style="color: white;">Foo</p></p>

will first make Foo white, and then black.  So, er, either the overlays
should be applied in reverse-stack-order, or `shr-insert-*-overlay'
should avoid clobbering overlays that are already there, and that use
the same properties (i.e., :foreground, etc).

The latter seems easier.

But what I wanted to talk was the CSS inheritance thing and non-inline
style sheets.

So here's my thought:

shr should parse the style sheet first, and bind the thing at the
top-most level, like:

(defun shr-insert-document (dom)
  (let ((shr-stylesheet (shr-parse-stylesheets dom)))
    ...))

or something.

And then we'd have

(defun shr-descend (dom)
  (let ((shr-stylesheet (append (shr-parse-style (cdr (assq :style (cdr dom))))))) ...
  
So you'd inherit down into the DOM and pop when you exit.  However,
would that be correct?  Er, no, not really.  So you'd basically have the
inline thing, plus the stylesheet, but not endlessly combining inline
things.

And I'm not sure this is worth doing...  I mean, implementing it is
probably easy, but computation-wise for the user...
  
-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-12-06 15:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-25  1:20 Cascading styles Lars Magne Ingebrigtsen
2010-11-25  9:41 ` Julien Danjou
2010-11-26  1:16   ` Lars Magne Ingebrigtsen
2010-11-26  9:17     ` Julien Danjou
2010-12-05 13:14       ` Lars Magne Ingebrigtsen
2010-12-05 14:32         ` Lars Magne Ingebrigtsen
2010-12-06 11:21         ` Julien Danjou
2010-12-06 11:24           ` Lars Magne Ingebrigtsen
2010-12-06 15:12             ` Julien Danjou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).