Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support zero dimension values for aspect-ratio #6529

Merged
merged 3 commits into from
May 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -26103,9 +26103,9 @@ interface <dfn>HTMLSourceElement</dfn> : <span>HTMLElement</span> {
environment">match the environment</span>.</p>

<p>The <span>source</span> element supports <span>dimension attributes</span>. These attributes
annevk marked this conversation as resolved.
Show resolved Hide resolved
can <span>map to the aspect-ratio property</span> as well as the rendered dimensions of
sibling <span>img</span> element, if <span>source</span> element's parent is a
<span>picture</span> element and <span>source</span> element's <span>source set</span> is
can <span>map to the aspect-ratio property (using dimension rules)</span> as well as the
rendered dimensions of sibling <span>img</span> element, if <span>source</span> element's parent
annevk marked this conversation as resolved.
Show resolved Hide resolved
is a <span>picture</span> element and <span>source</span> element's <span>source set</span> is
returned as a result of <span>update the source set</span> for that sibling
<span>img</span>.</p>

Expand Down Expand Up @@ -62620,7 +62620,7 @@ try {
<code>CanvasRenderingContext2D</code> APIs, and the source image's dimensions must be the <span
data-x="concept-video-intrinsic-width">intrinsic width</span> and <span
data-x="concept-video-intrinsic-height">intrinsic height</span> of the <span>media resource</span>
(i.e. after any aspect-ratio correction has been applied).</p>
(i.e., after any aspect-ratio correction has been applied).</p>

<p>When a <code>CanvasImageSource</code> object represents an <code>HTMLCanvasElement</code>, the
element's bitmap must be used as the source image.</p>
Expand Down Expand Up @@ -112822,7 +112822,15 @@ console.assert(container.firstChild instanceof SuperP);
<p>When the text below says that a pair of attributes <var>w</var> and <var>h</var> on an
element <var>element</var> <dfn>map to the aspect-ratio property</dfn>, it means that if
<var>element</var> has both attributes <var>w</var> and <var>h</var>, and parsing those
attributes' values using the <span>rules for parsing nonzero dimension values</span> doesn't
attributes' values using the <span>rules for parsing non-negative integers</span> doesn't
generate an error for either, then the user agent is expected to use the parsed integers as a
<span data-x="presentational hints">presentational hint</span> for the <span>'aspect-ratio'</span>
property of the form <code data-x="">auto <var>w</var> / <var>h</var></code>.</p>

<p>When the text below says that a pair of attributes <var>w</var> and <var>h</var> on an
element <var>element</var> <dfn>map to the aspect-ratio property (using dimension rules)</dfn>, it
means that if <var>element</var> has both attributes <var>w</var> and <var>h</var>, and parsing
those attributes' values using the <span>rules for parsing dimension values</span> doesn't
generate an error or return a percentage for either, then the user agent is expected to use the
parsed dimensions as a <span data-x="presentational hints">presentational hint</span> for the
<span>'aspect-ratio'</span> property of the form <code data-x="">auto
Expand Down Expand Up @@ -114485,21 +114493,26 @@ input[type=image i][align=bottom i], object[align=bottom i] {
data-x="concept-img-dimension-attribute-source">dimension attribute source</span> <span
data-x="maps to the dimension property">map to the dimension properties</span>
<span>'width'</span> and <span>'height'</span> on the <code>img</code> element respectively. They
similarly <span>map to the aspect-ratio property</span> of the <code>img</code> element.</p>
similarly <span>map to the aspect-ratio property (using dimension rules)</span> of the
<code>img</code> element.</p>

<p>The <code data-x="attr-dim-width">width</code> and <code data-x="attr-dim-height">height</code>
attributes on <code>embed</code>, <code>iframe</code>, <code>object</code> or <code>video</code>
attributes on <code>embed</code>, <code>iframe</code>, <code>object</code>, and <code>video</code>
elements, and <code>input</code> elements with a <code data-x="attr-input-type">type</code>
attribute in the <span data-x="attr-input-type-image">Image Button</span> state and that either
represents an image or that the user expects will eventually represent an image, <span
data-x="maps to the dimension property">map to the dimension properties</span>
<span>'width'</span> and <span>'height'</span> on the element respectively.</p>

<p>The <code data-x="attr-dim-width">width</code> and <code data-x="attr-dim-height">height</code>
attributes <span>map to the aspect-ratio property</span> on <code>img</code>, <code>canvas</code>,
and <code>video</code> elements, and <code>input</code> elements with a <code
attributes <span>map to the aspect-ratio property (using dimension rules)</span> on
<code>img</code> and <code>video</code> elements, and <code>input</code> elements with a <code
data-x="attr-input-type">type</code> attribute in the <span data-x="attr-input-type-image">Image
Button</span> state.
Button</span> state.</p>

<p>The <code data-x="attr-canvas-width">width</code> and <code
data-x="attr-canvas-height">height</code> attributes <span>map to the aspect-ratio property</span>
on <code>canvas</code> elements.</p>
</div>


Expand Down