RESOLVED FIXED 15986
Dynamically inserting CSS rule with @media query fails with DOM Exception 12
https://bugs.webkit.org/show_bug.cgi?id=15986
Summary Dynamically inserting CSS rule with @media query fails with DOM Exception 12
David Kilzer (:ddkilzer)
Reported 2007-11-14 08:55:57 PST
* 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.
Attachments
Test case (599 bytes, text/html)
2007-11-14 08:57 PST, David Kilzer (:ddkilzer)
no flags
Static test case (works) (197 bytes, text/html)
2007-11-14 08:57 PST, David Kilzer (:ddkilzer)
no flags
Patch v1 (5.64 KB, patch)
2008-01-03 16:56 PST, David Kilzer (:ddkilzer)
darin: review+
David Kilzer (:ddkilzer)
Comment 1 2007-11-14 08:57:06 PST
Created attachment 17269 [details] Test case
David Kilzer (:ddkilzer)
Comment 2 2007-11-14 08:57:52 PST
Created attachment 17270 [details] Static test case (works)
David Kilzer (:ddkilzer)
Comment 3 2008-01-03 16:56:14 PST
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.
Darin Adler
Comment 4 2008-01-03 17:08:01 PST
Comment on attachment 18256 [details] Patch v1 r=me Does this match other browsers?
David Kilzer (:ddkilzer)
Comment 5 2008-01-03 18:26:44 PST
(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.
Eric Seidel (no email)
Comment 6 2008-01-10 18:47:38 PST
Did this land?
David Kilzer (:ddkilzer)
Comment 7 2008-01-10 19:05:56 PST
(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().
Eric Seidel (no email)
Comment 8 2008-03-03 11:17:24 PST
WildFox just ran into this while trying to create a nice test case for Acid3 Test 77... We'd love to see this land. :)
David Kilzer (:ddkilzer)
Comment 9 2008-03-03 11:29:24 PST
Working on it now!
David Kilzer (:ddkilzer)
Comment 10 2008-03-03 11:46:13 PST
Committed revision 30715.
Eric Seidel (no email)
Comment 11 2008-03-03 13:05:27 PST
Thank you David!
Note You need to log in before you can comment on or make changes to this bug.