<pre class='metadata'>
Title: CSS Images Module Level 4
Status: ED
Prepare for TR: no
Work Status: Exploring
Shortname: css-images
Level: 4
Group: csswg
ED: https://drafts.csswg.org/css-images-4/
TR: https://www.w3.org/TR/css-images-4/
Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/, w3cid 42199
Editor: Elika J. Etemad / fantasai, Apple, http://fantasai.inkedblade.net/contact, w3cid 35400
Editor: Lea Verou, Invited Expert, http://lea.verou.me/about, w3cid 52258
Abstract: This module contains the features of CSS level 4 relating to the <<image>> type and replaced elements.
	It includes and extends the functionality of CSS level 2 [[CSS2]] and in the previous level of this specification [[css-images-3]].
	The main extensions compared to "CSS Images Module Level 3" [[css-images-3]] are several additions to the <<image>> type, such as the ''image()'' notation, the ''element()'' notation, and conic gradients.
	This level is currently maintained as a diff spec over the level 3 module.

!Delta Spec: yes
Issue Tracking: Tracker http://www.w3.org/Style/CSS/Tracker/products/27
Previous Version: https://www.w3.org/TR/2023/WD-css-images-4-20230217/
Previous Version: https://www.w3.org/TR/2017/WD-css-images-4-20170413/
Previous Version: https://www.w3.org/TR/2012/WD-css4-images-20120911/
Ignored Terms: <offset>, background positioning area, border image area, <meetorslice>, Map, <image>, invalid image, invalid images, concrete object size, linear-gradient(), radial-gradient(), default object size, CSS
Ignored Vars: H, P
Include Can I Use Panels: yes
Default Highlight: css
Complain About: missing-example-ids true
WPT Path Prefix: css/css-images/
WPT Display: open
</pre>

<pre class=link-defaults>
spec: css-color-4; type: type; text: <color-interpolation-method>
</pre>

