Closed Bug 1013936 Opened 11 years ago Closed 11 years ago

Only load the html.css, forms.css, number-control.css and ua.css UA style sheet on-demand for SVG documents

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: jwatt, Assigned: jwatt)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [MemShrink:P2])

Attachments

(2 files, 2 obsolete files)

I'm having trouble with bug 1011802, so I'm spinning this part off to unblock bug 999931.
Blocks: 999931
Blocks: 686875
Blocks: 1011802
This also moves related members to improve packing.
Attachment #8426227 - Flags: review?(bzbarsky)
Attachment #8426228 - Flags: review?(bzbarsky)
Blocks: 1011806
Comment on attachment 8426227 [details] [diff] [review] part 1 - add methods to nsIDocument to help determine its type r=me
Attachment #8426227 - Flags: review?(bzbarsky) → review+
Comment on attachment 8426228 [details] [diff] [review] part 2 - only load the html.css UA style sheet on-demand for SVG documents r=me. This does depend on SVG documents never being quirks-mode, but that's OK. ;)
Attachment #8426228 - Flags: review?(bzbarsky) → review+
Comment on attachment 8426601 [details] [diff] [review] part 2 - for SVG documents, only load the number-control.css, forms.css, html.css and ua.css UA style sheets on-demand r=me
Attachment #8426601 - Flags: review?(bzbarsky) → review+
Actually the nsStyleSet.cpp change from bug 1011806 has to move into this part 2 patch too. Done locally.
Attachment #8426228 - Attachment is obsolete: true
Huh. Turns out adding forms.css to this patch breaks form controls in foreignObject on Fennec and B2G. This seems to be because sheets loaded via EnsureCatalogStyleSheet take precedence over sheets that have previously been loaded by nsDocumentViewer::CreateStyleSet, so rules like the |select > button| rule that appears in both content.css and forms.css reverse their precedence. Besides that it seems that EnsureCatalogStyleSheet doesn't do what I assumed and just check if the sheet is in the nsStyleSet, but rather if nsDocumentViewer::CreateStyleSet adds a sheet then EnsureCatalogStyleSheet will add a second copy of the sheet to the style set. I guess I need different (new) API.
Target Milestone: --- → mozilla32
Depends on: 1016131
Summary: Only load the html.css UA style sheet on-demand for SVG documents → Only load the html.css, forms.css, number-control.css and ua.css UA style sheet on-demand for SVG documents
Depends on: 1016145
Depends on: 1035248
Depends on: 1073924
Depends on: 1246883
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: