[Webkit-unassigned] [Bug 60091] New: The canvas spec models an edge case after an old bug in CG

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 3 17:27:44 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=60091

           Summary: The canvas spec models an edge case after an old bug
                    in CG
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Canvas
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mdelaney at apple.com
                CC: simon.fraser at apple.com, reed at google.com,
                    senorblanco at chromium.org, jamesr at chromium.org,
                    mdelaney at apple.com


It appears that this edge case in the canvas spec...

"Shadows are only drawn if the opacity component of the alpha component of the color of shadowColor is non-zero and either the shadowBlur is non-zero, or the shadowOffsetX is non-zero, or the shadowOffsetY is non-zero."

...is modeled after a bug that CG had/has. In destination-atop, the shadow should be rendered atop the source. However, if you have a shadowBlur of 0 (or very close to 0), then CG will just not render the shadow. The philip canvas test suite has a test to check for this edge case at: http://philip.html5.org/tests/canvas/suite/tests/2d.shadow.enable.off.2.html

Here's a testcase that jamesr constructed that shows the discontinuity of varying the shadow blur from 20 down to 0. Notice that it switches all of a sudden to all blue at the end, where it should instead have an all red shadow rect on top. http://webstuff.nfshost.com/shadowblur.html

Looking around, it appears that the only browsers that support this faulty edge case are FireFox4 (not before 4 though), WebKit browsers that use CG (and also Skia, jamesr tells me).

My proposal is to:
1) Change the spec by stripping out this edge case paragraph.
2) Notify Firefox team that they should strip out this hack in their code for the edge case.
3) Remove the hack also from Skia.
4) File a bug against CG on this faulty behavior (just did that) and hope that it can be fixed in future releases.
5) In GraphicsContextCG, "fix" this faulty behavior for all OSes that don't this possible future CG fix (via Gestalt).
6) Tell philip/W3C to update his/the test at http://philip.html5.org/tests/canvas/suite/tests/2d.shadow.enable.off.2.html / http://w3c-test.org/html/tests/approved/canvas/2d.shadow.enable.off.2.html
7) Remove the GraphicsContextCG "fix" in a few thousands years if/when we no longer need to support the broken CG.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list