Closed Bug 75559 Opened 24 years ago Closed 21 years ago

Style re-resolution due to content state changes needs to be optimized

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED WONTFIX
Future

People

(Reporter: attinasi, Assigned: dbaron)

References

()

Details

(Keywords: perf, Whiteboard: [Hixie-P2] (major performance problem once we remove the hack workaround))

When some piece of content has a state change we currently resolve all style for
that element and all of its children. This is terribly inefficient, and causes
incredible performance problems when rules like '*:active' are present because
any state change ends up re applying ALL rules on potentially all elements (if
the BODY or root element is the one who's state is changing). A smarter approach
would be to simply re-apply the style rules that have dynamic pseudos in them,
as these are the only ones that can change when a content state change happens.
Even better would be to restrict it to rules that have a specific dynamic
pseudo, like the :active when a content state change for 'active' happens, or
:hover when a content state for hover happens.

The hack put in for bug 58821 can then be removed, allowing a wider application
of the dynamic pseudos without suffering from abysmal performance.
CC self, perf keyword and nominating for 0.9.1, 1.0, since we wouldn't want to
forget about this for too long :)
cc'ing hyatt since :active, :hover and :focus (and later :disabled, :enabled,
:checked, :selected, and what not) are things that I believe interest him. ;-)
Whiteboard: [Hixie-P3]
Whiteboard: [Hixie-P3] → [Hixie-P2] (major performance problem once we remove the hack workaround)
Adding the URL from the old bug - Ian, please don't remove that page!

Also, setting milestone to Moz 1.0 for now - far too many 0.9.1 bugs on my lap
already, and this one does not crash or hang or corrupt data ;)
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla1.0
Depends on: 78695
I wonder if this was fixed with the RuleTree landing...
Reassigning to Pierre
Assignee: attinasi → pierre
Status: ASSIGNED → NEW
Target Milestone: mozilla1.0 → mozilla1.0.1
Wouldn't this be a perfect 1.0 candidate?
Bulk moving Mozilla1.01 bugs to future-P1
Priority: P2 → P1
Target Milestone: mozilla1.0.1 → Future
*** Bug 132598 has been marked as a duplicate of this bug. ***
My patch in bug 5693 has some optimizations -- it makes HasStateDependentStyle
state-specific.

Bug 96984 is about removing the hack.
Blocks: 96984
See also bug 137395, which is a bug that we should try to fix when we consider a
better way to optimize this.
cc'ing myself
Blocks: 149216
Assigning pierre's remaining Style System-related bugs to myself.
Assignee: pierre → dbaron
Priority: P1 → P3
Keywords: mozilla1.0mozilla1.4
So now that we have HasStateDependentStyle, is this still an issue?
Blocks: 203448
No.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.