immersive-web/model-element

Default width/height

marcoscaceres opened this issue · 3 comments

When the model is missing width/height, and the resource itself doesn't provide them, it would be nice to have it fall back to something sensible. Seems to be controlled by https://html.spec.whatwg.org/#embedded-content-rendering-rules

Related to #27

That's is 300x150 for the record

I've been trying to tack down how one ultimately one would end up rendering at 300x150... The trail goes -> HTML Rules for embedded content -> CSS Display "replaced element" - but then the trail goes cold (i.e., I wasn't able to find where CSS or HTML actually say 300x150). Anyone know?

In webkit for <video>, at least, the implementation has 300x150 hard coded:
https://github.com/WebKit/WebKit/blob/757f991622c717f67e075f197f7116b431a5376a/Source/WebCore/rendering/RenderVideo.cpp#L80-L87

(claiming that it's in the spec... but that code was added 13 years ago)

Checking also what happens with the interplay with poster... it gets its intrinsic size from the poster, unless a dimension is given, in which case the poster is "object-fit" "contain".

Actually, I found it as part of the video element definition. https://html.spec.whatwg.org/#the-video-element

The default object size is a width of 300 CSS pixels and a height of 150 CSS pixels. [CSSIMAGES]