Closed
Bug 113098
Opened 24 years ago
Closed 24 years ago
lazy calls to parentContext->GetStyleData
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla0.9.9
People
(Reporter: dbaron, Assigned: dbaron)
Details
(Whiteboard: [whitebox])
Attachments
(1 file, 2 obsolete files)
|
30.98 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
In bug 111815 I removed the last vestiges of having lazy calls to
parentContext->GetStyleData in the nsRuleNode::Compute*Data functions. I think
we should make this lazy, and the easy way to do that would be to add two new
eRuleDetail values -- eRuleFullReset and eRulePartialReset. This probably would
give some space savings.
| Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla0.9.8
| Assignee | ||
Comment 1•24 years ago
|
||
| Assignee | ||
Comment 2•24 years ago
|
||
I think we could use a little more |detail == eRuleNone| optimization too (for
the case where we don't have a start struct or do have a post-resolve callback.
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.8 → mozilla0.9.7
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.7 → mozilla0.9.8
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.8 → mozilla0.9.9
| Assignee | ||
Comment 3•24 years ago
|
||
This also adds a little nsStyleContext cleanup and the renaming of the hated
mInheritBits to mDependentBits.
| Assignee | ||
Comment 4•24 years ago
|
||
Attachment #60066 -
Attachment is obsolete: true
Attachment #65377 -
Attachment is obsolete: true
Comment 5•24 years ago
|
||
sr=hyatt.
| Assignee | ||
Comment 6•24 years ago
|
||
I should change
// XXXldb What about eRuleFullInherited?
to
// XXXldb What about eRuleFullInherited? (Which is faster?)
| Assignee | ||
Comment 7•24 years ago
|
||
For the record, here's a summary of what this patch does:
This patch restores an optimization that I removed in the patch to
bug 111815 by adding a few new values to the ruledetail. The
optimization is that we can avoid calling GetStyleData all the way up
the style context tree in some cases (particularly for reset structs),
and we may never need the data -- for example, we may only care about
the TextReset struct for leaf and near-leaf frames. This should be a
bit of a space savings and time savings.
It also renames the confusing nsRuleNode::mInheritBits to mDependentBits
(while leaving nsStyleContext::mBits, which is really (mostly) about
inheritance, unlike nsRuleNode::mDependentBits).
Finally, it uses none bits in a really minor case where they weren't
used before, namely if there is one rule node that has a rule that
causes something to be specified, and then a rule node that is a
descendent from it that explicitly specifies 'inherit' for that property
so that there's again nothing specified and we can completely inherit.
For example, given:
div { line-height: 3; }
div.special { line-height: inherit; }
the rule nodes associated with |div.special| and their descendants could
have none bits set (and will if nothing else in the text struct is
specified). This saves a needless struct copy (and the cost of computing
it) on all style contexts with one of the rule nodes that now gets none
bits.
Comment 8•24 years ago
|
||
Why are some rules using
+ if (parentContext &&
+ aRuleDetail != eRuleFullReset &&
+ aRuleDetail != eRulePartialReset &&
+ aRuleDetail != eRuleNone)
to determine whether to get the parent style date while others use
+ if (parentContext && aRuleDetail != eRuleFullReset)
? The first of this makes sense for the "textreset" and "uireset" rules but why
display, background, margin, border, padding, outline, and the like?
Alternately, why is "visibility" using the second pattern?
| Assignee | ||
Comment 9•24 years ago
|
||
The ones that use the former are the inherited structs -- the structs where the
properties are inherited by default ("Inherited: yes" in the spec). The ones
that use the latter are the reset structs, where none of the properties are
inherited by default.
| Assignee | ||
Comment 10•24 years ago
|
||
Except I got it backwards, but you get the point. Too many != are confusing. :-)
Comment 11•24 years ago
|
||
Comment on attachment 65380 [details] [diff] [review]
a few more tweaks
Ah. Makes perfect sense. :)
r=bzbarsky
Attachment #65380 -
Flags: review+
| Assignee | ||
Comment 12•24 years ago
|
||
Fix checked in, 2002-02-16 17:53 PST.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 13•24 years ago
|
||
I added one additional comment change that I just caught (where "inherit" was
used to refer to the mInheritBits meaning of inherit):
- return GetParentData(aSID); // We inherit. Just go up the rule tree and
return the first
- // cached struct we find.
+ return GetParentData(aSID); // We depend on an ancestor for this
+ // struct since the cached struct it has
+ // is also appropriate for this rule
+ // node. Just go up the rule tree and
+ // return the first cached struct we
+ // find.
| Assignee | ||
Comment 14•23 years ago
|
||
For the record, this caused bug 131454.
Updated•23 years ago
|
Whiteboard: [whitebox]
You need to log in
before you can comment on or make changes to this bug.
Description
•