diff options
Diffstat (limited to 'components/shared')
-rw-r--r-- | components/shared/constellation/from_script_message.rs | 4 | ||||
-rw-r--r-- | components/shared/devtools/lib.rs | 2 | ||||
-rw-r--r-- | components/shared/embedder/resources.rs | 38 | ||||
-rw-r--r-- | components/shared/net/image_cache.rs | 6 | ||||
-rw-r--r-- | components/shared/script_layout/lib.rs | 2 |
5 files changed, 14 insertions, 38 deletions
diff --git a/components/shared/constellation/from_script_message.rs b/components/shared/constellation/from_script_message.rs index ddc9f788617..21665c24e57 100644 --- a/components/shared/constellation/from_script_message.rs +++ b/components/shared/constellation/from_script_message.rs @@ -22,6 +22,7 @@ use euclid::default::Size2D as UntypedSize2D; use http::{HeaderMap, Method}; use ipc_channel::Error as IpcError; use ipc_channel::ipc::{IpcReceiver, IpcSender}; +use net_traits::policy_container::PolicyContainer; use net_traits::request::{InsecureRequestsPolicy, Referrer, RequestBody}; use net_traits::storage_thread::StorageType; use net_traits::{CoreResourceMsg, ReferrerPolicy, ResourceThreads}; @@ -97,6 +98,8 @@ pub struct LoadData { pub referrer: Referrer, /// The referrer policy. pub referrer_policy: ReferrerPolicy, + /// The policy container. + pub policy_container: Option<PolicyContainer>, /// The source to use instead of a network response for a srcdoc document. pub srcdoc: String, @@ -143,6 +146,7 @@ impl LoadData { js_eval_result: None, referrer, referrer_policy, + policy_container: None, srcdoc: "".to_string(), inherited_secure_context, crash: None, diff --git a/components/shared/devtools/lib.rs b/components/shared/devtools/lib.rs index c07f4529073..628d76bd25d 100644 --- a/components/shared/devtools/lib.rs +++ b/components/shared/devtools/lib.rs @@ -273,6 +273,8 @@ pub enum DevtoolScriptControlMsg { GetCssDatabase(IpcSender<HashMap<String, CssDatabaseProperty>>), /// Simulates a light or dark color scheme for the given pipeline SimulateColorScheme(PipelineId, Theme), + /// Highlight the given DOM node + HighlightDomNode(PipelineId, Option<String>), } #[derive(Clone, Debug, Deserialize, Serialize)] diff --git a/components/shared/embedder/resources.rs b/components/shared/embedder/resources.rs index 29e64bf9629..830a403698e 100644 --- a/components/shared/embedder/resources.rs +++ b/components/shared/embedder/resources.rs @@ -91,18 +91,6 @@ pub enum Resource { /// The message can contain a placeholder `${reason}` for the error code. /// It can be empty but then nothing will be displayed when an internal error occurs. NetErrorHTML, - /// A CSS file to style the user agent stylesheet. - /// It can be empty but then there's simply no user agent stylesheet. - UserAgentCSS, - /// A CSS file to style the Servo browser. - /// It can be empty but several features might not work as expected. - ServoCSS, - /// A CSS file to style the presentational hints. - /// It can be empty but then presentational hints will not be styled. - PresentationalHintsCSS, - /// A CSS file to style the quirks mode. - /// It can be empty but then quirks mode will not be styled. - QuirksModeCSS, /// A placeholder image to display if we couldn't get the requested image. /// /// ## Panic @@ -110,12 +98,6 @@ pub enum Resource { /// If the resource is not provided, servo will fallback to a baked in default (See resources/rippy.png). /// However, if the image is provided but invalid, Servo will crash. RippyPNG, - /// A CSS file to style the media controls. - /// It can be empty but then media controls will not be styled. - MediaControlsCSS, - /// A JS file to control the media controls. - /// It can be empty but then media controls will not work. - MediaControlsJS, /// A placeholder HTML page to display when the code responsible for rendering a page panics and the original /// page can no longer be displayed. /// The message can contain a placeholder `${details}` for the error details. @@ -137,13 +119,7 @@ impl Resource { Resource::HstsPreloadList => "hsts_preload.json", Resource::BadCertHTML => "badcert.html", Resource::NetErrorHTML => "neterror.html", - Resource::UserAgentCSS => "user-agent.css", - Resource::ServoCSS => "servo.css", - Resource::PresentationalHintsCSS => "presentational-hints.css", - Resource::QuirksModeCSS => "quirks-mode.css", Resource::RippyPNG => "rippy.png", - Resource::MediaControlsCSS => "media-controls.css", - Resource::MediaControlsJS => "media-controls.js", Resource::CrashHTML => "crash.html", Resource::DirectoryListingHTML => "directory-listing.html", Resource::AboutMemoryHTML => "about-memory.html", @@ -183,21 +159,7 @@ fn resources_for_tests() -> Box<dyn ResourceReaderMethods + Sync + Send> { }, Resource::BadCertHTML => &include_bytes!("../../../resources/badcert.html")[..], Resource::NetErrorHTML => &include_bytes!("../../../resources/neterror.html")[..], - Resource::UserAgentCSS => &include_bytes!("../../../resources/user-agent.css")[..], - Resource::ServoCSS => &include_bytes!("../../../resources/servo.css")[..], - Resource::PresentationalHintsCSS => { - &include_bytes!("../../../resources/presentational-hints.css")[..] - }, - Resource::QuirksModeCSS => { - &include_bytes!("../../../resources/quirks-mode.css")[..] - }, Resource::RippyPNG => &include_bytes!("../../../resources/rippy.png")[..], - Resource::MediaControlsCSS => { - &include_bytes!("../../../resources/media-controls.css")[..] - }, - Resource::MediaControlsJS => { - &include_bytes!("../../../resources/media-controls.js")[..] - }, Resource::CrashHTML => &include_bytes!("../../../resources/crash.html")[..], Resource::DirectoryListingHTML => { &include_bytes!("../../../resources/directory-listing.html")[..] diff --git a/components/shared/net/image_cache.rs b/components/shared/net/image_cache.rs index 8fb329d304f..3f316388755 100644 --- a/components/shared/net/image_cache.rs +++ b/components/shared/net/image_cache.rs @@ -141,4 +141,10 @@ pub trait ImageCache: Sync + Send { /// Inform the image cache about a response for a pending request. fn notify_pending_response(&self, id: PendingImageId, action: FetchResponseMsg); + + /// Create new image cache based on this one, while reusing the existing thread_pool. + fn create_new_image_cache( + &self, + compositor_api: CrossProcessCompositorApi, + ) -> Arc<dyn ImageCache>; } diff --git a/components/shared/script_layout/lib.rs b/components/shared/script_layout/lib.rs index 66baccd5147..8c5d4edc4e0 100644 --- a/components/shared/script_layout/lib.rs +++ b/components/shared/script_layout/lib.rs @@ -428,6 +428,8 @@ pub struct ReflowRequest { pub node_to_image_animation_map: FxHashMap<OpaqueNode, ImageAnimationState>, /// The theme for the window pub theme: PrefersColorScheme, + /// The node highlighted by the devtools, if any + pub highlighted_dom_node: Option<OpaqueNode>, } /// A pending restyle. |