Expose CSSProperties from CSSPropertiesFront
Categories
(DevTools :: General, task, P3)
Tracking
(firefox77 fixed)
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.
Assignee | ||
Comment 1•5 years ago
|
||
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 | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
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.
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b1b999f20521
https://hg.mozilla.org/mozilla-central/rev/f279cfb964e7
Description
•