Open MrBrain295 opened 1 year ago
This is backed by the HTML Specification:
The attributes [width and height], if specified, must have values that are valid non-negative integers.
Actually, it looks like we could just deprecate the width
parameter of the EmbedLiveSample
macro, because live samples always span the full width according to this CSS that takes precedence:
For example, this live sample has width="150" height="100%"
, but it is still 100% wide and the height is ignored anyways, because a height of 100% doesn't really make sense.
@teoli2003 @SphinxKnight @wbamberg Any objections against ignoring the width parameter of the EmbedLiveSample
?
To do this, we would need to reassign the parameters:
If parameters $1 and $2 are both numeric (including 100%), we could use $2 as height and $3 as screenshot url.
This would allow "migrating" the macro calls in a backward-compatible way.
See also https://github.com/mdn/yari/issues/5016.
I thought the width
parameter had been ignored since the start of the Yari era.
I think we could just revise the API and update macro calls, it would be better than tricks to keep backward compatibility.
See also #5016.
I thought the
width
parameter had been ignored since the start of the Yari era.I think we could just revise the API and update macro calls, it would be better than tricks to keep backward compatibility.
+1 on this.
Summary
The width for live samples is a percentage which isn’t a valid value.
URL
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
Reproduction steps
Expected behavior
A valid number or CSS.
Actual behavior
An invalid value.
Device
Desktop
Browser
Firefox
Browser version
Stable
Operating system
Linux
Screenshot
No response
Anything else?
No response
Validations