Open Bug 1500974 Opened 6 years ago Updated 2 years ago

Font editor: remove dependencies to Rules view

Categories

(DevTools :: Inspector, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: rcaliman, Unassigned)

References

(Blocks 1 open bug)

Details

The Font Editor expects a working instance of the Rules view to read, preview and write CSS font properties. This is not a problem in 3-pane mode, but in 2-pane mode, when the Rules view was not previously opened (i.e. it's not the default panel), the Font Editor forces the creation of the Rules view in the background.

This adds needles complexity and performance impact. 

Optimizations in lazy-loading modules can and do impact this. 

The Font Editor should create its own instance of the [ElementStyle](https://searchfox.org/mozilla-central/source/devtools/client/inspector/rules/models/element-style.js) model to to read and write to the element's CSS rules.

Basically:
- `this.selectedRule` should no longer rely on `inspector.ruleView`:
https://searchfox.org/mozilla-central/rev/fcfb479e6ff63aea017d063faa17877ff750b4e5/devtools/client/inspector/fonts/fonts.js#876
- replace the reliance on TextProperty (a model from the Rules view) with a direct reference to the CSS declaration of the selected rule.
- changes in the Rules view should still be reflected in the Font Editor, but perhaps reacting to the CSS rule itself is sufficient.

This should facilitate work for Bug 1462591
Component: Inspector: Fonts → Inspector
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.