Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up"reset the rendering context to its default state" should also clear the "current default path" #5771
Comments
|
Having some web-platform-tests to back this up would be ideal. |
Related to whatwg/html#5771 There is currently a compat issue with the specs.
|
So assuming the tests are correct is there any reason we shouldn't make the path part of the drawing state? |
Yes, |
|
Thanks, I had missed that as a lot of usage of "drawing state" isn't linked back to its definition apparently. |
|
I was trying to write a PR for this when I realized it's actually a bit strange to have this fit in the canvas state paragraph when this paragraph only applies to objects inheriting from the So probably it's better to duplicate something in both places which actually calls this algorithm: 2D context set bitmap dimensions and OffscreenCanvas I was thinking something like (bold are changes)
for the 2D context's set bitmap dimensions, and
for OffscreenCanvas. But in the mean time, I'm wondering if it is correct to have two algorithms that much similar, and if the ordering of these steps technically matters, since they do differ there. Thoughts? (particularly from team canvas like @fserb maybe?). |
|
Ordering shouldn't matter there I think and I agree that these should share more infrastructure. |


Related to #5618 (comment).
When a canvas element with a 2D context has either its
widthorheightbeing changed, current texts ask that the "set bitmap dimensions" algorithm is executed, itself calling "reset the rendering context to its default state".In the "drawing state" definition there is a note specifying clearly
The "context's bitmap" is cleared in the second step of "set bitmap dimensions", but the "current default path" is never explicitly reset in this algorithm.
This means that according to these texts the "current default path" should not be cleared when the canvas dimension is set again.
However all implementations do reset it, I think they always did, and I'm sure a lot of websites are expecting it to happen.
So I believe a new step in this "reset the rendering context to its default state" algorithm should be included to specifically reset the "current default path".