mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -162,9 +162,6 @@ impl VirtualMethods for HTMLBodyElement {
|
|||
let do_super_mutate = 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());
|
||||
// https://html.spec.whatwg.org/multipage/
|
||||
// #event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-3
|
||||
match name {
|
||||
|
@ -175,7 +172,9 @@ impl VirtualMethods for HTMLBodyElement {
|
|||
&atom!("onresize") | &atom!("onunload") | &atom!("onerror")
|
||||
=> {
|
||||
let evtarget = window.upcast::<EventTarget>(); // forwarded event
|
||||
evtarget.set_event_handler_uncompiled(cx, url, reflector,
|
||||
let source_line = 1; //TODO(#9604) obtain current JS execution line
|
||||
evtarget.set_event_handler_uncompiled(window.get_url(),
|
||||
source_line,
|
||||
&name[2..],
|
||||
DOMString::from((**attr.value()).to_owned()));
|
||||
false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue