mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Move the definition of ServoThreadSafeLayoutNode::canvas_data to script.
This commit is contained in:
parent
ef3c6a7773
commit
5859109197
2 changed files with 10 additions and 5 deletions
|
@ -38,6 +38,7 @@ use dom::documenttype::DocumentType;
|
|||
use dom::element::{Element, ElementCreator};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlcanvaselement::{LayoutHTMLCanvasElementHelpers, HTMLCanvasData};
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmlimageelement::{HTMLImageElement, LayoutHTMLImageElementHelpers};
|
||||
|
@ -965,6 +966,7 @@ pub trait LayoutNodeHelpers {
|
|||
fn text_content(&self) -> String;
|
||||
fn selection(&self) -> Option<Range<usize>>;
|
||||
fn image_url(&self) -> Option<Url>;
|
||||
fn canvas_data(&self) -> Option<HTMLCanvasData>;
|
||||
}
|
||||
|
||||
impl LayoutNodeHelpers for LayoutJS<Node> {
|
||||
|
@ -1094,6 +1096,11 @@ impl LayoutNodeHelpers for LayoutJS<Node> {
|
|||
.image_url()
|
||||
}
|
||||
}
|
||||
|
||||
fn canvas_data(&self) -> Option<HTMLCanvasData> {
|
||||
self.downcast()
|
||||
.map(|canvas| canvas.data())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue