From e9d4585561419eae6532bb835bcbd5822612cf16 Mon Sep 17 00:00:00 2001
From: "jsbell@chromium.org" <jsbell@chromium.org>
Date: Fri, 24 Jul 2015 23:05:19 +0000
Subject: FileAPI: ProgressEvent should not be cancelable

Per specs[1,2] the "progress" event of type ProgressEvent fired at
FileReader objects should not be cancelable. Blink doesn't respond to
a preventDefault() anyway - this is probably just an oversight.

[1] https://w3c.github.io/FileAPI/
[2] https://xhr.spec.whatwg.org/#firing-events-using-the-progressevent-interface

BUG=509782
R=kinuko@chromium.org

Review URL: https://codereview.chromium.org/1230113009

git-svn-id: svn://svn.chromium.org/blink/trunk@199467 bbb929c8-8fbe-4397-9dbb-9b2b20218538
---
 .../LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt   | 2 +-
 .../http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt        | 2 +-
 .../infoOnProgressEvent-response-type-blob-expected.txt               | 2 +-
 .../FileAPI/FileReader/Progress_event_bubbles_cancelable-expected.txt | 4 ----
 third_party/WebKit/Source/core/events/ProgressEvent.cpp               | 2 +-
 5 files changed, 4 insertions(+), 8 deletions(-)
 delete mode 100644 third_party/WebKit/LayoutTests/imported/web-platform-tests/FileAPI/FileReader/Progress_event_bubbles_cancelable-expected.txt

diff --git a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt
index f39dd1f..9af9a7a 100644
--- a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt
@@ -45,7 +45,7 @@ NONE : '0'
 SELECT : '16384'
 bubbles : 'false'
 cancelBubble : 'false'
-cancelable : 'true'
+cancelable : 'false'
 currentTarget : '[object XMLHttpRequest]'
 defaultPrevented : 'false'
 eventPhase : '2'
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt
index 0711820..0f7ba22 100644
--- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt
@@ -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]
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-response-type-blob-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-response-type-blob-expected.txt
index 424cd0c..83746dc 100644
--- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-response-type-blob-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-response-type-blob-expected.txt
@@ -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]
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/FileAPI/FileReader/Progress_event_bubbles_cancelable-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/FileAPI/FileReader/Progress_event_bubbles_cancelable-expected.txt
deleted file mode 100644
index 8828716..0000000
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/FileAPI/FileReader/Progress_event_bubbles_cancelable-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a testharness.js-based test.
-FAIL Check the values of bubbles and cancelable are false when the progress event is dispatched assert_false: The cancelable must be false when the event is dispatched expected false got true
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/Source/core/events/ProgressEvent.cpp b/third_party/WebKit/Source/core/events/ProgressEvent.cpp
index 55e2f74b..dc857f4 100644
--- a/third_party/WebKit/Source/core/events/ProgressEvent.cpp
+++ b/third_party/WebKit/Source/core/events/ProgressEvent.cpp
@@ -44,7 +44,7 @@ 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)
-- 
cgit v1.1