Closed
Bug 1888079
Opened 1 year ago
Closed 1 year ago
Don't call getStyleSheetRuleCountAndAtRules when modifying a Rule from the Inspector
Categories
(DevTools :: Inspector: Rules, task)
DevTools
Inspector: Rules
Tracking
(firefox126 fixed)
RESOLVED
FIXED
126 Branch
| Tracking | Status | |
|---|---|---|
| firefox126 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
setStyleSheetText always calls getStyleSheetRuleCountAndAtRules and triggers an at-rules-changed stylesheet update:
/**
* Update the style sheet in place with new text.
...
*/
async setStyleSheetText(
...
) {
...
const { atRules, ruleCount } =
this.getStyleSheetRuleCountAndAtRules(styleSheet);
if (kind !== UPDATE_PRESERVING_RULES) {
this.#notifyPropertyChanged(resourceId, "ruleCount", ruleCount);
}
...
this.#onStyleSheetUpdated({
resourceId,
updateKind: "at-rules-changed",
updates: {
resourceUpdates: { atRules },
},
});
But when modifying a property from the inspector, the rule count and the at-rules can't be modified, so we could avoid computing those information that can be costly on large stylesheets.
| Assignee | ||
Comment 1•1 year ago
|
||
When we modify a rule from the inspector, the number of rules and the at-rules
data can't be impacted, so avoid computing this costly information.
Updated•1 year ago
|
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/76f2f82eefe2
[devtools] Don't call getStyleSheetRuleCountAndAtRules in setStyleSheetText when it's not needed. r=devtools-reviewers,ochameau.
Comment 3•1 year ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
status-firefox126:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•