mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Introduce a set_uint_attribute method.
This commit is contained in:
parent
4386bae576
commit
bb732ef4e6
3 changed files with 10 additions and 6 deletions
|
@ -198,6 +198,7 @@ pub trait AttributeHandlers {
|
|||
fn set_url_attribute(&mut self, name: &str, value: DOMString);
|
||||
fn get_string_attribute(&self, name: &str) -> DOMString;
|
||||
fn set_string_attribute(&mut self, name: &str, value: DOMString);
|
||||
fn set_uint_attribute(&mut self, name: &str, value: u32);
|
||||
}
|
||||
|
||||
pub trait AfterSetAttrListener {
|
||||
|
@ -410,6 +411,11 @@ impl AttributeHandlers for JS<Element> {
|
|||
assert!(name == name.to_ascii_lower());
|
||||
assert!(self.set_attribute(Null, name.to_owned(), value).is_ok());
|
||||
}
|
||||
|
||||
fn set_uint_attribute(&mut self, name: &str, value: u32) {
|
||||
assert!(name == name.to_ascii_lower());
|
||||
assert!(self.set_attribute(Null, name.to_owned(), value.to_str()).is_ok());
|
||||
}
|
||||
}
|
||||
|
||||
impl Element {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue