mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Support CORS attributes for image elements.
This commit is contained in:
parent
583536c940
commit
1df8d57dc6
102 changed files with 277 additions and 363 deletions
|
@ -442,13 +442,19 @@ pub mod utils {
|
|||
use crate::dom::window::Window;
|
||||
use net_traits::image_cache::CanRequestImages;
|
||||
use net_traits::image_cache::{ImageOrMetadataAvailable, ImageResponse, UsePlaceholder};
|
||||
use net_traits::request::CorsSettings;
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
pub fn request_image_from_cache(window: &Window, url: ServoUrl) -> ImageResponse {
|
||||
pub fn request_image_from_cache(
|
||||
window: &Window,
|
||||
url: ServoUrl,
|
||||
cors_setting: Option<CorsSettings>,
|
||||
) -> ImageResponse {
|
||||
let image_cache = window.image_cache();
|
||||
let response = image_cache.find_image_or_metadata(
|
||||
url.into(),
|
||||
window.origin().immutable().clone(),
|
||||
cors_setting,
|
||||
UsePlaceholder::No,
|
||||
CanRequestImages::No,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue