-
Notifications
You must be signed in to change notification settings - Fork 14
Reuse width/height attributes? #4
Comments
Hi, I am just trying to understand how to set the height and boolean attribute as suggested if I set width to be 100% of its containing block's width? Thanks |
Are you trying to accomplish that in a web page right now? This issue is
proposing a not-yet-real attribute, so it doesn't work anywhere.
…On Thu, Jul 19, 2018, 2:03 PM Luna Lu ***@***.***> wrote:
Hi, I am just trying to understand how to set the height and boolean
attribute as suggested if I set width to be 100% of its containing block's
width?
Thanks
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHstSnd6Tw60AHOaqltRDM0HnE-jGCf3ks5uIMnbgaJpZM4VOMq2>
.
|
No. I am trying to understand how this proposal would work to solve the issue raised in the explainer. |
Of course, I'm sorry for my rudeness.
If width=300 and height=500, and this attribute is set, then if CSS sizes
the element to be 100% of the parent container, then the element's height
will become 1⅔× the container's width.
Does that work?
…On Thu, Jul 19, 2018, 4:55 PM Luna Lu ***@***.***> wrote:
No. I am trying to understand how this proposal would work to solve the
issue raised in the explainer.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHstSq9YGQUcmUloZr26SPz3NSJB7aGSks5uIPJWgaJpZM4VOMq2>
.
|
I see. |
That's a good question. The @eeeps, do you know how that turns out? As for |
Yes. I am personally leaning towards this proposal. I think it is so great. Although, that one is a lot more complicated. |
Re: It was initially proposed (by @yoavweiss) as a way to give images intrinsic dimensions before they were loaded – solving exactly the problem that @ojanvafai is trying to solve, here. I asked if These two use cases were deemed significant, but not significant enough to block the first specs or implementations. Despite apparent consensus, in the four years since all of those conversations, nobody ever implemented or spec’d Implementing |
We've run a fairly large sampling of
As you can see, the discrepancies are significant in noticeable percentages of cases. And this doesn't take into account cases where one of I believe if we were to try to use the current |
/cc @jensimmons too. |
The (very) minor discrepancies might be from how The really big discrepancies are probably |
@tigt The data I provided already explicitly excludes float/integer rounding issues. I tried to remove cases that look like |
@dvoytenko can you provide a few examples of pages in the "Discrepancy was over 1.2" category? It's difficult to assess the visual impact from a number. So, wrt changing the default of 'object-fit':
Is it common to have width/height set, and then set one of them to
Which one of these do we want? |
@zcorpan couple of examples:
I think what we want functionally is described fairly well in the explainer and for |
From what I understand, it's fairly common, and becoming more popular as people update to responsive design techniques and create fluid layouts with Grid and Flexbox.
I don't think we can change the It would be simpler to map to the proposed CSS @dvoytenko Wrt the data in #4 (comment) you will want to consider only the images with an |
Could you clarify this? Wouldn't both
I agree - I think CSS aspect-ratio could be really helpful here, but I think that work on CSS side is mostly stuck? But maybe we should open a new issue to discuss CSS aspect-ratio vs intrinsic-size? I think another possible benefit is that CDNs could rewrite documents to insert |
No. If an image has a fixed CSS width/height value, then that size must be honored. (And unless overridden by CSS, the HTML width/height attributes map to CSS width/height values.) The intrinsic size of the image is ignored in these cases, because the author gave an explicit one and this overrides. See https://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width The intrinsic sizes (and aspect ratio) of an image only come into play for calculating
CSS (It's stuck mainly waiting on me to address @dholbert's comments and clean up the rest of spec. But there's an Editor’s Draft here https://drafts.csswg.org/css-sizing-4/#aspect-ratio and I really should target the June F2F for that. :) |
Apologies if this was in the Alternatives Considered section — I didn't quite see something that seemed the same.
What if
width
/height
were used as normal, and a boolean attribute would indicate they result in the aspect ratio to maintain?The text was updated successfully, but these errors were encountered: