Closed
Bug 529750
Opened 16 years ago
Closed 14 years ago
Move GetImportantRule to nsICSSStyleRule and make it nonvirtual
Categories
(Core :: CSS Parsing and Computation, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla7
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(5 files)
3.56 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
4.42 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
3.03 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
4.45 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
3.75 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
See bug 523148 comment 2.
![]() |
Assignee | |
Comment 1•16 years ago
|
||
Need to wait for bug 522595 to land before working on this.
Depends on: 522595
![]() |
Assignee | |
Updated•15 years ago
|
Priority: -- → P2
![]() |
Assignee | |
Updated•15 years ago
|
Priority: P2 → P3
![]() |
Assignee | |
Updated•15 years ago
|
Priority: P3 → P1
![]() |
Assignee | |
Comment 2•14 years ago
|
||
One thing to keep track of, from bug 5231348:
There are some UA-level rules that are not in fact nsICSSStyleRule (e.g. the
restriction rules for first-letter and first-line).
![]() |
Assignee | |
Comment 3•14 years ago
|
||
Attachment #530778 -
Flags: review?(dbaron)
![]() |
Assignee | |
Comment 4•14 years ago
|
||
Attachment #530779 -
Flags: review?(dbaron)
![]() |
Assignee | |
Comment 5•14 years ago
|
||
Attachment #530780 -
Flags: review?(dbaron)
![]() |
Assignee | |
Comment 6•14 years ago
|
||
Attachment #530781 -
Flags: review?(dbaron)
![]() |
Assignee | |
Updated•14 years ago
|
Whiteboard: [need review]
Comment on attachment 530778 [details] [diff] [review]
part 1. Don't walk non-CSS UA rules when checking for important UA rules.
You should AssertNoCSSRules between lastRestrictionRN and mRuleTree.
r=dbaron with that
Attachment #530778 -
Flags: review?(dbaron) → review+
Comment on attachment 530779 [details] [diff] [review]
part 2. Assume that in AssertNoImportantRules and AddImportantRules the rule is a StyleRule.
>+#ifdef DEBUG
>+ nsRefPtr<css::StyleRule> cssRule(do_QueryObject(node->GetRule()));
>+ NS_ASSERTION(cssRule, "Unexpected non-CSS rule");
>+#endif
If we haven't broken the ability to do it, I'd prefer (no ifdefs):
+ NS_ASSERTION(nsRefPtr<css::StyleRule>(do_QueryObject(node->GetRule())),
+ "Unexpected non-CSS rule");
r=dbaron with that
Attachment #530779 -
Flags: review?(dbaron) → review+
Comment on attachment 530780 [details] [diff] [review]
part 3. Switch nsRuleWalker to only calling GetImportantRule on CSS StyleRules.
Instead of having one overload of forward call the other, could you
have both call a DoForward() method, and then have
Forward(nsIStyleRule*) assert that its argument is not a
css::StyleRule (to prevent the same mistake you had to fix earlier
in the patch)?
r=dbaron with that
Attachment #530780 -
Flags: review?(dbaron) → review+
Comment on attachment 530781 [details] [diff] [review]
part 4. Move GetImportantRule to css::StyleRule.
r=dbaron
Attachment #530781 -
Flags: review?(dbaron) → review+
![]() |
Assignee | |
Comment 11•14 years ago
|
||
> You should AssertNoCSSRules between lastRestrictionRN and mRuleTree.
Done.
>+ NS_ASSERTION(nsRefPtr<css::StyleRule>(do_QueryObject(node->GetRule())),
>+ "Unexpected non-CSS rule");
Done.
> could you have both call a DoForward() method, and then have
> Forward(nsIStyleRule*) assert
Done.
![]() |
Assignee | |
Comment 12•14 years ago
|
||
So adding that assert made tests fail because ResolveStyleByAddingRules() passes in a nsCOMArray<nsIStyleRule> &aRules.
And StyleWithDeclarationAdded calls ResolveStyleByAddingRules and passes in an array containing a single StyleRule. Other callers pass non-style rules here.
![]() |
Assignee | |
Comment 13•14 years ago
|
||
I disabled that assert for now. Please let me know if you'd prefer some other solution.
![]() |
Assignee | |
Comment 14•14 years ago
|
||
David, see comment 12 and comment 13.
![]() |
Assignee | |
Comment 15•14 years ago
|
||
Pushed to cedar:
http://hg.mozilla.org/projects/cedar/rev/957089411310
http://hg.mozilla.org/projects/cedar/rev/05e6b77b99c4
http://hg.mozilla.org/projects/cedar/rev/a5cfc3f56f62
http://hg.mozilla.org/projects/cedar/rev/99cff4d7f934
and then fixed test orange per comment 12 and comment 13: http://hg.mozilla.org/projects/cedar/rev/e0580e4f3825
Flags: in-testsuite-
Whiteboard: [need review] → fixed-in-cedar
Target Milestone: --- → mozilla6
![]() |
Assignee | |
Updated•14 years ago
|
Target Milestone: mozilla6 → mozilla7
The other solution would be to add a third Forward() method (ForwardOnPossiblyCSSRule) that doesn't have the assert. I'd sort of prefer that...
![]() |
Assignee | |
Comment 17•14 years ago
|
||
I can do that.
![]() |
Assignee | |
Comment 18•14 years ago
|
||
Attachment #534669 -
Flags: review?(dbaron)
Comment 19•14 years ago
|
||
Merged all parts from Cedar to mozilla-central:
http://hg.mozilla.org/mozilla-central/pushloghtml?changeset=e0580e4f3825
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: fixed-in-cedar
Comment on attachment 534669 [details] [diff] [review]
followup; reenable the assertion.
>+ void ForwardOnPossiblyCSSRule(nsIStyleRule* aRule) {
>+ DoForward(aRule);
>+ }
Add a comment that callers should only use this when they have a list of rules that already has the important rules in it?
r=dbaron with that
Attachment #534669 -
Flags: review?(dbaron) → review+
![]() |
Assignee | |
Comment 21•14 years ago
|
||
Done, and pushed http://hg.mozilla.org/projects/cedar/rev/db398bf9cffe with that.
Comment 22•14 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•