mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove unsound Root::deref() calls in HTML elements.
This commit is contained in:
parent
6032a2f8af
commit
d09d245ee1
5 changed files with 8 additions and 3 deletions
|
@ -170,6 +170,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
|
|||
// TODO: Add support for the `defer` and `async` attributes. (For now, we fetch all
|
||||
// scripts synchronously and execute them immediately.)
|
||||
let window = window_from_node(self).root();
|
||||
let window = window.r();
|
||||
let page = window.page();
|
||||
let base_url = page.get_url();
|
||||
|
||||
|
@ -207,9 +208,9 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
|
|||
None => (text, base_url)
|
||||
};
|
||||
|
||||
window.r().evaluate_script_with_result(source.as_slice(), url.serialize().as_slice());
|
||||
window.evaluate_script_with_result(source.as_slice(), url.serialize().as_slice());
|
||||
|
||||
let event = Event::new(GlobalRef::Window(window.r()),
|
||||
let event = Event::new(GlobalRef::Window(window),
|
||||
"load".into_string(),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable).root();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue