From 13bcfc1aa8a49b8ead6aed4b70771e765592cfec Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 25 Mar 2021 12:32:35 +0100 Subject: [PATCH 1/3] Support zero dimension values for aspect-ratio Also map to aspect-ratio consistently with how the attributes are parsed. Tests: https://github.com/web-platform-tests/wpt/pull/28229. Follow-up: #6528. Closes #4961 and closes #6527. --- source | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/source b/source index c127ef318d6..4de171560c1 100644 --- a/source +++ b/source @@ -26103,9 +26103,9 @@ interface HTMLSourceElement : HTMLElement { environment">match the environment.

The source element supports dimension attributes. These attributes - can map to the aspect-ratio property as well as the rendered dimensions of - sibling img element, if source element's parent is a - picture element and source element's source set is + can map to the aspect-ratio property (using dimension rules) as well as the + rendered dimensions of sibling img element, if source element's parent + is a picture element and source element's source set is returned as a result of update the source set for that sibling img.

@@ -62620,7 +62620,7 @@ try { CanvasRenderingContext2D APIs, and the source image's dimensions must be the intrinsic width and intrinsic height of the media resource - (i.e. after any aspect-ratio correction has been applied).

+ (i.e., after any aspect-ratio correction has been applied).

When a CanvasImageSource object represents an HTMLCanvasElement, the element's bitmap must be used as the source image.

@@ -112822,7 +112822,15 @@ console.assert(container.firstChild instanceof SuperP);

When the text below says that a pair of attributes w and h on an element element map to the aspect-ratio property, it means that if element has both attributes w and h, and parsing those - attributes' values using the rules for parsing nonzero dimension values doesn't + attributes' values using the rules for parsing non-negative integers doesn't + generate an error for either, then the user agent is expected to use the parsed integers as a + presentational hint for the 'aspect-ratio' + property of the form auto w / h.

+ +

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

+ similarly map to the aspect-ratio property (using dimension rules) of the + img element.

The width and height - attributes on embed, iframe, object or video + attributes on embed, iframe, object, and video elements, and input elements with a type attribute in the Image Button state and that either represents an image or that the user expects will eventually represent an image, 'width' and 'height' on the element respectively.

The width and height - attributes map to the aspect-ratio property on img, canvas, - and video elements, and input elements with a map to the aspect-ratio property (using dimension rules) on + img and video elements, and input elements with a type attribute in the Image - Button state. + Button state.

+ +

The width and height attributes map to the aspect-ratio property + on canvas elements.

From 3109994004339800ad1f1194d5f975ca04e26caf Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 11 May 2021 13:11:31 +0200 Subject: [PATCH 2/3] cleanup source sentence --- source | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source b/source index 4de171560c1..8b52756fb2f 100644 --- a/source +++ b/source @@ -26102,12 +26102,12 @@ interface HTMLSourceElement : HTMLElement { skip to the next source element if the value does not match the environment.

-

The source element supports dimension attributes. These attributes +

The source element supports dimension attributes. These attributes can map to the aspect-ratio property (using dimension rules) as well as the - rendered dimensions of sibling img element, if source element's parent - is a picture element and source element's source set is - returned as a result of update the source set for that sibling - img.

+ rendered dimensions of a sibling img element, if the source element's + parent is a picture element and the source element's source + set is returned as a result of update the source set for that sibling + img element.

The type attribute gives the type of the images in the source set, to allow the user agent to skip to the next source element From 846048ba150147750df4330b15ccaf0ad0751db9 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 12 May 2021 13:26:09 +0200 Subject: [PATCH 3/3] improve non-normative sentence --- source | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/source b/source index 8b52756fb2f..53324542dba 100644 --- a/source +++ b/source @@ -1977,7 +1977,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute making the experience more accessible and usable to the user.

User agents that are designated as supporting the suggested default rendering must, while so - designated, implement the rules the rendering section defines as the + designated, implement the rules the Rendering section defines as the behavior that user agents are expected to implement.

@@ -18524,7 +18524,7 @@ interface HTMLOListElement : HTMLElement { data-x="attr-ol-type">type
attribute.

For CSS user agents, a mapping for this attribute to the - 'list-style-type' CSS property is given in the rendering + 'list-style-type' CSS property is given in the Rendering section (the mapping is straightforward: the states above have the same names as their corresponding CSS values).

@@ -26102,12 +26102,11 @@ interface HTMLSourceElement : HTMLElement { skip to the next source element if the value does not match the environment.

-

The source element supports dimension attributes. These attributes - can map to the aspect-ratio property (using dimension rules) as well as the - rendered dimensions of a sibling img element, if the source element's - parent is a picture element and the source element's source - set is returned as a result of update the source set for that sibling - img element.

+

The source element supports dimension attributes. The + img element can use the width and height attributes of a source element, instead of + those on the img element itself, to determine its rendered dimensions and + aspect-ratio, as defined in the Rendering section.

The type attribute gives the type of the images in the source set, to allow the user agent to skip to the next source element @@ -32224,7 +32223,7 @@ interface HTMLVideoElement : HTMLMediaElement { that do not contain the video represent nothing.

In user agents that implement CSS, the above requirement can be implemented by - using the style rule suggested in the rendering section.

+ using the style rule suggested in the Rendering section.

The intrinsic width of a video element's playback area is the intrinsic width of the poster frame, if that is available and the @@ -57421,7 +57420,7 @@ interface HTMLDialogElement : HTMLElement { specified should not be shown to the user. This requirement may be implemented indirectly through the style layer. For example, user agents that support the suggested default rendering implement this requirement using the CSS rules described in the rendering section.

+ href="#rendering">Rendering section.

@@ -116533,7 +116532,7 @@ interface HTMLFrameElement : HTMLElement { data-x="dom-body-background">background
IDL attribute of the body element must reflect the element's background content attribute. (The background content is not - defined to contain a URL, despite rules regarding its handling in the rendering + defined to contain a URL, despite rules regarding its handling in the Rendering section above.)