From 00c3ffb7a4ec3cef22b2b30e0a00b5e69988619d Mon Sep 17 00:00:00 2001 From: Junyoung Cho Date: Wed, 31 Jul 2013 17:32:23 +0900 Subject: Add a getter of 'document.head' according to HTML spec. Add a getter and a setter of 'document.title' according to HTML spec. Modify the test file. --- src/components/script/dom/node.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/components/script/dom/node.rs') diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index 6e94d2f8ef0..7bf7e53b7ac 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -349,6 +349,13 @@ impl<'self, View> AbstractNode { self.transmute(f) } + pub fn with_mut_text(self, f: &fn(&mut Text) -> R) -> R { + if !self.is_text() { + fail!(~"node is not text"); + } + self.transmute_mut(f) + } + pub fn is_element(self) -> bool { match self.type_id() { ElementNodeTypeId(*) => true, -- cgit v1.2.3