summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderVideo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/RenderVideo.cpp')
-rw-r--r--WebCore/rendering/RenderVideo.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp
index 13d6f60..ad25c22 100644
--- a/WebCore/rendering/RenderVideo.cpp
+++ b/WebCore/rendering/RenderVideo.cpp
@@ -47,9 +47,6 @@ namespace WebCore {
using namespace HTMLNames;
-static const int cDefaultWidth = 300;
-static const int cDefaultHeight = 150;
-
RenderVideo::RenderVideo(HTMLVideoElement* video)
: RenderMedia(video)
{
@@ -67,10 +64,10 @@ RenderVideo::RenderVideo(HTMLVideoElement* video)
// size since they also have audio thrown at them. By setting the intrinsic
// size to 300x1 the video will resize itself in these cases, and audio will
// have the correct height (it needs to be > 0 for controls to render properly).
- setIntrinsicSize(IntSize(cDefaultWidth, 1));
+ setIntrinsicSize(IntSize(defaultSize().width(), 1));
}
else
- setIntrinsicSize(IntSize(cDefaultWidth, cDefaultHeight));
+ setIntrinsicSize(defaultSize());
}
}
@@ -82,6 +79,15 @@ RenderVideo::~RenderVideo()
}
}
+IntSize RenderVideo::defaultSize()
+{
+ // These values are specified in the spec.
+ static const int cDefaultWidth = 300;
+ static const int cDefaultHeight = 150;
+
+ return IntSize(cDefaultWidth, cDefaultHeight);
+}
+
void RenderVideo::intrinsicSizeChanged()
{
if (videoElement()->shouldDisplayPosterImage())