Bug 53882

Summary: Inset shadow with large offset renders incorrectly
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, mitz, simon.fraser, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Testcase
none
Patch
none
Patch mitz: review+

Description Simon Fraser (smfr) 2011-02-06 11:36:02 PST
Created attachment 81419 [details]
Testcase

Some inset shadows with large offsets fail to render correctly.
Comment 1 Simon Fraser (smfr) 2011-02-08 09:38:12 PST
Created attachment 81653 [details]
Patch
Comment 2 mitz 2011-02-08 10:17:32 PST
Comment on attachment 81653 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=81653&action=review

> Source/WebCore/rendering/RenderBoxModelObject.cpp:1595
> +    if (shadowOffset.width() < 0)
> +        bounds.setWidth(bounds.width() - shadowOffset.width());
> +    else if (shadowOffset.width())
> +        bounds.shiftXEdgeTo(bounds.x() - shadowOffset.width());
> +
> +    if (shadowOffset.height() < 0)
> +        bounds.setHeight(bounds.height() - shadowOffset.height());
> +    else if (shadowOffset.height())
> +        bounds.shiftYEdgeTo(bounds.y() - shadowOffset.height());

I think this sort of thing is more readable as a union of bounds with (bound offset by shadowOffset).
Comment 3 Simon Fraser (smfr) 2011-02-08 10:47:12 PST
Created attachment 81661 [details]
Patch
Comment 4 Simon Fraser (smfr) 2011-02-08 11:06:36 PST
http://trac.webkit.org/changeset/77958
Comment 5 WebKit Review Bot 2011-02-08 11:34:56 PST
http://trac.webkit.org/changeset/77958 might have broken Qt Linux Release
The following tests are not passing:
http/tests/websocket/tests/workers/close-in-onmessage-crash.html