Closed Bug 1863202 Opened 1 year ago Closed 7 months ago

Interop bug with nested buttons via innerHTML

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

Firefox 119
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: lwarlow, Unassigned)

Details

Attachments

(2 files)

Steps to reproduce:

Load https://jsfiddle.net/1z43a8en/

Actual results:

You'll see an empty button, a button with the word Inner and then the text Outer. Repeated twice.

Expected results:

In Chrome and Safari: You'll see an empty button, a button with the word Inner and then the word Outer on the first line. On the second you'll see a button with a nested button with the word Inner, and then the word Outer still inside of the parent button.

I'm not sure who is correct but seeing as Firefox is the odd one out I thought I'd raise it here.

Attached image firefox.png
Attached image chrome-safari.png

Well it's not valid to nest buttons in the first place per https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element

Phrasing content, but there must be no interactive content descendant...

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 76616
Resolution: --- → DUPLICATE

The test cases of bug 76616 and this bug look very different.

Status: RESOLVED → REOPENED
Component: Untriaged → DOM: UI Events & Focus Handling
No longer duplicate of bug: 76616
Ever confirmed: true
Product: Firefox → Core
Resolution: DUPLICATE → ---

What's the expected behavior of setting innerHTML to the source containing nested-elements which cannot be nested at loading?

Flags: needinfo?(hsivonen)

Looking at what the test case does, in Firefox, the fragment parsing works with div context the way it works within div is full-document parse. In Chrome, the result is different in fragment parse. This looks more like a parser bug that Chrome has inherited from WebKit.

Status: REOPENED → RESOLVED
Closed: 1 year ago7 months ago
Flags: needinfo?(hsivonen)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: