| Differences between
and this patch
- a/Source/WebCore/ChangeLog +70 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2019-01-04  Youenn Fablet  <youenn@apple.com>
2
3
        [Fetch API] Implement abortable fetch
4
        https://bugs.webkit.org/show_bug.cgi?id=174980
5
        <rdar://problem/46861402>
6
7
        Reviewed by Chris Dumez.
8
9
        Add an AbortSignal to FetchRequest.
10
11
        Add support for AbortSignal algorithm.
12
        The fetch request signal is added an algorithm to abort the fetch.
13
        Update clone algorithm to let signal of the cloned request be following the origin request.
14
15
        Update ReadableStream error handling to return an exception instead of a string.
16
        This allows passing an AbortError instead of a TypeError as previously done.
17
18
        Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
19
        The latter is used for passing the error from service worker back to the page.
20
        The former is used to pass it to ReadableStream or body accessors.
21
22
        Covered by enabled tests.
23
24
        * Modules/cache/DOMCache.cpp:
25
        (WebCore::DOMCache::put):
26
        * Modules/fetch/FetchBody.cpp:
27
        (WebCore::FetchBody::consumeAsStream):
28
        (WebCore::FetchBody::loadingFailed):
29
        * Modules/fetch/FetchBody.h:
30
        * Modules/fetch/FetchBodyConsumer.cpp:
31
        (WebCore::FetchBodyConsumer::loadingFailed):
32
        * Modules/fetch/FetchBodyConsumer.h:
33
        * Modules/fetch/FetchBodyOwner.cpp:
34
        (WebCore::FetchBodyOwner::arrayBuffer):
35
        (WebCore::FetchBodyOwner::blob):
36
        (WebCore::FetchBodyOwner::cloneBody):
37
        (WebCore::FetchBodyOwner::formData):
38
        (WebCore::FetchBodyOwner::json):
39
        (WebCore::FetchBodyOwner::text):
40
        (WebCore::FetchBodyOwner::loadBlob):
41
        (WebCore::FetchBodyOwner::blobLoadingFailed):
42
        (WebCore::FetchBodyOwner::consumeBodyAsStream):
43
        (WebCore::FetchBodyOwner::setLoadingError):
44
        * Modules/fetch/FetchBodyOwner.h:
45
        (WebCore::FetchBodyOwner::loadingError const):
46
        (WebCore::FetchBodyOwner::loadingException const):
47
        * Modules/fetch/FetchBodySource.cpp:
48
        (WebCore::FetchBodySource::error):
49
        * Modules/fetch/FetchBodySource.h:
50
        * Modules/fetch/FetchRequest.cpp:
51
        (WebCore::FetchRequest::initializeWith):
52
        (WebCore::FetchRequest::clone):
53
        * Modules/fetch/FetchRequest.h:
54
        (WebCore::FetchRequest::FetchRequest):
55
        * Modules/fetch/FetchRequest.idl:
56
        * Modules/fetch/FetchRequestInit.h:
57
        (WebCore::FetchRequestInit::hasMembers const):
58
        * Modules/fetch/FetchRequestInit.idl:
59
        * Modules/fetch/FetchResponse.cpp:
60
        (WebCore::FetchResponse::clone):
61
        (WebCore::FetchResponse::fetch):
62
        (WebCore::FetchResponse::BodyLoader::didFail):
63
        * Modules/fetch/FetchResponse.h:
64
        * bindings/js/ReadableStreamDefaultController.h:
65
        (WebCore::ReadableStreamDefaultController::error):
66
        * dom/AbortSignal.cpp:
67
        (WebCore::AbortSignal::abort):
68
        (WebCore::AbortSignal::follow):
69
        * dom/AbortSignal.h:
70
1
2019-01-04  Chris Fleizach  <cfleizach@apple.com>
71
2019-01-04  Chris Fleizach  <cfleizach@apple.com>
2
72
3
        AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
73
        AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
- a/Source/WebCore/Modules/cache/DOMCache.cpp -2 / +2 lines
Lines 321-328 void DOMCache::put(RequestInfo&& info, Ref<FetchResponse>&& response, DOMPromise a/Source/WebCore/Modules/cache/DOMCache.cpp_sec1
321
    }
321
    }
322
    auto request = requestOrException.releaseReturnValue();
322
    auto request = requestOrException.releaseReturnValue();
323
323
324
    if (response->loadingError()) {
324
    if (auto exception = response->loadingException()) {
325
        promise.reject(Exception { TypeError, response->loadingError()->localizedDescription() });
325
        promise.reject(*exception);
326
        return;
326
        return;
327
    }
327
    }
328
328
- a/Source/WebCore/Modules/fetch/FetchBody.cpp -3 / +3 lines
Lines 186-192 void FetchBody::consumeAsStream(FetchBodyOwner& owner, FetchBodySource& source) a/Source/WebCore/Modules/fetch/FetchBody.cpp_sec1
186
        owner.loadBlob(blobBody(), nullptr);
186
        owner.loadBlob(blobBody(), nullptr);
187
        m_data = nullptr;
187
        m_data = nullptr;
188
    } else if (isFormData())
188
    } else if (isFormData())
189
        source.error("not implemented"_s);
189
        source.error(Exception { NotSupportedError, "Not implemented"_s });
190
    else if (m_consumer.hasData())
190
    else if (m_consumer.hasData())
191
        closeStream = source.enqueue(m_consumer.takeAsArrayBuffer());
191
        closeStream = source.enqueue(m_consumer.takeAsArrayBuffer());
192
    else
192
    else
Lines 224-232 void FetchBody::consumeBlob(FetchBodyOwner& owner, Ref<DeferredPromise>&& promis a/Source/WebCore/Modules/fetch/FetchBody.cpp_sec2
224
    m_data = nullptr;
224
    m_data = nullptr;
225
}
225
}
226
226
227
void FetchBody::loadingFailed()
227
void FetchBody::loadingFailed(const Exception& exception)
228
{
228
{
229
    m_consumer.loadingFailed();
229
    m_consumer.loadingFailed(exception);
230
}
230
}
231
231
232
void FetchBody::loadingSucceeded()
232
void FetchBody::loadingSucceeded()
- a/Source/WebCore/Modules/fetch/FetchBody.h -1 / +1 lines
Lines 60-66 public: a/Source/WebCore/Modules/fetch/FetchBody.h_sec1
60
60
61
    WEBCORE_EXPORT static Optional<FetchBody> fromFormData(FormData&);
61
    WEBCORE_EXPORT static Optional<FetchBody> fromFormData(FormData&);
62
62
63
    void loadingFailed();
63
    void loadingFailed(const Exception&);
64
    void loadingSucceeded();
64
    void loadingSucceeded();
65
65
66
    RefPtr<FormData> bodyAsFormData(ScriptExecutionContext&) const;
66
    RefPtr<FormData> bodyAsFormData(ScriptExecutionContext&) const;
- a/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp -3 / +3 lines
Lines 212-226 void FetchBodyConsumer::setSource(Ref<FetchBodySource>&& source) a/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp_sec1
212
    }
212
    }
213
}
213
}
214
214
215
void FetchBodyConsumer::loadingFailed()
215
void FetchBodyConsumer::loadingFailed(const Exception& exception)
216
{
216
{
217
    m_isLoading = false;
217
    m_isLoading = false;
218
    if (m_consumePromise) {
218
    if (m_consumePromise) {
219
        m_consumePromise->reject();
219
        m_consumePromise->reject(exception);
220
        m_consumePromise = nullptr;
220
        m_consumePromise = nullptr;
221
    }
221
    }
222
    if (m_source) {
222
    if (m_source) {
223
        m_source->error("Loading failed"_s);
223
        m_source->error(exception);
224
        m_source = nullptr;
224
        m_source = nullptr;
225
    }
225
    }
226
}
226
}
- a/Source/WebCore/Modules/fetch/FetchBodyConsumer.h -1 / +1 lines
Lines 66-72 public: a/Source/WebCore/Modules/fetch/FetchBodyConsumer.h_sec1
66
    void resolve(Ref<DeferredPromise>&&, ReadableStream*);
66
    void resolve(Ref<DeferredPromise>&&, ReadableStream*);
67
    void resolveWithData(Ref<DeferredPromise>&&, const unsigned char*, unsigned);
67
    void resolveWithData(Ref<DeferredPromise>&&, const unsigned char*, unsigned);
68
68
69
    void loadingFailed();
69
    void loadingFailed(const Exception&);
70
    void loadingSucceeded();
70
    void loadingSucceeded();
71
71
72
    void setConsumePromise(Ref<DeferredPromise>&&);
72
    void setConsumePromise(Ref<DeferredPromise>&&);
- a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp -7 / +82 lines
Lines 99-104 bool FetchBodyOwner::isDisturbedOrLocked() const a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec1
99
99
100
void FetchBodyOwner::arrayBuffer(Ref<DeferredPromise>&& promise)
100
void FetchBodyOwner::arrayBuffer(Ref<DeferredPromise>&& promise)
101
{
101
{
102
    if (auto exception = loadingException()) {
103
        promise->reject(*exception);
104
        return;
105
    }
106
102
    if (isBodyNullOrOpaque()) {
107
    if (isBodyNullOrOpaque()) {
103
        fulfillPromiseWithArrayBuffer(WTFMove(promise), nullptr, 0);
108
        fulfillPromiseWithArrayBuffer(WTFMove(promise), nullptr, 0);
104
        return;
109
        return;
Lines 113-118 void FetchBodyOwner::arrayBuffer(Ref<DeferredPromise>&& promise) a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec2
113
118
114
void FetchBodyOwner::blob(Ref<DeferredPromise>&& promise)
119
void FetchBodyOwner::blob(Ref<DeferredPromise>&& promise)
115
{
120
{
121
    if (auto exception = loadingException()) {
122
        promise->reject(*exception);
123
        return;
124
    }
125
116
    if (isBodyNullOrOpaque()) {
126
    if (isBodyNullOrOpaque()) {
117
        promise->resolve<IDLInterface<Blob>>(Blob::create(Vector<uint8_t> { }, Blob::normalizedContentType(extractMIMETypeFromMediaType(m_contentType))));
127
        promise->resolve<IDLInterface<Blob>>(Blob::create(Vector<uint8_t> { }, Blob::normalizedContentType(extractMIMETypeFromMediaType(m_contentType))));
118
        return;
128
        return;
Lines 127-132 void FetchBodyOwner::blob(Ref<DeferredPromise>&& promise) a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec3
127
137
128
void FetchBodyOwner::cloneBody(FetchBodyOwner& owner)
138
void FetchBodyOwner::cloneBody(FetchBodyOwner& owner)
129
{
139
{
140
    m_loadingError = owner.m_loadingError;
141
130
    m_contentType = owner.m_contentType;
142
    m_contentType = owner.m_contentType;
131
    if (owner.isBodyNull())
143
    if (owner.isBodyNull())
132
        return;
144
        return;
Lines 161-166 void FetchBodyOwner::consumeOnceLoadingFinished(FetchBodyConsumer::Type type, Re a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec4
161
173
162
void FetchBodyOwner::formData(Ref<DeferredPromise>&& promise)
174
void FetchBodyOwner::formData(Ref<DeferredPromise>&& promise)
163
{
175
{
176
    if (auto exception = loadingException()) {
177
        promise->reject(*exception);
178
        return;
179
    }
180
164
    if (isBodyNullOrOpaque()) {
181
    if (isBodyNullOrOpaque()) {
165
        promise->reject();
182
        promise->reject();
166
        return;
183
        return;
Lines 175-180 void FetchBodyOwner::formData(Ref<DeferredPromise>&& promise) a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec5
175
192
176
void FetchBodyOwner::json(Ref<DeferredPromise>&& promise)
193
void FetchBodyOwner::json(Ref<DeferredPromise>&& promise)
177
{
194
{
195
    if (auto exception = loadingException()) {
196
        promise->reject(*exception);
197
        return;
198
    }
199
178
    if (isBodyNullOrOpaque()) {
200
    if (isBodyNullOrOpaque()) {
179
        promise->reject(SyntaxError);
201
        promise->reject(SyntaxError);
180
        return;
202
        return;
Lines 189-194 void FetchBodyOwner::json(Ref<DeferredPromise>&& promise) a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec6
189
211
190
void FetchBodyOwner::text(Ref<DeferredPromise>&& promise)
212
void FetchBodyOwner::text(Ref<DeferredPromise>&& promise)
191
{
213
{
214
    if (auto exception = loadingException()) {
215
        promise->reject(*exception);
216
        return;
217
    }
218
192
    if (isBodyNullOrOpaque()) {
219
    if (isBodyNullOrOpaque()) {
193
        promise->resolve<IDLDOMString>({ });
220
        promise->resolve<IDLDOMString>({ });
194
        return;
221
        return;
Lines 208-214 void FetchBodyOwner::loadBlob(const Blob& blob, FetchBodyConsumer* consumer) a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec7
208
    ASSERT(!isBodyNull());
235
    ASSERT(!isBodyNull());
209
236
210
    if (!scriptExecutionContext()) {
237
    if (!scriptExecutionContext()) {
211
        m_body->loadingFailed();
238
        m_body->loadingFailed(Exception { TypeError, "Blob loading failed"_s});
212
        return;
239
        return;
213
    }
240
    }
214
241
Lines 217-223 void FetchBodyOwner::loadBlob(const Blob& blob, FetchBodyConsumer* consumer) a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec8
217
244
218
    m_blobLoader->loader->start(*scriptExecutionContext(), blob);
245
    m_blobLoader->loader->start(*scriptExecutionContext(), blob);
219
    if (!m_blobLoader->loader->isStarted()) {
246
    if (!m_blobLoader->loader->isStarted()) {
220
        m_body->loadingFailed();
247
        m_body->loadingFailed(Exception { TypeError, "Blob loading failed"_s});
221
        m_blobLoader = WTF::nullopt;
248
        m_blobLoader = WTF::nullopt;
222
        return;
249
        return;
223
    }
250
    }
Lines 251-261 void FetchBodyOwner::blobLoadingFailed() a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec9
251
#if ENABLE(STREAMS_API)
278
#if ENABLE(STREAMS_API)
252
    if (m_readableStreamSource) {
279
    if (m_readableStreamSource) {
253
        if (!m_readableStreamSource->isCancelling())
280
        if (!m_readableStreamSource->isCancelling())
254
            m_readableStreamSource->error("Blob loading failed"_s);
281
            m_readableStreamSource->error(Exception { TypeError, "Blob loading failed"_s});
255
        m_readableStreamSource = nullptr;
282
        m_readableStreamSource = nullptr;
256
    } else
283
    } else
257
#endif
284
#endif
258
        m_body->loadingFailed();
285
        m_body->loadingFailed(Exception { TypeError, "Blob loading failed"_s});
259
286
260
    finishBlobLoading();
287
    finishBlobLoading();
261
}
288
}
Lines 318-326 void FetchBodyOwner::consumeBodyAsStream() a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec10
318
{
345
{
319
    ASSERT(m_readableStreamSource);
346
    ASSERT(m_readableStreamSource);
320
347
321
    if (m_loadingError) {
348
    if (auto exception = loadingException()) {
322
        auto errorMessage = m_loadingError->localizedDescription();
349
        m_readableStreamSource->error(*exception);
323
        m_readableStreamSource->error(errorMessage.isEmpty() ? "Loading failed"_s : errorMessage);
324
        return;
350
        return;
325
    }
351
    }
326
352
Lines 329-332 void FetchBodyOwner::consumeBodyAsStream() a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp_sec11
329
        m_readableStreamSource = nullptr;
355
        m_readableStreamSource = nullptr;
330
}
356
}
331
357
358
ResourceError FetchBodyOwner::loadingError() const
359
{
360
    return WTF::switchOn(m_loadingError, [](const ResourceError& error) {
361
        return ResourceError { error };
362
    }, [](const Exception& exception) {
363
        return ResourceError { errorDomainWebKitInternal, 0, { }, exception.message() };
364
    }, [](auto&&) {
365
        return ResourceError { };
366
    });
367
}
368
369
Optional<Exception> FetchBodyOwner::loadingException() const
370
{
371
    return WTF::switchOn(m_loadingError, [](const ResourceError& error) {
372
        return Exception { TypeError, error.localizedDescription().isEmpty() ? "Loading failed"_s : error.localizedDescription() };
373
    }, [](const Exception& exception) {
374
        return Exception { exception };
375
    }, [](auto&&) -> Optional<Exception> {
376
        return WTF::nullopt;
377
    });
378
}
379
380
bool FetchBodyOwner::hasLoadingError() const
381
{
382
    return WTF::switchOn(m_loadingError, [](const ResourceError&) {
383
        return true;
384
    }, [](const Exception&) {
385
        return true;
386
    }, [](auto&&) {
387
        return false;
388
    });
389
}
390
391
void FetchBodyOwner::setLoadingError(Exception&& exception)
392
{
393
    if (hasLoadingError())
394
        return;
395
396
    m_loadingError = WTFMove(exception);
397
}
398
399
void FetchBodyOwner::setLoadingError(ResourceError&& error)
400
{
401
    if (hasLoadingError())
402
        return;
403
404
    m_loadingError = WTFMove(error);
405
}
406
332
} // namespace WebCore
407
} // namespace WebCore
- a/Source/WebCore/Modules/fetch/FetchBodyOwner.h -1 / +9 lines
Lines 66-71 public: a/Source/WebCore/Modules/fetch/FetchBodyOwner.h_sec1
66
    virtual void cancel() { }
66
    virtual void cancel() { }
67
#endif
67
#endif
68
68
69
    bool hasLoadingError() const;
70
    ResourceError loadingError() const;
71
    Optional<Exception> loadingException() const;
72
69
protected:
73
protected:
70
    const FetchBody& body() const { return *m_body; }
74
    const FetchBody& body() const { return *m_body; }
71
    FetchBody& body() { return *m_body; }
75
    FetchBody& body() { return *m_body; }
Lines 88-93 protected: a/Source/WebCore/Modules/fetch/FetchBodyOwner.h_sec2
88
    void setBodyAsOpaque() { m_isBodyOpaque = true; }
92
    void setBodyAsOpaque() { m_isBodyOpaque = true; }
89
    bool isBodyOpaque() const { return m_isBodyOpaque; }
93
    bool isBodyOpaque() const { return m_isBodyOpaque; }
90
94
95
    void setLoadingError(Exception&&);
96
    void setLoadingError(ResourceError&&);
97
91
private:
98
private:
92
    // Blob loading routines
99
    // Blob loading routines
93
    void blobChunk(const char*, size_t);
100
    void blobChunk(const char*, size_t);
Lines 116-126 protected: a/Source/WebCore/Modules/fetch/FetchBodyOwner.h_sec3
116
    RefPtr<FetchBodySource> m_readableStreamSource;
123
    RefPtr<FetchBodySource> m_readableStreamSource;
117
#endif
124
#endif
118
    Ref<FetchHeaders> m_headers;
125
    Ref<FetchHeaders> m_headers;
119
    Optional<ResourceError> m_loadingError;
120
126
121
private:
127
private:
122
    Optional<BlobLoader> m_blobLoader;
128
    Optional<BlobLoader> m_blobLoader;
123
    bool m_isBodyOpaque { false };
129
    bool m_isBodyOpaque { false };
130
131
    Variant<std::nullptr_t, Exception, ResourceError> m_loadingError;
124
};
132
};
125
133
126
} // namespace WebCore
134
} // namespace WebCore
- a/Source/WebCore/Modules/fetch/FetchBodySource.cpp -1 / +1 lines
Lines 88-94 void FetchBodySource::close() a/Source/WebCore/Modules/fetch/FetchBodySource.cpp_sec1
88
    m_bodyOwner = nullptr;
88
    m_bodyOwner = nullptr;
89
}
89
}
90
90
91
void FetchBodySource::error(const String& value)
91
void FetchBodySource::error(const Exception& value)
92
{
92
{
93
    controller().error(value);
93
    controller().error(value);
94
    clean();
94
    clean();
- a/Source/WebCore/Modules/fetch/FetchBodySource.h -1 / +1 lines
Lines 44-50 public: a/Source/WebCore/Modules/fetch/FetchBodySource.h_sec1
44
44
45
    bool enqueue(RefPtr<JSC::ArrayBuffer>&& chunk) { return controller().enqueue(WTFMove(chunk)); }
45
    bool enqueue(RefPtr<JSC::ArrayBuffer>&& chunk) { return controller().enqueue(WTFMove(chunk)); }
46
    void close();
46
    void close();
47
    void error(const String&);
47
    void error(const Exception&);
48
48
49
    bool isCancelling() const { return m_isCancelling; }
49
    bool isCancelling() const { return m_isCancelling; }
50
50
- a/Source/WebCore/Modules/fetch/FetchRequest.cpp +10 lines
Lines 159-164 ExceptionOr<void> FetchRequest::initializeWith(const String& url, Init&& init) a/Source/WebCore/Modules/fetch/FetchRequest.cpp_sec1
159
    if (optionsResult.hasException())
159
    if (optionsResult.hasException())
160
        return optionsResult.releaseException();
160
        return optionsResult.releaseException();
161
161
162
    if (init.signal && init.signal.value())
163
        m_signal->follow(*init.signal.value());
164
162
    if (init.headers) {
165
    if (init.headers) {
163
        auto fillResult = m_headers->fill(*init.headers);
166
        auto fillResult = m_headers->fill(*init.headers);
164
        if (fillResult.hasException())
167
        if (fillResult.hasException())
Lines 188-193 ExceptionOr<void> FetchRequest::initializeWith(FetchRequest& input, Init&& init) a/Source/WebCore/Modules/fetch/FetchRequest.cpp_sec2
188
    if (optionsResult.hasException())
191
    if (optionsResult.hasException())
189
        return optionsResult.releaseException();
192
        return optionsResult.releaseException();
190
193
194
    if (init.signal) {
195
        if (init.signal.value())
196
            m_signal->follow(*init.signal.value());
197
    } else
198
        m_signal->follow(input.m_signal);
199
191
    if (init.headers) {
200
    if (init.headers) {
192
        auto fillResult = m_headers->fill(*init.headers);
201
        auto fillResult = m_headers->fill(*init.headers);
193
        if (fillResult.hasException())
202
        if (fillResult.hasException())
Lines 293-298 ExceptionOr<Ref<FetchRequest>> FetchRequest::clone(ScriptExecutionContext& conte a/Source/WebCore/Modules/fetch/FetchRequest.cpp_sec3
293
302
294
    auto clone = adoptRef(*new FetchRequest(context, WTF::nullopt, FetchHeaders::create(m_headers.get()), ResourceRequest { m_request }, FetchOptions { m_options}, String { m_referrer }));
303
    auto clone = adoptRef(*new FetchRequest(context, WTF::nullopt, FetchHeaders::create(m_headers.get()), ResourceRequest { m_request }, FetchOptions { m_options}, String { m_referrer }));
295
    clone->cloneBody(*this);
304
    clone->cloneBody(*this);
305
    clone->m_signal->follow(m_signal);
296
    return WTFMove(clone);
306
    return WTFMove(clone);
297
}
307
}
298
308
- a/Source/WebCore/Modules/fetch/FetchRequest.h +4 lines
Lines 28-33 a/Source/WebCore/Modules/fetch/FetchRequest.h_sec1
28
28
29
#pragma once
29
#pragma once
30
30
31
#include "AbortSignal.h"
31
#include "ExceptionOr.h"
32
#include "ExceptionOr.h"
32
#include "FetchBodyOwner.h"
33
#include "FetchBodyOwner.h"
33
#include "FetchOptions.h"
34
#include "FetchOptions.h"
Lines 68-73 public: a/Source/WebCore/Modules/fetch/FetchRequest.h_sec2
68
    Cache cache() const { return m_options.cache; }
69
    Cache cache() const { return m_options.cache; }
69
    Redirect redirect() const { return m_options.redirect; }
70
    Redirect redirect() const { return m_options.redirect; }
70
    bool keepalive() const { return m_options.keepAlive; };
71
    bool keepalive() const { return m_options.keepAlive; };
72
    AbortSignal& signal() { return m_signal.get(); }
71
73
72
    const String& integrity() const { return m_options.integrity; }
74
    const String& integrity() const { return m_options.integrity; }
73
75
Lines 96-101 private: a/Source/WebCore/Modules/fetch/FetchRequest.h_sec3
96
    FetchOptions m_options;
98
    FetchOptions m_options;
97
    String m_referrer;
99
    String m_referrer;
98
    mutable String m_requestURL;
100
    mutable String m_requestURL;
101
    Ref<AbortSignal> m_signal;
99
};
102
};
100
103
101
inline FetchRequest::FetchRequest(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceRequest&& request, FetchOptions&& options, String&& referrer)
104
inline FetchRequest::FetchRequest(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceRequest&& request, FetchOptions&& options, String&& referrer)
Lines 103-108 inline FetchRequest::FetchRequest(ScriptExecutionContext& context, Optional<Fetc a/Source/WebCore/Modules/fetch/FetchRequest.h_sec4
103
    , m_request(WTFMove(request))
106
    , m_request(WTFMove(request))
104
    , m_options(WTFMove(options))
107
    , m_options(WTFMove(options))
105
    , m_referrer(WTFMove(referrer))
108
    , m_referrer(WTFMove(referrer))
109
    , m_signal(AbortSignal::create(context))
106
{
110
{
107
    updateContentType();
111
    updateContentType();
108
}
112
}
- a/Source/WebCore/Modules/fetch/FetchRequest.idl +1 lines
Lines 55-60 typedef (Blob or BufferSource or DOMFormData or URLSearchParams or ReadableStrea a/Source/WebCore/Modules/fetch/FetchRequest.idl_sec1
55
    readonly attribute FetchRequestRedirect redirect;
55
    readonly attribute FetchRequestRedirect redirect;
56
    readonly attribute DOMString integrity;
56
    readonly attribute DOMString integrity;
57
    [EnabledAtRuntime=FetchAPIKeepAlive] readonly attribute boolean keepalive;
57
    [EnabledAtRuntime=FetchAPIKeepAlive] readonly attribute boolean keepalive;
58
    readonly attribute AbortSignal signal;
58
59
59
    [CallWith=ScriptExecutionContext, MayThrowException, NewObject] FetchRequest clone();
60
    [CallWith=ScriptExecutionContext, MayThrowException, NewObject] FetchRequest clone();
60
};
61
};
- a/Source/WebCore/Modules/fetch/FetchRequestInit.h -1 / +3 lines
Lines 25-30 a/Source/WebCore/Modules/fetch/FetchRequestInit.h_sec1
25
25
26
#pragma once
26
#pragma once
27
27
28
#include "AbortSignal.h"
28
#include "FetchBody.h"
29
#include "FetchBody.h"
29
#include "FetchHeaders.h"
30
#include "FetchHeaders.h"
30
#include "FetchOptions.h"
31
#include "FetchOptions.h"
Lines 46-54 struct FetchRequestInit { a/Source/WebCore/Modules/fetch/FetchRequestInit.h_sec2
46
    Optional<FetchOptions::Redirect> redirect;
47
    Optional<FetchOptions::Redirect> redirect;
47
    String integrity;
48
    String integrity;
48
    Optional<bool> keepalive;
49
    Optional<bool> keepalive;
50
    Optional<AbortSignal*> signal;
49
    JSC::JSValue window;
51
    JSC::JSValue window;
50
52
51
    bool hasMembers() const { return !method.isEmpty() || headers || body || !referrer.isEmpty() || referrerPolicy || mode || credentials || cache || redirect || !integrity.isEmpty() || keepalive || !window.isUndefined(); }
53
    bool hasMembers() const { return !method.isEmpty() || headers || body || !referrer.isEmpty() || referrerPolicy || mode || credentials || cache || redirect || !integrity.isEmpty() || keepalive || !window.isUndefined() || signal; }
52
};
54
};
53
55
54
}
56
}
- a/Source/WebCore/Modules/fetch/FetchRequestInit.idl +1 lines
Lines 39-43 dictionary FetchRequestInit { a/Source/WebCore/Modules/fetch/FetchRequestInit.idl_sec1
39
    FetchRequestRedirect redirect;
39
    FetchRequestRedirect redirect;
40
    DOMString integrity;
40
    DOMString integrity;
41
    boolean keepalive;
41
    boolean keepalive;
42
    AbortSignal? signal;
42
    any window; // can only be set to null
43
    any window; // can only be set to null
43
};
44
};
- a/Source/WebCore/Modules/fetch/FetchResponse.cpp -5 / +43 lines
Lines 179-202 ExceptionOr<Ref<FetchResponse>> FetchResponse::clone(ScriptExecutionContext& con a/Source/WebCore/Modules/fetch/FetchResponse.cpp_sec1
179
        m_internalResponse.setHTTPHeaderFields(HTTPHeaderMap { headers().internalHeaders() });
179
        m_internalResponse.setHTTPHeaderFields(HTTPHeaderMap { headers().internalHeaders() });
180
180
181
    auto clone = FetchResponse::create(context, WTF::nullopt, headers().guard(), ResourceResponse { m_internalResponse });
181
    auto clone = FetchResponse::create(context, WTF::nullopt, headers().guard(), ResourceResponse { m_internalResponse });
182
    clone->m_loadingError = m_loadingError;
183
    clone->cloneBody(*this);
182
    clone->cloneBody(*this);
184
    clone->m_opaqueLoadIdentifier = m_opaqueLoadIdentifier;
183
    clone->m_opaqueLoadIdentifier = m_opaqueLoadIdentifier;
185
    clone->m_bodySizeWithPadding = m_bodySizeWithPadding;
184
    clone->m_bodySizeWithPadding = m_bodySizeWithPadding;
186
    return WTFMove(clone);
185
    return WTFMove(clone);
187
}
186
}
188
187
188
void FetchResponse::addAbortSteps(Ref<AbortSignal>&& signal)
189
{
190
    m_abortSignal = WTFMove(signal);
191
    m_abortSignal->addAlgorithm([this, weakThis = makeWeakPtr(this)] {
192
        // FIXME: Cancel request body if it is a stream.
193
        if (!weakThis)
194
            return;
195
196
        m_abortSignal = nullptr;
197
198
        setLoadingError(Exception { AbortError, "Fetch is aborted"_s });
199
200
        if (m_bodyLoader) {
201
            if (auto callback = m_bodyLoader->takeNotificationCallback())
202
                callback(Exception { AbortError, "Fetch is aborted"_s });
203
        }
204
205
        if (m_readableStreamSource) {
206
            if (!m_readableStreamSource->isCancelling())
207
                m_readableStreamSource->error(*loadingException());
208
            m_readableStreamSource = nullptr;
209
        }
210
        if (m_body)
211
            m_body->loadingFailed(*loadingException());
212
213
        if (m_bodyLoader) {
214
            m_bodyLoader->stop();
215
            m_bodyLoader = WTF::nullopt;
216
        }
217
    });
218
}
219
189
void FetchResponse::fetch(ScriptExecutionContext& context, FetchRequest& request, NotificationCallback&& responseCallback)
220
void FetchResponse::fetch(ScriptExecutionContext& context, FetchRequest& request, NotificationCallback&& responseCallback)
190
{
221
{
222
    if (request.signal().aborted()) {
223
        responseCallback(Exception { AbortError, "Request signal is aborted"_s });
224
        // FIXME: Cancel request body if it is a stream.
225
        return;
226
    }
227
191
    if (request.hasReadableStreamBody()) {
228
    if (request.hasReadableStreamBody()) {
192
        if (responseCallback)
229
        responseCallback(Exception { NotSupportedError, "ReadableStream uploading is not supported"_s });
193
            responseCallback(Exception { NotSupportedError, "ReadableStream uploading is not supported" });
194
        return;
230
        return;
195
    }
231
    }
196
    auto response = adoptRef(*new FetchResponse(context, FetchBody { }, FetchHeaders::create(FetchHeaders::Guard::Immutable), { }));
232
    auto response = adoptRef(*new FetchResponse(context, FetchBody { }, FetchHeaders::create(FetchHeaders::Guard::Immutable), { }));
197
233
198
    response->body().consumer().setAsLoading();
234
    response->body().consumer().setAsLoading();
199
235
236
    response->addAbortSteps(request.signal());
237
200
    response->m_bodyLoader.emplace(response.get(), WTFMove(responseCallback));
238
    response->m_bodyLoader.emplace(response.get(), WTFMove(responseCallback));
201
    if (!response->m_bodyLoader->start(context, request))
239
    if (!response->m_bodyLoader->start(context, request))
202
        response->m_bodyLoader = WTF::nullopt;
240
        response->m_bodyLoader = WTF::nullopt;
Lines 245-251 void FetchResponse::BodyLoader::didFail(const ResourceError& error) a/Source/WebCore/Modules/fetch/FetchResponse.cpp_sec2
245
{
283
{
246
    ASSERT(m_response.hasPendingActivity());
284
    ASSERT(m_response.hasPendingActivity());
247
285
248
    m_response.m_loadingError = error;
286
    m_response.setLoadingError(ResourceError { error });
249
287
250
    if (auto responseCallback = WTFMove(m_responseCallback))
288
    if (auto responseCallback = WTFMove(m_responseCallback))
251
        responseCallback(Exception { TypeError, error.localizedDescription() });
289
        responseCallback(Exception { TypeError, error.localizedDescription() });
Lines 256-262 void FetchResponse::BodyLoader::didFail(const ResourceError& error) a/Source/WebCore/Modules/fetch/FetchResponse.cpp_sec3
256
#if ENABLE(STREAMS_API)
294
#if ENABLE(STREAMS_API)
257
    if (m_response.m_readableStreamSource) {
295
    if (m_response.m_readableStreamSource) {
258
        if (!m_response.m_readableStreamSource->isCancelling())
296
        if (!m_response.m_readableStreamSource->isCancelling())
259
            m_response.m_readableStreamSource->error(makeString("Loading failed: "_s, error.localizedDescription()));
297
            m_response.m_readableStreamSource->error(*m_response.loadingException());
260
        m_response.m_readableStreamSource = nullptr;
298
        m_response.m_readableStreamSource = nullptr;
261
    }
299
    }
262
#endif
300
#endif
- a/Source/WebCore/Modules/fetch/FetchResponse.h -3 / +7 lines
Lines 33-38 a/Source/WebCore/Modules/fetch/FetchResponse.h_sec1
33
#include "ReadableStreamSink.h"
33
#include "ReadableStreamSink.h"
34
#include "ResourceResponse.h"
34
#include "ResourceResponse.h"
35
#include <JavaScriptCore/TypedArrays.h>
35
#include <JavaScriptCore/TypedArrays.h>
36
#include <wtf/WeakPtr.h>
36
37
37
namespace JSC {
38
namespace JSC {
38
class ExecState;
39
class ExecState;
Lines 41-51 class JSValue; a/Source/WebCore/Modules/fetch/FetchResponse.h_sec2
41
42
42
namespace WebCore {
43
namespace WebCore {
43
44
45
class AbortSignal;
44
class FetchRequest;
46
class FetchRequest;
45
struct ReadableStreamChunk;
47
struct ReadableStreamChunk;
46
class ReadableStreamSource;
48
class ReadableStreamSource;
47
49
48
class FetchResponse final : public FetchBodyOwner {
50
class FetchResponse final : public FetchBodyOwner, public CanMakeWeakPtr<FetchResponse> {
49
public:
51
public:
50
    using Type = ResourceResponse::Type;
52
    using Type = ResourceResponse::Type;
51
53
Lines 107-114 public: a/Source/WebCore/Modules/fetch/FetchResponse.h_sec3
107
109
108
    void initializeOpaqueLoadIdentifierForTesting() { m_opaqueLoadIdentifier = 1; }
110
    void initializeOpaqueLoadIdentifierForTesting() { m_opaqueLoadIdentifier = 1; }
109
111
110
    const Optional<ResourceError>& loadingError() const { return m_loadingError; }
111
112
    const HTTPHeaderMap& internalResponseHeaders() const { return m_internalResponse.httpHeaderFields(); }
112
    const HTTPHeaderMap& internalResponseHeaders() const { return m_internalResponse.httpHeaderFields(); }
113
113
114
private:
114
private:
Lines 124-129 private: a/Source/WebCore/Modules/fetch/FetchResponse.h_sec4
124
    void closeStream();
124
    void closeStream();
125
#endif
125
#endif
126
126
127
    void addAbortSteps(Ref<AbortSignal>&&);
128
127
    class BodyLoader final : public FetchLoaderClient {
129
    class BodyLoader final : public FetchLoaderClient {
128
    public:
130
    public:
129
        BodyLoader(FetchResponse&, NotificationCallback&&);
131
        BodyLoader(FetchResponse&, NotificationCallback&&);
Lines 137-142 private: a/Source/WebCore/Modules/fetch/FetchResponse.h_sec5
137
#if ENABLE(STREAMS_API)
139
#if ENABLE(STREAMS_API)
138
        RefPtr<SharedBuffer> startStreaming();
140
        RefPtr<SharedBuffer> startStreaming();
139
#endif
141
#endif
142
        NotificationCallback takeNotificationCallback() { return WTFMove(m_responseCallback); }
140
143
141
    private:
144
    private:
142
        // FetchLoaderClient API
145
        // FetchLoaderClient API
Lines 158-163 private: a/Source/WebCore/Modules/fetch/FetchResponse.h_sec6
158
    // Opaque responses will padd their body size when used with Cache API.
161
    // Opaque responses will padd their body size when used with Cache API.
159
    uint64_t m_bodySizeWithPadding { 0 };
162
    uint64_t m_bodySizeWithPadding { 0 };
160
    uint64_t m_opaqueLoadIdentifier { 0 };
163
    uint64_t m_opaqueLoadIdentifier { 0 };
164
    RefPtr<AbortSignal> m_abortSignal;
161
};
165
};
162
166
163
} // namespace WebCore
167
} // namespace WebCore
- a/Source/WebCore/bindings/js/ReadableStreamDefaultController.h -5 / +3 lines
Lines 49-56 public: a/Source/WebCore/bindings/js/ReadableStreamDefaultController.h_sec1
49
49
50
    bool enqueue(RefPtr<JSC::ArrayBuffer>&&);
50
    bool enqueue(RefPtr<JSC::ArrayBuffer>&&);
51
51
52
    template<class ResolveResultType>
52
    void error(const Exception&);
53
    void error(const ResolveResultType&);
54
53
55
    void close() { invoke(*globalObject().globalExec(), jsController(), "close", JSC::jsUndefined()); }
54
    void close() { invoke(*globalObject().globalExec(), jsController(), "close", JSC::jsUndefined()); }
56
55
Lines 104-115 inline bool ReadableStreamDefaultController::enqueue(RefPtr<JSC::ArrayBuffer>&& a/Source/WebCore/bindings/js/ReadableStreamDefaultController.h_sec2
104
    return true;
103
    return true;
105
}
104
}
106
105
107
template<>
106
inline void ReadableStreamDefaultController::error(const Exception& exception)
108
inline void ReadableStreamDefaultController::error<String>(const String& errorMessage)
109
{
107
{
110
    JSC::ExecState& state = globalExec();
108
    JSC::ExecState& state = globalExec();
111
    JSC::JSLockHolder locker(&state);
109
    JSC::JSLockHolder locker(&state);
112
    error(state, JSC::createTypeError(&state, errorMessage));
110
    error(state, createDOMException(&state, exception.code(), exception.message()));
113
}
111
}
114
112
115
} // namespace WebCore
113
} // namespace WebCore
- a/Source/WebCore/dom/AbortSignal.cpp -5 / +23 lines
Lines 37-43 Ref<AbortSignal> AbortSignal::create(ScriptExecutionContext& context) a/Source/WebCore/dom/AbortSignal.cpp_sec1
37
    return adoptRef(*new AbortSignal(context));
37
    return adoptRef(*new AbortSignal(context));
38
}
38
}
39
39
40
41
AbortSignal::AbortSignal(ScriptExecutionContext& context)
40
AbortSignal::AbortSignal(ScriptExecutionContext& context)
42
    : ContextDestructionObserver(&context)
41
    : ContextDestructionObserver(&context)
43
{
42
{
Lines 52-64 void AbortSignal::abort() a/Source/WebCore/dom/AbortSignal.cpp_sec2
52
    
51
    
53
    // 2. Set signal’s aborted flag.
52
    // 2. Set signal’s aborted flag.
54
    m_aborted = true;
53
    m_aborted = true;
55
    
54
56
    // 3. For each algorithm in signal's abort algorithms: run algorithm.
55
    auto protectedThis = makeRef(*this);
57
    // 4. Empty signal's abort algorithms.
56
    auto algorithms = WTFMove(m_algorithms);
58
    // FIXME: Add support for 'abort algorithms' - https://dom.spec.whatwg.org/#abortsignal-abort-algorithms
57
    for (auto& algorithm : algorithms)
58
        algorithm();
59
59
60
    // 5. Fire an event named abort at signal.
60
    // 5. Fire an event named abort at signal.
61
    dispatchEvent(Event::create(eventNames().abortEvent, Event::CanBubble::No, Event::IsCancelable::No));
61
    dispatchEvent(Event::create(eventNames().abortEvent, Event::CanBubble::No, Event::IsCancelable::No));
62
}
62
}
63
63
64
// https://dom.spec.whatwg.org/#abortsignal-follow
65
void AbortSignal::follow(AbortSignal& signal)
66
{
67
    if (aborted())
68
        return;
69
70
    if (signal.aborted()) {
71
        abort();
72
        return;
73
    }
74
75
    signal.addAlgorithm([weakThis = makeWeakPtr(this)] {
76
        if (!weakThis)
77
            return;
78
        weakThis->abort();
79
    });
80
}
81
64
}
82
}
- a/Source/WebCore/dom/AbortSignal.h -1 / +9 lines
Lines 27-40 a/Source/WebCore/dom/AbortSignal.h_sec1
27
27
28
#include "ContextDestructionObserver.h"
28
#include "ContextDestructionObserver.h"
29
#include "EventTarget.h"
29
#include "EventTarget.h"
30
#include <wtf/Function.h>
30
#include <wtf/Ref.h>
31
#include <wtf/Ref.h>
31
#include <wtf/RefCounted.h>
32
#include <wtf/RefCounted.h>
33
#include <wtf/WeakPtr.h>
32
34
33
namespace WebCore {
35
namespace WebCore {
34
36
35
class ScriptExecutionContext;
37
class ScriptExecutionContext;
36
38
37
class AbortSignal final : public RefCounted<AbortSignal>, public EventTargetWithInlineData, private ContextDestructionObserver {
39
class AbortSignal final : public RefCounted<AbortSignal>, public EventTargetWithInlineData, public CanMakeWeakPtr<AbortSignal>, private ContextDestructionObserver {
38
public:
40
public:
39
    static Ref<AbortSignal> create(ScriptExecutionContext&);
41
    static Ref<AbortSignal> create(ScriptExecutionContext&);
40
42
Lines 45-50 public: a/Source/WebCore/dom/AbortSignal.h_sec2
45
    using RefCounted::ref;
47
    using RefCounted::ref;
46
    using RefCounted::deref;
48
    using RefCounted::deref;
47
49
50
    using Algorithm = WTF::Function<void()>;
51
    void addAlgorithm(Algorithm&& algorithm) { m_algorithms.append(WTFMove(algorithm)); }
52
53
    void follow(AbortSignal&);
54
48
private:
55
private:
49
    explicit AbortSignal(ScriptExecutionContext&);
56
    explicit AbortSignal(ScriptExecutionContext&);
50
57
Lines 54-59 private: a/Source/WebCore/dom/AbortSignal.h_sec3
54
    void derefEventTarget() final { deref(); }
61
    void derefEventTarget() final { deref(); }
55
    
62
    
56
    bool m_aborted { false };
63
    bool m_aborted { false };
64
    Vector<Algorithm> m_algorithms;
57
};
65
};
58
66
59
}
67
}
- a/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp -2 / +3 lines
Lines 53-60 static void processResponse(Ref<Client>&& client, Expected<Ref<FetchResponse>, R a/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp_sec1
53
53
54
    client->didReceiveResponse(response->resourceResponse());
54
    client->didReceiveResponse(response->resourceResponse());
55
55
56
    if (response->loadingError()) {
56
    auto loadingError = response->loadingError();
57
        client->didFail(*response->loadingError());
57
    if (!loadingError.isNull()) {
58
        client->didFail(loadingError);
58
        return;
59
        return;
59
    }
60
    }
60
61
- a/LayoutTests/ChangeLog +10 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2019-01-04  Youenn Fablet  <youenn@apple.com>
2
3
        [Fetch API] Implement abortable fetch
4
        https://bugs.webkit.org/show_bug.cgi?id=174980
5
        <rdar://problem/46861402>
6
7
        Reviewed by Chris Dumez.
8
9
        * TestExpectations: Enable abort tests.
10
1
2019-01-04  Chris Fleizach  <cfleizach@apple.com>
11
2019-01-04  Chris Fleizach  <cfleizach@apple.com>
2
12
3
        AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
13
        AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
- a/LayoutTests/imported/w3c/ChangeLog +19 lines
Lines 1-3 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2019-01-04  Youenn Fablet  <youenn@apple.com>
2
3
        [Fetch API] Implement abortable fetch
4
        https://bugs.webkit.org/show_bug.cgi?id=174980
5
        <rdar://problem/46861402>
6
7
        Reviewed by Chris Dumez.
8
9
        Fixed tests to run in WebKit CI.
10
        Also fixed a bug in a test where the fetch response body is not actually empty.
11
12
        * web-platform-tests/fetch/api/abort/cache.https-expected.txt:
13
        * web-platform-tests/fetch/api/abort/general-serviceworker.https-expected.txt:
14
        * web-platform-tests/fetch/api/abort/general.any-expected.txt:
15
        * web-platform-tests/fetch/api/abort/general.any.js:
16
        * web-platform-tests/fetch/api/abort/general.any.worker-expected.txt:
17
        * web-platform-tests/fetch/api/abort/serviceworker-intercepted.https-expected.txt:
18
        * web-platform-tests/fetch/api/response/response-consume-stream-expected.txt:
19
1
2019-01-02  Simon Fraser  <simon.fraser@apple.com>
20
2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2
21
3
        Support css-color-4 rgb functions
22
        Support css-color-4 rgb functions
- a/LayoutTests/TestExpectations -5 lines
Lines 211-217 imported/w3c/web-platform-tests/service-workers/service-worker/worker-client-id. a/LayoutTests/TestExpectations_sec1
211
imported/w3c/web-platform-tests/cors/remote-origin.htm [ Skip ]
211
imported/w3c/web-platform-tests/cors/remote-origin.htm [ Skip ]
212
212
213
# Skip service worker tests that are timing out.
213
# Skip service worker tests that are timing out.
214
imported/w3c/web-platform-tests/fetch/api/abort/general-serviceworker.https.html [ Skip ]
215
imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https.html [ Skip ]
214
imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https.html [ Skip ]
216
imported/w3c/web-platform-tests/service-workers/service-worker/respond-with-body-accessed-response.https.html [ Skip ]
215
imported/w3c/web-platform-tests/service-workers/service-worker/respond-with-body-accessed-response.https.html [ Skip ]
217
imported/w3c/web-platform-tests/service-workers/service-worker/sandboxed-iframe-fetch-event.https.html [ Skip ]
216
imported/w3c/web-platform-tests/service-workers/service-worker/sandboxed-iframe-fetch-event.https.html [ Skip ]
Lines 383-392 webkit.org/b/189905 imported/w3c/web-platform-tests/resource-timing/resource_ini a/LayoutTests/TestExpectations_sec2
383
webkit.org/b/189910 imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html [ Pass Failure ]
382
webkit.org/b/189910 imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html [ Pass Failure ]
384
webkit.org/b/190523 imported/w3c/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain.html [ Pass Failure ]
383
webkit.org/b/190523 imported/w3c/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain.html [ Pass Failure ]
385
384
386
# The follow two tests change their output each run
387
imported/w3c/web-platform-tests/fetch/api/abort/general.any.html [ Skip ]
388
imported/w3c/web-platform-tests/fetch/api/abort/general.any.worker.html [ Skip ]
389
390
# These tests time out
385
# These tests time out
391
imported/w3c/web-platform-tests/fetch/api/request/destination/fetch-destination-no-load-event.https.html [ Skip ]
386
imported/w3c/web-platform-tests/fetch/api/request/destination/fetch-destination-no-load-event.https.html [ Skip ]
392
imported/w3c/web-platform-tests/fetch/api/request/destination/fetch-destination.https.html [ Skip ]
387
imported/w3c/web-platform-tests/fetch/api/request/destination/fetch-destination.https.html [ Skip ]
- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/cache.https-expected.txt -2 / +2 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/cache.https-expected.txt_sec1
1
1
2
FAIL Signals are not stored in the cache API promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'cachedRequest.signal.aborted')"
2
PASS Signals are not stored in the cache API 
3
FAIL Signals are not stored in the cache API, even if they're already aborted promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'cachedRequest.signal.aborted')"
3
PASS Signals are not stored in the cache API, even if they're already aborted 
4
4
- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general-serviceworker.https-expected.txt -32 / +30 lines
Lines 1-8 a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general-serviceworker.https-expected.txt_sec1
1
1
2
Harness Error (TIMEOUT), message = null
2
PASS Aborting rejects with AbortError 
3
3
PASS Aborting rejects with AbortError - no-cors 
4
FAIL Aborting rejects with AbortError assert_unreached: Should have rejected: undefined Reached unreachable code
5
FAIL Aborting rejects with AbortError - no-cors assert_throws: function "function () { throw e }" threw object "TypeError: A server with the specified hostname could not be found." that is not a DOMException AbortError: property "code" is equal to undefined, expected 20
6
PASS TypeError from request constructor takes priority - RequestInit's window is not null 
4
PASS TypeError from request constructor takes priority - RequestInit's window is not null 
7
PASS TypeError from request constructor takes priority - Input URL is not valid 
5
PASS TypeError from request constructor takes priority - Input URL is not valid 
8
PASS TypeError from request constructor takes priority - Input URL has credentials 
6
PASS TypeError from request constructor takes priority - Input URL has credentials 
Lines 19-52 PASS TypeError from request constructor takes priority - Bad mode init parameter a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general-serviceworker.https-expected.txt_sec2
19
PASS TypeError from request constructor takes priority - Bad credentials init parameter value 
17
PASS TypeError from request constructor takes priority - Bad credentials init parameter value 
20
PASS TypeError from request constructor takes priority - Bad cache init parameter value 
18
PASS TypeError from request constructor takes priority - Bad cache init parameter value 
21
PASS TypeError from request constructor takes priority - Bad redirect init parameter value 
19
PASS TypeError from request constructor takes priority - Bad redirect init parameter value 
22
FAIL Request objects have a signal property assert_true: Signal member is present & truthy expected true got false
20
PASS Request objects have a signal property 
23
FAIL Signal on request object assert_true: Signal member is present & truthy expected true got false
21
PASS Signal on request object 
24
FAIL Signal on request object created from request object assert_unreached: Should have rejected: undefined Reached unreachable code
22
PASS Signal on request object created from request object 
25
FAIL Signal on request object created from request object, with signal on second request assert_unreached: Should have rejected: undefined Reached unreachable code
23
PASS Signal on request object created from request object, with signal on second request 
26
FAIL Signal on request object created from request object, with signal on second request overriding another assert_unreached: Should have rejected: undefined Reached unreachable code
24
PASS Signal on request object created from request object, with signal on second request overriding another 
27
FAIL Signal retained after unrelated properties are overridden by fetch assert_unreached: Should have rejected: undefined Reached unreachable code
25
PASS Signal retained after unrelated properties are overridden by fetch 
28
PASS Signal removed by setting to null 
26
PASS Signal removed by setting to null 
29
FAIL Already aborted signal rejects immediately assert_unreached: Fetch must not resolve Reached unreachable code
27
PASS Already aborted signal rejects immediately 
30
PASS Request is still 'used' if signal is aborted before fetching 
28
PASS Request is still 'used' if signal is aborted before fetching 
31
FAIL response.arrayBuffer() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
29
PASS response.arrayBuffer() rejects if already aborted 
32
FAIL response.blob() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
30
PASS response.blob() rejects if already aborted 
33
FAIL response.formData() rejects if already aborted assert_throws: function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." that is not a DOMException AbortError: property "code" is equal to 9, expected 20
31
PASS response.formData() rejects if already aborted 
34
FAIL response.json() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
32
PASS response.json() rejects if already aborted 
35
FAIL response.text() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
33
PASS response.text() rejects if already aborted 
36
FAIL Already aborted signal does not make request assert_equals: Request hasn't been made to the server expected (object) null but got (string) "open"
34
PASS Already aborted signal does not make request 
37
FAIL Already aborted signal can be used for many fetches assert_unreached: Should have rejected: undefined Reached unreachable code
35
PASS Already aborted signal can be used for many fetches 
38
FAIL Signal can be used to abort other fetches, even if another fetch succeeded before aborting assert_unreached: Should have rejected: undefined Reached unreachable code
36
PASS Signal can be used to abort other fetches, even if another fetch succeeded before aborting 
39
FAIL Underlying connection is closed when aborting after receiving response promise_test: Unhandled rejection with value: object "Error: Timed out"
37
PASS Underlying connection is closed when aborting after receiving response 
40
FAIL Underlying connection is closed when aborting after receiving response - no-cors promise_test: Unhandled rejection with value: object "TypeError: A server with the specified hostname could not be found."
38
PASS Underlying connection is closed when aborting after receiving response - no-cors 
41
TIMEOUT Fetch aborted & connection closed when aborted after calling response.arrayBuffer() Test timed out
39
PASS Fetch aborted & connection closed when aborted after calling response.arrayBuffer() 
42
NOTRUN Fetch aborted & connection closed when aborted after calling response.blob() 
40
PASS Fetch aborted & connection closed when aborted after calling response.blob() 
43
NOTRUN Fetch aborted & connection closed when aborted after calling response.formData() 
41
FAIL Fetch aborted & connection closed when aborted after calling response.formData() assert_throws: function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." that is not a DOMException AbortError: property "code" is equal to 9, expected 20
44
NOTRUN Fetch aborted & connection closed when aborted after calling response.json() 
42
PASS Fetch aborted & connection closed when aborted after calling response.json() 
45
NOTRUN Fetch aborted & connection closed when aborted after calling response.text() 
43
PASS Fetch aborted & connection closed when aborted after calling response.text() 
46
NOTRUN Stream errors once aborted. Underlying connection closed. 
44
PASS Stream errors once aborted. Underlying connection closed. 
47
NOTRUN Stream errors once aborted, after reading. Underlying connection closed. 
45
PASS Stream errors once aborted, after reading. Underlying connection closed. 
48
NOTRUN Stream will not error if body is empty. It's closed with an empty queue before it errors. 
46
PASS Stream will not error if body is empty. It's closed with an empty queue before it errors. 
49
NOTRUN Readable stream synchronously cancels with AbortError if aborted before reading 
47
FAIL Readable stream synchronously cancels with AbortError if aborted before reading assert_true: Cancel called sync expected true got false
50
FAIL Signal state is cloned undefined is not an object (evaluating 'request.signal.aborted')
48
PASS Signal state is cloned 
51
FAIL Clone aborts with original controller undefined is not an object (evaluating 'request.signal.addEventListener')
49
PASS Clone aborts with original controller 
52
50
- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any-expected.txt -37 / +31 lines
Lines 1-12 a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any-expected.txt_sec1
1
Blocked access to external URL http://www1.localhost:8800/fetch/api/resources/data.json
1
CONSOLE MESSAGE: Unhandled Promise Rejection: AbortError: Request signal is aborted
2
CONSOLE MESSAGE: line 36: Fetch API cannot load http://www1.localhost:8800/fetch/api/resources/data.json due to access control checks.
3
Blocked access to external URL http://www1.localhost:8800/fetch/api/resources/infinite-slow-response.py?stateKey=28d5c068-417e-4c81-a0cd-9b8c22aed3c1&abortKey=ef9a1b5a-7afd-4734-b145-f033788c0e6b
4
CONSOLE MESSAGE: line 318: Fetch API cannot load http://www1.localhost:8800/fetch/api/resources/infinite-slow-response.py?stateKey=28d5c068-417e-4c81-a0cd-9b8c22aed3c1&abortKey=ef9a1b5a-7afd-4734-b145-f033788c0e6b due to access control checks.
5
2
6
Harness Error (TIMEOUT), message = null
3
PASS Aborting rejects with AbortError 
7
4
PASS Aborting rejects with AbortError - no-cors 
8
FAIL Aborting rejects with AbortError assert_unreached: Should have rejected: undefined Reached unreachable code
9
FAIL Aborting rejects with AbortError - no-cors assert_throws: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20
10
PASS TypeError from request constructor takes priority - RequestInit's window is not null 
5
PASS TypeError from request constructor takes priority - RequestInit's window is not null 
11
PASS TypeError from request constructor takes priority - Input URL is not valid 
6
PASS TypeError from request constructor takes priority - Input URL is not valid 
12
PASS TypeError from request constructor takes priority - Input URL has credentials 
7
PASS TypeError from request constructor takes priority - Input URL has credentials 
Lines 15-21 PASS TypeError from request constructor takes priority - RequestInit's referrer a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any-expected.txt_sec2
15
PASS TypeError from request constructor takes priority - RequestInit's method is invalid 
10
PASS TypeError from request constructor takes priority - RequestInit's method is invalid 
16
PASS TypeError from request constructor takes priority - RequestInit's method is forbidden 
11
PASS TypeError from request constructor takes priority - RequestInit's method is forbidden 
17
PASS TypeError from request constructor takes priority - RequestInit's mode is no-cors and method is not simple 
12
PASS TypeError from request constructor takes priority - RequestInit's mode is no-cors and method is not simple 
18
PASS TypeError from request constructor takes priority - RequestInit's mode is no-cors and integrity is not empty 
19
PASS TypeError from request constructor takes priority - RequestInit's cache mode is only-if-cached and mode is not same-origin 
13
PASS TypeError from request constructor takes priority - RequestInit's cache mode is only-if-cached and mode is not same-origin 
20
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode cors 
14
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode cors 
21
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode no-cors 
15
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode no-cors 
Lines 24-57 PASS TypeError from request constructor takes priority - Bad mode init parameter a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any-expected.txt_sec3
24
PASS TypeError from request constructor takes priority - Bad credentials init parameter value 
18
PASS TypeError from request constructor takes priority - Bad credentials init parameter value 
25
PASS TypeError from request constructor takes priority - Bad cache init parameter value 
19
PASS TypeError from request constructor takes priority - Bad cache init parameter value 
26
PASS TypeError from request constructor takes priority - Bad redirect init parameter value 
20
PASS TypeError from request constructor takes priority - Bad redirect init parameter value 
27
FAIL Request objects have a signal property assert_true: Signal member is present & truthy expected true got false
21
PASS Request objects have a signal property 
28
FAIL Signal on request object assert_true: Signal member is present & truthy expected true got false
22
PASS Signal on request object 
29
FAIL Signal on request object created from request object assert_unreached: Should have rejected: undefined Reached unreachable code
23
PASS Signal on request object created from request object 
30
FAIL Signal on request object created from request object, with signal on second request assert_unreached: Should have rejected: undefined Reached unreachable code
24
PASS Signal on request object created from request object, with signal on second request 
31
FAIL Signal on request object created from request object, with signal on second request overriding another assert_unreached: Should have rejected: undefined Reached unreachable code
25
PASS Signal on request object created from request object, with signal on second request overriding another 
32
FAIL Signal retained after unrelated properties are overridden by fetch assert_unreached: Should have rejected: undefined Reached unreachable code
26
PASS Signal retained after unrelated properties are overridden by fetch 
33
PASS Signal removed by setting to null 
27
PASS Signal removed by setting to null 
34
FAIL Already aborted signal rejects immediately assert_unreached: Fetch must not resolve Reached unreachable code
28
PASS Already aborted signal rejects immediately 
35
PASS Request is still 'used' if signal is aborted before fetching 
29
PASS Request is still 'used' if signal is aborted before fetching 
36
FAIL response.arrayBuffer() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
30
PASS response.arrayBuffer() rejects if already aborted 
37
FAIL response.blob() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
31
PASS response.blob() rejects if already aborted 
38
FAIL response.formData() rejects if already aborted assert_throws: function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." that is not a DOMException AbortError: property "code" is equal to 9, expected 20
32
PASS response.formData() rejects if already aborted 
39
FAIL response.json() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
33
PASS response.json() rejects if already aborted 
40
FAIL response.text() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
34
PASS response.text() rejects if already aborted 
41
FAIL Already aborted signal does not make request assert_equals: Request hasn't been made to the server expected (object) null but got (string) "open"
35
PASS Already aborted signal does not make request 
42
FAIL Already aborted signal can be used for many fetches assert_unreached: Should have rejected: undefined Reached unreachable code
36
PASS Already aborted signal can be used for many fetches 
43
FAIL Signal can be used to abort other fetches, even if another fetch succeeded before aborting assert_unreached: Should have rejected: undefined Reached unreachable code
37
PASS Signal can be used to abort other fetches, even if another fetch succeeded before aborting 
44
FAIL Underlying connection is closed when aborting after receiving response promise_test: Unhandled rejection with value: object "Error: Timed out"
38
PASS Underlying connection is closed when aborting after receiving response 
45
FAIL Underlying connection is closed when aborting after receiving response - no-cors promise_test: Unhandled rejection with value: object "TypeError: Type error"
39
PASS Underlying connection is closed when aborting after receiving response - no-cors 
46
TIMEOUT Fetch aborted & connection closed when aborted after calling response.arrayBuffer() Test timed out
40
PASS Fetch aborted & connection closed when aborted after calling response.arrayBuffer() 
47
NOTRUN Fetch aborted & connection closed when aborted after calling response.blob() 
41
PASS Fetch aborted & connection closed when aborted after calling response.blob() 
48
NOTRUN Fetch aborted & connection closed when aborted after calling response.formData() 
42
FAIL Fetch aborted & connection closed when aborted after calling response.formData() assert_throws: function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." that is not a DOMException AbortError: property "code" is equal to 9, expected 20
49
NOTRUN Fetch aborted & connection closed when aborted after calling response.json() 
43
PASS Fetch aborted & connection closed when aborted after calling response.json() 
50
NOTRUN Fetch aborted & connection closed when aborted after calling response.text() 
44
PASS Fetch aborted & connection closed when aborted after calling response.text() 
51
NOTRUN Stream errors once aborted. Underlying connection closed. 
45
PASS Stream errors once aborted. Underlying connection closed. 
52
NOTRUN Stream errors once aborted, after reading. Underlying connection closed. 
46
PASS Stream errors once aborted, after reading. Underlying connection closed. 
53
NOTRUN Stream will not error if body is empty. It's closed with an empty queue before it errors. 
47
PASS Stream will not error if body is empty. It's closed with an empty queue before it errors. 
54
NOTRUN Readable stream synchronously cancels with AbortError if aborted before reading 
48
FAIL Readable stream synchronously cancels with AbortError if aborted before reading assert_true: Cancel called sync expected true got false
55
FAIL Signal state is cloned undefined is not an object (evaluating 'request.signal.aborted')
49
PASS Signal state is cloned 
56
FAIL Clone aborts with original controller undefined is not an object (evaluating 'request.signal.addEventListener')
50
PASS Clone aborts with original controller 
57
51
- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.js -4 / +8 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.js_sec1
1
// META: script=/common/utils.js
1
// META: script=/common/utils.js
2
// META: script=/common/get-host-info.sub.js
2
// META: script=../request/request-error.js
3
// META: script=../request/request-error.js
3
4
4
const BODY_METHODS = ['arrayBuffer', 'blob', 'formData', 'json', 'text'];
5
const BODY_METHODS = ['arrayBuffer', 'blob', 'formData', 'json', 'text'];
Lines 15-20 function abortRequests() { a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.js_sec2
15
  );
16
  );
16
}
17
}
17
18
19
const hostInfo = get_host_info();
20
const urlHostname = hostInfo.REMOTE_HOST;
21
18
promise_test(async t => {
22
promise_test(async t => {
19
  const controller = new AbortController();
23
  const controller = new AbortController();
20
  const signal = controller.signal;
24
  const signal = controller.signal;
Lines 31-37 promise_test(async t => { a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.js_sec3
31
  controller.abort();
35
  controller.abort();
32
36
33
  const url = new URL('../resources/data.json', location);
37
  const url = new URL('../resources/data.json', location);
34
  url.hostname = 'www1.' + url.hostname;
38
  url.hostname = urlHostname;
35
39
36
  const fetchPromise = fetch(url, {
40
  const fetchPromise = fetch(url, {
37
    signal,
41
    signal,
Lines 314-320 promise_test(async t => { a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.js_sec4
314
  requestAbortKeys.push(abortKey);
318
  requestAbortKeys.push(abortKey);
315
319
316
  const url = new URL(`../resources/infinite-slow-response.py?stateKey=${stateKey}&abortKey=${abortKey}`, location);
320
  const url = new URL(`../resources/infinite-slow-response.py?stateKey=${stateKey}&abortKey=${abortKey}`, location);
317
  url.hostname = 'www1.' + url.hostname;
321
  url.hostname = urlHostname;
318
322
319
  await fetch(url, {
323
  await fetch(url, {
320
    signal,
324
    signal,
Lines 322-328 promise_test(async t => { a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.js_sec5
322
  });
326
  });
323
327
324
  const stashTakeURL = new URL(`../resources/stash-take.py?key=${stateKey}`, location);
328
  const stashTakeURL = new URL(`../resources/stash-take.py?key=${stateKey}`, location);
325
  stashTakeURL.hostname = 'www1.' + stashTakeURL.hostname;
329
  stashTakeURL.hostname = urlHostname;
326
330
327
  const beforeAbortResult = await fetch(stashTakeURL).then(r => r.json());
331
  const beforeAbortResult = await fetch(stashTakeURL).then(r => r.json());
328
  assert_equals(beforeAbortResult, "open", "Connection is open");
332
  assert_equals(beforeAbortResult, "open", "Connection is open");
Lines 440-446 promise_test(async t => { a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.js_sec6
440
  const controller = new AbortController();
444
  const controller = new AbortController();
441
  const signal = controller.signal;
445
  const signal = controller.signal;
442
446
443
  const response = await fetch(`../resources/empty.txt`, { signal });
447
  const response = await fetch(`../resources/method.py`, { signal });
444
448
445
  // Read whole response to ensure close signal has sent.
449
  // Read whole response to ensure close signal has sent.
446
  await response.clone().text();
450
  await response.clone().text();
- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.worker-expected.txt -35 / +30 lines
Lines 1-10 a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.worker-expected.txt_sec1
1
Blocked access to external URL http://www1.localhost:8800/fetch/api/resources/data.json
2
Blocked access to external URL http://www1.localhost:8800/fetch/api/resources/infinite-slow-response.py?stateKey=7471d98e-1bdb-4254-a315-9489c98b8f59&abortKey=4c631f17-2786-4b07-84f4-0a5760d28f1e
3
1
4
Harness Error (TIMEOUT), message = null
2
PASS Aborting rejects with AbortError 
5
3
PASS Aborting rejects with AbortError - no-cors 
6
FAIL Aborting rejects with AbortError assert_unreached: Should have rejected: undefined Reached unreachable code
7
FAIL Aborting rejects with AbortError - no-cors assert_throws: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20
8
PASS TypeError from request constructor takes priority - RequestInit's window is not null 
4
PASS TypeError from request constructor takes priority - RequestInit's window is not null 
9
PASS TypeError from request constructor takes priority - Input URL is not valid 
5
PASS TypeError from request constructor takes priority - Input URL is not valid 
10
PASS TypeError from request constructor takes priority - Input URL has credentials 
6
PASS TypeError from request constructor takes priority - Input URL has credentials 
Lines 13-19 PASS TypeError from request constructor takes priority - RequestInit's referrer a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.worker-expected.txt_sec2
13
PASS TypeError from request constructor takes priority - RequestInit's method is invalid 
9
PASS TypeError from request constructor takes priority - RequestInit's method is invalid 
14
PASS TypeError from request constructor takes priority - RequestInit's method is forbidden 
10
PASS TypeError from request constructor takes priority - RequestInit's method is forbidden 
15
PASS TypeError from request constructor takes priority - RequestInit's mode is no-cors and method is not simple 
11
PASS TypeError from request constructor takes priority - RequestInit's mode is no-cors and method is not simple 
16
PASS TypeError from request constructor takes priority - RequestInit's mode is no-cors and integrity is not empty 
17
PASS TypeError from request constructor takes priority - RequestInit's cache mode is only-if-cached and mode is not same-origin 
12
PASS TypeError from request constructor takes priority - RequestInit's cache mode is only-if-cached and mode is not same-origin 
18
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode cors 
13
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode cors 
19
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode no-cors 
14
PASS TypeError from request constructor takes priority - Request with cache mode: only-if-cached and fetch mode no-cors 
Lines 22-55 PASS TypeError from request constructor takes priority - Bad mode init parameter a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/general.any.worker-expected.txt_sec3
22
PASS TypeError from request constructor takes priority - Bad credentials init parameter value 
17
PASS TypeError from request constructor takes priority - Bad credentials init parameter value 
23
PASS TypeError from request constructor takes priority - Bad cache init parameter value 
18
PASS TypeError from request constructor takes priority - Bad cache init parameter value 
24
PASS TypeError from request constructor takes priority - Bad redirect init parameter value 
19
PASS TypeError from request constructor takes priority - Bad redirect init parameter value 
25
FAIL Request objects have a signal property assert_true: Signal member is present & truthy expected true got false
20
PASS Request objects have a signal property 
26
FAIL Signal on request object assert_true: Signal member is present & truthy expected true got false
21
PASS Signal on request object 
27
FAIL Signal on request object created from request object assert_unreached: Should have rejected: undefined Reached unreachable code
22
PASS Signal on request object created from request object 
28
FAIL Signal on request object created from request object, with signal on second request assert_unreached: Should have rejected: undefined Reached unreachable code
23
PASS Signal on request object created from request object, with signal on second request 
29
FAIL Signal on request object created from request object, with signal on second request overriding another assert_unreached: Should have rejected: undefined Reached unreachable code
24
PASS Signal on request object created from request object, with signal on second request overriding another 
30
FAIL Signal retained after unrelated properties are overridden by fetch assert_unreached: Should have rejected: undefined Reached unreachable code
25
PASS Signal retained after unrelated properties are overridden by fetch 
31
PASS Signal removed by setting to null 
26
PASS Signal removed by setting to null 
32
FAIL Already aborted signal rejects immediately assert_unreached: Fetch must not resolve Reached unreachable code
27
PASS Already aborted signal rejects immediately 
33
PASS Request is still 'used' if signal is aborted before fetching 
28
PASS Request is still 'used' if signal is aborted before fetching 
34
FAIL response.arrayBuffer() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
29
PASS response.arrayBuffer() rejects if already aborted 
35
FAIL response.blob() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
30
PASS response.blob() rejects if already aborted 
36
FAIL response.formData() rejects if already aborted assert_throws: function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." that is not a DOMException AbortError: property "code" is equal to 9, expected 20
31
PASS response.formData() rejects if already aborted 
37
FAIL response.json() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
32
PASS response.json() rejects if already aborted 
38
FAIL response.text() rejects if already aborted assert_unreached: Should have rejected: undefined Reached unreachable code
33
PASS response.text() rejects if already aborted 
39
FAIL Already aborted signal does not make request assert_equals: Request hasn't been made to the server expected (object) null but got (string) "open"
34
PASS Already aborted signal does not make request 
40
FAIL Already aborted signal can be used for many fetches assert_unreached: Should have rejected: undefined Reached unreachable code
35
PASS Already aborted signal can be used for many fetches 
41
FAIL Signal can be used to abort other fetches, even if another fetch succeeded before aborting assert_unreached: Should have rejected: undefined Reached unreachable code
36
PASS Signal can be used to abort other fetches, even if another fetch succeeded before aborting 
42
FAIL Underlying connection is closed when aborting after receiving response promise_test: Unhandled rejection with value: object "Error: Timed out"
37
PASS Underlying connection is closed when aborting after receiving response 
43
FAIL Underlying connection is closed when aborting after receiving response - no-cors promise_test: Unhandled rejection with value: object "TypeError: Type error"
38
PASS Underlying connection is closed when aborting after receiving response - no-cors 
44
TIMEOUT Fetch aborted & connection closed when aborted after calling response.arrayBuffer() Test timed out
39
PASS Fetch aborted & connection closed when aborted after calling response.arrayBuffer() 
45
NOTRUN Fetch aborted & connection closed when aborted after calling response.blob() 
40
PASS Fetch aborted & connection closed when aborted after calling response.blob() 
46
NOTRUN Fetch aborted & connection closed when aborted after calling response.formData() 
41
FAIL Fetch aborted & connection closed when aborted after calling response.formData() assert_throws: function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." that is not a DOMException AbortError: property "code" is equal to 9, expected 20
47
NOTRUN Fetch aborted & connection closed when aborted after calling response.json() 
42
PASS Fetch aborted & connection closed when aborted after calling response.json() 
48
NOTRUN Fetch aborted & connection closed when aborted after calling response.text() 
43
PASS Fetch aborted & connection closed when aborted after calling response.text() 
49
NOTRUN Stream errors once aborted. Underlying connection closed. 
44
PASS Stream errors once aborted. Underlying connection closed. 
50
NOTRUN Stream errors once aborted, after reading. Underlying connection closed. 
45
PASS Stream errors once aborted, after reading. Underlying connection closed. 
51
NOTRUN Stream will not error if body is empty. It's closed with an empty queue before it errors. 
46
PASS Stream will not error if body is empty. It's closed with an empty queue before it errors. 
52
NOTRUN Readable stream synchronously cancels with AbortError if aborted before reading 
47
FAIL Readable stream synchronously cancels with AbortError if aborted before reading assert_true: Cancel called sync expected true got false
53
FAIL Signal state is cloned undefined is not an object (evaluating 'request.signal.aborted')
48
PASS Signal state is cloned 
54
FAIL Clone aborts with original controller undefined is not an object (evaluating 'request.signal.addEventListener')
49
PASS Clone aborts with original controller 
55
50
- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/serviceworker-intercepted.https-expected.txt -7 / +8 lines
Lines 1-9 a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/abort/serviceworker-intercepted.https-expected.txt_sec1
1
1
2
FAIL Already aborted request does not land in service worker assert_unreached: Should have rejected: undefined Reached unreachable code
2
3
FAIL response.arrayBuffer() rejects if already aborted promise_test: Unhandled rejection with value: object "Error: wait_for_state must be passed a ServiceWorker"
3
PASS Already aborted request does not land in service worker 
4
FAIL response.blob() rejects if already aborted promise_test: Unhandled rejection with value: object "Error: wait_for_state must be passed a ServiceWorker"
4
PASS response.arrayBuffer() rejects if already aborted 
5
FAIL response.formData() rejects if already aborted promise_test: Unhandled rejection with value: object "Error: wait_for_state must be passed a ServiceWorker"
5
PASS response.blob() rejects if already aborted 
6
FAIL response.json() rejects if already aborted promise_test: Unhandled rejection with value: object "Error: wait_for_state must be passed a ServiceWorker"
6
PASS response.formData() rejects if already aborted 
7
FAIL response.text() rejects if already aborted promise_test: Unhandled rejection with value: object "Error: wait_for_state must be passed a ServiceWorker"
7
PASS response.json() rejects if already aborted 
8
FAIL Stream errors once aborted. promise_test: Unhandled rejection with value: object "Error: wait_for_state must be passed a ServiceWorker"
8
PASS response.text() rejects if already aborted 
9
FAIL Stream errors once aborted. assert_unreached: Should have rejected: undefined Reached unreachable code
9
10
- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-stream-expected.txt -1 / +1 lines
Lines 5-11 PASS Read blob response's body as readableStream a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-stream-expected.txt_sec1
5
PASS Read text response's body as readableStream 
5
PASS Read text response's body as readableStream 
6
PASS Read URLSearchParams response's body as readableStream 
6
PASS Read URLSearchParams response's body as readableStream 
7
PASS Read array buffer response's body as readableStream 
7
PASS Read array buffer response's body as readableStream 
8
FAIL Read form data response's body as readableStream promise_test: Unhandled rejection with value: object "TypeError: not implemented"
8
FAIL Read form data response's body as readableStream promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
9
PASS Getting an error Response stream 
9
PASS Getting an error Response stream 
10
PASS Getting a redirect Response stream 
10
PASS Getting a redirect Response stream 
11
11
- a/LayoutTests/platform/ios-simulator/TestExpectations +1 lines
Lines 67-72 webgl/1.0.2/conformance/uniforms/uniform-default-values.html [ Failure ] a/LayoutTests/platform/ios-simulator/TestExpectations_sec1
67
# This test requires Skia, which isn't available on iOS.
67
# This test requires Skia, which isn't available on iOS.
68
webkit.org/b/174079 fast/text/variations/skia-postscript-name.html [ ImageOnlyFailure ]
68
webkit.org/b/174079 fast/text/variations/skia-postscript-name.html [ ImageOnlyFailure ]
69
69
70
imported/w3c/web-platform-tests/fetch/api/abort/general-serviceworker.https.html [ Pass Failure ]
70
imported/w3c/web-platform-tests/2dcontext/transformations/canvas_transformations_reset_001.html [ ImageOnlyFailure ]
71
imported/w3c/web-platform-tests/2dcontext/transformations/canvas_transformations_reset_001.html [ ImageOnlyFailure ]
71
imported/w3c/web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html [ Failure ]
72
imported/w3c/web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html [ Failure ]
72
imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html [ Failure ]
73
imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html [ Failure ]

Return to Bug 174980