allow CSSGroupingRule.insertRule to insert non-style rules

RESOLVED FIXED in mozilla20

Status

()

Core
DOM: CSS Object Model
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: heycam, Assigned: heycam)

Tracking

(Blocks: 1 bug)

Trunk
mozilla20
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Currently CSSGroupingRule.insertRule only accepts a style rule.
Created 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 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
Last Resolved: 5 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.