mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Compile raw inline event handlers lazily. Resolves #8489.
This commit is contained in:
parent
3703e6d4f6
commit
2796a4dfa8
11 changed files with 323 additions and 67 deletions
|
@ -453,12 +453,10 @@ impl VirtualMethods for HTMLElement {
|
|||
self.super_type().unwrap().attribute_mutated(attr, mutation);
|
||||
match (attr.local_name(), mutation) {
|
||||
(name, AttributeMutation::Set(_)) if name.starts_with("on") => {
|
||||
let window = window_from_node(self);
|
||||
let (cx, url, reflector) = (window.get_cx(),
|
||||
window.get_url(),
|
||||
window.reflector().get_jsobject());
|
||||
let evtarget = self.upcast::<EventTarget>();
|
||||
evtarget.set_event_handler_uncompiled(cx, url, reflector,
|
||||
let source_line = 1; //TODO(#9604) get current JS execution line
|
||||
evtarget.set_event_handler_uncompiled(window_from_node(self).get_url(),
|
||||
source_line,
|
||||
&name[2..],
|
||||
// FIXME(ajeffrey): Convert directly from AttrValue to DOMString
|
||||
DOMString::from(&**attr.value()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue