[Webkit-unassigned] [Bug 17848] New: CSS caching corruption

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 14 09:25:07 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=17848

           Summary: CSS caching corruption
           Product: WebKit
           Version: 525+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: hartman at videolan.org


This is a very complicated bug. I encountered this issue when using the
javascript tool twinkle on Wikipedia. The tool gives you extra tabs, that open
tools in a CSS window. After finishing the "job", the tool redirects you to the
original page you visited.

Website of the tool:
http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/Twinkle

In Safari 3 (and the NB), I was experiencing a problem where after the
redirect, my page was only showing the background image. 
Screenshot: http://deneb.student.utwente.nl/~hartman/weird%20issue.png

It appeared as if all my CSS styling was down the drain somehow. If I opened
other Wikipedia pages on other tabs or windows the problem persisted. I had to
force a reload to make the issue disappear. I believe it was reproducible with
this webarchive:
http://deneb.student.utwente.nl/~hartman/wikipedia/saferversion.webarchive

I have now looked further into this issue. It was very hard to reduce what was
causing this. However I think i have now traced the issue.
Making the following changes in the javascript tool fixed the problem for me:
http://en.wikipedia.org/w/index.php?title=User%3ATheDJ%2Fmorebits.js&diff=198208031&oldid=197808959

Basically I changed

var cssNode = document.createElement('style');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.appendChild( document.createTextNode("")); // Safari bugfix 
document.getElementsByTagName("head")[0].appendChild(cssNode);
var styles = cssNode.sheet ? cssNode.sheet : cssNode.stylesSheet;
styles.insertRule("my line of CSS", 0);
styles.insertRule("another line of CSS", 0);

to 

var cssNode = document.createElement('style');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.appendChild( document.createTextNode("myCSS" ));
document.getElementsByTagName("head")[0].appendChild(cssNode);


So it seems that DOM editing and then using insertRule() breaks something that,
as far as I know it should not break. As you may note in the original code
there is a reference to a Safari bugfix. This would be bug #14462. It might be
related in some way, but I'm not sure.


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



More information about the webkit-unassigned mailing list