Allows extensions or embeddors to add to the built-in list of user or agent style sheets.
Inherits from: nsISupports
Implemented by: @mozilla.org/content/style-sheet-service;1
. To create an instance, use:
var styleSheetService = Components.classes["@mozilla.org/content/style-sheet-service;1"] .getService(Components.interfaces.nsIStyleSheetService);
void loadAndRegisterSheet(in nsIURI sheetURI, in unsigned long type); |
boolean sheetRegistered(in nsIURI sheetURI, in unsigned long type); |
void unregisterSheet(in nsIURI sheetURI, in unsigned long type); |
Constant | Value | Description |
AGENT_SHEET |
0 |
|
USER_SHEET |
1 |
|
AUTHOR_SHEET |
2 |
Synchronously loads a style sheet from sheetURI
and adds it to the list of user or agent style sheets.
A user sheet loaded via this API will come before userContent.css and userChrome.css in the cascade (so the rules in it will have lower precedence than rules in those sheets).
An agent sheet loaded via this API will come after ua.css in the cascade (so the rules in it will have higher precedence than rules in ua.css).
The relative ordering of two user or two agent sheets loaded via this API is undefined.
Sheets added via this API take effect on all documents, including already-loaded ones, immediately.
void loadAndRegisterSheet( in nsIURI sheetURI, in unsigned long type );
sheetURI
type
Check if a stylesheet has been registered
boolean sheetRegistered( in nsIURI sheetURI, in unsigned long type );
sheetURI
type
Returns true
if a style sheet at sheetURI
has previously been added to the list of style sheets specified by type
.
Remove the style sheet at sheetURI
from the list of style sheets specified by type
. The removal takes effect immediately, even for already-loaded documents.
void unregisterSheet( in nsIURI sheetURI, in unsigned long type );
sheetURI
type