<!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>[161541] 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/161541">161541</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-08 19:56:47 -0800 (Wed, 08 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/161532">r161532</a>.
http://trac.webkit.org/changeset/161532
https://bugs.webkit.org/show_bug.cgi?id=126677
Caused lots of assertion failures (Requested by ap on
#webkit).
Source/WebCore:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::callReadyStateChangeListener):
(WebCore::XMLHttpRequest::createRequest):
(WebCore::XMLHttpRequest::abort):
(WebCore::XMLHttpRequest::networkError):
(WebCore::XMLHttpRequest::abortError):
(WebCore::XMLHttpRequest::didSendData):
(WebCore::XMLHttpRequest::didReceiveData):
(WebCore::XMLHttpRequest::didTimeout):
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchEventAndLoadEnd):
(WebCore::XMLHttpRequestProgressEventThrottle::flushProgressEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::fired):
(WebCore::XMLHttpRequestProgressEventThrottle::hasEventToDispatch):
(WebCore::XMLHttpRequestProgressEventThrottle::suspend):
* xml/XMLHttpRequestProgressEventThrottle.h:
* xml/XMLHttpRequestUpload.cpp:
(WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
(WebCore::XMLHttpRequestUpload::dispatchEventAndLoadEnd):
* xml/XMLHttpRequestUpload.h:
LayoutTests:
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/xmlhttprequest/loadstart-event-init-expected.txt: Removed.
* http/tests/xmlhttprequest/loadstart-event-init.html: Removed.
* http/tests/xmlhttprequest/onabort-progressevent-attributes-expected.txt: Removed.
* http/tests/xmlhttprequest/onabort-progressevent-attributes.html: Removed.
* http/tests/xmlhttprequest/onload-progressevent-attributes-expected.txt: Removed.
* http/tests/xmlhttprequest/onload-progressevent-attributes.html: Removed.
* http/tests/xmlhttprequest/upload-onabort-progressevent-attributes-expected.txt: Removed.
* http/tests/xmlhttprequest/upload-onabort-progressevent-attributes.html: Removed.
* http/tests/xmlhttprequest/upload-onload-progressevent-attributes-expected.txt: Removed.
* http/tests/xmlhttprequest/upload-onload-progressevent-attributes.html: Removed.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastxmlhttprequestxmlhttprequestgetexpectedtxt">trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestcpp">trunk/Source/WebCore/xml/XMLHttpRequest.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequesth">trunk/Source/WebCore/xml/XMLHttpRequest.h</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestProgressEventThrottlecpp">trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestProgressEventThrottleh">trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestUploadcpp">trunk/Source/WebCore/xml/XMLHttpRequestUpload.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestUploadh">trunk/Source/WebCore/xml/XMLHttpRequestUpload.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestloadstarteventinitexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/loadstart-event-init-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestloadstarteventinithtml">trunk/LayoutTests/http/tests/xmlhttprequest/loadstart-event-init.html</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestonabortprogresseventattributesexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestonabortprogresseventattributeshtml">trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestonloadprogresseventattributesexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/onload-progressevent-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestonloadprogresseventattributeshtml">trunk/LayoutTests/http/tests/xmlhttprequest/onload-progressevent-attributes.html</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestuploadonabortprogresseventattributesexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/upload-onabort-progressevent-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestuploadonabortprogresseventattributeshtml">trunk/LayoutTests/http/tests/xmlhttprequest/upload-onabort-progressevent-attributes.html</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestuploadonloadprogresseventattributesexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/upload-onload-progressevent-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestuploadonloadprogresseventattributeshtml">trunk/LayoutTests/http/tests/xmlhttprequest/upload-onload-progressevent-attributes.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/ChangeLog        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-01-08 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r161532.
+ http://trac.webkit.org/changeset/161532
+ https://bugs.webkit.org/show_bug.cgi?id=126677
+
+ Caused lots of assertion failures (Requested by ap on
+ #webkit).
+
+ * fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
+ * http/tests/xmlhttprequest/loadstart-event-init-expected.txt: Removed.
+ * http/tests/xmlhttprequest/loadstart-event-init.html: Removed.
+ * http/tests/xmlhttprequest/onabort-progressevent-attributes-expected.txt: Removed.
+ * http/tests/xmlhttprequest/onabort-progressevent-attributes.html: Removed.
+ * http/tests/xmlhttprequest/onload-progressevent-attributes-expected.txt: Removed.
+ * http/tests/xmlhttprequest/onload-progressevent-attributes.html: Removed.
+ * http/tests/xmlhttprequest/upload-onabort-progressevent-attributes-expected.txt: Removed.
+ * http/tests/xmlhttprequest/upload-onabort-progressevent-attributes.html: Removed.
+ * http/tests/xmlhttprequest/upload-onload-progressevent-attributes-expected.txt: Removed.
+ * http/tests/xmlhttprequest/upload-onload-progressevent-attributes.html: Removed.
+
</ins><span class="cx"> 2014-01-08 Jinwoo Song <jinwoo7.song@samsung.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed EFL gardening. Rebaseline after r161521.
</span></span></pre></div>
<a id="trunkLayoutTestsfastxmlhttprequestxmlhttprequestgetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -53,9 +53,9 @@
</span><span class="cx"> initEvent : 'function initEvent() {
</span><span class="cx"> [native code]
</span><span class="cx"> }'
</span><del>-lengthComputable : 'true'
-loaded : '174'
-position : '174'
</del><ins>+lengthComputable : 'false'
+loaded : '0'
+position : '0'
</ins><span class="cx"> preventDefault : 'function preventDefault() {
</span><span class="cx"> [native code]
</span><span class="cx"> }'
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> [native code]
</span><span class="cx"> }'
</span><span class="cx"> target : '[object XMLHttpRequest]'
</span><del>-total : '174'
-totalSize : '174'
</del><ins>+total : '0'
+totalSize : '0'
</ins><span class="cx"> type : 'load'
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestloadstarteventinitexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/loadstart-event-init-expected.txt (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/loadstart-event-init-expected.txt        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/loadstart-event-init-expected.txt        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,3 +0,0 @@
</span><del>-
-PASS XMLHttpRequest: ensure loadstart event progress members are correctly initialized
-
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestloadstarteventinithtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/loadstart-event-init.html (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/loadstart-event-init.html        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/loadstart-event-init.html        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
- <title>XMLHttpRequest: ensure loadstart event progress members are correctly initialized</title>
- <script src="/js-test-resources/testharness.js"></script>
- <script src="/js-test-resources/testharnessreport.js"></script>
-</head>
-
-<body>
- <div id="log"></div>
-
- <script type="text/javascript">
- var test = async_test()
- test.step(function() {
- var count = 0;
- var xhr = new XMLHttpRequest();
-
- xhr.onloadstart = test.step_func(function(e)
- {
- assert_equals(e.loaded, 0, "loaded member of xhr.loadstart event should be 0")
- if (count == 1) {
- test.done();
- }
- })
-
- xhr.upload.onloadstart = test.step_func(function(e)
- {
- assert_equals(e.loaded, 0, "loaded member of xhr.upload.loadstart event should be 0");
- })
-
- xhr.onloadend = function(e)
- {
- if (count++ < 1) {
- xhr.open("POST", "./resources/content.php", true);
- xhr.send("test");
- }
- }
-
- xhr.open("POST", "./resources/content.php", true);
- xhr.send("test");
- });
- </script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestonabortprogresseventattributesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes-expected.txt (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes-expected.txt        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes-expected.txt        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-Test case for bug 120828: Correctly set XHR loadend attributes (loaded and total).
-
-Verify that abort and loadend events have their ProgressEvent attributes (loaded, total and lengthComputable) correctly set.
-
-PASS
-
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestonabortprogresseventattributeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-<html>
-<head>
-<title>Test case for bug 120828 (abort case)</title>
-</head>
-<body>
-<p>Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=120828"> bug 120828</a>: Correctly set XHR loadend attributes (loaded and total).</p>
-<p>Verify that abort and loadend events have their ProgressEvent attributes (loaded, total and lengthComputable) correctly set.</p>
-<p id=console></p>
-<script type="text/javascript">
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
-
-var status = "PASS";
-var total = 0;
-var loaded = 0;
-
-function onProgressEvent(e)
-{
- if (total != e.total || loaded != e.loaded)
- fail("Event " + e.type + "total/loaded values not matching: "
- + "(" + e.loaded + " / " + e.total + "), expected (" + loaded + " / " + total + ")");
-}
-
-function onUnexpectedProgressEvent(e)
-{
- fail("unexpected ProgressEvent: " + e.type);
-}
-
-function fail(msg)
-{
- status = "FAILED: " + msg;
- completeTest();
- status = "";
-}
-
-function completeTest()
-{
- log(status);
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-function test()
-{
- var iteration = 2;
- var delay = "1000";
-
- var req = new XMLHttpRequest();
- req.onprogress = function(e){
- total = e.total;
- loaded = e.loaded;
- req.abort();
- };
- req.onerror = onUnexpectedProgressEvent;
- req.onabort = onProgressEvent;
- req.onloadend = function(e) {
- onProgressEvent(e);
- completeTest();
- }
- req.open("GET", "resources/download-with-delay.php?iteration=" + iteration + "&delay=" + delay, true);
- req.send(null);
-
-}
-
-function log(message)
-{
- var consoleElt = document.getElementById("console");
- consoleElt.innerHTML += message + "<br/>";
-}
-
-test();
-
-</script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestonloadprogresseventattributesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/onload-progressevent-attributes-expected.txt (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/onload-progressevent-attributes-expected.txt        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onload-progressevent-attributes-expected.txt        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-Test case for bug 120828: Correctly set XHR loadend attributes (loaded and total).
-
-Verify that load and loadend events have their ProgressEvent attributes (loaded, total and lengthComputable) correctly set.
-
-PASS
-
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestonloadprogresseventattributeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/onload-progressevent-attributes.html (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/onload-progressevent-attributes.html        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onload-progressevent-attributes.html        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,78 +0,0 @@
</span><del>-<html>
-<head>
-<title>Test case for bug 120828</title>
-</head>
-<body>
-<p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=120828"> bug 120828</a>: Correctly set XHR loadend attributes (loaded and total).</p>
-<p> Verify that load and loadend events have their ProgressEvent attributes (loaded, total and lengthComputable) correctly set.</p>
-<p id=console></p>
-<script type="text/javascript">
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
-
-var status = "PASS";
-var total = 0;
-var loaded = 0;
-
-function onProgressEvent(e)
-{
- if (total != e.total || loaded != e.loaded)
- fail("Event " + e.type + " total/loaded values not matching: "
- + "(" + e.loaded + " / " + e.total + "), expected (" + loaded + " / " + total + ")");
-}
-
-function onUnexpectedProgressEvent(e)
-{
- fail("unexpected ProgressEvent: " + e.type);
-}
-
-function fail(msg)
-{
- status = "FAILED: " + msg;
- completeTest();
- status = "";
-}
-
-function completeTest()
-{
- log(status);
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-function test()
-{
- var req = new XMLHttpRequest();
- req.onreadystatechange = function(e) {
- if (req.readyState == req.DONE) {
- if (this.status == 200)
- total = loaded = req.responseText.length;
- else
- fail("unexpected status: " + status);
- }
- }
- req.onabort = onUnexpectedProgressEvent;
- req.onerror = onUnexpectedProgressEvent;
- req.onload = onProgressEvent;
- req.onloadend = function(e) {
- onProgressEvent(e);
- completeTest();
- }
-
- req.open("GET", "resources/get.txt", true);
- req.send();
-}
-
-function log(message)
-{
- var consoleElt = document.getElementById("console");
- consoleElt.innerHTML += message + "<br/>";
-}
-
-test();
-
-</script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestuploadonabortprogresseventattributesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/upload-onabort-progressevent-attributes-expected.txt (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/upload-onabort-progressevent-attributes-expected.txt        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/upload-onabort-progressevent-attributes-expected.txt        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-Test case for bug 120828: Correctly set XHR loadend attributes (loaded and total).
-
-Upload case: verify that abort and loadend events have their ProgressEvent attributes (loaded, total and lengthComputable) correctly set.
-
-PASS
-
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestuploadonabortprogresseventattributeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/upload-onabort-progressevent-attributes.html (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/upload-onabort-progressevent-attributes.html        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/upload-onabort-progressevent-attributes.html        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,78 +0,0 @@
</span><del>-<html>
-<head>
-<title>Test case for bug 120828 (abort case)</title>
-</head>
-<body>
-<p>Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=120828"> bug 120828</a>: Correctly set XHR loadend attributes (loaded and total).</p>
-<p>Upload case: verify that abort and loadend events have their ProgressEvent attributes (loaded, total and lengthComputable) correctly set.</p>
-<p id=console></p>
-<script type="text/javascript">
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
-
-var status = "PASS";
-var total = 1;
-var loaded = 1;
-var uploadedData = "d";
-
-function onProgressEvent(e)
-{
- if (!e.lengthComputable)
- fail("Event " + e.type + " lengthComputable is false");
- if (e.total != total || e.loaded != loaded)
- fail("Event " + e.type + " total/loaded values not matching: "
- + "(" + e.loaded + " / " + e.total + "), expected (" + loaded + " / " + total + ")");
-}
-
-function onUnexpectedProgressEvent(e)
-{
- fail("unexpected ProgressEvent: " + e.type);
-}
-
-function fail(msg)
-{
- status = "FAILED: " + msg;
- completeTest();
- status = "";
-}
-
-function completeTest()
-{
- log(status);
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-function test()
-{
- var req = new XMLHttpRequest();
- req.upload.onerror = onUnexpectedProgressEvent;
- req.upload.onload = onUnexpectedProgressEvent;
- req.upload.onabort = onProgressEvent;
- req.upload.onprogress = function(e) {
- onProgressEvent(e);
- req.abort();
- }
- req.upload.onloadend = function(e) {
- onProgressEvent(e);
- completeTest();
- }
-
- req.open("POST", "resources/post-echo.cgi", true);
- req.send(uploadedData);
-}
-
-
-function log(message)
-{
- var consoleElt = document.getElementById("console");
- consoleElt.innerHTML += message + "<br/>";
-}
-
-test();
-
-</script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestuploadonloadprogresseventattributesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/upload-onload-progressevent-attributes-expected.txt (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/upload-onload-progressevent-attributes-expected.txt        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/upload-onload-progressevent-attributes-expected.txt        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-Test case for bug 120828: Correctly set XHR loadend attributes (loaded and total).
-
-Upload case: verify that load and loadend events have their ProgressEvent attributes (loaded, total and lengthComputable) correctly set.
-
-PASS
-
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestuploadonloadprogresseventattributeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/upload-onload-progressevent-attributes.html (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/upload-onload-progressevent-attributes.html        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/upload-onload-progressevent-attributes.html        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,74 +0,0 @@
</span><del>-<html>
-<head>
-<title>Test case for bug 120828</title>
-</head>
-<body>
-<p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=120828"> bug 120828</a>: Correctly set XHR loadend attributes (loaded and total).</p>
-<p> Upload case: verify that load and loadend events have their ProgressEvent attributes (loaded, total and lengthComputable) correctly set.</p>
-<p id=console></p>
-<script type="text/javascript">
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
-
-var status = "PASS";
-var total = 1;
-var loaded = 1;
-var uploadedData = "d";
-
-function onProgressEvent(e)
-{
- if (!e.lengthComputable)
- fail("Event " + e.type + "event lengthComputable = false");
- if (e.total != total || e.loaded != loaded)
- fail("Event " + e.type + "total/loaded values not matching: "
- + "(" + e.loaded + " / " + e.total + "), expected (" + loaded + " / " + total + ")");
-}
-
-function onUnexpectedProgressEvent(e)
-{
- fail("unexpected ProgressEvent: " + e.type);
-}
-
-function fail(msg)
-{
- status = "FAILED: " + msg;
- completeTest();
- status = "";
-}
-
-function completeTest()
-{
- log(status);
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-function test()
-{
- var req = new XMLHttpRequest();
- req.upload.onabort = onUnexpectedProgressEvent;
- req.upload.onerror = onUnexpectedProgressEvent;
- req.upload.onprogress = onProgressEvent;
- req.upload.onload = onProgressEvent;
- req.upload.onloadend = function(e) {
- onProgressEvent(e);
- completeTest();
- }
-
- req.open("POST", "resources/post-echo.cgi", true);
- req.send(uploadedData);
-}
-
-function log(message)
-{
- var consoleElt = document.getElementById("console");
- consoleElt.innerHTML += message + "<br/>";
-}
-
-test();
-
-</script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/Source/WebCore/ChangeLog        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-01-08 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r161532.
+ http://trac.webkit.org/changeset/161532
+ https://bugs.webkit.org/show_bug.cgi?id=126677
+
+ Caused lots of assertion failures (Requested by ap on
+ #webkit).
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::callReadyStateChangeListener):
+ (WebCore::XMLHttpRequest::createRequest):
+ (WebCore::XMLHttpRequest::abort):
+ (WebCore::XMLHttpRequest::networkError):
+ (WebCore::XMLHttpRequest::abortError):
+ (WebCore::XMLHttpRequest::didSendData):
+ (WebCore::XMLHttpRequest::didReceiveData):
+ (WebCore::XMLHttpRequest::didTimeout):
+ * xml/XMLHttpRequest.h:
+ * xml/XMLHttpRequestProgressEventThrottle.cpp:
+ (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle):
+ (WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent):
+ (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEventAndLoadEnd):
+ (WebCore::XMLHttpRequestProgressEventThrottle::flushProgressEvent):
+ (WebCore::XMLHttpRequestProgressEventThrottle::fired):
+ (WebCore::XMLHttpRequestProgressEventThrottle::hasEventToDispatch):
+ (WebCore::XMLHttpRequestProgressEventThrottle::suspend):
+ * xml/XMLHttpRequestProgressEventThrottle.h:
+ * xml/XMLHttpRequestUpload.cpp:
+ (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
+ (WebCore::XMLHttpRequestUpload::dispatchEventAndLoadEnd):
+ * xml/XMLHttpRequestUpload.h:
+
</ins><span class="cx"> 2014-01-08 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Clean up confusing names and calculations in image-dragging functions
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -430,14 +430,14 @@
</span><span class="cx"> InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(scriptExecutionContext(), this);
</span><span class="cx">
</span><span class="cx"> if (m_async || (m_state <= OPENED || m_state == DONE))
</span><del>- m_progressEventThrottle.dispatchReadyStateChangeEvent(Event::create(eventNames().readystatechangeEvent, false, false), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
</del><ins>+ m_progressEventThrottle.dispatchReadyStateChangeEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
</ins><span class="cx">
</span><span class="cx"> InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie);
</span><span class="cx"> if (m_state == DONE && !m_error) {
</span><span class="cx"> InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRLoadEvent(scriptExecutionContext(), this);
</span><del>- m_progressEventThrottle.dispatchProgressEvent(eventNames().loadEvent);
</del><ins>+ m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
</ins><span class="cx"> InspectorInstrumentation::didDispatchXHRLoadEvent(cookie);
</span><del>- m_progressEventThrottle.dispatchProgressEvent(eventNames().loadendEvent);
</del><ins>+ m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadendEvent));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -765,10 +765,10 @@
</span><span class="cx"> // Also, only async requests support upload progress events.
</span><span class="cx"> bool uploadEvents = false;
</span><span class="cx"> if (m_async) {
</span><del>- m_progressEventThrottle.dispatchProgressEvent(eventNames().loadstartEvent);
</del><ins>+ m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
</ins><span class="cx"> if (m_requestEntityBody && m_upload) {
</span><span class="cx"> uploadEvents = m_upload->hasEventListeners();
</span><del>- m_upload->dispatchProgressEvent(eventNames().loadstartEvent);
</del><ins>+ m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -862,7 +862,12 @@
</span><span class="cx"> m_state = UNSENT;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- dispatchErrorEvents(eventNames().abortEvent);
</del><ins>+ m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
+ if (!m_uploadComplete) {
+ m_uploadComplete = true;
+ if (m_upload && m_uploadEventsAllowed)
+ m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void XMLHttpRequest::internalAbort()
</span><span class="lines">@@ -923,14 +928,24 @@
</span><span class="cx"> void XMLHttpRequest::networkError()
</span><span class="cx"> {
</span><span class="cx"> genericError();
</span><del>- dispatchErrorEvents(eventNames().errorEvent);
</del><ins>+ if (!m_uploadComplete) {
+ m_uploadComplete = true;
+ if (m_upload && m_uploadEventsAllowed)
+ m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().errorEvent));
+ }
+ m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().errorEvent));
</ins><span class="cx"> internalAbort();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void XMLHttpRequest::abortError()
</span><span class="cx"> {
</span><span class="cx"> genericError();
</span><del>- dispatchErrorEvents(eventNames().abortEvent);
</del><ins>+ if (!m_uploadComplete) {
+ m_uploadComplete = true;
+ if (m_upload && m_uploadEventsAllowed)
+ m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
+ }
+ m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void XMLHttpRequest::dropProtection()
</span><span class="lines">@@ -1164,13 +1179,12 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (m_uploadEventsAllowed)
</span><del>- m_upload->dispatchThrottledProgressEvent(true, bytesSent, totalBytesToBeSent);
</del><ins>+ m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, true, bytesSent, totalBytesToBeSent));
+
</ins><span class="cx"> if (bytesSent == totalBytesToBeSent && !m_uploadComplete) {
</span><span class="cx"> m_uploadComplete = true;
</span><del>- if (m_uploadEventsAllowed) {
- m_upload->dispatchProgressEvent(eventNames().loadEvent);
- m_upload->dispatchProgressEvent(eventNames().loadendEvent);
- }
</del><ins>+ if (m_uploadEventsAllowed)
+ m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1228,13 +1242,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_error) {
</span><ins>+ long long expectedLength = m_response.expectedContentLength();
</ins><span class="cx"> m_receivedLength += len;
</span><span class="cx">
</span><span class="cx"> if (m_async) {
</span><del>- long long expectedLength = m_response.expectedContentLength();
</del><span class="cx"> bool lengthComputable = expectedLength > 0 && m_receivedLength <= expectedLength;
</span><span class="cx"> unsigned long long total = lengthComputable ? expectedLength : 0;
</span><del>- m_progressEventThrottle.dispatchThrottledProgressEvent(lengthComputable, m_receivedLength, total);
</del><ins>+ m_progressEventThrottle.dispatchProgressEvent(lengthComputable, m_receivedLength, total);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (m_state != LOADING)
</span><span class="lines">@@ -1245,19 +1259,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequest::dispatchErrorEvents(const AtomicString& type)
-{
- if (!m_uploadComplete) {
- m_uploadComplete = true;
- if (m_upload && m_uploadEventsAllowed) {
- m_upload->dispatchProgressEvent(type);
- m_upload->dispatchProgressEvent(eventNames().loadendEvent);
- }
- }
- m_progressEventThrottle.dispatchProgressEvent(type);
- m_progressEventThrottle.dispatchProgressEvent(eventNames().loadendEvent);
-}
-
</del><span class="cx"> #if ENABLE(XHR_TIMEOUT)
</span><span class="cx"> void XMLHttpRequest::didTimeout()
</span><span class="cx"> {
</span><span class="lines">@@ -1279,7 +1280,12 @@
</span><span class="cx">
</span><span class="cx"> changeState(DONE);
</span><span class="cx">
</span><del>- dispatchErrorEvents(eventNames().timeoutEvent);
</del><ins>+ if (!m_uploadComplete) {
+ m_uploadComplete = true;
+ if (m_upload && m_uploadEventsAllowed)
+ m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().timeoutEvent));
+ }
+ m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().timeoutEvent));
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.h (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.h        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.h        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -208,8 +208,6 @@
</span><span class="cx">
</span><span class="cx"> bool shouldDecodeResponse() const { return m_responseTypeCode < FirstBinaryResponseType; }
</span><span class="cx">
</span><del>- void dispatchErrorEvents(const AtomicString&);
-
</del><span class="cx"> std::unique_ptr<XMLHttpRequestUpload> m_upload;
</span><span class="cx">
</span><span class="cx"> URL m_url;
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestProgressEventThrottlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -36,8 +36,6 @@
</span><span class="cx">
</span><span class="cx"> XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(EventTarget* target)
</span><span class="cx"> : m_target(target)
</span><del>- , m_hasThrottledProgressEvent(false)
- , m_lengthComputable(false)
</del><span class="cx"> , m_loaded(0)
</span><span class="cx"> , m_total(0)
</span><span class="cx"> , m_deferEvents(false)
</span><span class="lines">@@ -50,12 +48,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total)
</del><ins>+void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total)
</ins><span class="cx"> {
</span><del>- m_lengthComputable = lengthComputable;
- m_loaded = loaded;
- m_total = total;
-
</del><span class="cx"> if (m_deferEvents) {
</span><span class="cx"> // Only store the latest progress event while suspended.
</span><span class="cx"> m_deferredProgressEvent = XMLHttpRequestProgressEvent::create(eventNames().progressEvent, lengthComputable, loaded, total);
</span><span class="lines">@@ -72,12 +66,13 @@
</span><span class="cx">
</span><span class="cx"> dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, lengthComputable, loaded, total));
</span><span class="cx"> startRepeating(minimumProgressEventDispatchingIntervalInSeconds);
</span><del>- m_hasThrottledProgressEvent = false;
</del><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // The timer is already active so minimumProgressEventDispatchingIntervalInSeconds is the least frequent event.
</span><del>- m_hasThrottledProgressEvent = true;
</del><ins>+ m_lengthComputable = lengthComputable;
+ m_loaded = loaded;
+ m_total = total;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefPtr<Event> event, ProgressEventAction progressEventAction)
</span><span class="lines">@@ -101,17 +96,12 @@
</span><span class="cx"> m_target->dispatchEvent(event);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicString &type)
</del><ins>+void XMLHttpRequestProgressEventThrottle::dispatchEventAndLoadEnd(PassRefPtr<Event> event)
</ins><span class="cx"> {
</span><del>- ASSERT(type == eventNames().loadEvent || type == eventNames().loadstartEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent);
</del><ins>+ ASSERT(event->type() == eventNames().loadEvent || event->type() == eventNames().abortEvent || event->type() == eventNames().errorEvent || event->type() == eventNames().timeoutEvent);
</ins><span class="cx">
</span><del>- if (type == eventNames().loadstartEvent) {
- m_lengthComputable = false;
- m_loaded = 0;
- m_total = 0;
- }
-
- dispatchEvent(XMLHttpRequestProgressEvent::create(type, m_lengthComputable, m_loaded, m_total));
</del><ins>+ dispatchEvent(event);
+ dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadendEvent));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void XMLHttpRequestProgressEventThrottle::flushProgressEvent()
</span><span class="lines">@@ -125,8 +115,10 @@
</span><span class="cx">
</span><span class="cx"> if (!hasEventToDispatch())
</span><span class="cx"> return;
</span><ins>+
</ins><span class="cx"> PassRefPtr<Event> event = XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total);
</span><del>- m_hasThrottledProgressEvent = false;
</del><ins>+ m_loaded = 0;
+ m_total = 0;
</ins><span class="cx">
</span><span class="cx"> // We stop the timer as this is called when no more events are supposed to occur.
</span><span class="cx"> stop();
</span><span class="lines">@@ -168,12 +160,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total));
</span><del>- m_hasThrottledProgressEvent = false;
</del><ins>+ m_total = 0;
+ m_loaded = 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool XMLHttpRequestProgressEventThrottle::hasEventToDispatch() const
</span><span class="cx"> {
</span><del>- return m_hasThrottledProgressEvent && isActive();
</del><ins>+ return (m_total || m_loaded) && isActive();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void XMLHttpRequestProgressEventThrottle::suspend()
</span><span class="lines">@@ -194,7 +187,8 @@
</span><span class="cx"> // just defer it.
</span><span class="cx"> if (hasEventToDispatch()) {
</span><span class="cx"> m_deferredProgressEvent = XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total);
</span><del>- m_hasThrottledProgressEvent = false;
</del><ins>+ m_total = 0;
+ m_loaded = 0;
</ins><span class="cx"> }
</span><span class="cx"> stop();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestProgressEventThrottleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "Timer.h"
</span><span class="cx"> #include "wtf/PassRefPtr.h"
</span><span class="cx"> #include "wtf/Vector.h"
</span><del>-#include <wtf/Forward.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -49,10 +48,10 @@
</span><span class="cx"> explicit XMLHttpRequestProgressEventThrottle(EventTarget*);
</span><span class="cx"> virtual ~XMLHttpRequestProgressEventThrottle();
</span><span class="cx">
</span><del>- void dispatchThrottledProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total);
</del><ins>+ void dispatchProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total);
</ins><span class="cx"> void dispatchReadyStateChangeEvent(PassRefPtr<Event>, ProgressEventAction = DoNotFlushProgressEvent);
</span><span class="cx"> void dispatchEvent(PassRefPtr<Event>);
</span><del>- void dispatchProgressEvent(const AtomicString&);
</del><ins>+ void dispatchEventAndLoadEnd(PassRefPtr<Event>);
</ins><span class="cx">
</span><span class="cx"> void suspend();
</span><span class="cx"> void resume();
</span><span class="lines">@@ -69,7 +68,6 @@
</span><span class="cx"> // Weak pointer to our XMLHttpRequest object as it is the one holding us.
</span><span class="cx"> EventTarget* m_target;
</span><span class="cx">
</span><del>- bool m_hasThrottledProgressEvent;
</del><span class="cx"> bool m_lengthComputable;
</span><span class="cx"> unsigned long long m_loaded;
</span><span class="cx"> unsigned long long m_total;
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestUploadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequestUpload.cpp (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequestUpload.cpp        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/Source/WebCore/xml/XMLHttpRequestUpload.cpp        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -36,33 +36,17 @@
</span><span class="cx">
</span><span class="cx"> XMLHttpRequestUpload::XMLHttpRequestUpload(XMLHttpRequest* xmlHttpRequest)
</span><span class="cx"> : m_xmlHttpRequest(xmlHttpRequest)
</span><del>- , m_lengthComputable(false)
- , m_loaded(0)
- , m_total(0)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequestUpload::dispatchThrottledProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total)
</del><ins>+void XMLHttpRequestUpload::dispatchEventAndLoadEnd(PassRefPtr<Event> event)
</ins><span class="cx"> {
</span><del>- m_lengthComputable = lengthComputable;
- m_loaded = loaded;
- m_total = total;
</del><ins>+ ASSERT(event->type() == eventNames().loadEvent || event->type() == eventNames().abortEvent || event->type() == eventNames().errorEvent || event->type() == eventNames().timeoutEvent);
</ins><span class="cx">
</span><del>- dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, lengthComputable, loaded, total));
</del><ins>+ dispatchEvent(event);
+ dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadendEvent));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void XMLHttpRequestUpload::dispatchProgressEvent(const AtomicString &type)
-{
- ASSERT(type == eventNames().loadEvent || type == eventNames().loadstartEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent);
</del><span class="cx">
</span><del>- if (type == eventNames().loadstartEvent) {
- m_lengthComputable = false;
- m_loaded = 0;
- m_total = 0;
- }
</del><span class="cx">
</span><del>- dispatchEvent(XMLHttpRequestProgressEvent::create(type, m_lengthComputable, m_loaded, m_total));
-}
-
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestUploadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequestUpload.h (161540 => 161541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequestUpload.h        2014-01-09 03:49:38 UTC (rev 161540)
+++ trunk/Source/WebCore/xml/XMLHttpRequestUpload.h        2014-01-09 03:56:47 UTC (rev 161541)
</span><span class="lines">@@ -55,17 +55,13 @@
</span><span class="cx"> DEFINE_ATTRIBUTE_EVENT_LISTENER(loadstart);
</span><span class="cx"> DEFINE_ATTRIBUTE_EVENT_LISTENER(progress);
</span><span class="cx">
</span><del>- void dispatchThrottledProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total);
- void dispatchProgressEvent(const AtomicString &type);
</del><ins>+ void dispatchEventAndLoadEnd(PassRefPtr<Event>);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual void refEventTarget() OVERRIDE FINAL { ref(); }
</span><span class="cx"> virtual void derefEventTarget() OVERRIDE FINAL { deref(); }
</span><span class="cx">
</span><span class="cx"> XMLHttpRequest* m_xmlHttpRequest;
</span><del>- bool m_lengthComputable;
- unsigned long long m_loaded;
- unsigned long long m_total;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>
</body>
</html>