[whatwg/dom] Bubbling submit events and nested forms (#756)

Although nested forms are [disallowed](https://html.spec.whatwg.org/multipage/forms.html#the-form-element), you can still construct a DOM with nested forms dynamically:

```js
let inner = document.createElement('form');
inner.setAttribute('id', 'inner');
let outer = document.createElement('form');
outer.setAttribute('id', 'outer');
outer.appendChild(inner);

document.body.appendChild(outer);
```

Oddly enough when you do this, a `submit` event dispatched from the inner form does not bubble up to the outer form.

```js
document.getElementById('outer').addEventListener('submit' e => {
  console.log('never fires for submit events dispatched on inner');
}, false);
```

This seems to be the case for all modern browsers (but not at least IE 11, I haven't tested earlier IEs).

I would think this behavior should be specified in the event [dispatch section](https://dom.spec.whatwg.org/#concept-event-dispatch) of the spec but I can't seem to find anything that would suggest the observed behavior. 

Am I just misreading the spec or is this behavior currently unspecified?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/756

Received on Saturday, 20 April 2019 21:07:33 UTC