Remove HTMLTableCellElement fields with parsed attribute values.

This commit is contained in:
Eli Friedman 2015-10-16 13:25:21 -07:00
parent b4d234107e
commit 1940c3d7d6
3 changed files with 17 additions and 23 deletions

View file

@ -21,7 +21,8 @@ use std::mem;
use std::ops::Deref;
use string_cache::{Atom, Namespace};
use style::values::specified::Length;
use util::str::{DOMString, parse_unsigned_integer, split_html_space_chars, str_join};
use util::str::{DOMString, parse_unsigned_integer, parse_legacy_color};
use util::str::{split_html_space_chars, str_join};
#[derive(JSTraceable, PartialEq, Clone, HeapSizeOf)]
pub enum AttrValue {
@ -77,6 +78,11 @@ impl AttrValue {
AttrValue::Atom(value)
}
pub fn from_legacy_color(string: DOMString) -> AttrValue {
let parsed = parse_legacy_color(&string).ok();
AttrValue::Color(string, parsed)
}
/// Assumes the `AttrValue` is a `TokenList` and returns its tokens
///
/// ## Panics