Closed Bug 1561283 Opened 6 years ago Closed 6 years ago

[css-grid] Grandchild of grid container doesn't immediately become grid item when its parent gets "display:contents"

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: Oriol, Assigned: emilio)

Details

Attachments

(2 files)

What steps will reproduce the problem?

  1. Create a grid container with a child and a grandchild
  2. Set display: inline to the grandchild
  3. Force a style change event
  4. Set display: contents to the child

What is the expected result?
The grandchild becomes a grid item and is blockified

What happens instead?
The grandchild doesn't immediately become a grid item

In the attached testcase, the console should say

#test should be inline: inline
#wrapper should be contents: contents
#test should be blockified (immediately): block
#test should be blockified (after a while): block

The penultimate check fails in Firefox. This seems against https://drafts.csswg.org/css-transitions-1/#style-change-event

implementations must not use, present, or display something resulting from the CSS cascading, value computation, and inheritance process [CSS3CASCADE] without updating the computed value [...]. However, when an implementation updates the computed value of a property on an element to reflect one of these changes, [...] it must update the computed value for all properties and elements to reflect all of these changes at the same time (or at least it must be undetectable that it was done at a different time).

Chromium fails the two last checks: https://bugs.chromium.org/p/chromium/issues/detail?id=978419

I see what's going wrong. Last one fails as well on a clean profile btw, do you have any extension installed that could cause a restyle on load?

Assignee: nobody → emilio
Component: Layout: Grid → CSS Parsing and Computation
Flags: needinfo?(oriol-bugzilla)
Priority: -- → P3

(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)

I see what's going wrong. Last one fails as well on a clean profile btw, do you have any extension installed that could cause a restyle on load?

Oh, true. It's caused by uBlock Origin

Flags: needinfo?(oriol-bugzilla)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4167fd17006c Don't optimize out recascading of children when becoming or stopping being display: contents. r=dholbert
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17705 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: