Bug 1465701 [wpt PR 11263] - Add Priority Hints support to link and img elements, a=testonly
authorDominic Farolino <domfarolino@gmail.com>
Wed, 06 Jun 2018 17:44:01 +0000
changeset 476493 34d72e7db04612d61ed3e0880236547d4bcd955f
parent 476492 526c80fae7bc7c6faa4c5e13ef39cf82dd988991
child 476494 97284b91ef230857fb8822f0af60a0b5b1f76187
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1465701, 11263, 821464, 1067245, 563550
milestone62.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 1465701 [wpt PR 11263] - Add Priority Hints support to link and img elements, a=testonly Automatic update from web-platform-testsAdd Priority Hints support to link and img elements This adds Priority Hints support to link and img elements under a runtime-enabled flag. The support for link elements do not extend <link rel=modulepreload>s due to the nature of module script fetching. Support for this as well as script elements in general will come at a later time due to the significant changes to the module script loading infrastructure. Intent to Implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/65lfM2f0eeM R=kinuko@chromium.org, kouhei@chromium.org, yhirano@chromium.org, yoav@yoav.ws Bug: 821464 Change-Id: I5ab0a114ee2b2fce9f0df6c4c5e1f7a487980d0a Reviewed-on: https://chromium-review.googlesource.com/1067245 Commit-Queue: Dominic Farolino <domfarolino@gmail.com> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Yoav Weiss <yoav@yoav.ws> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#563550} -- wpt-commits: 5aa06e74524c68cf1135dd918699f527449b25c2 wpt-pr: 11263
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/priority-hints/img-attr-named-constructor.tentative.html
testing/web-platform/tests/priority-hints/link-attr.tentative.html
testing/web-platform/tests/priority-hints/resources/stylesheet.css
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -289770,16 +289770,21 @@
      {}
     ]
    ],
    "presentation-api/receiving-ua/support/stash.py": [
     [
      {}
     ]
    ],
+   "priority-hints/resources/stylesheet.css": [
+    [
+     {}
+    ]
+   ],
    "proximity/OWNERS": [
     [
      {}
     ]
    ],
    "quirks/OWNERS": [
     [
      {}
@@ -362297,16 +362302,28 @@
     ]
    ],
    "presentation-api/controlling-ua/startNewPresentation_error.https.html": [
     [
      "/presentation-api/controlling-ua/startNewPresentation_error.https.html",
      {}
     ]
    ],
+   "priority-hints/img-attr-named-constructor.tentative.html": [
+    [
+     "/priority-hints/img-attr-named-constructor.tentative.html",
+     {}
+    ]
+   ],
+   "priority-hints/link-attr.tentative.html": [
+    [
+     "/priority-hints/link-attr.tentative.html",
+     {}
+    ]
+   ],
    "proximity/ProximitySensor.https.html": [
     [
      "/proximity/ProximitySensor.https.html",
      {}
     ]
    ],
    "proximity/ProximitySensor_insecure_context.html": [
     [
@@ -598294,16 +598311,28 @@
   "presentation-api/receiving-ua/support/stash.js": [
    "f7a354462a5159ac11e56d13c5972ddfa5af0a70",
    "support"
   ],
   "presentation-api/receiving-ua/support/stash.py": [
    "f64f2ab5d0afa93e5adfa327e478936c0e295823",
    "support"
   ],
+  "priority-hints/img-attr-named-constructor.tentative.html": [
+   "7c30cb250fb854916a8bf87a4fd5c049ee1dcf5b",
+   "testharness"
+  ],
+  "priority-hints/link-attr.tentative.html": [
+   "39dd57841d9752f9220473c5de3a99d1c8ca18a1",
+   "testharness"
+  ],
+  "priority-hints/resources/stylesheet.css": [
+   "bb230110dd1cf4647e020d7172bc375e972c7b41",
+   "support"
+  ],
   "proximity/OWNERS": [
    "8de2a4a7f850b2d52ab3102b585fe38828b6d08d",
    "support"
   ],
   "proximity/ProximitySensor.https.html": [
    "6920751273c1220f40b5046be7ce7254a01ce72e",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/priority-hints/img-attr-named-constructor.tentative.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<title>Priority Hints - Image element</title>
+<meta name="author" title="Dominic Farolino" href="mailto:domfarolino@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<img id=img1 src=/images/green.png importance=high>
+<img id=img2 src=/images/green.png importance=low>
+<img id=img3 src=/images/green.png importance=auto>
+<img id=img4 src=/images/green.png importance=xyz>
+<img id=img5 src=/images/green.png>
+
+<script>
+  test(() => {
+    assert_equals(img1.importance, "high", "high importance is a valid IDL value on the image element");
+    assert_equals(img2.importance, "low", "high importance is a valid IDL value on the image element");
+    assert_equals(img3.importance, "auto", "auto importance is a valid IDL value on the image element");
+    assert_equals(img4.importance, "auto", "invalid importance reflects as 'auto' IDL attribute on the image element");
+    assert_equals(img5.importance, "auto", "missing importance reflects as 'auto' IDL attribute on the image element");
+  }, "importance attribute on <img> elements should reflect valid IDL values");
+
+  const img = new Image();
+  assert_equals(img.importance, "auto");
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/priority-hints/link-attr.tentative.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<title>Priority Hints - Link element</title>
+<meta name="author" title="Dominic Farolino" href="mailto:domfarolino@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<link id=link1 href=resources/stylesheet.css importance=high>
+<link id=link2 href=resources/stylesheet.css importance=low>
+<link id=link3 href=resources/stylesheet.css importance=auto>
+<link id=link4 href=resources/stylesheet.css importance=xyz>
+<link id=link5 href=resources/stylesheet.css>
+
+<script>
+  test(() => {
+    assert_equals(link1.importance, "high", "high importance is a valid IDL value on the link element");
+    assert_equals(link2.importance, "low", "high importance is a valid IDL value on the link element");
+    assert_equals(link3.importance, "auto", "auto importance is a valid IDL value on the link element");
+    assert_equals(link4.importance, "auto", "invalid importance reflects as 'auto' IDL attribute on the link element");
+    assert_equals(link5.importance, "auto", "missing importance reflects as 'auto' IDL attribute on the link element");
+  }, "importance attribute on <link> elements should reflect valid IDL values");
+
+  const link = document.createElement("link");
+  assert_equals(link.importance, "auto");
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/priority-hints/resources/stylesheet.css
@@ -0,0 +1,3 @@
+body {
+  background-color: green;
+}