Open Bug 1826556 Opened 2 years ago Updated 2 years ago

Cannot Have `::after` in area elements

Categories

(Core :: Layout: Generated Content, Lists, and Counters, defect)

Firefox 111
defect

Tracking

()

UNCONFIRMED

People

(Reporter: niente0, Unassigned)

References

Details

Attachments

(1 file)

Attached file after-bug.htm

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

Steps to reproduce:

Just view the HTML file in attachment. The pseudo element keeps having a "static" position. If I set:
#a1 {position:absolute}
then position seems to be accepted (even if it is not), but the hover effect still refuses to work.

Actual results:

No hover animation visible

Expected results:

A hover animation should be visible when cursor is moved on rectangle, like in Chrome

Component: Untriaged → Layout: Generated Content, Lists, and Counters
Product: Firefox → Core

Applying absolute positioning to div::after works, so I don't think that's causing issues.
The root cause seems to be that we do not allow ::after on these elements (::after never shows up in Inspector).
I think this is due to their Content Model in the standard being Nothing, which means no text or element nodes, and Chrome may be incorrect in this case?

Summary: Cannot set position on pseudo-elements other than static → Cannot Have `::after` in Content Model: Nothing DOM Elements.

<area> is display: none, so it's kind of expected that we don't allow pseudo-elements there... Maybe other browsers implement <area> differently.

See Also: → 135040
Summary: Cannot Have `::after` in Content Model: Nothing DOM Elements. → Cannot Have `::after` in area elements

The severity field is not set for this bug.
:boris, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(boris.chiou)

So this is an expected behavior in Firefox, and perhaps it's worth to discuss this behavior in the spec issue? Mark this as S3.

Severity: -- → S3
Flags: needinfo?(boris.chiou)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: