mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Replace unsafe_blocks by unsafe_code.
This commit is contained in:
parent
4eb26065ac
commit
3479d3fa7f
53 changed files with 151 additions and 57 deletions
|
@ -63,21 +63,27 @@ impl HTMLCanvasElement {
|
|||
}
|
||||
|
||||
pub trait LayoutHTMLCanvasElementHelpers {
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_renderer(&self) -> Option<Sender<CanvasMsg>>;
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_canvas_width(&self) -> u32;
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_canvas_height(&self) -> u32;
|
||||
}
|
||||
|
||||
impl LayoutHTMLCanvasElementHelpers for LayoutJS<HTMLCanvasElement> {
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_renderer(&self) -> Option<Sender<CanvasMsg>> {
|
||||
let context = (*self.unsafe_get()).context.get_inner_as_layout();
|
||||
context.map(|cx| cx.get_renderer())
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_canvas_width(&self) -> u32 {
|
||||
(*self.unsafe_get()).width.get()
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_canvas_height(&self) -> u32 {
|
||||
(*self.unsafe_get()).height.get()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue