From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/74358 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Cascading styles Date: Thu, 25 Nov 2010 02:20:10 +0100 Organization: Programmerer Ingebrigtsen Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1290648070 25035 80.91.229.12 (25 Nov 2010 01:21:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Nov 2010 01:21:10 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M22723@lists.math.uh.edu Thu Nov 25 02:21:06 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PLQWG-00030L-Si for ding-account@gmane.org; Thu, 25 Nov 2010 02:21:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PLQVp-0005Dc-Te; Wed, 24 Nov 2010 19:20:37 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PLQVo-0005DO-5h for ding@lists.math.uh.edu; Wed, 24 Nov 2010 19:20:36 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PLQVj-0002gj-7i for ding@lists.math.uh.edu; Wed, 24 Nov 2010 19:20:35 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PLQVi-0006sR-00 for ; Thu, 25 Nov 2010 02:20:30 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PLQVh-0002iv-Tp for ding@gnus.org; Thu, 25 Nov 2010 02:20:29 +0100 Original-Received: from cm-84.215.34.171.getinternet.no ([84.215.34.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Nov 2010 02:20:29 +0100 Original-Received: from larsi by cm-84.215.34.171.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Nov 2010 02:20:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 43 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.34.171.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEXbx8Lm1sbQubdnDRXn 18eWcXDk1Mbi0sTfzsT28esslE61AAACLUlEQVQ4jWWSz2vbMBTHhSnFV4EJ280oE8S3UaP7BF6h tyKjQ48J2bOP6+is7OaFzdFuJazQ/rd7T7ITh31Bcvz96P1SzNKDA4B366yqOOdVVekFOOc8i6BB hyMbtWgIAOj1I72egM6aHUud63j2iG5INEUQAFhzitAnwJsxAhZPeF5nU76MIrxz4HbYUIZoilgA ggM21641IgJjx9QV1mh2azS41jqLhXio0XXdDg006bDWI/BhvlCXV3qckoofqCkcfCzMA7mFkAoW 7nwbEROgu/p56WsI7cIc6Hi/TYjo4Gl2g6e7wtG74TT0KByQRocB4P3bXK89CyGHVmxlIUf3KM0r C2DXbdSPZSFG8FzfIMhT77+6b/buMhUChqCfjGtcfymIAPN9IT9EoIwUX74/EBBYJXkWecxgrK2t nEBS/B7BiyV9Lt4+JQiEOSpryF+t0uMmXyXFloC0Dy+qvKH+85XY742RxR0CWZbKKkwg7Ez3CVuW qBqXpR9Ymx7lPWPS1EYYVosL4RAynLB0OJyOIRixnECUqu0IYk41bXUsGICqy5lUAB8J1HZuxxqK alg7jzj1K2tVq/NkBGhAj4BGPwNFvjWeJUjMeTIk4Zmy5HJk/BeCD/+BlIw8rQgk0/Wg8ivckgjy jaAXFvUn7NdbitgLlrJJv8J+FVOxFDx9k7j6gfWEK7anRoaq7fHDo0UnENyyffhKt60f/NCij6v3 fojAe/AtRBFEAP8ALXE7QtpY/bEAAAAASUVORK5CYII= Mail-Copies-To: never X-Now-Playing: Dntel's _Life is Full of Possibilities_: "Suddenly is Sooner than You Think" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:d3vJXEENN0KWH0SFev2d4Tc6r6g= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:74358 Archived-At: 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.

Foo

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