Reviewed by Mitz.
[WebKit-https.git] / WebCore / rendering / RenderVideo.cpp
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