diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-02-22 11:48:46 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-02-22 11:48:46 -0700 |
commit | 287f390c4a56dd8c5960df699d45653227b25d6f (patch) | |
tree | 12503aa177afda01e92156174e17b41a948fa284 /components/script/dom/htmlcanvaselement.rs | |
parent | 3ea09bf2ea8db621107abbc8b358f1c0ce0ffea4 (diff) | |
parent | 325400dce41486ca9bdb4fa8ea07236520e86a50 (diff) | |
download | servo-287f390c4a56dd8c5960df699d45653227b25d6f.tar.gz servo-287f390c4a56dd8c5960df699d45653227b25d6f.zip |
auto merge of #5020 : jdm/servo/canvas, r=jdm
Rebase of #4639.
Diffstat (limited to 'components/script/dom/htmlcanvaselement.rs')
-rw-r--r-- | components/script/dom/htmlcanvaselement.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 60ff0f88f82..c3ea7fe6cb1 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -83,6 +83,16 @@ impl LayoutHTMLCanvasElementHelpers for LayoutJS<HTMLCanvasElement> { } } +pub trait HTMLCanvasElementHelpers { + fn get_size(&self) -> Size2D<i32>; +} + +impl<'a> HTMLCanvasElementHelpers for JSRef<'a, HTMLCanvasElement> { + fn get_size(&self) -> Size2D<i32> { + Size2D(self.Width() as i32, self.Height() as i32) + } +} + impl<'a> HTMLCanvasElementMethods for JSRef<'a, HTMLCanvasElement> { fn Width(self) -> u32 { self.width.get() |