Skip to content

Conversation

@zcorpan
Copy link
Member

@zcorpan zcorpan commented Aug 9, 2022

@zcorpan zcorpan mentioned this pull request Aug 9, 2022
3 tasks
@zcorpan
Copy link
Member Author

zcorpan commented Aug 11, 2022

This is blocking #8008

Copy link
Member

@domenic domenic left a comment

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

@zcorpan
Copy link
Member Author

zcorpan commented Aug 15, 2022

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

AFAICT that's the case.

@zcorpan
Copy link
Member Author

zcorpan commented Aug 15, 2022

@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
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
Copy link
Member Author

zcorpan commented Mar 8, 2023

@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
Copy link
Member

annevk commented Mar 8, 2023

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
Copy link
Member Author

zcorpan commented Mar 9, 2023

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

@annevk
Copy link
Member

annevk commented Mar 14, 2023

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
Copy link
Member Author

zcorpan commented Mar 14, 2023

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
Copy link
Member Author

zcorpan commented May 17, 2023

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
Copy link
Member

annevk commented May 22, 2023

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
Copy link
Member Author

zcorpan commented May 23, 2023

Added a note and rebased to resolve conflicts.

Copy link
Member

@annevk annevk left a comment

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.

@zcorpan
Copy link
Member Author

zcorpan commented May 24, 2023

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

@annevk
Copy link
Member

annevk commented May 25, 2023

@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
Copy link
Member Author

zcorpan commented May 25, 2023

@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

Development

Successfully merging this pull request may close these issues.

Update "intrinsic dimensions" terminology

5 participants