aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 9575a7bea16..f265f83a098 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -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())
+ }
}