Strange hover bug in FF 3

Jan 21, 2009 at 10:54 AM
Hi,

I am using Sandcastle + Sandcastle Styles to create a website with conceptual content. The presentation style used is Hana.

If I look at the page in IE, everything is fine. But if I look at it in FF 3, every single paragraph has a hover effect (color change). This results from the fact that each paragraph is included in an a tag that is used for anchoring. The same problem applies to Prototype style.

Any ideas how to solve this?

Cheerio,


Golo
Jan 21, 2009 at 12:20 PM
There is no need for the cross posting to both Sandcastle and Sandcastle Styles lists,
I have deleted the one in the Sandcastle Styles.

>>Golo: Any ideas how to solve this?
I will test to see what is happening.
For your information, Hana and Prototype styles are incomplete, even after applying
the Sandcastle Styles patch, and should not be considered yet for serious work,
unless you are ready to roll up your sleeves.

Best regards,
Paul.
Jan 22, 2009 at 8:32 AM
Hi Paul,

as I do not know whether this behavior is caused by Sandcastle without or with Styles extension, I posted it to both lists (sorry for that).

The problem occurs with VS2005 style, too, so this is a general problem. I have looked at the generated code and identified the problem, perhaps this might help:

Sandcastle puts every single paragraph into an a tag which has a name attribute, so that this can be addressed directly. Since the a tag represents a link, the stylesheet for hovering links matches in FF and every paragraph hgets highlighted when hovered. To be honest, that IE does not do this is an error of IE, not FF ;-).

A simple (and according to modern web standards) correct solution would be to get rid of any <a name="xyz">...</a> and replace it by <div id="xyz">...</div>. In modern browsers each element with an ID is reachable from a normal href.

Cheerio,


Golo
Jan 22, 2009 at 8:54 AM
Hi Golo,

I can't reproduce this issue.  Are you using the latest version of Sandcastle from CodePlex?  Also, just to be absolutely sure, have you modified Sandcastle in any way?  e.g., XSLT, CSS, shared content XML, configuration files, etc.  If so, I suggest trying again on a clean install.

If you're up-to-date and haven't modified Sandcastle, then perhaps you could provide us with some of your XML documentation comments and/or MAML files that are causing a problem for you.

- Dave
Jan 22, 2009 at 9:01 AM
Hi,

we are using Sandcastle May 2008 CTP (which seems to be the latest version for me), it has not been modified in any way. Additionally, we use the appropriate Sandcastle Styles extension that is suited for May 2008 CTP.

Our project files are built using SHFB, also latest version.

Moreover, the code block component is enabled.

Cheerio,


Golo
Jan 22, 2009 at 9:21 AM
PS: This happens only when using the address attribute on a section or paragraph.
Jan 22, 2009 at 11:58 AM
Hi Golo,

I was able to reproduce the problem in Firefox using the address attribute on a section element.  But frankly, it seems like it may be a bug in Firefox instead of Sandcastle, although that depends upon what the HTML specification is for self-closing anchor elements.

For example, given the following MAML:

<section address="first">

  <title>A topic section</title>

 

  <content>

    <para>Some topic content</para>

  </content>

</section>

<!--EndFragment-->
Sandcastle will generate something similar to the following HTML:

<a name="first" />

<h1 class="heading">

  <span onclick="ExpandCollapse(sectionToggleID0EFBAA)">

    <img id="sectionToggleID0EFBAA" class="toggle" name="toggleSwitch" src="../icons/collapse_all.gif" />
    A topic section
  </span>
</
h1>

<div id="sectionSectionID0EFBAA" class="section" name="collapseableSection" style="">

  <p>Some topic content</p>

</div>

<!--EndFragment-->
Apparently, Firefox does not see that the anchor is self-closing so it applies it to all of the following sibling elements, hence you see a mouse-over effect.

The solution is simply to fixup the Sandcastle XSLT so that it outputs a full anchor element instead of a self-closing one:

  1. Open the utilities_dduexml.xsl, located in Sandcastle's Shared folder: {install}\Presentation\Shared\transforms\utilities_dduexml.xsl
    1. Note: Do not confuse this file with the one of the same name in each presentation's Transforms folder.
  2. Locate the following template:

    <xsl:template match="@address">

    <!--EndFragment-->
  3. Change its content to:

    <a name="{string(.)}"><xsl:text> </xsl:text></a>

    <!--EndFragment--><!--EndFragment-->
I will report the problem in the Sandcastle issue tracker and the Sandcastle Styles issue tracker so that it will be fixed.

- Dave
Jan 22, 2009 at 12:02 PM
Hi,

Please ignore that EndFragment junk - apparently it's just a side effect of pasting code snippets into the HTML editor.

- Dave
Jan 22, 2009 at 12:06 PM
Great, thanks a lot :-)!
Jan 22, 2009 at 12:10 PM
Reported issue:
http://www.codeplex.com/Sandcastle/WorkItem/View.aspx?WorkItemId=3652