Canvas save/restore ignores fillStyle and strokeStyle

VERIFIED FIXED

Status

()

Core
Canvas: 2D
VERIFIED FIXED
13 years ago
12 years ago

People

(Reporter: Emil A Eklund, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

According to the whatwg canvas specification [1] the canvas state (which is stored/restored using save/restore) includes, among other things, the following attributes: strokeStyle, fillStyle, globalAlpha, lineWidth, lineCap, lineJoin, miterLimit, shadowOffsetX, shadowOffsetY, shadowBlur, shadowColor, globalCompositeOperation.

However, in the mozilla implementation neither strokeStyle nor fillStyle is restored when the restore method is called.

The demonstration provided illustrates this, the box should contain two squares, a green one with a black border in the top left and red one with a blue border in the bottom right.

Thats the way it's rendered in Safari [2]. In mozilla (firefox 1.5 and trunk) however, the second square is blue with a red border, as the restore method failed to restore the strokeStyle and fillStyle attributes.

[1] http://www.whatwg.org/specs/web-apps/current-work/#the-canvas
[2] http://eae.net/canvas_state_safari.png

Reproducible: Always

Steps to Reproduce:
Demonstrated here: http://eae.net/canvas_state.html

Actual Results:  
The lower right square is blue with a red border

Expected Results:  
The lower right square should be red with a blue border
Created attachment 208511 [details]
testcase from reporter's URL

Updated

13 years ago
Keywords: testcase
This is very similar to bug 313372 which was fixed; not sure why this is occurring.  I'll take a look.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Fixed with 333177.
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
(Reporter)

Updated

12 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.