Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this a bug in Firefox?

Status
Not open for further replies.
Dec 8, 2003
17,047
GB
We've been seeing odd behaviour in Firefox with content on a site we're building.

I've created a simple cut-down test harness:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] xml:lang="en" lang="en">
<head>
	<title>Firefox link focus bug</title>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

	<style type="text/css">
		html, body {
			padding: 0px;
			margin: 0px;
		}

		body {
			margin: 50px;
			font-size: 12px;
			font-family: Verdana, Arial, Helvetica, sans-serif;
		}

		.pod {
			width: 15em;
			overflow: auto;
			max-height: 200px;

			padding-left: 5px;
			padding-right: 5px;
			border:1px solid #000000;
		}
	</style>
</head>

<body>

	<div class="pod">
		<div>
			Lorum ipsum dolor sit amet
			<br />
			Lorum ipsum dolor sit amet
		</div>
		<div>
			<a href="[URL unfurl="true"]http://www.google.co.uk/">Visit[/URL] Google</a>
		</div>
	</div>

</body>
</html>

In FX 3.0.10 under Windows XP, Windows Vista, and Mac OS X 10.5, clicking the link causes a scrollbar to appear and the link to jump down a line.

This has a knock-on effect that the link is never activated, presumably because it has now moved (this is just a guess...) ?

The issue also appears if you tab to the link - in fact, anything that gives it focus causes it to jump down, and anything that takes focus away causes it to jump back up again.

So I guess my questions are:

1. Should the scrollbar be appearing at all, given the box is nowhere near its 200px max-height?

2. Even if the link does move, should that stop it working?

I'm guessing the answers are 'no' and 'no' and that this is a bug in Fx, but would like some other opinions.

Also, if people could try this in other versions of Fx (perhaps some v2 or older v3 versions, and under any other OSes, e.g. Linux, etc), that would help to determine the scope of this issue.

The CSS and HTML all validate correctly, so there should be no issue there.

Thanks,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hi

I would say,

1) No. The dotted border of the focus should not add extra padding around the element. ( By setting [tt].pod a { padding: 1px; }[/tt] you can avoid the "jumping" effect. )

2) Yes. You have to click on the link to follow it. The click means mouse down + mouse up on the element. Because the jumping, the mouse up occurs outside the element, so it is not a click. If you actually click it, it still works. ( Add some blah-blah to your sample document the make it scrollable; mouse down on the link; Alt-mouse scroll the document to move the link back under the mouse; mouse up on the link - and the browser will follow the link. )

I tried your sample with the following Mozilla based browsers on Linux ( release year in parenthesis ) :
[ul]
[li]FireFox 3.0.10 ( 2009 ) - jumps[/li]
[li]SeaMonkey 1.1.16 ( 2009 ) - jumps[/li]
[li]FireFox 2.0.0.13 ( 2008 ) - jumps[/li]
[li]FireFox 2.0.0.12 ( 2008 ) - jumps[/li]
[li]Mozilla 1.8b ( 2005 ) - jumps[/li]
[li]FireBird 0.6.1 ( 2003 ) - works correctly[/li]
[li]Phoenix 0.5 ( 2002 ) - works correctly[/li]
[/ul]


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top