Changeset 54048 in webkit
- Timestamp:
- Jan 28, 2010 11:42:05 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54047 r54048 1 2010-01-28 Nicholas Young <nicholas.young@nokia.com> 2 3 Reviewed by Eric Carlson. 4 5 Prefer provided video element width/height properties to hard coded 6 defaults for intrinsic size when natural video size is unavailable. 7 https://bugs.webkit.org/show_bug.cgi?id=34302 8 9 No new tests needed. 10 11 * rendering/RenderVideo.cpp: Attempt to use width/height properties 12 (WebCore::RenderVideo::RenderVideo): 13 * rendering/RenderVideo.h: More appropriate constructor signature 14 1 15 2010-01-28 Oliver Hunt <oliver@apple.com> 2 16 -
trunk/WebCore/rendering/RenderVideo.cpp
r53146 r54048 51 51 static const int cDefaultHeight = 150; 52 52 53 RenderVideo::RenderVideo(HTML MediaElement* video)53 RenderVideo::RenderVideo(HTMLVideoElement* video) 54 54 : RenderMedia(video) 55 55 { … … 57 57 setIntrinsicSize(video->player()->naturalSize()); 58 58 else { 59 // Video in standalone media documents should not use the default 300x150 60 // size since they also have audio thrown at them. By setting the intrinsic 61 // size to 300x1 the video will resize itself in these cases, and audio will 62 // have the correct height (it needs to be > 0 for controls to render properly). 63 if (video->ownerDocument() && video->ownerDocument()->isMediaDocument()) 59 // When the natural size of the video is unavailable, we use the provided 60 // width and height attributes of the video element as the intrinsic size until 61 // better values become available. If these attributes are not set, we fall back 62 // to a default video size (300x150). 63 if (video->hasAttribute(widthAttr) && video->hasAttribute(heightAttr)) 64 setIntrinsicSize(IntSize(video->width(), video->height())); 65 else if (video->ownerDocument() && video->ownerDocument()->isMediaDocument()) { 66 // Video in standalone media documents should not use the default 300x150 67 // size since they also have audio thrown at them. By setting the intrinsic 68 // size to 300x1 the video will resize itself in these cases, and audio will 69 // have the correct height (it needs to be > 0 for controls to render properly). 64 70 setIntrinsicSize(IntSize(cDefaultWidth, 1)); 71 } 65 72 else 66 73 setIntrinsicSize(IntSize(cDefaultWidth, cDefaultHeight)); -
trunk/WebCore/rendering/RenderVideo.h
r53146 r54048 41 41 class RenderVideo : public RenderMedia { 42 42 public: 43 RenderVideo(HTML MediaElement*);43 RenderVideo(HTMLVideoElement*); 44 44 virtual ~RenderVideo(); 45 45
Note: See TracChangeset
for help on using the changeset viewer.