Reviewed by Mitz.
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2008 01:41:13 +0000 (01:41 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2008 01:41:13 +0000 (01:41 +0000)
        Fix http://bugs.webkit.org/show_bug.cgi?id=16376
        <rdar://problem/5665206>
        <video> element fails to play frames when navigating back to page (16376)

        Don't make MediaPlayer visible when it is actually in page cache.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29345 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/rendering/RenderVideo.cpp

index 3608d4764b7ed54dbbcdcb570acf27b9a14ce69c..e19279afee637556463fb4a1d81a44d274ced027 100644 (file)
@@ -1,3 +1,16 @@
+2008-01-09  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Mitz.
+
+        Fix http://bugs.webkit.org/show_bug.cgi?id=16376
+        <rdar://problem/5665206>
+        <video> element fails to play frames when navigating back to page (16376)
+        
+        Don't make MediaPlayer visible when it is actually in page cache.
+
+        * rendering/RenderVideo.cpp:
+        (WebCore::RenderVideo::updatePlayer):
+
 2008-01-09  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin.
index 78e94ed17c35a45a5e9eb1ff34fc59a51e762ccd..aa0da1139e89fa6c3a03b469eb81e9e5b146d6f2 100644 (file)
@@ -116,17 +116,21 @@ void RenderVideo::updateFromElement()
 }
 
 void RenderVideo::updatePlayer()
-{    
-    if (MediaPlayer* mediaPlayer = player()) {
-        int x;
-        int y;
-        absolutePosition(x, y);
-        IntRect videoBounds = videoBox(); 
-        videoBounds.move(x, y);
-        mediaPlayer->setParentWidget(document()->view());
-        mediaPlayer->setRect(videoBounds);
-        mediaPlayer->setVisible(true);
-    }    
+{
+    MediaPlayer* mediaPlayer = player();
+    if (!mediaPlayer)
+        return;
+    Document* doc = document();
+    if (doc->inPageCache())
+        return;
+    int x;
+    int y;
+    absolutePosition(x, y);
+    IntRect videoBounds = videoBox(); 
+    videoBounds.move(x, y);
+    mediaPlayer->setParentWidget(doc->view());
+    mediaPlayer->setRect(videoBounds);
+    mediaPlayer->setVisible(true);
 }
 
 bool RenderVideo::isWidthSpecified() const