[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756
simon.fraser at apple.com
simon.fraser at apple.com
Fri Feb 26 22:21:19 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 27ef53315cd15c01b4797eb0d61778117bc2baf5
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Feb 16 22:04:37 2010 +0000
2010-02-16 Simon Fraser <simon.fraser at apple.com>
Reviewed by Eric Carlson.
With hardware acceleration turned off, video frames never display if poster
image is specified
https://bugs.webkit.org/show_bug.cgi?id=34965
HTMLVideoElement's m_shouldDisplayPosterImage was never updated after
the movie supplied its first video frame, so the poster would continue to show.
Fixed by calling updatePosterImage() from mediaPlayerRepaint(), which is called
each time a new frame is available. updatePosterImage() is cheap.
Also made updatePosterImage() virtual on HTMLMediaElement to avoid a number of
ugly casts.
Test: manual-tests/media-elements/video-replaces-poster.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::noneSupported): Call updatePosterImage() without video check.
(WebCore::HTMLMediaElement::setNetworkState): Ditto.
(WebCore::HTMLMediaElement::setReadyState): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerRepaint): Call udpatePosterImage().
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::updatePosterImage): Make this an empty virtual
method on the base class.
* html/HTMLVideoElement.h: Override updatePosterImage().
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 529ad8c..d6a6ddc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,34 @@
2010-02-16 Simon Fraser <simon.fraser at apple.com>
+ Reviewed by Eric Carlson.
+
+ With hardware acceleration turned off, video frames never display if poster
+ image is specified
+ https://bugs.webkit.org/show_bug.cgi?id=34965
+
+ HTMLVideoElement's m_shouldDisplayPosterImage was never updated after
+ the movie supplied its first video frame, so the poster would continue to show.
+
+ Fixed by calling updatePosterImage() from mediaPlayerRepaint(), which is called
+ each time a new frame is available. updatePosterImage() is cheap.
+
+ Also made updatePosterImage() virtual on HTMLMediaElement to avoid a number of
+ ugly casts.
+
+ Test: manual-tests/media-elements/video-replaces-poster.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::noneSupported): Call updatePosterImage() without video check.
+ (WebCore::HTMLMediaElement::setNetworkState): Ditto.
+ (WebCore::HTMLMediaElement::setReadyState): Ditto.
+ (WebCore::HTMLMediaElement::mediaPlayerRepaint): Call udpatePosterImage().
+ * html/HTMLMediaElement.h:
+ (WebCore::HTMLMediaElement::updatePosterImage): Make this an empty virtual
+ method on the base class.
+ * html/HTMLVideoElement.h: Override updatePosterImage().
+
+2010-02-16 Simon Fraser <simon.fraser at apple.com>
+
Build fix for platforms without ACCELERATED_COMPOSITING defined.
mediaPlayerRenderingModeChanged() is only available when ACCELERATED_COMPOSITING is defined.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 5efd016..12b93ef 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -664,8 +664,8 @@ void HTMLMediaElement::noneSupported()
// 9 -Abort these steps. Until the load() method is invoked, the element won't attempt to load another resource.
- if (isVideo())
- static_cast<HTMLVideoElement*>(this)->updatePosterImage();
+ updatePosterImage();
+
if (renderer())
renderer()->updateFromElement();
}
@@ -743,9 +743,7 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
else if (state == MediaPlayer::FormatError && m_loadState == LoadingFromSrcAttr)
noneSupported();
- if (isVideo())
- static_cast<HTMLVideoElement*>(this)->updatePosterImage();
-
+ updatePosterImage();
return;
}
@@ -883,8 +881,8 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
shouldUpdatePosterImage = true;
}
- if (shouldUpdatePosterImage && isVideo())
- static_cast<HTMLVideoElement*>(this)->updatePosterImage();
+ if (shouldUpdatePosterImage)
+ updatePosterImage();
updatePlayState();
}
@@ -1506,6 +1504,8 @@ void HTMLMediaElement::mediaPlayerRepaint(MediaPlayer*)
beginProcessingMediaPlayerCallback();
if (renderer())
renderer()->repaint();
+
+ updatePosterImage();
endProcessingMediaPlayerCallback();
}
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index cee912a..8aa82be 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -183,6 +183,7 @@ protected:
virtual void documentWillBecomeInactive();
virtual void documentDidBecomeActive();
virtual void mediaVolumeDidChange();
+ virtual void updatePosterImage() { }
void setReadyState(MediaPlayer::ReadyState);
void setNetworkState(MediaPlayer::NetworkState);
diff --git a/WebCore/html/HTMLVideoElement.h b/WebCore/html/HTMLVideoElement.h
index a5c005c..d12667e 100644
--- a/WebCore/html/HTMLVideoElement.h
+++ b/WebCore/html/HTMLVideoElement.h
@@ -70,7 +70,6 @@ public:
bool webkitSupportsFullscreen();
bool webkitDisplayingFullscreen();
- void updatePosterImage();
bool shouldDisplayPosterImage() const { return m_shouldDisplayPosterImage; }
void paint(GraphicsContext*, const IntRect&);
@@ -79,6 +78,7 @@ public:
private:
virtual bool hasAvailableVideoFrame() const;
+ virtual void updatePosterImage();
OwnPtr<HTMLImageLoader> m_imageLoader;
KURL m_posterURL;
diff --git a/WebCore/manual-tests/media-elements/video-replaces-poster.html b/WebCore/manual-tests/media-elements/video-replaces-poster.html
new file mode 100644
index 0000000..8d852aa
--- /dev/null
+++ b/WebCore/manual-tests/media-elements/video-replaces-poster.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ </head>
+ <body>
+ <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=34965">https://bugs.webkit.org/show_bug.cgi?id=34965</a><br>
+ Disable accelerated compositing and reload this test. You should see the test video
+ start playing.</p>
+
+ <video width="480" height="270" type="video/mp4"
+ src="../../../LayoutTests/media/content/test.mp4"
+ poster="../../../LayoutTests/media/content/abe.png" autoplay>
+ </video>
+ </body>
+</html>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list