Made the clipboard-related functionality in TextInput more testable. Added test_clipboard_paste to the "test-unit" suite.

This commit is contained in:
Avi Weinstock 2015-04-22 13:25:05 -04:00
parent 387836c42e
commit b742eeca05
11 changed files with 532 additions and 436 deletions

View file

@ -30,6 +30,7 @@ use textinput::{TextInput, Lines, KeyReaction};
use dom::virtualmethods::VirtualMethods;
use dom::window::WindowHelpers;
use script_task::{ScriptMsg, Runnable};
use msg::constellation_msg::ConstellationChan;
use util::str::DOMString;
use string_cache::Atom;
@ -40,7 +41,7 @@ use std::cell::Cell;
#[dom_struct]
pub struct HTMLTextAreaElement {
htmlelement: HTMLElement,
textinput: DOMRefCell<TextInput>,
textinput: DOMRefCell<TextInput<ConstellationChan>>,
cols: Cell<u32>,
rows: Cell<u32>,
// https://html.spec.whatwg.org/multipage/#concept-textarea-dirty
@ -95,7 +96,7 @@ impl HTMLTextAreaElement {
let chan = document.window().root().r().constellation_chan();
HTMLTextAreaElement {
htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLTextAreaElement, localName, prefix, document),
textinput: DOMRefCell::new(TextInput::new(Lines::Multiple, "".to_owned(), Some(chan))),
textinput: DOMRefCell::new(TextInput::new(Lines::Multiple, "".to_owned(), chan)),
cols: Cell::new(DEFAULT_COLS),
rows: Cell::new(DEFAULT_ROWS),
value_changed: Cell::new(false),