mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Move WebIDL methods to traits implemented by JSRef types.
This commit is contained in:
parent
dfdda0098a
commit
76783b029e
106 changed files with 3644 additions and 1912 deletions
|
@ -33,11 +33,17 @@ impl DOMParser {
|
|||
pub fn Constructor(owner: &JSRef<Window>) -> Fallible<Unrooted<DOMParser>> {
|
||||
Ok(DOMParser::new(owner))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ParseFromString(&self,
|
||||
_s: DOMString,
|
||||
ty: DOMParserBinding::SupportedType)
|
||||
-> Fallible<Unrooted<Document>> {
|
||||
pub trait DOMParserMethods {
|
||||
fn ParseFromString(&self, _s: DOMString, ty: DOMParserBinding::SupportedType) -> Fallible<Unrooted<Document>>;
|
||||
}
|
||||
|
||||
impl<'a> DOMParserMethods for JSRef<'a, DOMParser> {
|
||||
fn ParseFromString(&self,
|
||||
_s: DOMString,
|
||||
ty: DOMParserBinding::SupportedType)
|
||||
-> Fallible<Unrooted<Document>> {
|
||||
let roots = RootCollection::new();
|
||||
let owner = self.owner.root(&roots);
|
||||
match ty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue