Bug 1633934 [wpt PR 23309] - Add referrerpolicy to relevant mutations, a=testonly
authorDominic Farolino <dom@chromium.org>
Wed, 13 May 2020 03:57:45 +0000
changeset 531017 851b02986975a9b0b14e1bc62e7c9f5a472e993e
parent 531016 49daed2730e1d377d5937aad022048ecbea685e7
child 531018 f74ca0580bf8a8a9708677926a82438753d86bd0
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1633934, 23309, 1061685, 2171816, 764307
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1633934 [wpt PR 23309] - Add referrerpolicy to relevant mutations, a=testonly Automatic update from web-platform-tests Add referrerpolicy to relevant mutations This CL adds `referrerpolicy` mutations on the img element to the list of relevant mutations [1]. The associated HTML Standard PR is at [2]. See the document [3] for more information. [1]: https://html.spec.whatwg.org/multipage/images.html#relevant-mutations [2]: https://github.com/whatwg/html/pull/5434 [3]: https://docs.google.com/document/d/1Xp34FIbbZnJILl0PNd1sfs_3z1HSriUVyRUgnAesGZk/edit. R=domenic@chromium.org, fs@opera.com, hiroshige@chromium.org Bug: 1061685 Change-Id: Ia2f8490a3689524a86281569185b171f141ea085 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2171816 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#764307} -- wpt-commits: d382a1b0d367b39ba42b32a22dcd386729e4381f wpt-pr: 23309
testing/web-platform/tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html
--- a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html
@@ -40,16 +40,42 @@
 <img src="/images/green-2x2.png" crossorigin data-desc="crossorigin empty to use-credentials, src already set">
 <img src="/images/green-2x2.png" crossorigin=anonymous data-desc="crossorigin anonymous to absent, src already set">
 <img src="/images/green-2x2.png" crossorigin=anonymous data-desc="crossorigin anonymous to use-credentials, src already set">
 <img src="/images/green-2x2.png" crossorigin=use-credentials data-desc="crossorigin use-credentials to absent, src already set">
 <img src="/images/green-2x2.png" crossorigin=use-credentials data-desc="crossorigin use-credentials to empty, src already set">
 <img src="/images/green-2x2.png" crossorigin=use-credentials data-desc="crossorigin use-credentials to anonymous, src already set">
 <img src="/images/green-2x2.png" crossorigin=use-credentials data-desc="crossorigin use-credentials to invalid, src already set">
 
+<img data-desc="referrerpolicy absent to no-referrer-when-downgrade, src absent">
+<img data-desc="referrerpolicy absent to no-referrer, src absent">
+<img referrerpolicy data-desc="referrerpolicy empty to no-referrer-when-downgrade, src absent">
+<img referrerpolicy data-desc="referrerpolicy empty to no-referrer, src absent">
+<img referrerpolicy=no-referrer-when-downgrade data-desc="referrerpolicy no-referrer-when-downgrade to absent, src absent">
+<img referrerpolicy=no-referrer-when-downgrade data-desc="referrerpolicy no-referrer-when-downgrade to empty, src absent">
+<img referrerpolicy=no-referrer-when-downgrade data-desc="referrerpolicy no-referrer-when-downgrade to no-referrer, src absent">
+<img referrerpolicy=no-referrer-when-downgrade data-desc="referrerpolicy no-referrer-when-downgrade to invalid, src absent">
+<img referrerpolicy=no-referrer data-desc="referrerpolicy no-referrer to absent, src absent">
+<img referrerpolicy=no-referrer data-desc="referrerpolicy no-referrer to empty, src absent">
+<img referrerpolicy=no-referrer data-desc="referrerpolicy no-referrer to no-referrer-when-downgrade, src absent">
+<img referrerpolicy=no-referrer data-desc="referrerpolicy no-referrer to invalid, src absent">
+
+<img src="/images/green-2x2.png" data-desc="referrerpolicy absent to no-referrer-when-downgrade, src already set">
+<img src="/images/green-2x2.png" data-desc="referrerpolicy absent to no-referrer, src already set">
+<img src="/images/green-2x2.png" referrerpolicy data-desc="referrerpolicy empty to no-referrer-when-downgrade, src already set">
+<img src="/images/green-2x2.png" referrerpolicy data-desc="referrerpolicy empty to no-referrer, src already set">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer-when-downgrade data-desc="referrerpolicy no-referrer-when-downgrade to absent, src already set">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer-when-downgrade data-desc="referrerpolicy no-referrer-when-downgrade to empty, src already set">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer-when-downgrade data-desc="referrerpolicy no-referrer-when-downgrade to no-referrer, src already set">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer-when-downgrade data-desc="referrerpolicy no-referrer-when-downgrade to invalid, src already set">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer data-desc="referrerpolicy no-referrer to absent, src already set">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer data-desc="referrerpolicy no-referrer to empty, src already set">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer data-desc="referrerpolicy no-referrer to no-referrer-when-downgrade, src already set">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer data-desc="referrerpolicy no-referrer to invalid, src already set">
+
 <img src="/images/green-2x2.png" data-desc="inserted into picture"><picture></picture>
 
 <picture><img src="/images/green-2x2.png" data-desc="removed from picture"></picture>
 
 <picture><img src="/images/green-2x2.png" data-desc="parent is picture, previous source inserted"></picture>
 
 <picture><source><img src="/images/green-2x2.png" data-desc="parent is picture, previous source removed"></picture>
 
@@ -74,16 +100,23 @@
 <img srcset="/images/green-2x2.png" data-desc="srcset is set to same value">
 <img srcset="/images/green-2x2.png" sizes data-desc="sizes is set to same value">
 
 <img src="/images/green-2x2.png" data-desc="crossorigin state not changed: absent, removeAttribute">
 <img src="/images/green-2x2.png" crossorigin data-desc="crossorigin state not changed: empty to anonymous">
 <img src="/images/green-2x2.png" crossorigin=anonymous data-desc="crossorigin state not changed: anonymous to foobar">
 <img src="/images/green-2x2.png" crossorigin=use-credentials data-desc="crossorigin state not changed: use-credentials to USE-CREDENTIALS">
 
+<img src="/images/green-2x2.png" data-desc="referrerpolicy state not changed: absent, removeAttribute">
+<img src="/images/green-2x2.png" referrerpolicy data-desc="referrerpolicy state not changed: empty to empty">
+<img src="/images/green-2x2.png" referrerpolicy data-desc="referrerpolicy state not changed: empty to invalid">
+<img src="/images/green-2x2.png" data-desc="referrerpolicy state not changed: absent to invalid">
+<img src="/images/green-2x2.png" referrerpolicy=no-referrer data-desc="referrerpolicy state not changed: no-referrer to NO-REFERRER">
+<img src="/images/green-2x2.png" referrerpolicy=foobar data-desc="referrerpolicy state not changed: invalid to other-invalid">
+
 <img src="/images/green-2x2.png" data-desc="inserted into picture ancestor"><picture><span></span></picture>
 <picture><span><img src="/images/green-2x2.png" data-desc="removed from picture ancestor"></span></picture>
 
 <picture><span><img src="/images/green-2x2.png" data-desc="ancestor picture has a source inserted"></span></picture>
 <picture><source><span><img src="/images/green-2x2.png" data-desc="ancestor picture has a source removed"></span></picture>
 
 <picture><span><img src="/images/green-2x2.png" data-desc="ancestor picture; previous sibling source inserted"></span></picture>
 <picture><span><source><img src="/images/green-2x2.png" data-desc="ancestor picture; previous sibling source removed"></span></picture>
@@ -268,16 +301,119 @@ onload = function() {
   t('crossorigin use-credentials to anonymous, src already set', function(img) {
     img.crossOrigin = 'anonymous';
   }, 'load');
 
   t('crossorigin use-credentials to invalid, src already set', function(img) {
     img.crossOrigin = 'foobar';
   }, 'load');
 
+  // When src is absent, changing the referrerpolicy attribute state MUST NOT
+  // generate events.
+
+  t('referrerpolicy absent to no-referrer-when-downgrade, src absent', function(img) {
+    img.referrerPolicy = 'no-referrer-when-downgrade';
+  }, 'timeout');
+
+  t('referrerpolicy absent to no-referrer, src absent', function(img) {
+    img.referrerPolicy = 'no-referrer';
+  }, 'timeout');
+
+  t('referrerpolicy empty to no-referrer-when-downgrade, src absent', function(img) {
+    img.referrerPolicy = 'no-referrer-when-downgrade';
+  }, 'timeout');
+
+  t('referrerpolicy empty to no-referrer, src absent', function(img) {
+    img.referrerPolicy = 'no-referrer';
+  }, 'timeout');
+
+  t('referrerpolicy no-referrer-when-downgrade to absent, src absent', function(img) {
+    img.removeAttribute('referrerpolicy');
+  }, 'timeout');
+
+  t('referrerpolicy no-referrer-when-downgrade to empty, src absent', function(img) {
+    img.referrerPolicy = '';
+  }, 'timeout');
+
+  t('referrerpolicy no-referrer-when-downgrade to no-referrer, src absent', function(img) {
+    img.referrerPolicy = 'no-referrer';
+  }, 'timeout');
+
+  t('referrerpolicy no-referrer-when-downgrade to invalid, src absent', function(img) {
+    img.referrerPolicy = 'foobar';
+  }, 'timeout');
+
+  t('referrerpolicy no-referrer to absent, src absent', function(img) {
+    img.removeAttribute('referrerpolicy');
+  }, 'timeout');
+
+  t('referrerpolicy no-referrer to empty, src absent', function(img) {
+    img.referrerPolicy = '';
+  }, 'timeout');
+
+  t('referrerpolicy no-referrer to no-referrer-when-downgrade, src absent', function(img) {
+    img.referrerPolicy = 'no-referrer-when-downgrade';
+  }, 'timeout');
+
+  t('referrerpolicy no-referrer to invalid, src absent', function(img) {
+    img.removeAttribute('referrerpolicy');
+  }, 'timeout');
+
+  // When src is set, changing the referrerpolicy attribute state MUST generate
+  // events.
+
+  t('referrerpolicy absent to no-referrer-when-downgrade, src already set', function(img) {
+    img.referrerPolicy = 'no-referrer-when-downgrade';
+  }, 'load');
+
+  t('referrerpolicy absent to no-referrer, src already set', function(img) {
+    img.referrerPolicy = 'no-referrer';
+  }, 'load');
+
+  t('referrerpolicy empty to no-referrer-when-downgrade, src already set', function(img) {
+    img.referrerPolicy = 'no-referrer-when-downgrade';
+  }, 'load');
+
+  t('referrerpolicy empty to no-referrer, src already set', function(img) {
+    img.referrerPolicy = 'no-referrer';
+  }, 'load');
+
+  t('referrerpolicy no-referrer-when-downgrade to absent, src already set', function(img) {
+    img.removeAttribute('referrerpolicy');
+  }, 'load');
+
+  t('referrerpolicy no-referrer-when-downgrade to empty, src already set', function(img) {
+    img.referrerPolicy = '';
+  }, 'load');
+
+  t('referrerpolicy no-referrer-when-downgrade to no-referrer, src already set', function(img) {
+    img.referrerPolicy = 'no-referrer';
+  }, 'load');
+
+  t('referrerpolicy no-referrer-when-downgrade to invalid, src already set', function(img) {
+    img.referrerPolicy = 'foobar';
+  }, 'load');
+
+  t('referrerpolicy no-referrer to absent, src already set', function(img) {
+    img.removeAttribute('referrerpolicy');
+  }, 'load');
+
+  t('referrerpolicy no-referrer to empty, src already set', function(img) {
+    img.referrerPolicy = '';
+  }, 'load');
+
+  t('referrerpolicy no-referrer to no-referrer-when-downgrade, src already set', function(img) {
+    img.referrerPolicy = 'no-referrer-when-downgrade';
+  }, 'load');
+
+  t('referrerpolicy no-referrer to invalid, src already set', function(img) {
+    img.removeAttribute('referrerpolicy');
+  }, 'load');
+
+
   t('inserted into picture', function(img) {
     img.nextSibling.appendChild(img);
   }, 'load');
 
   t('removed from picture', function(img) {
     img.parentNode.removeChild(img);
   }, 'load');
 
@@ -356,16 +492,40 @@ onload = function() {
   t('crossorigin state not changed: anonymous to foobar', function(img) {
     img.crossOrigin = 'foobar';
   }, 'timeout');
 
   t('crossorigin state not changed: use-credentials to USE-CREDENTIALS', function(img) {
     img.crossOrigin = 'USE-CREDENTIALS';
   }, 'timeout');
 
+  t('referrerpolicy state not changed: absent, removeAttribute', function(img) {
+    img.removeAttribute('referrerpolicy');
+  }, 'timeout');
+
+  t('referrerpolicy state not changed: empty to empty', function(img) {
+    img.referrerPolicy = '';
+  }, 'timeout');
+
+  t('referrerpolicy state not changed: empty to invalid', function(img) {
+    img.referrerPolicy = 'foobar';
+  }, 'timeout');
+
+  t('referrerpolicy state not changed: absent to invalid', function(img) {
+    img.referrerPolicy = 'foobar';
+  }, 'timeout');
+
+  t('referrerpolicy state not changed: no-referrer to NO-REFERRER', function(img) {
+    img.referrerPolicy = 'NO-REFERRER';
+  }, 'timeout');
+
+  t('referrerpolicy state not changed: invalid to other-invalid', function(img) {
+    img.referrerPolicy = 'foobar2';
+  }, 'timeout');
+
   t('inserted into picture ancestor', function(img) {
     img.nextSibling.firstChild.appendChild(img);
   }, 'timeout');
 
   t('removed from picture ancestor', function(img) {
     img.parentNode.removeChild(img);
   }, 'timeout');