[Webkit-unassigned] [Bug 15648] It is not possible to modify the innerHTML of a HEAD element

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Nov 28 07:59:40 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=15648


David Gatwood <dgatwood at mac.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dgatwood at mac.com




--- Comment #1 from David Gatwood <dgatwood at mac.com>  2009-11-28 07:59:39 PST ---

It's far worse than that.  It is not possible to even add elements into the
HEAD tag programmatically unless there is already at least one element inside
that tag, AFAICT.

Steps to reproduce:

* Create an iframe element in the HTML.
* Populate the iframe by setting iframeelt.contentDocument.body.innerHTML =
"...."
* Set var elt = iframeelt.contentDocument.getElementsByTagName('head')[0];
* Note that the head element was correctly created implicitly.
* Try to add stuff to elt.
* Observe the DOM error 7 (NO_MODIFICATION_ALLOWED_ERR).

Also tried various other ways of loading the content, including putting a HEAD
tag in the BODY, putting the LINK tags in the body where they should have been
automatically moved into the HEAD, etc.  Nothing worked.

This behavior makes it much, much more difficult to write any code that uses
iframes and apply CSS styles to the content.  Combine that with 31951 and it
forced some really ugly workarounds.  I eventually gave up and used the src
attribute to load a real HTML file that contained a HEAD element with the tags
I needed inside it, then blowing out the BODY.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list