diff options
author | Matthew Rasmus <mattr@zzntd.com> | 2014-11-29 14:03:33 -0800 |
---|---|---|
committer | Matthew Rasmus <mattr@zzntd.com> | 2014-12-05 12:31:31 -0800 |
commit | ed37b53a62defe1d3d08de18166d41a20bd86912 (patch) | |
tree | 5d40de3410c141bd8281c1007988aff394f1295e | |
parent | 29241699fdbdfe9308dde4f0586472919049f153 (diff) | |
download | servo-ed37b53a62defe1d3d08de18166d41a20bd86912.tar.gz servo-ed37b53a62defe1d3d08de18166d41a20bd86912.zip |
Updates WPT to expect newly passing tests
Addresses reviews
More review addressing
-rw-r--r-- | components/layout/construct.rs | 3 | ||||
-rw-r--r-- | components/layout/lib.rs | 2 | ||||
-rw-r--r-- | components/layout/wrapper.rs | 18 | ||||
-rw-r--r-- | components/script/dom/htmltextareaelement.rs | 6 | ||||
-rw-r--r-- | tests/wpt/metadata/html/dom/interfaces.html.ini | 48 |
5 files changed, 13 insertions, 64 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs index d4d52c2ebb4..21a24af7efb 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -274,8 +274,7 @@ impl<'a> FlowConstructor<'a> { TableColumnFragment(TableColumnFragmentInfo::new(node)) } Some(ElementNodeTypeId(HTMLTableDataCellElementTypeId)) | - Some(ElementNodeTypeId(HTMLTableHeaderCellElementTypeId)) | - Some(ElementNodeTypeId(HTMLTextAreaElementTypeId)) => TableCellFragment, + Some(ElementNodeTypeId(HTMLTableHeaderCellElementTypeId)) => TableCellFragment, Some(ElementNodeTypeId(HTMLTableRowElementTypeId)) | Some(ElementNodeTypeId(HTMLTableSectionElementTypeId)) => TableRowFragment, Some(TextNodeTypeId) => UnscannedTextFragment(UnscannedTextFragmentInfo::new(node)), diff --git a/components/layout/lib.rs b/components/layout/lib.rs index 6489f6fe307..2d045508088 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -5,7 +5,7 @@ #![comment = "The Servo Parallel Browser Project"] #![license = "MPL"] -#![feature(globs, macro_rules, phase, thread_local, unsafe_destructor)] +#![feature(globs, macro_rules, phase, thread_local, unsafe_destructor, if_let)] #![deny(unused_imports)] #![deny(unused_variables)] diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 595ae6a760e..14c18bf1e17 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -184,16 +184,14 @@ impl<'ln> TLayoutNode for LayoutNode<'ln> { fn text(&self) -> String { unsafe { - let text_opt: Option<JS<Text>> = TextCast::to_js(self.get_jsmanaged()); - match text_opt { - Some(text) => (*text.unsafe_get()).characterdata().data_for_layout().to_string(), - None => match HTMLInputElementCast::to_js(self.get_jsmanaged()) { - Some(input) => input.get_value_for_layout(), - None => match HTMLTextAreaElementCast::to_js(self.get_jsmanaged()) { - Some(area) => area.get_value_for_layout(), - None => panic!("not text!") - } - } + if let Some(text) = TextCast::to_js(self.get_jsmanaged()) { + (*text.unsafe_get()).characterdata().data_for_layout().to_string() + } else if let Some(input) = HTMLInputElementCast::to_js(self.get_jsmanaged()) { + input.get_value_for_layout() + } else if let Some(area) = HTMLTextAreaElementCast::to_js(self.get_jsmanaged()) { + area.get_value_for_layout() + } else { + panic!("not text!") } } } diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index e34ec36aeca..67498ba6a17 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -139,11 +139,11 @@ impl<'a> HTMLTextAreaElementMethods for JSRef<'a, HTMLTextAreaElement> { } } -pub trait HTMLTextAreaElementHelpers { +trait PrivateHTMLTextAreaElementHelpers { fn force_relayout(self); } -impl<'a> HTMLTextAreaElementHelpers for JSRef<'a, HTMLTextAreaElement> { +impl<'a> PrivateHTMLTextAreaElementHelpers for JSRef<'a, HTMLTextAreaElement> { fn force_relayout(self) { let doc = document_from_node(self).root(); let node: JSRef<Node> = NodeCast::from_ref(self); @@ -223,7 +223,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> { } if child.is_text() { - self.SetValue(child.GetTextContent().unwrap()); + self.SetValue(self.DefaultValue()); } } diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index a9e0d52f1cf..40fc05cdb10 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -5370,9 +5370,6 @@ [HTMLTextAreaElement interface: attribute autofocus] expected: FAIL - [HTMLTextAreaElement interface: attribute cols] - expected: FAIL - [HTMLTextAreaElement interface: attribute dirName] expected: FAIL @@ -5388,30 +5385,9 @@ [HTMLTextAreaElement interface: attribute minLength] expected: FAIL - [HTMLTextAreaElement interface: attribute name] - expected: FAIL - - [HTMLTextAreaElement interface: attribute placeholder] - expected: FAIL - [HTMLTextAreaElement interface: attribute readOnly] expected: FAIL - [HTMLTextAreaElement interface: attribute required] - expected: FAIL - - [HTMLTextAreaElement interface: attribute rows] - expected: FAIL - - [HTMLTextAreaElement interface: attribute wrap] - expected: FAIL - - [HTMLTextAreaElement interface: attribute defaultValue] - expected: FAIL - - [HTMLTextAreaElement interface: attribute value] - expected: FAIL - [HTMLTextAreaElement interface: attribute textLength] expected: FAIL @@ -5463,9 +5439,6 @@ [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "autofocus" with the proper type (1)] expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "cols" with the proper type (2)] - expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "dirName" with the proper type (3)] expected: FAIL @@ -5481,30 +5454,9 @@ [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "minLength" with the proper type (8)] expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "name" with the proper type (9)] - expected: FAIL - - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "placeholder" with the proper type (10)] - expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "readOnly" with the proper type (11)] expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "required" with the proper type (12)] - expected: FAIL - - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "rows" with the proper type (13)] - expected: FAIL - - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "wrap" with the proper type (14)] - expected: FAIL - - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "defaultValue" with the proper type (16)] - expected: FAIL - - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "value" with the proper type (17)] - expected: FAIL - [HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "textLength" with the proper type (18)] expected: FAIL |