Closed Bug 816720 Opened 12 years ago Closed 12 years ago

allow CSSGroupingRule.insertRule to insert non-style rules

Categories

(Core :: DOM: CSS Object Model, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: heycam, Assigned: heycam)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Currently CSSGroupingRule.insertRule only accepts a style rule.
Attached patch patchSplinter Review
If you have any good ideas about how I might test for whether the @page and @font-face rules were applied when inserted into a passing conditional rule, I can update the test.
Attachment #686797 - Flags: review?(bzbarsky)
Comment on attachment 686797 [details] [diff] [review]
patch

> If you have any good ideas about how I might test for whether the @page and @font-face
> rules were applied 

For @font-face you might be able to detect font metrics via getBoundingClientRect or something?  No idea about @page.

As for the patch itself, do we want a whitelist here, or a blacklist of @namespace and @import?

r=me if you at least add an assert that the type is one of those two if it's not in your whitelist.
Attachment #686797 - Flags: review?(bzbarsky) → review+
I was going for a white list; I'll add an assertion.
(Commit message should be s/CSSRule/CSSGroupingRule/ but oh well.)
https://hg.mozilla.org/mozilla-central/rev/447dff867909
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.