git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG/RFH] gitweb: Trouble with ref markers being hyperlinks because of illegally nested links

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Jan 12, 2009, 02:59 UTC
Message-ID
<cb7bb73a0901111859q3a166d92k5176b27af2c4d256@mail.gmail.com>
In-Reply-To
<200901120215.13668.jnareb@gmail.com>
On Sun, Jan 11, 2009 at 8:15 PM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 34 quoted lines
> Commit 4afbaef by Giuseppe Bilotta (gitweb: ref markers link to named
> shortlogs) turned ref markers for tags and heads into links to
> appropriate views for the ref name.
>
> Unfortunately the code didn't take into account the fact that nesting
> links (A elements) is illegal in (X)HTML:
>
>  12.2.2 Nested links are illegal
>
>  Links and anchors defined by the A element must not be nested;
>  an A element must not contain any other A elements.
>
> (from http://www.w3.org/TR/html401/struct/links.html#h-12.2.2), and that
> some browsers (e.g. Mozilla 1.17.2 I still use) in the very strict
> conformance mode (application/xhtml+xml mimetype and XML + XHTML DTD)
> _enforce_ this requirement by moving inner link immediately outside the
> end of outer link, i.e. for the HTML source looking like the following
>  <a ...> some text <a ...>v1.5.1</a></a>
> rendered HTML (which you can see using "View Selection Source") is
> instead
>  <a ...> some text </a><a ...>v1.5.1</a>
> And of course SPAN elements which wraps inner link (inner A element) is
> _not_ moved.
>
>
> This is quite easy to fix for hyperlinked ref markers in 'shortlog' and
> 'history' views: just close the "title" hyperlink before printing
> $extra, i.e. ref markers. I have even made a patch doing that. Then
> instead of incorrect
>  _Merge branch into maint_ [] _maint_
> where _aaa_ means that 'aaa' is hyperlink, and [xxx] is a fer marker,
> we will have correct:
>  _Merge branch into maint_ [_maint_]
> See that we have two separate and not nested links...

I've seen from the list that you already have patches ready to fix at least this problem. I think we might start from having these patches in while we think of the best way to fix the biggest issue:

Show 19 quoted lines
> What is more complicated is the issue of ref marker from
> git_print_header_div e.g. in 'commit'/'commitdiff' view, and in 'log'
> view.  There link is made into block element using "display: block;"
> CSS rule (div.title, a.title), so that you can click _anywhere_ on the
> header block.  This breaks layout even worse, making hyperlinked ref
> marker text appear *below* header div:
>
>  -----------------------------------------------------------
>  |_Merge branch into maint_ []                             |
>  -----------------------------------------------------------
>  _maint_
>
> To preserve current layout and behavior it would be needed to do some
> deep HTML + CSS positioning hackery, perhaps with additional link block
> without any text... But I don't know exactly how to do this; all [few]
> experiments I did failed.
>
> I see possible the following alternate solutions:
>  * Ignore this issue (e.g. if it does not affect modern browsers)
That would be my current choice until we find a better solution.
Show 6 quoted lines
>  * Revert 4afbaef (we lose feature, but how often used is it?)
>  * Always use quirks mode, or check browser and use quirks mode if it
>   would break layout
>  * Use extra divs and links and CSS positioning to make layout which
>   looks like current one, and behaves as current one, but is more
>   complicated.
I'm asking on #html, hopefully I'll get some interesting idea to try for this.
-- 
Giuseppe "Oblomov" Bilotta
Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 8 in “[BUG/RFH] gitweb: Trouble with ref markers being hyperlinks because of illegally nested links”
  1. Jakub NarebskiJan 12, 2009
  2. Giuseppe BilottaJan 12, 2009
  3. Jakub NarebskiJan 13, 2009
  4. Giuseppe BilottaJan 13, 2009
  5. gitweb: Fix nested links problem with ref markersJakub Narebski, Jan 14, 2009
  6. Giuseppe BilottaJan 14, 2009
  7. Jakub NarebskiJan 14, 2009
  8. Giuseppe BilottaJan 14, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.