Message from discussion Get all stylesheets (including UA sheets)?
Received: by 10.68.220.229 with SMTP id pz5mr953731pbc.5.1331559910464;
Mon, 12 Mar 2012 06:45:10 -0700 (PDT)
Subject: Re: Get all stylesheets (including UA sheets)?
Date: Mon, 12 Mar 2012 06:38:40 -0700 (PDT)
X-Trace: posting.google.com 1331559908 17081 127.0.0.1 (12 Mar 2012 13:45:08 GMT)
NNTP-Posting-Date: Mon, 12 Mar 2012 13:45:08 +0000 (UTC)
Cc: Mike Ratcliffe <sabine.michael.ratcli...@gmail.com>
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=184.108.40.206;
Content-Type: text/plain; charset=ISO-8859-1
On Monday, 12 March 2012 13:03:35 UTC, Gijs Kruitbosch wrote:
> On 12/03/2012 13:31 PM, Mike Ratcliffe wrote:
> > Do we not have a way to list all stylesheets (including UA sheets)
> > used by a document? I could use domUtils.getCSSStyleRules() on every
> > element on the page, iterate the rules and gather the stylesheets that
> > way, but that seems like an awful hack.
> > I am sure that there is something obvious but my Monday brain just
> > ain't finding it :o/
> (disclaimer: very unfamiliar with layout, but this was a fun excuse to poke
> around MXR)
> You mean in JS or an external component? Because it seems you can ask
> nsStylesheetService, but not nsIStylesheetService. In other words, if you're
> inside layout, you could directly ask the component, but it isn't exposing that
> info via its IDL, as far as I can tell, and it looks like UA ones aren't
> included in document.styleSheets. Perhaps nsIStylesheetService could be made to
> include this? I don't see a reason not to expose it (and many reasons why it may
> be useful).
How did I miss that? Thanks ... https://bugzilla.mozilla.org/show_bug.cgi?id=734861.