Bug 5478 - Dynamically adding <style> element outside of <head> fails to change style
Summary: Dynamically adding <style> element outside of <head> fails to change style
Status: RESOLVED DUPLICATE of bug 5476
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Geoffrey Garen
URL: http://projects.backbase.com/SafariBu...
Keywords: InRadar
Depends on:
Blocks: 6628
  Show dependency treegraph
 
Reported: 2005-10-24 07:53 PDT by Sjoerd Mulder
Modified: 2008-04-25 08:59 PDT (History)
1 user (show)

See Also:


Attachments
local copy of test case (1.04 KB, text/html)
2005-11-04 07:32 PST, Darin Adler
no flags Details
Workaround - append to head element (1.01 KB, text/html)
2005-11-04 08:03 PST, Mark Malone
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sjoerd Mulder 2005-10-24 07:53:15 PDT
At Backbase we are trying to write support for Safari but we found the 
following bug:

If you try to add a <style> tag dynamicly anywhere inside the DOM-tree 
throught createElement Safari does nothing (2.x and ToT).

I tried different methods / attributes, they all seem to do nothing.
innerHTML gives a strange Expection 7

The testcase fails in IE because it wasnt build for it (we got another 
solution).

Mozilla Firefox and Opera are working as supposed with the testcase
Comment 1 Sjoerd Mulder 2005-10-25 01:32:16 PDT
Changed severity to critical because this bug prevents development of any kind
of          Ajax applications
Comment 2 Darin Adler 2005-11-04 07:29:57 PST
This is a high priority bug to fix, and we should also look for a workaround that the backbase folks can 
take advantage of.
Comment 3 Darin Adler 2005-11-04 07:32:12 PST
Created attachment 4590 [details]
local copy of test case
Comment 4 Mark Malone 2005-11-04 08:03:09 PST
Created attachment 4591 [details]
Workaround - append to head element

Style elements created with createElement and appended to the document head
works as required. This appears to only be an issue when appending style
information to the body.
Comment 5 Darin Adler 2005-11-04 08:16:18 PST
Great! We have a workaround.

Since style elements are supposed to be in the head, I think it's probably a good workaround.
Comment 6 Darin Adler 2005-11-04 08:36:31 PST
Given the workaround, downgrading "severity".
Comment 7 Sjoerd Mulder 2006-02-03 00:36:33 PST
This bug is also in Radar: <rdar://4327493>
Comment 8 Tim Omernick 2006-03-15 02:05:44 PST
The patch I attached to 5476 also fixes this bug.  If the patch (or a similar one which also fixes this bug) is accepted, then this bug should be marked as a duplicate of 5476.
Comment 9 Dave Hyatt 2008-04-25 08:59:46 PDT

*** This bug has been marked as a duplicate of 5476 ***