mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Implement trivial stringifiers
This commit is contained in:
parent
2a2e8b176d
commit
3b82cba011
6 changed files with 12 additions and 35 deletions
|
@ -159,4 +159,9 @@ impl<'a> DOMTokenListMethods for JSRef<'a, DOMTokenList> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://dom.spec.whatwg.org/#stringification-behavior
|
||||||
|
fn Stringifier(self) -> DOMString {
|
||||||
|
self.element.root().r().get_string_attribute(&self.local_name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,11 @@ impl<'a> URLSearchParamsMethods for JSRef<'a, URLSearchParams> {
|
||||||
self.data.borrow_mut().insert(name, vec!(value));
|
self.data.borrow_mut().insert(name, vec!(value));
|
||||||
self.update_steps();
|
self.update_steps();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://url.spec.whatwg.org/#stringification-behavior
|
||||||
|
fn Stringifier(self) -> DOMString {
|
||||||
|
DOMString::from_utf8(self.serialize(None)).unwrap()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait URLSearchParamsHelpers {
|
pub trait URLSearchParamsHelpers {
|
||||||
|
|
|
@ -17,5 +17,5 @@ interface DOMTokenList {
|
||||||
[Throws]
|
[Throws]
|
||||||
boolean toggle(DOMString token, optional boolean force);
|
boolean toggle(DOMString token, optional boolean force);
|
||||||
|
|
||||||
//stringifier;
|
stringifier;
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,5 +15,5 @@ interface URLSearchParams {
|
||||||
// sequence<DOMString> getAll(DOMString name);
|
// sequence<DOMString> getAll(DOMString name);
|
||||||
boolean has(DOMString name);
|
boolean has(DOMString name);
|
||||||
void set(DOMString name, DOMString value);
|
void set(DOMString name, DOMString value);
|
||||||
//stringifier;
|
stringifier;
|
||||||
};
|
};
|
||||||
|
|
|
@ -825,9 +825,6 @@
|
||||||
[DOMTokenList interface: operation toggle(DOMString,boolean)]
|
[DOMTokenList interface: operation toggle(DOMString,boolean)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[DOMTokenList interface: stringifier]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[DOMTokenList interface: calling add(DOMString) on document.body.classList with too few arguments must throw TypeError]
|
[DOMTokenList interface: calling add(DOMString) on document.body.classList with too few arguments must throw TypeError]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -12,42 +12,12 @@
|
||||||
[classList.add must not cause the CSS selector to stop matching]
|
[classList.add must not cause the CSS selector to stop matching]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[classList must stringify correctly when items have been added]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.add should not add a token if it already exists]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.remove removes arguments passed, if they are present.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.remove must remove existing tokens]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.remove must not break case-sensitive CSS selector matching]
|
[classList.remove must not break case-sensitive CSS selector matching]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[classList.remove must collapse whitespace around removed tokens]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.remove must collapse whitespaces around each token]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.remove must collapse whitespaces around each token and remove duplicates]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.remove must collapse whitespace when removing duplicate tokens]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.add must collapse whitespaces and remove duplicates when adding a token that already exists]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[classList.toggle must not break case-sensitive CSS selector matching]
|
[classList.toggle must not break case-sensitive CSS selector matching]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[CSS class selectors must stop matching when all classes have been removed]
|
[CSS class selectors must stop matching when all classes have been removed]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[classList must stringify to an empty string when all classes have been removed]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue