mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Move parse_integer and parse_unsigned_integer from util::str to style::attr
This commit is contained in:
parent
f0d4c03bd9
commit
43d527fcc8
3 changed files with 49 additions and 49 deletions
|
@ -18,7 +18,8 @@ use dom::node::{Node, document_from_node};
|
|||
use dom::virtualmethods::VirtualMethods;
|
||||
use std::cell::Cell;
|
||||
use string_cache::Atom;
|
||||
use util::str::{self, DOMString, LengthOrPercentageOrAuto};
|
||||
use style::attr::parse_unsigned_integer;
|
||||
use util::str::{DOMString, LengthOrPercentageOrAuto};
|
||||
|
||||
#[dom_struct]
|
||||
pub struct HTMLTableElement {
|
||||
|
@ -176,12 +177,12 @@ impl VirtualMethods for HTMLTableElement {
|
|||
atom!("border") => {
|
||||
// According to HTML5 § 14.3.9, invalid values map to 1px.
|
||||
self.border.set(mutation.new_value(attr).map(|value| {
|
||||
str::parse_unsigned_integer(value.chars()).unwrap_or(1)
|
||||
parse_unsigned_integer(value.chars()).unwrap_or(1)
|
||||
}));
|
||||
}
|
||||
atom!("cellspacing") => {
|
||||
self.cellspacing.set(mutation.new_value(attr).and_then(|value| {
|
||||
str::parse_unsigned_integer(value.chars())
|
||||
parse_unsigned_integer(value.chars())
|
||||
}));
|
||||
},
|
||||
_ => {},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue