Auto merge of #21052 - tigercosmos:rrr, r=jdm

add TextLength

<!-- Please describe your changes on the following line: -->
add TextLength in HTMLTextAreaElement

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21052)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-06-15 13:59:12 -04:00 committed by GitHub
commit 0c5b020163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()

View file

@ -39,7 +39,7 @@ interface HTMLTextAreaElement : HTMLElement {
attribute DOMString defaultValue;
[CEReactions,TreatNullAs=EmptyString]
attribute DOMString value;
// readonly attribute unsigned long textLength;
readonly attribute unsigned long textLength;
// readonly attribute boolean willValidate;
// readonly attribute ValidityState validity;