ProgressEvent should not be cancelable
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 06:04:29 +0000 (06:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 06:04:29 +0000 (06:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114444

Patch by Praveen R Jadhav <praveen.j@samsung.com> on 2013-05-29
Reviewed by Darin Adler.

Source/WebCore:

Parameter "cancelable" in ProgressEvent is set to false, by default, as mentioned in the specification. The spec link is given below.

Spec: http://www.w3.org/TR/2011/CR-progress-events-20110922/#suggested-names-for-events-using-the-progressevent-interface

No new tests. file-reader-event-listener.html and infoOnProgressEvent-expected.txt are updated.

* dom/ProgressEvent.cpp:
(WebCore::ProgressEvent::ProgressEvent):
(WebCore):

LayoutTests:

file-reader-event-listener.html, xmlhttprequest-get-expected.txt and infoOnProgressEvent-expected.txt are updated.

* fast/files/file-reader-event-listener-expected.txt:
* fast/files/file-reader-event-listener.html:
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt:
* platform/efl/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/fast/files/file-reader-event-listener-expected.txt
LayoutTests/fast/files/file-reader-event-listener.html
LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt
LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt
LayoutTests/platform/efl/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/ProgressEvent.cpp

index 03bdb89..2ab8647 100644 (file)
@@ -1,3 +1,18 @@
+2013-05-29  Praveen R Jadhav  <praveen.j@samsung.com>
+
+        ProgressEvent should not be cancelable
+        https://bugs.webkit.org/show_bug.cgi?id=114444
+
+        Reviewed by Darin Adler.
+
+        file-reader-event-listener.html, xmlhttprequest-get-expected.txt and infoOnProgressEvent-expected.txt are updated.
+
+        * fast/files/file-reader-event-listener-expected.txt:
+        * fast/files/file-reader-event-listener.html:
+        * fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
+        * http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt:
+        * platform/efl/TestExpectations:
+
 2013-05-29  Dean Jackson  <dino@apple.com>
 
         -webkit-text-underline-position should not be inherited
index 1639fec..7be7056 100644 (file)
@@ -1,9 +1,13 @@
-
 Test that FileReader's event listener works.
 Received loadstart event
 Received foo event
+PASS event.bubbles is false
+PASS event.cancelable is false
+PASS event.defaultPrevented is false
 Received progress event
 Received load event
 Received loadend event
-DONE
+PASS successfullyParsed is true
+
+TEST COMPLETE
 
index eea086b..3d0a350 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE html>
 <html>
 <body>
-<input type="file" name="file" id="file" onchange="onInputFileChange()">
 <pre id='console'></pre>
+<script src="../js/resources/js-test-pre.js"></script>
 
 <script>
 var fileReader;
@@ -24,9 +24,14 @@ function onLoadStart()
     fileReader.dispatchEvent(event);
 }
 
-function onProgress()
+function onProgress(event)
 {
     receivedProgressEvent = true;
+    shouldBeFalse("event.bubbles");
+    shouldBeFalse("event.cancelable");
+
+    event.preventDefault();
+    shouldBeFalse("event.defaultPrevented");
 }
 
 function onLoad()
@@ -39,14 +44,12 @@ function onLoad()
 function onLoadEnd()
 {
     log("Received loadend event");
-    log("DONE");
     
     fileReader.removeEventListener("loadstart", onLoadStart, false);
     fileReader.removeEventListener("load", onLoad, false);
     fileReader.removeEventListener("error", onError, false);
 
-    if (window.testRunner)
-        testRunner.notifyDone();
+    finishJSTest();
 }
 
 function onAbort()
@@ -64,13 +67,19 @@ function onFoo()
     log("Received foo event");
 }
 
