aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakhan7 <akhan7@ncsu.edu>2016-03-19 19:56:27 -0500
committerJosh Matthews <josh@joshmatthews.net>2016-04-12 14:11:31 -0400
commit90359b1cba2e0171e9666c3ae6beb6cb1596b541 (patch)
treef6f388e5f525d7055207b264b435608493ffd743
parentdfb482a2b7fdb570f34e9092384fa74a3e1b54e3 (diff)
downloadservo-90359b1cba2e0171e9666c3ae6beb6cb1596b541.tar.gz
servo-90359b1cba2e0171e9666c3ae6beb6cb1596b541.zip
Implement image request concept for HTMLImageElement. Implement HTMLImageElement.currentSrc.
-rw-r--r--components/script/dom/htmlimageelement.rs73
-rw-r--r--components/script/dom/webidls/HTMLImageElement.webidl4
-rw-r--r--tests/wpt/metadata/html/dom/interfaces.html.ini24
-rw-r--r--tests/wpt/metadata/html/dom/reflection-embedded.html.ini207
-rw-r--r--tests/wpt/metadata/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html.ini561
-rw-r--r--tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini162
6 files changed, 63 insertions, 968 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index c36bcb02651..92291600ca3 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -21,6 +21,7 @@ use dom::htmlelement::HTMLElement;
use dom::node::{Node, NodeDamage, document_from_node, window_from_node};
use dom::values::UNSIGNED_LONG_MAX;
use dom::virtualmethods::VirtualMethods;
+use heapsize::HeapSizeOf;
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use net_traits::image::base::{Image, ImageMetadata};
@@ -33,17 +34,31 @@ use string_cache::Atom;
use url::Url;
use util::str::{DOMString, LengthOrPercentageOrAuto};
+#[derive(JSTraceable, HeapSizeOf)]
+#[allow(dead_code)]
+enum State {
+ Unavailable,
+ PartiallyAvailable,
+ CompletelyAvailable,
+ Broken,
+}
+#[derive(JSTraceable, HeapSizeOf)]
+struct ImageRequest {
+ state: State,
+ url: Option<Url>,
+ image: Option<Arc<Image>>,
+ metadata: Option<ImageMetadata>,
+}
#[dom_struct]
pub struct HTMLImageElement {
htmlelement: HTMLElement,
- url: DOMRefCell<Option<Url>>,
- image: DOMRefCell<Option<Arc<Image>>>,
- metadata: DOMRefCell<Option<ImageMetadata>>,
+ current_request: DOMRefCell<ImageRequest>,
+ pending_request: DOMRefCell<ImageRequest>,
}
impl HTMLImageElement {
pub fn get_url(&self) -> Option<Url>{
- self.url.borrow().clone()
+ self.current_request.borrow().url.clone()
}
}
@@ -77,8 +92,8 @@ impl Runnable for ImageResponseHandlerRunnable {
}
ImageResponse::None => (None, None, true)
};
- *element_ref.image.borrow_mut() = image;
- *element_ref.metadata.borrow_mut() = metadata;
+ element_ref.current_request.borrow_mut().image = image;
+ element_ref.current_request.borrow_mut().metadata = metadata;
// Mark the node dirty
let document = document_from_node(&*element);
@@ -104,14 +119,14 @@ impl HTMLImageElement {
let image_cache = window.image_cache_thread();
match value {
None => {
- *self.url.borrow_mut() = None;
- *self.image.borrow_mut() = None;
+ self.current_request.borrow_mut().url = None;
+ self.current_request.borrow_mut().image = None;
}
Some((src, base_url)) => {
let img_url = base_url.join(&src);
// FIXME: handle URL parse errors more gracefully.
let img_url = img_url.unwrap();
- *self.url.borrow_mut() = Some(img_url.clone());
+ self.current_request.borrow_mut().url = Some(img_url.clone());
let trusted_node = Trusted::new(self, window.networking_task_source());
let (responder_sender, responder_receiver) = ipc::channel().unwrap();
@@ -134,13 +149,21 @@ impl HTMLImageElement {
}
}
}
-
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement {
HTMLImageElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
- url: DOMRefCell::new(None),
- image: DOMRefCell::new(None),
- metadata: DOMRefCell::new(None),
+ current_request: DOMRefCell::new(ImageRequest {
+ state: State::Unavailable,
+ url: None,
+ image: None,
+ metadata: None
+ }),
+ pending_request: DOMRefCell::new(ImageRequest {
+ state: State::Unavailable,
+ url: None,
+ image: None,
+ metadata: None
+ }),
}
}
@@ -182,12 +205,12 @@ pub trait LayoutHTMLImageElementHelpers {
impl LayoutHTMLImageElementHelpers for LayoutJS<HTMLImageElement> {
#[allow(unsafe_code)]
unsafe fn image(&self) -> Option<Arc<Image>> {
- (*self.unsafe_get()).image.borrow_for_layout().clone()
+ (*self.unsafe_get()).current_request.borrow_for_layout().image.clone()
}
#[allow(unsafe_code)]
unsafe fn image_url(&self) -> Option<Url> {
- (*self.unsafe_get()).url.borrow_for_layout().clone()
+ (*self.unsafe_get()).current_request.borrow_for_layout().url.clone()
}
#[allow(unsafe_code)]
@@ -224,6 +247,11 @@ impl HTMLImageElementMethods for HTMLImageElement {
// https://html.spec.whatwg.org/multipage/#dom-img-src
make_setter!(SetSrc, "src");
+ // https://html.spec.whatwg.org/multipage/#dom-img-crossOrigin
+ make_enumerated_getter!(CrossOrigin, "crossorigin", "anonymous", ("use-credentials"));
+ // https://html.spec.whatwg.org/multipage/#dom-img-crossOrigin
+ make_setter!(SetCrossOrigin, "crossorigin");
+
// https://html.spec.whatwg.org/multipage/#dom-img-usemap
make_getter!(UseMap, "usemap");
// https://html.spec.whatwg.org/multipage/#dom-img-usemap
@@ -260,7 +288,7 @@ impl HTMLImageElementMethods for HTMLImageElement {
// https://html.spec.whatwg.org/multipage/#dom-img-naturalwidth
fn NaturalWidth(&self) -> u32 {
- let metadata = self.metadata.borrow();
+ let ref metadata = self.current_request.borrow().metadata;
match *metadata {
Some(ref metadata) => metadata.width,
@@ -270,7 +298,7 @@ impl HTMLImageElementMethods for HTMLImageElement {
// https://html.spec.whatwg.org/multipage/#dom-img-naturalheight
fn NaturalHeight(&self) -> u32 {
- let metadata = self.metadata.borrow();
+ let ref metadata = self.current_request.borrow().metadata;
match *metadata {
Some(ref metadata) => metadata.height,
@@ -280,10 +308,19 @@ impl HTMLImageElementMethods for HTMLImageElement {
// https://html.spec.whatwg.org/multipage/#dom-img-complete
fn Complete(&self) -> bool {
- let image = self.image.borrow();
+ let ref image = self.current_request.borrow().image;
image.is_some()
}
+ // https://html.spec.whatwg.org/multipage/#dom-img-currentsrc
+ fn CurrentSrc(&self) -> DOMString {
+ let ref url = self.current_request.borrow().url;
+ match *url {
+ Some(ref url) => DOMString::from(url.serialize()),
+ None => DOMString::from(""),
+ }
+ }
+
// https://html.spec.whatwg.org/multipage/#dom-img-name
make_getter!(Name, "name");
diff --git a/components/script/dom/webidls/HTMLImageElement.webidl b/components/script/dom/webidls/HTMLImageElement.webidl
index c063301cb39..69bd2f7d4c1 100644
--- a/components/script/dom/webidls/HTMLImageElement.webidl
+++ b/components/script/dom/webidls/HTMLImageElement.webidl
@@ -9,7 +9,7 @@ interface HTMLImageElement : HTMLElement {
attribute DOMString alt;
attribute DOMString src;
// attribute DOMString srcset;
- // attribute DOMString crossOrigin;
+ attribute DOMString crossOrigin;
attribute DOMString useMap;
attribute boolean isMap;
attribute unsigned long width;
@@ -17,7 +17,7 @@ interface HTMLImageElement : HTMLElement {
readonly attribute unsigned long naturalWidth;
readonly attribute unsigned long naturalHeight;
readonly attribute boolean complete;
-
+ readonly attribute DOMString currentSrc;
// also has obsolete members
};
diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini
index ba5f8cadb8f..71408205755 100644
--- a/tests/wpt/metadata/html/dom/interfaces.html.ini
+++ b/tests/wpt/metadata/html/dom/interfaces.html.ini
@@ -1989,9 +1989,6 @@
[HTMLBaseElement interface: document.createElement("base") must inherit property "target" with the proper type (1)]
expected: FAIL
- [HTMLLinkElement interface: attribute crossOrigin]
- expected: FAIL
-
[HTMLLinkElement interface: attribute sizes]
expected: FAIL
@@ -2319,12 +2316,6 @@
[HTMLImageElement interface: attribute sizes]
expected: FAIL
- [HTMLImageElement interface: attribute crossOrigin]
- expected: FAIL
-
- [HTMLImageElement interface: attribute currentSrc]
- expected: FAIL
-
[HTMLImageElement interface: attribute lowsrc]
expected: FAIL
@@ -2334,12 +2325,6 @@
[HTMLImageElement interface: document.createElement("img") must inherit property "sizes" with the proper type (3)]
expected: FAIL
- [HTMLImageElement interface: document.createElement("img") must inherit property "crossOrigin" with the proper type (4)]
- expected: FAIL
-
- [HTMLImageElement interface: document.createElement("img") must inherit property "currentSrc" with the proper type (12)]
- expected: FAIL
-
[HTMLImageElement interface: document.createElement("img") must inherit property "lowsrc" with the proper type (14)]
expected: FAIL
@@ -2349,12 +2334,6 @@
[HTMLImageElement interface: new Image() must inherit property "sizes" with the proper type (3)]
expected: FAIL
- [HTMLImageElement interface: new Image() must inherit property "crossOrigin" with the proper type (4)]
- expected: FAIL
-
- [HTMLImageElement interface: new Image() must inherit property "currentSrc" with the proper type (12)]
- expected: FAIL
-
[HTMLImageElement interface: new Image() must inherit property "lowsrc" with the proper type (14)]
expected: FAIL
@@ -8967,3 +8946,6 @@
[Document interface: new Document() must inherit property "onwaiting" with the proper type (156)]
expected: FAIL
+ [HTMLLinkElement interface: attribute crossOrigin]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/dom/reflection-embedded.html.ini b/tests/wpt/metadata/html/dom/reflection-embedded.html.ini
index 32ed9423826..94df1baae7b 100644
--- a/tests/wpt/metadata/html/dom/reflection-embedded.html.ini
+++ b/tests/wpt/metadata/html/dom/reflection-embedded.html.ini
@@ -594,213 +594,12 @@
[img.crossOrigin: IDL get with DOM attribute unset]
expected: FAIL
- [img.crossOrigin: setAttribute() to "" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to undefined followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to 7 followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to 1.5 followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to true followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to false followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to object "[object Object\]" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to NaN followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to Infinity followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to -Infinity followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "\\0" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to null followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to object "test-toString" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to object "test-valueOf" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "anonymous" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "xanonymous" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "anonymous\\0" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "nonymous" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "ANONYMOUS" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "use-credentials" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "xuse-credentials" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "use-credentials\\0" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "se-credentials" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: setAttribute() to "USE-CREDENTIALS" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get]
- expected: FAIL
-
[img.crossOrigin: IDL set to undefined followed by getAttribute()]
expected: FAIL
[img.crossOrigin: IDL set to undefined followed by IDL get]
expected: FAIL
- [img.crossOrigin: IDL set to 7 followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to 7 followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to 1.5 followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to 1.5 followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to true followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to true followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to false followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to false followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to object "[object Object\]" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to object "[object Object\]" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to NaN followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to NaN followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to Infinity followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to Infinity followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to -Infinity followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to -Infinity followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "\\0" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "\\0" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to object "test-toString" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to object "test-toString" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to object "test-valueOf" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to object "test-valueOf" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "anonymous" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "xanonymous" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "xanonymous" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "anonymous\\0" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "anonymous\\0" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "nonymous" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "nonymous" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "ANONYMOUS" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "ANONYMOUS" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "use-credentials" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "xuse-credentials" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "xuse-credentials" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "use-credentials\\0" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "use-credentials\\0" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "se-credentials" followed by getAttribute()]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "se-credentials" followed by IDL get]
- expected: FAIL
-
- [img.crossOrigin: IDL set to "USE-CREDENTIALS" followed by IDL get]
- expected: FAIL
-
[img.width: IDL set to 1 followed by IDL get]
expected: FAIL
@@ -21882,9 +21681,6 @@
[video.height: IDL set to 4294967295 followed by IDL get]
expected: FAIL
- [img.crossOrigin: IDL set to "" followed by IDL get]
- expected: FAIL
-
[img.crossOrigin: IDL set to null followed by getAttribute()]
expected: FAIL
@@ -21894,3 +21690,6 @@
[audio.crossOrigin: IDL set to null followed by getAttribute()]
expected: FAIL
+ [img.crossOrigin: IDL set to null followed by IDL get]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html.ini
index bb5e3f9274f..24774d34ea0 100644
--- a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html.ini
+++ b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html.ini
@@ -1,14 +1,5 @@
[parse-a-srcset-attribute.html]
type: testharness
- [""]
- expected: FAIL
-
- [","]
- expected: FAIL
-
- [",,,"]
- expected: FAIL
-
[" data:,a 1x "]
expected: FAIL
@@ -114,267 +105,27 @@
["data:,a, data:,b ()"]
expected: FAIL
- ["data:,a (, data:,b"]
- expected: FAIL
-
["data:,a /*, data:,b, data:,c */"]
expected: FAIL
["data:,a //, data:,b"]
expected: FAIL
- ["data:,a foo"]
- expected: FAIL
-
- ["data:,a foo foo"]
- expected: FAIL
-
- ["data:,a foo 1x"]
- expected: FAIL
-
- ["data:,a foo 1x foo"]
- expected: FAIL
-
- ["data:,a foo 1w"]
- expected: FAIL
-
- ["data:,a foo 1w foo"]
- expected: FAIL
-
- ["data:,a 1x 1x"]
- expected: FAIL
-
- ["data:,a 1w 1w"]
- expected: FAIL
-
- ["data:,a 1w 1x"]
- expected: FAIL
-
- ["data:,a 1x 1w"]
- expected: FAIL
-
["data:,a 1w 1h"]
expected: FAIL
["data:,a 1h 1w"]
expected: FAIL
- ["data:,a 1h 1h"]
- expected: FAIL
-
- ["data:,a 1h 1x"]
- expected: FAIL
-
- ["data:,a 1h 1w 1x"]
- expected: FAIL
-
- ["data:,a 1x 1w 1h"]
- expected: FAIL
-
["data:,a 1w"]
expected: FAIL
- ["data:,a 1h"]
- expected: FAIL
-
- ["data:,a 1h foo"]
- expected: FAIL
-
- ["data:,a foo 1h"]
- expected: FAIL
-
- ["data:,a 0w"]
- expected: FAIL
-
- ["data:,a -1w"]
- expected: FAIL
-
- ["data:,a 1w -1w"]
- expected: FAIL
-
- ["data:,a 1.0w"]
- expected: FAIL
-
- ["data:,a 1w 1.0w"]
- expected: FAIL
-
- ["data:,a 1e0w"]
- expected: FAIL
-
- ["data:,a 1w 1e0w"]
- expected: FAIL
-
- ["data:,a 1www"]
- expected: FAIL
-
- ["data:,a 1w 1www"]
- expected: FAIL
-
- ["data:,a +1w"]
- expected: FAIL
-
- ["data:,a 1w +1w"]
- expected: FAIL
-
- ["data:,a 1W"]
- expected: FAIL
-
- ["data:,a 1w 1W"]
- expected: FAIL
-
- ["data:,a Infinityw"]
- expected: FAIL
-
- ["data:,a 1w Infinityw"]
- expected: FAIL
-
- ["data:,a NaNw"]
- expected: FAIL
-
- ["data:,a 1w NaNw"]
- expected: FAIL
-
- ["data:,a 0x1w"]
- expected: FAIL
-
- ["data:,a 0X1w"]
- expected: FAIL
-
- ["data:,a 1\\x01w" (trailing U+0001)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+00A0)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+1680)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2000)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2001)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2002)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2003)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2004)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2005)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2006)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2007)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2008)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+2009)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+200A)]
- expected: FAIL
-
- ["data:,a 1‌w" (trailing U+200C)]
- expected: FAIL
-
- ["data:,a 1‍w" (trailing U+200D)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+202F)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+205F)]
- expected: FAIL
-
- ["data:,a 1 w" (trailing U+3000)]
- expected: FAIL
-
- ["data:,a 1w" (trailing U+FEFF)]
- expected: FAIL
-
- ["data:,a \\x011w" (leading U+0001)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+00A0)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+1680)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2000)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2001)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2002)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2003)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2004)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2005)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2006)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2007)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2008)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+2009)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+200A)]
- expected: FAIL
-
- ["data:,a ‌1w" (leading U+200C)]
- expected: FAIL
-
- ["data:,a ‍1w" (leading U+200D)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+202F)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+205F)]
- expected: FAIL
-
- ["data:,a  1w" (leading U+3000)]
- expected: FAIL
-
- ["data:,a 1w" (leading U+FEFF)]
- expected: FAIL
-
["data:,a 0x"]
expected: FAIL
["data:,a -0x"]
expected: FAIL
- ["data:,a 1x -0x"]
- expected: FAIL
-
- ["data:,a -1x"]
- expected: FAIL
-
- ["data:,a 1x -1x"]
- expected: FAIL
-
["data:,a 1e0x"]
expected: FAIL
@@ -387,324 +138,12 @@
["data:,a 1.5e1x"]
expected: FAIL
- ["data:,a -x"]
- expected: FAIL
-
- ["data:,a .x"]
- expected: FAIL
-
- ["data:,a -.x"]
- expected: FAIL
-
- ["data:,a 1.x"]
- expected: FAIL
-
["data:,a .5x"]
expected: FAIL
["data:,a .5e1x"]
expected: FAIL
- ["data:,a 1x 1.5e1x"]
- expected: FAIL
-
- ["data:,a 1x 1e1.5x"]
- expected: FAIL
-
["data:,a 1.0x"]
expected: FAIL
- ["data:,a 1x 1.0x"]
- expected: FAIL
-
- ["data:,a +1x"]
- expected: FAIL
-
- ["data:,a 1X"]
- expected: FAIL
-
- ["data:,a Infinityx"]
- expected: FAIL
-
- ["data:,a NaNx"]
- expected: FAIL
-
- ["data:,a 0x1x"]
- expected: FAIL
-
- ["data:,a 0X1x"]
- expected: FAIL
-
- ["data:,a 1\\x01x" (trailing U+0001)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+00A0)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+1680)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2000)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2001)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2002)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2003)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2004)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2005)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2006)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2007)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2008)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+2009)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+200A)]
- expected: FAIL
-
- ["data:,a 1‌x" (trailing U+200C)]
- expected: FAIL
-
- ["data:,a 1‍x" (trailing U+200D)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+202F)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+205F)]
- expected: FAIL
-
- ["data:,a 1 x" (trailing U+3000)]
- expected: FAIL
-
- ["data:,a 1x" (trailing U+FEFF)]
- expected: FAIL
-
- ["data:,a \\x011x" (leading U+0001)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+00A0)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+1680)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2000)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2001)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2002)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2003)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2004)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2005)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2006)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2007)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2008)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+2009)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+200A)]
- expected: FAIL
-
- ["data:,a ‌1x" (leading U+200C)]
- expected: FAIL
-
- ["data:,a ‍1x" (leading U+200D)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+202F)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+205F)]
- expected: FAIL
-
- ["data:,a  1x" (leading U+3000)]
- expected: FAIL
-
- ["data:,a 1x" (leading U+FEFF)]
- expected: FAIL
-
- ["data:,a 1w 0h"]
- expected: FAIL
-
- ["data:,a 1w -1h"]
- expected: FAIL
-
- ["data:,a 1w 1.0h"]
- expected: FAIL
-
- ["data:,a 1w 1e0h"]
- expected: FAIL
-
- ["data:,a 1w 1hhh"]
- expected: FAIL
-
- ["data:,a 1w +1h"]
- expected: FAIL
-
- ["data:,a 1w 1H"]
- expected: FAIL
-
- ["data:,a 1w Infinityh"]
- expected: FAIL
-
- ["data:,a 1w NaNh"]
- expected: FAIL
-
- ["data:,a 0x1h"]
- expected: FAIL
-
- ["data:,a 0X1h"]
- expected: FAIL
-
- ["data:,a 1w 1\\x01h" (trailing U+0001)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+00A0)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+1680)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2000)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2001)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2002)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2003)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2004)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2005)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2006)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2007)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2008)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+2009)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+200A)]
- expected: FAIL
-
- ["data:,a 1w 1‌h" (trailing U+200C)]
- expected: FAIL
-
- ["data:,a 1w 1‍h" (trailing U+200D)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+202F)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+205F)]
- expected: FAIL
-
- ["data:,a 1w 1 h" (trailing U+3000)]
- expected: FAIL
-
- ["data:,a 1w 1h" (trailing U+FEFF)]
- expected: FAIL
-
- ["data:,a 1w \\x011h" (leading U+0001)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+00A0)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+1680)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2000)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2001)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2002)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2003)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2004)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2005)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2006)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2007)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2008)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+2009)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+200A)]
- expected: FAIL
-
- ["data:,a 1w ‌1h" (leading U+200C)]
- expected: FAIL
-
- ["data:,a 1w ‍1h" (leading U+200D)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+202F)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+205F)]
- expected: FAIL
-
- ["data:,a 1w  1h" (leading U+3000)]
- expected: FAIL
-
- ["data:,a 1w 1h" (leading U+FEFF)]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini
index 7748cf097bb..8af7b4f8c78 100644
--- a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini
+++ b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini
@@ -1,17 +1,8 @@
[update-the-source-set.html]
type: testharness
- [<img data-expect="">]
- expected: FAIL
-
[<img src="" data-expect="">]
expected: FAIL
- [<img src="data:,a" data-expect="data:,a">]
- expected: FAIL
-
- [<img srcset="" src="data:,a" data-expect="data:,a">]
- expected: FAIL
-
[<img srcset="data:,b" src="data:,a" data-expect="data:,b">]
expected: FAIL
@@ -48,42 +39,6 @@
[<img srcset="data:,a" data-expect="data:,a">]
expected: FAIL
- [<picture>foo<img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><!--foo--><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><br><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><p></p><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><video><source srcset="data:,b"></video><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><span><source srcset="data:,b"></span><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><img src="data:,a"><img src="data:,b" data-expect="data:,b"></picture>]
- expected: FAIL
-
- [<picture><source><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source src="data:,b"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset=""><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset=", ,"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b 1x 1x"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
[<picture><source srcset="data:,b" media=""><img src="data:,a" data-expect="data:,b"></picture>]
expected: FAIL
@@ -93,33 +48,12 @@
[<picture><source srcset="data:,b" media="all and (min-width:0)"><img src="data:,a" data-expect="data:,b"></picture>]
expected: FAIL
- [<picture><source srcset="data:,b" media="all and !"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" media="all and (!)"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" media="not all"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" media="not all and (min-width:0)"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
[<picture><source srcset="data:,b" media="not all and (max-width:0)"><img src="data:,a" data-expect="data:,b"></picture>]
expected: FAIL
- [<picture><source srcset="data:,b" media="not all and !"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" media="not all and (!)"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
[<picture><source srcset="data:,b" media="all, !"><img src="data:,a" data-expect="data:,b"></picture>]
expected: FAIL
- [<picture><source srcset="data:,b" media=","><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
[<picture><source srcset="data:,b" media=", all"><img src="data:,a" data-expect="data:,b"></picture>]
expected: FAIL
@@ -162,108 +96,12 @@
[<picture><source srcset="data:,b" type="image/x-icon"><img src="data:,a" data-expect="data:,b"></picture>]
expected: FAIL
- [<picture><source srcset="data:,b" type="text/xml"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="text/html"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="text/plain"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="text/css"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="video/mp4"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="video/ogg"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="video/webm"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="unknown/unknown"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="application/octet-stream"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="application/x-shockwave-flash"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="image\\gif"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="gif"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type=".gif"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="*"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="*/*"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="image/*"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type=","><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="image/gif, image/png"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="image/gif image/png"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b" type="image/foobarbaz"><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
- [<picture><img src="data:,a" data-expect="data:,a">foo</picture>]
- expected: FAIL
-
- [<picture><img src="data:,a" data-expect="data:,a"><br></picture>]
- expected: FAIL
-
- [<picture><img src="data:,a" data-expect="data:,a"><!--foo--></picture>]
- expected: FAIL
-
- [<picture><img src="data:,a" data-expect="data:,a"><img src="data:,b"></picture>]
- expected: FAIL
-
- [<picture><img data-expect=""><img src="data:,b"></picture>]
- expected: FAIL
-
- [<picture><img src="data:,a" data-expect="data:,a"><source srcset="data:,b"></picture>]
- expected: FAIL
-
- [<picture><img data-expect=""><source srcset="data:,b"></picture>]
- expected: FAIL
-
- [<picture><span><source srcset="data:,b"><img data-expect=""></span></picture>]
- expected: FAIL
-
- [<picture><span><source srcset="data:,b"><img src="data:,a" data-expect="data:,a"></span></picture>]
- expected: FAIL
-
- [<picture><source srcset="data:,b"><span><img src="data:,a" data-expect="data:,a"></span></picture>]
- expected: FAIL
-
[<picture><source srcset="data:,b"><img data-expect="data:,b"></picture>]
expected: FAIL
- [<picture><svg><source srcset="data:,b"></source></svg><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
[<picture><svg></svg><source srcset="data:,b"><img src="data:,a" data-expect="data:,b"></picture>]
expected: FAIL
- [<picture><svg><font></font><source srcset="data:,b"></source></svg><img src="data:,a" data-expect="data:,a"></picture>]
- expected: FAIL
-
[<picture><svg><!--<font face> tag breaks out of svg--><font face=""></font><source srcset="data:,b"></source></svg><img src="data:,a" data-expect="data:,b"></picture>]
expected: FAIL