Open Bug 577035 Opened 14 years ago Updated 4 months ago

Double request on button click (inside a tag)

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: dev, Unassigned)

References

(Blocks 1 open bug)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.5pre) Gecko/20100602 Ubuntu/9.10 (karmic) Firefox/3.6.3pre
Build Identifier: 3.6.5pre (rv:1.9.2.5pre)

First of all, I want to say that I know that having a button tag inside an anchor tag is not standard (which makes this report to be a non-bug report). However for several reasons I find it very useful (I use it mainly in intranet systems), for example:
1) clicking in a button works without javascript and without using a form. 
2) buttons style are the same (as links or as submit button inside a form).
3) button styling is easier (better semantic).

Clicking in a button inside an anchor works in Firefox, Opera and Chrome. And it is known not to work in IE (which I don't mind as it is an Intranet project).
However in Firefox for some reason the page is requested twice on a single click. 

Reproducible: Always

Steps to Reproduce:
1.Use this code and save it as test.htm:

<html>
<body>
<div>
<a href="test.htm"><button>Hello</button></a>
</div>
</body>
</html>

2.click on the button and check the access log.
Actual Results:  
"test.htm" is requested twice.

Expected Results:  
"test.htm" should be requested once.

I know (again) that what I am asking is not a bug as it is not standard. But if "fixing" it is trivial, it would behave the same as Opera and Chrome in this matter. 
Thank you for your time and excuse me for this request.
Hmm.  Are we triggering the link on both the click and activate events or something?  smaug, can you reproduce?
Component: HTML: Form Submission → DOM: Core & HTML
See Also: → 1658315
Severity: minor → S4
Blocks: 1459231
Severity: S4 → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.