Repository navigation
Add WPTs for normative 2D image source selection - #64736
Merged
Merged
Conversation
5 tasks done
noamr
force-pushed
the
noamr/untent-sizes-2d
branch
from
November 5, 2026 16:03
08a4a52 to
61669a0
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests normative image candidate selection (
select an image source from a source set) when normalizing densities using 2D<source-size-value>s (contain/cover),sizes="auto"withobject-fit,hdescriptors, andwidth/heightdimension attributes (stacked on #64025 for whatwg/html#13053):select-an-image-source-2d.html:0.5x,1x,1.25x,1.5x,2x, unsorted candidate lists, and all< DPRfallback) withcoverandcontain2Dsizesandhdescriptors across<img>,<picture><source>, and<link rel="preload" as="image" imagesrcset imagesizes>, using aspect-ratio-preservingMath.ceil/Math.floorscaling so assertions hold at fractionaldevicePixelRatiovalues.srcsetwhere sorting by 2D-normalized density (w / concreteWidth) inverts the relative order of candidates compared to theirwdescriptor values.wdescriptors (orw+hvsxdescriptors) that normalize to equal 2D pixel density, includingcover 0px 0px,contain 400px 0px, andcontain 0px 400px(Infinitydensity,0x0density-corrected natural dimensions), contrasted withcover 0px 400px(non-zero scaled width).<source-size-value>s and 1D fallbacks.dimension attribute aspect ratio(widthandheightattributes on<img>and<source>, inheritance, override, mixed per-candidatehdescriptor + fallback aspect ratio, dynamicremoveAttribute('height')re-selection, and fallback tosrcwhen allhdescriptors are invalid).>= DPR; cached duplicate at equal 2D density removed by deduplication before cache check; cached mid-density candidate never causing selection of higher uncached candidate).'zoom'interaction with 2D source selection (zoomon<img>and ancestor not scaling targetdevicePixelRatiofor explicit 2Dsizes, whilezoom: 2,zoom: 0.5, and fractionalzoom: 1.1on<iframe>scale childdevicePixelRatiofor both<img>and<link rel="preload">).sizes="auto"(loading="lazy") andobject-fit(cover,contain,scale-down,fill,none, and100px x 0pxcontain->Infinitydensity) on both<img>and<picture><source>.select-an-image-source-2d-cached.optional.html:<img>,<picture><source>,data:URLs, and<link rel="preload" imagesizes imagesrcset>-warmed candidates), keeping an already-loaded candidate when 2Dsizeschanges fromcovertocontain, and dynamiciframezoomre-selection.preload/link-header-preload-imagesrcset-2d.html(+.headers):Link:HTTP response headers withrel=preload; as=image,hdescriptors inimagesrcset, andcover/contain/ media-conditioned 2Dimagesizes.