Closed Bug 230651 Opened 21 years ago Closed 21 years ago

don't create new rule processors when enabling/disabling a style sheet

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

Attachments

(2 files)

We can eliminate the style set clearing its rule processors array (and
subsequent creation of new rule processors) for enabling/disabling style sheets
by calling ClearRuleCascades() from CSSStyleSheetImpl::SetEnabled().
Attached patch patchSplinter Review
Comment on attachment 138826 [details] [diff] [review]
patch

dbaron, can you r+sr?
Attachment #138826 - Flags: superreview?(dbaron)
Attachment #138826 - Flags: review?(dbaron)
Actually, if |mInner && mInner->mComplete| there is no need to clear the
cascades -- incomplete sheets won't be affecting anyone's style anyway.

With this change, is there still good reason to move sheets in and out of the
style set as their enabled state changes?  I guess with alternate sheets that's
still a win?
In what way do we move sheets in and out of the style set as their enabled state
changes?
Attachment #138826 - Flags: superreview?(dbaron)
Attachment #138826 - Flags: superreview?(bz-vacation)
Attachment #138826 - Flags: review?(dbaron)
Attachment #138826 - Flags: review+
See nsDocument::SetStyleSheetApplicableState
(http://lxr.mozilla.org/seamonkey/source/content/base/src/nsDocument.cpp#1500)

Also see the checks done in nsDocument::AddStyleSheet,
sDocument::InsertStyleSheetAt, and nsDocument::UpdateStyleSheets to not put
sheets that are not applicable in style sets (all those used to be just disabled
checks back before we had a concept of "applicable").
Comment on attachment 138826 [details] [diff] [review]
patch

sr=bzbarsky if the first paragraph of comment 3 is addressed.
Attachment #138826 - Flags: superreview?(bz-vacation) → superreview+
checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
I just realized.. this changed the SetEnabled code, but not SetDisabled.  That
needs to be changed too.

Reopening to make sure that happens.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch er, yeahSplinter Review
how about this

(note, i'm using explicit scope resolution to avoid the second function call
being virtual)
Attachment #139054 - Flags: superreview?(bz-vacation)
Attachment #139054 - Flags: review?(bz-vacation)
Comment on attachment 139054 [details] [diff] [review]
er, yeah

Looks reasonable (though in my tree the functions are subtly different, but I
can merge).
Attachment #139054 - Flags: superreview?(bz-vacation)
Attachment #139054 - Flags: superreview+
Attachment #139054 - Flags: review?(bz-vacation)
Attachment #139054 - Flags: review+
Checked in.
Status: REOPENED → RESOLVED
Closed: 21 years ago21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: