From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: ding@gnus.org
Subject: Re: Cascading styles
Date: Sun, 05 Dec 2010 14:14:42 +0100 [thread overview]
Message-ID: <m3pqtg1hvh.fsf@quimbies.gnus.org> (raw)
In-Reply-To: <sa339qomoka.fsf@cigue.easter-eggs.fr>
Julien Danjou <julien@danjou.info> writes:
> I don't see why inheriting would not work with what you did propose. if
> its shr-descend call adds style information to the dynamic variable
> shr-stylesheet (and merge them of course), we're just having correct
> inheritance.
Yes, but that's special-casing the colour things. :-) If you have
<p style="border: 3px;">foo<p>bar
then only the top-level p should have a border, and the next one
shouldn't. But it's kinda moot, since I don't think any of the
properties we're interested in have this kinda of behaviour.
> With:
> <p style="background: blue; color: red;">foo<p style="color: green;">bar</p></p>
>
> You start with the first style, render foo with background and
> foreground. Then you got for bar via shr-descend, which changes color to
> green, but merge with the previous dynamically bound shr-stylesheet, so
> it still has background set to 'blue'. You render bar, exit 2
> shr-descend calls, and continue to render what else is in the document.
Yes... except that we're setting the colour after rendering all the
children today. So I think we'll have to have the inheritance as well
as the non-overwriting colour property stuff to get it right.
I'm not sure how selectors like
p.foo > div > p { colour: red; }
selectors fit in here. I suspect it doesn't. :-)
I'll take a whack at implementing the inheritance thing, and we'll see
how that goes...
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
next prev parent reply other threads:[~2010-12-05 13:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-25 1:20 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 [this message]
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=m3pqtg1hvh.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).