Skip to content
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

Merged
merged 2 commits into from
Sep 21, 2017
Merged

[OffscreenCanvas] Throw when resizing placeholder #2951

merged 2 commits into from
Sep 21, 2017

Conversation

junov
Copy link
Member

@junov junov commented Aug 21, 2017

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.

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.
@junov
Copy link
Member Author

junov commented Aug 21, 2017

cc @whatwg/canvas @juj

@junov
Copy link
Member Author

junov commented Aug 21, 2017

FYI: The corresponding web-platform-test is tweaked with this change (via Chromium -> wpt sync): https://chromium-review.googlesource.com/c/612513

@annevk
Copy link
Member

annevk commented Aug 21, 2017

That text you added is informative and has no requirements. You probably want to use must somewhere.

@annevk
Copy link
Member

annevk commented Aug 22, 2017

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.

@juj
Copy link

juj commented Aug 22, 2017

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

@junov
Copy link
Member Author

junov commented Aug 22, 2017

At some point we should just define the width/height getter/setter as four distinct algorithms.

Agreed.

zhenyao pushed a commit to KhronosGroup/WebGL that referenced this pull request Aug 22, 2017
* 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
@domenic domenic merged commit 5a51d3e into whatwg:master Sep 21, 2017
@junov junov deleted the resizeplaceholder branch July 7, 2022 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants