<!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>[184947] trunk/Source</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/184947">184947</a></dd>
<dt>Author</dt> <dd>jhoneycutt@apple.com</dd>
<dt>Date</dt> <dd>2015-05-28 00:34:21 -0700 (Thu, 28 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] When viewing an MJPEG stream as the main resource, only the first
frame paints

&lt;https://bugs.webkit.org/show_bug.cgi?id=145185&gt;
&lt;rdar://problem/20124694&gt;

Source/WebCore:

This bug is caused by state not being restored between successive loads
of multipart/x-mixed-replace content. Each part of the stream is not
treated as a wholly new load, so if state is cleared as part of the
previous page being destroyed, it may not be restored when loading
the next stream part.

On WK1, tile cache updates are disabled in FrameView::clear(), which is
called as the previous page is destroyed, but were not being
reenabled when loading new replacement content from the stream.

On WK2, the exposed content rect was being reset to an empty rect as
the previous page was destroyed, but it was not being reset by loading
replacement content.

To fix these issues, I added two WebFrameLoaderClient callbacks;
willReplaceMultipartContent() and didReplaceMultipartContent(). These
are used to save and restore state between successive loads.

Reviewed by Darin Adler.

* loader/DocumentLoader.cpp:
Call the new client callbacks.
(WebCore::DocumentLoader::commitLoad):
If replacing content in a multipart/x-mixed-replace stream, call the
WebFrameLoaderClient's didReplaceMultipartContent().

(WebCore::DocumentLoader::setupForReplace):
Call the WebFrameLoaderClient's willReplaceMultipartContent().

* loader/EmptyClients.h:

* loader/FrameLoaderClient.h:

* page/FrameView.cpp:
(WebCore::FrameView::didReplaceMultipartContent):
Re-enable tile cache updates that were disabled in FrameView::clear().
This fixes the issue for WK1.

* page/FrameView.h:
Declare an exported function, didReplaceMultipartContent(), that WebKit
can call.

Source/WebKit/mac:

Reviewed by Darin Adler.

* WebCoreSupport/WebFrameLoaderClient.h:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::didReplaceMultipartContent):
Call the FrameView's didReplaceMultipartContent().

Source/WebKit/win:

Reviewed by Darin Adler.

* WebCoreSupport/WebFrameLoaderClient.h:
Stubbed new functions that aren't used on Windows.

Source/WebKit2:

Reviewed by Darin Adler.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
Tell the WebPage that we will replace multipart content.

(WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
Tell the WebPage that we did replace multipart content.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/DrawingArea.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willReplaceMultipartContent):
Save the exposed content rect.
(WebKit::WebPage::didReplaceMultipartContent):
Restore the exposed content rect that was saved before this load. This
fixes the issue for WK2.

* WebProcess/WebPage/WebPage.h:

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::exposedContentRect):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderClienth">trunk/Source/WebCore/loader/FrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebFrameLoaderClienth">trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebCore/ChangeLog        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2015-05-19  Jon Honeycutt  &lt;jhoneycutt@apple.com&gt;
+
+        [iOS] When viewing an MJPEG stream as the main resource, only the first
+        frame paints
+
+        &lt;https://bugs.webkit.org/show_bug.cgi?id=145185&gt;
+        &lt;rdar://problem/20124694&gt;
+
+        This bug is caused by state not being restored between successive loads
+        of multipart/x-mixed-replace content. Each part of the stream is not
+        treated as a wholly new load, so if state is cleared as part of the
+        previous page being destroyed, it may not be restored when loading
+        the next stream part.
+
+        On WK1, tile cache updates are disabled in FrameView::clear(), which is
+        called as the previous page is destroyed, but were not being
+        reenabled when loading new replacement content from the stream.
+
+        On WK2, the exposed content rect was being reset to an empty rect as
+        the previous page was destroyed, but it was not being reset by loading
+        replacement content.
+
+        To fix these issues, I added two WebFrameLoaderClient callbacks;
+        willReplaceMultipartContent() and didReplaceMultipartContent(). These
+        are used to save and restore state between successive loads.
+
+        Reviewed by Darin Adler.
+
+        * loader/DocumentLoader.cpp:
+        Call the new client callbacks.
+        (WebCore::DocumentLoader::commitLoad):
+        If replacing content in a multipart/x-mixed-replace stream, call the
+        WebFrameLoaderClient's didReplaceMultipartContent().
+
+        (WebCore::DocumentLoader::setupForReplace):
+        Call the WebFrameLoaderClient's willReplaceMultipartContent().
+
+        * loader/EmptyClients.h:
+
+        * loader/FrameLoaderClient.h:
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::didReplaceMultipartContent):
+        Re-enable tile cache updates that were disabled in FrameView::clear().
+        This fixes the issue for WK1.
+
+        * page/FrameView.h:
+        Declare an exported function, didReplaceMultipartContent(), that WebKit
+        can call.
+
</ins><span class="cx"> 2015-05-27  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove unused ResourceRequest &quot;user initiated&quot; flag.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -762,6 +762,9 @@
</span><span class="cx">         return;
</span><span class="cx"> #endif
</span><span class="cx">     frameLoader-&gt;client().committedLoad(this, data, length);
</span><ins>+
+    if (isMultipartReplacingLoad())
+        frameLoader-&gt;client().didReplaceMultipartContent();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ResourceError DocumentLoader::interruptedForPolicyChangeError() const
</span><span class="lines">@@ -870,6 +873,8 @@
</span><span class="cx"> {
</span><span class="cx">     if (!mainResourceData())
</span><span class="cx">         return;
</span><ins>+
+    frameLoader()-&gt;client().willReplaceMultipartContent();
</ins><span class="cx">     
</span><span class="cx">     maybeFinishLoadingMultipartContent();
</span><span class="cx">     maybeCreateArchive();
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebCore/loader/EmptyClients.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -317,6 +317,9 @@
</span><span class="cx">     virtual void willChangeTitle(DocumentLoader*) override { }
</span><span class="cx">     virtual void didChangeTitle(DocumentLoader*) override { }
</span><span class="cx"> 
</span><ins>+    virtual void willReplaceMultipartContent() override { }
+    virtual void didReplaceMultipartContent() override { }
+
</ins><span class="cx">     virtual void committedLoad(DocumentLoader*, const char*, int) override { }
</span><span class="cx">     virtual void finishedLoading(DocumentLoader*) override { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderClient.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -199,6 +199,9 @@
</span><span class="cx">         virtual void willChangeTitle(DocumentLoader*) = 0;
</span><span class="cx">         virtual void didChangeTitle(DocumentLoader*) = 0;
</span><span class="cx"> 
</span><ins>+        virtual void willReplaceMultipartContent() = 0;
+        virtual void didReplaceMultipartContent() = 0;
+
</ins><span class="cx">         virtual void committedLoad(DocumentLoader*, const char*, int) = 0;
</span><span class="cx">         virtual void finishedLoading(DocumentLoader*) = 0;
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -419,6 +419,15 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void FrameView::didReplaceMultipartContent()
+{
+    // Re-enable tile updates that were disabled in clear().
+    if (LegacyTileCache* tileCache = legacyTileCache())
+        tileCache-&gt;setTilingMode(LegacyTileCache::Normal);
+}
+#endif
+
</ins><span class="cx"> bool FrameView::didFirstLayout() const
</span><span class="cx"> {
</span><span class="cx">     return !m_firstLayout;
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebCore/page/FrameView.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -345,6 +345,10 @@
</span><span class="cx">     void willPaintContents(GraphicsContext*, const IntRect&amp; dirtyRect, PaintingState&amp;);
</span><span class="cx">     void didPaintContents(GraphicsContext*, const IntRect&amp; dirtyRect, PaintingState&amp;);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    WEBCORE_EXPORT void didReplaceMultipartContent();
+#endif
+
</ins><span class="cx">     WEBCORE_EXPORT void setPaintBehavior(PaintBehavior);
</span><span class="cx">     WEBCORE_EXPORT PaintBehavior paintBehavior() const;
</span><span class="cx">     bool isPainting() const;
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-05-19  Jon Honeycutt  &lt;jhoneycutt@apple.com&gt;
+
+        [iOS] When viewing an MJPEG stream as the main resource, only the first
+        frame paints
+
+        &lt;https://bugs.webkit.org/show_bug.cgi?id=145185&gt;
+        &lt;rdar://problem/20124694&gt;
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebFrameLoaderClient.h:
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::didReplaceMultipartContent):
+        Call the FrameView's didReplaceMultipartContent().
+
</ins><span class="cx"> 2015-05-22  Jon Lee  &lt;jonlee@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix macros for wireless playback
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -140,6 +140,9 @@
</span><span class="cx">     virtual void willChangeTitle(WebCore::DocumentLoader*) override;
</span><span class="cx">     virtual void didChangeTitle(WebCore::DocumentLoader*) override;
</span><span class="cx"> 
</span><ins>+    virtual void willReplaceMultipartContent() override { }
+    virtual void didReplaceMultipartContent() override;
+
</ins><span class="cx">     virtual void committedLoad(WebCore::DocumentLoader*, const char*, int) override;
</span><span class="cx">     virtual void finishedLoading(WebCore::DocumentLoader*) override;
</span><span class="cx">     virtual void updateGlobalHistory() override;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -999,6 +999,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebFrameLoaderClient::didReplaceMultipartContent()
+{
+#if PLATFORM(IOS)
+    if (FrameView *view = core(m_webFrame.get())-&gt;view())
+        view-&gt;didReplaceMultipartContent();
+#endif
+}
+
</ins><span class="cx"> void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length)
</span><span class="cx"> {
</span><span class="cx">     NSData *nsData = [[NSData alloc] initWithBytesNoCopy:(void*)data length:length freeWhenDone:NO];
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit/win/ChangeLog        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-05-26  Jon Honeycutt  &lt;jhoneycutt@apple.com&gt;
+
+        [iOS] When viewing an MJPEG stream as the main resource, only the first
+        frame paints
+
+        &lt;https://bugs.webkit.org/show_bug.cgi?id=145185&gt;
+        &lt;rdar://problem/20124694&gt;
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        Stubbed new functions that aren't used on Windows.
+
</ins><span class="cx"> 2015-05-22  Jon Lee  &lt;jonlee@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename MediaPlaybackAllowsInline
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -127,6 +127,9 @@
</span><span class="cx">     virtual void willChangeTitle(WebCore::DocumentLoader*) override;
</span><span class="cx">     virtual void didChangeTitle(WebCore::DocumentLoader*) override;
</span><span class="cx"> 
</span><ins>+    virtual void willReplaceMultipartContent() override { }
+    virtual void didReplaceMultipartContent() override { }
+
</ins><span class="cx">     virtual void updateGlobalHistory() override;
</span><span class="cx">     virtual void updateGlobalHistoryRedirectLinks() override;
</span><span class="cx">     virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const override;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit2/ChangeLog        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-05-19  Jon Honeycutt  &lt;jhoneycutt@apple.com&gt;
+
+        [iOS] When viewing an MJPEG stream as the main resource, only the first
+        frame paints
+
+        &lt;https://bugs.webkit.org/show_bug.cgi?id=145185&gt;
+        &lt;rdar://problem/20124694&gt;
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
+        Tell the WebPage that we will replace multipart content.
+
+        (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
+        Tell the WebPage that we did replace multipart content.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+        * WebProcess/WebPage/DrawingArea.h:
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::willReplaceMultipartContent):
+        Save the exposed content rect.
+        (WebKit::WebPage::didReplaceMultipartContent):
+        Restore the exposed content rect that was saved before this load. This
+        fixes the issue for WK2.
+
+        * WebProcess/WebPage/WebPage.h:
+
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::exposedContentRect):
+
</ins><span class="cx"> 2015-05-22  Jon Lee  &lt;jonlee@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix macros for wireless playback
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -913,6 +913,22 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebFrameLoaderClient::willReplaceMultipartContent()
+{
+    WebPage* webPage = m_frame-&gt;page();
+    if (!webPage)
+        return;
+    webPage-&gt;willReplaceMultipartContent(*m_frame);
+}
+
+void WebFrameLoaderClient::didReplaceMultipartContent()
+{
+    WebPage* webPage = m_frame-&gt;page();
+    if (!webPage)
+        return;
+    webPage-&gt;didReplaceMultipartContent(*m_frame);
+}
+
</ins><span class="cx"> void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length)
</span><span class="cx"> {
</span><span class="cx">     if (!m_pluginView)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -123,7 +123,10 @@
</span><span class="cx">     
</span><span class="cx">     virtual void willChangeTitle(WebCore::DocumentLoader*) override;
</span><span class="cx">     virtual void didChangeTitle(WebCore::DocumentLoader*) override;
</span><del>-    
</del><ins>+
+    virtual void willReplaceMultipartContent() override;
+    virtual void didReplaceMultipartContent() override;
+
</ins><span class="cx">     virtual void committedLoad(WebCore::DocumentLoader*, const char*, int) override;
</span><span class="cx">     virtual void finishedLoading(WebCore::DocumentLoader*) override;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -94,6 +94,7 @@
</span><span class="cx">     virtual void addFence(const WebCore::MachSendRight&amp;) { }
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+    virtual WebCore::FloatRect exposedContentRect() const = 0;
</ins><span class="cx">     virtual void setExposedContentRect(const WebCore::FloatRect&amp;) = 0;
</span><span class="cx"> #endif
</span><span class="cx">     virtual void mainFrameScrollabilityChanged(bool) { }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -4571,6 +4571,28 @@
</span><span class="cx">     request-&gt;didCancel();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPage::willReplaceMultipartContent(const WebFrame&amp; frame)
+{
+#if PLATFORM(IOS)
+    if (!frame.isMainFrame())
+        return;
+
+    m_previousExposedContentRect = m_drawingArea-&gt;exposedContentRect();
+#endif
+}
+
+void WebPage::didReplaceMultipartContent(const WebFrame&amp; frame)
+{
+#if PLATFORM(IOS)
+    if (!frame.isMainFrame())
+        return;
+
+    // Restore the previous exposed content rect so that it remains fixed when replacing content
+    // from multipart/x-mixed-replace streams.
+    m_drawingArea-&gt;setExposedContentRect(m_previousExposedContentRect);
+#endif
+}
+
</ins><span class="cx"> void WebPage::didCommitLoad(WebFrame* frame)
</span><span class="cx"> {
</span><span class="cx">     if (!frame-&gt;isMainFrame())
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -253,6 +253,8 @@
</span><span class="cx">     void didStartPageTransition();
</span><span class="cx">     void didCompletePageTransition();
</span><span class="cx">     void didCommitLoad(WebFrame*);
</span><ins>+    void willReplaceMultipartContent(const WebFrame&amp;);
+    void didReplaceMultipartContent(const WebFrame&amp;);
</ins><span class="cx">     void didFinishLoad(WebFrame*);
</span><span class="cx">     void show();
</span><span class="cx">     String userAgent(const WebCore::URL&amp;) const;
</span><span class="lines">@@ -1337,6 +1339,7 @@
</span><span class="cx">     HashMap&lt;std::pair&lt;WebCore::IntSize, double&gt;, WebCore::IntPoint&gt; m_dynamicSizeUpdateHistory;
</span><span class="cx">     RefPtr&lt;WebCore::Node&gt; m_pendingSyntheticClickNode;
</span><span class="cx">     WebCore::FloatPoint m_pendingSyntheticClickLocation;
</span><ins>+    WebCore::FloatRect m_previousExposedContentRect;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     WebInspectorClient* m_inspectorClient;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -92,6 +92,7 @@
</span><span class="cx">     virtual void acceleratedAnimationDidEnd(uint64_t layerID, const String&amp; key) override;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+    virtual WebCore::FloatRect exposedContentRect() const override;
</ins><span class="cx">     virtual void setExposedContentRect(const WebCore::FloatRect&amp;) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (184946 => 184947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2015-05-28 07:27:13 UTC (rev 184946)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2015-05-28 07:34:21 UTC (rev 184947)
</span><span class="lines">@@ -235,6 +235,15 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+WebCore::FloatRect RemoteLayerTreeDrawingArea::exposedContentRect() const
+{
+    FrameView* frameView = m_webPage.mainFrameView();
+    if (!frameView)
+        return FloatRect();
+
+    return frameView-&gt;exposedContentRect();
+}
+
</ins><span class="cx"> void RemoteLayerTreeDrawingArea::setExposedContentRect(const FloatRect&amp; exposedContentRect)
</span><span class="cx"> {
</span><span class="cx">     FrameView* frameView = m_webPage.mainFrameView();
</span></span></pre>
</div>
</div>

</body>
</html>