Associate logical and physical keypresses together to support non-QWERTY keyboards.

This commit is contained in:
Josh Matthews 2016-06-30 04:27:26 -04:00
parent 87c7772527
commit 04ce86c08c
15 changed files with 137 additions and 77 deletions

View file

@ -5,7 +5,7 @@
//! The `ByteString` struct.
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::borrow::{ToOwned, Cow};
use std::fmt;
use std::hash::{Hash, Hasher};
use std::ops;
@ -204,6 +204,15 @@ impl<'a> From<&'a str> for DOMString {
}
}
impl<'a> From<Cow<'a, str>> for DOMString {
fn from(contents: Cow<'a, str>) -> DOMString {
match contents {
Cow::Owned(s) => DOMString::from(s),
Cow::Borrowed(s) => DOMString::from(s),
}
}
}
impl From<DOMString> for Atom {
fn from(contents: DOMString) -> Atom {
Atom::from(contents.0)