Bug 22356 - background image doesn't show in a popup
Summary: background image doesn't show in a popup
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Critical
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-19 09:14 PST by zimekzimny
Modified: 2011-06-16 15:25 PDT (History)
1 user (show)

See Also:


Attachments
image (13.35 KB, image/png)
2008-11-19 09:17 PST, zimekzimny
no flags Details
dummy (2 bytes, text/html)
2008-11-19 09:18 PST, zimekzimny
no flags Details
test (535 bytes, text/html)
2008-11-19 09:19 PST, zimekzimny
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.