RESOLVED DUPLICATE of bug 4402128195
Inline style wrapped in noscript not applied when added to the DOM via innerHTML
https://bugs.webkit.org/show_bug.cgi?id=28195
Summary Inline style wrapped in noscript not applied when added to the DOM via innerHTML
Jonathan Hohle
Reported 2009-08-11 15:37:57 PDT
Created attachment 34605 [details] HTML to reproduce issue. If an HTML fragment which contains an inline stylesheet and is wrapped in a noscript tag is added to the DOM by setting innerHTML on a DOM node in JavaScript, those styles are applied to the DOM. In my use case an external library is blindly copying HTML fragments which may have reuse elsewhere. Styles that are expected not to be applied when JavaScript is enabled are being applied due to this library using innerHTML to copy this HTML fragment. In other browsers this works as expected, but in Safari, the styles wrapped in noscript are applied causing undesired rendering. Expected behavior -------------- Styles wrapped in noscript should be ignored no matter how they are added to the DOM if JavaScript is enabled. Actual Behavior ------------ Styles wrapped in noscript added to the DOM via innerHTML are applied to the DOM. Styles wrapped in noscript are not applied if they are added to the DOM in an HTML file or via document.write Reproduction ---------- This has been reproduced in Safari 3.2.x, Safari 4.0.x, and with a current Webkit nightly. I've attached a minimal HTML file which illustrates the problem.
Attachments
HTML to reproduce issue. (605 bytes, text/html)
2009-08-11 15:37 PDT, Jonathan Hohle
no flags
Actual result when rendering the attached HTML. (41.10 KB, image/png)
2009-08-11 15:39 PDT, Jonathan Hohle
no flags
Expected result when rendering the attached HTML (39.97 KB, image/png)
2009-08-11 15:39 PDT, Jonathan Hohle
no flags
Jonathan Hohle
Comment 1 2009-08-11 15:39:00 PDT
Created attachment 34606 [details] Actual result when rendering the attached HTML.
Jonathan Hohle
Comment 2 2009-08-11 15:39:27 PDT
Created attachment 34607 [details] Expected result when rendering the attached HTML
Alexey Proskuryakov
Comment 3 2009-10-26 09:26:16 PDT
Confirmed with r49890.
Jonathan Hohle
Comment 4 2010-08-02 16:31:58 PDT
Still affects Safari 5.0 (6533.16)
Alexey Proskuryakov
Comment 5 2010-08-16 06:06:49 PDT
This is probably a root cause of bug 13522.
Alexey Proskuryakov
Comment 6 2010-08-16 06:07:23 PDT
But looking at more than its title, maybe not :)
Adam Barth
Comment 7 2010-08-17 21:36:48 PDT
It's the same bug. *** This bug has been marked as a duplicate of bug 44021 ***
Note You need to log in before you can comment on or make changes to this bug.