More documentation.

This commit is contained in:
Josh Matthews 2014-10-06 12:17:12 -04:00
parent cbed5da9fa
commit 89a27dd11a
2 changed files with 46 additions and 8 deletions

View file

@ -26,7 +26,7 @@ use dom::keyboardevent::KeyboardEvent;
use dom::htmlformelement::{InputElement, FormOwner, HTMLFormElement, HTMLFormElementHelpers, NotFromFormSubmitMethod};
use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId, document_from_node, window_from_node};
use dom::virtualmethods::VirtualMethods;
use textinput::{TextInput, TriggerDefaultAction, DispatchInput, Nothing};
use textinput::{Single, TextInput, TriggerDefaultAction, DispatchInput, Nothing};
use servo_util::str::DOMString;
use string_cache::Atom;
@ -74,7 +74,7 @@ impl HTMLInputElement {
input_type: Cell::new(InputText),
checked: Cell::new(false),
size: Cell::new(DEFAULT_INPUT_SIZE),
textinput: DOMRefCell::new(TextInput::new(false, "".to_string())),
textinput: DOMRefCell::new(TextInput::new(Single, "".to_string())),
}
}
@ -433,6 +433,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLInputElement> {
_ => {}
}
//TODO: set the editing position for text inputs
let doc = document_from_node(*self).root();
doc.request_focus(ElementCast::from_ref(*self));
} else if "keydown" == event.Type().as_slice() && !event.DefaultPrevented() &&