{"thread":{"id":"5887","subject":"Gitweb indentation wrong in Internet Explorer","startedAt":"2006-10-11T17:25:53Z","lastAt":"2006-10-13T15:09:08Z","messageCount":16,"participants":["Ralf Baechle","Jakub Narebski","Luben Tuikov","Pazu","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"28612","messageId":"20061011172553.GA1147@linux-mips.org","threadId":"5887","inReplyTo":null,"subject":"Gitweb indentation wrong in Internet Explorer","fromName":"Ralf Baechle","fromEmail":"ralf@linux-mips.org","sentAt":"2006-10-11T17:25:53Z","receivedAt":"2006-10-11T17:25:53Z","isPatch":false,"sender":{"key":"ralf@linux-mips.org","avatar":null},"body":"I have a report from an MSIE suffering user:\n\n> When I use it (and I believe I've seen this on my laptop as well as my\n> workstation) all left-hand margin whitespace is collapsed to nothingness.\n> Once can still parse the code, but it's harder with no indentations.\n\nA screenshot from a Windows laptop to illustrate the problem is at\nhttp://www.linux-mips.org/~ralf/gitweb.png.  It shows the code was\npreformatted correctly which seems to be an IE bug but the following patch\nseems to work around it.\n\n*** gitweb.cgi.dist\t2006-10-09 19:02:19.561726255 +0100\n--- gitweb.cgi\t2006-10-09 19:03:31.744837495 +0100\n***************\n*** 234,239 ****\n--- 234,240 ----\n  \tmy $str = shift;\n  \t$str = decode(\"utf8\", $str, Encode::FB_DEFAULT);\n  \t$str = escapeHTML($str);\n+ \t$str =~ s/ /&nbsp;/g;\n  \treturn $str;\n  }\n\nThanks,\n\n  Ralf  \n"},{"id":"28614","messageId":"egjang$nmh$1@sea.gmane.org","threadId":"5887","inReplyTo":"20061011172553.GA1147@linux-mips.org","subject":"Re: Gitweb indentation wrong in Internet Explorer","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-11T17:47:24Z","receivedAt":"2006-10-11T17:47:24Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ralf Baechle wrote:\n\n> I have a report from an MSIE suffering user:\n> \n>> When I use it (and I believe I've seen this on my laptop as well as my\n>> workstation) all left-hand margin whitespace is collapsed to nothingness.\n>> Once can still parse the code, but it's harder with no indentations.\n> \n> A screenshot from a Windows laptop to illustrate the problem is at\n> http://www.linux-mips.org/~ralf/gitweb.png.  It shows the code was\n> preformatted correctly which seems to be an IE bug but the following patch\n> seems to work around it.\n\nWhich version of gitweb? We have removed s/ /&nbsp;/g; in esc_html\nsubroutine in favor of using \"white-space: pre;\" in CSS some time ago,\nand we have added escaping FORM FEED and ESCAPE characters.\n\nCould you send git patches, by the way? Or at least '-p' diffs?\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"28617","messageId":"20061011181348.85585.qmail@web31801.mail.mud.yahoo.com","threadId":"5887","inReplyTo":"20061011172553.GA1147@linux-mips.org","subject":"Re: Gitweb indentation wrong in Internet Explorer","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-10-11T18:13:48Z","receivedAt":"2006-10-11T18:13:48Z","isPatch":false,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Ralf Baechle <ralf@linux-mips.org> wrote:\n> I have a report from an MSIE suffering user:\n> \n> > When I use it (and I believe I've seen this on my laptop as well as my\n> > workstation) all left-hand margin whitespace is collapsed to nothingness.\n> > Once can still parse the code, but it's harder with no indentations.\n> \n> A screenshot from a Windows laptop to illustrate the problem is at\n> http://www.linux-mips.org/~ralf/gitweb.png.  It shows the code was\n> preformatted correctly which seems to be an IE bug but the following patch\n> seems to work around it.\n\nThank you.\n\nHas anyone let MSIE people know about this bug?  Or tried latest MSIE?\n\n   Luben\n\n> \n> *** gitweb.cgi.dist\t2006-10-09 19:02:19.561726255 +0100\n> --- gitweb.cgi\t2006-10-09 19:03:31.744837495 +0100\n> ***************\n> *** 234,239 ****\n> --- 234,240 ----\n>   \tmy $str = shift;\n>   \t$str = decode(\"utf8\", $str, Encode::FB_DEFAULT);\n>   \t$str = escapeHTML($str);\n> + \t$str =~ s/ /&nbsp;/g;\n>   \treturn $str;\n>   }\n> \n> Thanks,\n> \n>   Ralf  \n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"28619","messageId":"20061011181526.GA13892@linux-mips.org","threadId":"5887","inReplyTo":"egjang$nmh$1@sea.gmane.org","subject":"Re: Gitweb indentation wrong in Internet Explorer","fromName":"Ralf Baechle","fromEmail":"ralf@linux-mips.org","sentAt":"2006-10-11T18:15:26Z","receivedAt":"2006-10-11T18:15:26Z","isPatch":false,"sender":{"key":"ralf@linux-mips.org","avatar":null},"body":"On Wed, Oct 11, 2006 at 07:47:24PM +0200, Jakub Narebski wrote:\n\n> >> When I use it (and I believe I've seen this on my laptop as well as my\n> >> workstation) all left-hand margin whitespace is collapsed to nothingness.\n> >> Once can still parse the code, but it's harder with no indentations.\n> > \n> > A screenshot from a Windows laptop to illustrate the problem is at\n> > http://www.linux-mips.org/~ralf/gitweb.png.  It shows the code was\n> > preformatted correctly which seems to be an IE bug but the following patch\n> > seems to work around it.\n> \n> Which version of gitweb? We have removed s/ /&nbsp;/g; in esc_html\n> subroutine in favor of using \"white-space: pre;\" in CSS some time ago,\n> and we have added escaping FORM FEED and ESCAPE characters.\n\nAnything since since at least June 19 seems affected, including yesterday's\nversion.\n\n> Could you send git patches, by the way? Or at least '-p' diffs?\n\nNope.  I'm just forwarding this.\n\n  Ralf\n"},{"id":"28632","messageId":"egjllu$6k8$1@sea.gmane.org","threadId":"5887","inReplyTo":"egjang$nmh$1@sea.gmane.org","subject":"Re: Gitweb indentation wrong in Internet Explorer","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-10-11T20:53:51Z","receivedAt":"2006-10-11T20:53:51Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Jakub Narebski wrote:\n\n> Which version of gitweb? We have removed s/ /&nbsp;/g; in esc_html\n> subroutine in favor of using \"white-space: pre;\" in CSS some time ago,\n> and we have added escaping FORM FEED and ESCAPE characters.\n\nThe problem here is that \"white-space: pre\" is only supported by IE6 in \nstandards compliance mode[1], but the DTD declaration for this page:\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\nsurprisingly triggers IE6 quirks mode[2]. A quick fix to this problem \nwould be changing the doctype declaration to use XHTML 1.0 Transitional \ninstead of Strict, as that would trigger IE6 standards-compliance mode.\n\n[1] \nhttp://msdn.microsoft.com/workshop/author/dhtml/reference/properties/whitespace.asp\n\n[2] http://hsivonen.iki.fi/doctype/\n\n-- Marcus\n"},{"id":"28633","messageId":"egjmri$atp$1@sea.gmane.org","threadId":"5887","inReplyTo":"egjllu$6k8$1@sea.gmane.org","subject":"[PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-10-11T21:13:59Z","receivedAt":"2006-10-11T21:13:59Z","isPatch":true,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"The XML declaration forces IE6 into quirks mode, breaking our\nnice standards compliant stylesheet.\nSigned-off-by: Marcus Brito <pazu@pazu.com.br>\n---\n  gitweb/gitweb.perl |    1 -\n  1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 0ec1eef..ecb3b66 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1357,7 +1357,6 @@ sub git_header_html {\n     print $cgi->header(-type=>$content_type, -charset => 'utf-8',\n                        -status=> $status, -expires => $expires);\n     print <<EOF;\n-<?xml version=\"1.0\" encoding=\"utf-8\"?>\n  <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n  <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\n  <!-- git web interface version $version, (C) 2005-2006, Kay Sievers \n<kay.sievers\\@vrfy.org>, Christian Gierke -->\n-- \n1.4.2.3\n"},{"id":"28635","messageId":"egjnk5$bpn$2@sea.gmane.org","threadId":"5887","inReplyTo":"egjmri$atp$1@sea.gmane.org","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-11T21:27:35Z","receivedAt":"2006-10-11T21:27:35Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Pazu wrote:\n\n> The XML declaration forces IE6 into quirks mode, breaking our\n> nice standards compliant stylesheet.\n\nBut isn't it _required_ by XML/XHTML?\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"28648","messageId":"egk24r$hgb$1@sea.gmane.org","threadId":"5887","inReplyTo":"egjnk5$bpn$2@sea.gmane.org","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-10-12T00:26:36Z","receivedAt":"2006-10-12T00:26:36Z","isPatch":true,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Jakub Narebski wrote:\n\n>> The XML declaration forces IE6 into quirks mode, breaking our\n>> nice standards compliant stylesheet.\n> \n> But isn't it _required_ by XML/XHTML?\n\nAs far as I know, it isn't. But even if the specs required it, none of \nthe popular browsers do, and since we're talking about a web page \nintended for presentation (as opposed to automated data processing), \nthat's what matters.\n\n-- Marcus\n"},{"id":"28649","messageId":"egk4im$njm$1@sea.gmane.org","threadId":"5887","inReplyTo":"egjnk5$bpn$2@sea.gmane.org","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-10-12T01:08:10Z","receivedAt":"2006-10-12T01:08:10Z","isPatch":true,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Jakub Narebski wrote:\n\n> But isn't it _required_ by XML/XHTML?\n\nAccording to the XML 1.0 specification, section 2.8:\n\n[Definition: XML documents should begin with a XML declaration which \nspecifies the version of XML being used]\n\nI believe that the use of 'should' instead of 'must' here makes it \nhighly recommended, but not strictly required. Anyway, the comments in \nmy previous message (the 'browser support is what really matters' part) \nremain valid.\n\n-- Marcus\n"},{"id":"28657","messageId":"200610120745.00909.robin.rosenberg.lists@dewire.com","threadId":"5887","inReplyTo":"egjnk5$bpn$2@sea.gmane.org","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2006-10-12T05:45:00Z","receivedAt":"2006-10-12T05:45:00Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"onsdag 11 oktober 2006 23:27 skrev Jakub Narebski:\n> Pazu wrote:\n> > The XML declaration forces IE6 into quirks mode, breaking our\n> > nice standards compliant stylesheet.\n>\n> But isn't it _required_ by XML/XHTML?\n\nFor pure XML document it is required, but not for XHTML, unless the encoding \nis something other than UTF-8 or (shudder) UTF-16. W3C recommends it though.\n\n-- robin\n"},{"id":"28685","messageId":"200610122321.18630.jnareb@gmail.com","threadId":"5887","inReplyTo":"200610120745.00909.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-12T21:21:17Z","receivedAt":"2006-10-12T21:21:17Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Robin Rosenberg wrote:\n> onsdag 11 oktober 2006 23:27 skrev Jakub Narebski:\n> > Pazu wrote:\n> > > The XML declaration forces IE6 into quirks mode, breaking our\n> > > nice standards compliant stylesheet.\n> >\n> > But isn't it _required_ by XML/XHTML?\n> \n> For pure XML document it is required, but not for XHTML, unless the encoding \n> is something other than UTF-8 or (shudder) UTF-16. W3C recommends it though.\n\nSo what should be our decision? Honor IE quirks ;-) and either remove\nXML declaration, or use Transitional DTD? Add back SPC to &nbsp; conversion\nin esc_html? Ignore broken browsers?\n-- \nJakub Narebski\nPoland\n"},{"id":"28724","messageId":"ego2nk$3nm$1@sea.gmane.org","threadId":"5887","inReplyTo":"200610122321.18630.jnareb@gmail.com","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-10-13T13:01:12Z","receivedAt":"2006-10-13T13:01:12Z","isPatch":true,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Jakub Narebski wrote:\n\n> So what should be our decision? Honor IE quirks ;-) and either remove\n> XML declaration, or use Transitional DTD? Add back SPC to &nbsp; conversion\n> in esc_html? Ignore broken browsers?\n\nMy bad here. In my first email I said that using the Transitional DTD \nwould fix the problem, but I was wrong. It doesn't matter the DTD you \nuse, if you add a <?xml?> declaration, IE will get it wrong and activate \nquirks mode.\n\n-- Marcus\n"},{"id":"28726","messageId":"ego331$568$2@sea.gmane.org","threadId":"5887","inReplyTo":"ego2nk$3nm$1@sea.gmane.org","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-13T13:07:54Z","receivedAt":"2006-10-13T13:07:54Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Pazu wrote:\n\n> Jakub Narebski wrote:\n> \n>> So what should be our decision? Honor IE quirks ;-) and either remove\n>> XML declaration, or use Transitional DTD? Add back SPC to &nbsp; conversion\n>> in esc_html? Ignore broken browsers?\n> \n> My bad here. In my first email I said that using the Transitional DTD \n> would fix the problem, but I was wrong. It doesn't matter the DTD you \n> use, if you add a <?xml?> declaration, IE will get it wrong and activate \n> quirks mode.\n\nWell, there is yet another solution. Do browser detection, and do not output\n<?xml ... ?> declaration for IE. Perhaps that would be best solution.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"28734","messageId":"200610131605.56913.robin.rosenberg.lists@dewire.com","threadId":"5887","inReplyTo":"200610122321.18630.jnareb@gmail.com","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2006-10-13T14:05:56Z","receivedAt":"2006-10-13T14:05:56Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"torsdag 12 oktober 2006 23:21 skrev Jakub Narebski:\n> Robin Rosenberg wrote:\n> > onsdag 11 oktober 2006 23:27 skrev Jakub Narebski:\n> > > Pazu wrote:\n> > > > The XML declaration forces IE6 into quirks mode, breaking our\n> > > > nice standards compliant stylesheet.\n> > >\n> > > But isn't it _required_ by XML/XHTML?\n> >\n> > For pure XML document it is required, but not for XHTML, unless the\n> > encoding is something other than UTF-8 or (shudder) UTF-16. W3C\n> > recommends it though.\n>\n> So what should be our decision? Honor IE quirks ;-) and either remove\n> XML declaration, or use Transitional DTD? Add back SPC to &nbsp; conversion\n> in esc_html? Ignore broken browsers?\n\nIt isn't required by the standard. Why not just drop it?\n\n-- robin\n"},{"id":"28732","messageId":"ego6nn$l78$1@sea.gmane.org","threadId":"5887","inReplyTo":"ego331$568$2@sea.gmane.org","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-10-13T14:09:31Z","receivedAt":"2006-10-13T14:09:31Z","isPatch":true,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Jakub Narebski wrote:\n\n> Well, there is yet another solution. Do browser detection, and do not output\n> <?xml ... ?> declaration for IE. Perhaps that would be best solution.\n\nWell, there's now drawback in removing the XML declaration (no browser \nrequires it), so why even worry about browser detection?\n\n-- Marcus\n"},{"id":"28735","messageId":"200610131709.08515.jnareb@gmail.com","threadId":"5887","inReplyTo":"200610131605.56913.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Removes the <?xml?> declaration from gitweb.pl","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-13T15:09:08Z","receivedAt":"2006-10-13T15:09:08Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Robin Rosenberg wrote:\n> torsdag 12 oktober 2006 23:21 skrev Jakub Narebski:\n>> Robin Rosenberg wrote:\n>>> onsdag 11 oktober 2006 23:27 skrev Jakub Narebski:\n>>>> Pazu wrote:\n>>>>> The XML declaration forces IE6 into quirks mode, breaking our\n>>>>> nice standards compliant stylesheet.\n>>>>\n>>>> But isn't it _required_ by XML/XHTML?\n>>>\n>>> For pure XML document it is required, but not for XHTML, unless the\n>>> encoding is something other than UTF-8 or (shudder) UTF-16. W3C\n>>> recommends it though.\n>>\n>> So what should be our decision? Honor IE quirks ;-) and either remove\n>> XML declaration, or use Transitional DTD? Add back SPC to &nbsp; conversion\n>> in esc_html? Ignore broken browsers?\n> \n> It isn't required by the standard. Why not just drop it?\n\n>From http://www.w3.org/TR/xhtml1/#docconf\n\n An XML declaration is not required in all XML documents; however XHTML\n document authors are strongly encouraged to use XML declarations in all\n their documents. Such a declaration is required when the character\n encoding of the document is other than the default UTF-8 or UTF-16 and\n no encoding was determined by a higher-level protocol.\n\nSo even if it is not required, it is recommended. But yes, removing\n<?xml?> for bug-compatibility conformance is better idea than mucking\nwith browser detection... if we sould need browser detection to avoid\nother bugs (like non-W3C CSS box model in IE), then perhaps we could\nreintroduce <?xml?> in standards-conforming browsers.\n-- \nJakub Narebski\nPoland\n"}]}