Closed Bug 457810 Opened 16 years ago Closed 15 years ago

Speculatively load stylesheets from preloading

Categories

(Core :: DOM: HTML Parser, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mrbkap, Assigned: bjarne)

References

(Depends on 1 open bug)

Details

(Keywords: fixed1.9.1)

Attachments

(3 files)

This is similar to bug 457809 but for stylesheets.
Assuming you have the nsIDocument involved in |doc|, the URI of the sheet in |uri| and an nsICSSLoaderObserver implementation (probably one which just does "return NS_OK;" as the body of StyleSheetLoaded) in |obs|:

  doc->CSSLoader()->LoadSheet(uri, doc->NodePrincipal(), obs);

will do the trick, since CSSLoader already caches loaded sheets and already coalesces sheet loads.

You probably want to avoid doing this for alternate stylesheets, though, since currently we deprioritize them and forcing them to load earlier could actually slow sites that use them down.
See patch for bug #457809
Status: NEW → ASSIGNED
Assignee: nobody → bjarne
Depends on: 457809
This is the part of patch from bug #457809 needed to preload stylesheets. See bug #457809 comment #45.

Requesting another round of reviews just in case...
Attachment #370195 - Flags: superreview?(bzbarsky)
Attachment #370195 - Flags: review?(mrbkap)
Depends on: 486044
Attachment #370195 - Attachment description: V1.0 part of patch to preload images → V1.0 part of patch to preload stylesheets
Attachment #370195 - Flags: superreview?(bzbarsky) → superreview+
Attachment #370195 - Flags: review?(mrbkap) → review+
Keywords: checkin-needed
This can be applied without the fix for bug #457809. Not tested beyond mochitests and some random browsing since it's a trivial code-shuffle.
Pushed http://hg.mozilla.org/mozilla-central/rev/bf5cf25cdd3c with the following changes to the patch:

1) No changes to nsIDocument IID
2) Fixed checkin comment.

Unfortunately, I missed the fact that the patch doesn't have the right user set.  :(
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Must have shuffled code a little too fast this morning... :\ thanks for fixing up. :)

(Apparently hg qfold does not preserve user-info. Must remember to check this next time!)
Tp is looking good, on both Linux and Mac!
Keywords: checkin-needed
Attachment #370827 - Flags: approval1.9.1?
We should probably fix bug 485012 before landing this on branch.
Depends on: 485012
No longer depends on: 457809
Identical to V2.0 but with issues from comment #5 fixed.
Attachment #372430 - Flags: approval1.9.1?
Comment on attachment 372430 [details] [diff] [review]
V2.0 for 1.9.1 branch 

a191=beltzner
Attachment #372430 - Flags: approval1.9.1? → approval1.9.1+
And pushed http://hg.mozilla.org/releases/mozilla-1.9.1/rev/e36f8c547a96 to fix the resulting test bustage due to the test fix from bug 457809 never making it to branch....
Depends on: 495274
Depends on: 533247
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: