gecko/layout/reftests/box-shadow/boxshadow-blur-2-ref.html

12 lines
235 B
HTML
Raw Normal View History

Change the blur radius for -moz-box-shadow and text-shadow to match what is specified in css3-background, and the blur radius for canvas to follow what is specified in HTML5. (Bug 590039) r=roc a2.0=blocking2.0:beta6 This fixes the multiplication by 1.5 in gfxAlphaBoxBlur::CalculateBlurRadius (originally added in changeset ce9f05b57b95 for bug 467518) to work correctly. It was previously a multiplication by 1 due to integer division. CalculateBlurRadius previously multiplied by 1.880; it now multiplies by 2.820. This changes canvas shadow handling to multiply shadowBlur by 2 before taking its square root, as described in the spec. This means that canvas shadow blurs 8px or smaller are 1.5 times larger than they were previously (due to the CalculateBlurRadius change), and canvas shadow blurs larger than 8px are 2.121 times larger than they were previously (due to the CalculateBlurRadius change *and* the additional factor of sqrt(2)). This changes text-shadow and -moz-box-shadow handling to use CalculateBlurRadius on half of the value given instead of passing the value through directly. This means that text-shadow and box-shadow blurs are multiplied by 1.410 relative to their old sizes. It also means that we round rather than floor, so that the effect that used to be drawn by a blur in the range 1px to 1.99px is now drawn by a blur anywhere in the range 0.36px to 1.05px, the effect that used to be drawn by a blur in the range 2px to 2.99px is now drawn by a blur anywhere in the range 1.06px to 1.77px, what used to be a drawn by a blur in the range 3px to 3.99px is now drawn by a blur anywhere in the range 1.78px to 2.47px, etc.
2010-09-11 09:27:12 -07:00
<!DOCTYPE html>
<style>
body { margin: 0 }
p {
height: 1200px;
width: 100px;
box-shadow: 0px -100px 100px black;
Change the blur radius for -moz-box-shadow and text-shadow to match what is specified in css3-background, and the blur radius for canvas to follow what is specified in HTML5. (Bug 590039) r=roc a2.0=blocking2.0:beta6 This fixes the multiplication by 1.5 in gfxAlphaBoxBlur::CalculateBlurRadius (originally added in changeset ce9f05b57b95 for bug 467518) to work correctly. It was previously a multiplication by 1 due to integer division. CalculateBlurRadius previously multiplied by 1.880; it now multiplies by 2.820. This changes canvas shadow handling to multiply shadowBlur by 2 before taking its square root, as described in the spec. This means that canvas shadow blurs 8px or smaller are 1.5 times larger than they were previously (due to the CalculateBlurRadius change), and canvas shadow blurs larger than 8px are 2.121 times larger than they were previously (due to the CalculateBlurRadius change *and* the additional factor of sqrt(2)). This changes text-shadow and -moz-box-shadow handling to use CalculateBlurRadius on half of the value given instead of passing the value through directly. This means that text-shadow and box-shadow blurs are multiplied by 1.410 relative to their old sizes. It also means that we round rather than floor, so that the effect that used to be drawn by a blur in the range 1px to 1.99px is now drawn by a blur anywhere in the range 0.36px to 1.05px, the effect that used to be drawn by a blur in the range 2px to 2.99px is now drawn by a blur anywhere in the range 1.06px to 1.77px, what used to be a drawn by a blur in the range 3px to 3.99px is now drawn by a blur anywhere in the range 1.78px to 2.47px, etc.
2010-09-11 09:27:12 -07:00
}
</style>
<p>
<div style="position:absolute; background: white; top: 100px; left: 215px; height: 2px; width: 2px"></div>