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

Conflicts resolved in conflicting files. OffscreenCanvas ready to be merged. #19067

Closed
wants to merge 11 commits into from

New and constructor function changed for offscreen-canvas

  • Loading branch information
gauraangkhurana committed Dec 3, 2017
commit 39d0308803f6c3372a7c1860b952d33df2e82128
@@ -44,24 +44,42 @@ pub struct OffscreenCanvas {
}

impl OffscreenCanvas {
fn new_inherited(document: &Document) -> OffscreenCanvas {
OffscreenCanvas {
reflector_: Reflector::new(),
context: DomRefCell::new(None),
}
}
pub fn new_inherited(
width: u64,
height: u64,
document: &Document
) -> OffscreenCanvas {

pub fn Constructor(global: &GlobalScope, width: u64,
height: u64) -> Result<DomRoot<OffscreenCanvas>, Error> {
unimplemented!()
OffscreenCanvas {
reflector_: Reflector::new(),
context: DomRefCell::new(None),
}
}
//#[allow(unrooted_must_root)]
pub fn new(
global: &GlobalScope,
width: u64,
height: u64
) -> DomRoot<OffscreenCanvas> {
reflect_dom_object(Box::new(OffscreenCanvas::new_inherited(width, height)),
global,
OffscreenCanvasBinding::Wrap)
}

pub fn Constructor(
global : &GlobalScope,
width: u64,
height: u64
) -> Result<DomRoot<OffscreenCanvas>, Error> {
Ok(OffscreenCanvas::new(global, width, height))
}
}

impl OffscreenCanvasMethods for OffscreenCanvas {
// https://html.spec.whatwg.org/multipage/#dom-img-width
fn Width(&self) -> u64 {
let width: u64 = 300;
width
fn Width(&self) -> u64 {
let width: u64 = 300;
width
}

// https://html.spec.whatwg.org/multipage/#dom-img-height
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.