Closed Bug 309033 Opened 19 years ago Closed 19 years ago

Canvas globalAlpha property does not ignore invalid assignments

Categories

(Core :: Graphics: Canvas2D, defect)

1.8 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: kamiel, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050917 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050917 Firefox/1.4

According to the specification the globalAlpha property must only accept values
between 0.0 and 1.0 everything else should be ignored.
Currently it's possible to assign anything to the globalAlpha property (even
strings which are interpreted as being 0).

Reproducible: Always

Steps to Reproduce:
1. see test case
2.
3.

Actual Results:  
Opaque green circle on two black squares. globalAlpha property  was changed to 1.

Expected Results:  
Green semi transparent circles should be drawn onto two black squares
(globalAlpha should remain 0.1).
Version: Trunk → 1.8 Branch
Attached file Test case
We ignore invalid numeric values right now, but for non-numbers we don't even see it -- the object gets coerced to a number (strings are attempted to be parsed as numbers, so .globalAlpha = "0.2" should work, whcih I say without trying it yet; but .globalAlpha = "foo" will parse "foo" as 0) way before it ever touches canvas code.  Going to wontfix this for now, unless it becomes a problem.

With this test case in particular, the spec says "must only accept values between 0.0 and 1.0" -- it doesn't say anything about clamping to [0,1], which is what the test case seems to expect it to do.  The value of "2" is correctly being ignored now.  So, I think this should -> invalid, but I also think that the spec should specify a clamping to [0,1].
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: