Remove get_unsigned_integer_attribute.

This commit is contained in:
Ms2ger 2015-11-15 11:24:03 +01:00
parent 5417df6397
commit 9c1d678b1b
4 changed files with 1 additions and 50 deletions

View file

@ -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 {

View file

@ -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 {

View file

@ -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

View file

@ -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>;