This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10647 - shadowBlur should be linear throughout rather than changing to sqrt() above 8px
Summary: shadowBlur should be linear throughout rather than changing to sqrt() above 8px
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML Canvas 2D Context (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-17 18:01 UTC by L. David Baron (Mozilla)
Modified: 2010-10-05 12:58 UTC (History)
10 users (show)

See Also:


Attachments

Description L. David Baron (Mozilla) 2010-09-17 18:01:56 UTC
http://www.w3.org/TR/2010/WD-2dcontext-20100624/#dom-context-2d-shadowblur says, in point 4.1:

If shadowBlur is less than 8, let σ be half the value of shadowBlur; otherwise, let σ be the square root of multiplying the value of shadowBlur by 2.

This is bizarre behavior that's emulation of a bug in Safari for Mac.  It doesn't seem present in Chromium for Linux, and until very recently the implementation of it in Gecko was actually wrong by a factor of sqrt(2) for the >8px case because the *2 inside the sqrt() was missing.  No Gecko bugs were filed about this difference; I only noticed because I was changing our blur code to conform to css3-background.

Instead of this bizarre formula, I think it should instead define σ as half the value of shadowBlur, no matter what the value of shadowBlur.  This would match css3-background's definition of blur for box-shadow.

Given the current lack of interoperability, I don't think changing this would pose a problem, and it would be much better to have a sensible behavior that's consistent with other specifications.

I have a testcase at http://dbaron.org/css/test/2010/shadow-blur ; the example on the left is box-shadow and the example on the right is canvas.
Comment 1 Ian 'Hixie' Hickson 2010-09-28 23:14:20 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 2 contributor 2010-09-28 23:16:58 UTC
Checked in as WHATWG revision r5538.
Check-in comment: Change how canvas blur is calculated to be less quirky. Please update your browsers accordingly. This affects all implementations.
http://html5.org/tools/web-apps-tracker?from=5537&to=5538
Comment 3 Aryeh Gregor 2010-09-29 18:57:04 UTC
(In reply to comment #0)
> This is bizarre behavior that's emulation of a bug in Safari for Mac.  It
> doesn't seem present in Chromium for Linux, and until very recently the
> implementation of it in Gecko was actually wrong by a factor of sqrt(2) for the
> >8px case because the *2 inside the sqrt() was missing.  No Gecko bugs were
> filed about this difference; I only noticed because I was changing our blur
> code to conform to css3-background.

FWIW, there was a bug filed about this:

https://bugzilla.mozilla.org/show_bug.cgi?id=578995

This change makes a lot of sense, though.  Actually, I already suggested it in bug 10169, but I'm not an implementer, so it didn't get anywhere.  (Which is fine, although I should have prodded implementers about it as I said I would . . .)