Bug 19179

Summary: Edge fringe artifact with transformed, masked elements (including reflections)
Product: WebKit Reporter: CJ Yetman <cj>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Severity: Normal CC: bdakin, bugs.webkit.org, cabel, darin, dino, mail, mitz, rik, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Macintosh   
OS: OS X 10.5   
Description Flags
more dramatic demonstration
Patch bdakin: review+

Description CJ Yetman 2008-05-21 20:37:33 PDT
When adding a reflection with -webkit-box-reflect that has a gradient mask... if you also use -webkit-transform: skew, you will see a line at the edge of the reflected image. You will not see the line if the skew is removed or set to 0 degrees. Probably just something to do with the anti-aliasing of the gradient or the skewed image, but there should be some way to resolve it. Sorry, I don't know all the proper terminology, so I'll just attach a test case.

(Tested on latest nightly r33980)
Comment 1 CJ Yetman 2008-05-21 20:39:54 PDT
Created attachment 21282 [details]
Comment 2 CJ Yetman 2008-05-22 11:48:34 PDT
Created attachment 21298 [details]
more dramatic demonstration
Comment 3 mitz 2008-05-22 12:09:01 PDT
Great test cases. Thanks!
Comment 4 mitz 2008-05-22 12:46:07 PDT
This can probably happens when applying any mask to any transformed box.
Comment 5 Simon Fraser (smfr) 2009-01-03 19:50:58 PST
Created attachment 26404 [details]
Comment 6 David Harrison 2009-02-21 08:54:05 PST
Comment 7 mitz 2009-10-04 22:41:49 PDT
*** Bug 30040 has been marked as a duplicate of this bug. ***
Comment 8 Simon Fraser (smfr) 2009-12-16 10:25:02 PST
Very obvious example:
Comment 9 Simon Fraser (smfr) 2009-12-16 10:27:17 PST
*** Bug 27832 has been marked as a duplicate of this bug. ***
Comment 10 Darin Adler 2009-12-16 10:33:08 PST
rdar://6608800 is a different issue. We need a new Radar report.
Comment 11 mitz 2010-02-16 15:45:08 PST
Comment 12 Simon Fraser (smfr) 2010-07-07 17:52:56 PDT
*** Bug 39248 has been marked as a duplicate of this bug. ***
Comment 13 Simon Fraser (smfr) 2010-10-07 11:39:22 PDT
Maybe fix:

diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index d54af1f..8b643b4 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -814,6 +814,11 @@ void RenderBox::paintMaskImages(const PaintInfo& paintInfo, int tx, int ty, int
     bool allMaskImagesLoaded = true;
     if (!compositedMask) {
+        // If the context has a rotation, scale or skew, then use a transparency layer to avoid
+        // pixel cruft around the edge of the mask.
+        AffineTransform currentCTM = paintInfo.context->getCTM();
+        pushTransparencyLayer = !currentCTM.isIdentityOrTranslationOrFlipped();;
         StyleImage* maskBoxImage = style()->maskBoxImage().image();
         const FillLayer* maskLayers = style()->maskLayers();
Comment 14 Simon Fraser (smfr) 2010-10-07 13:43:14 PDT
Created attachment 70144 [details]
Comment 15 Simon Fraser (smfr) 2010-10-07 13:49:39 PDT