Closed Bug 1628044 Opened 5 years ago Closed 5 years ago

Expose CSSProperties from CSSPropertiesFront

Categories

(DevTools :: General, task, P3)

task

Tracking

(firefox77 fixed)

RESOLVED FIXED
Firefox 77
Tracking Status
firefox77 --- fixed

People

(Reporter: rcaliman, Assigned: rcaliman)

References

Details

Attachments

(2 files)

The initCssProperties() helper is used to augment the CSS database of properties received from the server with additional local data. The returned CSSProperties object is cached by DevToolsClient instance so it can be returned quickly on subsequent requests.

Requesting the database from the server and its augmentation could be done in the CSSPropertiesFront's Front.initialize() which is already async. This ensures that by the time the CSSPropertiesFront is returned, the CSSProperties object is ready to use with reconciled data.

Fronts are already cached per target. A duplicate target.getFront("cssProperties") will return the previously instantiated CSSPropertiesFront with the augmented database.

Getting the CSSProperties object is something done only for the top-level target in the Inspector and the Style Editor. Thanks to the behavior of target.getFront(), this already acts as a cache, thus satisfying both tasks done by the initCssProperties() helper.

The initCssProperties() helper is used to augment the CSS database of properties received from the server with additional local data. The returned CSSProperties object is cached by DevToolsClient instance so it can be returned quickly on subsequent requests.

Requesting the database from the server and its augmentation can be done in the CSSPropertiesFront's Front.initialize() which is already async. This ensures that by the time the CSSPropertiesFront is returned, the CSSProperties object is ready to use with data reconciled.

Fronts are already cached per target. A duplicate target.getFront("cssProperties") will return the previously instantiated CSSPropertiesFront with the augmented database.

Getting the CSSProperties object is something done only for the top-level target in the Inspector and the Style Editor. Thanks to the behavior of target.getFront(), this already acts as a cache, thus negating both tasks done by the initCssProperties() helper.

Assignee: nobody → rcaliman
Priority: -- → P3
See Also: → 1573644

Depends on D70071

After changes in D70071, the CSSProperties object is retrieved from the CSSPropertiesFront. The initCssProperties() method is no longer required. It is only used in tests.

This patch removes the leftover callsites for initCssProperties() from tests and the method implementation itself.

Pushed by rcaliman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b1b999f20521 Get CSSProperties directly from CSSPropertiesFront r=jdescottes https://hg.mozilla.org/integration/autoland/rev/f279cfb964e7 Remove obsolete initCssProperties() helper and cleanup tests; r=jdescottes
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: