{"thread":{"id":"20704","subject":"[PATCH] gitweb: pull ref markes pull out of subject <a> tag","startedAt":"2009-08-23T08:28:09Z","lastAt":"2009-08-23T22:31:22Z","messageCount":4,"participants":["Giuseppe Bilotta","Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"121555","messageId":"1251016089-10548-1-git-send-email-giuseppe.bilotta@gmail.com","threadId":"20704","inReplyTo":null,"subject":"[PATCH] gitweb: pull ref markes pull out of subject <a> tag","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2009-08-23T08:28:09Z","receivedAt":"2009-08-23T08:28:09Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"Since 4afbaefffa9095fe1391b4b61289a7dc954e9f7b ref markers that\naccompain the subject in views such as shortlog and history point to\nsomething different from the subject itself. Therefore, they should not\nbe included in the same <a> tag.\n\nBenefits of the change are:\n* better compliance to the XHTML standards, that forbid links within\n  links even though the restriction cannot be imposed via DTD; this also\n  benefits visualization in some older browsers;\n* when hovering the subject, only the subject itself is underlined; when\n  hovering the ref markers, only the text in the hovered ref marker is\n  underlined; previously, hovering any written part of the subject\n  column led to complete underlying of everything at the same time,\n  with unpleasing effects.\n---\n gitweb/gitweb.perl |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\nThe next step would be to find a way to layout decently the case when\nsome shortlog entries have a _humongous_ amount of ref markers. See\nfor example http://git.oblomov.eu/acecad/shortlog\n\nI honestly doubt these cases happen in normal git repositories, but it\nmight still be worth taking them into consideration. Possibilities\ninclude hard-limiting the title column maximum width (in browsers for\nwhich the corresponding attributes and rules work), manual insertion of\nhard line breaks <br/> every n-th ref marker, or something more dynamic\nsuch as hiding most of the ref markers when they are more than, say, 5,\nand showing them on hover.\n\nSuggestions? Comments?\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex ce6e8f6..bb9648b 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1524,10 +1524,10 @@ sub format_subject_html {\n \t\t$long =~ s/[[:cntrl:]]/?/g;\n \t\treturn $cgi->a({-href => $href, -class => \"list subject\",\n \t\t                -title => to_utf8($long)},\n-\t\t       esc_html($short) . $extra);\n+\t\t       esc_html($short)) . $extra;\n \t} else {\n \t\treturn $cgi->a({-href => $href, -class => \"list subject\"},\n-\t\t       esc_html($long)  . $extra);\n+\t\t       esc_html($long)) . $extra;\n \t}\n }\n \n-- \n1.6.3.rc1.192.gdbfcb\n"},{"id":"121574","messageId":"200908232213.48786.jnareb@gmail.com","threadId":"20704","inReplyTo":"1251016089-10548-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"Re: [PATCH] gitweb: pull ref markes pull out of subject <a> tag","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-08-23T20:13:47Z","receivedAt":"2009-08-23T20:13:47Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sun, 23 Aug 2009, Giuseppe Bilotta wrote:\n\n> Since 4afbaefffa9095fe1391b4b61289a7dc954e9f7b ref markers that\n> accompain the subject in views such as shortlog and history point to\n> something different from the subject itself. Therefore, they should not\n> be included in the same <a> tag.\n> \n> Benefits of the change are:\n> * better compliance to the XHTML standards, that forbid links within\n>   links even though the restriction cannot be imposed via DTD; this also\n>   benefits visualization in some older browsers;\n\nYes, some older browsers (like Mozilla 1.7.12, Gecko/20050923) did \n_enforce_ that requirement when served document with XHTML DOCTYPE,\nand application/xml+xhtml Content-Type, by moving inner link (A element)\njust outside (just after) outer, containing <a> element.\n\nFor format_subject_html which you are fixing, and which is used by \n'shortlog', 'history' and 'tags' views this didn't cause much changes\nin layout.  But the way gitweb uses git_print_header_div in views such\nas 'tree', 'blob' etc., where the outer (containing) link is made into\n*block* element[1] by the way of CSS (display: block) makes layout \n(visualisation) very screwed up in older browser.  But I don't expect\nyou to fix that.\n\n[1] Originally so the area to click is larger.\n\n> * when hovering the subject, only the subject itself is underlined; when\n>   hovering the ref markers, only the text in the hovered ref marker is\n>   underlined; previously, hovering any written part of the subject\n>   column led to complete underlying of everything at the same time,\n>   with unpleasing effects.\n\nSignoff?\n\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n\n> ---\n>  gitweb/gitweb.perl |    4 ++--\n>  1 files changed, 2 insertions(+), 2 deletions(-)\n> \n> The next step would be to find a way to layout decently the case when\n> some shortlog entries have a _humongous_ amount of ref markers. See\n> for example http://git.oblomov.eu/acecad/shortlog\n> \n> I honestly doubt these cases happen in normal git repositories, but it\n> might still be worth taking them into consideration. Possibilities\n> include hard-limiting the title column maximum width (in browsers for\n> which the corresponding attributes and rules work), manual insertion of\n> hard line breaks <br/> every n-th ref marker, or something more dynamic\n> such as hiding most of the ref markers when they are more than, say, 5,\n> and showing them on hover.\n> \n> Suggestions? Comments?\n\nPerhaps limiting to heads and tags if there are too many refs?\n\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index ce6e8f6..bb9648b 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -1524,10 +1524,10 @@ sub format_subject_html {\n>  \t\t$long =~ s/[[:cntrl:]]/?/g;\n>  \t\treturn $cgi->a({-href => $href, -class => \"list subject\",\n>  \t\t                -title => to_utf8($long)},\n> -\t\t       esc_html($short) . $extra);\n> +\t\t       esc_html($short)) . $extra;\n>  \t} else {\n>  \t\treturn $cgi->a({-href => $href, -class => \"list subject\"},\n> -\t\t       esc_html($long)  . $extra);\n> +\t\t       esc_html($long)) . $extra;\n>  \t}\n>  }\n>  \n> -- \n> 1.6.3.rc1.192.gdbfcb\n> \n> \n\n-- \nJakub Narebski\nPoland\n"},{"id":"121582","messageId":"cb7bb73a0908231343k3546682ge05cc4f3c3d83638@mail.gmail.com","threadId":"20704","inReplyTo":"200908232213.48786.jnareb@gmail.com","subject":"Re: [PATCH] gitweb: pull ref markes pull out of subject <a> tag","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2009-08-23T20:43:30Z","receivedAt":"2009-08-23T20:43:30Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"2009/8/23 Jakub Narebski <jnareb@gmail.com>:\n> For format_subject_html which you are fixing, and which is used by\n> 'shortlog', 'history' and 'tags' views this didn't cause much changes\n> in layout.  But the way gitweb uses git_print_header_div in views such\n> as 'tree', 'blob' etc., where the outer (containing) link is made into\n> *block* element[1] by the way of CSS (display: block) makes layout\n> (visualisation) very screwed up in older browser.  But I don't expect\n> you to fix that.\n>\n> [1] Originally so the area to click is larger.\n\nFixing that really needs some kind of ridiculously complex\nworkarounds, or a totally different layout. That is actually one of\nthe situations where nested links make perfect sense, and it's a real\npity the standard wouldn't allow them, and that some client actually\naltered the DOM to 'fix' it. But anyway.\n\n> Signoff?\n\nAaaargh. Is it enough if I put it here:\n\nSigned-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n\nor should I resend?\n\n(One would expect I actually learned to add it, finally, but noooo ...\ngah, stupid me.)\n\n>> The next step would be to find a way to layout decently the case when\n>> some shortlog entries have a _humongous_ amount of ref markers. See\n>> for example http://git.oblomov.eu/acecad/shortlog\n>>\n>> I honestly doubt these cases happen in normal git repositories, but it\n>> might still be worth taking them into consideration. Possibilities\n>> include hard-limiting the title column maximum width (in browsers for\n>> which the corresponding attributes and rules work), manual insertion of\n>> hard line breaks <br/> every n-th ref marker, or something more dynamic\n>> such as hiding most of the ref markers when they are more than, say, 5,\n>> and showing them on hover.\n>>\n>> Suggestions? Comments?\n>\n> Perhaps limiting to heads and tags if there are too many refs?\n\nThat wouldn't help at all in the case I linked:\nhttp://git.oblomov.eu/acecad/shortlog due to the number of tags that\nwere imported from CVS.\n\n-- \nGiuseppe \"Oblomov\" Bilotta\n"},{"id":"121597","messageId":"7vzl9qqi11.fsf@alter.siamese.dyndns.org","threadId":"20704","inReplyTo":"cb7bb73a0908231343k3546682ge05cc4f3c3d83638@mail.gmail.com","subject":"Re: [PATCH] gitweb: pull ref markes pull out of subject <a> tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-23T22:31:22Z","receivedAt":"2009-08-23T22:31:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:\n\n> 2009/8/23 Jakub Narebski <jnareb@gmail.com>:\n>> For format_subject_html which you are fixing, and which is used by\n>> 'shortlog', 'history' and 'tags' views this didn't cause much changes\n>> in layout.  But the way gitweb uses git_print_header_div in views such\n>> as 'tree', 'blob' etc., where the outer (containing) link is made into\n>> *block* element[1] by the way of CSS (display: block) makes layout\n>> (visualisation) very screwed up in older browser.  But I don't expect\n>> you to fix that.\n>>\n>> [1] Originally so the area to click is larger.\n>\n> Fixing that really needs some kind of ridiculously complex\n> workarounds, or a totally different layout. That is actually one of\n> the situations where nested links make perfect sense, and it's a real\n> pity the standard wouldn't allow them, and that some client actually\n> altered the DOM to 'fix' it. But anyway.\n>\n>> Signoff?\n>\n> Aaaargh. Is it enough if I put it here:\n>\n> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n\nI can manage.\n\nThanks, both.\n"}]}