Skip to content

Commit 2c2584e

Browse files
kalenikaliaksandrgmta
authored andcommitted
LibWeb: Delete VideoPaintable::layout_box()
No need for this method when we could reach into DOM node directly from Paintable.
1 parent 5c699e1 commit 2c2584e

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

Libraries/LibWeb/Painting/VideoPaintable.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ VideoPaintable::VideoPaintable(Layout::VideoBox const& layout_box)
3838
{
3939
}
4040

41-
Layout::VideoBox& VideoPaintable::layout_box()
42-
{
43-
return static_cast<Layout::VideoBox&>(layout_node());
44-
}
45-
46-
Layout::VideoBox const& VideoPaintable::layout_box() const
47-
{
48-
return static_cast<Layout::VideoBox const&>(layout_node());
49-
}
50-
5141
void VideoPaintable::paint(DisplayListRecordingContext& context, PaintPhase phase) const
5242
{
5343
if (!is_visible())
@@ -65,7 +55,7 @@ void VideoPaintable::paint(DisplayListRecordingContext& context, PaintPhase phas
6555

6656
ScopedCornerRadiusClip corner_clip { context, video_rect, normalized_border_radii_data(ShrinkRadiiForBorders::Yes) };
6757

68-
auto const& video_element = layout_box().dom_node();
58+
auto const& video_element = as<HTML::HTMLVideoElement>(*dom_node());
6959
auto mouse_position = MediaPaintable::mouse_position(context, video_element);
7060

7161
auto const& current_frame = video_element.current_frame();

Libraries/LibWeb/Painting/VideoPaintable.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class VideoPaintable final : public MediaPaintable {
2020

2121
virtual void paint(DisplayListRecordingContext&, PaintPhase) const override;
2222

23-
Layout::VideoBox& layout_box();
24-
Layout::VideoBox const& layout_box() const;
25-
2623
private:
2724
VideoPaintable(Layout::VideoBox const&);
2825

0 commit comments

Comments
 (0)