The default bug view has changed. See this FAQ.

Provide Javascript Access to User Agent Style Sheets.

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
8 years ago
a year ago

People

(Reporter: John J. Barton, Unassigned)

Tracking

({helpwanted, student-project})

1.9.1 Branch
x86
Windows XP
helpwanted, student-project
Points:
---
Dependency tree / graph
Bug Flags:
wanted1.9.2 +

Firefox Tracking Flags

(status1.9.1 ?)

Details

(Whiteboard: [firebug-p2])

(Reporter)

Description

8 years ago
Firebug wants to apply the same workaround to User Agent Style sheets as we applied to page sheets in Bug 500365
	
Unfortunately we have no way to access the User Agent Sheets.

CSS editing is one of Firebug's top features and revealing the User Agent Sheets is a great way to help users understand CSS results. Currently editing User Agent sheets breaks Firefox, either making its UI fall apart or crash.

Firebug could try to implement read-only for the User Agent Sheet, but just then we will want the edit capability for Chromebug.
(Reporter)

Comment 1

8 years ago
Boris, please set blocking/wanting flags according to your estimate of how hard this would be to implement.
Whiteboard: [firebug-p1]
Probably pretty easy, actually, via nsIDOMWindowUtils.  Could add a method that just returns a non-live array of user or UA sheets.

If someone wants to implement, I'm happy to point you to the relevant pieces.
Keywords: helpwanted, student-project
Flags: wanted1.9.1.x?
Flags: blocking1.9.2?

Comment 3

8 years ago
Hi,
I've noticed this bug on http://blog.getfirebug.com/?p=265 and because I have some free time and I wanted to improve my C++ skills I see this as a great opportunity how to start.
I've currently have the latest trunk and prepared build environment so I'll start with it this night.
I have only question if there is any other what I need to know - but the previous post is pretty clear.
Regards,
Ondrej Donek
(Reporter)

Comment 4

8 years ago
You'll need test cases to succeed and test cases will illustrate the proposed API, so I encourage you to start there.

Comment 5

8 years ago
I would rather prefer having this exposed via nsIStyleSheetService - so that user stylesheets are exposed as well.
John wants access to both, I think.

That said, this needs to be done per-document, so I'm not sure hanging it off of nsIStyleSheetService is a good approach; you'd have to have an API on there that takes a document or something.
That's assuming I diagnosed John's problem correctly, of course.  I looked again, and we only clone the quirks sheet; the other user/ua sheets are used as-is (we used to clone them, though).  So I'm not quite sure whether the issue John's seeing would be fixed by touching those sheets....
(Reporter)

Comment 8

8 years ago
(In reply to comment #5)
> I would rather prefer having this exposed via nsIStyleSheetService - so that
> user stylesheets are exposed as well.

I can already get these from window.document.styleSheets.
No, you can get the document sheets.  User sheets are not in that collection.
Flags: blocking1.9.2? → wanted1.9.2+
status1.9.1: --- → ?
Flags: wanted1.9.1.x?
In order to make it ok for Firebug to mutate the UA sheets, we need to (1) ensure that the UA sheets get cloned in DocumentViewerImpl::CreateStyleSet or somewhere else and (2) ensure that they get unique inners before they're mutated (which bug 536379 should do for the get-style-rules case, and make it easy to do in other cases)
Blocks: 343508
Depends on: 536379
(Reporter)

Updated

7 years ago
Whiteboard: [firebug-p1] → [firebug-p2]
You need to log in before you can comment on or make changes to this bug.