aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-06-15 13:59:12 -0400
committerGitHub <noreply@github.com>2018-06-15 13:59:12 -0400
commit0c5b0201637899bd8ec7f63d0dc3944a01895986 (patch)
treec670dbf26e7e49deed6f377d4d708f61cedbea61 /components/script/dom
parent3279d1fe85d3aa8dbb99c59b4184e4bc3cc6c54b (diff)
parent0907940db85f49541b1caa7581027ea0c02413aa (diff)
downloadservo-0c5b0201637899bd8ec7f63d0dc3944a01895986.tar.gz
servo-0c5b0201637899bd8ec7f63d0dc3944a01895986.zip
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 -->
Diffstat (limited to 'components/script/dom')
-rwxr-xr-xcomponents/script/dom/htmltextareaelement.rs5
-rw-r--r--components/script/dom/webidls/HTMLTextAreaElement.webidl2
2 files changed, 6 insertions, 1 deletions
diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs
index 359fe4d8a19..d03fb1a348c 100755
--- a/components/script/dom/htmltextareaelement.rs
+++ b/components/script/dom/htmltextareaelement.rs
@@ -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()
diff --git a/components/script/dom/webidls/HTMLTextAreaElement.webidl b/components/script/dom/webidls/HTMLTextAreaElement.webidl
index 3ff20242bfe..f8f52c82b92 100644
--- a/components/script/dom/webidls/HTMLTextAreaElement.webidl
+++ b/components/script/dom/webidls/HTMLTextAreaElement.webidl
@@ -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;