[Building Sakai] Firefox 4 changes to anchor links in an iframe

Robert Cohen robert.cohen at anu.edu.au
Mon Jul 11 17:32:57 PDT 2011



From:  Sam Ottenhoff <ottenhoff at longsight.com>
Date:  Mon, 11 Jul 2011 12:20:44 -0400
To:  <sakai-dev at collab.sakaiproject.org>
Subject:  [Building Sakai] Firefox 4 changes to anchor links in an iframe

Firefox 4 modified the way anchor links work in an iframe. I suspect that
people will start hearing from faculty and instructional designers that are
previewing their carefully-crafted syllabus pages or other pages that use
anchor links.

Firefox 4 no longer allows the browser to scroll down to an anchor if the
page is within an iframe not using iframe scollbars. This will reveal itself
in Sakai because Sakai's Javascript sets the height of the iframe container
as the page is rendered; this allows the browser to have scrollbars instead
of the iframe.

Here is the Firefox bug:

  https://bugzilla.mozilla.org/show_bug.cgi?id=638598
<https://bugzilla.mozilla.org/show_bug.cgi?id=638598#c11>

Comment 11 reveals why it appears that Firefox devs have modified the
behavior for security reasons.

You can replicate the issue in Sakai by creating a Syllabus page with a link
to an anchor (target=_self) and then include the anchor after many line
breaks. In all other browsers, the anchor link will work fine; in Firefox 4
and above, the link will not scroll the browser window.

Has anyone else run into this issue?  Any thoughts on a JavaScript
workaround 
(http://matthewmanela.com/blog/making-linking-between-anchors-in-an-iframe-w
ork-in-firefox-4-and-above/) versus changing in framing (providing
scrollbars to the iframe instead of the browser)?  Should we expect all
other browser vendors to follow the Firefox lead here?


I suspect that this is fixed in firefox 5 which behaves rather differently
in relation to anchors.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110712/86320c78/attachment.html 


More information about the sakai-dev mailing list