Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
Rust ai-agentsai-toolsbrowserbrowser-automationcloud-browserheadlessheadless-browserkitesurfplaywrightpuppeteerrustservoweb-crawlerweb-crawlingweb-scraperweb-scraping
fix(preload): share nonblocking link lifecycle ownership
ldm0adffcce2a4f6
diff --git a/moli-core/tests/fetch_behaviors.rs b/moli-core/tests/fetch_behaviors.rsindex 2e7ee0d93..a01845a1a 100644--- a/moli-core/tests/fetch_behaviors.rs+++ b/moli-core/tests/fetch_behaviors.rs@@ -9,6 +9,8 @@ use moli_core::{use std::time::Instant;use support::FixtureServer;use tokio::time::Duration;+#[path = "fetch_behaviors/preload_lifecycle.rs"]+mod preload_lifecycle;fn diagnostic_global<'a>(page: &'a Page, name: &str) -> Option<&'a JsValueSnapshot> {page.script_execution().global(name)diff --git a/moli-core/tests/fetch_behaviors/preload_lifecycle.rs b/moli-core/tests/fetch_behaviors/preload_lifecycle.rsnew file mode 100644index 000000000..e7ee7acb3--- /dev/null+++ b/moli-core/tests/fetch_behaviors/preload_lifecycle.rs@@ -0,0 +1,174 @@+use super::*;++async fn evaluate_preload_probe(page: &mut Page, fixture: &str) -> Result<serde_json::Value> {+ let result = tokio::time::timeout(+ Duration::from_secs(15),+ page.evaluate_runtime_expression_with_await_async(+ &format!("({fixture}).then(JSON.stringify)"),+ true,+ ),+ )+ .await??;+ Ok(serde_json::from_str(+ result["value"]+ .as_str()+ .expect("preload lifecycle observations"),+ )?)+}++#[tokio::test(flavor = "multi_thread")]+async fn ordinary_preloads_do_not_delay_window_load_or_lose_late_events() -> Result<()> {+ for dynamic in [false, true] {+ for (destination, content_type) in [+ ("fetch", "text/plain"),+ ("script", "text/javascript"),+ ("style", "text/css"),+ ("image", "image/svg+xml"),+ ("font", "font/ttf"),+ ("track", "text/vtt"),+ ] {+ for successful in [true, false] {+ let server =+ gated_preload_server(destination, content_type, dynamic, successful).await?;+ let mut config = AppConfig::default();+ config.set_optional_resource_fetch_mask(+ moli_page_types::OptionalResourceFetchMask::ALL,+ );+ let browser = Browser::new(config)?;+ let mut page = browser+ .fetch_with_wait_until(+ &server.url,+ RenderedDomWaitUntil::Load,+ Duration::from_secs(5),+ )+ .await?;+ tokio::time::timeout(Duration::from_secs(5), server.requested).await??;+ let before = evaluate_preload_probe(+ &mut page,+ "Promise.resolve({state: document.readyState, events: preloadEvents, \+ count: performance.getEntriesByName(document.getElementById('preload').href).length})",+ )+ .await?;+ assert_eq!(+ before,+ serde_json::json!({"state":"complete","events":["window:complete"],"count":0}),+ "{destination}, dynamic={dynamic}, successful={successful}"+ );++ server.release.send(()).expect("release preload response");+ let after = evaluate_preload_probe(+ &mut page,+ r#"(async () => {+ const link = document.getElementById('preload');+ if (!preloadDone) await new Promise(resolve => {+ link.addEventListener('load', resolve, {once: true});+ link.addEventListener('error', resolve, {once: true});+ });+ return {state: document.readyState, events: preloadEvents,+ count: performance.getEntriesByName(link.href).length};+ })()"#,+ )+ .await?;+ let event = if successful { "load" } else { "error" };+ assert_eq!(+ after,+ serde_json::json!({+ "state":"complete", "events":["window:complete",format!("link:{event}:complete")],+ "count":1+ }),+ "{destination}, dynamic={dynamic}, successful={successful}"+ );+ server.task.await??;+ }+ }+ }+ Ok(())+}++struct GatedPreloadServer {+ url: String,+ requested: tokio::sync::oneshot::Receiver<()>,+ release: tokio::sync::oneshot::Sender<()>,+ task: tokio::task::JoinHandle<Result<()>>,+}++async fn gated_preload_server(+ destination: &str,+ content_type: &'static str,+ dynamic: bool,+ successful: bool,+) -> Result<GatedPreloadServer> {+ use tokio::io::{AsyncReadExt, AsyncWriteExt};++ let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await?;+ let url = format!("http://{}/page", listener.local_addr()?);+ let (request_tx, requested) = tokio::sync::oneshot::channel();+ let (release, release_rx) = tokio::sync::oneshot::channel();+ let link = if dynamic {+ format!(+ "<script>const link = document.createElement('link'); \+ Object.assign(link, {{id:'preload', rel:'preload', as:'{destination}', href:'/resource'}}); \+ link.onload = link.onerror = recordPreload; document.head.append(link);</script>"+ )+ } else {+ format!(+ "<link id=preload rel=preload as={destination} href=/resource \+ onload=recordPreload(event) onerror=recordPreload(event)>"+ )+ };+ let markup = format!(+ "<!doctype html><head><script> \+ globalThis.preloadEvents = []; globalThis.preloadDone = false; \+ addEventListener('load', () => preloadEvents.push('window:' + document.readyState)); \+ function recordPreload(event) {{ preloadDone = true; \+ preloadEvents.push('link:' + event.type + ':' + document.readyState); }} \+ </script>{link}</head><body>preload lifecycle"+ );+ let task = tokio::spawn(async move {+ let mut request_tx = Some(request_tx);+ let mut release_rx = Some(release_rx);+ for _ in 0..2 {+ let (mut stream, _) = listener.accept().await?;+ let mut request = Vec::new();+ let mut buffer = [0_u8; 1024];+ loop {+ let read = stream.read(&mut buffer).await?;+ if read == 0 {+ break;+ }+ request.extend_from_slice(&buffer[..read]);+ if request.windows(4).any(|window| window == b"\r\n\r\n") {+ break;+ }+ }+ let (status, mime, body) = if request.starts_with(b"GET /page ") {+ ("200 OK", "text/html", markup.as_str())+ } else {+ assert!(request.starts_with(b"GET /resource "));+ let _ = request_tx.take().expect("one preload request").send(());+ let _ = release_rx.take().expect("one response gate").await;+ (+ if successful {+ "200 OK"+ } else {+ "404 Not Found"+ },+ content_type,+ "body {}",+ )+ };+ let response = format!(+ "HTTP/1.1 {status}\r\nContent-Type: {mime}\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{body}",+ body.len()+ );+ stream.write_all(response.as_bytes()).await?;+ }+ Ok(())+ });+ Ok(GatedPreloadServer {+ url,+ requested,+ release,+ task,+ })+}diff --git a/moli-renderer-v8/src/frame_owner_model/store.rs b/moli-renderer-v8/src/frame_owner_model/store.rsindex 722d17e5c..a5f5d2144 100644--- a/moli-renderer-v8/src/frame_owner_model/store.rs+++ b/moli-renderer-v8/src/frame_owner_model/store.rs@@ -2704,7 +2704,7 @@ impl FrameOwnerStore {))}- pub(crate) fn accept_current_main_modulepreload_event_owner(+ pub(crate) fn accept_current_main_link_event_owner(&self,owner: FrameDocumentTaskOwner,element: DomHandle,diff --git a/moli-renderer-v8/src/frame_owner_model/store_tests.rs b/moli-renderer-v8/src/frame_owner_model/store_tests.rsindex 6d2faa834..029f75c70 100644--- a/moli-renderer-v8/src/frame_owner_model/store_tests.rs+++ b/moli-renderer-v8/src/frame_owner_model/store_tests.rs@@ -731,7 +731,7 @@ fn main_modulepreload_owner_never_allocates_a_load_event_delay() {);let event_owner = store- .accept_current_main_modulepreload_event_owner(owner, handle(10))+ .accept_current_main_link_event_owner(owner, handle(10)).expect("current modulepreload should retain exact event ownership");assert_eq!(event_owner.owner(), owner);assert_eq!(event_owner.element(), handle(10));diff --git a/moli-renderer-v8/src/native_bridge/context_host/main_document_lifecycle.rs b/moli-renderer-v8/src/native_bridge/context_host/main_document_lifecycle.rsindex 8e47f78ff..9577061b6 100644--- a/moli-renderer-v8/src/native_bridge/context_host/main_document_lifecycle.rs+++ b/moli-renderer-v8/src/native_bridge/context_host/main_document_lifecycle.rs@@ -181,22 +181,20 @@ impl JsContextHost {let binding = self.accept_current_main_style_load_event(element)?;Some(ConnectedStyleLoadEventAdmission::LoadDelaying(binding))}- ConnectedStyleLoadEventPlan::NonBlockingModulepreload { element } => {- let owner = self.accept_current_main_modulepreload_event_owner(element)?;- Some(ConnectedStyleLoadEventAdmission::NonBlockingModulepreload(- owner,- ))+ ConnectedStyleLoadEventPlan::NonBlockingLink { element } => {+ let owner = self.accept_current_main_link_event_owner(element)?;+ Some(ConnectedStyleLoadEventAdmission::NonBlockingLink(owner))}}}- pub(crate) fn accept_current_main_modulepreload_event_owner(+ pub(crate) fn accept_current_main_link_event_owner(&self,element: crate::document_runtime::DomHandle,) -> Option<DocumentLinkEventOwner> {let owner = self.current_main_document_task_owner()?;self.frame_owner_store- .accept_current_main_modulepreload_event_owner(owner, element)+ .accept_current_main_link_event_owner(owner, element)}pub(crate) fn main_style_load_event_is_current(diff --git a/moli-renderer-v8/src/script_vm/tests/browser_api/security_policy.rs b/moli-renderer-v8/src/script_vm/tests/browser_api/security_policy.rsindex d6e413392..a2436c569 100644--- a/moli-renderer-v8/src/script_vm/tests/browser_api/security_policy.rs+++ b/moli-renderer-v8/src/script_vm/tests/browser_api/security_policy.rs@@ -826,6 +826,12 @@ async fn style_preload_csp_blocks_before_typed_resource_and_dispatches_async_err"","CSP failure must not synchronously dispatch the preload error");+ let owner = vm.current_main_document_task_owner().unwrap();+ assert_eq!(+ vm.current_main_document_has_style_load_event_delay(owner),+ Some(false),+ "the queued CSP error must not delay Window load for a preload"+ );assert_eq!(drain_pre_domcontentloaded_non_script_page_tasks_for_test(&mut vm),diff --git a/moli-renderer-v8/src/script_vm/tests/mod.rs b/moli-renderer-v8/src/script_vm/tests/mod.rsindex 01f2078b1..357b88a3e 100644--- a/moli-renderer-v8/src/script_vm/tests/mod.rs+++ b/moli-renderer-v8/src/script_vm/tests/mod.rs@@ -14186,6 +14186,40 @@ fn cached_connected_modulepreload_never_acquires_a_load_delay() {);}+#[tokio::test]+async fn connected_preload_stylesheet_consumers_keep_their_load_delay() {+ for rel in ["preload", "preload stylesheet", "stylesheet preload"] {+ let mut vm = new_parsed_test_vm(+ "https://example.test/page.html",+ &format!(+ "<!doctype html><link id=preload rel='{rel}' as=style href='data:text/css,body{{}}'>"+ ),+ );+ let loader = ResourceRequestClient::new(&moli_fetch::FetchConfig::default()).unwrap();+ vm.replace_document_resource_runtime(&loader);+ let owner = vm.current_main_document_task_owner().unwrap();+ vm.queue_initial_connected_style_loads_for_current_owner();+ assert_eq!(+ vm.current_main_document_has_style_load_event_delay(owner),+ Some(rel.contains("stylesheet")),+ "only stylesheet consumers of the preload acquire a load delay: {rel}"+ );+ if rel == "preload" {+ vm.exec(+ "document.getElementById('preload').rel = 'stylesheet'",+ None,+ )+ .unwrap();+ vm.prime_document_lifecycle_processing_and_record_stylesheet_network_results();+ assert_eq!(+ vm.current_main_document_has_style_load_event_delay(owner),+ Some(true),+ "converting an in-flight preload to a stylesheet acquires the consumer's load delay"+ );+ }+ }+}+// Mirrors WPT `preload/avoid-delaying-onload-link-modulepreload.html`: the// response stays pending until after Window load has been observed.#[tokio::test]diff --git a/moli-renderer-v8/src/stylesheet_runtime/connected.rs b/moli-renderer-v8/src/stylesheet_runtime/connected.rsindex 2983c36c2..dab861f1a 100644--- a/moli-renderer-v8/src/stylesheet_runtime/connected.rs+++ b/moli-renderer-v8/src/stylesheet_runtime/connected.rs@@ -386,10 +386,8 @@ impl DocumentRuntime {if !csp_blocked && !kind.uses_connected_load_lifecycle() {return None;}- let event_plan = if !csp_blocked- && self.connected_owner_uses_non_blocking_modulepreload_identity(handle)- {- ConnectedStyleLoadEventPlan::non_blocking_modulepreload(handle)+ let event_plan = if self.connected_owner_uses_non_blocking_link_identity(handle) {+ ConnectedStyleLoadEventPlan::non_blocking_link(handle)} else {ConnectedStyleLoadEventPlan::load_delaying(handle)};@@ -455,8 +453,8 @@ impl DocumentRuntime {),)}- ConnectedStyleLoadEventPlan::NonBlockingModulepreload { element } => {- ConnectedStyleLoadEventAdmission::NonBlockingModulepreload(+ ConnectedStyleLoadEventPlan::NonBlockingLink { element } => {+ ConnectedStyleLoadEventAdmission::NonBlockingLink(crate::frame_owner_model::DocumentLinkEventOwner::unowned_for_document_runtime_test(element,),@@ -511,11 +509,11 @@ impl DocumentRuntime {/// Choose the load-event lifecycle from the link relation, independently/// of whether the current request is valid or fetchable.///- /// HTML requires every `modulepreload` processing outcome to be+ /// HTML requires every `preload` and `modulepreload` processing outcome to be/// non-load-delaying. Invalid `as`, non-matching media and malformed URLs/// therefore retain only exact Document/element identity for any terminal/// event. A stylesheet relation takes precedence when both tokens occur.- fn connected_owner_uses_non_blocking_modulepreload_identity(&self, handle: DomHandle) -> bool {+ fn connected_owner_uses_non_blocking_link_identity(&self, handle: DomHandle) -> bool {let node_id = NodeId::new(handle.index());if stylesheet_link_disposition(&self.dom_host, node_id).is_some() {return false;@@ -525,9 +523,10 @@ impl DocumentRuntime {.and_then(Node::as_element).is_some_and(|element| {element.is_html_element("link")- && element- .attribute("rel")- .is_some_and(|rel| link_rel_includes_token(rel, "modulepreload"))+ && element.attribute("rel").is_some_and(|rel| {+ link_rel_includes_token(rel, "preload")+ || link_rel_includes_token(rel, "modulepreload")+ })})}@@ -731,14 +730,12 @@ impl DocumentRuntime {return result;}if let Some(admission) = event_admission {- let expects_modulepreload_identity =- self.connected_owner_uses_non_blocking_modulepreload_identity(handle);+ let expects_non_blocking_identity =+ self.connected_owner_uses_non_blocking_link_identity(handle);let admission_matches_current_processing = matches!(- (expects_modulepreload_identity, admission),- (- true,- ConnectedStyleLoadEventAdmission::NonBlockingModulepreload(_)- ) | (false, ConnectedStyleLoadEventAdmission::LoadDelaying(_))+ (expects_non_blocking_identity, admission),+ (true, ConnectedStyleLoadEventAdmission::NonBlockingLink(_))+ | (false, ConnectedStyleLoadEventAdmission::LoadDelaying(_)));if !admission_matches_current_processing {self.settle_connected_style_load_admission(@@ -749,7 +746,7 @@ impl DocumentRuntime {self.invalidate_stylesheet_owner_operations(handle);tracing::debug!(?handle,- expects_modulepreload_identity,+ expects_non_blocking_identity,"discarded stale connected-style lifecycle commit");return result;@@ -831,8 +828,9 @@ impl DocumentRuntime {let resource_type = element.map(preload_like_link_resource_type).unwrap_or(SubresourceResourceType::Fetch);- let is_modulepreload =- self.connected_owner_uses_non_blocking_modulepreload_identity(handle);+ let is_modulepreload = element+ .and_then(|element| element.attribute("rel"))+ .is_some_and(|rel| link_rel_includes_token(rel, "modulepreload"));if !self.document_scripting_enabled()&& (is_modulepreload || resource_type == SubresourceResourceType::Script){@@ -865,9 +863,7 @@ impl DocumentRuntime {}let main_document_event_owner =event_admission.and_then(|admission| match admission {- ConnectedStyleLoadEventAdmission::NonBlockingModulepreload(owner) => {- Some(owner)- }+ ConnectedStyleLoadEventAdmission::NonBlockingLink(owner) => Some(owner),ConnectedStyleLoadEventAdmission::LoadDelaying(_) => None,});let Some(main_document_event_owner) = main_document_event_owner else {@@ -3677,98 +3673,103 @@ mod tests {#[tokio::test]async fn stylesheet_and_modulepreload_switches_drop_stale_event_bindings() -> Result<()> {- let parser = HtmlParser::SCRIPTING_ENABLED;- let document = parser.parse(- Url::parse("https://example.test/page").unwrap(),- "<!doctype html><html><head><link rel=preload as=style href='http://127.0.0.1:9/shared'></head><body></body></html>"- .to_owned(),- );- let link = first_link_handle(&document);- let loader = ResourceRequestClient::new(&FetchConfig::default())?;- let mut runtime = DocumentRuntime::new_networked(&document, &loader);-- runtime.queue_connected_style_loads(link);- let first_style_client = runtime- .active_stylesheet_link_client_for_test(link)- .expect("initial stylesheet preload client");- assert_eq!(- runtime- .stylesheet_lifecycle- .owner_states- .cancelable_load_event_bindings(link)- .len(),- 1- );+ for style_rel in ["stylesheet", "preload"] {+ let parser = HtmlParser::SCRIPTING_ENABLED;+ let document = parser.parse(+ Url::parse("https://example.test/page").unwrap(),+ format!(+ "<!doctype html><html><head><link rel={style_rel} as=style \+ href='http://127.0.0.1:9/shared'></head><body></body></html>"+ ),+ );+ let link = first_link_handle(&document);+ let loader = ResourceRequestClient::new(&FetchConfig::default())?;+ let mut runtime = DocumentRuntime::new_networked(&document, &loader);- assert!(runtime.dom_host.set_attribute(link, "rel", "modulepreload"));- drop(runtime.invalidate_style_related_state(link));- assert!(- runtime- .stylesheet_lifecycle- .owner_states- .cancelable_load_event_bindings(link)- .is_empty(),- "stylesheet invalidation must remove its event binding"- );- runtime.queue_connected_style_loads(link);- let (modulepreload_starts, warnings) =- runtime.prime_pending_connected_style_loads().into_parts();- assert!(warnings.is_empty(), "runtime warnings: {warnings:?}");- assert_eq!(modulepreload_starts.len(), 1);- assert!(- runtime+ runtime.queue_initial_connected_style_loads();+ let first_style_client = runtime.active_stylesheet_link_client_for_test(link)- .is_none()- );- assert!(- runtime- .stylesheet_lifecycle- .owner_states- .cancelable_load_event_bindings(link)- .is_empty(),- "an in-flight modulepreload must retain identity without a load-delay binding"- );+ .expect("initial stylesheet resource client");+ assert_eq!(+ runtime+ .stylesheet_lifecycle+ .owner_states+ .cancelable_load_event_bindings(link)+ .len(),+ usize::from(style_rel == "stylesheet"),+ "only stylesheet consumers carry load-delay bindings"+ );- assert!(runtime.dom_host.set_attribute(link, "rel", "preload"));- drop(runtime.invalidate_style_related_state(link));- assert!(- runtime- .stylesheet_lifecycle- .owner_states- .cancelable_load_event_bindings(link)- .is_empty(),- "modulepreload invalidation must remove its event binding"- );- runtime.queue_connected_style_loads(link);- let second_style_client = runtime- .active_stylesheet_link_client_for_test(link)- .expect("replacement stylesheet preload client");+ assert!(runtime.dom_host.set_attribute(link, "rel", "modulepreload"));+ drop(runtime.invalidate_style_related_state(link));+ assert!(+ runtime+ .stylesheet_lifecycle+ .owner_states+ .cancelable_load_event_bindings(link)+ .is_empty(),+ "stylesheet invalidation must remove its event binding"+ );+ runtime.queue_connected_style_loads(link);+ let (modulepreload_starts, warnings) =+ runtime.prime_pending_connected_style_loads().into_parts();+ assert!(warnings.is_empty(), "runtime warnings: {warnings:?}");+ assert_eq!(modulepreload_starts.len(), 1);+ assert!(+ runtime+ .active_stylesheet_link_client_for_test(link)+ .is_none()+ );+ assert!(+ runtime+ .stylesheet_lifecycle+ .owner_states+ .cancelable_load_event_bindings(link)+ .is_empty(),+ "an in-flight modulepreload must retain identity without a load-delay binding"+ );- assert!(!StylesheetLinkClient::ptr_eq(- &first_style_client,- &second_style_client- ));- assert!(- !runtime- .stylesheet_lifecycle- .owner_states- .accepts_stylesheet_link_client(&first_style_client)- );- assert!(- runtime- .stylesheet_lifecycle- .owner_states- .accepts_stylesheet_link_client(&second_style_client)- );- assert_eq!(- runtime- .stylesheet_lifecycle- .owner_states- .cancelable_load_event_bindings(link)- .len(),- 1,- "only the replacement stylesheet processing may retain a binding"- );+ assert!(runtime.dom_host.set_attribute(link, "rel", style_rel));+ drop(runtime.invalidate_style_related_state(link));+ assert!(+ runtime+ .stylesheet_lifecycle+ .owner_states+ .cancelable_load_event_bindings(link)+ .is_empty(),+ "modulepreload invalidation must remove its event binding"+ );+ runtime.queue_connected_style_loads(link);+ let second_style_client = runtime+ .active_stylesheet_link_client_for_test(link)+ .expect("replacement stylesheet resource client");++ assert!(!StylesheetLinkClient::ptr_eq(+ &first_style_client,+ &second_style_client+ ));+ assert!(+ !runtime+ .stylesheet_lifecycle+ .owner_states+ .accepts_stylesheet_link_client(&first_style_client)+ );+ assert!(+ runtime+ .stylesheet_lifecycle+ .owner_states+ .accepts_stylesheet_link_client(&second_style_client)+ );+ assert_eq!(+ runtime+ .stylesheet_lifecycle+ .owner_states+ .cancelable_load_event_bindings(link)+ .len(),+ usize::from(style_rel == "stylesheet"),+ "only the replacement stylesheet consumer may retain a binding"+ );+ }Ok(())}diff --git a/moli-renderer-v8/src/stylesheet_runtime/load.rs b/moli-renderer-v8/src/stylesheet_runtime/load.rsindex 3415c36aa..f95270673 100644--- a/moli-renderer-v8/src/stylesheet_runtime/load.rs+++ b/moli-renderer-v8/src/stylesheet_runtime/load.rs@@ -195,7 +195,7 @@ impl NativeModulepreloadLinkFetchOutcome {#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub(crate) enum ConnectedStyleLoadEventPlan {LoadDelaying { element: DomHandle },- NonBlockingModulepreload { element: DomHandle },+ NonBlockingLink { element: DomHandle },}impl ConnectedStyleLoadEventPlan {@@ -203,22 +203,22 @@ impl ConnectedStyleLoadEventPlan {Self::LoadDelaying { element }}- pub(in crate::document_runtime) fn non_blocking_modulepreload(element: DomHandle) -> Self {- Self::NonBlockingModulepreload { element }+ pub(in crate::document_runtime) fn non_blocking_link(element: DomHandle) -> Self {+ Self::NonBlockingLink { element }}}/// Lifecycle authority committed for one connected style/link plan.///-/// `modulepreload` links take the identity-only variant, which captures the-/// exact Document and element without touching the Document load gate. This+/// `preload` and `modulepreload` links take the identity-only variant, capturing+/// the exact Document and element without touching the Document load gate. This/// classification is independent of request validity, so error outcomes also/// remain non-load-delaying. All other owners retain the stylesheet/// load-event lease.#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub(crate) enum ConnectedStyleLoadEventAdmission {LoadDelaying(MainDocumentStyleLoadEventBinding),- NonBlockingModulepreload(DocumentLinkEventOwner),+ NonBlockingLink(DocumentLinkEventOwner),}impl ConnectedStyleLoadEventAdmission {@@ -232,17 +232,11 @@ impl ConnectedStyleLoadEventAdmission {ConnectedStyleLoadEventPlan::LoadDelaying { element },) => binding.element() == element,(- Self::NonBlockingModulepreload(owner),- ConnectedStyleLoadEventPlan::NonBlockingModulepreload { element },+ Self::NonBlockingLink(owner),+ ConnectedStyleLoadEventPlan::NonBlockingLink { element },) => owner.element() == element,- (- Self::LoadDelaying(_),- ConnectedStyleLoadEventPlan::NonBlockingModulepreload { .. },- )- | (- Self::NonBlockingModulepreload(_),- ConnectedStyleLoadEventPlan::LoadDelaying { .. },- ) => false,+ (Self::LoadDelaying(_), ConnectedStyleLoadEventPlan::NonBlockingLink { .. })+ | (Self::NonBlockingLink(_), ConnectedStyleLoadEventPlan::LoadDelaying { .. }) => false,}}@@ -251,7 +245,7 @@ impl ConnectedStyleLoadEventAdmission {) -> Option<MainDocumentStyleLoadEventBinding> {match self {Self::LoadDelaying(binding) => Some(binding),- Self::NonBlockingModulepreload(_) => None,+ Self::NonBlockingLink(_) => None,}}}