Font editor doesn't work in 2-pane mode; missing selectedRule

Categories

(DevTools :: Inspector: Fonts, defect, P1)

For bugs in Firefox DevTools, the developer tools within the Firefox web browser. This includes issues about the user interface of the toolbox, special pages such as about:debugging and about:devtools, and developer-related APIs.

The current iteration of the Fonts panel requires an instance of the Rules view
in order to get access to the element's rules.
In 2-pane mode, when the Fonts panel is the default (last used panel), the Rules
view is not yet instantiated. To guard against this, the Fonts panel makes a call
to ensure an instance of the Rules view is created (and with it a CSSRuleView object).
For some reason, the pageStyle wasn't immediately assigned to the CSSRuleView in
the constructor. The constructor signature shows that pageStyle can be passed in as a
param, but this never happens. There's only one usage of `new CSSRuleView()`.
The pageStyle exist on the inspector instance passed in to the CSSRuleView.
This patch ensures that the CSSRuleView makes use of the PageStyleFront instance
from the inspector and removes the unused param from the constructor.
Perhaps it's better for the Fonts panel to manage its own ElementStyle instance to
get access to the element's selected rules. But in the interest of time, since the
merge date is soon, I'd rather have this fix in quikcly now and keep the dependency
to a Rules view instance with the promise to revisit the Fonts panel architecture and
remove this dependency during the Firefox 65 Nightly cycle.

Thanks, Pascal!
The issue was only occurring in Firefox 64 for which the uplift was successful.
I tested in the current stable, Firefox 63.0.1, which doesn't have the uplift, and the issue does not exist.
So I see no need to uplift this patch in a dot release for stable.