LibWeb: Support dimension attributes on HTMLVideoElement

This commit is contained in:
Timothy Flynn 2024-04-10 20:22:22 -04:00 committed by Andreas Kling
parent 4b1abcf61d
commit 0ffc338406
Notes: sideshowbarker 2024-07-17 08:43:11 +09:00
3 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,15 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x736 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x720 children: inline
frag 0 from VideoBox start: 0, length: 0, rect: [8,8 320x240] baseline: 240
frag 1 from VideoBox start: 0, length: 0, rect: [8,248 640x480] baseline: 480
VideoBox <video> at (8,8) content-size 320x240 children: not-inline
TextNode <#text>
VideoBox <video> at (8,248) content-size 640x480 children: not-inline
TextNode <#text>
ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x736]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x736]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x720]
VideoPaintable (VideoBox<VIDEO>) [8,8 320x240]
VideoPaintable (VideoBox<VIDEO>) [8,248 640x480]

View file

@ -0,0 +1,2 @@
<video width="320" height="240" src="../../../../Base/home/anon/Videos/test-webm.webm"></video>
<video width="640" height="480" src="../../../../Base/home/anon/Videos/test-webm.webm"></video>

View file

@ -50,6 +50,9 @@ private:
virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override;
// https://html.spec.whatwg.org/multipage/media.html#the-video-element:dimension-attributes
virtual bool supports_dimension_attributes() const override { return true; }
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
virtual void on_playing() override;