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

fix(runtime-dom): <img> width should be set as attribute #8781

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

zh-lx
Copy link
Contributor

@zh-lx zh-lx commented Jul 14, 2023

close #8780

@TheDutchCoder
Copy link

TheDutchCoder commented Aug 5, 2023

Setting 24px as an attribute is not valid HTML: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img

The intrinsic height of the image, in pixels. Must be an integer without a unit

So I think if anything, it should be parsed as an integer, not blindly propagated with invalid values?

@zh-lx
Copy link
Contributor Author

zh-lx commented Aug 5, 2023

I have known this standard, but in most browsers, it can be rendered normally when set 24px with unit. So my main point is that when user give an invalid value, vue should keep the invalid value and let browser to handle the invalid value, rather than rewrite it to 0 in vue.

@TheDutchCoder
Copy link

Ok that's a fair point, I guess normally Vue also propagates invalid attribute values, so that's at least consistent 👍

@sxzz sxzz added the ready to merge The PR is ready to be merged. label Aug 13, 2023
@yyx990803 yyx990803 merged commit bfc1838 into vuejs:main Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge The PR is ready to be merged.
Projects
Development

Successfully merging this pull request may close these issues.

The behavior about width or height attribute of <img /> is not diffrent between vue and original html
4 participants