Closed Bug 1625910 Opened 5 years ago Closed 4 years ago

Use the ResourceWatcher API to fetch CSS Warning

Categories

(DevTools :: Console, task, P1)

task

Tracking

(Fission Milestone:M6c, firefox79 fixed)

RESOLVED FIXED
Firefox 79
Fission Milestone M6c
Tracking Status
firefox79 --- fixed

People

(Reporter: ochameau, Assigned: nchevobbe)

References

Details

(Whiteboard: dt-fission-m2-mvp)

Attachments

(1 file)

Bug 1576624 introduced the ResourceWatcher API, accessible via toolbox.resourceWatcher. This API will help listen to data that is being created early, when the document just started loading.

We should migrate the whole DevTools codebase to this API for any data that:

  • DevTools frontend listen to, or care about,
    and,
  • may be created or be notified early, when the document just starts being loaded.
    This data will typically be: console messages, errors, warnings, sources, Root element NodeFront, storage values, network events, stylesheets, ...

We are typically not going to use this API for:

  • data being fetched on-demand, from user's input. For ex: webconsole evaluation input, or, DOM element expands from the Markup view.
  • events which we only want to record when the user cares about them. For ex: animation events.

For some more high level context, please have a look at Migration to Fission-compatible APIs, which describes all Fission-related refactorings.

The typical task for this bug will be about migrating code that:

  • start listening and register a RDP event listener,
  • retrieve already existings data,
    from panel's codebase, to the ResourceWatcher module, in the LegacyListener object.
    And then, the panel should use the ResourceWatcher instead.

Bug 1620234 is a good example of such migration, applied to Console Messages.
Bug 1623699 is also useful example as it demonstrates how to write tests for such migration.

This bug is about focusing on only one usecase in the console: CSS Warnings.

This case is different from the other ones, I imagine this depends on bug 1625905, as CSS Warnings are passed as JS Errors?
But we do call target.ensureCSSErrorReportingEnabled:
https://searchfox.org/mozilla-central/source/devtools/client/webconsole/enhancers/css-error-reporting.js#39
https://searchfox.org/mozilla-central/rev/9c6e7500c0015a2c60be7b1b888261d95095ce27/devtools/server/actors/targets/browsing-context.js#1084
We should probably be going through the ResourceWatcher API, as a followup work will be about migration client side LegacyListeners to the server side. And from the server side, we will have to ensure calling ensureCSSErrorReportingEnabled as soon as the document starts loading. So, we should probably introduce a CSS Warning Type and ensure registering it to the ResourceWatcher API.

Tracking Fission DevTools bugs for Fission Nightly (M6) milestone

Fission Milestone: --- → M6
Blocks: 1626645
Depends on: 1627977
No longer depends on: 1627977
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Type: enhancement → task
Priority: P2 → P1

Tracking dt-fission-m2-mvp bugs for Fission Nightly milestone (M6c)

Fission Milestone: M6 → M6c
Blocks: 1644187
Blocks: 1644186
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9055fd940de5
Use ResourceAPI for CSS Warning messages.r=ochameau.
Flags: needinfo?(nchevobbe)

sorry, I forgot to upload my up-to-date patch to phab before landing it

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2f775ed55e62
Use ResourceAPI for CSS Warning messages.r=ochameau.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: