Closed Bug 296821 Opened 20 years ago Closed 17 years ago

restore() should reset state to initial values

Categories

(Core :: Graphics: Canvas2D, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: paper, Assigned: vlad)

Details

Before the Canvas specs were rewritten based on Gecko, it said for restore: "If there is no saved state, the method resets the context's drawing state to its initial values." I think this is a valid, logical, and usefull action. All it would require it pushing the state at startup, and never popping it (pull it, but keep it in the state stack)
The change was made based on Safari, not Gecko.
Assignee: nobody → vladimir
Resolving this (even if as WONTFIX) needs to happen before 1.1, says me.
Flags: blocking-aviary1.1+
(In reply to comment #1) > The change was made based on Safari, not Gecko. I stand corrected, however, I still think it's a good idea. Just because Safari lacked the insight to think of this feature, someone (I assume you, Hixie, since the spec is in your name) did. Resolving as wontfix? Why? The fix isn't impossible and the the spec is not a standard yet. In fact, it changes very often (and, I might add, without a revision trail). This really is an extension of my arguement that a spec shouldn't be written soley based on an implementation built behind closed doors. I mean, why can't the spec still say restore should reset the context's drawing state, even if the current implementations don't support it yet? That goes for any other good ideas that were/are written into the spec but Safari currently does have. Sounds to me like the big 3 browsers just want to gloat "we support 100% of the canvas tag! [..because we wrote the spec to exclude anything we hadn't coded]"
I'm not saying that it _should_ be WONTFIX, just that FIXED or WONTFIX need to happen before 1.1 goes out. What good is a specification that nobody implements? You then need to know a) what the spec says, and b) what you really have to be compatible with, if you implement it. (Or what subset of the spec you can really use, if you're trying to write something that actually uses it.) It's not about gloating, but WHATWG process and spec issues belong on the WHATWG list, not in our bugzilla, so please limit comments here to technical discussion of what Mozilla should do here. If restore()-before-save()'s behaviour is undefined, we're free to make it reset to default values; that doesn't require a spec change, and we should discuss it here on its specific merits.
(In reply to comment #3) > ideas that were/are written into the spec but Safari currently does have. s/does have/does not have/ The problem with a volitile spec is that it's just that.. volitile. Yesterday it said restore reverts to default, today it says no action, tommorow, who knows? (In reply to comment #4) > What good is a specification that nobody implements? You then need to know heh, what good is implementing a spec when it keeps changing? I think this is why Gecko has shied away from evolving, incomplete specs in the past.
restore()-before-save()'s behaviour is not undefined, it's currently defined to be a no-op, it used to be defined to be a reset. The spec can change, it's a draft. It says so right at the top of the spec in its status section. In any case, if you have comments on the spec itself, please send them to whatwg@whatwg.org; similarly if you have comments regarding Mozilla's process please take them up with drivers@mozilla.org or some other appropriate forum. I agree that reset would be useful here. Mozilla used to crash, we changed Mozilla to do the same as Safari because that was easiest, and made sense, and the spec changed to match. If Vlad thinks that the reset behaviour is better, then he'll decide to change to that, and the spec can be updated, assuming Apple also agree.
I disagree that this is generally useful. If you want to get back to the default state put a save() as the first line of your code and be done with it. You can then restore the that point and save again...
renominate for b5 if this is critical.
Flags: blocking-aviary1.5+
this should definatly not be blocking the branch. it should be marked invalid, if anything.
The spec has been changed. http://www.whatwg.org/specs/web-apps/current-work/multipage/section-the-canvas.html#drawing0 http://www.w3.org/TR/2008/WD-html5-20080122/#drawing0 "If there is no saved state, the method must do nothing." -> INVALID related: bug 412530
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.