Closed Bug 1804925 Opened 2 years ago Closed 2 years ago

`display: revert` may have partially broke between FF 105 and 106

Categories

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

Firefox 107
defect

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox107 --- wontfix
firefox108 --- wontfix
firefox109 --- wontfix
firefox110 --- fixed

People

(Reporter: armen.michaeli, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

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

Steps to reproduce:

  • Open the following HTML document in Firefox 106 (Windows, x64):
<!DOCTYPE html>
<html>
	<head>
		<style>
			summary {
				display: revert;
			}
		</style>
	</head>
	<body>
		<details>
			<summary>Example</summary>
		</details>
	</body>
</html>
  • Observe summary no longer has a list marker (a filled triangle) which it had in Firefox 105

Actual results:

display: revert causes computed value of the display property of the summary element to be block, which seems contrary to how revert is described where it should have the effect as if the property wasn't changed in current style origin -- meaning the user agent stylesheet value should be applied, which in case of with 106 is a certain resource://content-accessible/details.css file now (looking at it in Developer Tools):

summary,
slot[name=internal-main-summary]::slotted(summary) {
  display: list-item;
  counter-increment: list-item 0;
  list-style: disclosure-closed inside;
}

In Firefox 105 which does not exhibit the issue, there is no details.css file, the corresponding default UA style is instead in resource://gre-resources/html.css:

details > summary:is(:first-of-type, :-moz-native-anonymous) {
  display: list-item;
  counter-increment: list-item 0;
  list-style: disclosure-closed inside;
}

Anyway, the URL doesn't have to be the cause of this, but something somewhere else that's related to the changing of the URL somehow, broke the display: revert subtly, I think.

Expected results:

Old behaviour as per Firefox 105 at least, is correct -- display: revert should have the effect as if display was list-item because that value is the one computed from the previous layer which is UA default.

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

Hmm, this is because now that the style is inside the shadow tree, "revert" doesn't revert to that as that's considered author origin, but to the user-agent stylesheet (which now no longer has display: list-item rules).

display: revert-layer works as you intend, fwiw.

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Regressed by: 1308080
Severity: -- → S2

This preserves the revert keyword behavior. This doesn't match the spec
to the letter, see https://github.com/whatwg/html/issues/8610, but I
think it's probably ok to keep behavior for now. Changing to match the
spec would avoid duplicating the details.css summary rule.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5c61586b4d42 Implement details and summary styling in a UA sheet. r=TYLin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/37470 for changes under testing/web-platform/tests

Set release status flags based on info from the regressing bug 1308080

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Upstream PR merged by moz-wptsync-bot
Flags: in-testsuite+

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox109 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: