1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/nsIStyleSheetService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* interface for managing user and user-agent style sheets */ 1.10 + 1.11 +#include "nsISupports.idl" 1.12 + 1.13 +interface nsIURI; 1.14 + 1.15 +/* 1.16 + * nsIStyleSheetService allows extensions or embeddors to add to the 1.17 + * built-in list of user or agent style sheets. 1.18 + */ 1.19 + 1.20 +[scriptable, uuid(1f42a6a2-ab0a-45d4-8a96-396f58ea6c6d)] 1.21 +interface nsIStyleSheetService : nsISupports 1.22 +{ 1.23 + const unsigned long AGENT_SHEET = 0; 1.24 + const unsigned long USER_SHEET = 1; 1.25 + const unsigned long AUTHOR_SHEET = 2; 1.26 + 1.27 + /** 1.28 + * Synchronously loads a style sheet from |sheetURI| and adds it to the list 1.29 + * of user or agent style sheets. 1.30 + * 1.31 + * A user sheet loaded via this API will come before userContent.css and 1.32 + * userChrome.css in the cascade (so the rules in it will have lower 1.33 + * precedence than rules in those sheets). 1.34 + * 1.35 + * An agent sheet loaded via this API will come after ua.css in the cascade 1.36 + * (so the rules in it will have higher precedence than rules in ua.css). 1.37 + * 1.38 + * The relative ordering of two user or two agent sheets loaded via 1.39 + * this API is undefined. 1.40 + * 1.41 + * Sheets added via this API take effect on all documents, including 1.42 + * already-loaded ones, immediately. 1.43 + */ 1.44 + void loadAndRegisterSheet(in nsIURI sheetURI, in unsigned long type); 1.45 + 1.46 + /** 1.47 + * Returns true if a style sheet at |sheetURI| has previously been 1.48 + * added to the list of style sheets specified by |type|. 1.49 + */ 1.50 + boolean sheetRegistered(in nsIURI sheetURI, in unsigned long type); 1.51 + 1.52 + /** 1.53 + * Remove the style sheet at |sheetURI| from the list of style sheets 1.54 + * specified by |type|. The removal takes effect immediately, even for 1.55 + * already-loaded documents. 1.56 + */ 1.57 + void unregisterSheet(in nsIURI sheetURI, in unsigned long type); 1.58 +};