Closed
Bug 144899
Opened 23 years ago
Closed 15 years ago
nsHTMLStyleSheet table rules code looks inefficient
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
Future
People
(Reporter: dbaron, Unassigned)
References
Details
I just noticed all the code in nsHTMLStyleSheet that was added for bug 41262.
This code does a bunch of things less efficiently than it should be:
* it looks to me like it prevents any table style data from being cached in the
rule tree, even when the rules attribute is not present
* it does stuff in the post resolve callback that really should be done earlier
so that it doesn't mess up the cascade
I suspect that what should be done here is:
* rather than mapping the "rules" attribute into style on the table's style
context, do a GetAttribute on the table in RulesMatching and add the appropriate
rule(s) only if needed.
* rather than using a single rule object, create one rule object for each table
element that has a "rules" attribute (or whatever attributes are currently being
mapped into tableData->mRules, and either cache this straight on the table
element or use a hashtable. This allows us to get the benefits of the rule tree
even when the rules are needed.
* Do the work normal MapRuleInfoInto phase rather than the post resolve callback.
Reporter | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → Future
Reporter | ||
Comment 1•21 years ago
|
||
Note that the rules also should be immutable to satisfy the contract of the
nsIStyleRule interface (bug 188803).
Reporter | ||
Updated•18 years ago
|
Assignee: dbaron → nobody
Status: ASSIGNED → NEW
QA Contact: ian → style-system
the code is question got removed in bug 43178
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•