Bug 59577

Summary: if both border-radius and box-shadow applied, shadow is not fully visible
Product: WebKit Reporter: Petr Gajdůšek <gajdusek.petr>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jchaffraix, kulanthaivel, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
testcase
none
testcase
none
Proposed patch.
simon.fraser: review+
Proposed patch.
simon.fraser: review+, commit-queue: commit-queue-
Archive of layout-test-results from cr-jail-7 none

Description Petr Gajdůšek 2011-04-26 21:12:06 PDT
Hi,

Have a box with border-radius applied for its top <right|left> and/or bottom <right|left> corners,
be the border-radius length set to the exactly same (or greater) value as the height of the box.

Something like these CSS rules:
#box {
  height: 30px;
  border-radius: 0 0 30px 30px;
}

Now if you apply box-shadow to #box, that shadow is not displayed properly - 
it is not displayed in that box parts that are cut off by border-radius,
instead underlying layer is visible (i.e. body background color).

Lowering the shadow length by single pixel works ok.

Example (XHTML attached):

HTML:
<div id="shadowed_box"></div>

CSS:
#shadowed_box {
  height: 30px;
  border-radius: 30px 0;
  box-shadow: 4px 4px 8px black;
  background-color: red;
}

I had this issue with every webkit version (with border-shadow support) I tried (latest nightly build r84622 including)
on Debian 32bit (chromium, epiphany) and Win7 64bit (google chrome, safari + nightly webkit).

Regards,
Petr
Comment 1 Petr Gajdůšek 2011-04-26 21:14:45 PDT
Created attachment 91224 [details]
testcase
Comment 2 Petr Gajdůšek 2011-04-26 21:20:51 PDT
Created attachment 91225 [details]
testcase
Comment 3 Kulanthaivel Palanichamy 2011-05-19 18:14:47 PDT
Created attachment 94155 [details]
Proposed patch.
Comment 4 Simon Fraser (smfr) 2011-05-20 11:03:31 PDT
Comment on attachment 94155 [details]
Proposed patch.

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

> Source/WebCore/platform/graphics/RoundedIntRect.cpp:81
> +    float factor = 0;

No need to initialize this here. You should also move this line to just above the if () test below.
Comment 5 Kulanthaivel Palanichamy 2011-05-20 14:26:06 PDT
Created attachment 94271 [details]
Proposed patch.
Comment 6 WebKit Commit Bot 2011-05-20 17:19:08 PDT
Comment on attachment 94271 [details]
Proposed patch.

Rejecting attachment 94271 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-7', 'build-..." exit_code: 2

Last 500 characters of output:
tmlmp .
http/tests/xmlhttprequest ................................................................................................................................................................................
http/tests/xmlhttprequest/web-apps ...............
http/tests/xmlhttprequest/workers ...........
http/tests/xmlviewer .
http/tests/xmlviewer/dumpAsText ...........
739.88s total testing time

23588 test cases (99%) succeeded
1 test case (<1%) was new
14 test cases (<1%) had stderr output

Full output: http://queues.webkit.org/results/8721452
Comment 7 WebKit Commit Bot 2011-05-20 17:19:11 PDT
Created attachment 94298 [details]
Archive of layout-test-results from cr-jail-7

The attached test failures were seen while running run-webkit-tests on the commit-queue.
Bot: cr-jail-7  Port: Mac  Platform: Mac OS X 10.6.7
Comment 8 Julien Chaffraix 2011-05-20 17:53:56 PDT
Manually landed the patch in r87006.