Bug 59577 - if both border-radius and box-shadow applied, shadow is not fully visible
Summary: if both border-radius and box-shadow applied, shadow is not fully visible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 21:12 PDT by Petr Gajdůšek
Modified: 2011-05-20 17:53 PDT (History)
4 users (show)

See Also:


Attachments
testcase (598 bytes, application/xhtml+xml)
2011-04-26 21:14 PDT, Petr Gajdůšek
no flags Details
testcase (605 bytes, application/xhtml+xml)
2011-04-26 21:20 PDT, Petr Gajdůšek
no flags Details
Proposed patch. (109.40 KB, patch)
2011-05-19 18:14 PDT, Kulanthaivel Palanichamy
simon.fraser: review+
Details | Formatted Diff | Diff
Proposed patch. (109.40 KB, patch)
2011-05-20 14:26 PDT, Kulanthaivel Palanichamy
simon.fraser: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from cr-jail-7 (202.52 KB, application/zip)
2011-05-20 17:19 PDT, WebKit Commit Bot
no flags Details

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