diff options
author | Feng Qian <fqian@google.com> | 2009-06-17 12:12:20 -0700 |
---|---|---|
committer | Feng Qian <fqian@google.com> | 2009-06-17 12:12:20 -0700 |
commit | 5f1ab04193ad0130ca8204aadaceae083aca9881 (patch) | |
tree | 5a92cd389e2cfe7fb67197ce14b38469462379f8 /WebCore/rendering/RenderVideo.cpp | |
parent | 194315e5a908cc8ed67d597010544803eef1ac59 (diff) | |
download | external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2 |
Get WebKit r44544.
Diffstat (limited to 'WebCore/rendering/RenderVideo.cpp')
-rw-r--r-- | WebCore/rendering/RenderVideo.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp index d6e98e7..d47e2f3 100644 --- a/WebCore/rendering/RenderVideo.cpp +++ b/WebCore/rendering/RenderVideo.cpp @@ -41,9 +41,24 @@ namespace WebCore { using namespace HTMLNames; +static const int cDefaultWidth = 300; +static const int cDefaultHeight = 150; + RenderVideo::RenderVideo(HTMLMediaElement* video) - : RenderMedia(video, video->player() ? video->player()->naturalSize() : IntSize(300, 150)) + : RenderMedia(video) { + if (video->player()) + setIntrinsicSize(video->player()->naturalSize()); + else { + // Video in standalone media documents should not use the default 300x150 + // 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). + if (video->ownerDocument() && video->ownerDocument()->isMediaDocument()) + setIntrinsicSize(IntSize(cDefaultWidth, 1)); + else + setIntrinsicSize(IntSize(cDefaultWidth, cDefaultHeight)); + } } RenderVideo::~RenderVideo() |