diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 2447e078efb..a3f10fcb4d8 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -850,6 +850,8 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> { this.get_width() } else if let Some(this) = self.downcast::() { this.get_width() + } else if let Some(this) = self.downcast::() { + this.get_width() } else if let Some(this) = self.downcast::() { // https://html.spec.whatwg.org/multipage/#the-hr-element-2:attr-hr-width this.get_width() @@ -886,6 +888,14 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> { this.get_height() } else if let Some(this) = self.downcast::() { this.get_height() + } else if let Some(this) = self.downcast::() { + this.get_height() + } else if let Some(this) = self.downcast::() { + this.get_height() + } else if let Some(this) = self.downcast::() { + this.get_height() + } else if let Some(this) = self.downcast::() { + this.get_height() } else { LengthOrPercentageOrAuto::Auto }; diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index e566fdfb5e0..ff10074c96b 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -111,6 +111,7 @@ pub trait HTMLTableCellElementLayoutHelpers<'dom> { fn get_rowspan(self) -> Option; fn get_table(self) -> Option>; fn get_width(self) -> LengthOrPercentageOrAuto; + fn get_height(self) -> LengthOrPercentageOrAuto; } impl<'dom> HTMLTableCellElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableCellElement> { @@ -151,6 +152,14 @@ impl<'dom> HTMLTableCellElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTable .cloned() .unwrap_or(LengthOrPercentageOrAuto::Auto) } + + fn get_height(self) -> LengthOrPercentageOrAuto { + self.upcast::() + .get_attr_for_layout(&ns!(), &local_name!("height")) + .map(AttrValue::as_dimension) + .cloned() + .unwrap_or(LengthOrPercentageOrAuto::Auto) + } } impl VirtualMethods for HTMLTableCellElement { @@ -185,6 +194,7 @@ impl VirtualMethods for HTMLTableCellElement { }, local_name!("bgcolor") => AttrValue::from_legacy_color(value.into()), local_name!("width") => AttrValue::from_nonzero_dimension(value.into()), + local_name!("height") => AttrValue::from_nonzero_dimension(value.into()), _ => self .super_type() .unwrap() diff --git a/components/script/dom/htmltablecolelement.rs b/components/script/dom/htmltablecolelement.rs index 98acc4eb6c3..36e0429230e 100644 --- a/components/script/dom/htmltablecolelement.rs +++ b/components/script/dom/htmltablecolelement.rs @@ -5,7 +5,7 @@ use dom_struct::dom_struct; use html5ever::{local_name, namespace_url, ns, LocalName, Prefix}; use js::rust::HandleObject; -use style::attr::AttrValue; +use style::attr::{AttrValue, LengthOrPercentageOrAuto}; use super::bindings::root::LayoutDom; use super::element::Element; @@ -66,6 +66,7 @@ impl HTMLTableColElementMethods for HTMLTableColElement { pub trait HTMLTableColElementLayoutHelpers<'dom> { fn get_span(self) -> Option; + fn get_width(self) -> LengthOrPercentageOrAuto; } impl<'dom> HTMLTableColElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableColElement> { @@ -74,6 +75,14 @@ impl<'dom> HTMLTableColElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableC .get_attr_for_layout(&ns!(), &local_name!("span")) .map(AttrValue::as_uint) } + + fn get_width(self) -> LengthOrPercentageOrAuto { + self.upcast::() + .get_attr_for_layout(&ns!(), &local_name!("width")) + .map(AttrValue::as_dimension) + .cloned() + .unwrap_or(LengthOrPercentageOrAuto::Auto) + } } impl VirtualMethods for HTMLTableColElement { @@ -92,6 +101,7 @@ impl VirtualMethods for HTMLTableColElement { } attr }, + local_name!("width") => AttrValue::from_nonzero_dimension(value.into()), _ => self .super_type() .unwrap() diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index ac34c8ea80e..b13113042fa 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -443,6 +443,7 @@ pub trait HTMLTableElementLayoutHelpers { fn get_cellpadding(self) -> Option; fn get_cellspacing(self) -> Option; fn get_width(self) -> LengthOrPercentageOrAuto; + fn get_height(self) -> LengthOrPercentageOrAuto; } impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement> { @@ -472,6 +473,14 @@ impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement> { .cloned() .unwrap_or(LengthOrPercentageOrAuto::Auto) } + + fn get_height(self) -> LengthOrPercentageOrAuto { + self.upcast::() + .get_attr_for_layout(&ns!(), &local_name!("height")) + .map(AttrValue::as_dimension) + .cloned() + .unwrap_or(LengthOrPercentageOrAuto::Auto) + } } impl VirtualMethods for HTMLTableElement { @@ -512,6 +521,7 @@ impl VirtualMethods for HTMLTableElement { match *local_name { local_name!("border") => AttrValue::from_u32(value.into(), 1), local_name!("width") => AttrValue::from_nonzero_dimension(value.into()), + local_name!("height") => AttrValue::from_nonzero_dimension(value.into()), local_name!("bgcolor") => AttrValue::from_legacy_color(value.into()), _ => self .super_type() diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs index 4545eab9f8c..6179c1fe063 100644 --- a/components/script/dom/htmltablerowelement.rs +++ b/components/script/dom/htmltablerowelement.rs @@ -5,7 +5,7 @@ use dom_struct::dom_struct; use html5ever::{local_name, namespace_url, ns, LocalName, Prefix}; use js::rust::HandleObject; -use style::attr::AttrValue; +use style::attr::{AttrValue, LengthOrPercentageOrAuto}; use style::color::AbsoluteColor; use crate::dom::bindings::codegen::Bindings::HTMLTableElementBinding::HTMLTableElementMethods; @@ -154,6 +154,7 @@ impl HTMLTableRowElementMethods for HTMLTableRowElement { pub trait HTMLTableRowElementLayoutHelpers { fn get_background_color(self) -> Option; + fn get_height(self) -> LengthOrPercentageOrAuto; } impl HTMLTableRowElementLayoutHelpers for LayoutDom<'_, HTMLTableRowElement> { @@ -163,6 +164,14 @@ impl HTMLTableRowElementLayoutHelpers for LayoutDom<'_, HTMLTableRowElement> { .and_then(AttrValue::as_color) .cloned() } + + fn get_height(self) -> LengthOrPercentageOrAuto { + self.upcast::() + .get_attr_for_layout(&ns!(), &local_name!("height")) + .map(AttrValue::as_dimension) + .cloned() + .unwrap_or(LengthOrPercentageOrAuto::Auto) + } } impl VirtualMethods for HTMLTableRowElement { @@ -173,6 +182,7 @@ impl VirtualMethods for HTMLTableRowElement { fn parse_plain_attribute(&self, local_name: &LocalName, value: DOMString) -> AttrValue { match *local_name { local_name!("bgcolor") => AttrValue::from_legacy_color(value.into()), + local_name!("height") => AttrValue::from_nonzero_dimension(value.into()), _ => self .super_type() .unwrap() diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs index 17ff6ef9881..5d7edf6ca83 100644 --- a/components/script/dom/htmltablesectionelement.rs +++ b/components/script/dom/htmltablesectionelement.rs @@ -5,7 +5,7 @@ use dom_struct::dom_struct; use html5ever::{local_name, namespace_url, ns, LocalName, Prefix}; use js::rust::HandleObject; -use style::attr::AttrValue; +use style::attr::{AttrValue, LengthOrPercentageOrAuto}; use style::color::AbsoluteColor; use crate::dom::bindings::codegen::Bindings::HTMLTableSectionElementBinding::HTMLTableSectionElementMethods; @@ -92,6 +92,7 @@ impl HTMLTableSectionElementMethods for HTMLTableSectionElement { pub trait HTMLTableSectionElementLayoutHelpers { fn get_background_color(self) -> Option; + fn get_height(self) -> LengthOrPercentageOrAuto; } impl HTMLTableSectionElementLayoutHelpers for LayoutDom<'_, HTMLTableSectionElement> { @@ -101,6 +102,14 @@ impl HTMLTableSectionElementLayoutHelpers for LayoutDom<'_, HTMLTableSectionElem .and_then(AttrValue::as_color) .cloned() } + + fn get_height(self) -> LengthOrPercentageOrAuto { + self.upcast::() + .get_attr_for_layout(&ns!(), &local_name!("height")) + .map(AttrValue::as_dimension) + .cloned() + .unwrap_or(LengthOrPercentageOrAuto::Auto) + } } impl VirtualMethods for HTMLTableSectionElement { @@ -111,6 +120,7 @@ impl VirtualMethods for HTMLTableSectionElement { fn parse_plain_attribute(&self, local_name: &LocalName, value: DOMString) -> AttrValue { match *local_name { local_name!("bgcolor") => AttrValue::from_legacy_color(value.into()), + local_name!("height") => AttrValue::from_nonzero_dimension(value.into()), _ => self .super_type() .unwrap() diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-bfc-005.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-bfc-005.xht.ini deleted file mode 100644 index c5c4499fdf7..00000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-bfc-005.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-bfc-005.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/normal-flow/inline-block-valign-001.xht.ini b/tests/wpt/meta/css/CSS2/normal-flow/inline-block-valign-001.xht.ini deleted file mode 100644 index 9d395c40f40..00000000000 --- a/tests/wpt/meta/css/CSS2/normal-flow/inline-block-valign-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[inline-block-valign-001.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/css-backgrounds/border-image-repeat-002.htm.ini b/tests/wpt/meta/css/css-backgrounds/border-image-repeat-002.htm.ini deleted file mode 100644 index fb4031b3d52..00000000000 --- a/tests/wpt/meta/css/css-backgrounds/border-image-repeat-002.htm.ini +++ /dev/null @@ -1,2 +0,0 @@ -[border-image-repeat-002.htm] - expected: FAIL diff --git a/tests/wpt/meta/css/css-backgrounds/border-image-repeat-004.htm.ini b/tests/wpt/meta/css/css-backgrounds/border-image-repeat-004.htm.ini deleted file mode 100644 index 7ae2c899b70..00000000000 --- a/tests/wpt/meta/css/css-backgrounds/border-image-repeat-004.htm.ini +++ /dev/null @@ -1,2 +0,0 @@ -[border-image-repeat-004.htm] - expected: FAIL diff --git a/tests/wpt/meta/css/css-backgrounds/css3-border-image-repeat-repeat.html.ini b/tests/wpt/meta/css/css-backgrounds/css3-border-image-repeat-repeat.html.ini deleted file mode 100644 index 003c9f4c831..00000000000 --- a/tests/wpt/meta/css/css-backgrounds/css3-border-image-repeat-repeat.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[css3-border-image-repeat-repeat.html] - expected: FAIL diff --git a/tests/wpt/meta/css/css-tables/crashtests/large-col-widths.html.ini b/tests/wpt/meta/css/css-tables/crashtests/large-col-widths.html.ini new file mode 100644 index 00000000000..3c509af5fd8 --- /dev/null +++ b/tests/wpt/meta/css/css-tables/crashtests/large-col-widths.html.ini @@ -0,0 +1,2 @@ +[large-col-widths.html] + expected: CRASH diff --git a/tests/wpt/meta/css/css-tables/tentative/colgroup-col.html.ini b/tests/wpt/meta/css/css-tables/tentative/colgroup-col.html.ini index 5f81cb67a16..54122c07acd 100644 --- a/tests/wpt/meta/css/css-tables/tentative/colgroup-col.html.ini +++ b/tests/wpt/meta/css/css-tables/tentative/colgroup-col.html.ini @@ -1,10 +1,4 @@ [colgroup-col.html] - [table 1] - expected: FAIL - - [table 2] - expected: FAIL - [table 3] expected: FAIL diff --git a/tests/wpt/meta/html/rendering/dimension-attributes.html.ini b/tests/wpt/meta/html/rendering/dimension-attributes.html.ini index ee7320aa3e2..f3eaf8cdf25 100644 --- a/tests/wpt/meta/html/rendering/dimension-attributes.html.ini +++ b/tests/wpt/meta/html/rendering/dimension-attributes.html.ini @@ -569,198 +569,6 @@ [ mapping to height property] expected: FAIL - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [
mapping to
height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [ mapping to height property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - - [mapping to width property] - expected: FAIL - [ mapping to marginLeft property] expected: FAIL diff --git a/tests/wpt/meta/html/rendering/non-replaced-elements/tables/table-attribute.html.ini b/tests/wpt/meta/html/rendering/non-replaced-elements/tables/table-attribute.html.ini index 4d1d09da8fc..187307c0f5f 100644 --- a/tests/wpt/meta/html/rendering/non-replaced-elements/tables/table-attribute.html.ini +++ b/tests/wpt/meta/html/rendering/non-replaced-elements/tables/table-attribute.html.ini @@ -128,30 +128,18 @@ [table th align attribute justify is correct] expected: FAIL - [tr height attribute pixel is correct] - expected: FAIL - [td height attribute pixel is correct] expected: FAIL [th height attribute pixel is correct] expected: FAIL - [table_tr height attribute percentage is correct] - expected: FAIL - [table_td height attribute percentage is correct] expected: FAIL [table_th height attribute percentage is correct] expected: FAIL - [table height attribute pixel is correct] - expected: FAIL - - [table height attribute 90% is correct] - expected: FAIL - [table height attribute 110% is correct] expected: FAIL @@ -160,6 +148,3 @@ [th default align attribute is center] expected: FAIL - - [table col width attribute is correct] - expected: FAIL diff --git a/tests/wpt/meta/html/rendering/non-replaced-elements/tables/table-row-group-height.html.ini b/tests/wpt/meta/html/rendering/non-replaced-elements/tables/table-row-group-height.html.ini deleted file mode 100644 index e23d11f1829..00000000000 --- a/tests/wpt/meta/html/rendering/non-replaced-elements/tables/table-row-group-height.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[table-row-group-height.html] - expected: FAIL