Closed Bug 1947747 Opened 1 year ago Closed 5 months ago

Display view transition dynamic rules in the inspector view

Categories

(DevTools :: Inspector: Rules, enhancement, P2)

enhancement

Tracking

(firefox147 fixed)

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: emilio, Assigned: nchevobbe)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

Much like pres hints (bug 1212289), view transition dynamic rules (https://drafts.csswg.org/css-view-transitions-1/#document-dynamic-view-transition-style-sheet, implemented in bug 1947746) work in a similar way (not with a full cssRule but with a UA-origin declaration block).

After bug 1919853, we return CSSNestedDeclarations in getMatchingCSSRules. We could also return declaration blocks for pres hints and these, so it'd be a matter of exposing them.

Priority: -- → P2

Emilio, does this need work on the platform side or is everything doable directly from DevTools?
Also, do you have a link to a demo page that would show this ? Thanks

Flags: needinfo?(emilio)

So this needs some platform side work in InspectorUtils at least, to expose the declaration blocks that are not rules around here. That work is the same that would be needed for presentational hints (bug 1212289).

As for pages that trigger this, the view-transitions devtools integration is none right now, but with devtools.inspector.showAllAnonymousContent and such you can inspect a long-running animation like:

<!doctype html>
<style>
@keyframes blink {
  from { opacity: 0 }
  to { opacity: 1 }
}

:root::view-transition-new(foo) {
  animation: blink 1s infinite alternate;
}

#target {
  view-transition-name: foo;
  width: 100px;
  height: 100px;
  background-color: green;
  contain: paint;
}
</style>
<div id="target"></div>
<script>
target.addEventListener("click", function() {
  document.startViewTransition(() => {
    target.style.translate = "300px 0";
  });
});
</script>

And you will see <div type=":view-transition-root"> etc. Some of those elements have these declarations applied.

Note the animation still doesn't quite work, but I'm working on that :)

My recommendation would be to get pres hints working first, it's a long-standing request and 99% of the work here :)

Flags: needinfo?(emilio)
Depends on: 1212289

It looks like we could start accepting view transition pseudo elements from this server logic and then display these elements nicely in the markup view. Notably hidding the intermediate <div type=":-moz-snapshot-containing-block"> wrapping element?

Comment 3's link would be about showing rules in the rule view.
For the markup view, it may be about tweak this walker actor logic.

Blocks: 1995296

We only had to handle the label on the inherited section for view transition
pseudo element.
A test is added to check that the rules are properly displayed when a view transition
pseudo element is selected in the markup view, and that the inherited properties
are visible and that the expected declarations are overridden (acts as a client
test for Bug 1997145)

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Depends on: 1996608
Blocks: 1998345

This will allow to check if a given declaration is considered as inactive (this
is used by the next patch in the queue).
The helper function is refactored a bit so we don't trigger the eslint complexity warning

QA Whiteboard: [qa-triage-done-c148/b147]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: