mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Remove as_slice() calls from script.
This commit is contained in:
parent
ef536372cd
commit
a862479ca8
42 changed files with 115 additions and 124 deletions
|
@ -89,7 +89,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLBodyElement> {
|
|||
s.after_set_attr(attr);
|
||||
}
|
||||
|
||||
let name = attr.local_name().as_slice();
|
||||
let name = attr.local_name();
|
||||
if name.starts_with("on") {
|
||||
static FORWARDED_EVENTS: &'static [&'static str] =
|
||||
&["onfocus", "onload", "onscroll", "onafterprint", "onbeforeprint",
|
||||
|
@ -101,7 +101,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLBodyElement> {
|
|||
window.r().get_url(),
|
||||
window.r().reflector().get_jsobject());
|
||||
let evtarget: JSRef<EventTarget> =
|
||||
if FORWARDED_EVENTS.iter().any(|&event| name == event) {
|
||||
if FORWARDED_EVENTS.iter().any(|&event| &**name == event) {
|
||||
EventTargetCast::from_ref(window.r())
|
||||
} else {
|
||||
EventTargetCast::from_ref(*self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue