mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Add upgrade reaction
This commit is contained in:
parent
ec528e944a
commit
e83a0045f9
3 changed files with 28 additions and 3 deletions
|
@ -39,7 +39,7 @@ use dom::bindings::str::DOMString;
|
|||
use dom::bindings::structuredclone::StructuredCloneData;
|
||||
use dom::bindings::trace::JSTraceable;
|
||||
use dom::bindings::utils::WRAP_CALLBACKS;
|
||||
use dom::customelementregistry::{CallbackReaction, CustomElementReactionStack};
|
||||
use dom::customelementregistry::{CallbackReaction, CustomElementDefinition, CustomElementReactionStack};
|
||||
use dom::document::{Document, DocumentSource, FocusType, HasBrowsingContext, IsHTMLDocument, TouchEventResult};
|
||||
use dom::element::Element;
|
||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||
|
@ -774,7 +774,7 @@ impl ScriptThread {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn enqueue_callback_reaction(element:&Element, reaction: CallbackReaction) {
|
||||
pub fn enqueue_callback_reaction(element: &Element, reaction: CallbackReaction) {
|
||||
SCRIPT_THREAD_ROOT.with(|root| {
|
||||
if let Some(script_thread) = root.get() {
|
||||
let script_thread = unsafe { &*script_thread };
|
||||
|
@ -783,6 +783,15 @@ impl ScriptThread {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn enqueue_upgrade_reaction(element: &Element, definition: Rc<CustomElementDefinition>) {
|
||||
SCRIPT_THREAD_ROOT.with(|root| {
|
||||
if let Some(script_thread) = root.get() {
|
||||
let script_thread = unsafe { &*script_thread };
|
||||
script_thread.custom_element_reaction_stack.enqueue_upgrade_reaction(element, definition);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn invoke_backup_element_queue() {
|
||||
SCRIPT_THREAD_ROOT.with(|root| {
|
||||
if let Some(script_thread) = root.get() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue