Closed Bug 1605473 Opened 4 years ago Closed 3 years ago

'content: none' behaves like 'content: normal' in ::marker instead of destroying it

Categories

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

defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: Oriol, Assigned: MatsPalmgren_bugz)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-needed)

Attachments

(1 file)

From https://drafts.csswg.org/css-lists/#content-property,

  • content on the ::marker itself is not normal
    The contents of the marker box are determined as defined by the content property, exactly as for ::before.

From https://drafts.csswg.org/css-content-3/#valdef-content-none

On pseudo-elements it inhibits the creation of the pseudo-element as if it had display: none.

Well, display doesn't apply to ::marker, but the first part of the sentence seems clear that no marker box should be generated.

However, in Firefox it behaves just like content: normal.

In Chromium I have the same problem since both normal and none are stored as nullptr.

Yeah, we have the exact same issue, basically, which was long-standing since before our style system rewrite:

document.body.style.content = "normal"
"normal"
getComputedStyle(document.body).content
"none"

Because both are stored as an empty array.

Here is where this distinction is lost.

The refactoring in bug 1605803 will allow to fix this trivially.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Depends on: 1605803
Priority: -- → P3

MDN probably needs to be updated for content:none / content:normal on ::marker when this is fixed, too.
devdoc-needed?

BTW, I added some WPT tests about this:

  • css/css-pseudo/marker-computed-content.html
  • css/css-pseudo/marker-computed-size.html
  • css/css-pseudo/marker-content-019.html

Thanks Oriol!

Keywords: dev-doc-needed

(And sorry, I'm a bit swamped with other things atm)

Since this has not been fixed, I would assume content:none behaves exactly as content:normal
But then why is this test failing in Firefox? https://wpt.fyi/results/css/css-pseudo/marker-content-020.html
It seems some pixels are different (though I can't detect it if I disable highlight diff)
https://wpt.fyi/analyzer?screenshot=sha1%3A88511f75bca2f25537d7d5d1bb8d4ac6686bdb2c&screenshot=sha1%3Aabfd224f3e20313ee8a6c04c0e45abbc0bf89d0e

Assigning to Mats per bug 1699949

Assignee: emilio → mats
Depends on: 1542807

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:mats, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(mats)
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0044af746b47
Implement 'content: none' for ::marker.  r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: