Bug 140536 - Border-radius clipping on a stacking context causes descendants to not render
Summary: Border-radius clipping on a stacking context causes descendants to not render
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks: 138551
  Show dependency treegraph
 
Reported: 2015-01-15 20:24 PST by Simon Fraser (smfr)
Modified: 2015-01-29 14:57 PST (History)
5 users (show)

See Also:


Attachments
Testcase (622 bytes, text/html)
2015-01-15 20:24 PST, Simon Fraser (smfr)
no flags Details
Patch (27.32 KB, patch)
2015-01-17 11:14 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
test-result (31.89 KB, image/png)
2015-01-21 14:30 PST, Byungseon(Sun) Shin
no flags Details
test-result-expected (27.61 KB, image/png)
2015-01-21 14:30 PST, Byungseon(Sun) Shin
no flags Details
clip and border radius test (715 bytes, text/html)
2015-01-21 14:34 PST, Byungseon(Sun) Shin
no flags Details
Patch (27.32 KB, patch)
2015-01-26 20:27 PST, Simon Fraser (smfr)
no flags 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) 2015-01-15 20:24:17 PST
Created attachment 244747 [details]
Testcase

Attached testcase shows a bug with border-radius clipping on a stacking context, with composited descendants.
Comment 1 Simon Fraser (smfr) 2015-01-15 22:03:58 PST
I have a fix for this.
Comment 2 Simon Fraser (smfr) 2015-01-17 11:14:40 PST
Created attachment 244842 [details]
Patch
Comment 3 Byungseon(Sun) Shin 2015-01-19 10:41:04 PST
I have verified that this change resolve the issue clearly on Mac Platform.
Thanks Simon.
Comment 4 Byungseon(Sun) Shin 2015-01-19 10:48:50 PST
I have found an issue on "Testcase that asserts on non-Mac" of https://bugs.webkit.org/show_bug.cgi?id=138551. 
It does not work on second test.
Comment 5 Byungseon(Sun) Shin 2015-01-21 08:17:01 PST
When container has border radius and clippingLayer with an offset value, it may need to apply border radius to container not to clippingLayer and then update offset value.
I have created a patch for it. 

One issue is when I change the offset value of clip Layer using inspector, it does not work well.

 // The clipping strategy depends on whether the rounded rect has equal corner radii.
 void GraphicsLayerCA::updateClippingStrategy(PlatformCALayer& clippingLayer, RefPtr<PlatformCALayer>& shapeMaskLayer, const FloatRoundedRect& roundedRect
)
 {
@@ -2085,7 +2072,15 @@ void GraphicsLayerCA::updateClippingStrategy(PlatformCALayer& clippingLayer, Ref
     clippingLayer.setCornerRadius(0);
     clippingLayer.setMask(shapeMaskLayer.get());
     
-    FloatRoundedRect offsetRoundedRect(clippingLayer.bounds(), roundedRect.radii());+
+    FloatRoundedRect offsetRoundedRect(roundedRect);
+
+    FloatRect clipRect = clippingLayer.bounds();
+    FloatPoint3D clipPos = clippingLayer.position();
+    FloatSize clipOffset = FloatSize(-(clipPos.x() - clipRect.width()/2), -(clipPos.y() - clipRect.height()/2));
+
+    offsetRoundedRect.move(clipOffset);
+
     shapeMaskLayer->setShapeRoundedRect(offsetRoundedRect);
 }
Comment 6 Byungseon(Sun) Shin 2015-01-21 14:30:10 PST
Created attachment 245090 [details]
test-result
Comment 7 Byungseon(Sun) Shin 2015-01-21 14:30:53 PST
Created attachment 245091 [details]
test-result-expected
Comment 8 Byungseon(Sun) Shin 2015-01-21 14:34:31 PST
Created attachment 245093 [details]
clip and border radius test
Comment 9 Simon Fraser (smfr) 2015-01-26 20:27:45 PST
Created attachment 245405 [details]
Patch
Comment 10 WebKit Commit Bot 2015-01-29 14:57:53 PST
Comment on attachment 245405 [details]
Patch

Clearing flags on attachment: 245405

Committed r179369: <http://trac.webkit.org/changeset/179369>
Comment 11 WebKit Commit Bot 2015-01-29 14:57:57 PST
All reviewed patches have been landed.  Closing bug.