add TextLength

This commit is contained in:
tigercosmos 2018-06-14 10:52:06 -07:00
parent 5c4f54c403
commit 0907940db8
4 changed files with 35 additions and 1 deletions

View file

@ -263,6 +263,11 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
}
// https://html.spec.whatwg.org/multipage/#dom-textarea-textlength
fn TextLength(&self) -> u32 {
self.textinput.borrow().utf16_len() as u32
}
// https://html.spec.whatwg.org/multipage/#dom-lfe-labels
fn Labels(&self) -> DomRoot<NodeList> {
self.upcast::<HTMLElement>().labels()