-function onInputFileChange()
-{
+function runTest() {
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+    }
+
+    window.jsTestIsAsync = true;
+
     log("Test that FileReader's event listener works.");
 
-    var file = document.getElementById("file").files[0];
+    var text = "Hello";
     fileReader = new FileReader();
-    fileReader.readAsText(file);
+
     fileReader.addEventListener("loadstart", onLoadStart, false);
     fileReader.addEventListener("progress", onProgress, false);
     fileReader.addEventListener("load", onLoad, false);
@@ -78,24 +87,13 @@ function onInputFileChange()
     fileReader.addEventListener("abort", onAbort, false);
     fileReader.addEventListener("error", onError, false);
     fileReader.addEventListener("foo", onFoo, false);
-}
 
-function runTests()
-{
-    eventSender.beginDragWithFiles(['resources/UTF8.txt']);
-    eventSender.mouseMoveTo(10, 10);
-    eventSender.mouseUp();
+    fileReader.readAsText(new Blob([text]));
 }
 
-if (window.eventSender) {
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-    window.onload = runTests;
-} else {
-    log("eventSender is not present.");
-}
+runTest();
+
 </script>
+<script src="../js/resources/js-test-post.js"></script>
 </body>
 </html>
index 76b3dde..9e76736 100644 (file)
@@ -45,7 +45,7 @@ NONE : '0'
 SELECT : '16384'
 bubbles : 'false'
 cancelBubble : 'false'
-cancelable : 'true'
+cancelable : 'false'
 clipboardData : 'undefined'
 currentTarget : '[object XMLHttpRequest]'
 defaultPrevented : 'false'
index e689f8b..e8081ec 100644 (file)
@@ -4,7 +4,7 @@ You should see type, bubble, cancelable, eventPhase, target and current target.
 
 Type: progress
 Bubble: false
-Cancelable: true
+Cancelable: false
 EventPhase: 2
 Target: [object XMLHttpRequest]
 Current target: [object XMLHttpRequest]
index 7cdc72e..9562b14 100644 (file)
@@ -883,7 +883,6 @@ webkit.org/b/84333 fast/files/apply-blob-url-to-xhr.html [ Failure ]
 webkit.org/b/84333 fast/files/file-list-test.html [ Failure ]
 webkit.org/b/84333 fast/files/file-reader-abort.html [ Failure ]
 webkit.org/b/84333 fast/files/file-reader-directory-crash.html [ Failure ]
-webkit.org/b/84333 fast/files/file-reader-event-listener.html [ Failure ]
 webkit.org/b/84333 fast/files/null-origin-string.html [ Failure ]
 webkit.org/b/84333 fast/files/read-blob-async.html [ Failure ]
 webkit.org/b/84333 fast/files/read-file-async.html [ Failure ]
index df56890..c678a5b 100644 (file)
@@ -1,3 +1,20 @@
+2013-05-29  Praveen R Jadhav  <praveen.j@samsung.com>
+
+        ProgressEvent should not be cancelable
+        https://bugs.webkit.org/show_bug.cgi?id=114444
+
+        Reviewed by Darin Adler.
+
+        Parameter "cancelable" in ProgressEvent is set to false, by default, as mentioned in the specification. The spec link is given below.
+
+        Spec: http://www.w3.org/TR/2011/CR-progress-events-20110922/#suggested-names-for-events-using-the-progressevent-interface
+
+        No new tests. file-reader-event-listener.html and infoOnProgressEvent-expected.txt are updated.
+
+        * dom/ProgressEvent.cpp:
+        (WebCore::ProgressEvent::ProgressEvent):
+        (WebCore):
+
 2013-05-29  Simon Fraser  <simon.fraser@apple.com>
 
         Fix paint-related milestones to not fire when the layer tree is frozen
index fe8351b..cdcc81b 100644 (file)
@@ -53,13 +53,13 @@ ProgressEvent::ProgressEvent(const AtomicString& type, const ProgressEventInit&
 }
 
 ProgressEvent::ProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
-    : Event(type, false, true)
+    : Event(type, false, false)
     , m_lengthComputable(lengthComputable)
     , m_loaded(loaded)
     , m_total(total)
 {
 }
-    
+
 const AtomicString& ProgressEvent::interfaceName() const
 {
     return eventNames().interfaceForProgressEvent;