::marker deprecation notice in Canary 90

290 views
Skip to first unread message

Tom Brodhead

unread,
Feb 17, 2021, 3:05:12 PM2/17/21
to Chromium-discuss
I'm suppressing the default triangle marker in <summary> elements in my site. The info at Feature: 'display: list-item' by default for <summary> states:

The default value of CSS 'display' property for <summary> is changed to 'list-item' from 'block'. We also support '::marker' pseudo element selector for <summary>, and remove '::-webkit-details-marker' pseudo element selector. Before this change, developers did the following in order to hide the details marker: summary::-webkit-details-marker { display: none; margin-inline-end: 0; } Now developers can do: summary { display: block; } or summary { list-style-type: none; }

Chrome v. 89 and below and all versions of Safari require the older method described above. My CSS is therefore:

/* Suppress caret: Needed for Chrome >= 89: */
@supports (::marker) {
.main summary {
list-style: none;
}
}

/* Suppress caret: Needed for Chrome < 89, Safari */
@supports not (::marker) {
.main summary::-webkit-details-marker {
display: none;
}
}

However, Canary 90 issues this warning in the console:

[Deprecation] ::-webkit-details-marker pseudo element selector is deprecated. Please use ::marker instead. See https://chromestatus.com/feature/6730096436051968 for more details.

How can I write my CSS to suppress this warning? I am using ::marker, and I'm providing a fallback for non-compliant browsers.

PhistucK

unread,
Feb 17, 2021, 3:20:08 PM2/17/21
to brodhe...@gmail.com, Chromium-discuss
Looks like @supports does not support feature-testing selectors this way. You need to prefix it with selector -
@supports selector(::marker) { ... }
Not that it explains the deprecation warning, but just so you know.
I suspect that the warning is emitted on parse and not on use, in which case there is basically no way around it and you just have to ignore it.

The following reference kind of agrees with my hypothesis (its file name is "parser") -

PhistucK


--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.
Reply all
Reply to author
Forward
0 new messages