* SUMMARY Dynamically inserting a CSS rule with an @media query fails with DOM Exception 12. The same rule in a static stylesheet is valid and is applied correctly. * STEPS TO REPRODUCE 1. Open test case in Safari/WebKit. * RESULTS Test fails. * REGRESSION Not a regression as Safari 2.0.4 (419.3) with original WebKit fails with a "TypeError - Null value" exception. * NOTES Opera 9.22 works. Firefox 2.0.0.9 and 3.0b2 (today's download) both also fail.
Created attachment 17269 [details] Test case
Created attachment 17270 [details] Static test case (works)
Created attachment 18256 [details] Patch v1 Proposed fix. If you'd prefer a test for @page that expects an exception to be thrown, let me know.
Comment on attachment 18256 [details] Patch v1 r=me Does this match other browsers?
(In reply to comment #4) > Does this match other browsers? Regarding @font-face: Opera 9.2x and Firefox 2.0.0.x don't implement it yet. Regarding @media: It matches Opera 9.2x. Firefox 2.0.0.x doesn't implement @media yet. Will try @page with Opera and Firefox before landing. Will try all three with MSIE 7 as well.
Did this land?
(In reply to comment #6) > Did this land? Not yet. Was waiting to do some testing on other browsers first. Regardless, without this feature, it's not possible to add @media, @page or @font-face rules individually using insertRule().
WildFox just ran into this while trying to create a nice test case for Acid3 Test 77... We'd love to see this land. :)
Working on it now!
Committed revision 30715.
Thank you David!