Bug 146784

Summary: Brightness filter on image with transition ignores border radius clipping on ancestor
Product: WebKit Reporter: Amaury Bauzac <amaury.bauzac>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: commit-queue, dino, freezindevil, sabouhallawa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP none

Description Amaury Bauzac 2015-07-09 06:56:35 PDT
Version : 537.36

Reproduced on Chrome 43 and Safari

Hello, 

I encounter a CSS problem using the brightness filter and transition filter on an image. Here is a simple example :

<style>
div {
  border: 4px solid #fff;
  border-radius: 50%;
  overflow: hidden;
}

img {
  -webkit-filter: brightness(0.8);
  -webkit-transition: -webkit-filter 1s ease-out;
  width: 100%;
}

img:hover {
  -webkit-filter: brightness(0.6);
}
</style>

<div>
  <img src="http://i0.kym-cdn.com/photos/images/facebook/000/581/722/7bc.jpg">
</div>


Or see directly : http://codepen.io/bqlou/pen/rVvLXK

Expected result : when hovering the image, brightness applies to the image

Actual result : when hovering the image, brightness applies to the image without repainting the whole picture during the transition
Comment 1 Simon Fraser (smfr) 2015-07-10 08:54:16 PDT
The bug here is that we're not taking the border-radius into account for the composited clip while the transition is running. I think we have another bug on this.
Comment 2 Radar WebKit Bug Importer 2015-07-10 08:54:45 PDT
<rdar://problem/21766718>
Comment 3 Simon Fraser (smfr) 2016-05-07 10:43:22 PDT
The problem is more general. Any layer that has an "ancestor clipping layer" that's affected by corner radius doesn't take the radius into account.
Comment 4 Simon Fraser (smfr) 2016-05-09 08:41:10 PDT
Created attachment 278406 [details]
WIP
Comment 5 WebKit Commit Bot 2016-05-09 08:44:46 PDT
Attachment 278406 [details] did not pass style-queue:


ERROR: Source/WebCore/rendering/RenderLayer.h:817:  The parameter name "context" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Simon Fraser (smfr) 2019-10-30 12:06:22 PDT
*** Bug 203558 has been marked as a duplicate of this bug. ***
Comment 7 Simon Fraser (smfr) 2022-08-31 14:40:20 PDT

*** This bug has been marked as a duplicate of bug 68196 ***