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)

defect

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.
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → Future
Blocks: 167496
Note that the rules also should be immutable to satisfy the contract of the nsIStyleRule interface (bug 188803).
Blocks: 211114
Depends on: 43178
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.