aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/layout/wrapper.rs19
-rw-r--r--components/script/dom/element.rs22
-rw-r--r--components/style/legacy.rs8
-rw-r--r--components/style/node.rs2
4 files changed, 1 insertions, 50 deletions
diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs
index 8feba75a690..96bf3927381 100644
--- a/components/layout/wrapper.rs
+++ b/components/layout/wrapper.rs
@@ -64,7 +64,6 @@ use std::sync::Arc;
use string_cache::{Atom, Namespace};
use style::computed_values::content::ContentItem;
use style::computed_values::{content, display, white_space};
-use style::legacy::UnsignedIntegerAttribute;
use style::node::TElementAttributes;
use style::properties::ComputedValues;
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock};
@@ -643,12 +642,6 @@ impl<'le> TElementAttributes for LayoutElement<'le> {
}
}
- fn get_unsigned_integer_attribute(&self, attribute: UnsignedIntegerAttribute) -> Option<u32> {
- unsafe {
- self.element.get_unsigned_integer_attribute_for_layout(attribute)
- }
- }
-
#[inline]
fn get_attr<'a>(&'a self, namespace: &Namespace, name: &Atom) -> Option<&'a str> {
unsafe {
@@ -885,18 +878,6 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
}
}
- pub fn get_unsigned_integer_attribute(self, attribute: UnsignedIntegerAttribute)
- -> Option<u32> {
- unsafe {
- match self.get_jsmanaged().downcast::<Element>() {
- Some(element) => {
- element.get_unsigned_integer_attribute_for_layout(attribute)
- }
- None => panic!("not an element!")
- }
- }
- }
-
/// Get the description of how to account for recent style changes.
/// This is a simple bitfield and fine to copy by value.
pub fn restyle_damage(self) -> RestyleDamage {
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index a1a98e78edf..79d091505bc 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -75,7 +75,7 @@ use std::default::Default;
use std::mem;
use std::sync::Arc;
use string_cache::{Atom, Namespace, QualName};
-use style::legacy::{UnsignedIntegerAttribute, from_declaration};
+use style::legacy::from_declaration;
use style::properties::DeclaredValue;
use style::properties::longhands::{self, background_image, border_spacing, font_family, font_size};
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, parse_style_attribute};
@@ -227,9 +227,6 @@ pub trait LayoutElementHelpers {
#[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)]
unsafe fn html_element_in_html_document_for_layout(&self) -> bool;
fn id_attribute(&self) -> *const Option<Atom>;
fn style_attribute(&self) -> *const Option<PropertyDeclarationBlock>;
@@ -512,23 +509,6 @@ impl LayoutElementHelpers for LayoutJS<Element> {
}
}
- #[allow(unsafe_code)]
- unsafe fn get_unsigned_integer_attribute_for_layout(&self,
- attribute: UnsignedIntegerAttribute)
- -> Option<u32> {
- match attribute {
- UnsignedIntegerAttribute::ColSpan => {
- if let Some(this) = self.downcast::<HTMLTableCellElement>() {
- this.get_colspan()
- } else {
- // Don't panic since `display` can cause this to be called on arbitrary
- // elements.
- None
- }
- }
- }
- }
-
#[inline]
#[allow(unsafe_code)]
unsafe fn html_element_in_html_document_for_layout(&self) -> bool {
diff --git a/components/style/legacy.rs b/components/style/legacy.rs
index ffaaaadcab6..9d48b17d938 100644
--- a/components/style/legacy.rs
+++ b/components/style/legacy.rs
@@ -13,14 +13,6 @@ use selectors::matching::DeclarationBlock;
use smallvec::VecLike;
use std::sync::Arc;
-
-/// Legacy presentational attributes that take a nonnegative integer as defined in HTML5 § 2.4.4.2.
-#[derive(Copy, Clone, PartialEq, Eq)]
-pub enum UnsignedIntegerAttribute {
- /// `<td colspan>`
- ColSpan,
-}
-
/// Extension methods for `Stylist` that cause rules to be synthesized for legacy attributes.
pub trait PresentationalHintSynthesis {
/// Synthesizes rules from various HTML attributes (mostly legacy junk from HTML4) that confer
diff --git a/components/style/node.rs b/components/style/node.rs
index aa764f5f662..302ad48fd80 100644
--- a/components/style/node.rs
+++ b/components/style/node.rs
@@ -5,7 +5,6 @@
//! Traits that nodes must implement. Breaks the otherwise-cyclic dependency between layout and
//! style.
-use legacy::UnsignedIntegerAttribute;
use properties::PropertyDeclaration;
use selectors::matching::DeclarationBlock;
use smallvec::VecLike;
@@ -14,7 +13,6 @@ use string_cache::{Atom, Namespace};
pub trait TElementAttributes {
fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, &mut V)
where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>;
- fn get_unsigned_integer_attribute(&self, attribute: UnsignedIntegerAttribute) -> Option<u32>;
fn get_attr<'a>(&'a self, namespace: &Namespace, attr: &Atom) -> Option<&'a str>;
fn get_attrs<'a>(&'a self, attr: &Atom) -> Vec<&'a str>;