Auto merge of #8728 - dzbarsky:reset_bitmpa, r=dzbarsky

Reset canvas state when changing bitmap dimensions

Ran http://mxr.mozilla.org/servo/source/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html?force=1#88 to confirm that this code is being executed, but the test still fails because the font isn't implemented and the expando doesn't get reset.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8728)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-12-04 11:57:55 +05:30
commit 2bb34feb3e
4 changed files with 103 additions and 2 deletions

View file

@ -81,7 +81,7 @@ impl HTMLCanvasElement {
let size = self.get_size();
if let Some(ref context) = *self.context.borrow() {
match *context {
CanvasContext::Context2d(ref context) => context.recreate(size),
CanvasContext::Context2d(ref context) => context.set_bitmap_dimensions(size),
CanvasContext::WebGL(ref context) => context.recreate(size),
}
}