mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Remove HTMLTableCellElement fields with parsed attribute values.
This commit is contained in:
parent
b4d234107e
commit
1940c3d7d6
3 changed files with 17 additions and 23 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue