[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
eric at webkit.org
eric at webkit.org
Thu Feb 4 21:31:59 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 0245035cdec34517de39fe10f21f82809a0a4ceb
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 29 07:42:05 2010 +0000
2010-01-28 Nicholas Young <nicholas.young at nokia.com>
Reviewed by Eric Carlson.
Prefer provided video element width/height properties to hard coded
defaults for intrinsic size when natural video size is unavailable.
https://bugs.webkit.org/show_bug.cgi?id=34302
No new tests needed.
* rendering/RenderVideo.cpp: Attempt to use width/height properties
(WebCore::RenderVideo::RenderVideo):
* rendering/RenderVideo.h: More appropriate constructor signature
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54048 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7001d3b..acb15a0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-28 Nicholas Young <nicholas.young at nokia.com>
+
+ Reviewed by Eric Carlson.
+
+ Prefer provided video element width/height properties to hard coded
+ defaults for intrinsic size when natural video size is unavailable.
+ https://bugs.webkit.org/show_bug.cgi?id=34302
+
+ No new tests needed.
+
+ * rendering/RenderVideo.cpp: Attempt to use width/height properties
+ (WebCore::RenderVideo::RenderVideo):
+ * rendering/RenderVideo.h: More appropriate constructor signature
+
2010-01-28 Oliver Hunt <oliver at apple.com>
Reviewed by Gavin Barraclough.
diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp
index f433f8c..d2a9620 100644
--- a/WebCore/rendering/RenderVideo.cpp
+++ b/WebCore/rendering/RenderVideo.cpp
@@ -50,18 +50,25 @@ using namespace HTMLNames;
static const int cDefaultWidth = 300;
static const int cDefaultHeight = 150;
-RenderVideo::RenderVideo(HTMLMediaElement* video)
+RenderVideo::RenderVideo(HTMLVideoElement* video)
: 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())
+ // When the natural size of the video is unavailable, we use the provided
+ // width and height attributes of the video element as the intrinsic size until
+ // better values become available. If these attributes are not set, we fall back
+ // to a default video size (300x150).
+ if (video->hasAttribute(widthAttr) && video->hasAttribute(heightAttr))
+ setIntrinsicSize(IntSize(video->width(), video->height()));
+ else if (video->ownerDocument() && video->ownerDocument()->isMediaDocument()) {
+ // 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).
setIntrinsicSize(IntSize(cDefaultWidth, 1));
+ }
else
setIntrinsicSize(IntSize(cDefaultWidth, cDefaultHeight));
}
diff --git a/WebCore/rendering/RenderVideo.h b/WebCore/rendering/RenderVideo.h
index 709a048..3ca5328 100644
--- a/WebCore/rendering/RenderVideo.h
+++ b/WebCore/rendering/RenderVideo.h
@@ -40,7 +40,7 @@ class GraphicsLayer;
class RenderVideo : public RenderMedia {
public:
- RenderVideo(HTMLMediaElement*);
+ RenderVideo(HTMLVideoElement*);
virtual ~RenderVideo();
void videoSizeChanged();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list