diff options
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 158d9612442..a1a98e78edf 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -225,6 +225,8 @@ pub trait LayoutElementHelpers { unsafe fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, &mut V) where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>; #[allow(unsafe_code)] + unsafe fn get_colspan(self) -> u32; + #[allow(unsafe_code)] unsafe fn get_unsigned_integer_attribute_for_layout(&self, attribute: UnsignedIntegerAttribute) -> Option<u32>; #[allow(unsafe_code)] @@ -500,6 +502,17 @@ impl LayoutElementHelpers for LayoutJS<Element> { } #[allow(unsafe_code)] + unsafe fn get_colspan(self) -> u32 { + if let Some(this) = self.downcast::<HTMLTableCellElement>() { + this.get_colspan().unwrap_or(1) + } else { + // Don't panic since `display` can cause this to be called on arbitrary + // elements. + 1 + } + } + + #[allow(unsafe_code)] unsafe fn get_unsigned_integer_attribute_for_layout(&self, attribute: UnsignedIntegerAttribute) -> Option<u32> { |