Skip to content

Rename 'intrinsic dimensions' to 'natural dimensions' to match CSS - #8175

Merged
annevk merged 5 commits into
mainfrom
bocoup/rename-intrinsic-dimensions
May 26, 2023
Merged

annevk merged 5 commits into
mainfrom
bocoup/rename-intrinsic-dimensions

Conversation

@zcorpan

@zcorpan zcorpan commented Aug 9, 2022 •

Copy link
Copy Markdown
Member

@zcorpan zcorpan mentioned this pull request Aug 9, 2022
3 tasks done
@zcorpan

zcorpan commented Aug 11, 2022

Copy link
Copy Markdown
Member Author

This is blocking #8008

@domenic domenic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit I started skimming toward the middle, but this seems good... The only thing I worry about is if CSS's "natural width" = our definition of "natural width", or if it = our "density-corrected natural width".

Comment thread source Resolved
@domenic domenic added clarification Standard could be clearer topic: media Audio and video: media elements, text tracks, playback and controls topic: img Images: img, picture, srcset and sizes, image loading and decoding, and image maps labels Aug 12, 2022
@zcorpan

zcorpan commented Aug 15, 2022

Copy link
Copy Markdown
Member Author

if CSS's "natural width" = our definition of "natural width"

AFAICT that's the case.

@zcorpan

zcorpan commented Aug 15, 2022

Copy link
Copy Markdown
Member Author

@tabatkins would you like to review this, to verify it still makes sense from CSS's point of view?

@zcorpan
zcorpan requested a review from tabatkins August 15, 2022 15:39
@tabatkins

Copy link
Copy Markdown
Contributor

CSS isn't sufficiently well-specified here, but afaict we do intend for "natural dimensions" to refer to the density-corrected values. See, for example, https://w3c.github.io/csswg-drafts/css-images-4/#preferred-resolution. And in general we use "natural dimensions" when doing things like sizing, which definitely uses the density-corrected values or else it would be nonsensical.

@zcorpan

zcorpan commented Mar 8, 2023

Copy link
Copy Markdown
Member Author

@tabatkins density-corrected from information in the image, or from srcset?

HTML defines "density-corrected natural width and height" for images by dividing natural dimensions by current pixel density: https://whatpr.org/html/8175/ba579d7...74081ef/images.html#density-corrected-natural-width-and-height

@annevk

annevk commented Mar 8, 2023

Copy link
Copy Markdown
Member

The way natural dimensions read to me is as if they are in CSS pixels. Especially given the examples given. I don't think that's accurate for what we want here.

@zcorpan

zcorpan commented Mar 9, 2023

Copy link
Copy Markdown
Member Author

Yeah, same as "intrinsic dimensions" before. Why is it not what we want?

@annevk

annevk commented Mar 14, 2023

Copy link
Copy Markdown
Member

How would that make sense for https://html.spec.whatwg.org/#density-corrected-intrinsic-width-and-height, for instance? Or perhaps the problem is that it doesn't make sense today?

@zcorpan

zcorpan commented Mar 14, 2023 •

Copy link
Copy Markdown
Member Author

The width and height in step 1 are the width and height of the image in image pixels. Edit: reading the spec again, step 1 applies density correction from EXIF, and gives a number in CSS pixels.

Maybe there's a bug for the case where that is null, where the pixel density shouldn't be applied. Filed #9023

@zcorpan

zcorpan commented May 17, 2023

Copy link
Copy Markdown
Member Author

Maybe step 2 in https://html.spec.whatwg.org/#images-processing-model:preferred-density-corrected-dimensions should say "physical dimensions" (new term) instead of "natural dimensions" (or currently, "intrinsic dimensions"), defined as step 2 in https://html.spec.whatwg.org/#preparing-an-image-for-presentation:preferred-density-corrected-dimensions

the width and height obtained from req's image data, as defined by the relevant codec.

@annevk

annevk commented May 22, 2023

Copy link
Copy Markdown
Member

I don't think we should add a new term. It seems like "natural dimensions" would be correct for step 2, but some context as per #9023 in a note would help make it more understandable what is going on.

@zcorpan
zcorpan force-pushed the bocoup/rename-intrinsic-dimensions branch from 0dfca87 to 2912e87 Compare May 23, 2023 11:30
@zcorpan

zcorpan commented May 23, 2023

Copy link
Copy Markdown
Member Author

Added a note and rebased to resolve conflicts.

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This largely looks okay now, but I found a couple places that could be improved.

Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
@zcorpan

zcorpan commented May 24, 2023

Copy link
Copy Markdown
Member Author

@annevk thanks, fixed. I found some more "natural dimensions" that should be "density-corrected natural width and height" and fixed them also.

@annevk

annevk commented May 25, 2023

Copy link
Copy Markdown
Member

@zcorpan can we move the IDs to the <dfn>? If you're done with this PR I'm happy to do it before merging.

@zcorpan

zcorpan commented May 25, 2023

Copy link
Copy Markdown
Member Author

@annevk sure

@annevk
annevk merged commit e85c0bf into main May 26, 2023
@annevk
annevk deleted the bocoup/rename-intrinsic-dimensions branch May 26, 2023 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clarification Standard could be clearer topic: img Images: img, picture, srcset and sizes, image loading and decoding, and image maps topic: media Audio and video: media elements, text tracks, playback and controls

Development

Successfully merging this pull request may close these issues.

Update "intrinsic dimensions" terminology

4 participants