mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -126,6 +126,7 @@ impl<'a> LayoutContext<'a> {
|
||||||
let result = self.image_cache.find_image_or_metadata(
|
let result = self.image_cache.find_image_or_metadata(
|
||||||
url.clone(),
|
url.clone(),
|
||||||
self.origin.clone(),
|
self.origin.clone(),
|
||||||
|
None,
|
||||||
use_placeholder,
|
use_placeholder,
|
||||||
can_request,
|
can_request,
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,6 +8,7 @@ use net_traits::image::base::{load_from_memory, Image, ImageMetadata};
|
||||||
use net_traits::image_cache::{CanRequestImages, CorsStatus, ImageCache, ImageResponder};
|
use net_traits::image_cache::{CanRequestImages, CorsStatus, ImageCache, ImageResponder};
|
||||||
use net_traits::image_cache::{ImageOrMetadataAvailable, ImageResponse, ImageState};
|
use net_traits::image_cache::{ImageOrMetadataAvailable, ImageResponse, ImageState};
|
||||||
use net_traits::image_cache::{PendingImageId, UsePlaceholder};
|
use net_traits::image_cache::{PendingImageId, UsePlaceholder};
|
||||||
|
use net_traits::request::CorsSettings;
|
||||||
use net_traits::{FetchMetadata, FetchResponseMsg, FilteredMetadata, NetworkError};
|
use net_traits::{FetchMetadata, FetchResponseMsg, FilteredMetadata, NetworkError};
|
||||||
use pixels::PixelFormat;
|
use pixels::PixelFormat;
|
||||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||||
|
@ -92,6 +93,9 @@ fn set_webrender_image_key(webrender_api: &webrender_api::RenderApi, image: &mut
|
||||||
// Aux structs and enums.
|
// Aux structs and enums.
|
||||||
// ======================================================================
|
// ======================================================================
|
||||||
|
|
||||||
|
/// https://html.spec.whatwg.org/multipage/#list-of-available-images
|
||||||
|
type ImageKey = (ServoUrl, ImmutableOrigin, Option<CorsSettings>);
|
||||||
|
|
||||||
// Represents all the currently pending loads/decodings. For
|
// Represents all the currently pending loads/decodings. For
|
||||||
// performance reasons, loads are indexed by a dedicated load key.
|
// performance reasons, loads are indexed by a dedicated load key.
|
||||||
struct AllPendingLoads {
|
struct AllPendingLoads {
|
||||||
|
@ -101,7 +105,7 @@ struct AllPendingLoads {
|
||||||
|
|
||||||
// Get a load key from its url and requesting origin. Used ony when starting and
|
// Get a load key from its url and requesting origin. Used ony when starting and
|
||||||
// finishing a load or when adding a new listener.
|
// finishing a load or when adding a new listener.
|
||||||
url_to_load_key: HashMap<(ServoUrl, ImmutableOrigin), LoadKey>,
|
url_to_load_key: HashMap<ImageKey, LoadKey>,
|
||||||
|
|
||||||
// A counter used to generate instances of LoadKey
|
// A counter used to generate instances of LoadKey
|
||||||
keygen: LoadKeyGenerator,
|
keygen: LoadKeyGenerator,
|
||||||
|
@ -124,7 +128,11 @@ impl AllPendingLoads {
|
||||||
fn remove(&mut self, key: &LoadKey) -> Option<PendingLoad> {
|
fn remove(&mut self, key: &LoadKey) -> Option<PendingLoad> {
|
||||||
self.loads.remove(key).and_then(|pending_load| {
|
self.loads.remove(key).and_then(|pending_load| {
|
||||||
self.url_to_load_key
|
self.url_to_load_key
|
||||||
.remove(&(pending_load.url.clone(), pending_load.load_origin.clone()))
|
.remove(&(
|
||||||
|
pending_load.url.clone(),
|
||||||
|
pending_load.load_origin.clone(),
|
||||||
|
pending_load.cors_setting,
|
||||||
|
))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
Some(pending_load)
|
Some(pending_load)
|
||||||
})
|
})
|
||||||
|
@ -134,9 +142,13 @@ impl AllPendingLoads {
|
||||||
&'a mut self,
|
&'a mut self,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
origin: ImmutableOrigin,
|
origin: ImmutableOrigin,
|
||||||
|
cors_status: Option<CorsSettings>,
|
||||||
can_request: CanRequestImages,
|
can_request: CanRequestImages,
|
||||||
) -> CacheResult<'a> {
|
) -> CacheResult<'a> {
|
||||||
match self.url_to_load_key.entry((url.clone(), origin.clone())) {
|
match self
|
||||||
|
.url_to_load_key
|
||||||
|
.entry((url.clone(), origin.clone(), cors_status))
|
||||||
|
{
|
||||||
Occupied(url_entry) => {
|
Occupied(url_entry) => {
|
||||||
let load_key = url_entry.get();
|
let load_key = url_entry.get();
|
||||||
CacheResult::Hit(*load_key, self.loads.get_mut(load_key).unwrap())
|
CacheResult::Hit(*load_key, self.loads.get_mut(load_key).unwrap())
|
||||||
|
@ -149,7 +161,7 @@ impl AllPendingLoads {
|
||||||
let load_key = self.keygen.next();
|
let load_key = self.keygen.next();
|
||||||
url_entry.insert(load_key);
|
url_entry.insert(load_key);
|
||||||
|
|
||||||
let pending_load = PendingLoad::new(url, origin);
|
let pending_load = PendingLoad::new(url, origin, cors_status);
|
||||||
match self.loads.entry(load_key) {
|
match self.loads.entry(load_key) {
|
||||||
Occupied(_) => unreachable!(),
|
Occupied(_) => unreachable!(),
|
||||||
Vacant(load_entry) => {
|
Vacant(load_entry) => {
|
||||||
|
@ -274,6 +286,9 @@ struct PendingLoad {
|
||||||
/// The origin that requested this load.
|
/// The origin that requested this load.
|
||||||
load_origin: ImmutableOrigin,
|
load_origin: ImmutableOrigin,
|
||||||
|
|
||||||
|
/// The CORS attribute setting for the requesting
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
|
|
||||||
/// The CORS status of this image response.
|
/// The CORS status of this image response.
|
||||||
cors_status: CorsStatus,
|
cors_status: CorsStatus,
|
||||||
|
|
||||||
|
@ -282,7 +297,11 @@ struct PendingLoad {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PendingLoad {
|
impl PendingLoad {
|
||||||
fn new(url: ServoUrl, load_origin: ImmutableOrigin) -> PendingLoad {
|
fn new(
|
||||||
|
url: ServoUrl,
|
||||||
|
load_origin: ImmutableOrigin,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
|
) -> PendingLoad {
|
||||||
PendingLoad {
|
PendingLoad {
|
||||||
bytes: ImageBytes::InProgress(vec![]),
|
bytes: ImageBytes::InProgress(vec![]),
|
||||||
metadata: None,
|
metadata: None,
|
||||||
|
@ -291,6 +310,7 @@ impl PendingLoad {
|
||||||
url: url,
|
url: url,
|
||||||
load_origin,
|
load_origin,
|
||||||
final_url: None,
|
final_url: None,
|
||||||
|
cors_setting,
|
||||||
cors_status: CorsStatus::Unsafe,
|
cors_status: CorsStatus::Unsafe,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -308,7 +328,7 @@ struct ImageCacheStore {
|
||||||
pending_loads: AllPendingLoads,
|
pending_loads: AllPendingLoads,
|
||||||
|
|
||||||
// Images that have finished loading (successful or not)
|
// Images that have finished loading (successful or not)
|
||||||
completed_loads: HashMap<(ServoUrl, ImmutableOrigin), CompletedLoad>,
|
completed_loads: HashMap<ImageKey, CompletedLoad>,
|
||||||
|
|
||||||
// The placeholder image used when an image fails to load
|
// The placeholder image used when an image fails to load
|
||||||
placeholder_image: Option<Arc<Image>>,
|
placeholder_image: Option<Arc<Image>>,
|
||||||
|
@ -346,7 +366,11 @@ impl ImageCacheStore {
|
||||||
|
|
||||||
let completed_load = CompletedLoad::new(image_response.clone(), key);
|
let completed_load = CompletedLoad::new(image_response.clone(), key);
|
||||||
self.completed_loads.insert(
|
self.completed_loads.insert(
|
||||||
(pending_load.url.into(), pending_load.load_origin),
|
(
|
||||||
|
pending_load.url.into(),
|
||||||
|
pending_load.load_origin,
|
||||||
|
pending_load.cors_setting,
|
||||||
|
),
|
||||||
completed_load,
|
completed_load,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -361,10 +385,11 @@ impl ImageCacheStore {
|
||||||
&self,
|
&self,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
origin: ImmutableOrigin,
|
origin: ImmutableOrigin,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
placeholder: UsePlaceholder,
|
placeholder: UsePlaceholder,
|
||||||
) -> Option<Result<ImageOrMetadataAvailable, ImageState>> {
|
) -> Option<Result<ImageOrMetadataAvailable, ImageState>> {
|
||||||
self.completed_loads
|
self.completed_loads
|
||||||
.get(&(url, origin))
|
.get(&(url, origin, cors_setting))
|
||||||
.map(
|
.map(
|
||||||
|completed_load| match (&completed_load.image_response, placeholder) {
|
|completed_load| match (&completed_load.image_response, placeholder) {
|
||||||
(&ImageResponse::Loaded(ref image, ref url), _) |
|
(&ImageResponse::Loaded(ref image, ref url), _) |
|
||||||
|
@ -421,22 +446,29 @@ impl ImageCache for ImageCacheImpl {
|
||||||
&self,
|
&self,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
origin: ImmutableOrigin,
|
origin: ImmutableOrigin,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
use_placeholder: UsePlaceholder,
|
use_placeholder: UsePlaceholder,
|
||||||
can_request: CanRequestImages,
|
can_request: CanRequestImages,
|
||||||
) -> Result<ImageOrMetadataAvailable, ImageState> {
|
) -> Result<ImageOrMetadataAvailable, ImageState> {
|
||||||
debug!("Find image or metadata for {} ({:?})", url, origin);
|
debug!("Find image or metadata for {} ({:?})", url, origin);
|
||||||
let mut store = self.store.lock().unwrap();
|
let mut store = self.store.lock().unwrap();
|
||||||
if let Some(result) =
|
if let Some(result) = store.get_completed_image_if_available(
|
||||||
store.get_completed_image_if_available(url.clone(), origin.clone(), use_placeholder)
|
url.clone(),
|
||||||
{
|
origin.clone(),
|
||||||
|
cors_setting,
|
||||||
|
use_placeholder,
|
||||||
|
) {
|
||||||
debug!("{} is available", url);
|
debug!("{} is available", url);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
let decoded = {
|
let decoded = {
|
||||||
let result = store
|
let result = store.pending_loads.get_cached(
|
||||||
.pending_loads
|
url.clone(),
|
||||||
.get_cached(url.clone(), origin.clone(), can_request);
|
origin.clone(),
|
||||||
|
cors_setting,
|
||||||
|
can_request,
|
||||||
|
);
|
||||||
match result {
|
match result {
|
||||||
CacheResult::Hit(key, pl) => match (&pl.result, &pl.metadata) {
|
CacheResult::Hit(key, pl) => match (&pl.result, &pl.metadata) {
|
||||||
(&Some(Ok(_)), _) => {
|
(&Some(Ok(_)), _) => {
|
||||||
|
@ -468,7 +500,7 @@ impl ImageCache for ImageCacheImpl {
|
||||||
// and ignore the async decode when it finishes later.
|
// and ignore the async decode when it finishes later.
|
||||||
// TODO: make this behaviour configurable according to the caller's needs.
|
// TODO: make this behaviour configurable according to the caller's needs.
|
||||||
store.handle_decoder(decoded);
|
store.handle_decoder(decoded);
|
||||||
match store.get_completed_image_if_available(url, origin, use_placeholder) {
|
match store.get_completed_image_if_available(url, origin, cors_setting, use_placeholder) {
|
||||||
Some(result) => result,
|
Some(result) => result,
|
||||||
None => Err(ImageState::LoadError),
|
None => Err(ImageState::LoadError),
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::image::base::{Image, ImageMetadata};
|
use crate::image::base::{Image, ImageMetadata};
|
||||||
|
use crate::request::CorsSettings;
|
||||||
use crate::FetchResponseMsg;
|
use crate::FetchResponseMsg;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||||
|
@ -111,6 +112,7 @@ pub trait ImageCache: Sync + Send {
|
||||||
&self,
|
&self,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
origin: ImmutableOrigin,
|
origin: ImmutableOrigin,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
use_placeholder: UsePlaceholder,
|
use_placeholder: UsePlaceholder,
|
||||||
can_request: CanRequestImages,
|
can_request: CanRequestImages,
|
||||||
) -> Result<ImageOrMetadataAvailable, ImageState>;
|
) -> Result<ImageOrMetadataAvailable, ImageState>;
|
||||||
|
|
|
@ -10,7 +10,7 @@ use msg::constellation_msg::PipelineId;
|
||||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||||
|
|
||||||
/// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator)
|
/// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator)
|
||||||
#[derive(Clone, Copy, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
|
||||||
pub enum Initiator {
|
pub enum Initiator {
|
||||||
None,
|
None,
|
||||||
Download,
|
Download,
|
||||||
|
@ -128,7 +128,7 @@ pub enum Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [CORS settings attribute](https://html.spec.whatwg.org/multipage/#attr-crossorigin-anonymous)
|
/// [CORS settings attribute](https://html.spec.whatwg.org/multipage/#attr-crossorigin-anonymous)
|
||||||
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||||
pub enum CorsSettings {
|
pub enum CorsSettings {
|
||||||
Anonymous,
|
Anonymous,
|
||||||
UseCredentials,
|
UseCredentials,
|
||||||
|
@ -178,6 +178,7 @@ pub struct RequestBuilder {
|
||||||
// to keep track of redirects
|
// to keep track of redirects
|
||||||
pub url_list: Vec<ServoUrl>,
|
pub url_list: Vec<ServoUrl>,
|
||||||
pub parser_metadata: ParserMetadata,
|
pub parser_metadata: ParserMetadata,
|
||||||
|
pub initiator: Initiator,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RequestBuilder {
|
impl RequestBuilder {
|
||||||
|
@ -204,9 +205,15 @@ impl RequestBuilder {
|
||||||
integrity_metadata: "".to_owned(),
|
integrity_metadata: "".to_owned(),
|
||||||
url_list: vec![],
|
url_list: vec![],
|
||||||
parser_metadata: ParserMetadata::Default,
|
parser_metadata: ParserMetadata::Default,
|
||||||
|
initiator: Initiator::None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn initiator(mut self, initiator: Initiator) -> RequestBuilder {
|
||||||
|
self.initiator = initiator;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn method(mut self, method: Method) -> RequestBuilder {
|
pub fn method(mut self, method: Method) -> RequestBuilder {
|
||||||
self.method = method;
|
self.method = method;
|
||||||
self
|
self
|
||||||
|
@ -298,6 +305,7 @@ impl RequestBuilder {
|
||||||
Some(Origin::Origin(self.origin)),
|
Some(Origin::Origin(self.origin)),
|
||||||
self.pipeline_id,
|
self.pipeline_id,
|
||||||
);
|
);
|
||||||
|
request.initiator = self.initiator;
|
||||||
request.method = self.method;
|
request.method = self.method;
|
||||||
request.headers = self.headers;
|
request.headers = self.headers;
|
||||||
request.unsafe_request = self.unsafe_request;
|
request.unsafe_request = self.unsafe_request;
|
||||||
|
|
|
@ -19,6 +19,7 @@ use crate::dom::bindings::root::{Dom, DomRoot, LayoutDom};
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
use crate::dom::canvasgradient::{CanvasGradient, CanvasGradientStyle, ToFillOrStrokeStyle};
|
use crate::dom::canvasgradient::{CanvasGradient, CanvasGradientStyle, ToFillOrStrokeStyle};
|
||||||
use crate::dom::canvaspattern::CanvasPattern;
|
use crate::dom::canvaspattern::CanvasPattern;
|
||||||
|
use crate::dom::element::cors_setting_for_element;
|
||||||
use crate::dom::element::Element;
|
use crate::dom::element::Element;
|
||||||
use crate::dom::globalscope::GlobalScope;
|
use crate::dom::globalscope::GlobalScope;
|
||||||
use crate::dom::htmlcanvaselement::{CanvasContext, HTMLCanvasElement};
|
use crate::dom::htmlcanvaselement::{CanvasContext, HTMLCanvasElement};
|
||||||
|
@ -45,6 +46,7 @@ use net_traits::image_cache::ImageOrMetadataAvailable;
|
||||||
use net_traits::image_cache::ImageResponse;
|
use net_traits::image_cache::ImageResponse;
|
||||||
use net_traits::image_cache::ImageState;
|
use net_traits::image_cache::ImageState;
|
||||||
use net_traits::image_cache::UsePlaceholder;
|
use net_traits::image_cache::UsePlaceholder;
|
||||||
|
use net_traits::request::CorsSettings;
|
||||||
use pixels::PixelFormat;
|
use pixels::PixelFormat;
|
||||||
use profile_traits::ipc as profiled_ipc;
|
use profile_traits::ipc as profiled_ipc;
|
||||||
use script_traits::ScriptMsg;
|
use script_traits::ScriptMsg;
|
||||||
|
@ -210,8 +212,12 @@ impl CanvasState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fetch_image_data(&self, url: ServoUrl) -> Option<(Vec<u8>, Size2D<u32>)> {
|
fn fetch_image_data(
|
||||||
let img = match self.request_image_from_cache(url) {
|
&self,
|
||||||
|
url: ServoUrl,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
|
) -> Option<(Vec<u8>, Size2D<u32>)> {
|
||||||
|
let img = match self.request_image_from_cache(url, cors_setting) {
|
||||||
ImageResponse::Loaded(img, _) => img,
|
ImageResponse::Loaded(img, _) => img,
|
||||||
ImageResponse::PlaceholderLoaded(_, _) |
|
ImageResponse::PlaceholderLoaded(_, _) |
|
||||||
ImageResponse::None |
|
ImageResponse::None |
|
||||||
|
@ -229,11 +235,15 @@ impl CanvasState {
|
||||||
Some((image_data, image_size))
|
Some((image_data, image_size))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
fn request_image_from_cache(
|
||||||
fn request_image_from_cache(&self, url: ServoUrl) -> ImageResponse {
|
&self,
|
||||||
|
url: ServoUrl,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
|
) -> ImageResponse {
|
||||||
let response = self.image_cache.find_image_or_metadata(
|
let response = self.image_cache.find_image_or_metadata(
|
||||||
url.clone(),
|
url.clone(),
|
||||||
self.origin.clone(),
|
self.origin.clone(),
|
||||||
|
cors_setting,
|
||||||
UsePlaceholder::No,
|
UsePlaceholder::No,
|
||||||
CanRequestImages::No,
|
CanRequestImages::No,
|
||||||
);
|
);
|
||||||
|
@ -353,13 +363,28 @@ impl CanvasState {
|
||||||
// If the image argument is an HTMLImageElement object that is in the broken state,
|
// If the image argument is an HTMLImageElement object that is in the broken state,
|
||||||
// then throw an InvalidStateError exception
|
// then throw an InvalidStateError exception
|
||||||
let url = image.get_url().ok_or(Error::InvalidState)?;
|
let url = image.get_url().ok_or(Error::InvalidState)?;
|
||||||
self.fetch_and_draw_image_data(htmlcanvas, url, sx, sy, sw, sh, dx, dy, dw, dh)
|
let cors_setting = cors_setting_for_element(image.upcast());
|
||||||
|
self.fetch_and_draw_image_data(
|
||||||
|
htmlcanvas,
|
||||||
|
url,
|
||||||
|
cors_setting,
|
||||||
|
sx,
|
||||||
|
sy,
|
||||||
|
sw,
|
||||||
|
sh,
|
||||||
|
dx,
|
||||||
|
dy,
|
||||||
|
dw,
|
||||||
|
dh,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
CanvasImageSource::CSSStyleValue(ref value) => {
|
CanvasImageSource::CSSStyleValue(ref value) => {
|
||||||
let url = value
|
let url = value
|
||||||
.get_url(self.base_url.clone())
|
.get_url(self.base_url.clone())
|
||||||
.ok_or(Error::InvalidState)?;
|
.ok_or(Error::InvalidState)?;
|
||||||
self.fetch_and_draw_image_data(htmlcanvas, url, sx, sy, sw, sh, dx, dy, dw, dh)
|
self.fetch_and_draw_image_data(
|
||||||
|
htmlcanvas, url, None, sx, sy, sw, sh, dx, dy, dw, dh,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -435,6 +460,7 @@ impl CanvasState {
|
||||||
&self,
|
&self,
|
||||||
canvas: Option<&HTMLCanvasElement>,
|
canvas: Option<&HTMLCanvasElement>,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
sx: f64,
|
sx: f64,
|
||||||
sy: f64,
|
sy: f64,
|
||||||
sw: Option<f64>,
|
sw: Option<f64>,
|
||||||
|
@ -445,7 +471,9 @@ impl CanvasState {
|
||||||
dh: Option<f64>,
|
dh: Option<f64>,
|
||||||
) -> ErrorResult {
|
) -> ErrorResult {
|
||||||
debug!("Fetching image {}.", url);
|
debug!("Fetching image {}.", url);
|
||||||
let (mut image_data, image_size) = self.fetch_image_data(url).ok_or(Error::InvalidState)?;
|
let (mut image_data, image_size) = self
|
||||||
|
.fetch_image_data(url, cors_setting)
|
||||||
|
.ok_or(Error::InvalidState)?;
|
||||||
pixels::rgba8_premultiply_inplace(&mut image_data);
|
pixels::rgba8_premultiply_inplace(&mut image_data);
|
||||||
let image_size = image_size.to_f64();
|
let image_size = image_size.to_f64();
|
||||||
|
|
||||||
|
@ -788,7 +816,9 @@ impl CanvasState {
|
||||||
// then throw an InvalidStateError exception
|
// then throw an InvalidStateError exception
|
||||||
image
|
image
|
||||||
.get_url()
|
.get_url()
|
||||||
.and_then(|url| self.fetch_image_data(url))
|
.and_then(|url| {
|
||||||
|
self.fetch_image_data(url, cors_setting_for_element(image.upcast()))
|
||||||
|
})
|
||||||
.ok_or(Error::InvalidState)?
|
.ok_or(Error::InvalidState)?
|
||||||
},
|
},
|
||||||
CanvasImageSource::HTMLCanvasElement(ref canvas) => {
|
CanvasImageSource::HTMLCanvasElement(ref canvas) => {
|
||||||
|
@ -800,7 +830,7 @@ impl CanvasState {
|
||||||
},
|
},
|
||||||
CanvasImageSource::CSSStyleValue(ref value) => value
|
CanvasImageSource::CSSStyleValue(ref value) => value
|
||||||
.get_url(self.base_url.clone())
|
.get_url(self.base_url.clone())
|
||||||
.and_then(|url| self.fetch_image_data(url))
|
.and_then(|url| self.fetch_image_data(url, None))
|
||||||
.ok_or(Error::InvalidState)?,
|
.ok_or(Error::InvalidState)?,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ use crate::dom::create::create_element;
|
||||||
use crate::dom::customelementregistry::{
|
use crate::dom::customelementregistry::{
|
||||||
CallbackReaction, CustomElementDefinition, CustomElementReaction, CustomElementState,
|
CallbackReaction, CustomElementDefinition, CustomElementReaction, CustomElementState,
|
||||||
};
|
};
|
||||||
use crate::dom::document::{Document, LayoutDocumentHelpers};
|
use crate::dom::document::{determine_policy_for_token, Document, LayoutDocumentHelpers};
|
||||||
use crate::dom::documentfragment::DocumentFragment;
|
use crate::dom::documentfragment::DocumentFragment;
|
||||||
use crate::dom::domrect::DOMRect;
|
use crate::dom::domrect::DOMRect;
|
||||||
use crate::dom::domtokenlist::DOMTokenList;
|
use crate::dom::domtokenlist::DOMTokenList;
|
||||||
|
@ -97,6 +97,7 @@ use js::jsapi::Heap;
|
||||||
use js::jsval::JSVal;
|
use js::jsval::JSVal;
|
||||||
use msg::constellation_msg::InputMethodType;
|
use msg::constellation_msg::InputMethodType;
|
||||||
use net_traits::request::CorsSettings;
|
use net_traits::request::CorsSettings;
|
||||||
|
use net_traits::ReferrerPolicy;
|
||||||
use ref_filter_map::ref_filter_map;
|
use ref_filter_map::ref_filter_map;
|
||||||
use script_layout_interface::message::ReflowGoal;
|
use script_layout_interface::message::ReflowGoal;
|
||||||
use selectors::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
|
use selectors::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
|
||||||
|
@ -3606,7 +3607,14 @@ pub fn set_cross_origin_attribute(element: &Element, value: Option<DOMString>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cors_setting_for_element(element: &Element) -> Option<CorsSettings> {
|
pub(crate) fn referrer_policy_for_element(element: &Element) -> Option<ReferrerPolicy> {
|
||||||
|
element
|
||||||
|
.get_attribute_by_name(DOMString::from_string(String::from("referrerpolicy")))
|
||||||
|
.and_then(|attribute: DomRoot<Attr>| determine_policy_for_token(&attribute.Value()))
|
||||||
|
.or_else(|| document_from_node(element).get_referrer_policy())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn cors_setting_for_element(element: &Element) -> Option<CorsSettings> {
|
||||||
reflect_cross_origin_attribute(element).map_or(None, |attr| match &*attr {
|
reflect_cross_origin_attribute(element).map_or(None, |attr| match &*attr {
|
||||||
"anonymous" => Some(CorsSettings::Anonymous),
|
"anonymous" => Some(CorsSettings::Anonymous),
|
||||||
"use-credentials" => Some(CorsSettings::UseCredentials),
|
"use-credentials" => Some(CorsSettings::UseCredentials),
|
||||||
|
|
|
@ -18,7 +18,7 @@ use crate::dom::eventtarget::EventTarget;
|
||||||
use crate::dom::globalscope::GlobalScope;
|
use crate::dom::globalscope::GlobalScope;
|
||||||
use crate::dom::messageevent::MessageEvent;
|
use crate::dom::messageevent::MessageEvent;
|
||||||
use crate::dom::performanceresourcetiming::InitiatorType;
|
use crate::dom::performanceresourcetiming::InitiatorType;
|
||||||
use crate::fetch::FetchCanceller;
|
use crate::fetch::{create_a_potential_CORS_request, FetchCanceller};
|
||||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||||
use crate::task_source::{TaskSource, TaskSourceName};
|
use crate::task_source::{TaskSource, TaskSourceName};
|
||||||
use crate::timers::OneshotTimerCallback;
|
use crate::timers::OneshotTimerCallback;
|
||||||
|
@ -31,8 +31,7 @@ use ipc_channel::router::ROUTER;
|
||||||
use js::conversions::ToJSValConvertible;
|
use js::conversions::ToJSValConvertible;
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
use mime::{self, Mime};
|
use mime::{self, Mime};
|
||||||
use net_traits::request::{CacheMode, CorsSettings, CredentialsMode};
|
use net_traits::request::{CacheMode, CorsSettings, Destination, RequestBuilder};
|
||||||
use net_traits::request::{RequestBuilder, RequestMode};
|
|
||||||
use net_traits::{CoreResourceMsg, FetchChannels, FetchMetadata};
|
use net_traits::{CoreResourceMsg, FetchChannels, FetchMetadata};
|
||||||
use net_traits::{FetchResponseListener, FetchResponseMsg, NetworkError};
|
use net_traits::{FetchResponseListener, FetchResponseMsg, NetworkError};
|
||||||
use net_traits::{ResourceFetchTiming, ResourceTimingType};
|
use net_traits::{ResourceFetchTiming, ResourceTimingType};
|
||||||
|
@ -516,17 +515,14 @@ impl EventSource {
|
||||||
};
|
};
|
||||||
// Step 8
|
// Step 8
|
||||||
// TODO: Step 9 set request's client settings
|
// TODO: Step 9 set request's client settings
|
||||||
let mut request = RequestBuilder::new(url_record)
|
let mut request = create_a_potential_CORS_request(
|
||||||
.origin(global.origin().immutable().clone())
|
url_record,
|
||||||
.pipeline_id(Some(global.pipeline_id()))
|
Destination::None,
|
||||||
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
Some(cors_attribute_state),
|
||||||
.use_url_credentials(true)
|
Some(true),
|
||||||
.mode(RequestMode::CorsMode)
|
)
|
||||||
.credentials_mode(if cors_attribute_state == CorsSettings::Anonymous {
|
.origin(global.origin().immutable().clone())
|
||||||
CredentialsMode::CredentialsSameOrigin
|
.pipeline_id(Some(global.pipeline_id()));
|
||||||
} else {
|
|
||||||
CredentialsMode::Include
|
|
||||||
});
|
|
||||||
|
|
||||||
// Step 10
|
// Step 10
|
||||||
// TODO(eijebong): Replace once typed headers allow it
|
// TODO(eijebong): Replace once typed headers allow it
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::activation::Activatable;
|
use crate::dom::activation::Activatable;
|
||||||
use crate::dom::attr::Attr;
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
|
use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::HTMLAnchorElementBinding;
|
use crate::dom::bindings::codegen::Bindings::HTMLAnchorElementBinding;
|
||||||
|
@ -14,10 +13,9 @@ use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::refcounted::Trusted;
|
use crate::dom::bindings::refcounted::Trusted;
|
||||||
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
|
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
|
||||||
use crate::dom::bindings::str::{DOMString, USVString};
|
use crate::dom::bindings::str::{DOMString, USVString};
|
||||||
use crate::dom::document::determine_policy_for_token;
|
|
||||||
use crate::dom::document::Document;
|
use crate::dom::document::Document;
|
||||||
use crate::dom::domtokenlist::DOMTokenList;
|
use crate::dom::domtokenlist::DOMTokenList;
|
||||||
use crate::dom::element::Element;
|
use crate::dom::element::{referrer_policy_for_element, Element};
|
||||||
use crate::dom::event::Event;
|
use crate::dom::event::Event;
|
||||||
use crate::dom::eventtarget::EventTarget;
|
use crate::dom::eventtarget::EventTarget;
|
||||||
use crate::dom::globalscope::GlobalScope;
|
use crate::dom::globalscope::GlobalScope;
|
||||||
|
@ -669,9 +667,7 @@ pub fn follow_hyperlink(subject: &Element, hyperlink_suffix: Option<String>) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Step 12.
|
// Step 12.
|
||||||
let referrer_policy = subject
|
let referrer_policy = referrer_policy_for_element(subject);
|
||||||
.get_attribute_by_name(DOMString::from_string(String::from("referrerpolicy")))
|
|
||||||
.and_then(|attribute: DomRoot<Attr>| (determine_policy_for_token(&attribute.Value())));
|
|
||||||
|
|
||||||
// Step 13
|
// Step 13
|
||||||
let referrer = match subject.get_attribute(&ns!(), &local_name!("rel")) {
|
let referrer = match subject.get_attribute(&ns!(), &local_name!("rel")) {
|
||||||
|
|
|
@ -442,13 +442,19 @@ pub mod utils {
|
||||||
use crate::dom::window::Window;
|
use crate::dom::window::Window;
|
||||||
use net_traits::image_cache::CanRequestImages;
|
use net_traits::image_cache::CanRequestImages;
|
||||||
use net_traits::image_cache::{ImageOrMetadataAvailable, ImageResponse, UsePlaceholder};
|
use net_traits::image_cache::{ImageOrMetadataAvailable, ImageResponse, UsePlaceholder};
|
||||||
|
use net_traits::request::CorsSettings;
|
||||||
use servo_url::ServoUrl;
|
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 image_cache = window.image_cache();
|
||||||
let response = image_cache.find_image_or_metadata(
|
let response = image_cache.find_image_or_metadata(
|
||||||
url.into(),
|
url.into(),
|
||||||
window.origin().immutable().clone(),
|
window.origin().immutable().clone(),
|
||||||
|
cors_setting,
|
||||||
UsePlaceholder::No,
|
UsePlaceholder::No,
|
||||||
CanRequestImages::No,
|
CanRequestImages::No,
|
||||||
);
|
);
|
||||||
|
|
|
@ -20,6 +20,7 @@ use crate::dom::bindings::reflector::DomObject;
|
||||||
use crate::dom::bindings::root::{DomRoot, LayoutDom, MutNullableDom};
|
use crate::dom::bindings::root::{DomRoot, LayoutDom, MutNullableDom};
|
||||||
use crate::dom::bindings::str::{DOMString, USVString};
|
use crate::dom::bindings::str::{DOMString, USVString};
|
||||||
use crate::dom::document::Document;
|
use crate::dom::document::Document;
|
||||||
|
use crate::dom::element::{cors_setting_for_element, referrer_policy_for_element};
|
||||||
use crate::dom::element::{reflect_cross_origin_attribute, set_cross_origin_attribute};
|
use crate::dom::element::{reflect_cross_origin_attribute, set_cross_origin_attribute};
|
||||||
use crate::dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
|
use crate::dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
|
||||||
use crate::dom::event::Event;
|
use crate::dom::event::Event;
|
||||||
|
@ -40,6 +41,7 @@ use crate::dom::performanceresourcetiming::InitiatorType;
|
||||||
use crate::dom::values::UNSIGNED_LONG_MAX;
|
use crate::dom::values::UNSIGNED_LONG_MAX;
|
||||||
use crate::dom::virtualmethods::VirtualMethods;
|
use crate::dom::virtualmethods::VirtualMethods;
|
||||||
use crate::dom::window::Window;
|
use crate::dom::window::Window;
|
||||||
|
use crate::fetch::create_a_potential_CORS_request;
|
||||||
use crate::image_listener::{add_cache_listener_for_element, ImageCacheListener};
|
use crate::image_listener::{add_cache_listener_for_element, ImageCacheListener};
|
||||||
use crate::microtask::{Microtask, MicrotaskRunnable};
|
use crate::microtask::{Microtask, MicrotaskRunnable};
|
||||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||||
|
@ -58,9 +60,9 @@ use net_traits::image::base::{Image, ImageMetadata};
|
||||||
use net_traits::image_cache::UsePlaceholder;
|
use net_traits::image_cache::UsePlaceholder;
|
||||||
use net_traits::image_cache::{CanRequestImages, CorsStatus, ImageCache, ImageOrMetadataAvailable};
|
use net_traits::image_cache::{CanRequestImages, CorsStatus, ImageCache, ImageOrMetadataAvailable};
|
||||||
use net_traits::image_cache::{ImageResponder, ImageResponse, ImageState, PendingImageId};
|
use net_traits::image_cache::{ImageResponder, ImageResponse, ImageState, PendingImageId};
|
||||||
use net_traits::request::RequestBuilder;
|
use net_traits::request::{CorsSettings, Destination, Initiator, RequestBuilder};
|
||||||
use net_traits::{FetchMetadata, FetchResponseListener, FetchResponseMsg, NetworkError};
|
use net_traits::{FetchMetadata, FetchResponseListener, FetchResponseMsg, NetworkError};
|
||||||
use net_traits::{ResourceFetchTiming, ResourceTimingType};
|
use net_traits::{ReferrerPolicy, ResourceFetchTiming, ResourceTimingType};
|
||||||
use num_traits::ToPrimitive;
|
use num_traits::ToPrimitive;
|
||||||
use servo_url::origin::ImmutableOrigin;
|
use servo_url::origin::ImmutableOrigin;
|
||||||
use servo_url::origin::MutableOrigin;
|
use servo_url::origin::MutableOrigin;
|
||||||
|
@ -263,15 +265,31 @@ impl PreInvoke for ImageContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(PartialEq)]
|
||||||
|
pub(crate) enum FromPictureOrSrcSet {
|
||||||
|
Yes,
|
||||||
|
No,
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#update-the-image-data steps 17-20
|
||||||
// This function is also used to prefetch an image in `script::dom::servoparser::prefetch`.
|
// This function is also used to prefetch an image in `script::dom::servoparser::prefetch`.
|
||||||
pub(crate) fn image_fetch_request(
|
pub(crate) fn image_fetch_request(
|
||||||
img_url: ServoUrl,
|
img_url: ServoUrl,
|
||||||
origin: ImmutableOrigin,
|
origin: ImmutableOrigin,
|
||||||
pipeline_id: PipelineId,
|
pipeline_id: PipelineId,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
|
referrer_policy: Option<ReferrerPolicy>,
|
||||||
|
from_picture_or_srcset: FromPictureOrSrcSet,
|
||||||
) -> RequestBuilder {
|
) -> RequestBuilder {
|
||||||
RequestBuilder::new(img_url)
|
let mut request =
|
||||||
.origin(origin)
|
create_a_potential_CORS_request(img_url, Destination::Image, cors_setting, None)
|
||||||
.pipeline_id(Some(pipeline_id))
|
.origin(origin)
|
||||||
|
.pipeline_id(Some(pipeline_id))
|
||||||
|
.referrer_policy(referrer_policy);
|
||||||
|
if from_picture_or_srcset == FromPictureOrSrcSet::Yes {
|
||||||
|
request = request.initiator(Initiator::ImageSet);
|
||||||
|
}
|
||||||
|
request
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HTMLImageElement {
|
impl HTMLImageElement {
|
||||||
|
@ -282,6 +300,7 @@ impl HTMLImageElement {
|
||||||
let response = image_cache.find_image_or_metadata(
|
let response = image_cache.find_image_or_metadata(
|
||||||
img_url.clone().into(),
|
img_url.clone().into(),
|
||||||
window.origin().immutable().clone(),
|
window.origin().immutable().clone(),
|
||||||
|
cors_setting_for_element(self.upcast()),
|
||||||
UsePlaceholder::Yes,
|
UsePlaceholder::Yes,
|
||||||
CanRequestImages::Yes,
|
CanRequestImages::Yes,
|
||||||
);
|
);
|
||||||
|
@ -344,6 +363,13 @@ impl HTMLImageElement {
|
||||||
img_url.clone(),
|
img_url.clone(),
|
||||||
document.origin().immutable().clone(),
|
document.origin().immutable().clone(),
|
||||||
document.global().pipeline_id(),
|
document.global().pipeline_id(),
|
||||||
|
cors_setting_for_element(self.upcast()),
|
||||||
|
referrer_policy_for_element(self.upcast()),
|
||||||
|
if Self::uses_srcset_or_picture(self.upcast()) {
|
||||||
|
FromPictureOrSrcSet::Yes
|
||||||
|
} else {
|
||||||
|
FromPictureOrSrcSet::No
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// This is a background load because the load blocker already fulfills the
|
// This is a background load because the load blocker already fulfills the
|
||||||
|
@ -909,6 +935,7 @@ impl HTMLImageElement {
|
||||||
let response = image_cache.find_image_or_metadata(
|
let response = image_cache.find_image_or_metadata(
|
||||||
img_url.clone().into(),
|
img_url.clone().into(),
|
||||||
window.origin().immutable().clone(),
|
window.origin().immutable().clone(),
|
||||||
|
cors_setting_for_element(self.upcast()),
|
||||||
UsePlaceholder::No,
|
UsePlaceholder::No,
|
||||||
CanRequestImages::No,
|
CanRequestImages::No,
|
||||||
);
|
);
|
||||||
|
@ -1065,6 +1092,7 @@ impl HTMLImageElement {
|
||||||
let response = image_cache.find_image_or_metadata(
|
let response = image_cache.find_image_or_metadata(
|
||||||
img_url.clone().into(),
|
img_url.clone().into(),
|
||||||
window.origin().immutable().clone(),
|
window.origin().immutable().clone(),
|
||||||
|
cors_setting_for_element(self.upcast()),
|
||||||
UsePlaceholder::No,
|
UsePlaceholder::No,
|
||||||
CanRequestImages::Yes,
|
CanRequestImages::Yes,
|
||||||
);
|
);
|
||||||
|
|
|
@ -58,7 +58,7 @@ use crate::dom::url::URL;
|
||||||
use crate::dom::videotrack::VideoTrack;
|
use crate::dom::videotrack::VideoTrack;
|
||||||
use crate::dom::videotracklist::VideoTrackList;
|
use crate::dom::videotracklist::VideoTrackList;
|
||||||
use crate::dom::virtualmethods::VirtualMethods;
|
use crate::dom::virtualmethods::VirtualMethods;
|
||||||
use crate::fetch::FetchCanceller;
|
use crate::fetch::{create_a_potential_CORS_request, FetchCanceller};
|
||||||
use crate::microtask::{Microtask, MicrotaskRunnable};
|
use crate::microtask::{Microtask, MicrotaskRunnable};
|
||||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||||
use crate::script_thread::ScriptThread;
|
use crate::script_thread::ScriptThread;
|
||||||
|
@ -74,7 +74,7 @@ use ipc_channel::router::ROUTER;
|
||||||
use media::{glplayer_channel, GLPlayerMsg, GLPlayerMsgForward};
|
use media::{glplayer_channel, GLPlayerMsg, GLPlayerMsgForward};
|
||||||
use net_traits::image::base::Image;
|
use net_traits::image::base::Image;
|
||||||
use net_traits::image_cache::ImageResponse;
|
use net_traits::image_cache::ImageResponse;
|
||||||
use net_traits::request::{CredentialsMode, Destination, Referrer, RequestBuilder, RequestMode};
|
use net_traits::request::{Destination, Referrer};
|
||||||
use net_traits::{CoreResourceMsg, FetchChannels, FetchMetadata, FetchResponseListener, Metadata};
|
use net_traits::{CoreResourceMsg, FetchChannels, FetchMetadata, FetchResponseListener, Metadata};
|
||||||
use net_traits::{NetworkError, ResourceFetchTiming, ResourceTimingType};
|
use net_traits::{NetworkError, ResourceFetchTiming, ResourceTimingType};
|
||||||
use script_layout_interface::HTMLMediaData;
|
use script_layout_interface::HTMLMediaData;
|
||||||
|
@ -822,16 +822,9 @@ impl HTMLMediaElement {
|
||||||
None => self.blob_url.borrow().as_ref().unwrap().clone(),
|
None => self.blob_url.borrow().as_ref().unwrap().clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let request = RequestBuilder::new(url.clone())
|
let cors_setting = cors_setting_for_element(self.upcast());
|
||||||
|
let request = create_a_potential_CORS_request(url.clone(), destination, cors_setting, None)
|
||||||
.headers(headers)
|
.headers(headers)
|
||||||
.destination(destination)
|
|
||||||
.credentials_mode(CredentialsMode::Include)
|
|
||||||
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
|
||||||
.mode(match cors_setting_for_element(self.upcast::<Element>()) {
|
|
||||||
Some(_) => RequestMode::CorsMode,
|
|
||||||
None => RequestMode::NoCors,
|
|
||||||
})
|
|
||||||
.use_url_credentials(true)
|
|
||||||
.origin(document.origin().immutable().clone())
|
.origin(document.origin().immutable().clone())
|
||||||
.pipeline_id(Some(self.global().pipeline_id()))
|
.pipeline_id(Some(self.global().pipeline_id()))
|
||||||
.referrer(Some(Referrer::ReferrerUrl(document.url())))
|
.referrer(Some(Referrer::ReferrerUrl(document.url())))
|
||||||
|
|
|
@ -25,6 +25,7 @@ use crate::dom::node::{document_from_node, window_from_node};
|
||||||
use crate::dom::node::{BindContext, ChildrenMutation, CloneChildrenFlag, Node};
|
use crate::dom::node::{BindContext, ChildrenMutation, CloneChildrenFlag, Node};
|
||||||
use crate::dom::performanceresourcetiming::InitiatorType;
|
use crate::dom::performanceresourcetiming::InitiatorType;
|
||||||
use crate::dom::virtualmethods::VirtualMethods;
|
use crate::dom::virtualmethods::VirtualMethods;
|
||||||
|
use crate::fetch::create_a_potential_CORS_request;
|
||||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use encoding_rs::Encoding;
|
use encoding_rs::Encoding;
|
||||||
|
@ -33,9 +34,7 @@ use ipc_channel::ipc;
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use net_traits::request::{
|
use net_traits::request::{CorsSettings, Destination, Referrer, RequestBuilder};
|
||||||
CorsSettings, CredentialsMode, Destination, Referrer, RequestBuilder, RequestMode,
|
|
||||||
};
|
|
||||||
use net_traits::ReferrerPolicy;
|
use net_traits::ReferrerPolicy;
|
||||||
use net_traits::{FetchMetadata, FetchResponseListener, Metadata, NetworkError};
|
use net_traits::{FetchMetadata, FetchResponseListener, Metadata, NetworkError};
|
||||||
use net_traits::{ResourceFetchTiming, ResourceTimingType};
|
use net_traits::{ResourceFetchTiming, ResourceTimingType};
|
||||||
|
@ -306,20 +305,7 @@ pub(crate) fn script_fetch_request(
|
||||||
referrer_policy: Option<ReferrerPolicy>,
|
referrer_policy: Option<ReferrerPolicy>,
|
||||||
integrity_metadata: String,
|
integrity_metadata: String,
|
||||||
) -> RequestBuilder {
|
) -> RequestBuilder {
|
||||||
RequestBuilder::new(url)
|
create_a_potential_CORS_request(url, Destination::Script, cors_setting, None)
|
||||||
.destination(Destination::Script)
|
|
||||||
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
|
||||||
// Step 1
|
|
||||||
.mode(match cors_setting {
|
|
||||||
Some(_) => RequestMode::CorsMode,
|
|
||||||
None => RequestMode::NoCors,
|
|
||||||
})
|
|
||||||
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
|
||||||
// Step 3-4
|
|
||||||
.credentials_mode(match cors_setting {
|
|
||||||
Some(CorsSettings::Anonymous) => CredentialsMode::CredentialsSameOrigin,
|
|
||||||
_ => CredentialsMode::Include,
|
|
||||||
})
|
|
||||||
.origin(origin)
|
.origin(origin)
|
||||||
.pipeline_id(Some(pipeline_id))
|
.pipeline_id(Some(pipeline_id))
|
||||||
.referrer(Some(referrer))
|
.referrer(Some(referrer))
|
||||||
|
|
|
@ -133,6 +133,7 @@ impl HTMLVideoElement {
|
||||||
let response = image_cache.find_image_or_metadata(
|
let response = image_cache.find_image_or_metadata(
|
||||||
poster_url.clone().into(),
|
poster_url.clone().into(),
|
||||||
window.origin().immutable().clone(),
|
window.origin().immutable().clone(),
|
||||||
|
None,
|
||||||
UsePlaceholder::No,
|
UsePlaceholder::No,
|
||||||
CanRequestImages::Yes,
|
CanRequestImages::Yes,
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
use crate::dom::bindings::reflector::DomObject;
|
use crate::dom::bindings::reflector::DomObject;
|
||||||
use crate::dom::bindings::trace::JSTraceable;
|
use crate::dom::bindings::trace::JSTraceable;
|
||||||
use crate::dom::document::Document;
|
use crate::dom::document::{determine_policy_for_token, Document};
|
||||||
use crate::dom::htmlimageelement::image_fetch_request;
|
use crate::dom::htmlimageelement::{image_fetch_request, FromPictureOrSrcSet};
|
||||||
use crate::dom::htmlscriptelement::script_fetch_request;
|
use crate::dom::htmlscriptelement::script_fetch_request;
|
||||||
use crate::stylesheet_loader::stylesheet_fetch_request;
|
use crate::stylesheet_loader::stylesheet_fetch_request;
|
||||||
use html5ever::buffer_queue::BufferQueue;
|
use html5ever::buffer_queue::BufferQueue;
|
||||||
|
@ -123,7 +123,14 @@ impl TokenSink for PrefetchSink {
|
||||||
(TagKind::StartTag, local_name!("img")) if self.prefetching => {
|
(TagKind::StartTag, local_name!("img")) if self.prefetching => {
|
||||||
if let Some(url) = self.get_url(tag, local_name!("src")) {
|
if let Some(url) = self.get_url(tag, local_name!("src")) {
|
||||||
debug!("Prefetch {} {}", tag.name, url);
|
debug!("Prefetch {} {}", tag.name, url);
|
||||||
let request = image_fetch_request(url, self.origin.clone(), self.pipeline_id);
|
let request = image_fetch_request(
|
||||||
|
url,
|
||||||
|
self.origin.clone(),
|
||||||
|
self.pipeline_id,
|
||||||
|
self.get_cors_settings(tag, local_name!("crossorigin")),
|
||||||
|
self.get_referrer_policy(tag, LocalName::from("referrerpolicy")),
|
||||||
|
FromPictureOrSrcSet::No,
|
||||||
|
);
|
||||||
let _ = self
|
let _ = self
|
||||||
.resource_threads
|
.resource_threads
|
||||||
.send(CoreResourceMsg::Fetch(request, FetchChannels::Prefetch));
|
.send(CoreResourceMsg::Fetch(request, FetchChannels::Prefetch));
|
||||||
|
@ -137,6 +144,8 @@ impl TokenSink for PrefetchSink {
|
||||||
debug!("Prefetch {} {}", tag.name, url);
|
debug!("Prefetch {} {}", tag.name, url);
|
||||||
let cors_setting =
|
let cors_setting =
|
||||||
self.get_cors_settings(tag, local_name!("crossorigin"));
|
self.get_cors_settings(tag, local_name!("crossorigin"));
|
||||||
|
let referrer_policy =
|
||||||
|
self.get_referrer_policy(tag, LocalName::from("referrerpolicy"));
|
||||||
let integrity_metadata = self
|
let integrity_metadata = self
|
||||||
.get_attr(tag, local_name!("integrity"))
|
.get_attr(tag, local_name!("integrity"))
|
||||||
.map(|attr| String::from(&attr.value))
|
.map(|attr| String::from(&attr.value))
|
||||||
|
@ -147,7 +156,7 @@ impl TokenSink for PrefetchSink {
|
||||||
self.origin.clone(),
|
self.origin.clone(),
|
||||||
self.pipeline_id,
|
self.pipeline_id,
|
||||||
self.referrer.clone(),
|
self.referrer.clone(),
|
||||||
self.referrer_policy,
|
referrer_policy,
|
||||||
integrity_metadata,
|
integrity_metadata,
|
||||||
);
|
);
|
||||||
let _ = self
|
let _ = self
|
||||||
|
@ -191,6 +200,12 @@ impl PrefetchSink {
|
||||||
ServoUrl::parse_with_base(Some(base), &attr.value).ok()
|
ServoUrl::parse_with_base(Some(base), &attr.value).ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_referrer_policy(&self, tag: &Tag, name: LocalName) -> Option<ReferrerPolicy> {
|
||||||
|
self.get_attr(tag, name)
|
||||||
|
.and_then(|attr| determine_policy_for_token(&*attr.value))
|
||||||
|
.or(self.referrer_policy)
|
||||||
|
}
|
||||||
|
|
||||||
fn get_cors_settings(&self, tag: &Tag, name: LocalName) -> Option<CorsSettings> {
|
fn get_cors_settings(&self, tag: &Tag, name: LocalName) -> Option<CorsSettings> {
|
||||||
let crossorigin = self.get_attr(tag, name)?;
|
let crossorigin = self.get_attr(tag, name)?;
|
||||||
if crossorigin.value.eq_ignore_ascii_case("anonymous") {
|
if crossorigin.value.eq_ignore_ascii_case("anonymous") {
|
||||||
|
|
|
@ -19,6 +19,7 @@ use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
||||||
use crate::dom::bindings::root::{Dom, DomOnceCell, DomRoot, LayoutDom, MutNullableDom};
|
use crate::dom::bindings::root::{Dom, DomOnceCell, DomRoot, LayoutDom, MutNullableDom};
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
|
use crate::dom::element::cors_setting_for_element;
|
||||||
use crate::dom::event::{Event, EventBubbles, EventCancelable};
|
use crate::dom::event::{Event, EventBubbles, EventCancelable};
|
||||||
use crate::dom::htmlcanvaselement::utils as canvas_utils;
|
use crate::dom::htmlcanvaselement::utils as canvas_utils;
|
||||||
use crate::dom::htmlcanvaselement::HTMLCanvasElement;
|
use crate::dom::htmlcanvaselement::HTMLCanvasElement;
|
||||||
|
@ -576,13 +577,15 @@ impl WebGLRenderingContext {
|
||||||
};
|
};
|
||||||
|
|
||||||
let window = window_from_node(&*self.canvas);
|
let window = window_from_node(&*self.canvas);
|
||||||
|
let cors_setting = cors_setting_for_element(image.upcast());
|
||||||
|
|
||||||
let img = match canvas_utils::request_image_from_cache(&window, img_url) {
|
let img =
|
||||||
ImageResponse::Loaded(img, _) => img,
|
match canvas_utils::request_image_from_cache(&window, img_url, cors_setting) {
|
||||||
ImageResponse::PlaceholderLoaded(_, _) |
|
ImageResponse::Loaded(img, _) => img,
|
||||||
ImageResponse::None |
|
ImageResponse::PlaceholderLoaded(_, _) |
|
||||||
ImageResponse::MetadataLoaded(_) => return Ok(None),
|
ImageResponse::None |
|
||||||
};
|
ImageResponse::MetadataLoaded(_) => return Ok(None),
|
||||||
|
};
|
||||||
|
|
||||||
let size = Size2D::new(img.width, img.height);
|
let size = Size2D::new(img.width, img.height);
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,9 @@ use crate::network_listener::{
|
||||||
use crate::task_source::TaskSourceName;
|
use crate::task_source::TaskSourceName;
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use net_traits::request::RequestBuilder;
|
use net_traits::request::{
|
||||||
|
CorsSettings, CredentialsMode, Destination, RequestBuilder, RequestMode,
|
||||||
|
};
|
||||||
use net_traits::request::{Request as NetTraitsRequest, ServiceWorkersMode};
|
use net_traits::request::{Request as NetTraitsRequest, ServiceWorkersMode};
|
||||||
use net_traits::CoreResourceMsg::Fetch as NetTraitsFetch;
|
use net_traits::CoreResourceMsg::Fetch as NetTraitsFetch;
|
||||||
use net_traits::{CoreResourceMsg, CoreResourceThread, FetchResponseMsg};
|
use net_traits::{CoreResourceMsg, CoreResourceThread, FetchResponseMsg};
|
||||||
|
@ -124,6 +126,7 @@ fn request_init_from_request(request: NetTraitsRequest) -> RequestBuilder {
|
||||||
integrity_metadata: "".to_owned(),
|
integrity_metadata: "".to_owned(),
|
||||||
url_list: vec![],
|
url_list: vec![],
|
||||||
parser_metadata: request.parser_metadata,
|
parser_metadata: request.parser_metadata,
|
||||||
|
initiator: request.initiator,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,3 +342,29 @@ pub fn load_whole_resource(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
||||||
|
pub(crate) fn create_a_potential_CORS_request(
|
||||||
|
url: ServoUrl,
|
||||||
|
destination: Destination,
|
||||||
|
cors_setting: Option<CorsSettings>,
|
||||||
|
same_origin_fallback: Option<bool>,
|
||||||
|
) -> RequestBuilder {
|
||||||
|
RequestBuilder::new(url)
|
||||||
|
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
||||||
|
// Step 1
|
||||||
|
.mode(match cors_setting {
|
||||||
|
Some(_) => RequestMode::CorsMode,
|
||||||
|
None if same_origin_fallback == Some(true) => RequestMode::SameOrigin,
|
||||||
|
None => RequestMode::NoCors,
|
||||||
|
})
|
||||||
|
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
||||||
|
// Step 3-4
|
||||||
|
.credentials_mode(match cors_setting {
|
||||||
|
Some(CorsSettings::Anonymous) => CredentialsMode::CredentialsSameOrigin,
|
||||||
|
_ => CredentialsMode::Include,
|
||||||
|
})
|
||||||
|
// Step 5
|
||||||
|
.destination(destination)
|
||||||
|
.use_url_credentials(true)
|
||||||
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ use crate::dom::htmllinkelement::{HTMLLinkElement, RequestGenerationId};
|
||||||
use crate::dom::node::{containing_shadow_root, document_from_node, window_from_node};
|
use crate::dom::node::{containing_shadow_root, document_from_node, window_from_node};
|
||||||
use crate::dom::performanceresourcetiming::InitiatorType;
|
use crate::dom::performanceresourcetiming::InitiatorType;
|
||||||
use crate::dom::shadowroot::ShadowRoot;
|
use crate::dom::shadowroot::ShadowRoot;
|
||||||
|
use crate::fetch::create_a_potential_CORS_request;
|
||||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||||
use cssparser::SourceLocation;
|
use cssparser::SourceLocation;
|
||||||
use encoding_rs::UTF_8;
|
use encoding_rs::UTF_8;
|
||||||
|
@ -23,9 +24,7 @@ use ipc_channel::ipc;
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use mime::{self, Mime};
|
use mime::{self, Mime};
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use net_traits::request::{
|
use net_traits::request::{CorsSettings, Destination, Referrer, RequestBuilder};
|
||||||
CorsSettings, CredentialsMode, Destination, Referrer, RequestBuilder, RequestMode,
|
|
||||||
};
|
|
||||||
use net_traits::{
|
use net_traits::{
|
||||||
FetchMetadata, FetchResponseListener, FilteredMetadata, Metadata, NetworkError, ReferrerPolicy,
|
FetchMetadata, FetchResponseListener, FilteredMetadata, Metadata, NetworkError, ReferrerPolicy,
|
||||||
};
|
};
|
||||||
|
@ -335,6 +334,7 @@ impl<'a> StylesheetLoader<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is also used to prefetch a stylesheet in `script::dom::servoparser::prefetch`.
|
// This function is also used to prefetch a stylesheet in `script::dom::servoparser::prefetch`.
|
||||||
|
// https://html.spec.whatwg.org/multipage/#default-fetch-and-process-the-linked-resource
|
||||||
pub(crate) fn stylesheet_fetch_request(
|
pub(crate) fn stylesheet_fetch_request(
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
cors_setting: Option<CorsSettings>,
|
cors_setting: Option<CorsSettings>,
|
||||||
|
@ -344,20 +344,7 @@ pub(crate) fn stylesheet_fetch_request(
|
||||||
referrer_policy: Option<ReferrerPolicy>,
|
referrer_policy: Option<ReferrerPolicy>,
|
||||||
integrity_metadata: String,
|
integrity_metadata: String,
|
||||||
) -> RequestBuilder {
|
) -> RequestBuilder {
|
||||||
RequestBuilder::new(url)
|
create_a_potential_CORS_request(url, Destination::Style, cors_setting, None)
|
||||||
.destination(Destination::Style)
|
|
||||||
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
|
||||||
// Step 1
|
|
||||||
.mode(match cors_setting {
|
|
||||||
Some(_) => RequestMode::CorsMode,
|
|
||||||
None => RequestMode::NoCors,
|
|
||||||
})
|
|
||||||
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
|
||||||
// Step 3-4
|
|
||||||
.credentials_mode(match cors_setting {
|
|
||||||
Some(CorsSettings::Anonymous) => CredentialsMode::CredentialsSameOrigin,
|
|
||||||
_ => CredentialsMode::Include,
|
|
||||||
})
|
|
||||||
.origin(origin)
|
.origin(origin)
|
||||||
.pipeline_id(Some(pipeline_id))
|
.pipeline_id(Some(pipeline_id))
|
||||||
.referrer(Some(referrer))
|
.referrer(Some(referrer))
|
||||||
|
|
|
@ -34,3 +34,6 @@
|
||||||
[Revoke blob URL after creating Request, will fetch]
|
[Revoke blob URL after creating Request, will fetch]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[Revoke blob URL after calling fetch, fetch should succeed]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -290912,6 +290912,12 @@
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
"2dcontext/drawing-images-to-the-canvas/drawimage_crossorigin.sub.html": [
|
||||||
|
[
|
||||||
|
"2dcontext/drawing-images-to-the-canvas/drawimage_crossorigin.sub.html",
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
],
|
||||||
"2dcontext/drawing-images-to-the-canvas/drawimage_html_image.html": [
|
"2dcontext/drawing-images-to-the-canvas/drawimage_html_image.html": [
|
||||||
[
|
[
|
||||||
"2dcontext/drawing-images-to-the-canvas/drawimage_html_image.html",
|
"2dcontext/drawing-images-to-the-canvas/drawimage_html_image.html",
|
||||||
|
@ -447773,6 +447779,10 @@
|
||||||
"9f297cacdcd81bef7093f79ebed6992110dab4d7",
|
"9f297cacdcd81bef7093f79ebed6992110dab4d7",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
|
"2dcontext/drawing-images-to-the-canvas/drawimage_crossorigin.sub.html": [
|
||||||
|
"3d57d9f064bec7755a4f735e3fd12850109fcc15",
|
||||||
|
"testharness"
|
||||||
|
],
|
||||||
"2dcontext/drawing-images-to-the-canvas/drawimage_html_image.html": [
|
"2dcontext/drawing-images-to-the-canvas/drawimage_html_image.html": [
|
||||||
"a94cfdcd2d66fb667d458a4dff91532fbf3608de",
|
"a94cfdcd2d66fb667d458a4dff91532fbf3608de",
|
||||||
"testharness"
|
"testharness"
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[floats-in-table-caption-001.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,4 +0,0 @@
|
||||||
[inline-negative-margin-001.html]
|
|
||||||
[#container 1]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[abspos-float-with-inline-container.html]
|
[abspos-float-with-inline-container.html]
|
||||||
expected: FAIL
|
expected: TIMEOUT
|
||||||
|
|
2
tests/wpt/metadata/css/CSS2/text/white-space-002.xht.ini
Normal file
2
tests/wpt/metadata/css/CSS2/text/white-space-002.xht.ini
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[white-space-002.xht]
|
||||||
|
expected: FAIL
|
2
tests/wpt/metadata/css/CSS2/text/white-space-003.xht.ini
Normal file
2
tests/wpt/metadata/css/CSS2/text/white-space-003.xht.ini
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[white-space-003.xht]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
||||||
|
[line-height-204.html]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
||||||
|
[mix-blend-mode-paragraph.html]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
||||||
|
[background-repeat-round-roundup.xht]
|
||||||
|
expected: FAIL
|
|
@ -254,9 +254,6 @@
|
||||||
[Matching font-stretch: '90%' should prefer '90% 100%' over '50% 80%']
|
[Matching font-stretch: '90%' should prefer '90% 100%' over '50% 80%']
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Matching font-weight: '400' should prefer '450 460' over '500']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Matching font-style: 'normal' should prefer 'normal' over 'oblique 0deg']
|
[Matching font-style: 'normal' should prefer 'normal' over 'oblique 0deg']
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[line-break-normal-018.xht]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[line-break-strict-018.xht]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[text-transform-full-size-kana-001.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[text-transform-full-size-kana-002.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[text-transform-full-size-kana-003.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[text-transform-full-size-kana-004.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[trailing-ideographic-space-004.html]
|
|
||||||
expected: FAIL
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[word-break-break-all-007.html]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
||||||
|
[word-break-keep-all-006.html]
|
||||||
|
expected: FAIL
|
|
@ -1,5 +1,4 @@
|
||||||
[perspective-interpolation.html]
|
[perspective-interpolation.html]
|
||||||
expected: CRASH
|
|
||||||
[ perspective interpolation]
|
[ perspective interpolation]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[css-transforms-3d-on-anonymous-block-001.html]
|
||||||
|
expected: FAIL
|
|
@ -1,14 +0,0 @@
|
||||||
[HTMLMediaElement.html]
|
|
||||||
expected: CRASH
|
|
||||||
[controls on HTMLMediaElement in video must enqueue an attributeChanged reaction when replacing an existing attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[controls on HTMLMediaElement in video must enqueue an attributeChanged reaction when adding a new attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[controls on HTMLMediaElement in audio must enqueue an attributeChanged reaction when replacing an existing attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[controls on HTMLMediaElement in audio must enqueue an attributeChanged reaction when adding a new attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[contenttype_html.html]
|
|
||||||
expected: CRASH
|
|
|
@ -1,2 +0,0 @@
|
||||||
[contenttype_txt.html]
|
|
||||||
expected: CRASH
|
|
|
@ -1,2 +0,0 @@
|
||||||
[contenttype_xml.html]
|
|
||||||
expected: CRASH
|
|
|
@ -1,4 +0,0 @@
|
||||||
[traverse_the_history_2.html]
|
|
||||||
[Multiple history traversals, last would be aborted]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
[form-submission-algorithm.html]
|
[form-submission-algorithm.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[If form's firing submission events is true, then return; 'submit' event]
|
[If form's firing submission events is true, then return; 'submit' event]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[If form's firing submission events is true, then return; 'invalid' event]
|
[If form's firing submission events is true, then return; 'invalid' event]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Cannot navigate (after constructing the entry list)]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
[htmlanchorelement_noopener.html]
|
[htmlanchorelement_noopener.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
[Check that rel=noopener with target=_self does a normal load]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Check that targeting of rel=noopener with a given name ignores an existing window with that name]
|
[Check that targeting of rel=noopener with a given name ignores an existing window with that name]
|
||||||
expected: NOTRUN
|
expected: NOTRUN
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
[promise-rejection-events-iframe.html]
|
||||||
|
expected: TIMEOUT
|
||||||
|
[delayed handling: promise is created in iframe and being rejected elsewhere]
|
||||||
|
expected: TIMEOUT
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
[promise-rejection-events-onerror.html]
|
||||||
|
expected: TIMEOUT
|
||||||
|
[Throwing inside an unhandledrejection handler invokes the error handler.]
|
||||||
|
expected: TIMEOUT
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-http.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-http.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-http.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-http.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-http.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-http.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.keep-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.no-redirect.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[cross-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-http.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[same-https.swap-origin.http.html]
|
|
||||||
[Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[resource_TAO_multi_wildcard.html]
|
|
||||||
[redirectStart, redirectEnd, domainLookupStart, domainLookupEnd, connectStart, connectEnd, secureConnectionStart, requestStart, and responseStart -- should not be all returned as 0 when the HTTP response has multiple Timing-Allow-Origin header fields and the subsequent field value is separated by a comma, i.e. TAO algorithm passes]
|
|
||||||
expected: FAIL
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[resource_timing_buffer_full_eventually.html]
|
||||||
|
expected: CRASH
|
|
@ -1,4 +1,5 @@
|
||||||
[realtimeanalyser-fft-scaling.html]
|
[realtimeanalyser-fft-scaling.html]
|
||||||
|
expected: TIMEOUT
|
||||||
[X 2048-point FFT peak position is not equal to 64. Got 0.]
|
[X 2048-point FFT peak position is not equal to 64. Got 0.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -95,3 +95,6 @@
|
||||||
[X SNR (19.538850442445742 dB) is not greater than or equal to 65.737. Got 19.538850442445742.]
|
[X SNR (19.538850442445742 dB) is not greater than or equal to 65.737. Got 19.538850442445742.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[X SNR (19.538850442082673 dB) is not greater than or equal to 65.737. Got 19.538850442082673.]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue