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.
Created attachment 34606 [details] Actual result when rendering the attached HTML.
Created attachment 34607 [details] Expected result when rendering the attached HTML
Confirmed with r49890.
Still affects Safari 5.0 (6533.16)
This is probably a root cause of bug 13522.
But looking at more than its title, maybe not :)
It's the same bug. *** This bug has been marked as a duplicate of bug 44021 ***