Closed Bug 1809114 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 37802 - [CQ] Improve ::backdrop support in container queries

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 37802 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/37802
Details from upstream follow.

Anders Hartvoll Ruud <andruud@chromium.org> wrote:

[CQ] Improve ::backdrop support in container queries

Containers with ::backdrop pseudo-elements are especially problematic
for our implementation of container queries, because we do layout for
the ::backdrop pseudo-element before we reach layout for the
originating element. This means that at the time we discover that some
::backdrop needs an update (based on some CQ evaluation), it will be
too late to effectuate that change.

This CL fixes this by delaying the creation of (problematic)
::backdrop pseudo-elements until after style and layout is done, then
doing another pass if needed.

  • During Element::RecalcStyle, at the point we'd normally update the
    ::backdrop, we'll now instead add a pending update to
    PostStyleUpdateScope if needed.
  • At the instantiation sites for PostStyleUpdateScope, we apply those
    pending updates (if any), and re-run style and layout. Applying the
    updates means that the PseudoElements are created/removed, and
    marked for style recalc. This differs from regular PseudoElement
    updates, since newly created PseudoElements aren't normally marked
    for recalc: instead their styles are computed immediately after
    creation. Marking for recalc is necessary in our case, because at
    the time the pending
    ::backdrop happens outside the style recalc lifecycle phase.

Fixed: 1405428
Change-Id: I1f57afd40c6a0834c8498ff814954db515a0e8ca
Reviewed-on: https://chromium-review.googlesource.com/4142899
WPT-Export-Revision: 2b74109166918c126e73452959116212feeb21bb

Component: web-platform-tests → Layout
Product: Testing → Core
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1a7b02bfac2a
[wpt PR 37802] - [CQ] Improve ::backdrop support in container queries, a=testonly
https://hg.mozilla.org/integration/autoland/rev/b4333904a09a
[wpt PR 37802] - Update wpt metadata, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.