From 3b2602918ba45708087ede00985206a33fcc0b6a Mon Sep 17 00:00:00 2001 From: tigercosmos Date: Fri, 22 Jun 2018 08:29:08 -0700 Subject: [PATCH] implement dirName --- components/script/dom/htmlformelement.rs | 3 +-- components/script/dom/htmlinputelement.rs | 4 ++-- components/script/dom/htmltextareaelement.rs | 6 ++++++ components/script/dom/webidls/HTMLTextAreaElement.webidl | 4 ++-- components/script/lib.rs | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 27a64d00cda1..88e74bf100b5 100755 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -606,7 +606,7 @@ impl HTMLFormElement { // Step 4 for datum in &mut ret { match &*datum.ty { - "file" | "textarea" => (), // TODO + "file" => (), // TODO _ => { datum.name = clean_crlf(&datum.name); datum.value = FormDatumValue::String(clean_crlf(match datum.value { @@ -616,7 +616,6 @@ impl HTMLFormElement { } } }; - // Step 5 ret } diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index f2d83fa4d548..dae5ca36b502 100755 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -477,10 +477,10 @@ impl HTMLInputElementMethods for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#dom-input-alt make_setter!(SetAlt, "alt"); - // https://html.spec.whatwg.org/multipage/#dom-input-dirName + // https://html.spec.whatwg.org/multipage/#attr-fe-dirname make_getter!(DirName, "dirname"); - // https://html.spec.whatwg.org/multipage/#dom-input-dirName + // https://html.spec.whatwg.org/multipage/#attr-fe-dirname make_setter!(SetDirName, "dirname"); // https://html.spec.whatwg.org/multipage/#dom-fe-disabled diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 459500da9a14..53fb5dec11fd 100755 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -195,6 +195,12 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement { // https://html.spec.whatwg.org/multipage/#dom-textarea-placeholder make_setter!(SetPlaceholder, "placeholder"); + // https://html.spec.whatwg.org/multipage/#submitting-element-directionality:-the-dirname-attribute + make_getter!(DirName, "dirname"); + + // https://html.spec.whatwg.org/multipage/#submitting-element-directionality:-the-dirname-attribute + make_setter!(SetDirName, "dirname"); + // https://html.spec.whatwg.org/multipage/#attr-textarea-maxlength make_int_getter!(MaxLength, "maxlength", DEFAULT_MAX_LENGTH); diff --git a/components/script/dom/webidls/HTMLTextAreaElement.webidl b/components/script/dom/webidls/HTMLTextAreaElement.webidl index 3839be24f5e0..9dd4705a6054 100644 --- a/components/script/dom/webidls/HTMLTextAreaElement.webidl +++ b/components/script/dom/webidls/HTMLTextAreaElement.webidl @@ -11,8 +11,8 @@ interface HTMLTextAreaElement : HTMLElement { // attribute boolean autofocus; [CEReactions, SetterThrows] attribute unsigned long cols; - // [CEReactions] - // attribute DOMString dirName; + [CEReactions] + attribute DOMString dirName; [CEReactions] attribute boolean disabled; readonly attribute HTMLFormElement? form; diff --git a/components/script/lib.rs b/components/script/lib.rs index cf020ab9ac68..f1d2e116d147 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -95,6 +95,7 @@ extern crate swapper; extern crate time; #[cfg(target_os = "linux")] extern crate tinyfiledialogs; +extern crate unicode_bidi; extern crate unicode_segmentation; extern crate url; extern crate utf8;