<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[214561] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/214561">214561</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-03-29 13:54:21 -0700 (Wed, 29 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Animated SVG images are not paused in pages loaded in the background
https://bugs.webkit.org/show_bug.cgi?id=170043
&lt;rdar://problem/31234412&gt;

Reviewed by Simon Fraser.

Source/WebCore:

Animated SVG images are not paused in pages loaded in the background. We rely
on FrameView::isOffscreen() to stop images animations in background tab (See
logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
if a tab is visble and then becomes hidden (i.e. by switching to another
tab). However, in the case where the tab gets loaded while in the background
(e.g. opening link in new background tab, or session restore), then the
animations would not be paused, due to FrameView::isOffscreen() erroneously
returning false in this case.

Normally, the following chain of events happens:
- Page is visible, we construct a main frame and its FrameView for loading
  the page. When a FrameView is constructed, we call FrameView::show() to
  make it visible. Then, if the page becomes non-visible, we call
  Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
  that, FrameView::isOffscreen() correctly returns true because we properly
  called FrameView::hide().

However, when doing a load while the Page is hidden, the following was
happening:
- Page is not visible, we call Page::setIsVisibleInternal(false) which tries
  to call FrameView::hide() for the main frame but it does not have a FrameView
  yet (because the load has not started). We start the load and end up creating
  a FrameView. The FrameView constructor was calling FrameView::show()
  unconditionally, thus making the FrameView think is visible, even though its
  page isn't. At this point, FrameView::isOffscreen() was returning false
  and animations would keep running, even though the page is not visible.

To address the issue, we now call FrameView::show() in FrameView::create() only
if the Page is actually visible, instead of calling it unconditionally. If the
page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
it will take care of calling FrameView::show() then.

Tests: svg/animations/animations-paused-in-background-page-iframe.html
       svg/animations/animations-paused-in-background-page.html

* page/FrameView.cpp:
(WebCore::FrameView::create):

LayoutTests:

Extend layout test coverage.

* svg/animations/animations-paused-in-background-page-expected.txt: Added.
* svg/animations/animations-paused-in-background-page-iframe-expected.txt: Added.
* svg/animations/animations-paused-in-background-page-iframe.html: Added.
* svg/animations/animations-paused-in-background-page.html: Added.
* svg/animations/resources/iframe-with-animated-svg-image.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiosTestExpectations">trunk/LayoutTests/platform/ios/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvganimationsanimationspausedinbackgroundpageexpectedtxt">trunk/LayoutTests/svg/animations/animations-paused-in-background-page-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimationspausedinbackgroundpageiframeexpectedtxt">trunk/LayoutTests/svg/animations/animations-paused-in-background-page-iframe-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimationspausedinbackgroundpageiframehtml">trunk/LayoutTests/svg/animations/animations-paused-in-background-page-iframe.html</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimationspausedinbackgroundpagehtml">trunk/LayoutTests/svg/animations/animations-paused-in-background-page.html</a></li>
<li><a href="#trunkLayoutTestssvganimationsresourcesiframewithanimatedsvgimagehtml">trunk/LayoutTests/svg/animations/resources/iframe-with-animated-svg-image.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214560 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-29 20:38:54 UTC (rev 214560)
+++ trunk/LayoutTests/ChangeLog        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2017-03-29  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Animated SVG images are not paused in pages loaded in the background
+        https://bugs.webkit.org/show_bug.cgi?id=170043
+        &lt;rdar://problem/31234412&gt;
+
+        Reviewed by Simon Fraser.
+
+        Extend layout test coverage.
+
+        * svg/animations/animations-paused-in-background-page-expected.txt: Added.
+        * svg/animations/animations-paused-in-background-page-iframe-expected.txt: Added.
+        * svg/animations/animations-paused-in-background-page-iframe.html: Added.
+        * svg/animations/animations-paused-in-background-page.html: Added.
+        * svg/animations/resources/iframe-with-animated-svg-image.html: Added.
+
</ins><span class="cx"> 2017-03-29  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Post-commit test gardening after r214546
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiosTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios/TestExpectations (214560 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios/TestExpectations        2017-03-29 20:38:54 UTC (rev 214560)
+++ trunk/LayoutTests/platform/ios/TestExpectations        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -309,6 +309,8 @@
</span><span class="cx"> webkit.org/b/165799 fast/events/page-visibility-onvisibilitychange.html [ Skip ]
</span><span class="cx"> webkit.org/b/165799 media/media-playback-page-visibility.html [ Skip ]
</span><span class="cx"> webkit.org/b/165799 svg/animations/animations-paused-page-non-visible.html [ Skip ]
</span><ins>+webkit.org/b/165799 svg/animations/animations-paused-in-background-page-iframe.html [ Skip ]
+webkit.org/b/165799 svg/animations/animations-paused-in-background-page.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # AutoFill button is not supported
</span><span class="cx"> fast/forms/auto-fill-button/mouse-down-input-mouse-release-auto-fill-button.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (214560 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2017-03-29 20:38:54 UTC (rev 214560)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -125,6 +125,8 @@
</span><span class="cx"> fast/images/animated-gif-zooming.html [ Skip ]
</span><span class="cx"> svg/animations/animated-svg-image-outside-viewport-paused.html [ Skip ]
</span><span class="cx"> svg/animations/animated-svg-image-removed-from-document-paused.html [ Skip ]
</span><ins>+svg/animations/animations-paused-in-background-page-iframe.html [ Skip ]
+svg/animations/animations-paused-in-background-page.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # WK1 uses the native scrollview for scrolling by page.
</span><span class="cx"> scrollbars/scrolling-backward-by-page-accounting-bottom-fixed-elements-on-keyboard-spacebar.html
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationspausedinbackgroundpageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-paused-in-background-page-expected.txt (0 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-paused-in-background-page-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-paused-in-background-page-expected.txt        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Tests that animated SVG images are properly paused when the page is no longer visible
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS internals.isImageAnimating(testImage) is true
+Setting page visibility to hidden
+PASS internals.isImageAnimating(testImage) became false
+Setting page visibility to visible
+PASS internals.isImageAnimating(testImage) became false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationspausedinbackgroundpageiframeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-paused-in-background-page-iframe-expected.txt (0 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-paused-in-background-page-iframe-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-paused-in-background-page-iframe-expected.txt        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Tests that animated SVG images are properly paused when loaded in a new iframe inside a hidden page
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Setting page visibility to hidden
+PASS document.hidden is true
+PASS internals.isImageAnimating(testImage) is false
+Setting page visibility to visible
+PASS internals.isImageAnimating(testImage) became true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationspausedinbackgroundpageiframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-paused-in-background-page-iframe.html (0 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-paused-in-background-page-iframe.html                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-paused-in-background-page-iframe.html        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Tests that animated SVG images are properly paused when loaded in a new iframe inside a hidden page&quot;);
+jsTestIsAsync = true;
+
+function frameLoadedInBackground()
+{
+    setTimeout(function() {
+        testImage = frame.contentDocument.getElementById(&quot;testImage&quot;);
+        shouldBeFalse(&quot;internals.isImageAnimating(testImage)&quot;);
+
+        document.onvisibilitychange = null;
+        debug(&quot;Setting page visibility to visible&quot;);
+        if (window.testRunner)
+            testRunner.setPageVisibility('visible');
+
+        shouldBecomeEqual(&quot;internals.isImageAnimating(testImage)&quot;, &quot;true&quot;, finishJSTest);
+    }, 30);
+}
+
+window.onload = function() {
+    document.onvisibilitychange = function() {
+        setTimeout(function() {
+            shouldBeTrue(&quot;document.hidden&quot;);
+            frame = document.createElement(&quot;iframe&quot;);
+            frame.src = &quot;resources/iframe-with-animated-svg-image.html&quot;;
+            frame.onload = frameLoadedInBackground;
+            document.body.appendChild(frame);
+        }, 30);
+    };
+
+    debug(&quot;Setting page visibility to hidden&quot;);
+    if (window.testRunner)
+        testRunner.setPageVisibility('hidden');
+}
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationspausedinbackgroundpagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-paused-in-background-page.html (0 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-paused-in-background-page.html                                (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-paused-in-background-page.html        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Tests that animated SVG images are properly paused when the page is no longer visible&quot;);
+jsTestIsAsync = true;
+
+function makePageVisible()
+{
+    debug(&quot;Setting page visibility to visible&quot;);
+    if (window.testRunner)
+        testRunner.setPageVisibility('visible');
+    shouldBecomeEqual(&quot;internals.isImageAnimating(testImage)&quot;, &quot;false&quot;, finishJSTest);
+}
+
+window.onload = function() {
+    testImage = document.getElementById(&quot;testImage&quot;);
+    shouldBeTrue(&quot;internals.isImageAnimating(testImage)&quot;);
+
+    debug(&quot;Setting page visibility to hidden&quot;);
+    if (window.testRunner)
+        testRunner.setPageVisibility('hidden');
+
+    shouldBecomeEqual(&quot;internals.isImageAnimating(testImage)&quot;, &quot;false&quot;, makePageVisible);
+}
+&lt;/script&gt;
+&lt;img id=&quot;testImage&quot; src=&quot;resources/smilAnimation.svg&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsresourcesiframewithanimatedsvgimagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/resources/iframe-with-animated-svg-image.html (0 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/resources/iframe-with-animated-svg-image.html                                (rev 0)
+++ trunk/LayoutTests/svg/animations/resources/iframe-with-animated-svg-image.html        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;img id=&quot;testImage&quot; src=&quot;smilAnimation.svg&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214560 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-29 20:38:54 UTC (rev 214560)
+++ trunk/Source/WebCore/ChangeLog        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2017-03-29  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Animated SVG images are not paused in pages loaded in the background
+        https://bugs.webkit.org/show_bug.cgi?id=170043
+        &lt;rdar://problem/31234412&gt;
+
+        Reviewed by Simon Fraser.
+
+        Animated SVG images are not paused in pages loaded in the background. We rely
+        on FrameView::isOffscreen() to stop images animations in background tab (See
+        logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
+        if a tab is visble and then becomes hidden (i.e. by switching to another
+        tab). However, in the case where the tab gets loaded while in the background
+        (e.g. opening link in new background tab, or session restore), then the
+        animations would not be paused, due to FrameView::isOffscreen() erroneously
+        returning false in this case.
+
+        Normally, the following chain of events happens:
+        - Page is visible, we construct a main frame and its FrameView for loading
+          the page. When a FrameView is constructed, we call FrameView::show() to
+          make it visible. Then, if the page becomes non-visible, we call
+          Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
+          that, FrameView::isOffscreen() correctly returns true because we properly
+          called FrameView::hide().
+
+        However, when doing a load while the Page is hidden, the following was
+        happening:
+        - Page is not visible, we call Page::setIsVisibleInternal(false) which tries
+          to call FrameView::hide() for the main frame but it does not have a FrameView
+          yet (because the load has not started). We start the load and end up creating
+          a FrameView. The FrameView constructor was calling FrameView::show()
+          unconditionally, thus making the FrameView think is visible, even though its
+          page isn't. At this point, FrameView::isOffscreen() was returning false
+          and animations would keep running, even though the page is not visible.
+
+        To address the issue, we now call FrameView::show() in FrameView::create() only
+        if the Page is actually visible, instead of calling it unconditionally. If the
+        page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
+        it will take care of calling FrameView::show() then.
+
+        Tests: svg/animations/animations-paused-in-background-page-iframe.html
+               svg/animations/animations-paused-in-background-page.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::create):
+
</ins><span class="cx"> 2017-03-29  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Links with empty hrefs should not be drag sources
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (214560 => 214561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2017-03-29 20:38:54 UTC (rev 214560)
+++ trunk/Source/WebCore/page/FrameView.cpp        2017-03-29 20:54:21 UTC (rev 214561)
</span><span class="lines">@@ -296,7 +296,8 @@
</span><span class="cx"> Ref&lt;FrameView&gt; FrameView::create(Frame&amp; frame)
</span><span class="cx"> {
</span><span class="cx">     Ref&lt;FrameView&gt; view = adoptRef(*new FrameView(frame));
</span><del>-    view-&gt;show();
</del><ins>+    if (frame.page() &amp;&amp; frame.page()-&gt;isVisible())
+        view-&gt;show();
</ins><span class="cx">     return view;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -304,7 +305,8 @@
</span><span class="cx"> {
</span><span class="cx">     Ref&lt;FrameView&gt; view = adoptRef(*new FrameView(frame));
</span><span class="cx">     view-&gt;Widget::setFrameRect(IntRect(view-&gt;location(), initialSize));
</span><del>-    view-&gt;show();
</del><ins>+    if (frame.page() &amp;&amp; frame.page()-&gt;isVisible())
+        view-&gt;show();
</ins><span class="cx">     return view;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>