Bug 15161 - Box shadow clipped on elements created through DOM
Summary: Box shadow clipped on elements created through DOM
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac (Intel) OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-08 08:53 PDT by Alexander Staubo
Modified: 2007-09-08 08:54 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Staubo 2007-09-08 08:53:40 PDT
If I create an element dynamically using the DOM, the shadow gets clipped initially until the next time the page is rendered, eg. by resizing the window. Sample code:

    var e = document.createElement("div");
    e.setAttribute("style", "-webkit-border-radius: 20px; -webkit-box-shadow: 10px 10px 20px rgba(0, 100, 255, 0.8);");
    e.style.position = "absolute";
    e.style.border = "solid 3px green";
    e.style.top = "100px";
    e.style.left = "100px";
    e.style.width = "100px";
    e.style.height = "100px";
    e.style.background = "#fff";
    e.id = "foo";
    document.documentElement.appendChild(e);

I am including a border radius here because it demonstrates how this is probably a redraw region problem. Without the  rounded border, the shadow is not shown at all.
Comment 1 Alexander Staubo 2007-09-08 08:54:54 PDT
Argh, I was testing in beta 3. Works fine in latest nightly.