mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
script: Eliminate the phantom type in favor of just whitelisting methods
that layout can safely call. This is simpler. Currently, the set of methods is not safe, but I plan to lock it down more soon.
This commit is contained in:
parent
da4cff034b
commit
be69a503fe
96 changed files with 646 additions and 522 deletions
|
@ -6,7 +6,7 @@ use dom::bindings::codegen::TextBinding;
|
|||
use dom::bindings::utils::{DOMString, Fallible};
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::node::{AbstractNode, ScriptView, Node, TextNodeTypeId};
|
||||
use dom::node::{AbstractNode, Node, TextNodeTypeId};
|
||||
use dom::window::Window;
|
||||
|
||||
/// An HTML text node.
|
||||
|
@ -21,16 +21,16 @@ impl Text {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(text: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
|
||||
pub fn new(text: ~str, document: AbstractDocument) -> AbstractNode {
|
||||
let node = Text::new_inherited(text, document);
|
||||
Node::reflect_node(@mut node, document, TextBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: @mut Window, text: DOMString) -> Fallible<AbstractNode<ScriptView>> {
|
||||
pub fn Constructor(owner: @mut Window, text: DOMString) -> Fallible<AbstractNode> {
|
||||
Ok(Text::new(text.clone(), owner.Document()))
|
||||
}
|
||||
|
||||
pub fn SplitText(&self, _offset: u32) -> Fallible<AbstractNode<ScriptView>> {
|
||||
pub fn SplitText(&self, _offset: u32) -> Fallible<AbstractNode> {
|
||||
fail!("unimplemented")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue