Bug 53882 - Inset shadow with large offset renders incorrectly
Summary: Inset shadow with large offset renders incorrectly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-06 11:36 PST by Simon Fraser (smfr)
Modified: 2011-02-08 11:34 PST (History)
5 users (show)

See Also:


Attachments
Testcase (994 bytes, text/html)
2011-02-06 11:36 PST, Simon Fraser (smfr)
no flags Details
Patch (8.35 KB, patch)
2011-02-08 09:38 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (8.10 KB, patch)
2011-02-08 10:47 PST, Simon Fraser (smfr)
mitz: review+
Details | Formatted Diff | Diff

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