Open Bug 731106 Opened 12 years ago Updated 2 years ago

Changing the HREF of a link in a mouseover handler doesn't change the displayed URL

Categories

(Firefox :: General, defect)

x86
All
defect

Tracking

()

People

(Reporter: mjh563, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

Attached file testpage
User Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20100101 Firefox/11.0
Build ID: 20120215222917

Steps to reproduce:

If a link has a mouseover handler that changes the link's href, this change is not reflected in the destination URL shown to the user. The original URL is shown instead.

The attached testpage contains a link with a mouseover handler that updates the href. To reproduce the problem, hover the mouse over the link and check the pop-up link destination that's shown at the bottom of the window. It shows the original URL, not the changed URL.

If you move the mouse off and back over the link, it then shows the new URL as expected.

This works as expected in Google Chrome and Opera.
Attachment #601161 - Attachment mime type: text/plain → text/html
UI issue.
Component: DOM: Events → General
Product: Core → Firefox
QA Contact: events → general
Regression window:
Works:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9a4pre) Gecko/20070422 Minefield/3.0a4pre
Fails:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9a4pre) Gecko/20070423 Minefield/3.0a4pre
Pushlog:
http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-04-22+00%3A00%3A00&maxdate=2007-04-23+03%3A00%3A00&cvsroot=%2Fcvsroot

Suspected:
Bug 40838
Status: UNCONFIRMED → NEW
Component: General → Event Handling
Ever confirmed: true
OS: Linux → All
Product: Firefox → Core
QA Contact: general → events
Version: 11 Branch → Trunk
Blocks: 40838
Keywords: regression
No, this bug was in the right place.  The notification to chrome is sent before in-page event processing; if chrome wants to show the post-processing URI it needs to do the showing async.
Component: Event Handling → General
Product: Core → Firefox
QA Contact: events → general
Duplicate of bug 554176?
I was about to report this same bug until I saw this. Crazy how this bug has been around since 2012.

PoC code to prove this bug is still working. Hover over the microsoft.com link and Firefox leads you to believe it'll actually go to microsoft.com, but when you click, it goes to google.com.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>mouseover demo</title>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>

<a id="awesomelink" href="#" onmouseover="runjs();" onclick="runjs1()";>http://www.microsoft.com/</a>

<script>
  $( document ).ready(function() {
    $("a#awesomelink").attr('href', 'http://www.microsoft.com/');
   });

function runjs() {
  $("a#awesomelink").attr('href', 'http://www.google.com/');
}
function runjs1() {
top.location.href='http://www.google.com/';
}
</script>
</body>
</html>
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: