mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make CanvasRenderingContext2d::new take a &GlobalScope
This commit is contained in:
parent
896d8d4781
commit
a8c05c6962
2 changed files with 7 additions and 6 deletions
|
@ -20,6 +20,7 @@ use dom::bindings::str::DOMString;
|
|||
use dom::canvasrenderingcontext2d::{CanvasRenderingContext2D, LayoutCanvasRenderingContext2DHelpers};
|
||||
use dom::document::Document;
|
||||
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{Node, window_from_node};
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
|
@ -142,7 +143,7 @@ impl HTMLCanvasElement {
|
|||
if self.context.borrow().is_none() {
|
||||
let window = window_from_node(self);
|
||||
let size = self.get_size();
|
||||
let context = CanvasRenderingContext2D::new(GlobalRef::Window(window.r()), self, size);
|
||||
let context = CanvasRenderingContext2D::new(window.upcast::<GlobalScope>(), self, size);
|
||||
*self.context.borrow_mut() = Some(CanvasContext::Context2d(JS::from_ref(&*context)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue