Bug 22356

Summary: background image doesn't show in a popup
Product: WebKit Reporter: zimekzimny <t.chomiuk>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Critical CC: barraclough
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
image
none
dummy
none
test none

Description zimekzimny 2008-11-19 09:14:56 PST
file1: dummy.html (empty file)
file2: image.png (any image)
file3: test.html
<html>
<head>
        <script type="text/javascript">
        var win;
        var image = 'image.png';

        function set_popup_background()
        {
                win.document.body.style.backgroundImage = "url(\'" + image + "\')";

                return true;
        }

        function popup()
        {       
                win = window.open('dummy.html', 'test', 'width=250, height=200, toolbar=no, resizable=no, scrollbars=no');

                var img = new Image();
                img.src = image;
                img.onload = set_popup_background;
        }
        </script>
</head>
<body>  
        <a href="#" onClick="javascript: popup();">popup</a>
</body>
</html>

---
To reproduce:
1) Put all the files in the same folder.
2) Open test.html with any webkit browser
3) Click on the 'popup' link (popup window opens with the background picture set just fine)
4) Close the popup box
5) Click on the same link (popup window opens but no background set)

I've tested it on Opera(linux) and Safari(win XP). FF and IE browsers work fine.
Comment 1 zimekzimny 2008-11-19 09:17:07 PST
Created attachment 25272 [details]
image
Comment 2 zimekzimny 2008-11-19 09:18:37 PST
Created attachment 25274 [details]
dummy
Comment 3 zimekzimny 2008-11-19 09:19:27 PST
Created attachment 25275 [details]
test
Comment 4 Gavin Barraclough 2011-06-16 15:25:44 PDT
Works for me, please reopen if this still repros for you.