Introduction {#intro}
=====================

	<em>This section is not normative.</em>

	This module introduces additional ways of representing 2D images,
	for example as <a section href="#image-notation">a URL with color fallback</a>,
	as <a href="#conic-gradients">conic gradients</a>,
	or as the <a href="#element-notation">rendering of another element in the document</a>.

Value Definitions {#values}
---------------------------

	This specification follows the <a href="https://www.w3.org/TR/CSS2/about.html#property-defs">CSS property definition conventions</a> from [[!CSS2]]
	using the <a href="https://www.w3.org/TR/css-values-3/#value-defs">value definition syntax</a> from [[!CSS-VALUES-3]].
	Value types not defined in this specification are defined in CSS Values &amp; Units [[!CSS-VALUES-3]].
	Combination with other CSS modules may expand the definitions of these value types.

	In addition to the property-specific values listed in their definitions,
	all properties defined in this specification
	also accept the <a>CSS-wide keywords</a> as their property value.
	For readability they have not been repeated explicitly.

<!--
   ██ ████ ██     ██    ███     ██████   ████████ ██
  ██   ██  ███   ███   ██ ██   ██    ██  ██        ██
 ██    ██  ████ ████  ██   ██  ██        ██         ██
██     ██  ██ ███ ██ ██     ██ ██   ████ ██████      ██
 ██    ██  ██     ██ █████████ ██    ██  ██         ██
  ██   ██  ██     ██ ██     ██ ██    ██  ██        ██
   ██ ████ ██     ██ ██     ██  ██████   ████████ ██
-->

2D Image Values: the <<image>> type {#image-values}
===================================================

	The <<image>> value type denotes a 2D image. It can be a
	<a section href="#url-notation">url reference</a>,
	<a section href="#image-notation">image notation</a>,
	or <a section href="#gradients">gradient notation</a>.
	Its syntax is:

	<pre class="prod"><dfn>&lt;image></dfn> = <<url>> | <<image()>> | <<image-set()>> | <<cross-fade()>> | <<element()>> | <<gradient>></pre>

	An <<image>> can be used in many CSS properties,
	including the 'background-image', 'list-style-image', 'cursor' properties [[!CSS2]]
	(where it replaces the <<url>> component in the property's value).

	In some cases an image is invalid,
	such as a <<url>> pointing to a resource that is not a valid image format
	or that has failed to load.
	An <dfn export lt="invalid image|valid image">invalid image</dfn> is rendered
	as a solid-color ''transparent'' image with no [=natural dimensions=].
	However, <a>invalid images</a> can trigger error-handling clauses
	in some contexts.
	For example, an <a>invalid image</a> in 'list-style-image'
	it is treated as ''list-style-type/none'',
	allowing the 'list-style-type' to render in its place. [[CSS2]]

	While an image is loading,
	is a <dfn export>loading image</dfn>.
	[=Loading images=] are <em>not</em> [=invalid images=],
	but have similar behavior:
	they are rendered as a solid-color ''transparent'' image with no [=natural dimensions=],
	and may trigger fallback rendering in contexts that offer it,
	but must not trigger loading of fallback resources.
	Alternately, if a <a>loading image</a> happens to be replacing
	an already-loaded image
	(for example due to changes in the document or style sheet)
	and the UA is tracking this information,
	it may continue to render the already-loaded image
	in place of the <a>loading image</a>.

	Partially-loaded images (whose [=natural dimensions=] are known, but whose image data is not fully loaded)
	may be either treated as [=loading images=]
	or as loaded images rendered with partial data.
	For example, a UA may render an interlaced GIF in place
	as soon as its first pass of pixel data has loaded
	or even as soon as the image header (which contains sizing data) has parsed
	and refresh the rendering as more data loads;
	or it may wait until the entire image has loaded before using it.

	A <dfn export>[=computed value|computed=] <<image>></dfn> value
	is the [=specified value=]
	with any <<url>>s, <<color>>s, and <<length>>s computed.


Image File Formats {#image-file-formats}
----------------------------------------

	At minimum, the UA must support the following image file formats
	when referenced from an <<image>> value,
	for all the properties in which using <<image>> is valid:
	<ul>
		<li>PNG, as specified in [[!PNG]]
		<li>SVG, as specified in [[!SVG11]],
		using the <a href="https://www.w3.org/TR/svg-integration/#secure-static-mode">secure static mode</a> (See [[!SVG-INTEGRATION]])
		<li>If the UA supports animated <<image>>s,
		SVG, as specified in [[!SVG11]],
		using the <a href="https://www.w3.org/TR/svg-integration/#secure-animated-mode">secure animated mode</a> (See [[!SVG-INTEGRATION]])
	</ul>

	The UA may support other file formats as well.

Image References: the ''url()'' notation {#url-notation}
--------------------------------------------------------

	Note: No change from [[css-images-3]].


Fetching External Images {#fetching-images}
-------------------------------------------

	To <dfn export>fetch an external image for a stylesheet</dfn>,
	given a <<url>> |url| and a [=CSS declaration block=] |declaration|,
	[=fetch a style resource=] given |url|,
	with ruleOrDeclaration being |declaration|,
	destination "image",
	CORS mode "no-cors",
	and processResponse being the following steps
	given [=/response=] <var ignore>res</var>
	and null, failure or
	a byte stream |byteStream|:
		If |byteStream| is a byte stream, load the image from the byte stream.


<!--
████ ██     ██    ███     ██████   ████████          ██████  ████████ ████████   ███ ███
 ██  ███   ███   ██ ██   ██    ██  ██               ██    ██ ██          ██     ██     ██
 ██  ████ ████  ██   ██  ██        ██               ██       ██          ██    ██       ██
 ██  ██ ███ ██ ██     ██ ██   ████ ██████   ███████  ██████  ██████      ██    ██       ██
 ██  ██     ██ █████████ ██    ██  ██                     ██ ██          ██    ██       ██
 ██  ██     ██ ██     ██ ██    ██  ██               ██    ██ ██          ██     ██     ██
████ ██     ██ ██     ██  ██████   ████████          ██████  ████████    ██      ███ ███
-->


Resolution/Type Negotiation: the ''image-set()'' notation {#image-set-notation}
-------------------------------------------------------------------------------

	Delivering the most appropriate image resolution for a user's device can be a difficult task.
	Ideally, images should be in the same resolution as the device they're being viewed in,
	which can vary between users.
	However, other factors can factor into the decision of which image to send;
	for example, if the user is on a slow mobile connection,
	they may prefer to receive lower-res images
	rather than waiting for a large proper-res image to load.
	The <dfn>image-set()</dfn> function allows an author to ignore most of these issues,
	simply providing multiple resolutions of an image
	and letting the UA decide which is most appropriate in a given situation.

	Issue: This solution assumes that resolution is a proxy for filesize,
	and therefore doesn't appropriately handle multi-resolution sets of vector images,
	or mixing vector images with raster ones (e.g. for icons).
	For example, use a vector for high-res,
	pixel-optimized bitmap for low-res,
	and same vector again for low-bandwidth (because it's much smaller, even though it's higher resolution).

	The syntax for ''image-set()'' is:

	<pre class='prod'>
	<<image-set()>> = image-set( <<image-set-option>># )
	<dfn>&lt;image-set-option></dfn> = [ <<image>> | <<string>> ]
	                     [ <<resolution>> || type(<<string>>) ]?
	</pre>

	Issue: We should add "w" and "h" dimensions as a possibility
	to match the functionality of HTML's <a element>picture</a>.

	Each <<string>> inside ''image-set()'' represents a <<url>>.

	The ''image-set()'' function can not be nested inside of itself,
	either directly
	or indirectly
	(as an argument to another <<image>> type).

	Each <<image-set-option>> defines a possible image for the ''image-set()'' function to represent,
	composed of three parts:

	* An image reference (required).
		This can be a URL,
		or a CSS generated image,
		such as a ''linear-gradient()''.

	* A <<resolution>> (optional).
		This is used to help the UA decide which <<image-set-option>> to choose.
		If the image reference is for a raster image,
		it also specifies the image's [=natural resolution=],
		overriding any other source of data that might supply a [=natural resolution=].

		If not specified,
		it behaves as ''1x'' for the purpose of selecting which <<image-set-option>> to use.
		It also <em>defaults</em> the image's [=natural resolution=] to ''1x'',
		but if some other source of data supplies a [=natural resolution=],
		that resolution must be honored instead.

	* A <dfn function for=image-set() lt=type()>type( <<string>> )</dfn> function (optional),
		specifying the image's MIME type in the <<string>>.

		If the <<string>>,
		when parsed as a [=valid MIME type string=],
		is either not valid,
		or is valid but doesn't specify a supported image format,
		the <<image-set-option>> does not define a valid option.
		(This has no effect on the validity of the ''image-set()'' function.)

		It does not have any effect on the image itself;
		an <<image-set-option>> like <code highlight=css>url("picture.png") 1x type("image/jpeg")</code> is valid,
		and if chosen will display the linked PNG image,
		even though it was declared to be a JPEG.

		If not specified,
		it has no effect on the <<image-set-option>>.

	<wpt>
		image-set/image-set-all-options-invalid.html
		image-set/image-set-calc-x-rendering-2.html
		image-set/image-set-calc-x-rendering.html
		image-set/image-set-computed.sub.html
		image-set/image-set-conic-gradient-rendering.html
		image-set/image-set-content-rendering.html
		image-set/image-set-dpcm-rendering.html
		image-set/image-set-dpi-rendering-2.html
		image-set/image-set-dpi-rendering.html
		image-set/image-set-dppx-rendering.html
		image-set/image-set-empty-url-rendering.html
		image-set/image-set-first-match-rendering.html
		image-set/image-set-linear-gradient-rendering.html
		image-set/image-set-negative-resolution-rendering-2.html
		image-set/image-set-negative-resolution-rendering-3.html
		image-set/image-set-negative-resolution-rendering.html
		image-set/image-set-no-res-rendering-2.html
		image-set/image-set-no-res-rendering.html
		image-set/image-set-no-url-rendering.html
		image-set/image-set-parsing.html
		image-set/image-set-radial-gradient-rendering.html
		image-set/image-set-rendering-2.html
		image-set/image-set-rendering.html
		image-set/image-set-repeating-conic-gradient-rendering.html
		image-set/image-set-repeating-linear-gradient-rendering.html
		image-set/image-set-repeating-radial-gradient-rendering.html
		image-set/image-set-resolution-001.html
		image-set/image-set-resolution-002.html
		image-set/image-set-resolution-003.html
		image-set/image-set-type-first-match-rendering.html
		image-set/image-set-type-rendering-2.html
		image-set/image-set-type-rendering-3.html
		image-set/image-set-type-rendering.html
		image-set/image-set-type-skip-unsupported-rendering.html
		image-set/image-set-type-unsupported-rendering-2.html
		image-set/image-set-type-unsupported-rendering.html
		image-set/image-set-unordered-res-rendering.html
		image-set/image-set-zero-resolution-rendering-2.html
		image-set/image-set-zero-resolution-rendering.html
	</wpt>

	An ''image-set()'' function contains a list of one or more <<image-set-option>>s,
	and must select only one of them
	to determine what image it will represent:

	1. First, remove any <<image-set-option>>s from the list
		that specify an unknown or unsupported MIME type in their ''type()'' value.
	2. Second, remove any <<image-set-option>>s from the list
		that have the same <<resolution>> as a previous option in the list.
	3. If there are no <<image-set-option>> left at this point,
		the function represents an [=invalid image=].
	3. Finally, among the remaining <<image-set-option>>s,
		make a UA-specific choice of which to load,
		based on whatever criteria deemed relevant
		(such as the resolution of the display,
			connection speed,
			etc).
	4. The ''image-set()'' function then represents the <<image>>
		of the chosen <<image-set-option>>.

	UAs <strong>may</strong> change which <<image-set-option>> they wish to use for a given ''image-set()''
	over the lifetime of the page,
	if the criteria used to determine which option to choose change significantly enough to make it worthwhile in the UA's estimation.

	<div class='example' id='ex-image-set'>
		This example shows how to use ''image-set()'' to provide an image in three versions:
		a "normal" version,
		a "high-res" version,
		and an extra-high resolution version for use in high-quality printing
		(as printers can have <em>extremely</em> high resolution):

		<pre>
			background-image: image-set( "foo.png" 1x,
			                             "foo-2x.png" 2x,
			                             "foo-print.png" 600dpi );
		</pre>
	</div>

	<div class='example' id='ex-image-set-type'>
		This example shows use of the ''type()'' function
		to serve multiple versions of the same image
		in both new, higher-quality formats,
		and older, more widely-supported formats:

		<pre>
			background-image: image-set( "foo.avif" type("image/avif"),
			                             "foo.jpg" type("image/jpeg") );
		</pre>

		Note that the AVIF image is given first;
		since both images have the same resolution
		(defaulting to ''1x'' since it's unspecified),
		the JPEG image,
		coming second,
		is automatically dropped in UAs that support AVIF images.

		In older UAs, however,
		the AVIF image is ignored
		(because the UA knows it doesn't support <code>"image/avif"</code> files),
		and so the JPEG is chosen instead.
	</div>

	<div class=example id='eximage-set-multi-resolution'>
		Raster images can be mixed with vector images,
		or even CSS generated images.

		For example, in this code snippet
		a high-resolution image with subtle details is used on screens that can do it justice,
		while an ordinary CSS ''linear-gradient()'' is used instead for low-resolution situations:

		<pre>
			background-image: image-set( linear-gradient(cornflowerblue, white) 1x,
			                             url("detailed-gradient.png") 3x );
		</pre>
	</div>

<!--
████ ██     ██    ███     ██████   ████████   ███ ███
 ██  ███   ███   ██ ██   ██    ██  ██        ██     ██
 ██  ████ ████  ██   ██  ██        ██       ██       ██
 ██  ██ ███ ██ ██     ██ ██   ████ ██████   ██       ██
 ██  ██     ██ █████████ ██    ██  ██       ██       ██
 ██  ██     ██ ██     ██ ██    ██  ██        ██     ██
████ ██     ██ ██     ██  ██████   ████████   ███ ███
-->


Image Fallbacks and Annotations: the ''image()'' notation {#image-notation}
---------------------------------------------------------------------------

	The ''image()'' function allows an author
	to easily generate a solid-color image from any color.
	Its syntax is:

	<pre class='prod'>
		<dfn>image()</dfn> = image( <<color>> )
	</pre>

	The ''image()'' function represents a solid-color image of the specified color
	with no [=natural dimensions=].

	<div class='example' id='ex-solid-color'>
		For example,
		one can use this as a simple way to "tint" a background image,
		by overlaying a partially-transparent color over the top of the other image:

		<pre class="lang-css">background-image: image(rgba(0, 0, 255, .5)), url("bg-image.png");</pre>

		This is equivalent to a single color stop gradient:

		<pre class="lang-css">background-image: linear-gradient(rgba(0, 0, 255, .5)), url("bg-image.png");</pre>

		'background-color' does not work for this,
		as the solid color it generates always lies <em>beneath</em> all the background images.
	</div>

	Note: This function previously defined a number of additional behaviors,
	but those have been shifted to [[css-images-5]].

<!-- Big Text: cross-fade

 ███▌  ████▌   ███▌   ███▌   ███▌        █████▌  ███▌  ████▌  █████▌
█▌  █▌ █▌  █▌ █▌  █▌ █▌  █▌ █▌  █▌       █▌     ▐█ ▐█  █▌  █▌ █▌
█▌     █▌  █▌ █▌  █▌ █▌     █▌           █▌     █▌  █▌ █▌  █▌ █▌
█▌     ████▌  █▌  █▌  ███▌   ███▌  ████▌ ████   █▌  █▌ █▌  █▌ ████
█▌     █▌▐█   █▌  █▌     █▌     █▌       █▌     █████▌ █▌  █▌ █▌
█▌  █▌ █▌ ▐█  █▌  █▌ █▌  █▌ █▌  █▌       █▌     █▌  █▌ █▌  █▌ █▌
 ███▌  █▌  █▌  ███▌   ███▌   ███▌        █▌     █▌  █▌ ████▌  █████▌
-->

Combining images: the ''cross-fade()'' notation {#cross-fade-function}
----------------------------------------------------------------------

	When transitioning between images,
	CSS requires a way to explicitly refer to the intermediate image
	that is a combination of the start and end images.
	This is accomplished with the ''cross-fade()'' function,
	which indicates the two images to be combined
	and how far along in the transition the combination is.

	Note: Authors can also use the ''cross-fade()'' function for many simple image manipulations,
	such as tinting an image with a solid color
	or highlighting a particular area of the page by combining an image with a radial gradient.

	The syntax for ''cross-fade()'' is defined as:

	<pre class=prod>
		<dfn caniuse="css-cross-fade">cross-fade()</dfn> = cross-fade( <<cf-image>># )
		<dfn>&lt;cf-image></dfn> = [ <<image>> | <<color>> ] && <<percentage [0,100]>>?
	</pre>

	The function represents an image generated by
	combining one or more images.

	The <<percentage>> represents how much of each image is retained
	when it is blended with the other images.
	The <<percentage>> must be between ''0%'' and ''100%'' inclusive;
	any other value is invalid.

	If any percentages are omitted,
	all the specified percentages are summed together
	and subtracted from ''100%'',
	the result is floored at ''0%'',
	then divided equally between all images with omitted percentages
	at computed-value time.

	<div class=note>
		While this is not reflected in the computed value,
		when all the arguments’ percentages sum to greater than ''100%'',
		the sizing/painting details effectively rescale them so that they sum to exactly ''100%''.

		On the other hand,
		when the sum is less than ''100%'',
		the sizing/painting details effectively act like there's an additional ''transparent'' argument,
		with its percentage set to the remaining value
		necessary to make the sum equal ''100%''.
	</div>

	If a <<color>> is provided,
	it represents a solid-color image
	with “automatic” dimensions
	(it doesn't participate in the sizing of the result image at all;
	see details in the sizing details below).

	<wpt>
		cross-fade-basic.html
		cross-fade-computed-value.html
		cross-fade-legacy-crash.html
		cross-fade-legacy-2-crash.html
		cross-fade-natural-size.html
		cross-fade-premultiplied-alpha.html
		cross-fade-target-alpha.html
	</wpt>

### ''cross-fade()'' Sizing ### {#cross-fade-sizing}

	The dimensions of the image represented by a ''cross-fade()''
	are a weighted average of dimensions of the <<image>> arguments to the function;
	the <<color>> arguments have no effect.
	They are calculated as follows:

	<div algorithm>
		To determine the <dfn export>[=natural dimensions=] of a cross-fade()</dfn>:

		1. [=Normalize mix percentages=] from the function's arguments,
			and let |args| and |leftover| be the result.

		2. If |leftover| is 100%,
			return no [=natural dimensions=].

		3. Let |images| be an empty list.

		4. For each <<cf-image>> |argument| of the function's arguments:
			1. If |argument| is not an <<image>>,
				or is an <<image>> with no natural dimensions,
				[=iteration/continue=].
			2. Let |item| be a [=tuple=] consisting of a width, a height, and a percentage.
			3. Run the [=object size negotiation=] algorithm for the <<image>>,
				as appropriate for the context in which the ''cross-fade()'' appears,
				and set |item|’s width and height
				to the width and height of the resulting [=concrete object size=].
			4. Set |item|’s percentage to the |argument|’s percentage.

		5. If |images| is empty,
			return no [=natural dimensions=].

		6. Return a [=natural width=] and [=natural height=]
			that are weighted averages of the width and height
			of each item in |images|,
			according to their corresponding percentages.

			Note: The percentages might sum to a value less than 100%,
			so a naive weighted-averaging process might need to normalize them first.
	</div>

### ''cross-fade()'' Painting ### {#cross-fade-painting}

	The image represented by a ''cross-fade()''
	is a weighted average of the input arguments to the function,
	calculated as follows:

	<div algorithm>
		To determine the <dfn export>appearance of a cross-fade()</dfn>:

		1. [=Normalize mix percentages=] from the function's arguments,
			and let |args| and |leftover| be the result.

		1. Let |images| be an empty list.

		2. Let |size| be a [=tuple=] of width and height,
			initialized to the result of finding the [=concrete object size=]
			of the ''cross-fade()'' function
			(using the [=natural dimensions of a cross-fade()=]).

		3. For each |argument| of the ''cross-fade()'' function:
			1. Let |item| be a [=tuple=] consisting of an image and a percentage.
			2. If |argument| has an <<image>>,
				rescale it to |size|’s width and height
				and set |item|’s image to the result.
				Otherwise, |argument| has a <<color>>;
				set |item|’s image to a solid-color image of the <<color>>,
				with |size|’s dimensions.
			3. Set |item|’s percentage to the |argument|’s percentage.

		5. If |leftover| is greater than ''0%'',
			append a [=tuple=] to |images|
			consisting of a solid-color transparent-black image
			with |size|’s dimensions,
			and a percentage equal to |leftover|.

		6. Let |final image| be an image
			with |size|’s dimensions,
			and every pixel being the weighted linear average of the corresponding pixels of [=list/for each|each=] |item|’s image in |images|,
			weighted according to the |item|’s percentage.
			(Average both the color channels and the alpha channel of the pixels.)
			For the purpose of this calculation,
			each pixel's color must be in pre-multiplied sRGB.

			<details class=note>
				<summary>Details on the above operation</summary>

				This is applying an N-way Porter-Duff <code>dissolve</code> operation to the source images.
				Wikipedia defines <code>dissolve</code> as a stochastic operation,
				with the result pixels independently randomly chosen from the source images’ corresponding pixels
				according to their source images’ weights,
				but as pixels shrink to infinitely small,
				this converges to doing color-averaging in pre-multiplied color space.

				In particular, this means that `cross-fade(white 50%, transparent 50%)`
				will produce a partially-transparent solid white image.
				(Rather than a partially-transparent gray,
				which is what you'd get if you averaged the opaque white and transparent black pixels
				in non-premultiplied space.)

				As converting to pre-multiplied does entail some loss of precision,
				and graphics libraries may or may not support this operation natively,
				as per usual any method can be used so long as it achieves the specified effect.

				For example, one can instead rebalance the percentages
				according to the alphas of each pixel,
				then do the color-channel averages in non-premultiplied space.
				E.g., to render ''cross-fade(rgb(255 0 0 / 1) 40%, rgb(0 255 0 / .5) 20%, rgb(0 0 255 / 0) 40%)'',
				rebalancing the percentages according to the 1 / .5 / 0 alphas
				would produce 40% / 10% / 0%
				(which renormalizes to 80% / 20% / 0%),
				at which point you can average the raw color channel values
				and end up with an ''rgb(204 51 0 / .5)'' image.
				(Note that the alpha channel is still averaged using the original percentages,
				not the rebalanced ones.)
			</details>


		7. Return |final image|.
	</div>

### Simplifying Complex ''cross-fade()'' ### {#cross-fade-complex}

	Issue: Per WG resolution,
	define a notion of "equality" for images,
	and combine "same" images at computed-value time,
	summing their percentages.

	Issue: Per WG resolution,
	simplify directly-nested ''cross-fade()'' at computed-value time
	by just distributing the percentage and flattening;
	''cross-fade(A 10%, cross-fade(B 30%, C 70%) 90%)''
	becomes ''cross-fade(A 10%, B 27%, C 63%)''.

<!--
████████ ██       ████████ ██     ██ ████████ ██    ██ ████████   ███ ███
██       ██       ██       ███   ███ ██       ███   ██    ██     ██     ██
██       ██       ██       ████ ████ ██       ████  ██    ██    ██       ██
██████   ██       ██████   ██ ███ ██ ██████   ██ ██ ██    ██    ██       ██
██       ██       ██       ██     ██ ██       ██  ████    ██    ██       ██
██       ██       ██       ██     ██ ██       ██   ███    ██     ██     ██
████████ ████████ ████████ ██     ██ ████████ ██    ██    ██      ███ ███
-->


<h3 id='element-notation' caniuse="css-element-function">Using Elements as Images: the ''element()'' notation</h3>

	The ''element()'' function allows an author to use an element in the document as an image.
	As the referenced element changes appearance,
	the image changes as well.
	This can be used, for example,
	to create live previews of the next/previous slide in a slideshow,
	or to reference a canvas element for a fancy generated gradient or even an animated background.

	Note: The ''element()'' function only reproduces the <em>appearance</em> of the referenced element,
	not the actual content and its structure.
	Authors should only use this for decorative purposes,
	and must not use ''element()'' to reproduce an element with significant content across the page.
	Instead, just insert multiple copies of the element into the document.

	The syntax for ''element()'' is:

	<pre class=prod><dfn>element()</dfn> = element( <<id-selector>> )</pre>

	where <<id-selector>> is an ID selector [[!SELECT]].

	<p class='issue'>
		Do we need to be able to refer to elements in external documents
		(such as SVG paint servers)?
		Or is it enough to just use url() for this?

	<p class='issue'>
		This name conflicts with a somewhat similar function in GCPM.
		This needs to be resolved somehow.

	<p class='issue'>
		Want the ability to do "reflections" of an element,
		either as a background-image on the element or in a pseudo-element.
		This needs to be specially-handled to avoid triggering the cycle-detection.

	<p class='issue'>
		When we have overflow:paged,
		how can we address a single page in the view?

	The ''element()'' function references the element matched by its argument.
	The ID is first looked up in the <a idl>elementSources</a> map,
	as described in that section.
	If it's not found,
	it's then matched against the document.
	If multiple elements are matched,
	the function references the first such element.

	The image represented by the ''element()'' function can vary based on whether the element is visible in the document:

	<dl>
		<dt>
			an <a lt="element-not-rendered">element that is rendered</a>,
			is not a descendant of a replaced element,
			and generates a <a spec=css2>stacking context</a>
		<dd>
			The function represents an image with its [=natural size=]
			equal to the <dfn export>decorated bounding box</dfn> of the referenced element:

			<ul>
				<li>
					for an element rendered using a CSS rendering model,
					the <a>decorated bounding box</a> is the smallest axis-aligned rectangle
					that contains the <a href="https://www.w3.org/TR/2011/CR-css3-background-20110215/#border-image-area">border image areas</a> of all the fragments of the principal box

				<li>
					for an element rendered using the SVG rendering model,
					<a href="https://www.w3.org/TR/SVGTiny12/intro.html#TermDecoratedBoundingBox">the decorated bounding box is defined by SVG</a>
			</ul>

			Note: Because images clip anything outside their bounds by default,
			this means that decorations that extend outside the <a>decorated bounding box</a>,
			like box shadows,
			may be clipped.

			The image is constructed by rendering the referenced element and its descendants
			(at the same size that they would be in the document)
			over an infinite ''transparent'' canvas,
			positioned so that the edges of the <a>decorated bounding box</a> are flush with the edges of the image.

			<p class='issue'>
				Requiring some degree of stacking context on the element appears to be required for an efficient implementation.
				Do we need a full stacking context, or just a pseudo-stacking context?
				Should it need to be a stacking context normally,
				or can we just render it as a stacking context when rendering it to element()?

			If the referenced element has a transform applied to it or an ancestor,
			the transform must be ignored when rendering the element as an image.  [[!CSS3-TRANSFORMS]]

			If the referenced element is broken across pages,
			the element is displayed as if the page content areas were joined flush in the pagination direction,
			with pages' edges corresponding to the initial containing block's start edge aligned.
			<span class='note'>Elements broken across lines or columns are just rendered with their <a>decorated bounding box</a>.</span>

			Implementations may either re-use existing bitmap data generated for the referenced element
			or regenerate the display of the element to maximize quality at the image's size
			(for example, if the implementation detects that the referenced element is an SVG fragment);
			in the latter case, the layout of the referenced element in the image must not be changed by the regeneration process.
			That is, the image must look identical to the referenced element,
			modulo rasterization quality.

			<div class='example' id='ex-element-reuse'>

				As a somewhat silly example, a <{p}> element can be reused as a background elsewhere in the document:

				<pre class="lang-html">
					&lt;style>
					#src { color: white; background: lime; width: 300px; height: 40px; position: relative; }
					#dst { color: black; background: element(#src); padding: 20px; margin: 20px 0; }
					&lt;/style>
					&lt;p id='src'>I'm an ordinary element!&lt;/p>
					&lt;p id='dst'>I'm using the previous element as my background!&lt;/p>
				</pre>

				<img src="images/element-function.png" alt="">
			</div>


		<dt>an <a lt='element-not-rendered'>element that is not rendered</a>, but which provides a <a>paint source</a>
		<dd>
			The function represents an image with the [=natural dimensions=] and appearance of the <a>paint source</a>.
			The host language defines the size and appearance of paint sources.

			<div class='example' id='ex-element-not-rendered-ref'>
				For example, the ''element()'' function can reference an SVG <code>&lt;pattern></code> element in an HTML document:

				<pre class=lang-html>
					&lt;!DOCTYPE html>
					&lt;svg>
						&lt;defs>
							&lt;pattern id='pattern1'>
								&lt;path d='...'>
							&lt;/pattern>
						&lt;/defs>
					&lt;/svg>
					&lt;p style="background: element(#pattern1)">
						I'm using the pattern as a background!
						If the pattern is changed or animated,
						my background will be updated too!
					&lt;/p>
				</pre>

				HTML also defines that a handful of elements,
				such as <{canvas}>, <{img}>, and <{video}>,
				provide a paint source.
				This means that CSS can, for example,
				reference a canvas that's being drawn into,
				but not displayed in the page:

				<pre class=lang-html>
					&lt;!DOCTYPE html>
					&lt;script>
						var canvas = document.querySelector('#animated-bullet');
						canvas.width = 20; canvas.height = 20;
						drawAnimation(canvas);
					&lt;/script>
					&lt;canvas id='animated-bullet' style='display:none'>&lt;/canvas>
					&lt;ul style="list-style-image: element(#animated-bullet);">
						&lt;li>I'm using the canvas as a bullet!&lt;/li>
						&lt;li>So am I!&lt;/li>
						&lt;li>As the canvas is changed over time with Javascript,
						    we'll all update our bullet image with it!&lt;/li>
					&lt;/ul>
				</pre>
			</div>


		<dt>anything else
		<dd>

			The function represents an <a>invalid image</a>.

			<div class='example' id='ex-invalid-image'>

				For example, all of the following ''element()'' uses will result in a transparent background:

				<pre class=lang-html>
					&lt;!DOCTYPE html>
					&lt;p id='one' style="display:none; position: relative;">one&lt;/p>
					&lt;iframe src="http://example.com">
						&lt;p id='two' style="position: relative;">I'm fallback content!&lt;/p>
					&lt;/iframe>
					&lt;ul>
						&lt;li style="background: element(#one);">
						  A display:none element isn't rendered, and a P element
						  doesn't provide a paint source.
						&lt;/li>
						&lt;li style="background: element(#two);">
						  The descendants of a replaced element like an IFRAME
						  can't be used in element() either.
						&lt;/li>
						&lt;li style="background: element(#three);">
						  There's no element with an id of "three", so this also
						  gets rendered as a transparent image.
						&lt;/li>
					&lt;/ul>
				</pre>
			</div>

	</dl>

	An element is <dfn export id='element-not-rendered' lt='element-not-rendered'>not rendered</dfn> if it does not have an associated box.
	This can happen, for example,
	if the element or an ancestor is ''display:none''.
	Host languages may define additional ways in which an element can be considered not rendered;
	for example, in SVG,
	any descendant of a <code>&lt;defs></code> element is considered to be not rendered.

	<div class='example' id='ex-element-preview'>

		The ''element()'' function can be put to many uses.
		For example, it can be used to show a preview of the previous or next slide in a slideshow:

		<pre class=lang-html>
			&lt;!DOCTYPE html>
			&lt;script>
			function navigateSlides() {
				var currentSlide = ...;
				document.querySelector('#prev-slide').id = '';
				document.querySelector('#next-slide').id = '';
				currentSlide.previousElementSibling.id = 'prev-slide';
				currentSlide.nextElementSibling.id = 'next-slide';
			}
			&lt;/script>
			&lt;style>
			.slide {
				/* Need to be a stacking context to be element()-able. */
				position: relative;
			}
			#prev-preview, #next-preview {
				position: fixed;
				...
			}
			#prev-preview { background: element(#prev-slide); }
			#next-preview { background: element(#next-slide); }
			&lt;/style>
			&lt;a id='prev-preview'>Previous Slide&lt;/a>
			&lt;a id='next-preview'>Next Slide&lt;/a>
			&lt;section class='slide'>...&lt;/section>
			&lt;section class='slide current-slide'>...&lt;/section>
			...
		</pre>

		In this example, the <code>navigateSlides</code> function updates the ids of the next and previous slides,
		which are then displayed in small floating boxes alongside the slides.
		Since you can't interact with the slides through the ''element()'' function (it's just an image),
		you could even use <code>click</code> handlers on the preview boxes to help navigate through the page.
	</div>

<h4 id='paint-sources'>
Paint Sources</h4>

	Host languages may define that some elements provide a <dfn export>paint source</dfn>.
	Paint sources have an intrinsic appearance and can obtain a <a>concrete object size</a>
	without having to do layout or rendering,
	and so may be used as images even when they're <a lt='element-not-rendered'>not rendered</a>.

	In HTML, the <{img}>, <{video}>, and <{canvas}> elements provide paint sources.

	In SVG, any element that provides a <a href='https://www.w3.org/TR/SVG/pservers.html'>paint server</a> provides a paint source.
	<span class='note'>Note: In SVG1.1,
		the <code>&lt;linearGradient></code>,
		<code>&lt;radialGradient></code>,
		and <code>&lt;pattern></code> elements
		provide paint sources.</span>
	They are drawn as described in the spec,
	with the coordinate systems defined as follows:

	<dl>
		<dt>objectBoundingBox
		<dd>
			The coordinate system has its origin at the top left corner of the rectangle defined by the <a>concrete object size</a> that it's being drawn into,
			and the same width and height as the <a>concrete object size</a>.
			A single <a href="https://www.w3.org/TR/SVG/coords.html#Units">user coordinate</a> is the width and height of the <a>concrete object size</a>.

		<dt>userSpaceOnUse
		<dd>
			The coordinate system has its origin at the top left corner of the rectangle defined by the <a>concrete object size</a> that it's being drawn into,
			and the same width and height as the <a>concrete object size</a>.
			<a href="https://www.w3.org/TR/SVG/coords.html#Units">User coordinates</a> are sized equivalently to the CSS ''px'' unit.
	</dl>

	Note: It is expected that a future version of this module will define ways to refer to paint sources in external documents,
	or ones that are created solely by script and never inserted into a document at all.

<h4 id='elementsources'>
Using Out-Of-Document Sources: the <code>ElementSources</code> interface</h4>

	The ''element()'' function normally selects elements within a document,
	but elements that provide a <a>paint source</a> don't necessarily need to be in-document.
	For example, an HTML <{canvas}> element can be created, maintained, and drawn into entirely in script,
	with no need for it to be inserted into the document directly.

	All that's needed is a way to refer to the element,
	as an ID selector cannot select elements outside of the document.
	The <a idl>elementSources</a> Map object provides this.

	<pre class='idl'>
		partial namespace CSS {
			[SameObject] readonly attribute any elementSources;
		};
	</pre>

	<wpt>
		idlharness.html
	</wpt>

	Any entries in the <a idl>elementSources</a> map with a string key
	and a value that is an object providing a <a>paint source</a>
	are made available to the ''element()'' function.

	Whenever ''element()'' uses an <<id-selector>>,
	the ID's value (without the leading <code>#</code> character)
	is first looked up in the <a idl>elementSources</a> map:

	<ul>
		<li>
			If it's found,
			and the object associated with it provides a <a>paint source</a>,
			the ''element()'' function represents that paint source.

		<li>
			If it's found,
			but the object associated with it <em>doesn't</em> provide a <a>paint source</a>,
			the ''element()'' function represent an <a>invalid image</a>.

		<li>
			If the ID isn't found in the map at all,
			it's then looked for in the document as normal.
	</ul>

	<p class='issue'>
		This reuse of the ID selector matches Moz behavior.
		I'm trying to avoid slapping a <<custom-ident>> right in the beginning of the grammar,
		as that eats too much syntax-space.
		Another possibility, though, is to start the value with a language-defined keyword
		<em>followed by</em> a <<custom-ident>>,
		like ''element(external fancy)'' or something.
		Naming suggestions welcome.

	<div class='example' id='ex-external-canvas'>
		For example, fancy animating backgrounds can be done with an external canvas:

		<pre class=lang-html>
			&lt;script>
			var bg = document.createElement('canvas');
			bg.height = 200;
			bg.width = 1000;
			drawFancyBackground(bg);
			CSS.elementSources.set('fancy', bg);
			&lt;/script>
			&lt;style>
			h1 {
				background-image: element(#fancy);
			}
			&lt;/style>
		</pre>

		As the "fancy" canvas is drawn into and animated,
		the backgrounds of all the H1 elements will automatically update in tandem.

		Note that the <a idl>elementSources</a> map is consulted <em>before</em> the document
		to match the ID selector,
		so even if there's an element in the document that would match ''#fancy'',
		the backgrounds will still predictably come from the <a idl>elementSources</a> value instead.
	</div>

<h4 id='element-cycles'>
Cycle Detection</h4>

	The ''element()'' function can produce nonsensical circular relationships,
	such as an element using itself as its own background.
	These relationships can be easily and reliably detected and resolved, however,
	by keeping track of a dependency graph and using common cycle-detection algorithms.

	The dependency graph consists of edges such that:

	<ul>
		<li>
			every element depends on its children

		<li>
			for any element A with a property using the ''element()'' function pointing to an element B,
			A depends on B

		<li>
			if a host language defines a way for elements to refer to the rendering of other elements,
			the referencing element depends on the referenced element.
			For example, in SVG,
			a <code>&lt;use></code> element depends on the element it referenced.
	</ul>

	If the graph contains a cycle,
	any ''element()'' functions participating in the cycle are <a>invalid images</a>.

<!--
 ██████   ████████     ███    ████████  ████ ████████ ██    ██ ████████  ██████
██    ██  ██     ██   ██ ██   ██     ██  ██  ██       ███   ██    ██    ██    ██
██        ██     ██  ██   ██  ██     ██  ██  ██       ████  ██    ██    ██
██   ████ ████████  ██     ██ ██     ██  ██  ██████   ██ ██ ██    ██     ██████
██    ██  ██   ██   █████████ ██     ██  ██  ██       ██  ████    ██          ██
██    ██  ██    ██  ██     ██ ██     ██  ██  ██       ██   ███    ██    ██    ██
 ██████   ██     ██ ██     ██ ████████  ████ ████████ ██    ██    ██     ██████
-->


<h2 id="gradients">
Gradients</h2>

	A gradient is an image that smoothly fades from one color to another.
	These are commonly used for subtle shading in background images, buttons, and many other things.
	The <dfn export lt="gradient function">gradient functions</dfn> described in this section allow an author to specify such an image in a terse syntax,
	so that the UA can generate the image automatically when rendering the page.
	The syntax of a <<gradient>> is:

	<pre class=prod>
		<dfn>&lt;gradient></dfn> = [
			<<linear-gradient()>> | <<repeating-linear-gradient()>> |
			<<radial-gradient()>> | <<repeating-radial-gradient()>> |
			<<conic-gradient()>>  | <<repeating-conic-gradient()>> ]
	</pre>

	<div class='example' id='ex-gradients-are-images'>

		As with the other <<image>> types defined in this specification,
		gradients can be used in any property that accepts images.
		For example:

		<ul class=lang-css>
			<li><code>background: linear-gradient(white, gray);</code>
			<li><code>list-style-image: radial-gradient(circle, #006, #00a 90%, #0000af 100%, white 100%)</code>
		</ul>
	</div>

	A gradient is drawn into a box with the dimensions of the <a>concrete object size</a>,
	referred to as the <dfn export>gradient box</dfn>.
	However, the gradient itself has no [=natural dimensions=].

	<wpt>
		gradients-with-border.html
	</wpt>

	<div class='example' id='ex-default-gradient-box'>
		For example, if you use a gradient as a background,
		by default the gradient will draw into a <a>gradient box</a> the size of the element's padding box.
		If 'background-size' is explicitly set to a value such as ''100px 200px'',
		then the <a>gradient box</a> will be 100px wide and 200px tall.
		Similarly, for a gradient used as a 'list-style-image',
		the box would be a 1em square,
		which is the <a>default object size</a> for that property.
	</div>

	Gradients are specified by defining the <dfn>starting point</dfn> and <dfn>ending point</dfn>
	of a <dfn export>gradient line</dfn>
	(which, depending on the type of gradient,
	may be technically a line, or a ray, or a spiral),
	and then specifying colors at points along this line.
	The colors are smoothly blended to fill in the rest of the line,
	and then each type of gradient defines how to use the color of the <a>gradient line</a> to produce the actual gradient.

<!--
██       ████ ██    ██ ████████    ███    ████████
██        ██  ███   ██ ██         ██ ██   ██     ██
██        ██  ████  ██ ██        ██   ██  ██     ██
██        ██  ██ ██ ██ ██████   ██     ██ ████████
██        ██  ██  ████ ██       █████████ ██   ██
██        ██  ██   ███ ██       ██     ██ ██    ██
████████ ████ ██    ██ ████████ ██     ██ ██     ██
-->


Linear Gradients: the ''linear-gradient()'' notation {#linear-gradients}
------------------------------------------------------------------------

	This level adds a <<color-interpolation-method>> argument
	to ''linear-gradient()'' and ''repeating-linear-gradient()'',
	indicating the color space and path to use
	when interpolating colors on the gradient line.
	See [[css-color-4#interpolation]].

	<pre class=prod>
		<dfn>&lt;linear-gradient-syntax></dfn> =
			[ [ <<angle>> | <<zero>> | to <<side-or-corner>> ] || <<color-interpolation-method>> ]? ,
			<<color-stop-list>>
		<dfn>&lt;side-or-corner></dfn> = [left | right] || [top | bottom]
	</pre>

	<wpt>
		color-stop-currentcolor.html
		gradient-border-box.html
		gradient-button.html
		gradient-content-box.html
		linear-gradient-1.html
		linear-gradient-2.html
		linear-gradient-body-sibling-index.html
		linear-gradient-calc-em-units.html
		linear-gradient-non-square.html
		linear-gradient-sibling-index.html
		multiple-position-color-stop-linear-2.html
		multiple-position-color-stop-linear.html
		normalization-linear-2.html
		normalization-linear-degenerate.html
		normalization-linear.html
		tiled-gradients.html
		gradient/color-stops-parsing.html
		gradient/display-p3-linear-gradient.html
		gradient/linear-gradient-relative-currentcolor-stop.html
		gradient/gradient-single-stop-001.html
		gradient/gradient-single-stop-002.html
		gradient/gradient-single-stop-003.html
		gradient/gradient-single-stop-004.html
		gradient/gradient-single-stop-005.html
		gradient/gradient-single-stop-006.html
		gradient/gradient-single-stop-007.html
		gradient/gradient-single-stop-008.html
		gradient/gradient-single-stop-longer-hue-hsl-002.html
		gradient/gradient-single-stop-longer-hue-hsl.html
		gradient/gradient-single-stop-longer-hue-oklch.html
		gradient/gradient-single-stop-none-interpolation.html
		parsing/gradient-interpolation-method-computed.html
		parsing/gradient-interpolation-method-invalid.html
		parsing/gradient-interpolation-method-valid.html
		parsing/gradient-position-invalid.html
		parsing/gradient-position-valid.html
		parsing/gradient-position-computed.html
	</wpt>

### Effects of color space on interpolation: examples ### {#color-interpolation}

	<p><em>This section is non-normative.</em>

The effect of colorspace on interpolation can be significant.

<div class="example" id='ex-colorspaces-srgb-lab-oklab'>
	In this example, a linear gradient between the same pair of colors
	#f01 and #081 is drawn in three different colorspaces.
	The middle gradient uses gamma-encoded sRGB,
	which was the only choice in CSS Images 3;
	the result is clearly too dark at the midpoint.
	The upper gradient uses CIE Lab,
	giving a more perceptually uniform result;
	while the lower gradient uses Oklab,
	which here gives almost the same result as CIE Lab.

	<ul class="lang-css">
		<li><code>linear-gradient(in lab to right, #F01, #081)</code></li>
		<li><code>linear-gradient(in srgb to right, #F01, #081)</code></li>
		<li><code>linear-gradient(in Oklab to right, #F01, #081)</code></li>
	</ul>

	<!-- source: images/rectangular-f01-081.html -->
	<img src="images/rectangular-f01-081.png"
		width="360" height="330"
		alt="red to green gradient in three colorspaces" >
</div>

<div class="example" id='ex-colorspaces-blue-white'>
	In this example, a linear gradient between the same pair of colors
	white and #01E is drawn in three different colorspaces.
	The middle gradient uses gamma-encoded sRGB,
	the result is again too dark at the midpoint,
	is a little desaturated, and has a slight purplish cast.
	The upper gradient uses CIE Lab,
	which avoids the too-dark midpoint
	but has a significant purple cast;
	while the lower gradient uses Oklab,
	giving a more perceptually uniform result
	with no purple cast at all.

	<ul class="lang-css">
		<li><code>linear-gradient(in lab to right, white, #01E)</code></li>
		<li><code>linear-gradient(in srgb to right, white, #01E)</code></li>
		<li><code>linear-gradient(in Oklab to right, white, #01E)</code></li>
	</ul>

	<!-- source: images/rectangular-fff-01e.html-->
	<img src="images/rectangular-fff-01e.png"
		width="360" height="330"
		alt="white to blue gradient in three colorspaces" >
</div>

<div class="example" id='ex-hue-nonlinearity'>
	In this example, a linear gradient between the same pair of colors
	#44C and #795 is drawn in three different colorspaces.
	This demonstrates that
	the hue non-linearity of CIE Lab
	affects all bulueish colors,
	not just the gradient from saturated primary blue to white.
	The middle gradient uses gamma-encoded sRGB,
	the result is again too dark at the midpoint,
	and has a slight purplish cast.
	The upper gradient uses CIE Lab,
	which avoids the too-dark midpoint
	but has a significant purple cast;
	while the lower gradient uses Oklab,
	again giving a more perceptually uniform result
	with no purple cast at all.

	<ul class="lang-css">
		<li><code>linear-gradient(in lab to right, #44C, #795)</code></li>
		<li><code>linear-gradient(in srgb to right, #44C, #795)</code></li>
		<li><code>linear-gradient(in Oklab to right, #44C, #795)</code></li>
	</ul>

	<!-- source: images/rectangular-44c-795.html -->
	<img src="images/rectangular-44c-795.png"
		width="360" height="330"
		alt="blue to green gradient in three colorspaces" >
</div>

Choosing a polar, rather than rectangular, colorspace
for gradient interpolation
avoids desaturation
if the hues of the color stops are far apart.
Interpolating in a polar colorspaces
is inherently chroma-preserving,
although it is easy for the intermediate colors to fall out of gamut;
they will then be gamut mapped
to bring them back into gamut.

<div class="example" id='ex-colorspaces-rectangular-polar'>
	In this example, a linear gradient between the same pair of colors
	#A37 and #595 is drawn in five different colorspaces,
	two of them polar.
	From top to bottom:
	CIE LCH, CIE Lab, sRGB, Oklab, Oklch.

	The rectangular spaces have a greyish midpoint,
	while the intermediate colors in the polar spaces
	follow a curved, chroma-preserving path.

	<ul class="lang-css">
		<li><code>linear-gradient(in lch to right, #A37, #595)</code></li>
		<li><code>linear-gradient(in lab to right, #A37, #595)</code></li>
		<li><code>linear-gradient(in srgb to right, #A37, #595)</code></li>
		<li><code>linear-gradient(in Oklab to right, #A37, #595)</code></li>
		<li><code>linear-gradient(in oklch to right, #A37, #595)</code></li>
	</ul>

	<!-- source: images/polar-a37-595.html -->
	<img src="images/polar-a37-595.png"
		width="360" height="538"
		alt="blue to green gradient in three colorspaces" >
</div>

<!--
████████     ███    ████████  ████    ███    ██
██     ██   ██ ██   ██     ██  ██    ██ ██   ██
██     ██  ██   ██  ██     ██  ██   ██   ██  ██
████████  ██     ██ ██     ██  ██  ██     ██ ██
██   ██   █████████ ██     ██  ██  █████████ ██
██    ██  ██     ██ ██     ██  ██  ██     ██ ██
██     ██ ██     ██ ████████  ████ ██     ██ ████████
-->


Radial Gradients: the ''radial-gradient()'' notation {#radial-gradients}
------------------------------------------------------------------------


<h4 id="radial-color-interpolation">
Adding <<color-interpolation-method>></h4>

	This level adds a <<color-interpolation-method>> argument
	to ''radial-gradient()'' and ''repeating-radial-gradient()'',
	indicating the color space and path to use
	when interpolating colors on the gradient line.
	See [[css-color-4#interpolation]].

	<pre class=prod>
		<dfn>&lt;radial-gradient-syntax></dfn> =
			[ [ [ <<radial-shape>> || <<radial-size>> ]? [ at <<position>> ]? ] || <<color-interpolation-method>>]? ,
			<<color-stop-list>>
	</pre>

	<wpt>
		empty-radial-gradient-crash.html
		infinite-radial-gradient-refcrash.html
		multiple-position-color-stop-radial-2.html
		multiple-position-color-stop-radial.html
		normalization-radial-2.html
		normalization-radial-3.html
		normalization-radial-4.html
		normalization-radial-degenerate.html
		normalization-radial.html
		radial-gradient-container-relative-units-001.html
		radial-gradient-container-relative-units-002.html
		radial-gradient-container-relative-units-003.html
		radial-gradient-container-relative-units-004.html
		radial-gradient-transition-hint-crash.html
		tiled-radial-gradients.html
		gradient/color-stops-parsing.html
		parsing/gradient-interpolation-method-computed.html
		parsing/gradient-interpolation-method-invalid.html
		parsing/gradient-interpolation-method-valid.html
		parsing/gradient-position-invalid.html
		parsing/gradient-position-valid.html
	</wpt>

<div class="example" id='ex-colorspaces-differ'>
	In this example, a radial gradient between the same pair of colors
	color(display-p3 0.918 0.2 0.161) and #081 is drawn in three different colorspaces.
	Notice that the color stops do not all need to be in the same colorspace.
	The middle gradient uses gamma-encoded sRGB,
	the result is clearly too dark at the midpoint.
	The upper gradient uses CIE Lab,
	giving a more perceptually uniform result;
	while the lower gradient uses Oklab,
	which here gives almost the same result as CIE Lab.

	<ul class="lang-css">
		<li><code>radial-gradient(in lab farthest-side at left bottom, color(display-p3 0.918 0.2 0.161), #081)</code></li>
		<li><code>radial-gradient(in srgb farthest-side at left bottom, color(display-p3 0.918 0.2 0.161), #081)</code></li>
		<li><code>radial-gradient(in Oklab farthest-side at left bottom, color(display-p3 0.918 0.2 0.161), #081)</code></li>
	</ul>

	<!-- source: images/radial-rectangular-f01-081.html -->
	<img src="images/radial-rectangular-f01-081.png"
		width="360" height="330"
		alt="red to green gradient in three colorspaces" >
</div>

<h4 id="radial-size">
Expanding <<radial-size>></h4>

	This level extends the <<radial-size>> options
	to include the additions from the ''circle()'' and ''ellipse()'' <<basic-shape>> values:

	<pre class=prod>
		<<radial-size>> = <<radial-extent>>{1,2} | <<length-percentage [0,∞]>>{1,2}
	</pre>

	Two-component values remain invalid when specifying
	''radial-gradient()/circle'' as the <<radial-shape>>,
	and otherwise indicate the horizontal (first) and vertical (second) radii
	of the ellipse.

	For ''radial-gradient()/circle'',
	a <<percentage>> value is resolved against
	the “scaled diagonal” of the [=gradient box=]'s width and height:
	<code>sqrt(width² + height²)/sqrt(2)</code>.

<!--
 ██████   ███████  ██    ██ ████  ██████
██    ██ ██     ██ ███   ██  ██  ██    ██
██       ██     ██ ████  ██  ██  ██
██       ██     ██ ██ ██ ██  ██  ██
██       ██     ██ ██  ████  ██  ██
██    ██ ██     ██ ██   ███  ██  ██    ██
 ██████   ███████  ██    ██ ████  ██████
-->

<h3 id='conic-gradients'>
Conic Gradients: the ''conic-gradient()'' notation</h3>



	A conic gradient starts by specifying the center of a circle,
	similar to radial gradients,
	except that conic gradient color-stops are placed <em>around</em> the circumference of the circle,
	rather than on a line emerging from the center,
	causing the color to smoothly transition as you spin around the center,
	rather than as you progress outward from the center.

	A conic gradient is specified by indicating a rotation angle, the center of the gradient,
	and then specifying a list of color-stops.
	Unlike linear and radial gradients,
	whose color-stops are placed by specifying a <<length>>,
	the color-stops of a conic gradient are specified with an <<angle>>.
	Rays are then drawn emerging from the center and pointing in all directions,
	with the color of each ray equal to the color of the gradient-line where they intersect it.

	Note: These gradients are called "conic" or "conical"
	because, if the color stops are chosen to be significantly lighter on one side than the other,
	it produces a pattern that looks like a cone observed from above.
	They are also known as "angle" gradients in some contexts,
	since they are produced by varying the rotation angle of a ray.

	<div class='example' id='ex-simple-conic'>
		<div style="overflow: hidden">
			<img style="float: right; margin-left: 1em;" src='images/conic-diagram.png' alt="[An image showing a box with a background shading gradually clockwise from white to black, starting from the top. A gradient circle is shown, and the colors at 0 and 216 degrees respectively.]">

			This example visually illustrates how ''conic-gradient(at 25% 30%, white, black 60%)'' would be drawn. Note that since color stop positions always resolve to angles, the only effect of the ''at 25% 30%'' is a 2D translation of the gradient, i.e. it does not affect how the gradient is drawn.
		</div>
	</div>

<h4 id='conic-gradient-syntax' class='no-toc'>
''conic-gradient()'' Syntax</h4>

	The syntax for a conic gradient is:

	<pre class='prod'>
		<dfn>conic-gradient()</dfn> = conic-gradient( [ <<conic-gradient-syntax>> ] )
		<dfn>&lt;conic-gradient-syntax></dfn> =
			[ [ [ from [ <<angle>> | <<zero>> ] ]? [ at <<position>> ]? ] || <<color-interpolation-method>> ]? ,
			<<angular-color-stop-list>>
	</pre>

	The arguments are defined as follows:

	<dl dfn-type=value dfn-for="conic-gradient(), repeating-conic-gradient()">
		<dt><dfn><<angle>> | <<zero>></dfn>
		<dd>
			The entire gradient is rotated by this angle.
			If omitted, defaults to ''0deg''.
			The unit identifier may be omitted if the <<angle>> is zero.

		<dt><dfn><<position>></dfn>
		<dd>
			Determines the <dfn dfn export>gradient center</dfn> of the gradient.
			The <<position>> value type (which is also used for 'background-position')
			is defined in [[CSS-VALUES-3]],
			and is resolved using the center-point as the object area
			and the <a>gradient box</a> as the positioning area.
			If this argument is omitted, it defaults to ''background-position/center''.
	</dl>

	<p class='issue'>
		Usually in conic gradients the sharp transition at 0deg is undesirable, which is typically avoided by making sure the first and last color stops are the same color. Perhaps it would be useful to have a keyword for automatically achieving this.

	<p class='issue'>
		Would a radius (inner & outer) for clipping the gradient be useful? If so, we could also support lengths in color stop positions, since we now have a specific radius.

	<p class='issue'>
		Are elliptical conic gradients useful? Do graphics libraries support them?</p>

	<wpt>
		gradient/conic-gradient-001.html
		conic-gradient-angle-negative.html
		conic-gradient-angle.html
		conic-gradient-center.html
		repeating-conic-gradient.html
		tiled-conic-gradients.html
		multiple-position-color-stop-conic-2.html
		multiple-position-color-stop-conic.html
		normalization-conic-2.html
		normalization-conic-degenerate.html
		normalization-conic.html
		out-of-range-color-stop-conic.html
		tiled-conic-gradients.html
		gradient/color-stops-parsing.html
		parsing/gradient-interpolation-method-computed.html
		parsing/gradient-interpolation-method-invalid.html
		parsing/gradient-interpolation-method-valid.html
		parsing/gradient-position-invalid.html
		parsing/gradient-position-valid.html
	</wpt>

<h4 id='conic-color-stops' class='no-toc'>
Placing Color Stops</h4>

	Color stops are placed on a <a>gradient line</a> that curves around the <a>gradient center</a> in a circle,
	with both the 0% and 100% locations at 0deg.
	Just like linear gradients,
	0deg points to the top of the page,
	and increasing angles correspond to clockwise movement around the circle.

	Note: It may be more helpful to think of the gradient line as forming a spiral,
	where only the segment from 0deg to 360deg is rendered.
	This avoids any confusion about "overlap" when you have angles outside of the rendered region.

	A color-stop can be placed at a location before 0% or after 100%;
	though these regions are never directly consulted for rendering,
	color stops placed there can affect the color of color-stops within the rendered region
	through interpolation or repetition (see <a href="#repeating-gradients">repeating gradients</a>).
	For example, ''conic-gradient(red -50%, yellow 150%)'' produces a conic gradient
	that starts with a reddish-orange color at 0deg (specifically, #f50),
	and transitions to an orangish-yellow color at 360deg (specifically, #fa0).

	The color of the gradient at any point is determined by first finding the unique ray
	anchored at the center of the gradient that passes through the given point.
	The point's color is then the color of the <a>gradient line</a> at the location where this ray intersects it.

<h4 id='conic-gradient-examples' class='no-toc'>
Conic Gradient Examples</h4>

	All of the following ''conic-gradient()'' examples are presumed to be applied to a box that is 300px wide and 200px tall, unless otherwise specified.

	<div class='example' id='ex-conic-syntax'>
		Below are various ways of specifying the same basic conic gradient:

		<pre class=lang-css>
			background: conic-gradient(#f06, gold);
			background: conic-gradient(at 50% 50%, #f06, gold);
			background: conic-gradient(from 0deg, #f06, gold);
			background: conic-gradient(from 0deg at center, #f06, gold);
			background: conic-gradient(#f06 0%, gold 100%);
			background: conic-gradient(#f06 0deg, gold 1turn);
		</pre>

		<img src="images/conic1.png" alt="" >
	</div>

	<div class='example' id='ex-conic-angles'>
		Below are various ways of specifying the same basic conic gradient.
		This demonstrates how even though color stops with angles outside [0deg, 360deg) are not directly painted,
		they can still affect the color of the painted part of the gradient.

		<pre class=lang-css>
			background: conic-gradient(white -50%, black 150%);
			background: conic-gradient(white -180deg, black 540deg);
			background: conic-gradient(hsl(0,0%,75%), hsl(0,0%,25%));
		</pre>

		<img src="images/conic2.png" alt="" >
	</div>

	<div class='example' id='ex-conic-rotated'>
		Below are two different ways of specifying the same rotated conic gradient, one with a rotation angle and one without:

		<pre class=lang-css>
			background: conic-gradient(from 45deg, white, black, white);
			background: conic-gradient(hsl(0,0%,75%), white 45deg, black 225deg, hsl(0,0%,75%));
		</pre>

		<img src="images/conic3.png" alt="" >

		Note that offsetting every color stop by the rotation angle instead would not work and produces an entirely different gradient:

		<pre>
			background: conic-gradient(white 45deg, black 225deg, white 405deg);
		</pre>

		<img src="images/conic4.png" alt="" >
	</div>

	<div class='example' id='ex-hsl-wheel'>
		A conic gradient with a radial gradient overlaid on it, to draw a hue & saturation wheel:

		<pre class=lang-css>
			background: radial-gradient(closest-side, gray, transparent),
			            conic-gradient(red, magenta, blue, aqua, lime, yellow, red);
			border-radius: 50%;
			width: 200px; height: 200px;
		</pre>

		You can also achieve the same effect using "longer" hue interpolation. This is more concise and makes it easy to switch to other color spaces.

		<pre class=lang-css>
			background: radial-gradient(closest-side, gray, transparent),
			            conic-gradient(in hsl longer hue, red 0 100%);
			transform: scaleX(-1);
			border-radius: 50%;
			width: 200px; height: 200px;
		</pre>

		<img src="images/conic5.png" alt="color wheel">
	</div>

	<div class='example' id='ex-conic-pie'>
		A conic gradient used to draw a simple pie chart.
		The ''0deg'' color stop positions will be fixed up to be equal to the position of the color stop before them.
		This will produce infinitesimal (invisible) transitions between the color stops with different colors,
		effectively producing solid color segments.

		<pre class=lang-css>
			background: conic-gradient(yellowgreen 40%, gold 0deg 75%, #f06 0deg);
			border-radius: 50%;
			width: 200px; height: 200px;
		</pre>

		<img src="images/conic6.png" alt="" >
	</div>

<!--
████████  ████████ ████████  ████████    ███    ████████
██     ██ ██       ██     ██ ██         ██ ██      ██
██     ██ ██       ██     ██ ██        ██   ██     ██
████████  ██████   ████████  ██████   ██     ██    ██
██   ██   ██       ██        ██       █████████    ██
██    ██  ██       ██        ██       ██     ██    ██
██     ██ ████████ ██        ████████ ██     ██    ██
-->

<h3 id='repeating-gradients'>
Repeating Gradients: the ''repeating-linear-gradient()'', ''repeating-radial-gradient()'', and ''repeating-conic-gradient()'' notations</h3>

	In addition to ''linear-gradient()'', ''radial-gradient()'', and ''conic-gradient()'',
	this specification defines <dfn>repeating-linear-gradient()</dfn>,
	<dfn>repeating-radial-gradient()</dfn>,
	and <dfn>repeating-conic-gradient()</dfn> values.
	These notations take the same values
	and are interpreted the same
	as their respective non-repeating siblings defined previously.

	<pre class=prod>
		<<repeating-conic-gradient()>> = repeating-conic-gradient( [ <<conic-gradient-syntax>> ] )
		<<repeating-linear-gradient()>> = repeating-linear-gradient( [ <<linear-gradient-syntax>> ] )
		<<repeating-radial-gradient()>> = repeating-radial-gradient( [ <<radial-gradient-syntax>> ] )
	</pre>

	<wpt>
		gradient-content-box.html
		gradient/color-stops-parsing.html
		gradient/repeating-gradient-hsl-and-oklch.html
	</wpt>

	<div class='example' id='ex-conic-repeat'>
		Basic repeating conic gradient:

		<pre>background: repeating-conic-gradient(gold, #f06 20deg);</pre>

		<img src="images/repeating-conic1.png" alt="">
	</div>

	<div class='example' id='ex-gradient-starburst'>
		Repeating color stops with abrupt transitions creates a starburst-type background:

		<pre class=lang-css>
			background: repeating-conic-gradient(
			                hsla(0,0%,100%,.2) 0deg 15deg,
			                hsla(0,0%,100%,0) 0deg 30deg
			            ) #0ac;
		</pre>

		<img src="images/repeating-conic2.png" alt="">
	</div>

	<div class='example' id='ex-checkerboards'>
		Here repeating color stops with abrupt transitions are used to create a checkerboard:

		<pre class=lang-css>
			background: repeating-conic-gradient(black 0deg 25%, white 0deg 50%);
			background-size: 60px 60px;
		</pre>

		<img src="images/repeating-conic3.png" alt="">

		The same checkerboard can be created via non-repeating conic gradients:

		<pre class=lang-css>
			background: conic-gradient(black 25%, white 0deg 50%, black 0deg 75%, white 0deg);
			background-size: 60px 60px;
		</pre>
	</div>



<!--
 ██████  ████████  ███████  ████████   ██████
██    ██    ██    ██     ██ ██     ██ ██    ██
██          ██    ██     ██ ██     ██ ██
 ██████     ██    ██     ██ ████████   ██████
      ██    ██    ██     ██ ██              ██
██    ██    ██    ██     ██ ██        ██    ██
 ██████     ██     ███████  ██         ██████
-->


Defining Gradient Color {#gradient-colors}
------------------------------------------

	The colors in gradients are specified using <dfn export lt="color stop">color stops</dfn>
	(a <<color>> and a corresponding position on the [=gradient line=])
	and <dfn export lt="color transition hint" local-lt="transition hint">color transition hints</dfn>
	(a position between two [=color stops=]
	representing the halfway point in the color transition)
	which are placed on the <a>gradient line</a>,
	defining the color at every point of the line.
	(Each [=gradient function=] defines the shape and length of the <a>gradient line</a>,
	along with its <a>starting point</a> and <a>ending point</a>;
	see above.)

	Colors throughout the gradient field are then determined
	by tying them to specific points along the [=gradient line=]
	as specified by the gradient function.
	UAs may “dither” gradient colors slightly
	(randomly alternate individual pixels with nearby colors on the gradient line)
	to effect a smoother gradient.

<h4 id=color-stop-syntax>
Color Stop Lists</h4>


	<a>Color stops</a> and [=transition hints=] are specified
	in a <dfn export>color stop list</dfn>,
	which is a list of one or more [=color stops=]
	interleaved with optional [=transition hints=]:

	<pre class=prod>
		<dfn>&lt;color-stop-list></dfn> =
			<<linear-color-stop>> , [ <<linear-color-hint>>? , <<linear-color-stop>> ]#?
		<dfn>&lt;linear-color-stop></dfn> = <<color>> <<color-stop-length>>?
		<dfn>&lt;linear-color-hint></dfn> = <<length-percentage>>
		<dfn>&lt;color-stop-length></dfn> = <<length-percentage>>{1,2}

		<dfn>&lt;angular-color-stop-list></dfn> =
			<<angular-color-stop>> , [ <<angular-color-hint>>? , <<angular-color-stop>> ]#?
		<dfn>&lt;angular-color-stop></dfn> = <<color>> <<color-stop-angle>>?
		<dfn>&lt;angular-color-hint></dfn> = <<angle-percentage>> | <<zero>>
		<dfn>&lt;color-stop-angle></dfn> = [ <<angle-percentage>> | <<zero>> ]{1,2}

		<dfn>&lt;color-stop></dfn> = <<color-stop-length>> | <<color-stop-angle>>
	</pre>

	<wpt>
		gradient/color-stops-parsing.html
		gradient/gradient-single-stop-001.html
		gradient/gradient-single-stop-002.html
		gradient/gradient-single-stop-003.html
		gradient/gradient-single-stop-004.html
		gradient/gradient-single-stop-005.html
		gradient/gradient-single-stop-006.html
		gradient/gradient-single-stop-007.html
		gradient/gradient-single-stop-008.html
		gradient/gradient-single-stop-longer-hue-hsl-002.html
		gradient/gradient-single-stop-longer-hue-hsl.html
		gradient/gradient-single-stop-longer-hue-oklch.html
		gradient/gradient-single-stop-none-interpolation.html
	</wpt>

	<div class=note>
		Note that <<color-stop-list>> and <<angular-color-stop-list>> are exactly identical in structure,
		they just differ on whether they accept <<length>>s or <<angle>>s
		for specifying the position of the stops and hints.

		Visualized with a railroad diagram,
		both of them follow this pattern:

		<pre class='railroad'>
			N: <color-stop>
			T: ,
			Plus:
				Sequence:
					Optional: skip
						Sequence:
							N: <color-hint>
							T: ,
					N: <color-stop>
				T: ,
		</pre>
	</div>

	A <a>color stop</a> with two positions is equivalent
	to specifying two <a>color stops</a> with the same color,
	one for each position.

	Note: Usually, this results in a solid-color "stripe"
	between the two positions,
	but using a ''longer'' <<color-interpolation-method>>
	will instead create a "rainbow" between the two positions.

	Percentages are resolved against the length of the <a>gradient line</a>
	between the <a>starting point</a> and <a>ending point</a>,
	with 0% being at the starting point
	and 100% being at the ending point.
	Lengths are measured along the <a>gradient line</a>
	from the <a>starting point</a>
	in the direction of the <a>ending point</a>.

	[=Color stop=] and [=transition hint=] positions
	are usually placed between
	the <a>starting point</a> and <a>ending point</a>,
	but that's not required:
	the gradient line extends infinitely in both directions,
	and positions can be specified anywhere
	on the <a>gradient line</a>.

	When the position of a [=color stop=] is omitted,
	it is automatically assigned a position.
	The first or last [=color stop=] in the [=color stop list=]
	is assigned
	the [=gradient line’s=] [=starting point=] or [=ending point=]
	(respectively).
	Otherwise,
	it's assigned the position halfway between the two surrounding stops.
	If multiple stops in a row lack a position,
	they space themselves out equally
	between the surrounding positioned stops.
	See [[#color-stop-fixup]] for details.


<h4 id=coloring-gradient-line>
Coloring the Gradient Line</h4>

	At each <a>color stop</a> position,
	the [=gradient line=] is the color of the <a>color stop</a>.
	Before the first <a>color stop</a>,
	the [=gradient line=] is the color of the first <a>color stop</a>,
	and after the last <a>color stop</a>,
	the [=gradient line=] is the color of the last <a>color stop</a>.
	Between each pair of <a>color stops</a>,
	the [=gradient line’s=] color is interpolated between the colors of the two <a>color stops</a>,
	with the interpolation taking place in the specified color space,
	with missing components handled as defined in [[css-color-4#interpolation-missing]],
	hue interpolation as defined in [[css-color-4#hue-interpolation]], and
	using premultiplied alpha, as defined in [[css-color-4#interpolation-alpha]].
	If no <<color-interpolation-method>> is specified in the gradient function,
	the color space used for gradient interpolation
	is the default interpolation color space, Oklab, as defined in [[css-color-4]].

	Note: The <<color-interpolation-method>>
	only affects the colors <em>between</em> stops.
	The color before the first and after the last stop
	is equal to the first/last stop,
	<em>regardless</em> of the interpolation method.

	<wpt>
		gradients-with-transparent.html
		gradient/gradient-analogous-missing-components-001.html
		gradient/gradient-analogous-missing-components-002.html
		gradient/gradient-analogous-missing-components-003.html
		gradient/gradient-analogous-missing-components-004.html
		gradient/css-color-4-colors-default-to-oklab-gradient.html
		gradient/gradient-decreasing-hue-hsl.html
		gradient/gradient-decreasing-hue-lch.html
		gradient/gradient-eval-predefined-color-spaces.html
		gradient/gradient-eval-001.html
		gradient/gradient-eval-002.html
		gradient/gradient-eval-003.html
		gradient/gradient-eval-004.html
		gradient/gradient-eval-005.html
		gradient/gradient-eval-006.html
		gradient/gradient-eval-007.html
		gradient/gradient-eval-008.html
		gradient/gradient-eval-009.html
		gradient/gradient-eval-010.html
		gradient/gradient-none-interpolation.html
		gradient/gradient-to-transparent.html
		gradient/legacy-color-gradient.html
		gradient/oklab-gradient.html
		gradient/srgb-gradient.html
		gradient/srgb-linear-gradient.html
		gradient/xyz-gradient.html
		gradient/color-scheme-dependent-color-stops.html
		gradient/gradient-hue-direction.html
		gradient/gradient-increasing-hue-hsl.html
		gradient/gradient-increasing-hue-lch.html
		gradient/gradient-infinity-001.html
		gradient/gradient-infinity-002.html
		gradient/gradient-infinity-003.html
		gradient/gradient-longer-hue-hsl-001.html
		gradient/gradient-longer-hue-hsl-002.html
		gradient/gradient-longer-hue-hsl-003.html
		gradient/gradient-longer-hue-hsl-004.html
		gradient/gradient-longer-hue-hsl-005.html
		gradient/gradient-longer-hue-hsl-006.html
		gradient/gradient-longer-hue-hsl-007.html
		gradient/gradient-longer-hue-hsl-008.html
		gradient/gradient-longer-hue-hsl-009.html
		gradient/gradient-longer-hue-hsl-010.html
		gradient/gradient-longer-hue-hsl-011.html
		gradient/gradient-longer-hue-hsl-012.html
		gradient/gradient-longer-hue-hsl-013.html
		gradient/gradient-longer-hue-lch-001.html
		gradient/gradient-longer-hue-lch-002.html
		gradient/gradient-longer-hue-lch-003.html
		gradient/gradient-longer-hue-lch-004.html
		gradient/gradient-longer-hue-lch-005.html
		gradient/gradient-longer-hue-lch-006.html
		gradient/gradient-longer-hue-lch-007.html
		gradient/gradient-longer-hue-lch-008.html
		gradient/gradient-longer-hue-lch-009.html
		gradient/gradient-longer-hue-lch-010.html
		gradient/gradient-longer-hue-lch-011.html
		gradient/gradient-longer-hue-lch-012.html
		gradient/gradient-powerless-hue-hsl.html
		gradient/gradient-powerless-hue-hwb.html
		gradient/gradient-powerless-hue-lch.html
		gradient/gradient-powerless-hue-oklch.html
	</wpt>

	<div class="example" id='ex-missing-hue'>
		For example, given the following gradient definition:

		<pre class="lang-css">
			linear-gradient(in oklch, red, #888, green)
		</pre>

		the conversion of the neutral #888 to oklch
		gives a missing hue component:
		<span class="lang-css">oklch(0.6268 0 none)</span>

		and thus, in the first gradient segment,
		the hue is taken from red,
		which is <span class="lang-css">oklch(0.628 0.2577 29.234)</span>;
		while in the second segment
		it is taken from green,
		which is <span class="lang-css">oklch(0.5198 0.1769 142.5)</span>
	</div>

	By default,
	this interpolation is linear--
	at 25%, 50%, or 75% of the distance between two <a>color stops</a>,
	the color is a 25%, 50%, or 75% blend of the colors of the two stops.

	However, if a [=transition hint=] was provided between two <a>color stops</a>,
	the interpolation is non-linear,
	and controlled by the hint:

	<div algorithm="interpolate with a color hint">
		<ol>
			<li>
				Determine the location of the [=transition hint=] as a percentage of the distance between the two <a>color stops</a>,
				denoted as a number between 0 and 1,
				where 0 indicates the hint is placed right on the first <a>color stop</a>,
				and 1 indicates the hint is placed right on the second <a>color stop</a>.
				Let this percentage be <var>H</var>.

			<li>
				For any given point between the two color stops,
				determine the point's location as a percentage of the distance between the two <a>color stops</a>,
				in the same way as the previous step.
				Let this percentage be <var>P</var>.

			<li>
				Let <var>C</var>, the color weighting at that point,
				be equal to <code><var>P</var><sup>log<sub><var>H</var></sub>(.5)</sup></code>.

			<li>
				The color at that point is then a linear blend between the colors of the two <a>color stops</a>,
				blending <code>(1 - <var>C</var>)</code> of the first stop and <var>C</var> of the second stop.
		</ol>
	</div>

	Note: The [=transition hint=] specifies where the “halfway color”--
	the 50% blend between the colors of the two surrounding color stops--
	should be placed.
	When the hint is exactly halfway between the two surrounding color stops,
	the above interpolation algorithm
	happens to produce the ordinary linear interpolation.
	If the hint is placed anywhere else,
	it produces a smooth exponential curve
	between the surrounding color stops,
	with the “halfway color” occurring exactly where the hint specifies.

	<div class='example' id='ex-transition-hints'>
		Here an example of a linear gradient without [=transition hint=] (top) compared to one with a transition hint between the red and blue [=color stops=] (bottom).

		<img src="images/gradient-colors-transition-hint-comparison.png" alt="">

		Top - Without transition hint (falling back to the default halfway transition hint):

		<pre class=lang-css>
			background: linear-gradient(to right, red 0%, blue 100%);
		</pre>

		Bottom - With transition hint:

		<pre class=lang-css>
			background: linear-gradient(to right, red 0%, 25%, blue 100%);
		</pre>
	</div>

	If multiple <a>color stops</a> have the same position,
	they produce an infinitesimal transition from the one specified first in the list
	to the one specified last.
	In effect, the color suddenly changes at that position rather than smoothly transitioning.

<h4 id=color-stop-fixup>
Color Stop “Fixup”</h4>

	When resolving the [=used value|used=] positions of each [=color stop=],
	the following steps must be applied <em>in order</em>:

	<ol>
		<li>
			If the first <a>color stop</a> does not have a position,
			set its position to 0%.

		<li>
			If the last <a>color stop</a> does not have a position,
			set its position to 100%.

		<li>
			If a <a>color stop</a> or [=transition hint=] has a position
			that is less than the specified position
			of any <a>color stop</a> or [=transition hint=] before it in the list,
			set its position to be equal to the largest specified position
			of any <a>color stop</a> or [=transition hint=] before it.

		<li>
			If any <a>color stop</a> still does not have a position,
			then, for each run of adjacent <a>color stops</a> without positions,
			set their positions so that they are evenly spaced
			between the preceding and following <a>color stops</a> with positions.
	</ol>

	After applying these rules,
	all [=color stops=] and [=transition hints=] will have a definite position and color
	and they will be in ascending order.

	<wpt>
		gradient-move-stops.html
		gradient-nan-crash.html
		gradient-refcrash.html
	</wpt>

	Note: It is recommended that authors exercise caution
	when mixing different types of units,
	such as px, em, or %,
	as this can cause a <a>color stop</a> to unintentionally try to move before an earlier one.
	For example,
	the rule ''background-image: linear-gradient(yellow 100px, blue 50%)''
	wouldn't trigger any fix-up while the background area is at least ''200px'' tall.
	If it was ''150px'' tall, however,
	the blue <a>color stop's</a> position would be equivalent to ''75px'',
	which precedes the yellow <a>color stop</a>,
	and would be corrected to a position of ''100px''.
	Additionally, since the relative ordering of such color stops
	cannot be determined without performing layout,
	they will not interpolate smoothly in
	<a href="http://www.w3.org/TR/css-animations/">animations</a>
	or <a href="http://www.w3.org/TR/css-transitions/">transitions</a>.

	<div class='example' id='ex-gradient-fixup'>
		Below are several pairs of gradients.
		The latter of each pair is a manually “fixed-up” version of the former,
		obtained by applying the above rules.
		For each pair, both gradients will render identically.
		<span class='note'>The numbers in each arrow specify which fixup steps are invoked in the transformation.</span>

		<pre>
			1. linear-gradient(red, white 20%, blue)
			   =1=>
			   linear-gradient(red 0%, white 20%, blue 100%)

			2. linear-gradient(red 40%, white, black, blue)
			   =1,3=>
			   linear-gradient(red 40%, white 60%, black 80%, blue 100%)

			3. linear-gradient(red -50%, white, blue)
			   =1,3=>
			   linear-gradient(red -50%, white 25%, blue 100%)

			4. linear-gradient(red -50px, white, blue)
			   =1,3=>
			   linear-gradient(red -50px, white calc(-25px + 50%), blue 100%)

			5. linear-gradient(red 20px, white 0px, blue 40px)
			   =2=>
			   linear-gradient(red 20px, white 20px, blue 40px)

			6. linear-gradient(red, white -50%, black 150%, blue)
			   =1,2=>
			   linear-gradient(red 0%, white 0%, black 150%, blue 150%)

			7. linear-gradient(red 80px, white 0px, black, blue 100px)
			   =2,3=>
			   linear-gradient(red 80px, white 80px, black 90px, blue 100px)
		</pre>
	</div>

<!--
 ██████  ████████ ████████  ████ ████████  ███████  ██████    ███ ███
██    ██    ██    ██     ██  ██  ██     ██ █       ██    ██  ██     ██
██          ██    ██     ██  ██  ██     ██ █       ██       ██       ██
 ██████     ██    ████████   ██  ████████  █████    ██████  ██       ██
      ██    ██    ██   ██    ██  ██        █             ██ ██       ██
██    ██    ██    ██    ██   ██  ██        █       ██    ██  ██     ██
 ██████     ██    ██     ██ ████ ██        ███████  ██████    ███ ███
-->

1D Image Values: the <<image-1D>> type and ''stripes()'' notation {#stripes}
============================================================================

	While <<image>> values represent a 2-dimensional (2D) image,
	and <<color>> can be thought of as a 0-dimensional (0D) image
	(unvarying in either axis),
	some contexts require a
	<dfn export lt="1D image | one-dimensional image | 1-dimensional image">1-dimensional (1D) image</dfn>,
	which specifies colors along an abstract, directionless, single-axis <dfn export>paint line</dfn>.
	The <dfn><<image-1D>></dfn> type represents such [=1D images=],
	including the ''stripes()'' [=functional notation=]:

	<pre class=prod>
		&lt;image-1D> = <<stripes()>>
		<<stripes()>> = stripes( <<color-stripe>># )
		<<color-stripe>> = <<color>> && [ <<length-percentage>> | <<flex>> ]?
	</pre>

	The <dfn>stripes()</dfn> function defines a [=1D image=]
	as a comma-separated list of colored stripes,
	each placed end-to-end on the [=paint line=] in the order given.

	Each <dfn><<color-stripe>></dfn> entry defines a solid-color stripe
	with the specified <<color>> and thickness.
	If the thickness is omitted,
	it defaults to ''1fr''.
	Thickness values are interpreted as follows:

	<dl dfn-type=value dfn-for="stripes()">
		<dt><dfn><<percentage [0,100]>></dfn>
		<dd>
			Percentage thicknesses are relative to the |total width|.
			Only values between ''0%'' and ''100%'' (inclusive)
			are valid.

		<dt><dfn><<length [0,Infinity]>></dfn>
		<dd>
			Negative length values are invalid.

		<dt><dfn><<flex>></dfn>
		<dd>
			A <<flex>> is evaluated as a fraction of the |total width|
			relative to the total sum of <<flex>> entries in the function,
			after subtracting the thickness of any non-<<flex>> entries
			(flooring the subtraction result at zero).
			If the sum of <<flex>> values is less than ''1fr'',
			the result of the subtraction is multiplied by the sum's value
			before being distributed.
	</dl>

	The |total width| refers to the length of the [=paint line=].
	It is defined by the context in which the ''stripes()'' function is used.
	If the sum of the stripes is smaller than the |total width|,
	the [=paint line=] is [=transparent black=] for its remaining length,
	as if a final ''transparent'' argument were given.
	If the sum is larger,
	any stripes or portions beyond the |total width| are truncated.

	<div class='example' id='ex-stripes-total-width'>
		For example,
		''stripes(red 1fr, green 2fr, blue 100px)''
		with a |total width| of ''400px''
		will result in a 100px red stripe and 200px green stripe,
		giving red 1 share and green 2 shares of the 300px remaining
		after subtracting blue's 100px from the 400px total.

		<img src="images/stripes1.svg" style="height:1em; width:400px;" alt="">

		On the other hand,
		''stripes(red .1fr, green .2fr, blue 100px)''
		with a |total width| of ''400px''
		will instead give a 30px red stripe and 60px green stripe,
		followed by 100px of blue and then 210px of transparent.
		The 300px of leftover space is multiplied by .3,
		the value of the sum of the <<flex>> values,
		to obtain only 90px,
		which is then distributed in the 1:2 ratio
		dictated by the <<flex>> values.

		<img src="images/stripes2.svg" style="height:1em; width:400px;" alt="">

		(This is similar to how [=flex layout=] deals with small <<flex>> sums on a line,
		and ensures smoothly continuous behavior
		as the <<flex>> values approach zero.)
	</div>

	The [=computed value=] of this function is
	an ordered list of stripes,
	each given as a [=computed color=]
	and a thickness represented either a <<flex>> value
	or a computed <<length-percentage>> value.

<!--
 ██████  ████ ████████ ████ ██    ██  ██████
██    ██  ██       ██   ██  ███   ██ ██    ██
██        ██      ██    ██  ████  ██ ██
 ██████   ██     ██     ██  ██ ██ ██ ██   ████
      ██  ██    ██      ██  ██  ████ ██    ██
██    ██  ██   ██       ██  ██   ███ ██    ██
 ██████  ████ ████████ ████ ██    ██  ██████
-->


Sizing Images and Objects in CSS {#sizing}
==========================================

<!--
 ███████  ████████        ██ ████████  ██████  ████████         ████████ ████ ████████
██     ██ ██     ██       ██ ██       ██    ██    ██            ██        ██     ██
██     ██ ██     ██       ██ ██       ██          ██            ██        ██     ██
██     ██ ████████        ██ ██████   ██          ██    ███████ ██████    ██     ██
██     ██ ██     ██ ██    ██ ██       ██          ██            ██        ██     ██
██     ██ ██     ██ ██    ██ ██       ██    ██    ██            ██        ██     ██
 ███████  ████████   ██████  ████████  ██████     ██            ██       ████    ██
-->

Sizing Objects: the 'object-fit' property {#the-object-fit}
-----------------------------------------------------------

	<pre class='propdef'>
	Name: object-fit
	Value: fill | none | [contain | cover] || scale-down
	Initial: fill
	Applies to: replaced elements
	Inherited: no
	Percentages: n/a
	Computed value: specified keyword(s)
	Animation type: discrete
	</pre>

	The 'object-fit' property specifies how the contents of a replaced element
	should be fitted to the box established by its used height and width.

	<dl dfn-type=value dfn-for=object-fit>
		<dt><dfn>fill</dfn>
		<dd>
			The replaced content is sized to fill the element's content box:
			the object's <a>concrete object size</a> is the element's used width and height.

		<dt><dfn>none</dfn>
		<dd>
			The replaced content is not resized to fit inside the element's content box:
			determine the object's <a>concrete object size</a>
			using the <a>default sizing algorithm</a> with no specified size,
			and a <a>default object size</a> equal to the replaced element's used width and height.

		<dt><dfn>contain</dfn>
		<dd>
			The replaced content is sized to maintain its aspect ratio
			while fitting within the element's content box:
			its <a>concrete object size</a> is resolved as a <a>contain constraint</a>
			against the element's used width and height.

			If the ''scale-down'' flag is used, size the content as if ''object-fit/none'' or ''object-fit/contain'' were specified,
			whichever would result in a smaller <a>concrete object size</a>.

			Note: Both ''object-fit/none'' and ''object-fit/contain'' respect the content's [=natural aspect ratio=],
			so the concept of "smaller" is well-defined.

		<dt><dfn>cover</dfn>
		<dd>
			The replaced content is sized to maintain its aspect ratio
			while filling the element's entire content box:
			its <a>concrete object size</a> is resolved as a <a>cover constraint</a>
			against the element's used width and height.

			If the ''scale-down'' flag is used, size the content as if ''object-fit/none'' or ''object-fit/cover'' were specified,
			whichever would result in a smaller <a>concrete object size</a>.

			Note: Both ''object-fit/none'' and ''object-fit/cover'' respect the content's [=natural aspect ratio=],
			so the concept of "smaller" is well-defined.

		<dt><dfn>scale-down</dfn>
		<dd>
			Equivalent to ''contain scale-down''.
	</dl>

	<wpt>
		inheritance.html
		object-fit-contain-png-001c.html
		object-fit-contain-png-001e.html
		object-fit-contain-png-001i.html
		object-fit-contain-png-001o.html
		object-fit-contain-png-001p.html
		object-fit-contain-png-002c.html
		object-fit-contain-png-002e.html
		object-fit-contain-png-002i.html
		object-fit-contain-png-002o.html
		object-fit-contain-png-002p.html
		object-fit-contain-svg-001e.html
		object-fit-contain-svg-001i.html
		object-fit-contain-svg-001o.html
		object-fit-contain-svg-001p.html
		object-fit-contain-svg-002e.html
		object-fit-contain-svg-002i.html
		object-fit-contain-svg-002o.html
		object-fit-contain-svg-002p.html
		object-fit-contain-svg-003e.html
		object-fit-contain-svg-003i.html
		object-fit-contain-svg-003o.html
		object-fit-contain-svg-003p.html
		object-fit-contain-svg-004e.html
		object-fit-contain-svg-004i.html
		object-fit-contain-svg-004o.html
		object-fit-contain-svg-004p.html
		object-fit-contain-svg-005e.html
		object-fit-contain-svg-005i.html
		object-fit-contain-svg-005o.html
		object-fit-contain-svg-005p.html
		object-fit-contain-svg-006e.html
		object-fit-contain-svg-006i.html
		object-fit-contain-svg-006o.html
		object-fit-contain-svg-006p.html
		object-fit-cover-png-001c.html
		object-fit-cover-png-001e.html
		object-fit-cover-png-001i.html
		object-fit-cover-png-001o.html
		object-fit-cover-png-001p.html
		object-fit-cover-png-002c.html
		object-fit-cover-png-002e.html
		object-fit-cover-png-002i.html
		object-fit-cover-png-002o.html
		object-fit-cover-png-002p.html
		object-fit-cover-svg-001e.html
		object-fit-cover-svg-001i.html
		object-fit-cover-svg-001o.html
		object-fit-cover-svg-001p.html
		object-fit-cover-svg-002e.html
		object-fit-cover-svg-002i.html
		object-fit-cover-svg-002o.html
		object-fit-cover-svg-002p.html
		object-fit-cover-svg-003e.html
		object-fit-cover-svg-003i.html
		object-fit-cover-svg-003o.html
		object-fit-cover-svg-003p.html
		object-fit-cover-svg-004e.html
		object-fit-cover-svg-004i.html
		object-fit-cover-svg-004o.html
		object-fit-cover-svg-004p.html
		object-fit-cover-svg-005e.html
		object-fit-cover-svg-005i.html
		object-fit-cover-svg-005o.html
		object-fit-cover-svg-005p.html
		object-fit-cover-svg-006e.html
		object-fit-cover-svg-006i.html
		object-fit-cover-svg-006o.html
		object-fit-cover-svg-006p.html
		object-fit-dyn-aspect-ratio-001.html
		object-fit-dyn-aspect-ratio-002.html
		object-fit-fill-png-001c.html
		object-fit-fill-png-001e.html
		object-fit-fill-png-001i.html
		object-fit-fill-png-001o.html
		object-fit-fill-png-001p.html
		object-fit-fill-png-002c.html
		object-fit-fill-png-002e.html
		object-fit-fill-png-002i.html
		object-fit-fill-png-002o.html
		object-fit-fill-png-002p.html
		object-fit-fill-svg-001e.html
		object-fit-fill-svg-001i.html
		object-fit-fill-svg-001o.html
		object-fit-fill-svg-001p.html
		object-fit-fill-svg-002e.html
		object-fit-fill-svg-002i.html
		object-fit-fill-svg-002o.html
		object-fit-fill-svg-002p.html
		object-fit-fill-svg-003e.html
		object-fit-fill-svg-003i.html
		object-fit-fill-svg-003o.html
		object-fit-fill-svg-003p.html
		object-fit-fill-svg-004e.html
		object-fit-fill-svg-004i.html
		object-fit-fill-svg-004o.html
		object-fit-fill-svg-004p.html
		object-fit-fill-svg-005e.html
		object-fit-fill-svg-005i.html
		object-fit-fill-svg-005o.html
		object-fit-fill-svg-005p.html
		object-fit-fill-svg-006e.html
		object-fit-fill-svg-006i.html
		object-fit-fill-svg-006o.html
		object-fit-fill-svg-006p.html
		object-fit-none-png-001c.html
		object-fit-none-png-001e.html
		object-fit-none-png-001i.html
		object-fit-none-png-001o.html
		object-fit-none-png-001p.html
		object-fit-none-png-002c.html
		object-fit-none-png-002e.html
		object-fit-none-png-002i.html
		object-fit-none-png-002o.html
		object-fit-none-png-002p.html
		object-fit-none-svg-001e.html
		object-fit-none-svg-001i.html
		object-fit-none-svg-001o.html
		object-fit-none-svg-001p.html
		object-fit-none-svg-002e.html
		object-fit-none-svg-002i.html
		object-fit-none-svg-002o.html
		object-fit-none-svg-002p.html
		object-fit-none-svg-003e.html
		object-fit-none-svg-003i.html
		object-fit-none-svg-003o.html
		object-fit-none-svg-003p.html
		object-fit-none-svg-004e.html
		object-fit-none-svg-004i.html
		object-fit-none-svg-004o.html
		object-fit-none-svg-004p.html
		object-fit-none-svg-005e.html
		object-fit-none-svg-005i.html
		object-fit-none-svg-005o.html
		object-fit-none-svg-005p.html
		object-fit-none-svg-006e.html
		object-fit-none-svg-006i.html
		object-fit-none-svg-006o.html
		object-fit-none-svg-006p.html
		object-fit-scale-down-png-001c.html
		object-fit-scale-down-png-001e.html
		object-fit-scale-down-png-001i.html
		object-fit-scale-down-png-001o.html
		object-fit-scale-down-png-001p.html
		object-fit-scale-down-png-002c.html
		object-fit-scale-down-png-002e.html
		object-fit-scale-down-png-002i.html
		object-fit-scale-down-png-002o.html
		object-fit-scale-down-png-002p.html
		object-fit-scale-down-svg-001e.html
		object-fit-scale-down-svg-001i.html
		object-fit-scale-down-svg-001o.html
		object-fit-scale-down-svg-001p.html
		object-fit-scale-down-svg-002e.html
		object-fit-scale-down-svg-002i.html
		object-fit-scale-down-svg-002o.html
		object-fit-scale-down-svg-002p.html
		object-fit-scale-down-svg-003e.html
		object-fit-scale-down-svg-003i.html
		object-fit-scale-down-svg-003o.html
		object-fit-scale-down-svg-003p.html
		object-fit-scale-down-svg-004e.html
		object-fit-scale-down-svg-004i.html
		object-fit-scale-down-svg-004o.html
		object-fit-scale-down-svg-004p.html
		object-fit-scale-down-svg-005e.html
		object-fit-scale-down-svg-005i.html
		object-fit-scale-down-svg-005o.html
		object-fit-scale-down-svg-005p.html
		object-fit-scale-down-svg-006e.html
		object-fit-scale-down-svg-006i.html
		object-fit-scale-down-svg-006o.html
		object-fit-scale-down-svg-006p.html
		parsing/object-fit-computed.html
		parsing/object-fit-invalid.html
		parsing/object-fit-valid.html
	</wpt>

	If the content does not completely fill the replaced element's content box,
	the unfilled space shows the replaced element's background.
	Since replaced elements always clip their contents to the content box,
	the content will never overflow.
	See the 'object-position' property for positioning the object with respect to the content box.

	<figure>
		<img src="images/img_scale.png" style="border: thin solid black;" alt="">

		<figcaption>
			An example showing how four of the values of 'object-fit' cause the replaced element (blue figure)
			to be scaled to fit its height/width box (shown with a green background),
			using the initial value for 'object-position'.
			In this case, ''scale-down'' and ''scale-down contain'' would look identical to ''object-fit/contain'',
			and ''scale-down cover'' would look identical to ''object-fit/none''.
		</figcaption>
	</figure>

	Note: The 'object-fit' property has similar semantics to
	the <code>fit</code> attribute in [[SMIL10]]
	and the <<meetOrSlice>> parameter
	on the <a href="https://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute"><code>preserveAspectRatio</code> attribute</a> in [[SVG11]].

	Note: Per the <a>object size negotiation</a> algorithm,
	the <a>concrete object size</a>
	(or, in this case, the size of the content)
	does not directly scale the object itself -
	it is merely passed to the object as information about the size of the visible canvas.
	How to then draw into that size is up to the image format.
	In particular, raster images always scale to the given size,
	while SVG uses the given size as the size of the "SVG Viewport"
	(a term defined by SVG)
	and then uses the values of several attributes on the root <code>&lt;svg></code> element to determine how to draw itself.




Image Processing {#image-processing}
====================================

<!--
████         ████████  ████████  ██████
 ██          ██     ██ ██       ██    ██
 ██          ██     ██ ██       ██
 ██  ███████ ████████  ██████    ██████
 ██          ██   ██   ██             ██
 ██          ██    ██  ██       ██    ██
████         ██     ██ ████████  ██████
-->

Overriding Image Resolutions: the 'image-resolution' property {#the-image-resolution}
-------------------------------------------------------------------------------------

	The <dfn export>image resolution</dfn> is defined as
	the number of image pixels per unit length,
	e.g., pixels per inch.
	Some image formats can record information about the resolution of images.
	This information can be helpful when determining the actual size of the image in the formatting process.
	However, the information can also be wrong,
	in which case it should be ignored.
	By default, CSS assumes a resolution of one image pixel per CSS ''px'' unit;
	however, the 'image-resolution' property allows using some other resolution.

	<pre class='propdef'>
	Name: image-resolution
	Value: [ from-image || <<resolution>> ] && snap?
	Initial: 1dppx
	Applies to: all elements
	Inherited: yes
	Computed value: specified keyword(s) and/or <<resolution>> (possibly adjusted for ''snap'', see below)
	Animation type: discrete
	</pre>

	Issue: The ''image-set()'' notation can alter the [=natural resolution=] of an image,
	which ideally would be automatically honored without having to set this property.
	How should we best address this?
	Change the initial value to <css>auto</css>, meaning "1dppx, unless CSS says otherwise"?
	Say that image-resolution has no effect on images whose resolution was set by something else in CSS?
	Or somehow wordsmithing ''image-set()'' in some way such that it always produces ''1dppx'' images somehow?

	The 'image-resolution' property specifies the [=preferred resolution=] of all raster images used in or on the element.
	It affects both content images
	(e.g. replaced elements and generated content)
	and decorative images
	(such as 'background-image').
	The <dfn export>preferred resolution</dfn> of an image is used to determine the image's [=natural dimensions=].
	Values have the following meanings:

	<dl dfn-type=value dfn-for=image-resolution>
		<dt><dfn><<resolution>></dfn>
		<dd>
			Specifies the [=preferred resolution=] explicitly.
			A "dot" in this case corresponds to a single image pixel.

		<dt><dfn>from-image</dfn>
		<dd>
			The image's [=preferred resolution=] is taken as that specified by the image format
			(the <dfn dfn dfn-for=/ export>natural resolution</dfn>).
			If the image does not specify its own resolution,
			the explicitly specified resolution is used (if given),
			else it defaults to ''1dppx''.

			Note: [[css-images-3#url-metadata]] imposes some restrictions on what metadata can be used.

		<dt><dfn>snap</dfn>
		<dd>
			If the "snap" keyword is provided,
			the computed <<resolution>> (if any)
			is the specified resolution rounded to the nearest value
			that would map one image pixel to an integer number of device pixels.
			If the resolution is taken from the image,
			then the used [=natural resolution=] is the image's native resolution similarly adjusted.
	</dl>

	As vector formats such as SVG do not have a [=natural resolution=],
	this property has no effect on vector images.

	<div class='example' id='ex-image-resolution'>
		Printers tend to have substantially higher resolution than computer monitors;
		due to this, an image that looks fine on the screen may look pixelated when printed out.
		The 'image-resolution' property can be used to embed a high-resolution image into the document
		and maintain an appropriate size,
		ensuring attractive display both on screen and on paper:

		<pre class=lang-css>
			img.high-res {
				image-resolution: 300dpi;
			}
		</pre>

		With this set, an image meant to be 5 inches wide at 300dpi
		will actually display as 5in wide;
		without this set,
		the image would display as approximately 15.6in wide
		since the image is 15000 image pixels across,
		and by default CSS displays 96 image pixels per inch.
	</div>


	<div class="example" id='ex-resolution-from-image'>
		Some image formats can encode the image resolution into the image data.
		This rule specifies that the UA should use the image resolution found in the image itself,
		falling back to 1 image pixel per CSS ''px'' unit.

		<pre class=lang-css>img { image-resolution: from-image }</pre>

		These rules both specify that the UA should use the image resolution found in the image itself,
		but if the image has no resolution,
		the resolution is set to ''300dpi'' instead of the default ''1dppx''.

		<pre class=lang-css>
			img { image-resolution: from-image 300dpi }
			img { image-resolution: 300dpi from-image }
		</pre>

	</div>

	<div class="example" id='ex-resolution-300'>
		Using this rule, the image resolution is set to 300dpi.
		(The resolution in the image, if any, is ignored.)

		<pre class=lang-css>img { image-resolution: 300dpi }</pre>

		This rule, on the other hand,
		if used when the screen's resolution is 96dpi,
		would instead render the image at 288dpi
		(so that 3 image pixels map to 1 device pixel):

		<pre class=lang-css>img { image-resolution: 300dpi snap; }</pre>

		The ''snap'' keyword can also be used when the resolution is taken from the image:

		<pre class=lang-css>img { image-resolution: snap from-image; }</pre>

		An image declaring itself as 300dpi will,
		in the situation above,
		display at 288dpi
		(3 image pixels per device pixel)
		whereas an image declaring 72dpi will render at 96dpi
		(1 image pixel per device pixel).
	</div>


<!--
████ ██    ██ ████████ ████████ ████████  ████████   ███████  ██          ███    ████████ ████  ███████  ██    ██
 ██  ███   ██    ██    ██       ██     ██ ██     ██ ██     ██ ██         ██ ██      ██     ██  ██     ██ ███   ██
 ██  ████  ██    ██    ██       ██     ██ ██     ██ ██     ██ ██        ██   ██     ██     ██  ██     ██ ████  ██
 ██  ██ ██ ██    ██    ██████   ████████  ████████  ██     ██ ██       ██     ██    ██     ██  ██     ██ ██ ██ ██
 ██  ██  ████    ██    ██       ██   ██   ██        ██     ██ ██       █████████    ██     ██  ██     ██ ██  ████
 ██  ██   ███    ██    ██       ██    ██  ██        ██     ██ ██       ██     ██    ██     ██  ██     ██ ██   ███
████ ██    ██    ██    ████████ ██     ██ ██         ███████  ████████ ██     ██    ██    ████  ███████  ██    ██
-->

Interpolation {#interpolation}
==============================

	This section describes how to interpolate between new value types defined in this specification,
	for use with modules such as CSS Transitions and CSS Animations.

	If an algorithm below simply states that two values should be "interpolated" or "transitioned" without further details,
	then the value should be interpolated as described by the Transitions spec.
	Otherwise, the algorithm may reference a variable <var>t</var>
	in its detailed description of the interpolation.
	This is a number which starts at 0% and goes to 100%,
	and is set to a value that represents the progress through the transition,
	based on the duration of the transition,
	the elapsed time,
	and the timing function in use.
	For example, with a linear timing function and a 1s duration,
	after .3s <var>t</var> is equal to 30%.

Interpolating <<image>> {#interpolating-images}
-----------------------------------------------

	All images can be interpolated,
	though some special types of images
	(like some gradients)
	have their own special interpolation rules.
	In general terms,
	images are interpolated by scaling them to the size of the <var>start image</var>
	and cross-fading the two while they transition to the size of the <var>end image</var>.

	In specific terms,
	at each point in the interpolation
	the image is equal to <code>cross-fade( (100% - <var>t</var>) <var>start image</var>, <var>end image</var>)</code>.

	Issue: Special-case interpolating to/from no image,
	like "background-image: url(foo);" to "background-image: none;".


Interpolating cross-fade() {#interpolating-image-combinations}
--------------------------------------------------------------

	The three components of ''cross-fade()'' are interpolated independently.
	Note this may result in nested ''cross-fade()'' notations.

Interpolating <<gradient>> {#interpolating-gradients}
-----------------------------------------------------

	Issue: This section needs review and improvement.
	In particular, I believe the handling of linear-gradient() is incomplete -
	I think we want to specifically interpolate the "length" of the gradient line
	(the distance between 0% and 100%)
	between the starting and ending positions explicitly,
	so it doesn't grow and then shrink over a single animation.

	Gradient images can be interpolated directly in CSS transitions and animations,
	smoothly animating from one gradient to another.
	There are only a few restrictions on what gradients are allowed to be interpolated:

	1. Both the starting and ending gradient must be expressed with the same function.
		(For example, you can transition from a ''linear-gradient()'' to a ''linear-gradient()'',
		but not from a ''linear-gradient()'' to a ''radial-gradient()'' or a ''repeating-linear-gradient()''.)

	2. Both the starting and ending gradient must have the same number of <<color-stop>>s.
		For this purpose, all repeating gradients are considered to have infinite color stops,
		and thus all repeating gradients match in this respect.

	3. Neither gradient uses a combination of <<length>> and <<percentage>> color stops.

	If the two gradients satisfy all of those constraints,
	they must be interpolated as described below.
	If they fail the third one only,
	they must be abruptly transitioned at 50%
	(unless otherwise specified by a future specification).
	If they fail either of the first two constraints,
	they must be interpolated using ''cross-fade()''
	as for generic images.

	Note: The abrupt transition at 50% is so that content will not rely on cross-fading,
	and smarter interpolation rules can be added for this case in the future.

	1. Convert both the start and end gradients to their explicit forms:

		: For linear gradients:
		:: * If the direction is specified as an <<angle>>,
				it is already in its explicit form.

			* Otherwise,
				change its direction to an <<angle>> in [''0deg'',''360deg'')
				that would produce an equivalent rendering.

				If both the start and end gradients had their direction specified with keywords,
				and the absolute difference between the angles their directions mapped to is greater than 180deg,
				add 360deg to the direction of the gradient with the smaller angle.
				<span class='note'>This ensures that a transition from, for example,
				"to left" (270deg) to "to top" (0deg)
				rotates the gradient a quarter-turn clockwise,
				as expected,
				rather than rotating three-quarters of a turn counter-clockwise.</span>

		: For radial gradients:
		:: * If the size is specified as two <<length>>s or <<percentage>>s,
				it is already in its explicit form.

			* Otherwise, the size must be changed to a pair of <<length>>s
				that would produce an equivalent ending-shape.
				If the <<radial-shape>> was specified as <a value spec=css-images-3>circle</a>,
				change it to ''ellipse''.

	2. Interpolate each component and color-stop of the gradients independently.
		For linear gradients,
		the only component is the angle.
		For radial gradients,
		the components are the horizontal and vertical position of the center
		and the horizontal and vertical axis lengths.

	3. To interpolate a color-stop,
		first match each color-stop in the start gradient
		to the corresponding color-stop at the same index in the end gradient.
		For repeating gradients,
		the first specified color-stop in the start and end gradients
		are considered to be at the same index,
		and all other color-stops following and preceding are indexed appropriately,
		repeating and shifting each gradient's list of color-stops as needed.
		Then, for each pair of color-stops,
		interpolate the position and color independently.

Interpolating ''stripes()'' {#interpolating-stripes}
-----------------------------------------------------

	Similar to gradients,
	two ''stripes()'' can be interpolated,
	allowing for smooth animations from one image to another.
	There is only one restriction on what ''stripes()'' are allowed to be interpolated.
	Both the starting and ending image must have the same number of <<color-stripe>>s.
	If the two images satisfy this constraint,
	they must be interpolated as described below.
	If they fail the constraint,
	they must be interpolated using ''cross-fade()''
	as for generic images.

	1. Interpolate each component and stripe of the images independently.

	2. To interpolate a stripe,
		first match each stripe in the start image
		to the corresponding stripe at the same index in the end image.
		Then, for each pair of stripes,
		interpolate the thickness
		and color independently.
		<<flex>> values are interpolated as <<length-percentage>>s using the following formula:

		<pre>max(0, 100% - sum-of-percents - sum-of-fixed) * flex value / max(1, sum-of-flexes)</pre>

		where ''sum-of-percents'' is the sum of all <<percentage>>s in the ''stripes()'' function,
		''sum-of-fixed'' is the sum of all fixed <<length>>s in the function,
		and ''sum-of-flexes'' is the sum of all <<flex>> values.

<!--
 ██████  ████████ ████████  ████    ███    ██       ████ ████████    ███    ████████ ████  ███████  ██    ██
██    ██ ██       ██     ██  ██    ██ ██   ██        ██       ██    ██ ██      ██     ██  ██     ██ ███   ██
██       ██       ██     ██  ██   ██   ██  ██        ██      ██    ██   ██     ██     ██  ██     ██ ████  ██
 ██████  ██████   ████████   ██  ██     ██ ██        ██     ██    ██     ██    ██     ██  ██     ██ ██ ██ ██
      ██ ██       ██   ██    ██  █████████ ██        ██    ██     █████████    ██     ██  ██     ██ ██  ████
██    ██ ██       ██    ██   ██  ██     ██ ██        ██   ██      ██     ██    ██     ██  ██     ██ ██   ███
 ██████  ████████ ██     ██ ████ ██     ██ ████████ ████ ████████ ██     ██    ██    ████  ███████  ██    ██
-->

Serialization {#serialization}
==============================

	This section describes the serialization of all new properties and value types introduced in this specification,
	for the purpose of interfacing with the CSS Object Model [[CSSOM]].

	To serialize any function defined in this module,
	serialize it per its individual grammar,
	in the order its grammar is written in,
	omitting components when possible without changing the meaning,
	joining space-separated tokens with a single space,
	and following each serialized comma with a single space.

	For ''cross-fade()'',
	always serialize the <<percentage>>.

	<div class='example' id='ex-serialize-gradient'>
		For example, a gradient specified as:

		<pre>Linear-Gradient( to bottom, red 0%,yellow,black 100px)</pre>

		must serialize as:

		<pre>linear-gradient(rgb(255, 0, 0), rgb(255, 255, 0), rgb(0, 0, 0) 100px)</pre>
	</div>

<h2 id=deprecated class=no-num>
Appendix A: Deprecated Features and Aliases</h2>

	Implementations must accept <dfn>-webkit-image-set()</dfn>
	as a parse-time alias of ''image-set()''.
	(It's a valid value, with identical arguments to ''image-set()'',
	and is turned into ''image-set()'' during parsing.)

Privacy Considerations {#privacy}
=================================

Note: No change from [[css-images-3]].

Security Considerations {#security}
===================================

Note: No change from [[css-images-3]].

Changes {#changes}
==================

<h3 class="no-num" id="changes-20250930">
Changes Since the <a href="https://www.w3.org/TR/2025/WD-css-images-4-20250930/">30 September 2025</a> Working Draft</h3>

<ul>
	<li>(none)</li>
</ul>

<h3 class="no-num" id="changes-20230217">
Changes Since the <a href="https://www.w3.org/TR/2023/WD-css-images-4-20230217/">17 February 2023</a> Working Draft</h3>

<!-- to 3 June 2025 -->
	* Cleaned up the use of fetching external URLs for style resources
		(<a href="https://github.com/w3c/csswg-drafts/issues/12065">Issue 12065</a>,
		<a href="https://github.com/w3c/csswg-drafts/issues/12068">Issue 12068</a>,
		<a href="https://github.com/w3c/csswg-drafts/issues/12086">Issue 12086</a>,
		<a href="https://github.com/w3c/csswg-drafts/issues/12147">Issue 12147</a>)
	* Made cross-fade() accept 1+ arguments
		(<a href="https://github.com/w3c/csswg-drafts/issues/11530">Issue 11530</a>)
	* Allowed &lt;zero> for angular color stop/hint
	* Explicitly allowed &lt;zero> for gradient rotation
	* Fixed note about double positions making a stripe.
		Added note about color before/after the stop lists.
		(<a href="https://github.com/w3c/csswg-drafts/issues/11381">Issue 11381</a>)
	* Separated the first and last stop fixing into separate steps,
		so it's clearer what happens with a single stop
		(<a href="https://github.com/w3c/csswg-drafts/issues/10092">Issue 10092</a>)
	* Allow just one color stop
		(<a href="https://github.com/w3c/csswg-drafts/issues/10092">Issue 10092</a>)
	* Made cross-fade() have same order as color-mix()
		(<a href="https://github.com/w3c/csswg-drafts/issues/9405">Issue 9405</a>)
	* Added example images for the stripes() function
		(<a href="https://github.com/w3c/csswg-drafts/pull/9749">PR 9749</a>)
	* Added <<percentage>> values to ''radial-gradient(circle)'',
		and dual <<radial-extent>> values to ''radial-gradient(ellipse)''
		to make ''radial-gradient()'' consistent with
		the ''circle()'' and ''ellipse()'' <<basic-shape>>s.
		(<a href="https://github.com/w3c/csswg-drafts/issues/824">Issue 824</a>)
	* Added example of missing hues when interpolating with neutrals
		(<a href="https://github.com/w3c/csswg-drafts/issues/4928">Issue 4928</a>)
	* Explicitly linked to CSS Color 4 hue interpolation, and handling of missing components
		(<a href="https://github.com/w3c/csswg-drafts/issues/4928">Issue 4928</a>)
	* Allowed omitting resolution/type in image-set()
	* Applied fix from <a href="https://github.com/w3c/csswg-drafts/pull/8021">PR #8021</a>
		to gradient definitions in CSS Images 4
		(<a href="https://github.com/w3c/csswg-drafts/pull/9147">Issue 9147</a>)
	* Made explicit what the default interpolation color space is.
		(<a href="https://github.com/w3c/csswg-drafts/issues/7948">Issue 7947</a>)
	* Fixed duplicate repeating gradient definitions
		(<a href="https://github.com/w3c/csswg-drafts/pull/8797">Issue 8797</a>)
	* Added basic syntax of repeating gradient types
		(<a href="https://github.com/w3c/csswg-drafts/pull/8775">Issue 8775</a>)
	* Fixed interpolation of stripes() with different types
		(<a href="https://github.com/w3c/csswg-drafts/pull/8614">Issue 8614</a>)
	* Added url request modifiers to enable request parameters
		(<a href="https://github.com/w3c/csswg-drafts/pull/8222">PR 8222</a>)
	* Specified that image-set() is an invalid image if you remove all the options.
		(<a href="https://github.com/w3c/csswg-drafts/issues/8266">Issue 8266</a>)

<h3 class="no-num" id="changes-20170413">
Changes Since the <a href="https://www.w3.org/TR/2017/WD-css-images-4-20170413/">13 April 2017</a> Working Draft</h3>

	* Major editorial rewrite of [[#gradient-colors]].
	* Added new <<image-1D>> data type and ''stripes()'' function.
		(<a href="https://github.com/w3c/csswg-drafts/issues/2532">Issue 2532</a>)
	* Added <<color-interpolation-method>> to all gradient functions.
		(Issues <a href="https://github.com/w3c/csswg-drafts/issues/6094">6094</a>,
		        <a href="https://github.com/w3c/csswg-drafts/issues/6667">6667</a>)
	* Added new 'object-view-box' property.
		(<a href="https://github.com/w3c/csswg-drafts/issues/7058">Issue 7058</a>)
	* Pulled definition of ''image-set()'' from [[css-images-3]] and:
		* Added ''type()'' to ''image-set()''.
			(<a href="https://github.com/w3c/csswg-drafts/issues/656">Issue 656</a>)
		* Added the ''-webkit-image-set()'' compatibility alias.
			(<a href="https://github.com/w3c/csswg-drafts/issues/6285">Issue 6285</a>)
	* Pulled definition of ''cross-fade()'' from [[css-images-3]] and:
		* Clarified that ''cross-fade()'' takes 1+ arguments.
		* Updated to allow mixing colors as well as images.
		* Defined sizing and painting of the new function arguments in detail.
		* Fixed incorrect definition of ''cross-fade()'' image blending.
		* Add issue about computation planned simplification and comparison.
			(<a href="https://github.com/w3c/csswg-drafts/issues/2852">Issue 2852</a>)

		(<a href='https://lists.w3.org/Archives/Public/www-style/2018Jul/0024.html'>Minutes</a>,
		 <a href="https://github.com/w3c/csswg-drafts/commit/ab20b4cbccf41db8e61850f58b2f1c1afc6ec66a">Changeset</a>)

	* Pulled [[#interpolation|interpolation]] and [[#serialization|serialization]] of images from [[css-images-3]].
	* Defined that image metadata placed after the image data should be ignored, see [[css-images-3#url-metadata]].
		(<a href="https://github.com/w3c/csswg-drafts/issues/4929">Issue 4929</a>)
	* Defined image loading.
		(<a href='https://github.com/w3c/csswg-drafts/issues/1984'>Issue 1984</a>)
		* Copied definition of [=loading image=] from [[css-images-3]].
		* Integrated loading and error handling into ''image()'' behavior.
		* Explicitly allow UA to render the old image while a new image loads in to replace another.
		* Properly defined [[#fetching-images]].
			(<a href="https://github.com/w3c/csswg-drafts/issues/562">Issue 562</a>,
			<a href="https://github.com/w3c/csswg-drafts/pull/6715">Pull Request 6715</a>)
	* Updated {{CSS}} interface to a namespace.
		(<a href="https://github.com/w3c/csswg-drafts/pull/437">Issue 437</a>)
	* Allowed unitless zero to represent <<angle>> values in ''conic-gradient()''.
		(<a href="https://github.com/w3c/csswg-drafts/issues/1162">Issue 1162</a>,
		 <a href="https://github.com/w3c/csswg-drafts/commit/edb0b3090bdd73abb765023475e58afe52c701b9">Changes</a>)
	* Allowed ''scale-down'' to be combined with other values in 'object-fit'.
		(<a href="https://github.com/w3c/csswg-drafts/issues/1578">Issue 1578</a>)
	* Added missing <<element()>> to <<image>> data type.
		(<a href="https://github.com/w3c/csswg-drafts/issues/5170">issue 5170</a>)
	* Fixed <code>elementSources</code> IDL definition.
	* Fixed grammar error requiring color stop positions to be mandatory.
		(<a href="https://github.com/w3c/csswg-drafts/issues/1334">Issue 1334</a>)
	* Updated property definition tables to:
		* Align “Computed Value” and “Animation Type” lines across modules, tighten wording, and correct errors.
		* Use the new [=CSS bracketed range notation=] where appropriate.
		* Drop “Media” lines.
	* Renamed “intrinsic dimensions” to [=natural dimensions=] to avoid confusion with [=intrinsic sizes=].
		(<a href="https://github.com/w3c/csswg-drafts/issues/4961">Issue 4961</a>)
	* Copied over definition of computed <<image>> from [[css-images-3]].
		(<a href="https://github.com/w3c/csswg-drafts/issues/4042">Issue 4042</a>)
	* Explicitly allowed dithering in gradients.
		(<a href="https://github.com/w3c/csswg-drafts/issues/4793">Issue 4793</a>)
	* Assorted markup fixes, corrections to property syntaxes, inline issues, spelling corrections, example fixes and improvements, and minor editorial refinements.
	* Shortened module title.

<h3 class="no-num" id="changes-20120911">
Changes Since the <a href="https://www.w3.org/TR/2012/WD-css4-images-20120911/">11 September 2012 Working Draft</a></h3>

- Added <a href="#color-stop-syntax">color interpolation hints</a>
- Added the <a href="#color-stop-syntax">two location syntax</a> for gradient color stops
- Added start angles to <a href="#conic-gradients">conic gradients</a>
- The position(s) of a color stop can now come before the color
- Text that is identical to [[css-images-3]] has been replaced with a reference to [[css-images-3]].
- Added the ''-webkit-image-set()'' alias.

<h3 class="no-num" id="changes-3">
Changes Since Level 3</h3>

- Added the ''image()'' notation (deferred from Level 3)
- Added the 'image-resolution' property (deferred from Level 3)
- Added the ''element()'' notation (deferred from Level 3)
- Added <a href="#conic-gradients">conic gradients</a>
- Added &lt;color-interpolation-method> to all gradient functions

<!-- CSS Images 3 tests -->
<wpt hidden>
	animation/image-no-interpolation.html
	animation/object-position-composition.html
	animation/object-position-interpolation.html
	animation/object-view-box-interpolation.html
	animation/image-slice-interpolation-math-functions-tentative.html
	image-fit-001.xht
	image-fit-006.xht
	image-orientation/image-orientation-background-image.html
	image-orientation/image-orientation-background-position.html
	image-orientation/image-orientation-background-properties-border-radius.html
	image-orientation/image-orientation-background-properties.html
	image-orientation/image-orientation-border-image.html
	image-orientation/image-orientation-cursor.html
	image-orientation/image-orientation-default.html
	image-orientation/image-orientation-exif-png.html
	image-orientation/image-orientation-from-image-composited-dynamic1.html
	image-orientation/image-orientation-from-image-composited-dynamic2.html
	image-orientation/image-orientation-from-image-composited.html
	image-orientation/image-orientation-from-image-computed-style.html
	image-orientation/image-orientation-from-image-content-images.html
	image-orientation/image-orientation-from-image-dynamic1.html
	image-orientation/image-orientation-from-image-dynamic2.html
	image-orientation/image-orientation-from-image-embedded-content.html
	image-orientation/image-orientation-from-image.html
	image-orientation/image-orientation-iframe.html
	image-orientation/image-orientation-img-object-fit.html
	image-orientation/image-orientation-list-style-image.html
	image-orientation/image-orientation-mask-image.html
	image-orientation/image-orientation-none-computed-style.html
	image-orientation/image-orientation-none-content-images.html
	image-orientation/image-orientation-none-cross-origin-canvas.html
	image-orientation/image-orientation-none-cross-origin-svg.html
	image-orientation/image-orientation-none-cross-origin.html
	image-orientation/image-orientation-none-image-document.html
	image-orientation/image-orientation-none.html
	image-orientation/image-orientation-exif-png-2.html
	image-orientation/image-orientation-exif-png-3.html
	image-orientation/svg-image-orientation-aspect-ratio.html
	image-orientation/svg-image-orientation-none.html
	image-orientation/svg-image-orientation.html
	image-rendering-border-image.html
	image-rendering-mixed-scaled.html
	object-position-png-001c.html
	object-position-png-001e.html
	object-position-png-001i.html
	object-position-png-001o.html
	object-position-png-001p.html
	object-position-png-002c.html
	object-position-png-002e.html
	object-position-png-002i.html
	object-position-png-002o.html
	object-position-png-002p.html
	object-position-svg-001e.html
	object-position-svg-001i.html
	object-position-svg-001o.html
	object-position-svg-001p.html
	object-position-svg-002e.html
	object-position-svg-002i.html
	object-position-svg-002o.html
	object-position-svg-002p.html
	object-view-box-contain-intrinsic-size.html
	object-view-box-empty-bounds.html
	object-view-box-fit-contain-canvas.html
	object-view-box-fit-contain-img.html
	object-view-box-fit-contain-svg.html
	object-view-box-fit-contain-video.html
	object-view-box-fit-cover-canvas.html
	object-view-box-fit-cover-img.html
	object-view-box-fit-cover-svg.html
	object-view-box-fit-cover-video.html
	object-view-box-fit-fill-canvas.html
	object-view-box-fit-fill-img.html
	object-view-box-fit-fill-svg.html
	object-view-box-fit-fill-video.html
	object-view-box-fit-none-canvas.html
	object-view-box-fit-none-img.html
	object-view-box-fit-none-svg.html
	object-view-box-fit-none-video.html
	object-view-box-iframe.html
	object-view-box-negative-bounds.html
	object-view-box-parsing.html
	object-view-box-property-changed.html
	object-view-box-rect-auto.html
	object-view-box-rect-percentage.html
	object-view-box-rect.html
	object-view-box-same-size.html
	object-view-box-size-containment.html
	object-view-box-svg-img-no-size.html
	object-view-box-transition-mutation.html
	object-view-box-writing-mode-canvas.html
	object-view-box-writing-mode-img.html
	object-view-box-writing-mode-svg.html
	object-view-box-writing-mode-video.html
	object-view-box-xywh-percentage.html
	object-view-box-xywh.html
	svg-images-are-ignored.html
	svg-script-is-ignored.html
	parsing/image-orientation-computed.html
	parsing/image-orientation-invalid.html
	parsing/image-orientation-valid.html
	parsing/image-rendering-computed.html
	parsing/image-rendering-invalid.html
	parsing/image-rendering-valid.html
	parsing/image-resolution-invalid.html
	parsing/image-resolution-valid.html
	parsing/object-position-computed.html
	parsing/object-position-invalid.html
	parsing/object-position-valid.html
</wpt>

<!-- CSS Values 4 test, empty url, on background-image -->
<wpt hidden>
	empty-background-image.html
</wpt>
