[Webkit-unassigned] [Bug 60155] New: createContextualFragment does not work with <style>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 4 03:59:38 PDT 2011


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

           Summary: createContextualFragment does not work with <style>
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Gtk
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: xclaesse at gmail.com


I'm trying to add support for Adium chat themes in Empathy using Webkit GTK. One of the JS function in the theme's HTML fails when running in webkit GTK but I guess it's working fine with webkit on MacOS:

        function setStylesheet( id, url ) {
            var code = "<style id=\"" + id + "\" type=\"text/css\" media=\"screen,print\">";
            if( url.length ) 
                code += "@import url( \"" + url + "\" );";
            code += "</style>";
            var range = document.createRange();
            var head = document.getElementsByTagName( "head" ).item(0);
            range.selectNode( head );
            var documentFragment = range.createContextualFragment( code );
            head.removeChild( document.getElementById( id ) );
            head.appendChild( documentFragment );
        }

When debugging, I've found that documentFragment's childNodes is empty. However if I do s/style/div/ in the above function, documentFragment's childNodes correctly contains a one HTMLDivElement.

So I came to the conclusion that createContextualFragment("<style></style>") is broken in webkit-gtk.

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