Closed
Bug 305026
Opened 20 years ago
Closed 20 years ago
[FIXr]Document how calls on nsIStyleSheetService interact with userContent.css
Categories
(Core :: Layout, defect, P1)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla1.8beta4
People
(Reporter: sfraser_bugs, Assigned: bzbarsky)
References
Details
(Keywords: fixed1.8)
Attachments
(1 file, 2 obsolete files)
|
5.08 KB,
patch
|
asa
:
approval1.8b4+
|
Details | Diff | Splinter Review |
When loading stylesheets (e.g. for ad blocking) via nsIStyleSheetService, it's
unclear how they will interact with userContent.css. Specifically, it's unclear
whether rules in the dynamically-loaded stylesheet will override those in
userContent.css, or whether it depends on which was loaded last.
| Assignee | ||
Comment 1•20 years ago
|
||
The nsStyleSet.h change just makes the docs match the code change made in bug
252578
Attachment #193183 -
Flags: superreview?(dbaron)
Attachment #193183 -
Flags: review?(dbaron)
Comment on attachment 193183 [details] [diff] [review]
Documentation
r+sr=dbaron, except I think the comment that you're changing in nsStyleSet.h
was actually a comment describing the ordering of the arrays within
mRuleProcessors, which was *removed* in bug 252578. I think the comment should
say "Levels of the cascade, from least significant to most". The use of "All"
seems incorrect.
Attachment #193183 -
Flags: superreview?(dbaron)
Attachment #193183 -
Flags: superreview+
Attachment #193183 -
Flags: review?(dbaron)
Attachment #193183 -
Flags: review+
...except that wording on significance is backward for !important, so I'd say:
// The "origins" of the CSS cascade, from lowest precedence to highest (for
// non-!important rules).
| Reporter | ||
Comment 4•20 years ago
|
||
If I'm reading this right, rules in userContent.css will be clobbered by rules
in sheets loaded via nsIStyleSheetService (is this true for !important rules
too?). This is unfortunate, since it prevents the user from overriding rules in
an application-provided stylesheet with rules in their user-editable stylesheet
(i.e. the user no longer has ultimate control).
| Assignee | ||
Comment 5•20 years ago
|
||
> (is this true for !important rules too?).
!important rules in userContent.css will be overridden by !important rules
loaded via the stylesheet service if the selectors ahve the same specificity.
I see no problem with putting userContent.css after the nsIStyleSheetService
sheets for the user level (though I still think that they should come after
ua.css for the UA leve). David, Brian, what do you think?
| Assignee | ||
Comment 6•20 years ago
|
||
This addresses the comments, and I changed the relative ordering of
userChrome/Content.css and the sheets added via this API; I think Simon makes a
good argument for having userChrome/Content.css be last.
Attachment #193209 -
Flags: superreview?(dbaron)
Attachment #193209 -
Flags: review?(dbaron)
| Assignee | ||
Comment 7•20 years ago
|
||
Oh, I'm going to add another sentence or two saying that relative ordering of
sheets added via this API is undefined.
Comment on attachment 193209 [details] [diff] [review]
With those changes
>- sheetService->UserStyleSheets()->EnumerateForwards(AppendUserSheet,
>+ sheetService->UserStyleSheets()->EnumerateForwards(PrependUserSheet,
why not make this EnumerateBackwards and not have the relative ordering be
undefined?
| Assignee | ||
Comment 9•20 years ago
|
||
Because then I'd have to document that the relative ordering is dependent on the
order of sheet registration and I'm not really happy doing that. Especially
because right now that's only true because of the data storage we're using
internally (an array).
| Reporter | ||
Comment 10•20 years ago
|
||
I don't suppose this would get onto the 1.8 branch, would it? Camino is using
nsIStyleSheetService for ad blocking, and it would be cool if they could disable
certain ad blocking rules via userContent.css.
| Assignee | ||
Comment 11•20 years ago
|
||
If that gets reviewed, I plan to try and land it on branch...
Comment on attachment 193209 [details] [diff] [review]
With those changes
OK, but could you change it to EnumerateBackwards anyway? Somebody might
accidentally start depending on current behavior, and if so, I'd at least like
to have them depend on something that's consistent.
Attachment #193209 -
Flags: superreview?(dbaron)
Attachment #193209 -
Flags: superreview+
Attachment #193209 -
Flags: review?(dbaron)
Attachment #193209 -
Flags: review+
| Assignee | ||
Comment 13•20 years ago
|
||
This is very safe and makes this API easier to use (and documents it better).
Assignee: nobody → bzbarsky
Attachment #193183 -
Attachment is obsolete: true
Attachment #193209 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #193231 -
Flags: approval1.8b4?
| Assignee | ||
Updated•20 years ago
|
Priority: -- → P1
Summary: Document how calls on nsIStyleSheetService interact with userContent.css → [FIXr]Document how calls on nsIStyleSheetService interact with userContent.css
Target Milestone: --- → mozilla1.8beta4
| Assignee | ||
Comment 14•20 years ago
|
||
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Flags: blocking1.8b4+
Updated•20 years ago
|
Attachment #193231 -
Flags: approval1.8b4? → approval1.8b4+
Updated•7 years ago
|
Product: Core → Core Graveyard
Updated•7 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•