Closed Bug 1833491 Opened 3 years ago Closed 3 years ago

WPT css-grid/parsing/grid-template-shorthand-areas-valid.html fails in Firefox

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: dholbert, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

wpt.fyi:
https://wpt.fyi/results/css/css-grid/parsing/grid-template-shorthand-areas-valid.html

Direct link to test:
http://wpt.live/css/css-grid/parsing/grid-template-shorthand-areas-valid.html

The test does something like the following:

let elem = document.documentElement;
elem.style.gridTemplate = "none / 1px" ;
elem.style.gridTemplateAreas = "";
elem.style.gridTemplateAreas = '"a"';

...and then it inspects elem.style.gridTemplate.

The lines that adjust grid-template-areas seem to also reset the serialization of the grid-template shorthand property itself.

So this seems to be a style-system bug with serialization of these interrelated properties.

Note, the grid-template property is defined here:
https://drafts.csswg.org/css-grid/#explicit-grid-shorthand

Component: Layout: Grid → CSS Parsing and Computation
Attached file reduced testcase 1 (obsolete) —

Aha, I was missing quotes around "a" in order to trigger the thing that the test is actually testing. When I add those quotes, I do see a difference between Firefox and Chrome. I'll update comment 0 to reflect that, and post an updated version of the testcase.

Attached file reduced testcase 1 —

I think this might be a test bug? The grid-template shorthand is supposed to set the grid-template-areas property to none. So once it's been set to some other valid value, it makes sense that it wouldn't be possible to serialize a value from it.

This seems similar to e.g. the situation with font shorthand and the font-size-adjust longhand, which (per MDN) it resets to its initial value (none) despite not directly having the ability to set a custom value for it. It looks like we have the same behavior-difference with Chrome for that example, actually; I'll attach a testcase to demonstrate.

Attachment #9334221 - Attachment is obsolete: true

Here's a screenshot showing the difference for testcase 2.

emilio, does this ring any bells for you? I'm pretty sure we're correct to decline-to-serialize-the-shorthand in this situation, right? (Is there a known Chrome bug on their behavior, assuming they're the buggy ones here?)

Flags: needinfo?(emilio)

Blink is clearly wrong, probably https://bugs.chromium.org/p/chromium/issues/detail?id=1322084 or similar.

The test is broken. grid-template can't serialize to something which
doesn't really round-trip, so firefox is correct and Blink is wrong.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

Yeah, that test makes no sense.

Flags: needinfo?(emilio)
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40053 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Flags: needinfo?(emilio)
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: