Closed Bug 1840258 Opened 2 years ago Closed 2 years ago

Empty-closed (<div/>) tags should be handled correctly

Categories

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

Firefox 102
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: googol.morons, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

Place <div style="text-align: center;"/> in the middle of left-aligned text in HTML document.
Render document in FF.

Actual results:

The text after <div/> is centered - the <div/> tag is recognized as 'never-closed' and the following part of text lays within it.

Expected results:

The tag should be available within DOM tree as empty. Following text must never be affected by it's styling.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

Only foreign elements are self-closing. The void elements can contain the /, but <div> isn't a void element.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.