From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/73637 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: [gnus git] branch master updated: =1= shr.el (shr-tag-div): Added. Date: Wed, 27 Oct 2010 13:06:27 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87pquvldcs.fsf@lifelogs.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1288202839 11507 80.91.229.12 (27 Oct 2010 18:07:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Oct 2010 18:07:19 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M22006@lists.math.uh.edu Wed Oct 27 20:07:17 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 1PBAP1-0006HV-Nc for ding-account@gmane.org; Wed, 27 Oct 2010 20:07:12 +0200 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 1PBAOb-0004G0-S9; Wed, 27 Oct 2010 13:06:45 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PBAOZ-0004Fi-JE for ding@lists.math.uh.edu; Wed, 27 Oct 2010 13:06:43 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PBAOV-0005cD-7N for ding@lists.math.uh.edu; Wed, 27 Oct 2010 13:06:43 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PBAOU-0005nY-00 for ; Wed, 27 Oct 2010 20:06:38 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PBAOR-0005ya-Tf for ding@gnus.org; Wed, 27 Oct 2010 20:06:35 +0200 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Oct 2010 20:06:35 +0200 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Oct 2010 20:06:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 59 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:czL35D+n+0majbP4nZxw0N5q60w= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:73637 Archived-At: On Wed, 27 Oct 2010 01:58:28 +0200 Lars Magne Ingebrigtsen wrote: LMI> Very often the div is just used as a container, and the css spells LMI> out that there should be no "rendering" effect of the div. (Many LMI> people haven't heard of span. :-)) There are very good reasons to use DIV instead of SPAN elements for layout. I won't bore you with the details, but it's surprisingly annoying to use SPANs in older browsers and in certain situations. On Wed, 27 Oct 2010 02:28:32 +0200 Lars Magne Ingebrigtsen wrote: LMI> Of course, we could start parsing the CSS, but then we'd have to have LMI> something else that shr could stand for, because it wouldn't be "Simple LMI> HTML Renderer" any more. :-) Parsing CSS is not hard. HTML layout according to the CSS styles is very hard and I don't think it should be attempted (I said a while back that it would require many man-years to get it right). But a few CSS properties could be interpreted: some properties I list below for appearance and "display" and "visibility" for layout. The renderer doesn't have to be perfect but it could be usable. Here's the appearance properties list that IMO would make sense in Emacs: border background-color color text-decoration text-transform line-height font-family font-style font-size font-weight list-style list-style-type list-style-image list-style-position For DIV vs SPAN, if "display" is "block" then the element should be rendered by itself. And DIV elements have display:block by default in all user agents. Also at a minimum "visibility:none" should be honored. If you want to support CSS, you have to parse referenced CSS stylesheets. I think that's not a big burden for shr.el and would make it much better. But otherwise let's not try to support DIVs specifically; stick to HTML 3.2 (http://www.w3.org/TR/REC-html32.html) and don't do anything extra for unknown tags. LMI> I took a stab at it for "color" in span, but I'm not particularly LMI> satisfied with the result. That is, somebody has , LMI> which renders the text totally unreadable for me, because I use a black LMI> background. So I was thinking about either backing that out again LMI> or... er... well, I don't have an "or". :-) I think you need to interpret background-color? Ted