Bug 63093 - beginTransparencyLayer leaves context color out of sync, bleeds color into text
Summary: beginTransparencyLayer leaves context color out of sync, bleeds color into text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matthew Delaney
URL:
Keywords:
: 66793 (view as bug list)
Depends on: 63132
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-21 13:57 PDT by Matthew Delaney
Modified: 2011-08-24 11:28 PDT (History)
7 users (show)

See Also:


Attachments
testcase (248 bytes, text/html)
2011-06-21 13:57 PDT, Matthew Delaney
no flags Details
Patch (22.65 KB, patch)
2011-06-21 14:57 PDT, Matthew Delaney
no flags Details | Formatted Diff | Diff
Patch (25.43 KB, patch)
2011-06-21 16:57 PDT, Matthew Delaney
simon.fraser: review+
simon.fraser: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-01 (1.50 MB, application/zip)
2011-06-21 17:13 PDT, WebKit Review Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Delaney 2011-06-21 13:57:17 PDT
Created attachment 98054 [details]
testcase

Attaching a simple testcase that shows a border's color bleeding into the surrounding text. The text should be black, but is getting stuck with the border's blue color.
Comment 1 Matthew Delaney 2011-06-21 14:57:25 PDT
Created attachment 98060 [details]
Patch
Comment 2 Simon Fraser (smfr) 2011-06-21 15:01:18 PDT
Comment on attachment 98060 [details]
Patch

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

> Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:901
>      CGContextSaveGState(context);

save() calls CGContextSaveGState() so you can remove that.

> Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:918
>      CGContextRestoreGState(context);
>      m_data->endTransparencyLayer();
>      m_data->m_userToDeviceTransformKnownToBeIdentity = false;
> +
> +    restore();

restore() calls restorePlatformState() which calls both CGContextRestoreGState() and does m_data->m_userToDeviceTransformKnownToBeIdentity = false so you can remove those lines.

> LayoutTests/compositing/color-matching/color-leakage.html:16
> +<html>
> +  <head>
> +    <style>
> +      div {
> +        color: black;
> +        border-top: 1px solid blue;
> +        border-bottom: 1px solid rgba(0,0,0,0.9);
> +      }
> +    </style>
> +</head>
> +<body>
> +    <div>
> +        This should be black
> +  </div>
> +</body>
> +</html>

This test needs to be changed to make the pixel failure more detectable (larger text, use Ahem etc).
Comment 3 Matthew Delaney 2011-06-21 16:57:10 PDT
Created attachment 98081 [details]
Patch
Comment 4 Simon Fraser (smfr) 2011-06-21 16:58:18 PDT
Comment on attachment 98081 [details]
Patch

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

> LayoutTests/fast/css/color-leakage.html:23
> +  This text and the Ahem text above should be black.

Remove this text. Put in an HTML comment about the Ahem text being black, to reduce text diffs between platforms.
Comment 5 WebKit Review Bot 2011-06-21 17:13:48 PDT
Comment on attachment 98081 [details]
Patch

Attachment 98081 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/8921152

New failing tests:
fast/css/color-leakage.html
Comment 6 WebKit Review Bot 2011-06-21 17:13:53 PDT
Created attachment 98083 [details]
Archive of layout-test-results from ec2-cr-linux-01

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-01  Port: Chromium  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 7 Matthew Delaney 2011-06-21 17:40:59 PDT
Committed r89397: <http://trac.webkit.org/changeset/89397>
Comment 8 Alexey Proskuryakov 2011-08-24 11:28:48 PDT
*** Bug 66793 has been marked as a duplicate of this bug. ***