mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Do not root DOMStringMap::element
This commit is contained in:
parent
ff0da2f642
commit
822e6f0d48
1 changed files with 3 additions and 6 deletions
|
@ -37,20 +37,17 @@ impl DOMStringMap {
|
|||
impl DOMStringMapMethods for DOMStringMap {
|
||||
// https://html.spec.whatwg.org/multipage/#dom-domstringmap-removeitem
|
||||
fn NamedDeleter(&self, name: DOMString) {
|
||||
let element = self.element.root();
|
||||
element.r().delete_custom_attr(name)
|
||||
self.element.delete_custom_attr(name)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-domstringmap-setitem
|
||||
fn NamedSetter(&self, name: DOMString, value: DOMString) -> ErrorResult {
|
||||
let element = self.element.root();
|
||||
element.r().set_custom_attr(name, value)
|
||||
self.element.set_custom_attr(name, value)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-domstringmap-nameditem
|
||||
fn NamedGetter(&self, name: DOMString, found: &mut bool) -> DOMString {
|
||||
let element = self.element.root();
|
||||
match element.r().get_custom_attr(name) {
|
||||
match self.element.get_custom_attr(name) {
|
||||
Some(value) => {
|
||||
*found = true;
|
||||
value.clone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue