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)
Path: h9ni17694pbe.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From: sabine.michael.ratcli...@gmail.com
Newsgroups: mozilla.dev.apps.firefox
Subject: Re: Get all stylesheets (including UA sheets)?
Date: Mon, 12 Mar 2012 06:38:40 -0700 (PDT)
Organization: http://groups.google.com
Lines: 25
Message-ID: <13892162.1217.1331559520889.JavaMail.geo-discussion-forums@vbut24>
References: <ba8a732c-00e5-4667-9549-2a64034d91a7@p12g2000yqe.googlegroups.com>
<4F5DF427.10105@gmail.com>
NNTP-Posting-Host: 93.186.147.36
Mime-Version: 1.0
X-Trace: posting.google.com 1331559908 17081 127.0.0.1 (12 Mar 2012 13:45:08 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 12 Mar 2012 13:45:08 +0000 (UTC)
Cc: Mike Ratcliffe <sabine.michael.ratcli...@gmail.com>
In-Reply-To: <4F5DF427.10105@gmail.com>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=93.186.147.36;
posting-account=UoiDUQoAAABuOFL5WK_mBJ288gV91lWQ
User-Agent: G2/1.0
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).
>
> Cheers,
> Gijs
How did I miss that? Thanks ... https://bugzilla.mozilla.org/show_bug.cgi?id=734861.