<pre class='metadata'>
Title: CSS Images Module Level 3
Status: ED
Shortname: css-images
Level: 3
Group: csswg
ED: https://drafts.csswg.org/css-images-3/
TR: https://www.w3.org/TR/css-images-3/
Work Status: Testing
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 3 relating to the <<image>> type and some replaced elements.
	It includes and extends the functionality of CSS level 2 [[CSS2]].
	The main extensions compared to CSS2.1 are the generalization of the <<url>> type to the <<image>> type,
	several additions to the <<image>> type, a generic sizing algorithm for images and other replaced content in CSS,
	definitions for interpolating several <<image>> types,
	and several properties controlling the interaction of replaced elements and CSS's layout models.
At Risk: 'image-orientation'
Implementation Report: https://wpt.fyi/results/css/css-images?label=experimental&label=master&aligned
Previous Version: https://www.w3.org/TR/2019/CR-css-images-3-20191010/
Previous Version: https://www.w3.org/TR/2012/CR-css3-images-20120417/
Ignored Terms: <offset>, background positioning area, border image area, <meetorslice>, <ending-shape>
Ignored Vars: start image, end image
Include Can I Use Panels: yes
WPT Path Prefix: css/css-images/
WPT Display: open
</pre>
<pre class=link-defaults>
spec:css-backgrounds-3;
	type:property;
		text:border-image
		text:border-image-repeat
	type:value; text:center
</pre>

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

	In CSS Levels 1 and 2,
	image values, such as those used in the 'background-image' property,
	could only be given by a single URL value.
	This module introduces additional ways of representing 2D images,
	for example as <a section href="#gradients">a gradient</a>.

	This module also defines several properties for <a section href="#image-processing">manipulating raster images</a>
	and for <a section href="#the-object-fit">sizing</a>
	or <a section href="#the-object-position">positioning</a>
	replaced elements such as images within the box determined by the CSS layout algorithms.
	It also defines in a generic way CSS's <a section href="#sizing">sizing algorithm</a> for images and other similar replaced elements.

	<em>This subsection (above) is not normative.</em>

Module Interactions {#placement}
--------------------------------

	This module defines and extends the <<image>> value type
	defined in [[!CSS-VALUES-3]].
	It also replaces the <<url>> type with <<image>>
	in the 'background-image', 'cursor', and 'list-style-image' definitions in CSS1 and CSS2
	and adds <<image>> as an alternative to <<url>>
	in the 'content' property's value.
	It is presumed that CSS specifications beyond CSS2.1
	will use the <<image>> notation in place of <<url>>
	where 2D images are expected.
	(See e.g. [[CSS3BG]].)

	None of the properties defined in this module, only 'image-rendering'
	applies to <code>::first-line</code> and <code>::first-letter</code>.

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 Level 2 Revision 1 [[!CSS2]].
	Other CSS modules may expand the definitions of these value types:
	for example [[CSS-VALUES-3]], when combined with this module,
	adds the ''initial'' keyword as a possible property value.

	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.

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

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

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

	<pre class="prod"><dfn>&lt;image></dfn> = <<url>> | <<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 References: the ''url()'' notation {#url-notation}
------------------------------------------------------------------------------------------

	The simplest way to indicate an image is to reference an image file by URL.
	This can be done with the ''url()'' notation, defined in [[CSS-VALUES-3]].

	<div class="example">
		In the example below, a background image is specified with ''url()''syntax:

		<pre>background-image: url(wavy.png);</pre>
	</div>

	If the UA cannot download, parse, or otherwise successfully display
	the contents at the URL as an image
	(i.e. if the image is not fully <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-imagebitmap-good">fully decodable</a>)
	it must be treated as an <a>invalid image</a>.

### Ambiguous Reference-or-Image URLs ### {#ambiguous-urls}

	URLs are used in many contexts for many types of resources,
	and therefore can be interpreted in many ways.
	Usually the context the URL appears in
	makes it clear how to interpret the resource,
	but in some instances
	it can be ambiguous.
	For example,
	a 'mask-image' <<url>> value pointing to an SVG file
	could be interpreted as a reference to an element in the file
	or as an <<image>>.

	An <dfn export for=CSS>ambiguous image URL</dfn> is
	a <<url>> value that can be interpreted
	as either an <<image>> or an element reference.
	If an [=ambiguous image URL=] is a [[CSS-VALUES-3#local-urls|fragment-only URL]],
	then it must be treated as an element reference.
	Otherwise, if the [=ambiguous image URL=] has a fragment
	that references an element in the resource
	that is an appropriate type of element for the context in which the <<url>> appears
	(such as a <{mask}> element for the 'mask-image' property),
	it is interpreted as an element reference.
	Otherwise, it is treated as an <<image>>.

	Specs using the [=ambiguous image URL=] concept
	must define what elements are valid references for the URL,
	and any additional conditions that might apply.

	<div class=example>
		For example,
		a reference like ''mask-image: url(icon.svg#foo)''
		might be pointing to a <code>&lt;mask id="foo"></code> element in the SVG document,
		<em>or</em> be pointing to a <code>&lt;g id="foo"></code> element
		and depending on the '':target'' pseudo-class to change how it renders as an image.

		When this occurs,
		the "icon.svg" file is loaded up and examined;
		if the #foo element is indeed a <{mask}>,
		the ''url()'' is treated as a reference to that element;
		otherwise,
		it's interpreted as an image.
	</div>

### Image Metadata ### {#url-metadata}

Images can contain metadata
such as color space, resolution and orientation
which specifies how to render the image.
Some image formats are flexible in where this metadata can be placed in the file;
however, if the metadata occurs <em>after</em> the actual image data,
it harms the UA's ability to “progressively decode” the image
and display it as the image's data streams in.

To reduce the impact of this issue:

* If the choice exists for a given image format, 
	authors <em>must</em> produce their images
	so that such metadata occurs before the image data in the image.
	(Note: This is the default for most images already.)
* User agents <em>should</em> ignore any layout-impacting metadata (such as orientation or resolution)
	that occurs after the image data begins.

	If a user agent cannot ignore the metadata based its location in the image
	(for example, if the decoder being used
	does not report where in the image the metadata was located),
	it <em>must</em> use the metadata in all cases.
	(In particular, it is not valid
	to use the metadata only when the image is "small"
	and the entire image is downloaded quickly,
	but to ignore it if the image is large
	and the metadata isn't downloaded until well after the image starts being displayed.)


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


Gradients {#gradients}
======================

	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()>>
	</pre>

	<div class=example>

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

		* <code>background: linear-gradient(white, gray);</code>
		* <code>list-style-image: radial-gradient(circle, #006, #00a 90%, #0000af 100%, white 100%)</code>
	</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=].

	<div class='example'>
		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 geometrically be 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}
------------------------------------------------------------------------

	A linear gradient is created by specifying a straight <a>gradient line</a>,
	and then several colors placed along that line.
	The image is constructed by creating an infinite canvas
	and painting it with lines perpendicular to the gradient line,
	with the color of the painted line being the color of the gradient line where the two intersect.
	This produces a smooth fade from each color to the next,
	progressing in the specified direction.

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

	The <dfn>linear-gradient()</dfn> notation
	specifies a linear gradient in CSS.
	Its syntax is as follows:

	<pre class=prod>
		<<linear-gradient()>> = linear-gradient( [ <<linear-gradient-syntax>> ] )

		<dfn>&lt;linear-gradient-syntax></dfn> = [ <<angle>> | <<zero>> | to <<side-or-corner>> ]? , <<color-stop-list>>

		<dfn>&lt;side-or-corner></dfn> = [left | right] || [top | bottom]
	</pre>

	The first argument to the function specifies the <a>gradient line</a>,
	which gives the gradient a direction and determines how color-stops are positioned.
	It may be omitted;
	if so, it defaults to ''to bottom''.

	The <a>gradient line's</a> direction may be specified in two ways:

	: using <<angle>>
	:: For the purpose of this argument,
		''0deg'' points upward,
		and positive angles represent clockwise rotation,
		so ''90deg'' point toward the right.

		The unit identifier may be omitted if the <<angle>> is zero.

	: using keywords
	:: If the argument is ''to top'', ''to right'', ''to bottom'', or ''to left'',
		the angle of the <a>gradient line</a> is ''0deg'', ''90deg'', ''180deg'', or ''270deg'', respectively.

		If the argument instead specifies a corner of the box such as ''to top left'',
		the <a>gradient line</a> must be angled such that it points into the same quadrant as the specified corner,
		and is perpendicular to a line intersecting the two neighboring corners of the <a>gradient box</a>.
		<span class='note'>This causes a color-stop at 50% to intersect the two neighboring corners (see <a href='#corner-gradient-example'>example</a>).</span>

	Starting from the center of the <a>gradient box</a>,
	extend a line at the specified angle in both directions.
	The ending point is the point on the <a>gradient line</a>
	where a line drawn perpendicular to the <a>gradient line</a>
	would intersect the corner of the <a>gradient box</a> in the specified direction.
	The starting point is determined identically, but in the opposite direction.

	Note: It is expected that the next level of this module will provide the ability to define the gradient's direction relative to the current text direction and writing-mode.

	<div class=example>
		<div style="overflow: hidden">
			<img src="images/gradient-diagram.png" width="454" height="455" style="float: right; margin-left: 1em;"
			     alt="[An image showing a box with a background shading gradually from white in the bottom-left corner to black in the top-right corner.  There is a line, illustrating the gradient line, angled at 45 degrees and passing through the center of the box.  The starting point and ending point of the gradient line are indicated by the intersection of the gradient line with two additional lines that pass through the bottom-left and top-right corners of the box.]">

			This example illustrates visually how to calculate the <a>gradient line</a> from the rules above.
			This shows the starting and ending point of the <a>gradient line</a>,
			along with the actual gradient,
			produced by an element with ''background: linear-gradient(45deg, white, black);''.

			Notice how, though the starting point and ending point are outside of the box,
			they're positioned precisely right so that the gradient is pure white <em>exactly</em> at the corner,
			and pure black <em>exactly</em> at the opposite corner.
			That's intentional, and will always be true for linear gradients.
		</div>
	</div>

	<div class='note'>
		Given:

		* <var>A</var> the angle (in any quadrant) defining the gradient line’s direction such that 0 degrees points upwards and positive angles represent clockwise rotation,
		* <var>W</var> the width of the gradient box,
		* <var>H</var> the height of the gradient box,

		The length of the gradient line (between the <a>starting point</a> and <a>ending point</a>) is:

		<code>abs(<var>W</var> * sin(<var>A</var>)) + abs(<var>H</var> * cos(<var>A</var>))</code>
	</div>

	The gradient's color stops are typically placed between
	the <a>starting point</a> and <a>ending point</a> on the <a>gradient line</a>,
	but this isn't required:
	the <a>gradient line</a> extends infinitely in both directions.
	The starting point and ending point are merely arbitrary location markers,
	the starting point defining where 0%, 0px, etc are located when specifying color-stops,
	and the ending point defines where 100% is located.
	Color-stops are allowed to have positions before 0% or after 100%.

	The color of a linear gradient at any point is determined
	by finding the unique line passing through that point that is perpendicular to the <a>gradient line</a>.
	The point's color is the color of the <a>gradient line</a>
	at the point where this line intersects it.


<h4 class='no-toc' id='linear-gradient-examples'>Linear Gradient Examples</h4>

	All of the following ''linear-gradient()'' examples are presumed to be backgrounds applied to a box that is 200px wide and 100px tall.

	<div class=example>
		Below are various ways of specifying a basic vertical gradient:

		<pre>
			linear-gradient(yellow, blue);
			linear-gradient(to bottom, yellow, blue);
			linear-gradient(180deg, yellow, blue);
			linear-gradient(to top, blue, yellow);
			linear-gradient(to bottom, yellow 0%, blue 100%);
		</pre>

		<img src="images/linear1.png" width="200" height="100" alt="">
	</div>

	<div class=example>
		This demonstrates the use of an angle in the gradient.
		Note that, though the angle is not exactly the same as the angle between the corners,
		the <a>gradient line</a> is still sized so as to make the gradient yellow exactly at the upper-left corner,
		and blue exactly at the lower-right corner.

		<pre>
			linear-gradient(135deg, yellow, blue);
			linear-gradient(-45deg, blue, yellow);
		</pre>

		<img src="images/linear3.png" width="200" height="100" alt="">
	</div>

	<div class=example>

		This demonstrates a 3-color gradient, and how to specify the location of a stop explicitly:

		<pre>linear-gradient(yellow, blue 20%, #0f0);</pre>

		<img src="images/linear4.png" width="200" height="100" alt="">
	</div>

	<div class=example id='corner-gradient-example'>
		This demonstrates a corner-to-corner gradient specified with keywords.
		Note how the gradient is red and blue exactly in the bottom-left and top-right corners, respectively,
		exactly like the second example.
		Additionally, the angle of the gradient is automatically computed so that the color at 50% (in this case, white)
		stretches across the top-left and bottom-right corners.

		<pre>linear-gradient(to top right, red, white, blue)</pre>

		<img src="images/gradient1.svg" width="200" height="100" alt="">
	</div>


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


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

	In a radial gradient,
	rather than colors smoothly fading from one side of the <a>gradient box</a> to the other
	as with linear gradients,
	they instead emerge from a single point
	and smoothly spread outward in a circular or elliptical shape.

	The <dfn>radial-gradient()</dfn> notation specifies a radial gradient
	by indicating the center of the gradient
	(where the 0% ellipse will be)
	and the size and shape of the <dfn>ending shape</dfn>
	(the 100% ellipse).
	Color stops are given as a list,
	just as for ''linear-gradient()''.
	Starting from the <a>gradient center</a>
	and progressing towards (and potentially beyond) the <a>ending shape</a>,
	uniformly-scaled concentric ellipses are drawn and colored
	according to the specified color stops.


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

	The radial gradient syntax is:

	<pre class=prod>
		<<radial-gradient()>> = radial-gradient( [ <<radial-gradient-syntax>> ] )

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

		<dfn>&lt;radial-size></dfn> = <<radial-extent>> | <<length [0,∞]>> | <<length-percentage [0,∞]>>{2}

		<dfn>&lt;radial-extent></dfn> = closest-corner | closest-side | farthest-corner | farthest-side

		<dfn>&lt;radial-shape></dfn> = circle | ellipse
	</pre>

	<div class=example>
		Here is an example of a circular radial gradient 5em wide
		and positioned with its center in the top left corner:

		<pre>radial-gradient(5em circle at top left, yellow, blue)</pre>
	</div>

	Note: A future level may add the ability to move the focus of the gradient,
	as in the original -webkit-gradient() function.
	See <a href="http://lists.w3.org/Archives/Public/www-style/2011Nov/0210.html">proposal</a>
	tracked in <a href="https://github.com/w3c/csswg-drafts/issues/1575">Issue 1575</a>
	for "from <<position>>" and "from offset <<offset>>".

	The arguments are defined as follows:

	<dl dfn-type=value dfn-for="radial-gradient(), repeating-radial-gradient()">
		<dt><dfn><<position>></dfn>
		<dd>
			Determines the <dfn dfn lt="gradient center">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 ''<position>/center''.

		<dt><dfn><<radial-shape>></dfn>
		<dd>
			Can be either <dfn value for="<radial-shape>">circle</dfn> or <dfn value for="<radial-shape>">ellipse</dfn>;
			determines whether the gradient's <a>ending shape</a> is a circle or an ellipse, respectively.
			If <<radial-shape>> is omitted,
			the <a>ending shape</a> defaults to a circle
			if the <<radial-size>> is a single <<length>>,
			and to an ellipse otherwise.

		<dt><dfn><<radial-size>></dfn>
		<dd>
			Determines the size of the gradient's <a>ending shape</a>.
			If omitted it defaults to ''farthest-corner''.
			It can be given explicitly or by keyword.
			For the purpose of the keyword definitions,
			consider the <a>gradient box</a> edges as extending infinitely in both directions,
			rather than being finite line segments.

			If the ending-shape is an ellipse,
			its axises are aligned with the horizontal and vertical axises.

			Both ''circle'' and ''ellipse'' gradients accept the following <<radial-extent>> values:

			<dl dfn-for="<radial-extent>, radial-gradient(), repeating-radial-gradient()">
				<dt><dfn>closest-side</dfn>
				<dd>
					The <a>ending shape</a> is sized so that
					it exactly meets the side of the <a>gradient box</a> closest to the gradient's center.
					If the shape is an ellipse,
					it exactly meets the closest side in each dimension.

				<dt><dfn>farthest-side</dfn>
				<dd>
					Same as ''closest-side'',
					except the <a>ending shape</a> is sized based on the farthest side(s).

				<dt><dfn>closest-corner</dfn>
				<dd>
					The <a>ending shape</a> is sized so that
					it passes through the corner of the <a>gradient box</a> closest to the gradient's center.
					If the shape is an ellipse,
					the <a>ending shape</a> is given the same aspect-ratio it would have if ''closest-side'' were specified.

				<dt><dfn>farthest-corner</dfn>
				<dd>
					Same as ''closest-corner'',
					except the <a>ending shape</a> is sized based on the farthest corner.
					If the shape is an ellipse,
					the <a>ending shape</a> is given the same aspect ratio it would have if ''farthest-side'' were specified.
			</dl>

			If <<radial-shape>> is specified as ''circle'' or is omitted,
			the <<radial-size>> may be given explicitly as:

			<dl>
				<dt><dfn for="<radial-size>, radial-gradient(), repeating-radial-gradient()">&lt;length [0,∞]></dfn>
				<dd>
					Gives the radius of the circle explicitly.
					Negative values are invalid.

					Note: Percentages are <em>not</em> allowed here;
					they can only be used to specify the size of an elliptical gradient,
					not a circular one.
					This restriction exists because there is are multiple reasonable answers as to which dimension the percentage should be relative to.
					A future level of this module may provide the ability to size circles with percentages,
					perhaps with more explicit controls over which dimension is used.

			</dl>

			If <<radial-shape>> is specified as ''ellipse'' or is omitted,
			<<radial-size>> may instead be given explicitly as:

			<dl>
				<dt><dfn for="<radial-size>, radial-gradient(), repeating-radial-gradient()"><<length-percentage [0,∞]>>{2}</dfn>
				<dd>
					Gives the size of the ellipse explicitly.
					The first value represents the horizontal radius,
					the second the vertical radius.
					Percentages values are relative to the corresponding dimension of the <a>gradient box</a>.
					Negative values are invalid.
			</dl>
	</dl>

	<div class='note'>
		Expanded with the above definitions,
		the grammar becomes:

		<pre>
			radial-gradient() = radial-gradient(
			  [ [ circle               || <<length [0,∞]>> ]                          [ at <<position>> ]? , |
			    [ ellipse              || <<length-percentage [0,∞]>>{2} ]            [ at <<position>> ]? , |
			    [ [ circle | ellipse ] || <<radial-extent>> ]                     [ at <<position>> ]? , |
			    at <<position>>,
			  ]?
			  <<color-stop-list>>
			)
		</pre>
	</div>


<h4 class="no-toc" id="radial-color-stops">Placing Color Stops</h4>

	Color-stops are placed on a <a>gradient line</a> shaped like a ray
	(a line that starts at one point, and extends infinitely in a one direction),
	similar to the <a>gradient line</a> of linear gradients.
	The <a>gradient line's</a> <a>starting point</a> is at the center of the gradient,
	and it extends toward the right,
	with the <a>ending point</a> on the point where the <a>gradient line</a> intersects the <a>ending shape</a>.
	A color-stop can be placed at a location before 0%;
	though the negative region of the <a>gradient line</a> is never directly consulted for rendering,
	color stops placed there can affect the color of non-negative locations on the <a>gradient line</a> through interpolation or repetition
	(see <a section href='#repeating-gradients'>repeating gradients</a>).
	For example, ''radial-gradient(red -50px, yellow 100px)'' produces an elliptical gradient
	that starts with a reddish-orange color in the center
	(specifically, #f50)
	and transitions to yellow.
	Locations greater than 100% simply specify a location a correspondingly greater distance from the center of the gradient.

	The color of the gradient at any point is determined by
	first finding the unique ellipse passing through that point
	with the same center, orientation, and ratio between major and minor axises as the ending-shape.
	The point's color is then the color of the positive section of the <a>gradient line</a> at the location where this ellipse intersects it.

<h4 class="no-toc" id="degenerate-radials">Degenerate Radial Gradients</h4>

	Some combinations of position, size, and shape
	will produce a circle or ellipse with a radius of 0.
	This will occur, for example,
	if the center is on a <a>gradient box</a> edge and ''closest-side'' or ''closest-corner'' is specified
	or if the size and shape are given explicitly and either of the radiuses is zero.
	In these degenerate cases,
	the gradient must be rendered as follows:

	: If the <a>ending shape</a> is a circle with zero radius:
	:: Render as if the <a>ending shape</a> was
		a circle whose radius was an arbitrary very small number greater than zero.
		<span class='note'>This will make the gradient continue to look like a circle.</span>

	: If the <a>ending shape</a> has zero width (regardless of the height):
	:: Render as if the <a>ending shape</a> was
		an ellipse whose height was an arbitrary very large number
		and whose width was an arbitrary very small number greater than zero.
		<span class='note'>This will make the gradient look similar to a horizontal linear gradient
		that is mirrored across the center of the ellipse.
		It also means that all color-stop positions specified with a percentage resolve to ''0px''.</span>

	: Otherwise, if the <a>ending shape</a> has zero height:
	:: Render as if the <a>ending shape</a> was
		an ellipse whose width was an arbitrary very large number
		and whose height was an arbitrary very small number greater than zero.
		<span class='note'>This will make the gradient look like a solid-color image
		equal to the color of the last color-stop,
		or equal to the average color of the gradient if it's repeating.</span>


<h4 class='no-toc' id='radial-gradient-examples'>Radial Gradient Examples</h4>

	All of the following examples are applied to a box that is 200px wide and 100px tall.

	<div class=example>
		These examples demonstrate different ways to write the basic syntax for radial gradients:

		<pre>
			radial-gradient(yellow, green);
			radial-gradient(ellipse at center, yellow 0%, green 100%);
			radial-gradient(farthest-corner at 50% 50%, yellow, green);
		</pre>

		<img src="images/radial1.png" width="200" height="100" alt="">

		<pre>radial-gradient(circle, yellow, green);</pre>

		<img src="images/radial2.png" width="200" height="100" alt="">
		<pre>radial-gradient(red, yellow, green);</pre>

		<img src="images/radial3.png" width="200" height="100" alt="">
	</div>

	<div class=example>
		This image shows a gradient originating from somewhere other than the center of the box:

		<pre>radial-gradient(farthest-side at left bottom, red, yellow 50px, green);</pre>

		<img src="images/radial4.png" width="200" height="100" alt="">
	</div>

	<div class=example>
		Here we illustrate a ''closest-side'' gradient.

		<pre>
			radial-gradient(closest-side at 20px 30px, red, yellow, green);
			radial-gradient(20px 30px at 20px 30px, red, yellow, green);
		</pre>

		<img src="images/radial6.png" width="200" height="100" alt="">

		<pre>
			radial-gradient(closest-side circle at 20px 30px, red, yellow, green);
			radial-gradient(20px 20px at 20px 30px, red, yellow, green);
		</pre>

		<img src="images/radial7.png" width="200" height="100" alt="">
	</div>

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

Repeating Gradients: the ''repeating-linear-gradient()'' and ''repeating-radial-gradient()'' notations {#repeating-gradients}
------------------------------------------------------------------------------------------------------

	In addition to ''linear-gradient()'' and ''radial-gradient()'',
	this specification defines <dfn caniuse="css-repeating-gradients">repeating-linear-gradient()</dfn>
	and <dfn>repeating-radial-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-linear-gradient()>> = repeating-linear-gradient( [ <<linear-gradient-syntax>> ] )
		<<repeating-radial-gradient()>> = repeating-radial-gradient( [ <<radial-gradient-syntax>> ] )
	</pre>

	When rendered, however, the color-stops are repeated infinitely in both directions,
	with their positions shifted by multiples of the difference between
	the last specified color-stop's position
	and the first specified color-stop's position.
	For example, ''repeating-linear-gradient(red 10px, blue 50px)''
	is equivalent to ''linear-gradient(..., red -30px, blue 10px, red 10px, blue 50px, red 50px, blue 90px, ...)''.
	Note that the last color-stop and first color-stop will always coincide at the boundaries of each group,
	which will produce sharp transitions if the gradient does not start and end with the same color.

	<div class=example>
		Repeating gradient syntax is identical to that of non-repeating gradients:

		<pre>repeating-linear-gradient(red, blue 20px, red 40px)</pre>
		<img src="images/repeating1.png" width="200" height="100" alt="">

		<pre>repeating-radial-gradient(red, blue 20px, red 40px)</pre>
		<img src="images/repeating2.png" width="200" height="100" alt="">

		<pre>repeating-radial-gradient(circle closest-side at 20px 30px, red, yellow, green 100%, yellow 150%, red 200%)</pre>
		<img src="images/repeating3.png" width="200" height="100" alt="">

	</div>

	If the distance between the first and last color-stops is non-zero,
	but is small enough that the implementation knows that the physical resolution of the output device is insufficient to faithfully render the gradient,
	the implementation must <a lt="gradient-average-color">find the average color of the gradient</a>
	and render the gradient as a solid-color image equal to the average color.

	If the distance between the first and last color-stops is zero
	(or rounds to zero due to implementation limitations),
	the implementation must <a lt="gradient-average-color">find the average color of a gradient</a>
	with the same number and color of color-stops,
	but with the first and last color-stop an arbitrary non-zero distance apart,
	and the remaining color-stops equally spaced between them.
	Then it must render the gradient as a solid-color image equal to that average color.

	If the width of the ending shape of a repeating radial gradient is non-zero
	and the height is zero,
	or is close enough to zero that the implementation knows that the physical resolution of the output device is insufficient to faithfully render the gradient,
	the implementation must <a lt="gradient-average-color">find the average color of the gradient</a>
	and render the gradient as a solid-color image equal to the average color.

	Note: The <a section href="#degenerate-radials">Degenerate Radial Gradients</a> section
	describes how the ending shape is adjusted when its width is zero.

	To <dfn lt="gradient-average-color">find the average color of a gradient</dfn>,
	run these steps:

	1. Define <var>list</var> as an initially-empty list of premultiplied RGBA colors,
		and <var>total-length</var> as the distance between first and last color stops.

	2. For each adjacent pair of color-stops,
		define <var>weight</var> as half the distance between the two color-stops,
		divided by <var>total-length</var>.
		Add two entries to <var>list</var>,
		the first obtained by representing the color of the first color-stop in premultiplied sRGBA
		and scaling all of the components by <var>weight</var>,
		and the second obtained in the same way with the second color-stop.

	3. Sum the entries of <var>list</var> component-wise to produce the average color,
		and return it.

	Note: As usual, implementations may use whatever algorithm they wish,
	so long as it produces the same result as the above.

	<div class='example'>
		For example, the following gradient is rendered as a solid light-purple image (equal to <code>rgb(75%,50%,75%)</code>):

		<pre class="css">repeating-linear-gradient(red 0px, white 0px, blue 0px);</pre>

		The following gradient would render the same as the previous under normal circumstances
		(because desktop monitors can't faithfully render color-stops 1/10th of a pixel apart),
		but would render as a normal repeating gradient if, for example,
		the author applied "zoom:100;" to the element on which the gradient appears:

		<pre class="css">repeating-linear-gradient(red 0px, white .1px, blue .2px);</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>> <<length-percentage>>?
		<dfn>&lt;linear-color-hint></dfn> = <<length-percentage>>
	</pre>

	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 two <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 <a href="#premultiplied">premultiplied RGBA space</a>.

	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.

	Issue: Add a visual example of a color hint being used.

	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.

	<details class=note id=premultiplied>
		<summary>What does “pre-multiplied” mean?</summary>

		A “pre-multiplied” color
		is written in a form
		where the alpha channel
		is multiplied into the color channels,
		rather than being processed independently.
		For example, a partially-transparent blue may be given as <code class=lang-css><nobr>rgba(0, 0, 255, .5)</nobr></code>,
		which would then be expressed as <code><nobr>[0, 0, 127.5, .5]</nobr></code> in its premultiplied representation.

		Interpolating colors using the premultiplied representations
		rather than the plain rgba representations
		tends to produce more attractive transitions,
		particularly when transitioning from a fully opaque color to fully transparent.

		Note that transitions where either the transparency or the color are held constant
		(for example, transitioning between <code class=lang-css><nobr>rgba(255, 0, 0, 100%)</nobr></code> (opaque red)
		and <code class=lang-css><nobr>rgba(0,0,255,100%)</nobr></code> (opaque blue),
		or <code class=lang-css><nobr>rgba(255,0,0,100%)</nobr></code> (opaque red)
		and <code class=lang-css><nobr>rgba(255,0,0,0%)</nobr></code> (transparent red))
		have identical results whether the color interpolation is done in premultiplied or non-premultiplied color-space.
		Differences only arise when <em>both</em> the color and transparency differ between the two endpoints.

		<div class=example>
			The following example illustrates the difference between
			a gradient transitioning in pre-multiplied sRGBA
			and one transitioning (incorrectly) in non-premultiplied.
			In both of these example,
			the gradient is drawn over a white background.
			Both gradients could be written with the following value:

			<pre>linear-gradient(90deg, red, transparent, blue)</pre>

			With premultiplied colors,
			transitions to or from "transparent" always look nice:

			<object data="images/gradient2.svg" width="200" height="100">(Image requires SVG)</object>

			On the other hand,
			if a gradient were to incorrectly transition in non-premultiplied space,
			the center of the gradient would be a noticeably grayish color,
			because "transparent" is actually a shorthand for ''rgba(0,0,0,0)'', or transparent black,
			meaning that the red transitions to a black
			as it loses opacity,
			and similarly with the blue's transition:

			<object data="images/gradient3.svg" width="200" height="100">(Image requires SVG)</object>
		</div>

	</details>



<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.

	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>
		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>



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


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

	Images used in CSS may come from a number of sources:
	from binary image formats (such as gif, jpeg, etc),
	dedicated markup formats (such as SVG),
	and CSS-specific formats (such as the linear-gradient() value type defined in this specification).
	As well, a document may contain many other types of objects,
	such as video, plugins, or nested documents.
	These images and objects
	(just <dfn noexport local-lt=object>objects</dfn> hereafter)
	may offer many types of sizing information to CSS,
	or none at all.
	This section defines generically the size negotiation model between the object and the CSS layout algorithms.


Object-Sizing Terminology {#sizing-terms}
-----------------------------------------

	In order to define this handling,
	we define a few terms,
	to make it easier to refer to various concepts:

	<dl export>
		<dt><dfn id="natural-dimensions" oldids="intrinsic-dimensions" lt="natural dimension">natural dimensions</dfn>
		<dd>
			The term [=natural dimensions=] refers to the set of
			the <dfn oldids="intrinsic-height">natural height</dfn>,
			<dfn oldids="intrinsic-width">natural width</dfn>,
			and <dfn oldids="intrinsic-aspect-ratio">natural aspect ratio</dfn>
			(the ratio between the width and height),
			each of which may or may not exist for a given [=object=].
			These natural dimensions represent the preferred sizing intrinsic to the object itself;
			that is, they are not a function of the context in which the object is used.
			CSS does not define how the natural dimensions are found in general.

			Raster images are an example of an [=object=] with all three natural dimensions.
			SVG images designed to scale might have only a [=natural aspect ratio=];
			SVG images can also be created with only a [=natural width=] or [=natural height|height=].
			CSS gradients, defined in this specification,
			are an example of an object with no [=natural dimensions=] at all.
			Another example of this is embedded documents,
			such as the <{iframe}> element in HTML.
			Many [=objects=], such as most images,
			cannot have only two [=natural dimensions=],
			as any two automatically define the third.
			However some types of replaced elements,
			such as form controls,
			can have a [=natural width=] and a [=natural height=],
			but no [=natural aspect ratio=].

			If an [=object=] has a [=degenerate ratio|degenerate=] [=natural aspect ratio=]
			(at least one part being zero or infinity),
			it is treated as having no [=natural aspect ratio=].

			If an [=object=] (such as an icon) has multiple sizes,
			then the largest size (by area) is taken as its [=natural dimensions=].
			If it has multiple aspect ratios at that size,
			or has multiple aspect ratios and no size,
			then the aspect ratio closest to the aspect ratio of the <a>default object size</a> is used.
			Determine this by seeing which aspect ratio produces the largest area
			when fitting it within the <a>default object size</a> using a <a>contain constraint</a> fit;
			if multiple sizes tie for the largest area,
			the widest size is chosen as its [=natural dimensions=].

			The [=natural width=] and [=natural height=]
			are collectively referred to the <dfn lt="natural size">natural sizes</dfn>.

		<dt><dfn>specified size</dfn>
		<dd>
			The specified size of an [=object=] is given by CSS,
			such as through the 'width' and 'height' or 'background-size' properties.
			The specified size can be a definite width and height,
			a set of constraints,
			or a combination thereof.

		<dt><dfn>concrete object size</dfn>
		<dd>
			The <a>concrete object size</a> is the result of combining
			an [=object’s=] [=natural dimensions=] and [=specified size=]
			with the <a>default object size</a> of the context it's used in,
			producing a rectangle with an absolute width and height.

		<dt><dfn>default object size</dfn>
		<dd>
			The <a>default object size</a> is a rectangle with an absolute height and width
			used to determine the <a>concrete object size</a>
			when both the [=natural dimensions=] and [=specified size=] are missing dimensions.

	</dl>


CSS⇋Object Negotiation {#object-negotiation}
--------------------------------------------

	[=Objects=] in CSS are sized and rendered by the <dfn export>object size negotiation</dfn> algorithm as follows:

	1. When an [=object=] is specified in a document,
		such as through a ''url()'' value in a 'background-image' property
		or a <{img/src}> attribute on an <{img}> element,
		CSS queries the object for its [=natural dimensions=].

	2. Using the [=natural dimensions=],
		the <a>specified size</a>,
		and the <a>default object size</a> for the context the [=object=] is used in,
		CSS then computes a <a>concrete object size</a>.
		(See the <a section href="#default-sizing">following section</a>.)
		This defines the size and position of the region the [=object=] will render in.

	3. CSS asks the [=object=] to render itself at the <a>concrete object size</a>.
		CSS does not define how [=objects=] render
		when the [=concrete object size=] is different
		from the [=object’s=] [=natural dimensions=].
		The [=object=] may adjust itself to match the <a>concrete object size</a> in some way,
		or even render itself larger or smaller than the <a>concrete object size</a> to satisfy sizing constraints of its own.

	4. Unless otherwise specified by CSS,
		the [=object=] is then clipped to the <a>concrete object size</a>.


Concrete Object Size Resolution {#concrete-size-resolution}
-----------------------------------------------------------

	Currently the rules for sizing [=objects=] are described in each context that such [=objects=] are used.
	This section defines some common sizing constraints
	and how to resolve them
	so that future specs can refer to them instead of redefining size resolution in each instance.

	<wpt>
		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
		animation/object-view-box-interpolation.html
	</wpt>

### Default Sizing Algorithm ### {#default-sizing}

	The <dfn export>default sizing algorithm</dfn> is a set of rules commonly used to find an [=object’s=] <a>concrete object size</a>.
	It resolves the simultaneous constraints presented by the [=object’s=] [=natural dimensions=]
	and either an unconstrained <a>specified size</a>
	or one consisting of only a definite width and/or height.

	Some [=object=] sizing rules
	(such as those for 'list-style-image')
	correspond exactly to the <a>default sizing algorithm</a>.
	Others
	(such as those for 'border-image')
	invoke the default sizing algorithm
	but also apply additional sizing rules before arriving at a final <a>concrete object size</a>.

	The <a>default sizing algorithm</a> is defined as follows:

	* If the <a>specified size</a> is a definite width and height,
		the <a>concrete object size</a> is given that width and height.

	* If the <a>specified size</a> is only a width or height (but not both)
		then the <a>concrete object size</a> is given that specified width or height.
		The other dimension is calculated as follows:

		1. If the [=object=] has a [=natural aspect ratio=],
			the missing dimension of the <a>concrete object size</a>
			is calculated using that aspect ratio and the present dimension.

		2. Otherwise, if the missing dimension is present in the object's [=natural dimensions=],
			the missing dimension is taken from the [=object’s=] [=natural dimensions=].

		3. Otherwise, the missing dimension of the <a>concrete object size</a> is taken from the <a>default object size</a>.

	* If the <a>specified size</a> has no constraints:

		1. If the [=object=] has a [=natural dimensions|natural=] height or width,
			its size is resolved as if its [=natural dimensions=] were given as the <a>specified size</a>.

		2. Otherwise, its size is resolved as a <a>contain constraint</a> against the <a>default object size</a>.

### Cover and Contain Constraint Sizing ### {#cover-contain}

	Two other common specified sizes are the <a>contain constraint</a> and the <a>cover constraint</a>,
	both of which are resolved against a specified <dfn export>constraint rectangle</dfn>
	using the [=object’s=] [=preferred aspect ratio=]:

	* A <dfn export>contain constraint</dfn> is resolved
		by setting the [=concrete object size=] to the largest rectangle
		that has the [=object’s=] [=natural aspect ratio=]
		and additionally has neither width nor height larger than
		the constraint rectangle's width and height, respectively.

	* A <dfn export>cover constraint</dfn> is resolved
		by setting the [=concrete object size=] to the smallest rectangle
		that has the [=object’s=] [=natural aspect ratio=]
		and additionally has neither width nor height smaller than
		the constraint rectangle's width and height, respectively.

	In both cases,
	if the object doesn't have a [=natural aspect ratio=],
	the <a>concrete object size</a> is the specified constraint rectangle.

Examples of CSS Object Sizing {#object-sizing-examples}
-------------------------------------------------------

	<div class="example">
		The following examples show how the <a href="https://www.w3.org/TR/CSS2/">CSS 2.1</a>
		and <a href="https://www.w3.org/TR/css3-background/">CSS3 Backgrounds &amp; Borders</a> sizing algorithms
		correspond to concepts defined in this specification.

		<dl>
			<dt>'background-image'
			<dd>
				The rules for calculating the <a>concrete object size</a> of a background
				are defined in <a href="https://www.w3.org/TR/CSS2/colors.html#background-properties">CSS2.1§14.2.1</a>
				and <a href="https://www.w3.org/TR/css3-background/#the-background-size">CSS3BG§3.9</a>.
				CSS2.1 uses the <a>default sizing algorithm</a>
				with no <a>specified size</a>
				and the <a>background positioning area</a> as the <a>default object size</a>. [[!CSS2]]
				In CSS3, 'background-size' property can give a sizing constraint,
				invoking either the <a>default sizing algorithm</a>
				or one of the <a lt="contain constraint">contain</a> or <a lt="cover constraint">cover</a> constraints.
				The concrete object size is further adjusted in later steps if 'background-repeat' has a ''background-repeat/round'' value. [[CSS3BG]]

			<dt>'list-style-image'
			<dd>
				The rules for calculating the <a>concrete object size</a> of a list-style image
				are defined in <a href="https://www.w3.org/TR/CSS2/generate.html#propdef-list-style-image">CSS2.1§12.5.1</a>.
				They use the <a>default sizing algorithm</a>
				with no <a>specified size</a>
				and a <a>default object size</a> of 1em square.

			<dt>'border-image'
			<dd>
				Border images are sized twice:
				first the entire image is sized to determine the slice points,
				then the slices are sized to decorate the border.
				The first sizing operation is defined in <a href="https://www.w3.org/TR/css3-background/#the-border-image-slice">CSS3BG§6.2</a>
				and uses the <a>default sizing algorithm</a>
				with no <a>specified size</a>,
				and the <a href="https://www.w3.org/TR/css3-background/#border-image-area">border image area</a> as the <a>default object size</a>.
				The second operation is defined in <a href="https://www.w3.org/TR/css3-background/#border-image-process">CSS3BG§6.2</a>:
				the <a>default sizing algorithm</a> is used to determine an initial size for each slice
				with the corresponding <a>border image area</a> part as the default object size.
				By default the <a>specified size</a> matches this <a>default object size</a>;
				however the 'border-image-repeat' property can drop the specified size in one or more directions
				and may also apply an additional rounding step. [[CSS3BG]]


			<dt>'cursor'
			<dd>
				The rules for calculating the <a>concrete object size</a> of a cursor
				are defined in <a href="https://www.w3.org/TR/CSS2/ui.html#cursor-props">CSS2.1 § 18.1: Cursors</a>.
				The <a>default object size</a> is a UA-defined size
				that should be based on the size of a typical cursor on the UA's operating system.  [[!CSS2]]

			<dt>'content'
			<dd>
				Objects inserted via the CSS2.1 'content' property
				are anonymous <a href="https://www.w3.org/TR/CSS2/conform.html#replaced-element">replaced elements</a>,
				and are sized the same way. [[!CSS2]]
				Note that such anonymous elements have all their non-inherited properties (including 'width', 'height', etc.)
				set to their initial values.

			<dt><a href="https://www.w3.org/TR/CSS2/conform.html#replaced-element">replaced elements</a>
			<dd>
				<a href="https://www.w3.org/TR/CSS2/">CSS 2.1</a> defines the sizing of replaced elements
				(including those inserted as <a href="https://www.w3.org/TR/CSS2/generate.html#content">generated content</a> via 'content')
				in sections <a href="https://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">10.3.2</a>,
				<a href="https://www.w3.org/TR/CSS2/visudet.html#min-max-widths">10.4</a>,
				<a href="https://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height">10.6.2</a>,
				and <a href="https://www.w3.org/TR/CSS2/visudet.html#min-max-heights">10.7</a>. [[!CSS2]]
				The 'object-fit' property defined below defines how the <a>concrete object size</a> corresponds to the element's used width and height;
				by default they coincide.
		</dl>
	</div>

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

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

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

	<wpt>
		image-fit-001.xht
		image-fit-006.xht
	</wpt>

	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>contain</dfn>
		<dd>
			The replaced content is sized to maintain its [=natural 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.

		<dt><dfn>cover</dfn>
		<dd>
			The replaced content is sized to maintain its [=natural 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.

		<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>scale-down</dfn>
		<dd>
			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.
	</dl>

	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" width="488" height="116" 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'.
			The fifth value, ''scale-down'',
			in this case looks identical to ''object-fit/contain''.
		</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.

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

Positioning Objects: the 'object-position' property {#the-object-position}
--------------------------------------------------------------------------

	<pre class='propdef'>
	Name: object-position
	Value: <<position>>
	Initial: 50% 50%
	Applies to: replaced elements
	Inherited: no
	Percentages: refer to width and height of element itself
	Computed value: as for 'background-position'
	Animation type: as for 'background-position'
	Canonical Order: the horizontal component of the <<position>>, followed by the vertical component
	</pre>

	<wpt>
		animation/object-position-interpolation.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
		parsing/object-position-computed.html
		parsing/object-position-invalid.html
		parsing/object-position-valid.html
	</wpt>

	The 'object-position' property determines the alignment of the replaced element inside its box.
	The <<position>> value type
	(which is also used for 'background-position')
	is defined in [[!CSS-VALUES-3]],
	and is resolved using the <a>concrete object size</a> as the object area
	and the content box as the positioning area.

	Note: Areas of the box not covered by the replaced element will show the element's background.



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

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

<h3 id="the-image-orientation" caniuse="css-image-orientation">Orienting an Image on the Page: the 'image-orientation' property </h3>


	If a picture is taken with a camera turned on its side,
	or a document isn't positioned correctly within a scanner,
	the resultant image may be "sideways" or even upside-down.
	The 'image-orientation' property provides a way to apply an "out-of-band" rotation to image source data to correctly orient an image.

	<pre class='propdef'>
	Name: image-orientation
	Value: from-image | none | [ <<angle>> || flip ]
	Initial: from-image
	Applies to: all elements
	Inherited: yes
	Computed value: the specified keyword, or an <<angle>>, rounded and normalized (see text), plus optionally a ''flip'' keyword
	Animation type: discrete
	</pre>

	<wpt>
		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/svg-image-orientation-aspect-ratio.html
		image-orientation/svg-image-orientation-none.html
		image-orientation/svg-image-orientation.html
		image-orientation/image-orientation-exif-png-2.html
		image-orientation/image-orientation-exif-png-3.html
		parsing/image-orientation-computed.html
		parsing/image-orientation-invalid.html
		parsing/image-orientation-valid.html
	</wpt>

	<strong>This property is <em>optional</em> for implementations.</strong>

	This property specifies an orthogonal rotation
	to be applied to the element’s images
	before they are used in the document.
	It applies to content images
	(e.g. replaced elements and generated content)
	and image sources referenced by SVG elements
	(such as <{feImage}>),
	as well as to decorative images applied via CSS rules
	(such as 'background-image' and other <<image>> properties).
	It does not apply to the rendering of images outside the document,
	e.g. favicons in the UA’s navigation toolbars or menus, etc.

	Note: This property is not intended to specify layout transformations
	such as arbitrary rotation or flipping the image in the horizontal or vertical direction.
	(See [[CSS-TRANSFORMS-1]] for a feature designed to do that.)
	It is also not needed to correctly orient an image when printing in landscape versus portrait orientation,
	as that rotation is done as part of layout. (See [[CSS3PAGE]].)
	It should only be used to correct incorrectly-oriented images.

	Values have the following meanings:

	<dl dfn-type=value dfn-for=image-orientation>
		<dt><dfn>none</dfn>
		<dd>
			No additional rotation is applied:
			the image is oriented as encoded.

		<dt><dfn>from-image</dfn>
		<dd>
			If the image has an orientation specified in its metadata,
			such as EXIF,
			this value computes to the angle that the metadata specifies is necessary to correctly orient the image.
			If necessary, this angle is then rounded and normalized as described above for an <<angle>> value.
			If there is no orientation specified in its metadata,
			this value computes to ''image-orientation/none''.

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

		<dt><dfn lt="<angle>|flip"><<angle>> || flip</dfn>
		<dd>
			Positive <<angle>> values cause the image to be rotated to the right
			(in a clockwise direction),
			while negative values cause a rotation to the left.
			If the <<angle>> is omitted, it defaults to ''0deg''.

			If ''flip'' is specified,
			after rotation the image is flipped horizontally.

			This value only applies to content images;
			decorative images continue to behave as ''from-image''.
			This value is deprecated
			and is optional for implementations
			except those conforming to [[!CSS-PRINT]].

			Note: This value allows all 8 possible EXIF orientations
			that ''image-orientation/from-image'' can produce
			to be manually reproduced.

			The computed value of the property is calculated
			by rounding the <<angle>> to the nearest quarter turn,
			rounding towards positive infinity when that's ambiguous,
			then moduloing the value by ''1turn''
			(so that it lies in the half-open range [''0turn'', ''1turn'')).
	</dl>

	Values other than ''image-orientation/none'' and ''from-image'' are
	<em>optional</em> to implement and <em>deprecated</em> in CSS.

	All CSS layout and rendering processes use the image <em>after</em> rotation,
	exactly as if the image were originally encoded in its rotated form.
	This implies, for example:

	* The [=natural dimensions|natural=] height and width are derived
		from the rotated rather than the original image dimensions.
	* The height (width) property applies to
		the vertical (horizontal) dimension of the image,
		<em>after</em> rotation.
	* The hotspot coordinates of an image 'cursor'
		are relative to the image after rotation.
	* Border images (see 'border-image') are sliced after rotation.
	* Other transformations, such as those in [[CSS-TRANSFORMS-1]],
		are applied to the image <em>after</em> 'image-orientation' is applied.

	<div class="example">
		The following example rotates the image 90 degrees clockwise:

		<pre>
			img.ninety     { image-orientation: 90deg }
			...
			&lt;img class="ninety" src=...>
		</pre>

		The same effect could be achieved with, for example,
		an angle of -270deg or 450deg.
	</div>

	Note: This property previously used ''image-orientation/none'' as its initial value.
	It is believed that using ''from-image'' as the initial value
	will produce a generally better user experience,
	and minimal breakage,
	but future compat data as UAs attempt to make the change will confirm that.
	If that is confirmed, then it is likely that this property will be removed from CSS
	unless use cases other than “correct for incorrect orientation” are raised for its other values.

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

Determining How To Scale an Image: the 'image-rendering' property {#the-image-rendering}
----------------------------------------------------------------------------------------

	<pre class='propdef'>
	Name: image-rendering
	Value: auto | smooth | high-quality | pixelated | crisp-edges
	Initial: auto
	Applies to: all elements
	Inherited: yes
	Computed value: specified keyword
	Animation type: discrete
	</pre>

	<wpt>
		image-rendering-border-image.html
		image-rendering-mixed-scaled.html
		parsing/image-rendering-computed.html
		parsing/image-rendering-invalid.html
		parsing/image-rendering-valid.html
	</wpt>

	The 'image-rendering' property provides a hint to the user-agent
	about what aspects of an image are most important to preserve when the image is scaled,
	to aid the user-agent in the choice of an appropriate scaling algorithm.
	When specified on an element,
	it applies to all images given in properties for the element,
	such as background images,
	list-style images,
	or the content of replaced elements when they represent an image that must be scaled.
	The values of the 'image-rendering' property are interpreted as follows:

	<dl dfn-type=value dfn-for=image-rendering>
		<dt><dfn>auto</dfn>
		<dd>
			The scaling algorithm is UA-dependent.

		<dt><dfn>smooth</dfn>
		<dd>
			The image should be scaled with an algorithm that maximizes the appearance of the image.
			In particular, scaling algorithms that "smooth" colors are acceptable,
			such as bilinear interpolation.
			This is intended for images such as photos.

		<dt><dfn>high-quality</dfn>
		<dd>

			Identical to ''image-rendering/smooth'',
			but with a preference for higher-quality scaling.
			If system resources are constrained,
			images with ''high-quality'' should be prioritized over those with any other value,
			when considering which images to degrade the quality of
			and to what degree.

			<div class=note>
				This value <em>does not</em> prevent the image quality from being degraded
				when the system resources are constrained.
				It merely expresses a preference that these images should receive extra scaling resources
				relative to the ''image-rendering/auto'' images.
				If all images on the page have ''high-quality'' applied,
				it's equivalent to all of them having ''image-rendering/auto'' applied--
				they're all treated the same.

				To get the most value out of ''high-quality'',
				only apply it to the most important images on the page.
			</div>

		<dt><dfn>pixelated</dfn>
		<dd>

			The image is scaled in a way that preserves
			the pixelation of the original as much as possible,
			but allows minor smoothing as necessary to avoid distorting the image
			when the target size is not a clean multiple of the original.

			For each axis independently,
			first determine the integer multiple of its natural size
			that puts it closest to the target size
			and is greater than zero.
			Scale it to this integer-multiple-size using [=nearest neighbor=],
			then scale it the rest of the way to the target size as for ''smooth''.

			Note: At integer multiples of the natural size,
			this gives the same results as ''crisp-edges''.
			At non-integer multiples, this usually gives better visual results,
			even for pixel art,
			but it does incur a performance penalty
			due to the "two-step" rendering requirement.

		<dt><dfn caniuse="css-crisp-edges">crisp-edges</dfn>
		<dd>

			The image is scaled in a way that preserves contrast and edges,
			and which avoids smoothing colors or introducing blur to the image in the process.
			This is intended for images such as line drawings.

			The image <em>may</em> be scaled using [=nearest neighbor=]
			or any other UA-chosen algorithm
			that does not blur edges or blend colors from the source image.
			It can, however, detect diagonal or curved lines
			and render them as such
			(rather than as jagged-looking “giant pixels”).

			Note: If the new size is not an integer multiple of the original size,
			the [=nearest neighbor=] algorithm can introduce significant “aliasing” bugs;
			lines that were the same thickness in the original image
			might be a pixel thinner or thicker in the scaled image
			depending on where they appear,
			etc.
			For most purposes,
			''pixelated'' will produce a more suitable rendering than [=nearest neighbor=].
	</dl>

	Other than the first step of ''pixelated'',
	this property does not dictate any particular scaling algorithm to be used.
	For example, with ''image-rendering: auto'',
	a user agent could scale images with bilinear interpolation by default,
	switch to nearest-neighbor interpolation in high-load situations,
	and switch to a higher-quality scaling algorithm like Lanczos interpolation
	for static images that aren't moving or changing.

	<div class='example'>
		For example, given the following small image:

		<figure>
			<img src="images/pixel-art-small.gif" width="128" height="64" alt="">
			<figcaption>A small pixel-art image.</figcaption>
		</figure>

		Scaling it up 3x might look like the following,
		depending on the value of 'image-rendering':

		<figure>
			<img src="images/pixel-art-small.gif" width="384" height="192" alt="">
			<figcaption>The image scaled 3x with ''smooth''</figcaption>
		</figure>

		<figure>
			<img src="images/pixel-art-nn.png" width="384" height="192" alt="">
			<figcaption>The image scaled 3x with ''pixelated''</figcaption>
		</figure>

		<figure>
			<img src="images/pixel-art-smooth.png" width="384" height="192" alt="">
			<figcaption>
				The image scaled 3x with ''crisp-edges''
				interpreted with an edge-preserving algorithm.
				<br>
				(Interpreting as [=nearest neighbor=] would give
				the same results as ''pixelated'' in this case.)
			</figcaption>
		</figure>
	</div>

	<div algorithm>
		The <dfn>nearest neighbor</dfn> (or NN) image scaling algorithm
		treats the source image's pixels as literal rectangles of color
		on the source canvas,
		then colors each destination pixel
		by choosing one point in the pixel's area
		(usually either the center or top-left)
		and using the color of the corresponding point
		on the source canvas.

		<div class=note>
			When the target size is an integer multiple of the source,
			this results in “big pixels”,
			as if you'd merely zoomed in on the source image.
			When the target size is a non-integer multiple,
			it still produces crisp pixels
			entirely out of source-image colors
			(no blending or blurring),
			but can produce aliasing quirks
			where the “pixel grid” can appear somewhat irregular.

			For example, using [=nearest neighbor=] to scale up an image by 2.5x
			will result in each pixel of the source image
			being used for two or three pixels of the destination image,
			in an alternating fashion,
			while scaling an image down to 0.5x
			will skip every second pixel in the source image.
		</div>
	</div>

	<div class='example'>
		At 3x scaling as in the preceding example,
		both ''pixelated'' and pure [=nearest neighbor=] give identical results.
		At scale ratios between integer multiples,
		however,
		they'll act differently:

		<figure>
			<img src="images/pixel-art-small.gif" width="128" height="64" alt="">
			<figcaption>The same small pixel-art image as before</figcaption>
		</figure>

		<figure>
			<img src="images/pixel-art-nn.png" width="384" height="192" alt="">
			<figcaption>The image scaled 2.5x with ''pixelated''</figcaption>
		</figure>

		<figure>
			<img src="images/pixel-art-nn-2p5.png" width="384" height="192" alt="">
			<figcaption>
				The image scaled 2.5x with ''crisp-edges''
				interpreted as [=nearest neighbor=]
			</figcaption>
		</figure>

		The ''pixelated'' version maintains the overall <em>look</em> of simply scaling the pixels up,
		at the cost of <em>slight</em> blurring,
		though much less blurring than the ''smooth'' scaling gives.
		Meanwhile, [=nearest neighbor=] avoids introducing any blurring at all,
		at the cost of aliasing artifacts
		making the “pixels” look irregularly sized.
	</div>

	This property previously accepted the values ''optimizeSpeed'' and ''optimizeQuality''.
	These are now deprecated;
	a user agent must accept them as valid values
	but must treat them as having the same behavior as ''crisp-edges'' and ''smooth'' respectively,
	and authors must not use them.


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

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

	Interpolation of <<image>> values is not defined in this level.
	Implementations must abruptly transition them
	(at 50% transition progress, like other unsupported interpolations),
	unless otherwise defined by a future specification.

	Note: CSS Images Level 4 is expected to define specialized interpolation for gradients,
	and define that all other images interpolate by cross-fading.

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

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.

	<div class='example'>
		For example, a gradient specified as:

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

		must serialize as:

		<pre>linear-gradient(red, yellow, black 100px)</pre>
	</div>

<h2 class="no-num" id="privacy">
Privacy Considerations</h2>

This specification introduces no new privacy concerns.

<h2 class="no-num" id="security">
Security Considerations</h2>

This specification allows rendering of cross-origin images by default,
which exposes some information of those images programmatically--
specifically, the [=natural dimensions=] and resolution of those images.

<h2 class="no-num" id="acknowledgments">
Acknowledgments</h2>

Thanks to the Webkit team, Brad Kemper, Brian Manthos, and Alan Gresley
for their contributions to the definition of gradients; to Melinda Grant
for her work on 'object-fit', 'object-position', and 'image-orientation';
<!-- to Robert O'Callahan for the definition of ''element()'';  to
Michael Day, Håkon Lie, and Shinyu Murakami for 'image-resolution' -->
and to L. David Baron,
Kang-Hao Lu, Leif Arne Storset, Erik Dahlstrom, and Øyvind Stenhaug for
their careful review, comments, and corrections.

<h2 class="no-num" id="changes">
Changes</h2>

<h3 id="changes-20191010">
Changes Since the <a href="https://www.w3.org/TR/2019/CR-css-images-3-20191010/">10 October 2019 Candidate Recommendation</a></h3>

	Significant changes since the <a href="https://www.w3.org/TR/2023/CRD-css-images-3-20231218/">18 December 2023 CRD</a>:

	<!-- to 08 Nov 2024 -->
	* Allow just one color stop (<a href="https://github.com/w3c/csswg-drafts/issues/10092">Issue 10092</a>)
	* Separate 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>)
	* Remove non-normative note about color space metadata; prefer "image" to "file" (<a href="https://github.com/w3c/csswg-drafts/issues/10075">Issue 10075</a>)
	* No longer require image metadata to be at the start of the image, if the format doesn't allow it (<a href="https://github.com/w3c/csswg-drafts/issues/8543">Issue 8543</a>)

	Significant changes since the <a href="https://www.w3.org/TR/2020/CRD-css-images-3-20201217/">17 December 2020 CRD</a>:

	* Remove ''&&'' which allows reordering from <<linear-color-stop>>.
		(<a href="https://github.com/w3c/csswg-drafts/pull/8021">Issue 8021</a>)
	* Specify ''pixelated'' to use smooth scaling from a [=nearest neighbor=] scale to the nearest pixel multiple,
		in order to avoid distortion.
		(<a href="https://github.com/w3c/csswg-drafts/issues/5837">Issue 5837</a>)
	* Explicitly allow [=nearest neighbor=] as the implementation for ''crisp-edges'',
		since this is what implementations currently do.
		(<a href="https://github.com/w3c/csswg-drafts/issues/6038">Issue 6038</a>)
	* Various editorial / typo fixes in grammar productions.

	Significant changes since the <a href="https://www.w3.org/TR/2019/CR-css-images-3-20191010/">10 October 2019 CR</a>:

	* Define handling of degenerate aspect ratios
		(<a href="https://github.com/w3c/csswg-drafts/issues/4572">Issue 4572</a>)
	* Define that layout-affecting metadata occurring after the image data should be ignored
		(<a href="https://github.com/w3c/csswg-drafts/issues/5165">Issue 5165</a>)
	* Explicitly allow dithering in gradients
		(<a href="https://github.com/w3c/csswg-drafts/issues/4793">Issue 4793</a>)
	* Define that 'image-orientation' applies to both decorative and content images
		(<a href="https://github.com/w3c/csswg-drafts/issues/5245">Issue 5245</a>)
		<!--
		wpt/css/css-images/image-orientation/image-orientation-background-image.html
		wpt/css/css-images/image-orientation/image-orientation-border-image.html
		wpt/css/css-images/image-orientation/image-orientation-cursor.html
		wpt/css/css-images/image-orientation/image-orientation-list-style-image.html
		-->
	* Rename “intrinsic dimensions” to [=natural dimensions=] to avoid confusion with [=intrinsic sizes=].
		(<a href="https://github.com/w3c/csswg-drafts/issues/4961">Issue 4961</a>)

<h3 id="changes-20120407">
Changes Since the <a href="https://www.w3.org/TR/2012/CR-css3-images-20120417/">17 April 2012 Candidate Recommendation</a></h3>

	Major changes include:

	- The <css>image()</css> notation has been deferred to Level 4.
	- The <css>image-resolution</css> property has been deferred to Level 4.
	- The 'image-orientation' property has been marked as deprecated, optional, and at-risk. Additionally:
		- Added the ''from-image'' and ''image-orientation/none'' keywords
		- Added the <css>flip</css> values
		- <a href="https://github.com/w3c/csswg-drafts/issues/1206">Swapped to "mod then round" ordering.</a>
	- Added the 'image-rendering' property.
	- Moved the <<resolution>> type to [[CSS-VALUES-3]].
	- Better defined the handling of invalid and partially-loaded images.
	- Defined the general computed form of <<image>>.
	- Defined concept and handling of URLs that are ambiguous between being images or element references.
	- Defined that the unit can be omitted for zero angles in ''linear-gradient()'' due to compat.
	- Slightly clarified handling of degenerate repeating radial gradients.
	- Added [=transition hints=] to <<color-stop-list>>,
		and editorially rewrote section on gradient color stops to better accommodate the new prose.
	- Added "Canonical Order" and "Animation Type" to all property definition tables.
	- Defined interpolation and serialization of <<image>> values.
	- Various minor clarifications.

	A <a href="https://drafts.csswg.org/issues?spec=css-images-3&doc=cr-2012">Disposition of Comments</a> is available.

	
	<wpt hidden title="Level 4 tests">
		parsing/image-resolution-invalid.html
		parsing/image-resolution-valid.html
		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
		css-image-fallbacks-and-annotations.html
		css-image-fallbacks-and-annotations002.html
		css-image-fallbacks-and-annotations003.html
		css-image-fallbacks-and-annotations004.html
		css-image-fallbacks-and-annotations005.html
		cross-fade-basic.html
		cross-fade-computed-value.html
		cross-fade-legacy-crash.html
		cross-fade-natural-size.html
		cross-fade-premultiplied-alpha.html
		cross-fade-target-alpha.html
		gradients-with-border.html
		color-stop-currentcolor.html
		gradient-border-box.html
		gradient-button.html
		gradient-content-box.html
		linear-gradient-1.html
		linear-gradient-2.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
		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
		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-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
		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
		gradient-content-box.html
		gradient/color-stops-parsing.html
		gradients-with-transparent.html
		gradient/css-color-4-colors-default-to-oklab-gradient.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-none-interpolation.html
		gradient/legacy-color-gradient.html
		gradient/oklab-gradient.html
		gradient/srgb-gradient.html
		gradient/srgb-linear-gradient.html
		gradient/xyz-gradient.html
		gradient-move-stops.html
		gradient-nan-crash.html
		gradient-refcrash.html
		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
		gradient/color-scheme-dependent-color-stops.html
		gradient/gradient-single-stop-longer-hue-hsl.html
		gradient/gradient-single-stop-longer-hue-oklch.html
		gradient/repeating-gradient-hsl-and-oklch.html
		idlharness.html
		svg-images-are-ignored.html
		svg-script-is-ignored.html
		animation/image-no-interpolation.html
		animation/image-slice-interpolation-math-functions-tentative.html
		parsing/object-fit-computed.html
		parsing/object-fit-invalid.html
		parsing/object-fit-valid.html
	</wpt>

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