Closed Bug 1015147 Opened 6 years ago Closed 6 years ago

Put the user-agent style sheets svg.css and mathml.css in the style sheet cache

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: jwatt, Assigned: jwatt)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [MemShrink])

Attachments

(1 file, 1 obsolete file)

The user-agent style sheets svg.css and mathml.css should be in the style sheet cache. I don't believe there's any reason to be creating a new instance of these style sheets for each document that needs them.
Attached patch patch (obsolete) — Splinter Review
Attachment #8427713 - Flags: review?(bzbarsky)
This builds on the patch in bug 1014891.
Depends on: 1014891
Ah, so svg.css used to be loaded at startup anyway as part of ua.css, right?
Back in 2005, yeah, but bug 287389 changed that.

So my reason for here loading it up front in the cache is that all our products load SVG during startup (like HTML and XUL), so we should cache the SVG sheet (like for HTML and XUL).
Oh, I see.

Yeah, ok.  svg.css is pretty small anyway...
Attached patch patchSplinter Review
Rotted myself with changes to the patch in bug 1014891 - updating for that.
Attachment #8427713 - Attachment is obsolete: true
Attachment #8427713 - Flags: review?(bzbarsky)
Attachment #8427943 - Flags: review?(bzbarsky)
Comment on attachment 8427943 [details] [diff] [review]
patch

Why not just:

  if (mOnDemandBuiltInUASheets.Contains(aSheet)) {
    return;
  }

instead of reinventing it?

And also, just early return if !aSheet instead of adding null to the list.

>-    mOnDemandBuiltInUASheets.SizeOfExcludingThis(SizeOfStyleSheetsElementIncludingThis,

We should just pass null for the callback, no?  We still want to measure the array memory.

r=me
Attachment #8427943 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/f11fd47e89a7
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.