mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Implement Document.createRange().
This commit is contained in:
parent
6501dad9e9
commit
de36dd03a1
2 changed files with 9 additions and 1 deletions
|
@ -38,15 +38,16 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::htmlheadelement::HTMLHeadElement;
|
use dom::htmlheadelement::HTMLHeadElement;
|
||||||
use dom::htmlhtmlelement::HTMLHtmlElement;
|
use dom::htmlhtmlelement::HTMLHtmlElement;
|
||||||
use dom::htmltitleelement::HTMLTitleElement;
|
use dom::htmltitleelement::HTMLTitleElement;
|
||||||
|
use dom::location::Location;
|
||||||
use dom::mouseevent::MouseEvent;
|
use dom::mouseevent::MouseEvent;
|
||||||
use dom::node::{Node, ElementNodeTypeId, DocumentNodeTypeId, NodeHelpers};
|
use dom::node::{Node, ElementNodeTypeId, DocumentNodeTypeId, NodeHelpers};
|
||||||
use dom::node::{CloneChildren, DoNotCloneChildren};
|
use dom::node::{CloneChildren, DoNotCloneChildren};
|
||||||
use dom::nodelist::NodeList;
|
use dom::nodelist::NodeList;
|
||||||
use dom::text::Text;
|
use dom::text::Text;
|
||||||
use dom::processinginstruction::ProcessingInstruction;
|
use dom::processinginstruction::ProcessingInstruction;
|
||||||
|
use dom::range::Range;
|
||||||
use dom::uievent::UIEvent;
|
use dom::uievent::UIEvent;
|
||||||
use dom::window::{Window, WindowHelpers};
|
use dom::window::{Window, WindowHelpers};
|
||||||
use dom::location::Location;
|
|
||||||
use html::hubbub_html_parser::build_element_from_tag;
|
use html::hubbub_html_parser::build_element_from_tag;
|
||||||
use hubbub::hubbub::{QuirksMode, NoQuirks, LimitedQuirks, FullQuirks};
|
use hubbub::hubbub::{QuirksMode, NoQuirks, LimitedQuirks, FullQuirks};
|
||||||
use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
|
use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
|
||||||
|
@ -504,6 +505,11 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// http://dom.spec.whatwg.org/#dom-document-createrange
|
||||||
|
fn CreateRange(&self) -> Temporary<Range> {
|
||||||
|
Range::new(self)
|
||||||
|
}
|
||||||
|
|
||||||
// http://www.whatwg.org/specs/web-apps/current-work/#document.title
|
// http://www.whatwg.org/specs/web-apps/current-work/#document.title
|
||||||
fn Title(&self) -> DOMString {
|
fn Title(&self) -> DOMString {
|
||||||
let mut title = String::new();
|
let mut title = String::new();
|
||||||
|
|
|
@ -43,6 +43,8 @@ interface Document : Node {
|
||||||
|
|
||||||
[Throws]
|
[Throws]
|
||||||
Event createEvent(DOMString interface_);
|
Event createEvent(DOMString interface_);
|
||||||
|
|
||||||
|
Range createRange();
|
||||||
};
|
};
|
||||||
|
|
||||||
/* http://www.whatwg.org/specs/web-apps/current-work/#the-document-object */
|
/* http://www.whatwg.org/specs/web-apps/current-work/#the-document-object */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue