Gnus development mailing list
 help / color / mirror / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: ding@gnus.org
Subject: Cascading styles
Date: Thu, 25 Nov 2010 02:20:10 +0100	[thread overview]
Message-ID: <m3tyj619o5.fsf@quimbies.gnus.org> (raw)

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




             reply	other threads:[~2010-11-25  1:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25  1:20 Lars Magne Ingebrigtsen [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tyj619o5.fsf@quimbies.gnus.org \
    --to=larsi@gnus.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).