[Webkit-unassigned] [Bug 28195] New: Inline style wrapped in noscript not applied when added to the DOM via innerHTML

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 11 15:37:58 PDT 2009


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

           Summary: Inline style wrapped in noscript not applied when
                    added to the DOM via innerHTML
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: hohle at amazon.com
                CC: hohle at amazon.com


Created an attachment (id=34605)
 --> (https://bugs.webkit.org/attachment.cgi?id=34605)
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.

-- 
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