Title: [103098] trunk
Revision
103098
Author
yael.aha...@nokia.com
Date
2011-12-16 13:03:05 -0800 (Fri, 16 Dec 2011)

Log Message

Audio file in video element has a size of 0x0 .
https://bugs.webkit.org/show_bug.cgi?id=74738

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

When the source of a video element has audio only, the intrinsic size of the video should
not be 0x0. Instead, it should be the same as as no media was loaded.

No new tests. An existing test is covering this case and was modified to reflect this change.

* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::calculateIntrinsicSize):

LayoutTests:

Changed the expected result to reflect this change.

* media/audio-only-video-intrinsic-size-expected.txt:
* media/audio-only-video-intrinsic-size.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (103097 => 103098)


--- trunk/LayoutTests/ChangeLog	2011-12-16 20:55:10 UTC (rev 103097)
+++ trunk/LayoutTests/ChangeLog	2011-12-16 21:03:05 UTC (rev 103098)
@@ -1,3 +1,15 @@
+2011-12-16  Yael Aharon  <yael.aha...@nokia.com>
+
+        Audio file in video element has a size of 0x0 .
+        https://bugs.webkit.org/show_bug.cgi?id=74738
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Changed the expected result to reflect this change.
+
+        * media/audio-only-video-intrinsic-size-expected.txt:
+        * media/audio-only-video-intrinsic-size.html:
+
 2011-12-16  Alexis Menard  <alexis.men...@openbossa.org>
 
         getComputedStyle for border-width is not implemented.

Modified: trunk/LayoutTests/media/audio-only-video-intrinsic-size-expected.txt (103097 => 103098)


--- trunk/LayoutTests/media/audio-only-video-intrinsic-size-expected.txt	2011-12-16 20:55:10 UTC (rev 103097)
+++ trunk/LayoutTests/media/audio-only-video-intrinsic-size-expected.txt	2011-12-16 21:03:05 UTC (rev 103098)
@@ -1,5 +1,5 @@
-This tests the intrinsic size of a video element is the default 300×150 before metadata is loaded, and 0×0 after metadata is loaded for an audio-only file.
+This tests the intrinsic size of a video element is the default 300×150 before metadata is loaded, and also after metadata is loaded for an audio-only file.
 
 Initial dimensions: 300×150
-Dimensions after metadata loaded: 0×0
+Dimensions after metadata loaded: 300×150
 

Modified: trunk/LayoutTests/media/audio-only-video-intrinsic-size.html (103097 => 103098)


--- trunk/LayoutTests/media/audio-only-video-intrinsic-size.html	2011-12-16 20:55:10 UTC (rev 103097)
+++ trunk/LayoutTests/media/audio-only-video-intrinsic-size.html	2011-12-16 21:03:05 UTC (rev 103098)
@@ -1,7 +1,7 @@
 <video id="vid" src="" _onloadedmetadata_="loadedMetadata()"></video>
 <p>
     This tests the intrinsic size of a video element is the default 300&#xd7;150 before metadata is
-    loaded, and 0&#xd7;0 after metadata is loaded for an audio-only file.
+    loaded, and also after metadata is loaded for an audio-only file.
 </p>
 <pre id="console"></pre>
 <script>

Modified: trunk/Source/WebCore/ChangeLog (103097 => 103098)


--- trunk/Source/WebCore/ChangeLog	2011-12-16 20:55:10 UTC (rev 103097)
+++ trunk/Source/WebCore/ChangeLog	2011-12-16 21:03:05 UTC (rev 103098)
@@ -1,3 +1,18 @@
+2011-12-16  Yael Aharon  <yael.aha...@nokia.com>
+
+        Audio file in video element has a size of 0x0 .
+        https://bugs.webkit.org/show_bug.cgi?id=74738
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        When the source of a video element has audio only, the intrinsic size of the video should
+        not be 0x0. Instead, it should be the same as as no media was loaded.
+
+        No new tests. An existing test is covering this case and was modified to reflect this change.
+
+        * rendering/RenderVideo.cpp:
+        (WebCore::RenderVideo::calculateIntrinsicSize):
+
 2011-12-16  Alexis Menard  <alexis.men...@openbossa.org>
 
         getComputedStyle for border-width is not implemented.

Modified: trunk/Source/WebCore/rendering/RenderVideo.cpp (103097 => 103098)


--- trunk/Source/WebCore/rendering/RenderVideo.cpp	2011-12-16 20:55:10 UTC (rev 103097)
+++ trunk/Source/WebCore/rendering/RenderVideo.cpp	2011-12-16 21:03:05 UTC (rev 103098)
@@ -113,8 +113,11 @@
     // of the video resource, if that is available; otherwise it is the intrinsic 
     // height of the poster frame, if that is available; otherwise it is 150 CSS pixels.
     MediaPlayer* player = mediaElement()->player();
-    if (player && video->readyState() >= HTMLVideoElement::HAVE_METADATA)
-        return player->naturalSize();
+    if (player && video->readyState() >= HTMLVideoElement::HAVE_METADATA) {
+        IntSize size = player->naturalSize();
+        if (!size.isEmpty())
+            return size;
+    }
 
     if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !imageResource()->errorOccurred())
         return m_cachedImageSize;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to