-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OffscreenCanvas] Throw when resizing placeholder #2951
Conversation
When attempting to set the width or height attribute of a canvas element after it has transferred controll to an OffscreenCanvas should throw an exception. Before this change, the behavior was to silently ignore changes to these attributes, which was not clear because that case was not specifically mentioned in the spec.
cc @whatwg/canvas @juj |
FYI: The corresponding web-platform-test is tweaked with this change (via Chromium -> wpt sync): https://chromium-review.googlesource.com/c/612513 |
That text you added is informative and has no requirements. You probably want to use must somewhere. |
Looks okay. At some point we should just define the width/height getter/setter as four distinct algorithms. Otherwise the execution order gets unwieldy and we get ambiguities. |
Coincidentally, Firefox already throws an exception, though the error message needs improving. The relevant bug is this one: https://bugzilla.mozilla.org/show_bug.cgi?id=1389090 |
Agreed. |
* Fix offscreencanvas-resize test to comply with spec This fix covers two spec compliance issues: 1) When an OffscreenCanvas is resized, its size must propagate to the placeholder canvas's width and height attributes; 2) Setting the width and height attributes on a placeholder canvas throws an exception. Related spec change: whatwg/html#2951 * Remove trailing whitespace
When attempting to set the width or height attribute of a canvas
element after it has transferred controll to an OffscreenCanvas
should throw an exception. Before this change, the behavior was
to silently ignore changes to these attributes, which was not clear
because that case was not specifically mentioned in the spec.