From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Subject: [BUG/RFH] gitweb: Trouble with ref markers being hyperlinks because of illegally nested links
Date: Mon, 12 Jan 2009 02:15:11 +0100 [thread overview]
Message-ID: <200901120215.13668.jnareb@gmail.com> (raw)
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...
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)
* 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.
P.S. From what I have checked neither kernel.org nor repo.or.cz
have this issue.
--
Jakub Narebski
Poland
next reply other threads:[~2009-01-12 1:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 1:15 Jakub Narebski [this message]
2009-01-12 2:59 ` [BUG/RFH] gitweb: Trouble with ref markers being hyperlinks because of illegally nested links Giuseppe Bilotta
2009-01-13 0:13 ` Jakub Narebski
2009-01-13 0:59 ` Giuseppe Bilotta
2009-01-14 0:17 ` [RFC/PATCH] gitweb: Fix nested links problem with ref markers Jakub Narebski
2009-01-14 3:56 ` Giuseppe Bilotta
2009-01-14 10:39 ` Jakub Narebski
2009-01-14 13:52 ` Giuseppe Bilotta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200901120215.13668.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=giuseppe.bilotta@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).