I love bugs that are just confusing and/or break your mental model of how you think the software works.

Here is a good example: Given the following HTML in Gecko, what happens when a user clicks the button?

<form method="POST" action="/form-action">
  <a href="/anchor-target">
    <input type="button" value="harro">
  </a>
</form>
GET /anchor-target HTTP/1.1
GET /anchor-target HTTP/1.1

2 GET requests? Okay, perhaps some sort of event bubbling problem; it's relatively common in GUI internals. But what about:

<form method="POST" action="/form-action">
  <a href="/anchor-target">
    <input type="image" src="http://upload.wikimedia.org/wikipedia/en/7/75/LHC5.jpg">
  </a>
</form>
POST /form-action HTTP/1.1
GET /anchor-target HTTP/1.1
GET /anchor-target HTTP/1.1

Wait, this time it POSTs the form and makes 2 GET requests?

Answers in a Bugzilla report, thanks.

§

Tags: Computer
Planets: ALUG UWCS WUGLUG Debian

§

Three comments

  1. From the HTML spec:
    `TYPE=IMAGE' implies `TYPE=SUBMIT' processing; that is, when a pixel is chosen, the form as a whole is submitted.

    i.e. the POST request in the second case is not a bug. The only bug I can see here is the duplicated GET.

    glandium

    Sorry, did you misread? In case it wasn't clear from my post, the interesting question is why are we seeing two GETs as *as well as* a single POST.

    lamby

  2. Looks like https://bugz... and https://bugz..., but wow, very weird.

    James Ross

  3. If you s/button/submit/ in the first example, do you also get a POST and two GETs?

    By the way, note that your example violates HTML5, at least: an "a" element cannot contain interactive content, which includes any input with type other than hidden.

    Anonymous

Reply

§