Closed Bug 2018538 Opened 5 months ago Closed 4 months ago

Tweak rules view to ease supporting incremental updates

Categories

(DevTools :: Inspector: Rules, task)

task

Tracking

(firefox151 fixed)

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

For now the CssRuleView class wipes its whole content on most updates, which causes many troubles regarding user focus.
We have to restore user focus when updating, whereas the actual element where the focus is doesn't need any update.

A simplification regarding "containers" would help supporting incremental updates.
Right now pseudo elements, inherited, keyframes, registered properties and position-try all follow a similar pattern with expandable containers.
But regular rules don't.
This discrepency makes it significantly harder to update the list of rules incrementally.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

This will help maintain the rule list on CSSOM updates.

  • simplify fetching pseudoClassLocks as ElementStyle.element is actually equal to this.viewedElement
  • which also help remove #clearPseudoClassLocks and only rely on the refresh one.
    refreshPseudoClassPanel doesn't need to wait for this.elementStyle,
    but is functional as soon as viewedElement is set.
  • streamline the pattern of having "refresh" methods that can be called
    right after updating the viewedElement both when it is set to a value
    or null.
  • #clear argument wasn't used and the method is overall confusing.
    Callsites are clearer by inlined it and using refresh methods.
    (the destroy of ElementStyle is going to be tweaked in followups)
Pushed by apoirot@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b46e96f6ffa3 https://hg.mozilla.org/integration/autoland/rev/00788d76a7fa [devtools] Simplify a few things around CssRuleView.selectElement. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/90e830b03f1e https://hg.mozilla.org/integration/autoland/rev/d660180beb2a [devtools] Use a more explicit name for the selected element node front. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/e24f8373ca04 https://hg.mozilla.org/integration/autoland/rev/bee11d4678c3 [devtools] RuleEditor: Factorize all container logic into a dedicated method. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/e10bc3fd75de https://hg.mozilla.org/integration/autoland/rev/4a499a60cca5 [devtools] Always use a container in the rule view. r=devtools-reviewers,nchevobbe
Regressions: 2027837
QA Whiteboard: [qa-triage-done-c152/b151]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: