Closed Bug 318128 Opened 19 years ago Closed 19 years ago

Please decide whether the CSS loader is a service or not

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: neil, Assigned: dbaron)

References

()

Details

Attachments

(1 file, 2 obsolete files)

Then I can run up a patch to switch the errant consumers.
It's not a service.  We have existing bugs on at least some of the code that uses GetService to get it, iirc.
Attached patch Proposed patch (obsolete) — Splinter Review
This changes the four cases found by the query. I converted the code to use NS_NewCSSLoader in the two layout sources. I was worried that something was expecting the CSS loader to outlive the function but it hasn't stopped me from using this patched build to attach the patch so I guess it's not an issue ;-)
Attachment #204501 - Flags: superreview?(bzbarsky)
Attachment #204501 - Flags: review?(bzbarsky)
Won't this lead to some perf impact from all the thrashing?  Some of these (document viewer and chrome registry) would likely want CSSLoaders fairly often...
Attached patch Cache CSS loader? (obsolete) — Splinter Review
I can cache the CSS loader in the chrome registry if you like (I can't write a patch for toolkit because I don't have a xulrunner tree). Since the stylesheet cache already caches the stylesheets I didn't see the point of caching the CSS loader as well, and the document viewer only requires its CSS loader when the usechromesheets attribute is set, which only applies to the sidebar in Modern.
I do see that I could optimize the placement of the loader creation slightly.
Attachment #204534 - Flags: superreview?(bzbarsky)
Comment on attachment 204534 [details] [diff] [review]
Cache CSS loader?

> Since the stylesheet cache already caches the stylesheets I didn't see the
> point of caching the CSS loader as well

It'd prevent us from creating (quite as many) oodles of CSS loaders at startup...

I agree that for the viewer this might be a non-issue.
Attachment #204534 - Flags: superreview?(bzbarsky) → superreview+
Attachment #204501 - Flags: superreview?(bzbarsky)
Attachment #204501 - Flags: superreview-
Attachment #204501 - Flags: review?(bzbarsky)
Attachment #204501 - Flags: review-
Attached patch Updated patchSplinter Review
Attachment #204501 - Attachment is obsolete: true
Attachment #204534 - Attachment is obsolete: true
Attachment #205031 - Flags: superreview?(bzbarsky)
Attachment #205031 - Flags: review?(benjamin)
Comment on attachment 205031 [details] [diff] [review]
Updated patch

Thank you for doing this!  sr=bzbarsky
Attachment #205031 - Flags: superreview?(bzbarsky) → superreview+
Attachment #205031 - Flags: review?(benjamin) → review+
Fix checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Depends on: 360746
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: