-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attributes imagesrcset
and imagesizes
attributes on <link>
#4048
Conversation
How do we handle the |
By |
Other way around; E.g., how can authors preload a resource for: <picture>
<source media=“(min-width: 800px)” srcset=“big.jpg 1200w, small.jpg 600w”>
<img srcset=“cropped-big.jpg 800w, cropped-small.jpg 400w”>
</picture> |
Presumably we can just use the pre-existing |
Oh, of course. And |
So if you have
How can you tell if this is one "picture" or two "picture"s? |
Hmm, well I think it should not matter IIUC. The HTML in your example has potential of fetching two images, and I think any number of |
The HTML in the example [edit: to clear up confusion – in the But, you could relatively-easily make your
But! I don't know how you could do the same thing for |
Gotcha. Yes it is a problem that the HTML @zcorpan provided will preload two images (assuming link |
How about adding a new
|
Ok, so: <link rel=preload as=source media="(min-width: 800px)" imagesrcset="a...">
<link rel=preload as=image imagesrcset="cropped-a...">
<link rel=preload as=source media="(min-width: 800px)" imagesrcset="b...">
<link rel=preload as=image imagesrcset="cropped-b...">
<link rel=preload as=source media="(min-width: 800px)" imagesrcset="c...">
<link rel=preload as=image imagesrcset="cropped-c..."> ...would preload three images, because processing I also imagine we should say that when
Given this, it seems we'll need a new update the source set algorithm that also takes in If this is a decent enough proposal, I guess we can start trying to gather other implementer interest. |
I'm stuck in meetings and can't read the above in detail, but I did just want to point out that I might be totally off-base due to not having read the above comments enough, and if so I apologize, but I wanted to throw this out there before people went too far. |
I think that makes sense @domenic. |
Ah, that's a very good point, yeah |
How about naming it <link rel=preload-source media="(min-width: 800px)" imagesrcset="a...">
<link rel=preload as=image imagesrcset="cropped-a...">
<link rel=preload-source media="(min-width: 800px)" imagesrcset="b...">
<link rel=preload as=image imagesrcset="cropped-b...">
<link rel=preload-source media="(min-width: 800px)" imagesrcset="c...">
<link rel=preload as=image imagesrcset="cropped-c..."> |
The implicit grouping of Perhaps we should file a new issue about the |
I don't think we should be grouping link elements together to try and mimic e.g. for
We'll use:
Does that make sense? Or am I overlooking something here? |
That makes things more difficult for authors, it's not always easy or possible to make the MQ mutually exclusive. Also |
Fair enough. |
Docs need recorded on MDN content roadmap — https://trello.com/c/6YAMGL3B/132-html-link-element |
7c13f55
to
399faa4
Compare
A bit less of a WIP now, but still have to work out the processing model for actually selecting and requesting the image. |
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Reviewed-by: Dominic Farolino <domfarolino@gmail.com> Cr-Commit-Position: refs/heads/master@{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127 --HG-- rename : testing/web-platform/tests/preload/dynamic-adding-preload-imagesrcset.tentative.html => testing/web-platform/tests/preload/dynamic-adding-preload-imagesrcset.html rename : testing/web-platform/tests/preload/link-header-preload-srcset.tentative.html.headers => testing/web-platform/tests/preload/link-header-preload-imagesrcset.html.headers
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Reviewed-by: Dominic Farolino <domfarolino@gmail.com> Cr-Commit-Position: refs/heads/master@{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Reviewed-by: Dominic Farolino <domfarolino@gmail.com> Cr-Commit-Position: refs/heads/master@{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127
heads-up @whatwg/documentation |
Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Reviewed-by: Dominic Farolino <domfarolino@gmail.com> Cr-Commit-Position: refs/heads/master@{#645156}
…o imagesrcset/imagesizes, a=testonly Automatic update from web-platform-tests Rename srcset/imgsizes link attributes to imagesrcset/imagesizes This patch renames "srcset" and "imgsizes" attributes on link to "imagesrcset" and "imagesizes" respectively, to match the latest spec PR [1]. Note: this feature is behind experimental-web-platform-features flag. [1] whatwg/html#4048 Bug: 813452 Change-Id: I8eabfbd734e2f29e36b7f7a3c4a32f1237b042b1 Reviewed-on: https://chromium-review.googlesource.com/c/1350414 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610782} -- wpt-commits: a990dff8729c18279154f66650e83f01911216a4 wpt-pr: 14229 UltraBlame original commit: 3cee5ee7e89d121d039d5ddcca2bdf6a13010f8a
…butes to HTMLLinkElement, a=testonly Automatic update from web-platform-tests Add imageSrcset and imageSizes IDL attributes to HTMLLinkElement This feature is behind the Experimental Web Platform feature flag. Spec PR: whatwg/html#4048 Bug: 813452 Change-Id: I84c58035789b64a311637cebc4672d16661980c2 Reviewed-on: https://chromium-review.googlesource.com/c/1350558 Reviewed-by: Dominic Farolino <domfarolinogmail.com> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610990} -- wpt-commits: dba9026fee0e7f5294181008a91b18c29030a397 wpt-pr: 14231 UltraBlame original commit: 050bf471d5cb823126cee83f31f3f78797e00867
…o imagesrcset/imagesizes, a=testonly Automatic update from web-platform-tests Rename srcset/imgsizes link attributes to imagesrcset/imagesizes This patch renames "srcset" and "imgsizes" attributes on link to "imagesrcset" and "imagesizes" respectively, to match the latest spec PR [1]. Note: this feature is behind experimental-web-platform-features flag. [1] whatwg/html#4048 Bug: 813452 Change-Id: I8eabfbd734e2f29e36b7f7a3c4a32f1237b042b1 Reviewed-on: https://chromium-review.googlesource.com/c/1350414 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610782} -- wpt-commits: a990dff8729c18279154f66650e83f01911216a4 wpt-pr: 14229 UltraBlame original commit: bb0ff9da601041924d15d595d43fcda992e9b17c
…butes to HTMLLinkElement, a=testonly Automatic update from web-platform-tests Add imageSrcset and imageSizes IDL attributes to HTMLLinkElement This feature is behind the Experimental Web Platform feature flag. Spec PR: whatwg/html#4048 Bug: 813452 Change-Id: I84c58035789b64a311637cebc4672d16661980c2 Reviewed-on: https://chromium-review.googlesource.com/c/1350558 Reviewed-by: Dominic Farolino <domfarolinogmail.com> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610990} -- wpt-commits: dba9026fee0e7f5294181008a91b18c29030a397 wpt-pr: 14231 UltraBlame original commit: 988fb1f286accc0c15d9fc19410ed514598dfaf7
…o imagesrcset/imagesizes, a=testonly Automatic update from web-platform-tests Rename srcset/imgsizes link attributes to imagesrcset/imagesizes This patch renames "srcset" and "imgsizes" attributes on link to "imagesrcset" and "imagesizes" respectively, to match the latest spec PR [1]. Note: this feature is behind experimental-web-platform-features flag. [1] whatwg/html#4048 Bug: 813452 Change-Id: I8eabfbd734e2f29e36b7f7a3c4a32f1237b042b1 Reviewed-on: https://chromium-review.googlesource.com/c/1350414 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610782} -- wpt-commits: a990dff8729c18279154f66650e83f01911216a4 wpt-pr: 14229 UltraBlame original commit: 3cee5ee7e89d121d039d5ddcca2bdf6a13010f8a
…butes to HTMLLinkElement, a=testonly Automatic update from web-platform-tests Add imageSrcset and imageSizes IDL attributes to HTMLLinkElement This feature is behind the Experimental Web Platform feature flag. Spec PR: whatwg/html#4048 Bug: 813452 Change-Id: I84c58035789b64a311637cebc4672d16661980c2 Reviewed-on: https://chromium-review.googlesource.com/c/1350558 Reviewed-by: Dominic Farolino <domfarolinogmail.com> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610990} -- wpt-commits: dba9026fee0e7f5294181008a91b18c29030a397 wpt-pr: 14231 UltraBlame original commit: 050bf471d5cb823126cee83f31f3f78797e00867
…o imagesrcset/imagesizes, a=testonly Automatic update from web-platform-tests Rename srcset/imgsizes link attributes to imagesrcset/imagesizes This patch renames "srcset" and "imgsizes" attributes on link to "imagesrcset" and "imagesizes" respectively, to match the latest spec PR [1]. Note: this feature is behind experimental-web-platform-features flag. [1] whatwg/html#4048 Bug: 813452 Change-Id: I8eabfbd734e2f29e36b7f7a3c4a32f1237b042b1 Reviewed-on: https://chromium-review.googlesource.com/c/1350414 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610782} -- wpt-commits: a990dff8729c18279154f66650e83f01911216a4 wpt-pr: 14229 UltraBlame original commit: bb0ff9da601041924d15d595d43fcda992e9b17c
…butes to HTMLLinkElement, a=testonly Automatic update from web-platform-tests Add imageSrcset and imageSizes IDL attributes to HTMLLinkElement This feature is behind the Experimental Web Platform feature flag. Spec PR: whatwg/html#4048 Bug: 813452 Change-Id: I84c58035789b64a311637cebc4672d16661980c2 Reviewed-on: https://chromium-review.googlesource.com/c/1350558 Reviewed-by: Dominic Farolino <domfarolinogmail.com> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610990} -- wpt-commits: dba9026fee0e7f5294181008a91b18c29030a397 wpt-pr: 14231 UltraBlame original commit: 988fb1f286accc0c15d9fc19410ed514598dfaf7
…o imagesrcset/imagesizes, a=testonly Automatic update from web-platform-tests Rename srcset/imgsizes link attributes to imagesrcset/imagesizes This patch renames "srcset" and "imgsizes" attributes on link to "imagesrcset" and "imagesizes" respectively, to match the latest spec PR [1]. Note: this feature is behind experimental-web-platform-features flag. [1] whatwg/html#4048 Bug: 813452 Change-Id: I8eabfbd734e2f29e36b7f7a3c4a32f1237b042b1 Reviewed-on: https://chromium-review.googlesource.com/c/1350414 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610782} -- wpt-commits: a990dff8729c18279154f66650e83f01911216a4 wpt-pr: 14229 UltraBlame original commit: 3cee5ee7e89d121d039d5ddcca2bdf6a13010f8a
…butes to HTMLLinkElement, a=testonly Automatic update from web-platform-tests Add imageSrcset and imageSizes IDL attributes to HTMLLinkElement This feature is behind the Experimental Web Platform feature flag. Spec PR: whatwg/html#4048 Bug: 813452 Change-Id: I84c58035789b64a311637cebc4672d16661980c2 Reviewed-on: https://chromium-review.googlesource.com/c/1350558 Reviewed-by: Dominic Farolino <domfarolinogmail.com> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610990} -- wpt-commits: dba9026fee0e7f5294181008a91b18c29030a397 wpt-pr: 14231 UltraBlame original commit: 050bf471d5cb823126cee83f31f3f78797e00867
…o imagesrcset/imagesizes, a=testonly Automatic update from web-platform-tests Rename srcset/imgsizes link attributes to imagesrcset/imagesizes This patch renames "srcset" and "imgsizes" attributes on link to "imagesrcset" and "imagesizes" respectively, to match the latest spec PR [1]. Note: this feature is behind experimental-web-platform-features flag. [1] whatwg/html#4048 Bug: 813452 Change-Id: I8eabfbd734e2f29e36b7f7a3c4a32f1237b042b1 Reviewed-on: https://chromium-review.googlesource.com/c/1350414 Reviewed-by: Kouhei Ueno <kouheichromium.org> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610782} -- wpt-commits: a990dff8729c18279154f66650e83f01911216a4 wpt-pr: 14229 UltraBlame original commit: bb0ff9da601041924d15d595d43fcda992e9b17c
…butes to HTMLLinkElement, a=testonly Automatic update from web-platform-tests Add imageSrcset and imageSizes IDL attributes to HTMLLinkElement This feature is behind the Experimental Web Platform feature flag. Spec PR: whatwg/html#4048 Bug: 813452 Change-Id: I84c58035789b64a311637cebc4672d16661980c2 Reviewed-on: https://chromium-review.googlesource.com/c/1350558 Reviewed-by: Dominic Farolino <domfarolinogmail.com> Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Cr-Commit-Position: refs/heads/master{#610990} -- wpt-commits: dba9026fee0e7f5294181008a91b18c29030a397 wpt-pr: 14231 UltraBlame original commit: 988fb1f286accc0c15d9fc19410ed514598dfaf7
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Reviewed-by: Dominic Farolino <domfarolinogmail.com> Cr-Commit-Position: refs/heads/master{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127 UltraBlame original commit: 54dede13dc1253acdce7b200324c904cfe2a3fc1
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Reviewed-by: Dominic Farolino <domfarolinogmail.com> Cr-Commit-Position: refs/heads/master{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127 UltraBlame original commit: 4c70421fcbab67e75f19743d9215abee07483f04
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Reviewed-by: Dominic Farolino <domfarolinogmail.com> Cr-Commit-Position: refs/heads/master{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127 UltraBlame original commit: 54dede13dc1253acdce7b200324c904cfe2a3fc1
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Reviewed-by: Dominic Farolino <domfarolinogmail.com> Cr-Commit-Position: refs/heads/master{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127 UltraBlame original commit: 4c70421fcbab67e75f19743d9215abee07483f04
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Reviewed-by: Dominic Farolino <domfarolinogmail.com> Cr-Commit-Position: refs/heads/master{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127 UltraBlame original commit: 54dede13dc1253acdce7b200324c904cfe2a3fc1
…esrcset tests, a=testonly Automatic update from web-platform-tests Remove .tentative mark from preload-imagesrcset tests Now that the HTML spec change (whatwg/html#4048) is landed, let's remove the .tentative label from the tests. Bug: 813452 Change-Id: Id92373c8b78b537b6020c6aa8e05765e2c075834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542738 Commit-Queue: Kunihiko Sakamoto <ksakamotochromium.org> Reviewed-by: Dominic Farolino <domfarolinogmail.com> Cr-Commit-Position: refs/heads/master{#645156} -- wpt-commits: 835b267c69bfddefa374083edf408f1015145e27 wpt-pr: 16127 UltraBlame original commit: 4c70421fcbab67e75f19743d9215abee07483f04
HTML Standard-size changes for w3c/preload#120
TODO:
as
==image
, and if soimagesrcset
andimagesizes
mutations under appropriate times (PR is up)Would appreciate some thoughts thus far; is this even the direction we want to go, i.e., making some of the algorithms in the images section fit the
link
element? /cc @zcorpan/images.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/links.html ( diff )
/semantics.html ( diff )