mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Clean up the cast calls
This commit is contained in:
parent
13ea3ac413
commit
68014af78e
66 changed files with 412 additions and 718 deletions
|
@ -225,8 +225,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-canvas-width
|
||||
fn SetWidth(&self, width: u32) {
|
||||
let elem = self.upcast::<Element>();
|
||||
elem.set_uint_attribute(&atom!("width"), width)
|
||||
self.upcast::<Element>().set_uint_attribute(&atom!("width"), width)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-canvas-height
|
||||
|
@ -236,8 +235,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-canvas-height
|
||||
fn SetHeight(&self, height: u32) {
|
||||
let elem = self.upcast::<Element>();
|
||||
elem.set_uint_attribute(&atom!("height"), height)
|
||||
self.upcast::<Element>().set_uint_attribute(&atom!("height"), height)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-canvas-getcontext
|
||||
|
@ -264,8 +262,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
|
|||
|
||||
impl VirtualMethods for HTMLCanvasElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
let element: &HTMLElement = self.upcast::<HTMLElement>();
|
||||
Some(element as &VirtualMethods)
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue