From df29b1e8786353275181506a69ca9e9430aadd3e Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 6 Aug 2015 10:26:07 -0700 Subject: [PATCH] script: Make the legacy presentational attributes on `` apply to `` too. Makes the Google SERPs not so narrow. --- components/script/dom/element.rs | 5 ++--- tests/ref/basic.list | 1 + tests/ref/legacy_th_width_attribute_a.html | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 tests/ref/legacy_th_width_attribute_a.html diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 8ebcfc3f3dc..34309eee29a 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -26,7 +26,6 @@ use dom::bindings::codegen::InheritTypes::{HTMLTableElementDerived, HTMLTableCel use dom::bindings::codegen::InheritTypes::{HTMLTableRowElementDerived, HTMLTextAreaElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLTableSectionElementDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::HTMLAnchorElementCast; -use dom::bindings::codegen::InheritTypes::HTMLTableDataCellElementDerived; use dom::bindings::codegen::InheritTypes::TextCast; use dom::bindings::codegen::UnionTypes::NodeOrString; use dom::bindings::error::{ErrorResult, Fallible}; @@ -259,7 +258,7 @@ impl RawLayoutElementHelpers for Element { } else if self.is_htmltableelement() { let this: &HTMLTableElement = mem::transmute(self); this.get_background_color() - } else if self.is_htmltabledatacellelement() { + } else if self.is_htmltablecellelement() { let this: &HTMLTableCellElement = mem::transmute(self); this.get_background_color() } else if self.is_htmltablerowelement() { @@ -357,7 +356,7 @@ impl RawLayoutElementHelpers for Element { } else if self.is_htmltableelement() { let this: &HTMLTableElement = mem::transmute(self); this.get_width() - } else if self.is_htmltabledatacellelement() { + } else if self.is_htmltablecellelement() { let this: &HTMLTableCellElement = mem::transmute(self); this.get_width() } else { diff --git a/tests/ref/basic.list b/tests/ref/basic.list index b8ec45640c5..822daca2019 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -179,6 +179,7 @@ experimental == iframe/size_attributes_vertical_writing_mode.html iframe/size_at == legacy_table_border_attribute_a.html legacy_table_border_attribute_ref.html == legacy_td_bgcolor_attribute_a.html legacy_td_bgcolor_attribute_ref.html == legacy_td_width_attribute_a.html legacy_td_width_attribute_ref.html +== legacy_th_width_attribute_a.html legacy_td_width_attribute_ref.html == letter_spacing_a.html letter_spacing_ref.html == line_breaking_whitespace_collapse_a.html line_breaking_whitespace_collapse_ref.html == line_height_a.html line_height_ref.html diff --git a/tests/ref/legacy_th_width_attribute_a.html b/tests/ref/legacy_th_width_attribute_a.html new file mode 100644 index 00000000000..aac23b296f4 --- /dev/null +++ b/tests/ref/legacy_th_width_attribute_a.html @@ -0,0 +1,21 @@ + + + + + + +
+
+
+ + + +