Closed Bug 1799383 Opened 3 years ago Closed 3 years ago

CSS media simulation not applied throughout navigation history

Categories

(DevTools :: General, defect, P3)

Firefox 102
defect

Tracking

(firefox110 verified, firefox111 verified)

VERIFIED FIXED
110 Branch
Tracking Status
firefox110 --- verified
firefox111 --- verified

People

(Reporter: ed7-aspire4925, Assigned: jdescottes)

References

Details

Attachments

(1 file, 2 obsolete files)

Steps to reproduce:

  1. Open any webpage using CSS media queries.
  1. Open DevTools > Inspector.
  2. Enable any media simulation.
  • e.g. print.
  1. Go to some other webpage (simulation should preserve).
  2. Disable all media simulations.
  3. Go back one page.
  4. Oops.

Actual results:

Previous media simulations are preserved.

Expected results:

Media simulations applied to the webpage should match those of the toggle buttons.

If useful, here are the steps to a user workaround:
8. Close then open DevTools again.
9. Turn the previous simulations on, then off. The webpage should return to normal.

Oops. I forgot to write that this bug is found in Firefox 102.4.0esr.

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

Yes, I can reproduce this. It seems like it might be more of a DevTools issue than the CSS engine, though; like it's failing to apply the correct media simulation settings when going back to a cached page. Moving to DevTools component for consideration.

Status: UNCONFIRMED → NEW
Component: CSS Parsing and Computation → General
Ever confirmed: true
Product: Core → DevTools

We could try to prevent navigation while in simulation mode, or restore the default browsing context settings before doing a navigation. Although that would be annoying for other simulation modes such as dark mode.

We should first check if the browsing context's flag has been updated and if only the document retains the print mode for some reason.

Flags: needinfo?(jdescottes)

The issue is in DevTools, we do not update the BrowsingContext targeted by target-configuration.
This is normally handled at https://searchfox.org/mozilla-central/rev/5a49163b7012ded5fa1c4da5aa4f8d3f7c85a5e7/devtools/server/actors/target-configuration.js#118-155, but bfcache navigations are missed.

Flags: needinfo?(jdescottes)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

The severity field is not set for this bug.
:Honza, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(odvarko)
Flags: needinfo?(odvarko)
Whiteboard: [devtools-triage]

The severity field is not set for this bug.
:Honza, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(odvarko)
Severity: -- → S3
Priority: -- → P3
Whiteboard: [devtools-triage]
Flags: needinfo?(odvarko)
Blocks: 1805094
Blocks: 1805997
Duplicate of this bug: 1805094

Comment on attachment 9307316 [details]
Bug 1799383 - [devtools] Restore target configuration before switching to new browsing context

Revision D164217 was moved to bug 1805997. Setting attachment 9307316 [details] to obsolete.

Attachment #9307316 - Attachment is obsolete: true

Comment on attachment 9308570 [details]
Bug 1799383 - [devtools] Do not restore configuration on discarded browsing contexts

Revision D164846 was moved to bug 1805997. Setting attachment 9308570 [details] to obsolete.

Attachment #9308570 - Attachment is obsolete: true
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e1ddb2789d79 [devtools] Update BrowsingContext for TargetConfiguration actor on bfcache navigation r=ochameau
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch

Very much appreciated.

Will look forward to this in the next ESR.

Cheers,
Brendon

QA Whiteboard: [qa-110b-p2]

Reproduced on a 2022-12-18 Nightly build on macOS 12.
Verified as fixed on Firefox 110.0b8(build ID: 20230202190127) and Nightly 111.0a1(build ID: 20230202172003) on macOS 12, Windows 10, Ubuntu 22.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-110b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: