Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 495690

Summary: styles.min.css should not render <a name="..."> tags as links
Product: Community Reporter: Markus Keller <markus.kell.r>
Component: WebsiteAssignee: phoenix.ui <phoenix.ui-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: chris.guindon, daniel_megert
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/74944
https://git.eclipse.org/c/www.eclipse.org/eclipse.org-common.git/commit/?id=bc87738c80667cde96d53a61187bd9e625ee308c
Whiteboard:
Bug Depends on:    
Bug Blocks: 493368    

Description Markus Keller CLA 2016-06-08 09:16:20 EDT
https://www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/styles.min.css contains declarations like this that apply to all <a> tags:

a:hover,a:focus{color:#100c1e;text-decoration:underline}

Unfortunately, this also makes non-link anchors like <a name="...">Some text</a> look like a link. This hit us in the Neon Readme (bug 493368 comment 32), but there quite a few other pages that still suffer from this problem, e.g.:

https://eclipse.org/legal/eplfaq.php#CPLEPL
https://www.eclipse.org/swt/faq.php#whatpackagesinSWT
https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_6.php#FixPassRules

styles.min.css should solve these issues globally by reverting the special styles for <a name="..."> tags.

Fix is to add this rule:

a[name], a[name]:hover {
	font-weight: inherit;
	text-decoration: inherit;
	color: inherit;
	background-color: inherit;
}
Comment 1 Christopher Guindon CLA 2016-06-08 10:27:17 EDT
I think the problem here is that we are using the name attributes instead of id for anchor links.

In HTML 4.01, the <a> tag could be either a hyperlink or an anchor. In HTML5, the <a> tag is always a hyperlink, but if it has no href attribute, it is only a placeholder for a hyperlink.
Comment 2 Markus Keller CLA 2016-06-08 11:22:01 EDT
(In reply to Christopher Guindon from comment #1)
> I think the problem here is that we are using the name attributes instead of
> id for anchor links.

I agree that setting an "id" attribute is the right solution for new pages, but the solstice theme has been retrofitted onto existing pages, so we have to expect some remaining pages that still use the outdated form.

Since the proposed fix only applies to cases where the outdated form is used, it should be a safe solution that won't affect clean HTML5 pages.
Comment 3 Christopher Guindon CLA 2016-06-08 16:27:57 EDT
(In reply to Markus Keller from comment #2)
> (In reply to Christopher Guindon from comment #1)
> > I think the problem here is that we are using the name attributes instead of
> > id for anchor links.
> 
> I agree that setting an "id" attribute is the right solution for new pages,
> but the solstice theme has been retrofitted onto existing pages, so we have
> to expect some remaining pages that still use the outdated form.

Agreed but at the same time the migration to solstice has been done 2 years ago. I think we should consider opening bugs to update these pages.

> 
> Since the proposed fix only applies to cases where the outdated form is
> used, it should be a safe solution that won't affect clean HTML5 pages.

The only problem I can see with this patch are links that include the href and name attribute. 

Even if I am on the fence with this one, I decided to create a patch to address this.

If we see some breakage, we will need to revert this change.
Comment 4 Eclipse Genie CLA 2016-06-08 16:48:32 EDT
New Gerrit change created: https://git.eclipse.org/r/74944
Comment 6 Christopher Guindon CLA 2016-06-09 10:30:52 EDT
This is now live!
thanks for the bug report!
Comment 7 Markus Keller CLA 2016-06-09 14:47:37 EDT
Thanks Chris, looks good.