Selection interface working for synthetic operations

This commit is contained in:
Patrick Shaughnessy 2020-01-31 21:56:36 -05:00
parent e697e6cca7
commit 5ef3358951
30 changed files with 812 additions and 8468 deletions

View file

@ -47,6 +47,7 @@ use crate::dom::node::{document_from_node, from_untrusted_node_address, Node, No
use crate::dom::performance::Performance;
use crate::dom::promise::Promise;
use crate::dom::screen::Screen;
use crate::dom::selection::Selection;
use crate::dom::storage::Storage;
use crate::dom::testrunner::TestRunner;
use crate::dom::webglrenderingcontext::WebGLCommandSender;
@ -1322,6 +1323,11 @@ impl WindowMethods for Window {
fn Origin(&self) -> USVString {
USVString(self.origin().immutable().ascii_serialization())
}
// https://w3c.github.io/selection-api/#dom-window-getselection
fn GetSelection(&self) -> Option<DomRoot<Selection>> {
self.document.get().and_then(|d| d.GetSelection())
}
}
impl Window {