[Mac] Change uint8_t* to Vector<uint8_t> type in all crypto algorithm implementation
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-19  Sam Weinig  <sam@webkit.org>
2
3         [Mac] Change uint8_t* to Vector<uint8_t> type in all crypto algorithm implementation
4         https://bugs.webkit.org/show_bug.cgi?id=164939
5
6         Reviewed by Chris Dumez.
7
8         Address FIXMEs, replacing uint8_t*/size_t parameters with Vector<uint8_t>&.
9
10         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
11         (WebCore::transformAES_CBC):
12         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
13         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
14         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
15         (WebCore::wrapKeyAES_KW):
16         (WebCore::unwrapKeyAES_KW):
17         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
18         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
19         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
20         (WebCore::calculateSignature):
21         (WebCore::CryptoAlgorithmHMAC::platformSign):
22         (WebCore::CryptoAlgorithmHMAC::platformVerify):
23         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
24         (WebCore::encryptRSAES_PKCS1_v1_5):
25         (WebCore::decryptRSAES_PKCS1_v1_5):
26         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
27         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
28         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
29         (WebCore::signRSASSA_PKCS1_v1_5):
30         (WebCore::verifyRSASSA_PKCS1_v1_5):
31         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
32         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
33         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
34         (WebCore::encryptRSA_OAEP):
35         (WebCore::decryptRSA_OAEP):
36         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
37         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
38
39 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
40
41         Forbid setDragImage after dragstart
42         https://bugs.webkit.org/show_bug.cgi?id=175751
43
44         Reviewed by Wenson Hsieh.
45
46         Removed the code to allow setting the drag mage after dragstart had happened.
47
48         The feature was apparently used in Mac WebKit1 port but using it today causes the drag image
49         to disapepar while the user is moving the mouse cursor and being drawn once it's stopped
50         and results in the contionus flickering of the drag image.
51
52         The feaure was never supported in WebKit2 and doesn't match the HTML5 specification:
53         https://html.spec.whatwg.org/multipage/dnd.html#concept-dnd-rw
54         https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdragimage
55         or the behaviors of other browsers such as Chrome and Firefox.
56
57         No new tests. This patch simply removes code.
58
59         * dom/DataTransfer.cpp:
60         (WebCore::DataTransfer::setDragImage):
61         (WebCore::DataTransfer::canSetDragImage const): Deleted.
62         * dom/DataTransfer.h:
63         (WebCore::DataTransfer::makeDragImageWritable): Deleted.
64         * page/EventHandler.cpp:
65         (WebCore::EventHandler::handleDrag):
66
67 2017-08-18  Sam Weinig  <sam@webkit.org>
68
69         [WebCrypto] Get rid of CryptoKeyData class and all its subclasses
70         https://bugs.webkit.org/show_bug.cgi?id=169806
71
72         Reviewed by Chris Dumez.
73
74         - Replaces the CryptoKeyData type hierarchy 
75
76             CryptoKeyData
77               - CryptoKeyDataOctetSequence
78               - CryptoKeyDataRSAComponents
79
80           with the renamed CryptoKeyRSAComponents.
81
82         - Removes pure virtual exportData function on CryptoKey, and all
83           the implementations except the one on CryptoKeyRSA, which now is
84           non-virtual, and returns a CryptoKeyRSAComponents. Update the one
85           external caller, SerializedScriptValue, to handle this.
86
87         * CMakeLists.txt:
88         * WebCore.xcodeproj/project.pbxproj:
89         * bindings/js/SerializedScriptValue.cpp:
90         * crypto/CryptoAlgorithm.h:
91         * crypto/CryptoKey.h:
92         * crypto/CryptoKeyData.h: Removed.
93         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
94         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
95         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
96         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
97         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
98         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
99         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
100         (WebCore::CryptoKeyRSA::create):
101         (WebCore::CryptoKeyRSA::exportData const):
102         * crypto/keys/CryptoKeyAES.cpp:
103         (WebCore::CryptoKeyAES::exportData const): Deleted.
104         * crypto/keys/CryptoKeyAES.h:
105         * crypto/keys/CryptoKeyDataOctetSequence.cpp: Removed.
106         * crypto/keys/CryptoKeyDataOctetSequence.h: Removed.
107         * crypto/keys/CryptoKeyDataRSAComponents.cpp: Removed.
108         * crypto/keys/CryptoKeyDataRSAComponents.h: Removed.
109         * crypto/keys/CryptoKeyEC.cpp:
110         (WebCore::CryptoKeyEC::exportData const): Deleted.
111         * crypto/keys/CryptoKeyEC.h:
112         * crypto/keys/CryptoKeyHMAC.cpp:
113         (WebCore::CryptoKeyHMAC::exportData const): Deleted.
114         * crypto/keys/CryptoKeyHMAC.h:
115         * crypto/keys/CryptoKeyRSA.cpp:
116         (WebCore::CryptoKeyRSA::importJwk):
117         (WebCore::CryptoKeyRSA::exportJwk const):
118         * crypto/keys/CryptoKeyRSA.h:
119         * crypto/keys/CryptoKeyRSAComponents.cpp: Copied from crypto/keys/CryptoKeyDataRSAComponents.cpp.
120         (WebCore::CryptoKeyRSAComponents::CryptoKeyRSAComponents):
121         (WebCore::CryptoKeyRSAComponents::~CryptoKeyRSAComponents):
122         (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents): Deleted.
123         (WebCore::CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents): Deleted.
124         * crypto/keys/CryptoKeyRSAComponents.h: Copied from crypto/keys/CryptoKeyDataRSAComponents.h.
125         (WebCore::CryptoKeyRSAComponents::createPublic):
126         (WebCore::CryptoKeyRSAComponents::createPrivate):
127         (WebCore::CryptoKeyRSAComponents::createPrivateWithAdditionalData):
128         * crypto/keys/CryptoKeyRaw.cpp:
129         (WebCore::CryptoKeyRaw::exportData const): Deleted.
130         * crypto/keys/CryptoKeyRaw.h:
131         * crypto/mac/CryptoKeyRSAMac.cpp:
132         (WebCore::getPrivateKeyComponents):
133         (WebCore::CryptoKeyRSA::create):
134         (WebCore::CryptoKeyRSA::exportData const):
135
136 2017-08-18  Youenn Fablet  <youenn@apple.com>
137
138         [Cache API] Add support for being loaded responses
139         https://bugs.webkit.org/show_bug.cgi?id=175732
140
141         Reviewed by Chris Dumez.
142
143         Covered by existing and rebased tests.
144
145         Introducing a callback-based method to consume the body when the load is finished.
146         Using that new method in Cache::put and calling batchPutOperation when the load is finished.
147
148         Fixing the case of a fetch response being cloned, in which case its body should be marked as ReadableStream.
149
150         * Modules/cache/Cache.cpp:
151         (WebCore::Cache::put): Changing order of checks to reduce test flakiness risks as there is not yet support for putting responses with ReadableStream.
152         (WebCore::toConnectionRecord):
153         (WebCore::Cache::batchPutOperation):
154         * Modules/cache/Cache.h:
155         * Modules/fetch/FetchBody.cpp:
156         (WebCore::FetchBody::readableStreamBody): Deleted.
157         * Modules/fetch/FetchBody.h:
158         (WebCore::FetchBody::loadingBody):
159         (WebCore::FetchBody::setAsReadableStream):
160         * Modules/fetch/FetchResponse.cpp:
161         (WebCore::FetchResponse::BodyLoader::didSucceed):
162         (WebCore::FetchResponse::BodyLoader::didFail):
163         (WebCore::FetchResponse::consumeBody):
164         (WebCore::FetchResponse::consumeBodyWhenLoaded):
165         * Modules/fetch/FetchResponse.h:
166
167 2017-08-18  Chris Dumez  <cdumez@apple.com>
168
169         [Beacon] Improve error reporting
170         https://bugs.webkit.org/show_bug.cgi?id=175723
171
172         Reviewed by Darin Adler.
173
174         Have Ping loads such as beacons report errors via their completion handler.
175         The Beacon API is using this error to log a console message when beacon loads
176         fail, provided that the page is still alive.
177
178         Test: http/wpt/beacon/beacon-async-error-logging.html
179
180         * Modules/beacon/NavigatorBeacon.cpp:
181         (WebCore::NavigatorBeacon::NavigatorBeacon):
182         (WebCore::NavigatorBeacon::~NavigatorBeacon):
183         (WebCore::NavigatorBeacon::from):
184         (WebCore::NavigatorBeacon::supplementName):
185         (WebCore::NavigatorBeacon::notifyFinished):
186         (WebCore::NavigatorBeacon::logError):
187         (WebCore::NavigatorBeacon::sendBeacon):
188         * Modules/beacon/NavigatorBeacon.h:
189         * loader/LoaderStrategy.h:
190         * loader/cache/CachedResource.cpp:
191         (WebCore::CachedResource::load):
192         * loader/cache/CachedResourceLoader.cpp:
193         (WebCore::CachedResourceLoader::requestBeaconResource):
194         * loader/cache/CachedResourceLoader.h:
195         * platform/network/PingHandle.h:
196
197 2017-08-18  Sam Weinig  <sam@webkit.org>
198
199         Remove the deprecated WebKitSubtleCrypto interface
200         https://bugs.webkit.org/show_bug.cgi?id=164938
201         <rdar://problem/29894563>
202
203         Reviewed by Chris Dumez.
204
205         Remove WebKitSubtleCrypto and all of its helper classes / functionality.
206
207         * CMakeLists.txt:
208         * DerivedSources.cpp:
209         * DerivedSources.make:
210         * WebCore.xcodeproj/project.pbxproj:
211         * bindings/js/JSCryptoAlgorithmDictionary.cpp: Removed.
212         * bindings/js/JSCryptoAlgorithmDictionary.h: Removed.
213         * bindings/js/JSCryptoKeySerializationJWK.cpp: Removed.
214         * bindings/js/JSCryptoKeySerializationJWK.h: Removed.
215         * bindings/js/JSCryptoOperationData.cpp: Removed.
216         * bindings/js/JSCryptoOperationData.h: Removed.
217         * bindings/js/JSWebKitSubtleCryptoCustom.cpp: Removed.
218         * crypto/CryptoAlgorithm.cpp:
219         (WebCore::CryptoAlgorithm::deriveKey): Deleted.
220         (WebCore::CryptoAlgorithm::encryptForWrapKey): Deleted.
221         (WebCore::CryptoAlgorithm::decryptForUnwrapKey): Deleted.
222         * crypto/CryptoAlgorithm.h:
223         * crypto/CryptoAlgorithmParametersDeprecated.h: Removed.
224         * crypto/CryptoKeySerialization.h: Removed.
225         * crypto/WebKitSubtleCrypto.cpp: Removed.
226         * crypto/WebKitSubtleCrypto.h: Removed.
227         * crypto/WebKitSubtleCrypto.idl: Removed.
228         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
229         (WebCore::CryptoAlgorithmAES_CBC::keyAlgorithmMatches const): Deleted.
230         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
231         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
232         (WebCore::CryptoAlgorithmAES_KW::encryptForWrapKey): Deleted.
233         (WebCore::CryptoAlgorithmAES_KW::decryptForUnwrapKey): Deleted.
234         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
235         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
236         (WebCore::CryptoAlgorithmHMAC::keyAlgorithmMatches const): Deleted.
237         * crypto/algorithms/CryptoAlgorithmHMAC.h:
238         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
239         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
240         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
241         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::keyAlgorithmMatches const): Deleted.
242         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
243         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
244         (WebCore::CryptoAlgorithmRSA_OAEP::keyAlgorithmMatches const): Deleted.
245         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
246         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
247         * crypto/algorithms/CryptoAlgorithmSHA1.h:
248         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
249         * crypto/algorithms/CryptoAlgorithmSHA224.h:
250         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
251         * crypto/algorithms/CryptoAlgorithmSHA256.h:
252         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
253         * crypto/algorithms/CryptoAlgorithmSHA384.h:
254         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
255         * crypto/algorithms/CryptoAlgorithmSHA512.h:
256         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
257         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
258         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
259         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
260         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
261         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
262         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
263         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
264         * crypto/keys/CryptoKeySerializationRaw.cpp: Removed.
265         * crypto/keys/CryptoKeySerializationRaw.h: Removed.
266         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
267         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
268         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
269         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
270         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
271         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
272         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
273         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
274         * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h: Removed.
275         * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h: Removed.
276         * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Removed.
277         * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h: Removed.
278         * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Removed.
279         * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h: Removed.
280         * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Removed.
281         * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h: Removed.
282         * features.json:
283         * page/Crypto.cpp:
284         * page/Crypto.h:
285         * page/Crypto.idl:
286
287 2017-08-18  Tim Horton  <timothy_horton@apple.com>
288
289         Remove classic mode screen scale clamping
290         https://bugs.webkit.org/show_bug.cgi?id=175739
291         <rdar://problem/33894531>
292
293         Reviewed by Andy Estes.
294
295         * platform/ios/PlatformScreenIOS.mm:
296         (WebCore::screenScaleFactor):
297         This code is no longer needed.
298
299 2017-08-18  Daewoong Jang  <daewoong.jang@navercorp.com>
300
301         [Curl] Improve multi-threaded networking
302         https://bugs.webkit.org/show_bug.cgi?id=175713
303
304         Reviewed by Alex Christensen.
305
306         * platform/Curl.cmake:
307         * platform/network/ResourceHandleInternal.h:
308         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
309         (WebCore::ResourceHandleInternal::m_failureTimer): Deleted.
310         * platform/network/curl/CurlCacheManager.cpp:
311         (WebCore::CurlCacheManager::didReceiveResponse):
312         * platform/network/curl/CurlDownload.cpp:
313         (WebCore::CurlDownload::init):
314         (WebCore::CurlDownload::start):
315         (WebCore::CurlDownload::cancel):
316         (WebCore::CurlDownload::retain):
317         (WebCore::CurlDownload::release):
318         (WebCore::CurlDownload::setupRequest):
319         (WebCore::CurlDownload::notifyFinish):
320         (WebCore::CurlDownload::notifyFail):
321         * platform/network/curl/CurlDownload.h:
322         * platform/network/curl/CurlJobManager.cpp:
323         (WebCore::CurlJobList::isEmpty const):
324         (WebCore::CurlJobList::startJobs):
325         (WebCore::CurlJobList::finishJobs):
326         (WebCore::CurlJobList::notifyResult):
327         (WebCore::CurlJobManager::add):
328         (WebCore::CurlJobManager::cancel):
329         (WebCore::CurlJobManager::callOnJobThread):
330         (WebCore::CurlJobManager::startThreadIfNeeded):
331         (WebCore::CurlJobManager::updateJobList):
332         (WebCore::CurlJobManager::workerThread):
333         (WebCore::CurlJobList::append): Deleted.
334         (WebCore::CurlJobList::cancel): Deleted.
335         (WebCore::CurlJobList::complete): Deleted.
336         (WebCore::CurlJobList::withJob): Deleted.
337         (WebCore::CurlJobList::withCurlHandle): Deleted.
338         (WebCore::CurlJob::invoke): Deleted.
339         (WebCore::CurlJobManager::updateJobs): Deleted.
340         * platform/network/curl/CurlJobManager.h:
341         (WebCore::CurlJob::CurlJob): Deleted.
342         (WebCore::CurlJob::~CurlJob): Deleted.
343         (WebCore::CurlJob::operator=): Deleted.
344         (WebCore::CurlJob::curlHandle const): Deleted.
345         (WebCore::CurlJob::ticket const): Deleted.
346         (WebCore::CurlJob::finished): Deleted.
347         (WebCore::CurlJob::error): Deleted.
348         (WebCore::CurlJob::cancel): Deleted.
349         (WebCore::CurlJobManager::isActiveJob const): Deleted.
350         * platform/network/curl/MultipartHandle.cpp:
351         (WebCore::MultipartHandle::didReceiveData):
352         * platform/network/curl/ResourceHandleCurl.cpp:
353         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
354         (WebCore::ResourceHandle::start):
355         (WebCore::ResourceHandle::cancel):
356         (WebCore::ResourceHandle::platformSetDefersLoading):
357         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
358         (WebCore::ResourceHandle::receivedCredential):
359         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
360         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
361         (WebCore::ResourceHandleInternal::initialize): Deleted.
362         (WebCore::ResourceHandleInternal::applyAuthentication): Deleted.
363         (WebCore::getFormElementsCount): Deleted.
364         (WebCore::ResourceHandleInternal::setupPUT): Deleted.
365         (WebCore::ResourceHandleInternal::setupPOST): Deleted.
366         (WebCore::ResourceHandleInternal::setupFormData): Deleted.
367         (WebCore::ResourceHandleInternal::didFinish): Deleted.
368         (WebCore::ResourceHandleInternal::didFail): Deleted.
369         (WebCore::ResourceHandleInternal::calculateWebTimingInformations): Deleted.
370         (WebCore::ResourceHandleInternal::handleLocalReceiveResponse): Deleted.
371         (WebCore::isHttpInfo): Deleted.
372         (WebCore::isHttpRedirect): Deleted.
373         (WebCore::isHttpAuthentication): Deleted.
374         (WebCore::isHttpNotModified): Deleted.
375         (WebCore::isAppendableHeader): Deleted.
376         (WebCore::removeLeadingAndTrailingQuotes): Deleted.
377         (WebCore::getProtectionSpace): Deleted.
378         (WebCore::ResourceHandleInternal::willPrepareSendData): Deleted.
379         (WebCore::ResourceHandleInternal::didReceiveHeaderLine): Deleted.
380         (WebCore::ResourceHandleInternal::didReceiveAllHeaders): Deleted.
381         (WebCore::ResourceHandleInternal::didReceiveContentData): Deleted.
382         (WebCore::ResourceHandleInternal::readCallback): Deleted.
383         (WebCore::ResourceHandleInternal::headerCallback): Deleted.
384         (WebCore::ResourceHandleInternal::writeCallback): Deleted.
385         (WebCore::ResourceHandleInternal::dispatchSynchronousJob): Deleted.
386         (WebCore::ResourceHandleInternal::handleDataURL): Deleted.
387         * platform/network/curl/ResourceHandleCurlDelegate.cpp: Added.
388         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
389         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
390         (WebCore::ResourceHandleCurlDelegate::hasHandle const):
391         (WebCore::ResourceHandleCurlDelegate::releaseHandle):
392         (WebCore::ResourceHandleCurlDelegate::start):
393         (WebCore::ResourceHandleCurlDelegate::cancel):
394         (WebCore::ResourceHandleCurlDelegate::setDefersLoading):
395         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
396         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
397         (WebCore::ResourceHandleCurlDelegate::retain):
398         (WebCore::ResourceHandleCurlDelegate::release):
399         (WebCore::ResourceHandleCurlDelegate::setupRequest):
400         (WebCore::ResourceHandleCurlDelegate::notifyFinish):
401         (WebCore::ResourceHandleCurlDelegate::notifyFail):
402         (WebCore::ResourceHandleCurlDelegate::response):
403         (WebCore::ResourceHandleCurlDelegate::setupAuthentication):
404         (WebCore::removeLeadingAndTrailingQuotes):
405         (WebCore::ResourceHandleCurlDelegate::getProtectionSpace):
406         (WebCore::isHttpInfo):
407         (WebCore::isHttpRedirect):
408         (WebCore::isHttpAuthentication):
409         (WebCore::isHttpNotModified):
410         (WebCore::isAppendableHeader):
411         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderLine):
412         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
413         (WebCore::ResourceHandleCurlDelegate::didReceiveContentData):
414         (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
415         (WebCore::ResourceHandleCurlDelegate::prepareSendData):
416         (WebCore::ResourceHandleCurlDelegate::didFinish):
417         (WebCore::ResourceHandleCurlDelegate::didFail):
418         (WebCore::ResourceHandleCurlDelegate::handleDataURL):
419         (WebCore::ResourceHandleCurlDelegate::setupPOST):
420         (WebCore::ResourceHandleCurlDelegate::setupPUT):
421         (WebCore::ResourceHandleCurlDelegate::getFormElementsCount):
422         (WebCore::ResourceHandleCurlDelegate::setupFormData):
423         (WebCore::ResourceHandleCurlDelegate::applyAuthentication):
424         (WebCore::ResourceHandleCurlDelegate::setWebTimings):
425         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
426         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
427         (WebCore::ResourceHandleCurlDelegate::willSendData):
428         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderCallback):
429         (WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback):
430         (WebCore::ResourceHandleCurlDelegate::willSendDataCallback):
431         * platform/network/curl/ResourceHandleCurlDelegate.h: Added.
432
433 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
434
435         iOS 10 debug build fix.
436
437         * dom/DataTransfer.cpp:
438         (WebCore::DataTransfer::DataTransfer):
439
440 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
441
442         Rename DataTransferAccessPolicy to match spec and refactor related node
443         https://bugs.webkit.org/show_bug.cgi?id=175704
444
445         Reviewed by Wenson Hsieh.
446
447         Renamed DataTransferAccessPolicy to DataTransfer::StoreMode to match the drag data store mode concept
448         in the HTML5 specification:
449         https://html.spec.whatwg.org/multipage/dnd.html#drag-data-store-mode
450
451         DataTransfer in addition to those states can be disassociated from the drag data store when it becomes
452         no longer valid. We also support a special mode which allows only updating the drag image.
453         These two states, Invalid and DragImageWritable, are added in addition to the three states in the spec.
454
455         Also split DragAndDrop type of DataTransfer into DragAndDropData and DragAndDropFiles, and refactored
456         the related code.
457
458         No new tests since there should be no behavioral change.
459
460         * WebCore.xcodeproj/project.pbxproj:
461         * dom/DataTransfer.cpp:
462         (WebCore::DataTransfer::DataTransfer): No longer takes forFileDrag boolean since it's folded into type.
463         (WebCore::DataTransfer::createForCopyAndPaste):
464         (WebCore::DataTransfer::~DataTransfer):
465         (WebCore::DataTransfer::setAccessPolicy): Deleted.
466         (WebCore::DataTransfer::canReadTypes const):
467         (WebCore::DataTransfer::canReadData const):
468         (WebCore::DataTransfer::canWriteData const):
469         (WebCore::DataTransfer::createForInputEvent):
470         (WebCore::DataTransfer::createForDrag):
471         (WebCore::DataTransfer::createForDrop):
472         (WebCore::DataTransfer::canSetDragImage const):
473         * dom/DataTransfer.h:
474         (WebCore::DataTransfer::makeInvalidForSecurity): Added.
475         (WebCore::DataTransfer::makeDragImageWritable): Added.
476         * dom/DataTransferAccessPolicy.h: Removed.
477         * editing/Editor.cpp:
478         (WebCore::dispatchClipboardEvent): Moved and renamed from dispatchCPPEvent. Now computes the store mode
479         inside the function to match the spec: https://w3c.github.io/clipboard-apis/#fire-a-clipboard-event
480         (WebCore::Editor::canDHTMLCut):
481         (WebCore::Editor::canDHTMLCopy):
482         (WebCore::Editor::canDHTMLPaste):
483         (WebCore::Editor::tryDHTMLCopy):
484         (WebCore::Editor::tryDHTMLCut):
485         (WebCore::Editor::tryDHTMLPaste):
486         (WebCore::Editor::dispatchCPPEvent): Deleted.
487         * editing/Editor.h:
488         * page/DragController.cpp:
489         (WebCore::createDataTransferToUpdateDrag): Extracted to share code.
490         (WebCore::DragController::dragExited):
491         (WebCore::DragController::performDragOperation):
492         (WebCore::DragController::tryDHTMLDrag):
493         * page/EventHandler.cpp:
494         (WebCore::EventHandler::invalidateDataTransfer):
495         (WebCore::EventHandler::handleDrag):
496
497 2017-08-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
498
499         Followup (r220289): RenderImageResourceStyleImage code clean up
500         https://bugs.webkit.org/show_bug.cgi?id=175444
501
502         Reviewed by Darin Adler.
503
504         RenderImageResourceStyleImage may be created with a StyleImage of type
505         StyleGeneratedImage. It may also be associated with a CachedImage which 
506         is loaded through a source URL. In this case, adding and removing m_renderer
507         as a client of the CachedImage will be done through 
508         RenderImageResource::setCachedImage().
509
510         RenderImageResource::setCachedImage() is already called from 
511         ImageLoader::updateRenderer() when the CachedImage finishes loading. This
512         call adds m_renderer to the clients of the CachedImage. 
513         RenderImageResource::setCachedImage() will also be called from 
514         RenderImageResourceStyleImage::shutdown() via RenderImageResource::shutdown()
515         to remove m_renderer from the clients of CachedImage by passing a null pointer.
516
517         * rendering/RenderImage.cpp:
518         (WebCore::RenderImage::styleWillChange):
519         * rendering/RenderImageResource.cpp:
520         (WebCore::RenderImageResource::initialize):
521         (WebCore::RenderImageResource::shutdown):
522         (WebCore::RenderImageResource::setCachedImage):
523         (WebCore::RenderImageResource::resetAnimation):
524         (WebCore::RenderImageResource::image const):
525         (WebCore::RenderImageResource::setContainerSizeForRenderer):
526         (WebCore::RenderImageResource::imageSize const):
527         (WebCore::RenderImageResource::~RenderImageResource): Deleted.
528         (WebCore::RenderImageResource::errorOccurred const): Deleted.
529         (WebCore::RenderImageResource::imageHasRelativeWidth const): Deleted.
530         (WebCore::RenderImageResource::imageHasRelativeHeight const): Deleted.
531         (WebCore::RenderImageResource::intrinsicSize const): Deleted.
532         (WebCore::RenderImageResource::getImageSize const): Deleted.
533         * rendering/RenderImageResource.h:
534         (WebCore::RenderImageResource::initialize):
535         (WebCore::RenderImageResource::renderer const):
536         (WebCore::RenderImageResource::errorOccurred const):
537         (WebCore::RenderImageResource::imageHasRelativeWidth const):
538         (WebCore::RenderImageResource::imageHasRelativeHeight const):
539         (WebCore::RenderImageResource::imageSize const):
540         (WebCore::RenderImageResource::intrinsicSize const):
541         (WebCore::RenderImageResource::imagePtr const):
542         * rendering/RenderImageResourceStyleImage.cpp:
543         (WebCore::RenderImageResourceStyleImage::initialize):
544         (WebCore::RenderImageResourceStyleImage::shutdown):
545         (WebCore::RenderImageResourceStyleImage::image const):
546         (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer):
547         (WebCore::RenderImageResourceStyleImage::~RenderImageResourceStyleImage): Deleted.
548         * rendering/RenderImageResourceStyleImage.h:
549         * rendering/RenderSnapshottedPlugIn.cpp:
550         (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn):
551         * rendering/svg/RenderSVGImage.cpp:
552         (WebCore::RenderSVGImage::RenderSVGImage):
553
554 2017-08-18  Jiewen Tan  <jiewen_tan@apple.com>
555
556         [WebCrypto][Mac] Replace CCECCryptorGetKeyComponents with CCECCryptorExportKey for exporting ECC JWKs
557         https://bugs.webkit.org/show_bug.cgi?id=175657
558         <rdar://problem/33797150>
559
560         Reviewed by Brent Fulgham.
561
562         CCECCryptorGetKeyComponents returns components in unpadded formats. In some minor cases, the ECC components
563         do need padding. Therefore, we occasionally see some corrupted outputs in JWKs. To overcome that, this patch
564         replaces CCECCryptorGetKeyComponents with CCECCryptorExportKey which does padding all the time.
565
566         In the meantime, this patch also makes export* methods return OperationError if any error occur in the
567         underlying operations though very unlikely.
568
569         Test: crypto/subtle/ecdsa-generate-export-import-jwk-sign-verify.html
570
571         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
572         (WebCore::CryptoAlgorithmECDH::exportKey):
573         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
574         (WebCore::CryptoAlgorithmECDSA::exportKey):
575         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
576         (WebCore::CryptoKeyEC::platformAddFieldElements const):
577         * crypto/keys/CryptoKeyEC.cpp:
578         (WebCore::CryptoKeyEC::exportRaw const):
579         (WebCore::CryptoKeyEC::exportJwk const):
580         (WebCore::CryptoKeyEC::exportSpki const):
581         (WebCore::CryptoKeyEC::exportPkcs8 const):
582         * crypto/keys/CryptoKeyEC.h:
583         * crypto/mac/CryptoKeyECMac.cpp:
584         (WebCore::CryptoKeyEC::platformExportRaw const):
585         (WebCore::CryptoKeyEC::platformAddFieldElements const):
586         (WebCore::CryptoKeyEC::platformExportSpki const):
587         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
588
589 2017-08-18  Per Arne Vollan  <pvollan@apple.com>
590
591         [Win] accessibility/heading-crash-after-hidden.html is a flaky crash.
592         https://bugs.webkit.org/show_bug.cgi?id=173536
593
594         Reviewed by Brent Fulgham.
595
596         If the tree state is dirty, accessible objects are deleted while iterating over children
597         under AccessibilityNodeObject::textUnderElement when the style is updated. Make sure the
598         style is updated before this method is called.
599
600         No new tests, covered by existing tests.
601
602         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
603         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
604
605 2017-08-18  Youenn Fablet  <youenn@apple.com>
606
607         [Cache API] Add response body storage
608         https://bugs.webkit.org/show_bug.cgi?id=175658
609
610         Reviewed by Alex Christensen.
611
612         Covered by rebased tests.
613         Tests are still flaky until waiting for end of fetch load is implemented.
614
615         Adding a response body within CacheStorageConnection::Record.
616         Adding ability to pass this body from/to the main thread.
617
618         Adding response body consumption into a CacheStorageConnection::Record.
619         Adding response body setting from a CacheStorageConnection::Record.
620
621         * Modules/beacon/NavigatorBeacon.cpp:
622         (WebCore::NavigatorBeacon::sendBeacon):
623         * Modules/cache/Cache.cpp:
624         (WebCore::Cache::put):
625         (WebCore::toConnectionRecord):
626         (WebCore::Cache::updateRecords):
627         * Modules/cache/CacheStorageConnection.cpp:
628         (WebCore::CacheStorageConnection::copyResponseBody):
629         (WebCore::CacheStorageConnection::isolatedResponseBody):
630         (WebCore::CacheStorageConnection::Record::copy const):
631         * Modules/cache/CacheStorageConnection.h:
632         * Modules/cache/WorkerCacheStorageConnection.cpp:
633         (WebCore::toCrossThreadRecordData):
634         (WebCore::fromCrossThreadRecordData):
635         * Modules/fetch/FetchBody.cpp:
636         (WebCore::FetchBody::bodyAsFormData const):
637         (WebCore::FetchBody::take):
638         (WebCore::FetchBody::bodyForInternalRequest const): Deleted.
639         * Modules/fetch/FetchBody.h:
640         (WebCore::FetchBody::setAsFormData):
641         * Modules/fetch/FetchBodyConsumer.h:
642         (WebCore::FetchBodyConsumer::setData):
643         * Modules/fetch/FetchRequest.cpp:
644         (WebCore::FetchRequest::resourceRequest const):
645         * Modules/fetch/FetchResponse.cpp:
646         (WebCore::FetchResponse::consumeBody):
647         (WebCore::FetchResponse::setBodyData):
648         * Modules/fetch/FetchResponse.h:
649
650 2017-08-18  Youenn Fablet  <youenn@apple.com>
651
652         [Fetch API] Add support for a callback-based fetch
653         https://bugs.webkit.org/show_bug.cgi?id=175710
654
655         Reviewed by Alex Christensen.
656
657         No change of behavior.
658
659         Moving from a DOMPromise to a Callback taking an ExceptionOr<FetchResponse&>.
660         Updating window and worker call sites.
661
662         * Modules/fetch/DOMWindowFetch.cpp:
663         (WebCore::DOMWindowFetch::fetch):
664         * Modules/fetch/FetchResponse.cpp:
665         (WebCore::FetchResponse::fetch):
666         (WebCore::FetchResponse::BodyLoader::didFail):
667         (WebCore::FetchResponse::BodyLoader::BodyLoader):
668         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
669         (WebCore::FetchResponse::BodyLoader::stop):
670         * Modules/fetch/FetchResponse.h:
671         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
672         (WebCore::WorkerGlobalScopeFetch::fetch):
673
674 2017-08-18  Brady Eidson  <beidson@apple.com>
675
676         Bounce ServiceWorker jobs to the Storage Process.
677         https://bugs.webkit.org/show_bug.cgi?id=175650
678
679         Reviewed by Andy Estes.
680
681         No new tests (Covered by both changes and consistencies in existing tests)
682
683         This lays the groundwork for the SW job queue being in the StorageProcess by actually
684         setting up some objects for IPC communication and actually sending things over the wire.
685
686         The main point of IPC is the WebCore abstract base class "SWServer::Connection"
687
688         A collection of them will soon be managed by the SWServer itself in the StorageProcess.
689
690         That object will be the stand-in for IPC on both the WebProcess and StorageProcess side.
691
692         Currently, any job that we try to schedule still immediately rejects (though now it does
693         so asynchronously instead of synchronously).
694
695         * CMakeLists.txt:
696         * WebCore.xcodeproj/project.pbxproj:
697
698         * dom/ExceptionData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
699         (WebCore::ExceptionData::toException const):
700         (WebCore::ExceptionData::encode const):
701         (WebCore::ExceptionData::decode):
702
703         * workers/service/ServiceWorkerContainer.cpp:
704         (WebCore::ServiceWorkerContainer::addRegistration):
705         (WebCore::ServiceWorkerContainer::scheduleJob):
706         * workers/service/ServiceWorkerContainer.h:
707
708         * workers/service/ServiceWorkerJob.cpp:
709         (WebCore::ServiceWorkerJob::failedWithException):
710         (WebCore::ServiceWorkerJob::data const):
711         * workers/service/ServiceWorkerJob.h:
712
713         * workers/service/ServiceWorkerJobData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
714         (WebCore::ServiceWorkerJobData::encode const):
715         (WebCore::ServiceWorkerJobData::decode):
716
717         * workers/service/ServiceWorkerJobType.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
718
719         * workers/service/ServiceWorkerProvider.h:
720
721         * workers/service/ServiceWorkerRegistrationParameters.h:
722
723         * workers/service/server/SWServer.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
724         (WebCore::SWServer::Connection::scheduleJob):
725         (WebCore::SWServer::Connection::jobRejected):
726         * workers/service/server/SWServer.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
727         (WebCore::SWServer::Connection::~Connection):
728
729 2017-08-18  Chris Dumez  <cdumez@apple.com>
730
731         [Beacon] Add support for quota limitation
732         https://bugs.webkit.org/show_bug.cgi?id=175443
733         <rdar://problem/33729002>
734
735         Reviewed by Youenn Fablet.
736
737         LoaderStrategy::startPingLoad() now takes a completion handler parameter, allowing CachedResource::load()
738         to know when a Beacon load is complete. This was needed in order for the fetch in-flight keepalive request
739         quota limit to work properly for beacon loads as well. We need to know when the beacon load completes in
740         order to know if the beacon is in-flight or not and only free up its allocated quota once it is no longer
741         in-flight.
742
743         No new tests, updated existing test.
744
745         * loader/LoaderStrategy.h:
746         * loader/PingLoader.cpp:
747         (WebCore::PingLoader::startPingLoad):
748         * loader/cache/CachedResource.cpp:
749         (WebCore::CachedResource::load):
750         * platform/network/PingHandle.h:
751
752 2017-08-18  Youenn Fablet  <youenn@apple.com>
753
754         [Cache API] Add a WK2 implementation of CacheStorageConnection
755         https://bugs.webkit.org/show_bug.cgi?id=175640
756
757         Reviewed by Alex Christensen & Chris Dumez.
758
759         * Modules/cache/CacheStorageConnection.cpp: Adding Internal error.
760         * Modules/cache/CacheStorageConnection.h: Ditto.
761         * WebCore.xcodeproj/project.pbxproj: Exporting CacheQueryOptions.h header.
762
763 2017-08-18  Antti Koivisto  <antti@apple.com>
764
765         Factor render tree mutation code from RenderListItem to RenderTreeUpdater
766         https://bugs.webkit.org/show_bug.cgi?id=175718
767
768         Reviewed by Andreas Kling.
769
770         We already stopped doing layout time mutations. We can now move the code out too.
771
772         * WebCore.xcodeproj/project.pbxproj:
773         * rendering/RenderListItem.cpp:
774         (WebCore::isHTMLListElement):
775         (WebCore::getParentOfFirstLineBox): Deleted.
776         (WebCore::firstNonMarkerChild): Deleted.
777         (WebCore::RenderListItem::updateMarkerRenderer): Deleted.
778
779             Moved to RenderTreeUpdater::ListItem.
780
781         * rendering/RenderListItem.h:
782         * rendering/RenderListMarker.cpp:
783         (WebCore::RenderListMarker::willBeDestroyed):
784         * rendering/TextAutoSizing.cpp:
785         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
786         * style/RenderTreeUpdater.cpp:
787         (WebCore::RenderTreeUpdater::pushParent):
788         (WebCore::RenderTreeUpdater::popParent):
789         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
790         (WebCore::RenderTreeUpdater::updateAfterDescendants):
791
792             Factor pre/post update into functions.
793
794         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
795         * style/RenderTreeUpdater.h:
796         * style/RenderTreeUpdaterListItem.cpp: Added.
797
798             Mutation functions move here.
799
800         (WebCore::getParentOfFirstLineBox):
801         (WebCore::firstNonMarkerChild):
802         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
803         * style/RenderTreeUpdaterListItem.h: Added.
804
805 2017-08-18  Ms2ger  <Ms2ger@gmail.com>
806
807         [GTK] Show controls if a video element isn't allowed to play inline.
808         https://bugs.webkit.org/show_bug.cgi?id=141705
809
810         Reviewed by Xabier Rodriguez-Calvar.
811
812         Test: covered by media/video-fullscreeen-only-controls.html [sic].
813
814         * Modules/mediacontrols/mediaControlsGtk.js:
815         (ControllerGtk.prototype.shouldHaveControls):
816
817 2017-08-18  Zan Dobersek  <zdobersek@igalia.com>
818
819         [EME] MediaKeySession has to initiate playback resume on HTMLMediaElement
820         https://bugs.webkit.org/show_bug.cgi?id=175671
821
822         Reviewed by Xabier Rodriguez-Calvar.
823
824         In MediaKeySession::updateKeyStatuses(), HTMLMediaElement objects that are
825         associated with the MediaKeys instance that created this session have to
826         be notified in order to run the 'Attempt to Resume Playback If Necessary'
827         algorithm.
828
829         MediaKeys object now tracks the sessions that were created through it.
830         MediaKeySession object is passed a MediaKeys reference, and has that
831         reference invalidated if/when the MediaKeys object is destroyed.
832
833         In MediaKeySession::updateKeyStatuses(), a task is now queued, notifying
834         the MediaKeys object, if any, that the associated HTMLMediaElement
835         instances have to run the mentioned algorithm. The associated media
836         elements are stored through CDMClient pointers, with HTMLMediaElement
837         class inheriting from the newly-introduced CDMClient interface.
838
839         HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary() is left
840         unimplemented for now. The object will attach itself to and detach from
841         the associated MediaKeys object in setMediaKeys() and the destructor,
842         enabling the MediaKeys object to properly dispatch the playback resume
843         requests for the attached clients.
844
845         * Modules/encryptedmedia/CDMClient.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
846         (WebCore::CDMClient::~CDMClient):
847         * Modules/encryptedmedia/MediaKeySession.cpp:
848         (WebCore::MediaKeySession::create):
849         (WebCore::MediaKeySession::MediaKeySession):
850         (WebCore::MediaKeySession::detachKeys):
851         (WebCore::MediaKeySession::updateKeyStatuses):
852         * Modules/encryptedmedia/MediaKeySession.h:
853         * Modules/encryptedmedia/MediaKeys.cpp:
854         (WebCore::MediaKeys::~MediaKeys):
855         (WebCore::MediaKeys::createSession):
856         (WebCore::MediaKeys::attachCDMClient):
857         (WebCore::MediaKeys::detachCDMClient):
858         (WebCore::MediaKeys::attemptToResumePlaybackOnClients):
859         * Modules/encryptedmedia/MediaKeys.h:
860         * html/HTMLMediaElement.cpp:
861         (WebCore::HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary):
862         * html/HTMLMediaElement.h:
863
864 2017-08-18  Commit Queue  <commit-queue@webkit.org>
865
866         Unreviewed, rolling out r220854.
867         https://bugs.webkit.org/show_bug.cgi?id=175716
868
869         I'm not sure we really need this (Requested by KaL on
870         #webkit).
871
872         Reverted changeset:
873
874         "[GTK][WPE] Add NTLM authentication enabled API"
875         https://bugs.webkit.org/show_bug.cgi?id=122952
876         http://trac.webkit.org/changeset/220854
877
878 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
879
880         [Input Events] Rename inputType "formatForeColor" to "formatFontColor"
881         https://bugs.webkit.org/show_bug.cgi?id=175703
882
883         Reviewed by Ryosuke Niwa.
884
885         Renames an inputType value to match the spec. There is no other change in behavior.
886         Rebaselines fast/events/input-events-selection-forecolor-data.html and fast/events/input-events-forecolor-data.html.
887
888         * editing/EditCommand.cpp:
889         (WebCore::inputTypeNameForEditingAction):
890
891 2017-08-17  Daewoong Jang  <daewoong.jang@navercorp.com>
892
893         [Curl] Improve multi-threaded networking
894         https://bugs.webkit.org/show_bug.cgi?id=175253
895
896         Reviewed by Alex Christensen.
897
898         * platform/network/curl/CurlContext.cpp:
899         (WebCore::CurlMultiHandle::CurlMultiHandle):
900         (WebCore::CurlHandle::CurlHandle):
901         (WebCore::CurlHandle::initialize):
902         (WebCore::CurlHandle::setSslKeyPassword):
903         (WebCore::CurlHandle::setSslErrors):
904         (WebCore::CurlHandle::getSslErrors):
905         * platform/network/curl/CurlContext.h:
906         * platform/network/curl/CurlDownload.cpp:
907         (WebCore::CurlDownload::init):
908         (WebCore::CurlDownload::getResponse const):
909         (WebCore::CurlDownload::setupRequest):
910         (WebCore::CurlDownload::didReceiveHeader):
911         (WebCore::CurlDownload::didReceiveData):
912         (WebCore::CurlDownload::headerCallback):
913         (WebCore::CurlDownload::getTempPath const): Deleted.
914         (WebCore::CurlDownload::getUrl const): Deleted.
915         (WebCore::CurlDownload::downloadFinishedCallback): Deleted.
916         (WebCore::CurlDownload::downloadFailedCallback): Deleted.
917         (WebCore::CurlDownload::receivedDataCallback): Deleted.
918         (WebCore::CurlDownload::receivedResponseCallback): Deleted.
919         * platform/network/curl/CurlDownload.h:
920         * platform/network/curl/ResourceError.h:
921         (WebCore::ResourceError::ResourceError):
922         (WebCore::ResourceError::sslErrors const):
923         (WebCore::ResourceError::setSSLErrors): Deleted.
924         * platform/network/curl/ResourceHandleCurl.cpp:
925         (WebCore::ResourceHandleInternal::initialize):
926         (WebCore::ResourceHandleInternal::didFail):
927         (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
928         * platform/network/curl/SSLHandle.cpp:
929         (WebCore::allowedClientHosts):
930         (WebCore::addAllowedClientCertificate):
931         (WebCore::getSSLClientCertificate):
932         (WebCore::certVerifyCallback):
933         (WebCore::setSSLVerifyOptions):
934         (WebCore::setSSLClientCertificate): Deleted.
935         * platform/network/curl/SSLHandle.h:
936
937 2017-08-17  Chris Dumez  <cdumez@apple.com>
938
939         Regression(r220817): We should only copy the original request headers for Ping loads
940         https://bugs.webkit.org/show_bug.cgi?id=175679
941
942         Reviewed by Youenn Fablet.
943
944         For performance reason, we should only copy the original request headers for Ping loads
945         (Beacon at the moment), not for all CachedResourceRequests.
946
947         * loader/LoaderStrategy.h:
948         * loader/cache/CachedResource.cpp:
949         (WebCore::CachedResource::CachedResource):
950         (WebCore::CachedResource::load):
951         * loader/cache/CachedResource.h:
952         (WebCore::CachedResource::shouldUsePingLoad):
953         (WebCore::CachedResource::setOriginalRequestHeaders):
954         * loader/cache/CachedResourceLoader.cpp:
955         (WebCore::CachedResourceLoader::requestResource):
956         * loader/cache/CachedResourceRequest.cpp:
957         (WebCore::CachedResourceRequest::CachedResourceRequest):
958         * loader/cache/CachedResourceRequest.h:
959         (WebCore::CachedResourceRequest::releaseResourceRequest):
960         (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders): Deleted.
961
962 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
963
964         [PAL] Relocate SessionID to root
965         https://bugs.webkit.org/show_bug.cgi?id=175684
966
967         Reviewed by Alex Christensen.
968
969         No new tests. No change in functionality.
970
971         * dom/Document.h:
972         * html/HTMLMediaElement.cpp:
973         * loader/cache/CachedResource.h:
974         * loader/cache/CachedResourceLoader.cpp:
975         * loader/cache/MemoryCache.h:
976         * loader/cocoa/DiskCacheMonitorCocoa.h:
977         * page/CacheStorageProvider.h:
978         * page/Page.h:
979         * page/PlugInClient.h:
980         * page/SocketProvider.h:
981         * platform/CookiesStrategy.h:
982         * platform/WebCoreCrossThreadCopier.cpp:
983         * platform/network/CacheValidation.h:
984         * platform/network/NetworkStorageSession.cpp:
985         * platform/network/NetworkStorageSession.h:
986         * platform/network/cf/SocketStreamHandleImpl.h:
987         * platform/network/curl/SocketStreamHandleImpl.h:
988         * platform/network/soup/SocketStreamHandleImpl.h:
989         * workers/WorkerGlobalScope.h:
990         * workers/service/ServiceWorkerContainer.h:
991         * workers/service/ServiceWorkerRegistrationParameters.h:
992
993 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
994
995         Fix the build on other platforms after r220865
996         https://bugs.webkit.org/show_bug.cgi?id=175683
997
998         Reviewed by Tim Horton.
999
1000         Instead of special casing iOS 10 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED < 110000, revert to special
1001         casing iOS 11 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000. This is because other targets that are
1002         neither iOS 10 nor 11 will fail the "before iOS 11" compile-time check, and subsequently assume that item
1003         providers exist. To fix this, flip the compiler-time checks and the order of codeblocks in the
1004         PlatformPasteboard::write methods.
1005
1006         There is no change in behavior.
1007
1008         * platform/ios/PlatformPasteboardIOS.mm:
1009         (WebCore::registerItemToPasteboard):
1010         (WebCore::PlatformPasteboard::write):
1011
1012 2017-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1013
1014         -Wreturn-type warnings in CryptoKey.cpp and SubtleCrypto.cpp
1015         https://bugs.webkit.org/show_bug.cgi?id=175675
1016
1017         Reviewed by Jiewen Tan.
1018
1019         * crypto/CryptoKey.cpp:
1020         (WebCore::CryptoKey::algorithm const):
1021         * crypto/SubtleCrypto.cpp:
1022         (WebCore::toCryptoKeyUsageBitmap):
1023         (WebCore::toKeyData):
1024
1025 2017-08-17  Andreas Kling  <akling@apple.com>
1026
1027         Disable CSS regions at compile time
1028         https://bugs.webkit.org/show_bug.cgi?id=175630
1029
1030         Reviewed by Antti Koivisto.
1031
1032         * Configurations/FeatureDefines.xcconfig:
1033
1034 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1035
1036         [iOS] Respect type fidelities when copying image elements to the pasteboard
1037         https://bugs.webkit.org/show_bug.cgi?id=175638
1038         <rdar://problem/26556043>
1039
1040         Reviewed by Ryosuke Niwa.
1041
1042         Ensures that we respect type fidelities when copying on iOS, by unifying pasteboard writing codepaths across
1043         dragging and copying. When dragging and copying, we now generate and set UIItemProviders on the UIPasteboard.
1044
1045         Tests: ActionSheetTests.CopyImageElementWithHREF
1046                ActionSheetTests.CopyImageElementWithoutHREF
1047
1048         * platform/PlatformPasteboard.h:
1049
1050         Remove all variants of the writeObjectRepresentations helper method. Now that both paths for writing to the
1051         pasteboard are unified, it's no longer useful to separate out item-provider-based pasteboard logic.
1052
1053         * platform/ios/AbstractPasteboard.h:
1054         * platform/ios/PlatformPasteboardIOS.mm:
1055
1056         Replaces -setItemsUsingRegistrationInfoLists: with -setRegistrationInfoLists:. Rather than have a helper that
1057         both sets up item providers and item registration lists, split this functionality out into two setters. This is
1058         because UIPasteboard does not need to know about the registration info lists used to set up the item providers
1059         in the first place, but internal drag-and-drop clients require this information immediately when starting a drag
1060         in order to construct custom drag previews.
1061
1062         (WebCore::richTextRepresentationsForPasteboardWebContent):
1063         (WebCore::registerItemToPasteboard):
1064
1065         Add a new helper to register item providers to the pasteboard, given an WebItemProviderRegistrationInfoList.
1066
1067         (WebCore::PlatformPasteboard::write):
1068         (WebCore::PlatformPasteboard::writeObjectRepresentations): Deleted.
1069
1070         Refactors PlatformPasteboard::write to always generate and set item providers, unless we're building for an SDK
1071         prior to iOS 11. For images, strings and URLs, we can simply transition to using the new item-provider-based
1072         codepaths used for drag and drop. For web content, we add two additional UTIs that were present when copying,
1073         but not when dragging: flat RTFD and a string constant used to indicate to UIKit that the pasteboard contains
1074         rich text.
1075
1076         * platform/ios/WebItemProviderPasteboard.h:
1077         * platform/ios/WebItemProviderPasteboard.mm:
1078         (-[WebItemProviderRegistrationInfoList init]):
1079         (-[WebItemProviderRegistrationInfoList addData:forType:]):
1080         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
1081         (-[WebItemProviderRegistrationInfoList numberOfItems]):
1082         (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
1083         (-[WebItemProviderRegistrationInfoList itemProvider]):
1084         (-[WebItemProviderRegistrationInfoList description]):
1085
1086         Make some small tweaks in WebItemProviderPasteboard (and related classes):
1087         1. Transition to preferredPresentationSize from estimatedDisplayedSize, which is now deprecated.
1088         2. Remove calls to -initWithItemProviderData:typeIdentifier:error:, which is deprecated.
1089         3. Rename _items to _representations to better reflect the role of WebItemProviderRegistrationInfo.
1090         4. Implement -description for WebItemProviderRegistrationInfoList for debugging purposes.
1091
1092         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1093         (-[WebItemProviderPasteboard setRegistrationInfoLists:]):
1094         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]): Deleted.
1095
1096 2017-08-17  Youenn Fablet  <youenn@apple.com>
1097
1098         Add a DOMPromiseDeferred method to handle ExceptionOr<> results
1099         https://bugs.webkit.org/show_bug.cgi?id=175603
1100
1101         Reviewed by Darin Adler.
1102
1103         No change of behavior.
1104
1105         Introduce DOMPromiseDeferred::settle to reject/resolve a promise with an ExceptionOr<>.
1106         Making batchPutOperation/batchDeleteOperation take a Function with an ExceptionOr<>.
1107         Using DOMPromiseDeferred::settle in Cache put/remove.
1108         Updated CacheStorageConnection to create ExceptionOr<> from CacheStorageConnection::Error.
1109
1110         * Modules/cache/Cache.cpp:
1111         (WebCore::Cache::put):
1112         (WebCore::Cache::remove):
1113         (WebCore::Cache::batchDeleteOperation):
1114         (WebCore::Cache::batchPutOperation):
1115         * Modules/cache/Cache.h:
1116         * Modules/cache/CacheStorage.cpp:
1117         (WebCore::CacheStorage::open):
1118         (WebCore::CacheStorage::remove):
1119         * Modules/cache/CacheStorageConnection.cpp:
1120         (WebCore::CacheStorageConnection::errorToException):
1121         * Modules/cache/CacheStorageConnection.h:
1122         (WebCore::CacheStorageConnection::errorToException):
1123         (WebCore::CacheStorageConnection::exceptionOrResult):
1124         * bindings/js/JSDOMPromiseDeferred.h:
1125         (WebCore::DOMPromiseDeferred::settle):
1126         (WebCore::DOMPromiseDeferred<void>::settle):
1127
1128 2017-08-17  Zan Dobersek  <zdobersek@igalia.com>
1129
1130         [GStreamer] AppendPipeline: support dispatch of decryption-specific GstStructure into the pipeline
1131         https://bugs.webkit.org/show_bug.cgi?id=175668
1132
1133         Reviewed by Xabier Rodriguez-Calvar.
1134
1135         Add the AppendPipeline::dispatchDecryptionStructure() method. Callers can
1136         pass in a GstStructure object that contains all the information the
1137         decryption elements in the pipeline will require to properly decrypt the
1138         content. In case the decryptor element isn't available yet, the
1139         GstStructure is stored and dispatched when that element becomes available.
1140
1141         The dispatch itself simply creates a new custom GstEvent that adopts the
1142         given GstStructure object, sends that into the pipeline element, and
1143         shifts the state to 'ongoing'.
1144
1145         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1146         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1147         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure):
1148         (WebCore::AppendPipeline::dispatchDecryptionStructure):
1149         * platform/graphics/gstreamer/mse/AppendPipeline.h: Remove a redundant private: label.
1150
1151 2017-08-17  Zan Dobersek  <zdobersek@igalia.com>
1152
1153         [GStreamer] GstStructure shouldn't be handled through GRefPtr
1154         https://bugs.webkit.org/show_bug.cgi?id=175673
1155
1156         Reviewed by Xabier Rodriguez-Calvar.
1157
1158         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1159         (webkitMediaCommonEncryptionDecryptTransformCaps): GstStructure isn't
1160         ref-counted, so it should be handled through the GUniquePtr<GstStructure>
1161         smart pointer.
1162
1163 2017-08-17  Youenn Fablet  <youenn@apple.com>
1164
1165         [Mac/iOS] Increase the audio buffer size when audio capture is on but web audio is not used
1166         https://bugs.webkit.org/show_bug.cgi?id=175631
1167
1168         Reviewed by Eric Carlson.
1169
1170         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
1171         (PlatformMediaSessionManager::updateSessionState): Change value from 128 to the equivalent of 20ms when audio capture happens but not web audio.
1172
1173 2017-08-17  Antti Koivisto  <antti@apple.com>
1174
1175         RenderListItem - Avoid render tree mutation during layout
1176         https://bugs.webkit.org/show_bug.cgi?id=175666
1177
1178         Reviewed by Andreas Kling.
1179
1180         Mutations should be done by RenderTreeUpdater only.
1181
1182         * rendering/RenderListItem.cpp:
1183         (WebCore::RenderListItem::updateMarkerRenderer):
1184
1185             This is now called by RenderTreeUpdater only.
1186             Remove code dealing with this being called at layout time.
1187             Merged marker construction code from styleDidChange here and renamed for clarity.
1188
1189         (WebCore::RenderListItem::layout):
1190         (WebCore::RenderListItem::computePreferredLogicalWidths):
1191
1192             Remove mutating calls.
1193
1194         (WebCore::RenderListItem::styleDidChange): Deleted.
1195         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded): Deleted.
1196         * rendering/RenderListItem.h:
1197         * rendering/TextAutoSizing.cpp:
1198         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
1199
1200             Call updateMarkerRenderer.
1201
1202         * style/RenderTreeUpdater.cpp:
1203         (WebCore::RenderTreeUpdater::popParent):
1204         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1205
1206             Call updateMarkerRenderer.
1207
1208 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
1209
1210         [PAL] Move SessionID into PAL
1211         https://bugs.webkit.org/show_bug.cgi?id=174192
1212
1213         Reviewed by Antti Koivisto.
1214
1215         No new tests. No change in behavior.
1216
1217         * CMakeLists.txt:
1218         * Modules/websockets/WebSocketChannel.cpp:
1219         (WebCore::WebSocketChannel::connect):
1220         * WebCore.xcodeproj/project.pbxproj:
1221         * dom/Document.cpp:
1222         (WebCore::Document::sessionID const):
1223         * dom/Document.h:
1224         * dom/ScriptExecutionContext.h:
1225         * html/HTMLMediaElement.cpp:
1226         (WebCore::HTMLMediaElement::elementWithID):
1227         (WebCore::HTMLMediaElement::finishParsingChildren):
1228         (WebCore::HTMLMediaElement::scheduleEvent):
1229         (WebCore::HTMLMediaElement::canPlayType const):
1230         (WebCore::HTMLMediaElement::load):
1231         (WebCore::HTMLMediaElement::loadResource):
1232         (WebCore::HTMLMediaElement::textTracksAreReady const):
1233         (WebCore::HTMLMediaElement::textTrackModeChanged):
1234         (WebCore::HTMLMediaElement::noneSupported):
1235         (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
1236         (WebCore::HTMLMediaElement::mediaLoadingFailed):
1237         (WebCore::HTMLMediaElement::setReadyState):
1238         (WebCore::HTMLMediaElement::addPlayedRange):
1239         (WebCore::HTMLMediaElement::seekTask):
1240         (WebCore::HTMLMediaElement::refreshCachedTime const):
1241         (WebCore::HTMLMediaElement::currentMediaTime const):
1242         (WebCore::HTMLMediaElement::setWebkitPreservesPitch):
1243         (WebCore::HTMLMediaElement::ended const):
1244         (WebCore::HTMLMediaElement::playInternal):
1245         (WebCore::HTMLMediaElement::pause):
1246         (WebCore::HTMLMediaElement::togglePlayState):
1247         (WebCore::HTMLMediaElement::beginScrubbing):
1248         (WebCore::HTMLMediaElement::playbackProgressTimerFired):
1249         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
1250         (WebCore::HTMLMediaElement::didAddTextTrack):
1251         (WebCore::HTMLMediaElement::didRemoveTextTrack):
1252         (WebCore::controllerJSValue):
1253         (WebCore::HTMLMediaElement::configureTextTracks):
1254         (WebCore::HTMLMediaElement::selectNextSourceChild):
1255         (WebCore::HTMLMediaElement::sourceWasAdded):
1256         (WebCore::HTMLMediaElement::sourceWasRemoved):
1257         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1258         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
1259         (WebCore::HTMLMediaElement::potentiallyPlaying const):
1260         (WebCore::HTMLMediaElement::endedPlayback const):
1261         (WebCore::HTMLMediaElement::stoppedDueToErrors const):
1262         (WebCore::HTMLMediaElement::updatePlayState):
1263         (WebCore::HTMLMediaElement::userCancelledLoad):
1264         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const):
1265         (WebCore::HTMLMediaElement::addEventListener):
1266         (WebCore::HTMLMediaElement::isFullscreen const):
1267         (WebCore::HTMLMediaElement::toggleStandardFullscreenState):
1268         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
1269         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
1270         (WebCore::HTMLMediaElement::updateTextTrackDisplay):
1271         (WebCore::HTMLMediaElement::mediaControls const):
1272         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
1273         (WebCore::HTMLMediaElement::setMediaGroup):
1274         (WebCore::HTMLMediaElement::setControllerForBindings):
1275         (WebCore::HTMLMediaElement::isBlockedOnMediaController const):
1276         (WebCore::HTMLMediaElement::prepareMediaFragmentURI):
1277         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1278         (WebCore::HTMLMediaElement::fileSize const):
1279         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1280         (WebCore::needsSeekingSupportQuirk):
1281         (WebCore::HTMLMediaElement::supportsSeeking const):
1282         (WebCore::HTMLMediaElement::doesHaveAttribute const):
1283         (WebCore::HTMLMediaElement::isVideoTooSmallForInlinePlayback):
1284         * loader/DocumentLoader.cpp:
1285         (WebCore::DocumentLoader::continueAfterContentPolicy):
1286         * loader/EmptyClients.cpp:
1287         * loader/FrameLoaderClient.h:
1288         * loader/cache/CachedCSSStyleSheet.cpp:
1289         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
1290         * loader/cache/CachedCSSStyleSheet.h:
1291         * loader/cache/CachedFont.cpp:
1292         (WebCore::CachedFont::CachedFont):
1293         * loader/cache/CachedFont.h:
1294         * loader/cache/CachedImage.cpp:
1295         (WebCore::CachedImage::CachedImage):
1296         * loader/cache/CachedImage.h:
1297         * loader/cache/CachedRawResource.cpp:
1298         (WebCore::CachedRawResource::CachedRawResource):
1299         * loader/cache/CachedRawResource.h:
1300         * loader/cache/CachedResource.cpp:
1301         (WebCore::CachedResource::CachedResource):
1302         * loader/cache/CachedResource.h:
1303         (WebCore::CachedResource::sessionID const):
1304         * loader/cache/CachedResourceLoader.cpp:
1305         (WebCore::createResource):
1306         (WebCore::CachedResourceLoader::sessionID const):
1307         * loader/cache/CachedResourceLoader.h:
1308         * loader/cache/CachedSVGDocument.cpp:
1309         (WebCore::CachedSVGDocument::CachedSVGDocument):
1310         * loader/cache/CachedSVGDocument.h:
1311         * loader/cache/CachedSVGFont.cpp:
1312         (WebCore::CachedSVGFont::CachedSVGFont):
1313         * loader/cache/CachedSVGFont.h:
1314         * loader/cache/CachedScript.cpp:
1315         (WebCore::CachedScript::CachedScript):
1316         * loader/cache/CachedScript.h:
1317         * loader/cache/CachedTextTrack.cpp:
1318         (WebCore::CachedTextTrack::CachedTextTrack):
1319         * loader/cache/CachedTextTrack.h:
1320         * loader/cache/CachedXSLStyleSheet.cpp:
1321         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
1322         * loader/cache/CachedXSLStyleSheet.h:
1323         * loader/cache/MemoryCache.cpp:
1324         (WebCore::MemoryCache::sessionResourceMap const):
1325         (WebCore::MemoryCache::ensureSessionResourceMap):
1326         (WebCore::MemoryCache::resourceForRequest):
1327         (WebCore::MemoryCache::addImageToCache):
1328         (WebCore::MemoryCache::removeImageFromCache):
1329         (WebCore::MemoryCache::forEachSessionResource):
1330         (WebCore::MemoryCache::removeResourcesWithOrigins):
1331         (WebCore::MemoryCache::originsWithCache const):
1332         (WebCore::MemoryCache::evictResources):
1333         * loader/cache/MemoryCache.h:
1334         * loader/cocoa/DiskCacheMonitorCocoa.h:
1335         (WebCore::DiskCacheMonitor::sessionID const):
1336         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1337         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation):
1338         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
1339         * page/CacheStorageProvider.h:
1340         * page/DatabaseProvider.h:
1341         * page/Page.cpp:
1342         (WebCore::Page::Page):
1343         (WebCore::Page::enableLegacyPrivateBrowsing):
1344         (WebCore::Page::sessionID const):
1345         (WebCore::Page::setSessionID):
1346         * page/Page.h:
1347         * page/PlugInClient.h:
1348         * page/SocketProvider.cpp:
1349         (WebCore::SocketProvider::createSocketStreamHandle):
1350         * page/SocketProvider.h:
1351         * platform/CookiesStrategy.h:
1352         * platform/WebCoreCrossThreadCopier.cpp:
1353         (WTF::PAL::SessionID>::copy):
1354         (WTF::WebCore::SessionID>::copy): Deleted.
1355         * platform/WebCoreCrossThreadCopier.h:
1356         * platform/network/CacheValidation.cpp:
1357         (WebCore::headerValueForVary):
1358         (WebCore::collectVaryingRequestHeaders):
1359         (WebCore::verifyVaryingRequestHeaders):
1360         * platform/network/CacheValidation.h:
1361         * platform/network/NetworkStorageSession.cpp:
1362         (WebCore::NetworkStorageSession::globalSessionMap):
1363         (WebCore::NetworkStorageSession::storageSession):
1364         (WebCore::NetworkStorageSession::destroySession):
1365         * platform/network/NetworkStorageSession.h:
1366         (WebCore::NetworkStorageSession::sessionID const):
1367         * platform/network/NetworkStorageSessionStub.cpp:
1368         (WebCore::NetworkStorageSession::NetworkStorageSession):
1369         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1370         (WebCore::NetworkStorageSession::ensureSession):
1371         (WebCore::NetworkStorageSession::defaultStorageSession):
1372         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1373         (WebCore::NetworkStorageSession::NetworkStorageSession):
1374         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1375         (WebCore::NetworkStorageSession::defaultStorageSession):
1376         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1377         (WebCore::NetworkStorageSession::ensureSession):
1378         * platform/network/cf/SocketStreamHandleImpl.h:
1379         (WebCore::SocketStreamHandleImpl::create):
1380         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1381         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
1382         * platform/network/curl/SocketStreamHandleImpl.h:
1383         (WebCore::SocketStreamHandleImpl::create):
1384         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1385         (WebCore::NetworkStorageSession::NetworkStorageSession):
1386         (WebCore::NetworkStorageSession::defaultStorageSession):
1387         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1388         (WebCore::NetworkStorageSession::ensureSession):
1389         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1390         * platform/network/soup/SocketStreamHandleImpl.h:
1391         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1392         (WebCore::SocketStreamHandleImpl::create):
1393         * workers/DedicatedWorkerGlobalScope.cpp:
1394         (WebCore::DedicatedWorkerGlobalScope::create):
1395         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1396         * workers/DedicatedWorkerGlobalScope.h:
1397         * workers/DedicatedWorkerThread.cpp:
1398         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1399         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1400         * workers/DedicatedWorkerThread.h:
1401         * workers/Worker.cpp:
1402         (WebCore::Worker::notifyFinished):
1403         * workers/WorkerGlobalScope.cpp:
1404         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1405         * workers/WorkerGlobalScope.h:
1406         * workers/WorkerGlobalScopeProxy.h:
1407         * workers/WorkerMessagingProxy.cpp:
1408         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1409         * workers/WorkerMessagingProxy.h:
1410         * workers/WorkerThread.cpp:
1411         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1412         (WebCore::WorkerThread::WorkerThread):
1413         * workers/WorkerThread.h:
1414         * workers/service/ServiceWorkerContainer.h:
1415         * workers/service/ServiceWorkerRegistrationParameters.h:
1416
1417 2017-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1418
1419         [GTK][WPE] Add NTLM authentication enabled API
1420         https://bugs.webkit.org/show_bug.cgi?id=122952
1421
1422         Reviewed by Michael Catanzaro.
1423
1424         Add/remove NTLM feature to/from soup session depending on whether the feature is enabled or disabled.
1425
1426         * platform/network/soup/SoupNetworkSession.cpp:
1427         (WebCore::SoupNetworkSession::SoupNetworkSession):
1428         (WebCore::SoupNetworkSession::setInitialNTLMAuthenticationEnabled):
1429         (WebCore::SoupNetworkSession::setNTLMAuthenticationEnabled):
1430         * platform/network/soup/SoupNetworkSession.h:
1431
1432 2017-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1433
1434         Add the support for mutating clipboard data via DataTransferItemList
1435         https://bugs.webkit.org/show_bug.cgi?id=175639
1436
1437         Reviewed by Wenson Hsieh.
1438
1439         Added the support for adding plaintext data via dataTransfer.items.add, clearing data via clear,
1440         and removing an entry via remove. When DataTransferItem is removed from DataTransferItemList,
1441         we must put into the disabled mode.
1442
1443         To support the removal of DataTransferItem, this patch replaces a reference to DataTransfer by
1444         a WeakPtr to DataTransferItemList, and stops forwarding ref from DataTransferItem to DataTransfer.
1445         This means that DataTransfer can now be GC'ed before DataTransferItem is GC'ed.
1446
1447         Because the identify and the order of DataTransferItems need to be preserved, we can't simply
1448         re-popluate m_itemList in DataTransferItemList. Instead, whenever the clipboard content is mutated,
1449         we make the parallel modifications to m_itemList. This includes changes made via DataTransfer
1450         methods such as setData and clearData.
1451
1452         Test: editing/pasteboard/datatransfer-items-copy-plaintext.html
1453
1454         * dom/DataTransfer.cpp:
1455         (WebCore::DataTransfer::clearData): Invoke didClearStringData when m_itemList exists.
1456         (WebCore::DataTransfer::setData): Ditto.
1457         (WebCore::DataTransfer::createForInputEvent):
1458         (WebCore::DataTransfer::createForDrag):
1459         (WebCore::DataTransfer::createForDrop):
1460         * dom/DataTransferItem.cpp:
1461         (WebCore::DataTransferItem::create):
1462         (WebCore::DataTransferItem::DataTransferItem):
1463         (WebCore::DataTransferItem::clearListAndPutIntoDisabledMode): Added.
1464         (WebCore::DataTransferItem::type const): Moved from the header.
1465         (WebCore::DataTransferItem::getAsString const):
1466         (WebCore::DataTransferItem::getAsFile const):
1467         * dom/DataTransferItem.h:
1468         (WebCore::DataTransferItem::ref): Deleted.
1469         (WebCore::DataTransferItem::deref): Deleted.
1470         (WebCore::DataTransferItem::isFile const): Added.
1471         (WebCore::DataTransferItem::type const): Move to the cpp file.
1472         * dom/DataTransferItemList.cpp:
1473         (WebCore::isSupportedType): Moved.
1474         (WebCore::DataTransferItemList::DataTransferItemList): Moved from the header.
1475         (WebCore::DataTransferItemList::~DataTransferItemList): Added.
1476         (WebCore::DataTransferItemList::item):
1477         (WebCore::DataTransferItemList::add): Implemented the variant to add string data.
1478         (WebCore::DataTransferItemList::remove): Implemented. For now, we don't have to deal with removing
1479         a file since a writable dataTransfer never contains a File object.
1480         (WebCore::DataTransferItemList::clear): Implemented.
1481         (WebCore::DataTransferItemList::ensureItems const):
1482         (WebCore::removeStringItemOfLowercasedType): Added.
1483         (WebCore::DataTransferItemList::didClearStringData): Called when dataTransfer.clear is called.
1484         (WebCore::DataTransferItemList::didSetStringData): Ditto for 
1485         * dom/DataTransferItemList.h:
1486         (WebCore::DataTransferItemList): Added a WeakPtrFactory. Also use a vector of Ref<DataTransferItem>
1487         instead of unique_ptr<DataTransferItem> since DataTransferItem can outlive DataTransferItemList.
1488         (WebCore::DataTransferItemList::dataTransfer): Added.
1489         * dom/DataTransferItemList.idl:
1490
1491 2017-08-16  Andy Estes  <aestes@apple.com>
1492
1493         [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest
1494         https://bugs.webkit.org/show_bug.cgi?id=175648
1495
1496         Reviewed by Tim Horton.
1497
1498         The W3C Payment Request API defines an interface called PaymentRequest, which conflicts with
1499         an existing Apple Pay class. This patch renames PaymentRequest to
1500         ApplePaySessionPaymentRequest so that a follow-on patch can introduce PaymentRequest for the
1501         W3C API.
1502
1503         * Modules/applepay/ApplePayError.h:
1504         * Modules/applepay/ApplePayLineItem.h:
1505         * Modules/applepay/ApplePayPaymentRequest.h:
1506         * Modules/applepay/ApplePaySession.cpp:
1507         (WebCore::convertAndValidateTotal):
1508         (WebCore::convertAndValidate):
1509         (WebCore::ApplePaySession::ApplePaySession):
1510         (WebCore::ApplePaySession::didSelectShippingMethod):
1511         * Modules/applepay/ApplePaySession.h:
1512         * Modules/applepay/ApplePaySessionPaymentRequest.cpp: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.cpp.
1513         (WebCore::ApplePaySessionPaymentRequest::ApplePaySessionPaymentRequest):
1514         (WebCore::ApplePaySessionPaymentRequest::~ApplePaySessionPaymentRequest):
1515         (WebCore::ApplePaySessionPaymentRequest::isValidSupportedNetwork):
1516         * Modules/applepay/ApplePaySessionPaymentRequest.h: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.h.
1517         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
1518         (WebCore::convert):
1519         (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
1520         * Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
1521         * Modules/applepay/PaymentCoordinator.cpp:
1522         (WebCore::PaymentCoordinator::beginPaymentSession):
1523         (WebCore::PaymentCoordinator::didSelectShippingMethod):
1524         * Modules/applepay/PaymentCoordinator.h:
1525         * Modules/applepay/PaymentCoordinatorClient.h:
1526         * Modules/applepay/PaymentHeaders.h:
1527         * Modules/applepay/PaymentRequestValidator.cpp:
1528         (WebCore::PaymentRequestValidator::validate):
1529         (WebCore::PaymentRequestValidator::validateTotal):
1530         (WebCore::validateMerchantCapabilities):
1531         (WebCore::validateShippingMethod):
1532         (WebCore::validateShippingMethods):
1533         * Modules/applepay/PaymentRequestValidator.h:
1534         * WebCore.xcodeproj/project.pbxproj:
1535         * loader/EmptyClients.cpp:
1536
1537 2017-08-16  Chris Dumez  <cdumez@apple.com>
1538
1539         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight
1540         https://bugs.webkit.org/show_bug.cgi?id=175628
1541         <rdar://problem/33919278>
1542
1543         Reviewed by Geoffrey Garen.
1544
1545         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight.
1546         To achieve this, the following changes were made:
1547         1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload
1548         2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS
1549            preflight merely because the fetch mode is set to "cors").
1550
1551         Test: http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html
1552
1553         * Modules/fetch/FetchBody.cpp:
1554         (WebCore::FetchBody::extract):
1555         * loader/CrossOriginAccessControl.h:
1556         * loader/LoaderStrategy.h:
1557         * loader/PingLoader.cpp:
1558         (WebCore::PingLoader::loadImage):
1559         (WebCore::PingLoader::sendPing):
1560         (WebCore::PingLoader::sendViolationReport):
1561         (WebCore::PingLoader::startPingLoad):
1562         * loader/PingLoader.h:
1563         * loader/cache/CachedResource.cpp:
1564         (WebCore::CachedResource::CachedResource):
1565         (WebCore::CachedResource::load):
1566         * loader/cache/CachedResource.h:
1567         * loader/cache/CachedResourceRequest.cpp:
1568         (WebCore::CachedResourceRequest::CachedResourceRequest):
1569         * loader/cache/CachedResourceRequest.h:
1570         (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders):
1571         * platform/network/HTTPHeaderValues.cpp:
1572         * platform/network/HTTPHeaderValues.h:
1573
1574 2017-08-16  Matt Baker  <mattbaker@apple.com>
1575
1576         Web Inspector: capture async stack trace when workers/main context posts a message
1577         https://bugs.webkit.org/show_bug.cgi?id=167084
1578         <rdar://problem/30033673>
1579
1580         Reviewed by Brian Burg.
1581
1582         Add instrumentation to DOMWindow to support showing asynchronous
1583         stack traces when the debugger pauses in a MessageEvent handler.
1584
1585         Test: inspector/debugger/async-stack-trace.html
1586
1587         * inspector/InspectorInstrumentation.cpp:
1588         (WebCore::InspectorInstrumentation::didPostMessageImpl):
1589         (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
1590         (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
1591         (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
1592
1593         * inspector/InspectorInstrumentation.h:
1594         (WebCore::InspectorInstrumentation::didPostMessage):
1595         (WebCore::InspectorInstrumentation::didFailPostMessage):
1596         (WebCore::InspectorInstrumentation::willDispatchPostMessage):
1597         (WebCore::InspectorInstrumentation::didDispatchPostMessage):
1598
1599         * inspector/PageDebuggerAgent.cpp:
1600         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
1601         (WebCore::PageDebuggerAgent::didPostMessage):
1602         (WebCore::PageDebuggerAgent::didFailPostMessage):
1603         (WebCore::PageDebuggerAgent::willDispatchPostMessage):
1604         (WebCore::PageDebuggerAgent::didDispatchPostMessage):
1605         * inspector/PageDebuggerAgent.h:
1606
1607         * page/DOMWindow.cpp:
1608         (WebCore::DOMWindow::postMessage):
1609         (WebCore::DOMWindow::postMessageTimerFired):
1610
1611 2017-08-16  Timothy Horton  <timothy_horton@apple.com>
1612
1613         Try to fix the build
1614
1615         * platform/ios/PlatformPasteboardIOS.mm:
1616
1617 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
1618
1619         Build fix after r220812
1620
1621         Fix builds where LOG_DISABLED is defined.
1622
1623         * css/MediaQueryEvaluator.cpp:
1624
1625 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
1626
1627         Add a log channel for media queries
1628         https://bugs.webkit.org/show_bug.cgi?id=175591
1629
1630         Reviewed by Zalan Bujtas.
1631
1632         Add a "MediaQueries" log channel which logs data about media query evaluation.
1633
1634         * css/MediaList.cpp:
1635         (WebCore::MediaQuerySet::MediaQuerySet):
1636         (WebCore::operator<<):
1637         * css/MediaList.h:
1638         * css/MediaQuery.cpp:
1639         (WebCore::operator<<):
1640         * css/MediaQuery.h:
1641         * css/MediaQueryEvaluator.cpp:
1642         (WebCore::operator<<):
1643         (WebCore::MediaQueryEvaluator::evaluate const):
1644         (WebCore::aspectRatioValueAsString):
1645         (WebCore::orientationEvaluate):
1646         (WebCore::aspectRatioEvaluate):
1647         (WebCore::deviceAspectRatioEvaluate):
1648         (WebCore::evaluateResolution):
1649         (WebCore::deviceHeightEvaluate):
1650         (WebCore::deviceWidthEvaluate):
1651         (WebCore::heightEvaluate):
1652         (WebCore::widthEvaluate):
1653         * css/MediaQueryExpression.cpp:
1654         (WebCore::operator<<):
1655         * css/MediaQueryExpression.h:
1656         * css/MediaQueryMatcher.cpp:
1657         (WebCore::MediaQueryMatcher::styleResolverChanged):
1658         * css/StyleResolver.cpp:
1659         (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange const):
1660         (WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange const):
1661         * dom/InlineStyleSheetOwner.cpp:
1662         (WebCore::InlineStyleSheetOwner::createSheet):
1663         * html/HTMLImageElement.cpp:
1664         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1665         * html/HTMLLinkElement.cpp:
1666         (WebCore::HTMLLinkElement::process):
1667         * html/HTMLMediaElement.cpp:
1668         (WebCore::HTMLMediaElement::selectNextSourceChild):
1669         * html/HTMLPictureElement.cpp:
1670         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture const):
1671         * html/parser/HTMLPreloadScanner.cpp:
1672         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1673         * page/FrameView.cpp:
1674         (WebCore::FrameView::layout):
1675         * platform/Logging.cpp:
1676         (WebCore::initializeLogChannelsIfNecessary):
1677         * platform/Logging.h:
1678         * platform/URL.cpp:
1679         (WebCore::isSchemeFirstChar):
1680         (WebCore::operator<<):
1681         * platform/URL.h:
1682
1683 2017-08-16  Sam Weinig  <sam@webkit.org>
1684
1685         [WebIDL] Remove the need for JSSubtleCryptoCustom.cpp
1686         https://bugs.webkit.org/show_bug.cgi?id=175526
1687
1688         Reviewed by Chris Dumez.
1689
1690         - Generates bindings for all of SubtleCrypto except AlgorithmIdentifier normalization, 
1691           which is defined in the WebCrypto spec to happen after normal IDL operations.
1692         - Adds initial support for IDL object types in unions (some, unneeded at the moment,
1693           edge cases remain).
1694
1695         * CMakeLists.txt:
1696         * WebCore.xcodeproj/project.pbxproj:
1697         * bindings/js/JSSubtleCryptoCustom.cpp: Removed.
1698
1699             Remove JSSubtleCryptoCustom.cpp, added CryptoKeyFormat.h
1700
1701         * bindings/js/JSDOMConvertObject.h:
1702
1703             Add needed, when included in generated code, #include of StrongInlines.h
1704
1705         * bindings/js/JSDOMConvertUnion.h:
1706         
1707             Add initial support for object (needed for AlgorithmIdentifier which is 
1708             (object or DOMString)). Remaining support will be handled by https://webkit.org/b/175616
1709
1710             Also add remaining spec comments while in the area.
1711
1712         * bindings/js/JSDOMPromiseDeferred.cpp:
1713         (WebCore::DeferredPromise::reject):
1714
1715             Add support for the special ExistingExceptionError error code. Capturing
1716             the current exception and using it as the rejection value.
1717
1718         * crypto/SubtleCrypto.cpp:
1719         (WebCore::SubtleCrypto::~SubtleCrypto):
1720         (WebCore::toHashIdentifier):
1721         (WebCore::normalizeCryptoAlgorithmParameters):
1722         (WebCore::toCryptoKeyUsageBitmap):
1723         (WebCore::rejectWithException):
1724         (WebCore::normalizeJsonWebKey):
1725         (WebCore::toKeyData):
1726         (WebCore::copyToVector):
1727         (WebCore::isSupportedExportKey):
1728         (WebCore::SubtleCrypto::encrypt):
1729         (WebCore::SubtleCrypto::decrypt):
1730         (WebCore::SubtleCrypto::sign):
1731         (WebCore::SubtleCrypto::verify):
1732         (WebCore::SubtleCrypto::digest):
1733         (WebCore::SubtleCrypto::generateKey):
1734         (WebCore::SubtleCrypto::deriveKey):
1735         (WebCore::SubtleCrypto::deriveBits):
1736         (WebCore::SubtleCrypto::importKey):
1737         (WebCore::SubtleCrypto::exportKey):
1738         (WebCore::SubtleCrypto::wrapKey):
1739         (WebCore::SubtleCrypto::unwrapKey):
1740         * crypto/SubtleCrypto.h:
1741         * crypto/SubtleCrypto.idl:
1742
1743             Moves implementation from JSSubtleCryptoCustom.cpp -> here. Important changes that come
1744             with that are:
1745             - All parameters are now converted / type checked for us.
1746             - Rather than throwing exceptions and expecting the bindings layer to convert
1747               them to promise rejections, all rejections are now explicitly made.
1748             - Algorithms are no longer checked for being supported twice, once in normalizeCryptoAlgorithmParameters
1749               and then again in the operation. We instead rely on normalizeCryptoAlgorithmParameters to return
1750               an Exception if its not supported.
1751             - Shaves 251 lines off the file.
1752
1753         * crypto/CryptoKeyFormat.h: Added.
1754
1755             Add new header for unified key format enum. (For bindings purposes, SubtleCrypto
1756             re aliases it to SubtleCrypto::KeyFormat).
1757
1758         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1759         * crypto/CryptoAlgorithm.cpp:
1760         * crypto/CryptoAlgorithm.h:
1761         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1762         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
1763         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
1764         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
1765         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
1766         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
1767         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
1768         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
1769         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1770         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
1771         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
1772         * crypto/algorithms/CryptoAlgorithmECDH.h:
1773         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
1774         * crypto/algorithms/CryptoAlgorithmECDSA.h:
1775         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
1776         * crypto/algorithms/CryptoAlgorithmHKDF.h:
1777         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1778         * crypto/algorithms/CryptoAlgorithmHMAC.h:
1779         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
1780         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
1781         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1782         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
1783         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1784         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
1785         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1786         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
1787         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
1788         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
1789
1790             Use CryptoKeyFormat enum directly, rather than SubtleCrypto::KeyFormat,
1791             to allow not including SubtleCrypto.h.
1792
1793         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
1794         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
1795         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
1796         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
1797         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
1798         * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
1799         * crypto/parameters/EcdsaParams.idl:
1800         * crypto/parameters/HkdfParams.idl:
1801         * crypto/parameters/HmacKeyParams.idl:
1802         * crypto/parameters/Pbkdf2Params.idl:
1803         * crypto/parameters/RsaHashedImportParams.idl:
1804         * crypto/parameters/RsaHashedKeyGenParams.idl:
1805
1806             Update IDLs and implementations to use the correct definition of HashAlgorithmIdentifier,
1807             which is (object or DOMString), now that it is supported.
1808
1809 2017-08-16  Youenn Fablet  <youenn@apple.com>
1810
1811         [Cache API] Implement Worker connection to the Cache storage engine
1812         https://bugs.webkit.org/show_bug.cgi?id=175599
1813
1814         Reviewed by Chris Dumez.
1815
1816         Covered by existing tests.
1817
1818         Adding a WorkerCacheStorageConnection to connect workers Cache/CacheStorage
1819         to the cache storage engine.
1820         WorkerCacheStorageConnection does this by hopping to the main thread to call the document cache storage connection to do the actual job.
1821         Doing some CacheStorageConnection refactoring to share code with WK2 implementation of the cache storage connection. 
1822
1823         * Modules/cache/CacheQueryOptions.h:
1824         (WebCore::CacheQueryOptions::isolatedCopy const):
1825         * Modules/cache/CacheStorageConnection.cpp:
1826         (WebCore::CacheStorageConnection::open):
1827         (WebCore::CacheStorageConnection::remove):
1828         (WebCore::CacheStorageConnection::retrieveCaches):
1829         (WebCore::CacheStorageConnection::retrieveRecords):
1830         (WebCore::CacheStorageConnection::batchDeleteOperation):
1831         (WebCore::CacheStorageConnection::batchPutOperation):
1832         (WebCore::CacheStorageConnection::openOrRemoveCompleted):
1833         (WebCore::CacheStorageConnection::updateCaches):
1834         (WebCore::CacheStorageConnection::updateRecords):
1835         (WebCore::CacheStorageConnection::removeRecordsCompleted):
1836         (WebCore::CacheStorageConnection::putRecordsCompleted):
1837         * Modules/cache/CacheStorageConnection.h:
1838         (WebCore::CacheStorageConnection::openCompleted):
1839         (WebCore::CacheStorageConnection::removeCompleted):
1840         (WebCore::CacheStorageConnection::doOpen):
1841         (WebCore::CacheStorageConnection::doRemove):
1842         (WebCore::CacheStorageConnection::doRetrieveCaches):
1843         (WebCore::CacheStorageConnection::doRetrieveRecords):
1844         (WebCore::CacheStorageConnection::doBatchDeleteOperation):
1845         (WebCore::CacheStorageConnection::doBatchPutOperation):
1846         * Modules/cache/WorkerCacheStorageConnection.cpp: Added.
1847         (WebCore::toCrossThreadRecordData):
1848         (WebCore::fromCrossThreadRecordData):
1849         (WebCore::WorkerCacheStorageConnection::create):
1850         (WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
1851         (WebCore::WorkerCacheStorageConnection::doOpen):
1852         (WebCore::WorkerCacheStorageConnection::doRemove):
1853         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
1854         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
1855         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
1856         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
1857         * Modules/cache/WorkerCacheStorageConnection.h: Added.
1858         * Modules/cache/WorkerGlobalScopeCaches.cpp:
1859         (WebCore::WorkerGlobalScopeCaches::caches const):
1860         * WebCore.xcodeproj/project.pbxproj:
1861         * loader/FetchOptions.h:
1862         (WebCore::FetchOptions::isolatedCopy const):
1863         * workers/WorkerGlobalScope.cpp:
1864         (WebCore::WorkerGlobalScope::cacheStorageConnection):
1865         * workers/WorkerGlobalScope.h:
1866
1867 2017-08-16  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1868
1869         [PAL] Move spi/ios and spi/win directories into PAL
1870         https://bugs.webkit.org/show_bug.cgi?id=175171
1871
1872         Reviewed by Antti Koivisto.
1873
1874         * PlatformWin.cmake:
1875         * WebCore.xcodeproj/project.pbxproj:
1876         * editing/cocoa/DataDetection.mm:
1877         * loader/ios/PreviewLoader.mm:
1878         * page/CaptionUserPreferencesMediaAF.cpp:
1879         * page/cocoa/MemoryReleaseCocoa.mm:
1880         * page/cocoa/SettingsCocoa.mm:
1881         * page/ios/UserAgentIOS.mm:
1882         * platform/audio/ios/MediaSessionManagerIOS.mm:
1883         * platform/graphics/ca/PlatformCALayer.cpp:
1884         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1885         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1886         * platform/graphics/opentype/OpenTypeCG.h:
1887         * platform/graphics/win/SimpleFontDataCGWin.cpp:
1888         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
1889         * platform/ios/Device.h:
1890         * platform/ios/PlatformPasteboardIOS.mm:
1891         * platform/ios/PlatformScreenIOS.mm:
1892         * platform/ios/QuickLookSoftLink.h:
1893         * platform/ios/QuickLookSoftLink.mm:
1894         * platform/ios/ValidationBubbleIOS.mm:
1895         * platform/ios/WebItemProviderPasteboard.mm:
1896         * platform/network/ios/PreviewConverter.mm:
1897         * platform/sql/SQLiteFileSystem.cpp:
1898         * rendering/RenderThemeIOS.mm:
1899
1900 2017-08-16  Tim Horton  <timothy_horton@apple.com>
1901
1902         2-3% of main thread time under UTTypeCreatePreferredIdentifierForTag on wunderground map
1903         https://bugs.webkit.org/show_bug.cgi?id=175618
1904
1905         Reviewed by Simon Fraser.
1906
1907         No new tests, just a perf win.
1908
1909         UTTypeCreatePreferredIdentifierForTag is fairly expensive, and is called
1910         under every toDataURL, which the Wunderground wundermap does a /lot/.
1911
1912         Keep a 16-item LRU cache of MIMEType->UTI mappings.
1913
1914         Also, make other callers of UTTypeCreatePreferredIdentifierForTag use
1915         the UTIUtilities version so they can share in the caching.
1916
1917         Also, as a drive-by, add and make other callers use mimeTypeFromUTI too,
1918         and make the UTIUtilities operate on Strings for a slightly more WebCore-y feel.
1919
1920         * editing/ios/EditorIOS.mm:
1921         (WebCore::Editor::WebContentReader::readImage):
1922         * platform/MIMETypeRegistry.cpp:
1923         (WebCore::initializeSupportedImageMIMETypes):
1924         (WebCore::initializeSupportedImageMIMETypesForEncoding):
1925         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1926         (WebCore::createFileTypesSet):
1927         * platform/graphics/cg/ImageSourceCGMac.mm:
1928         (WebCore::MIMETypeForImageSourceType):
1929         Adopt newly-added MIMETypeFromUTI().
1930
1931         * platform/graphics/cg/ImageBufferCG.cpp:
1932         (WebCore::utiFromImageBufferMIMEType):
1933         (WebCore::ImageBuffer::toCFData const):
1934         (WebCore::cfData):
1935         (WebCore::utiFromMIMEType): Deleted.
1936         Adopt UTIFromMIMEType, and rename the local helper that does something
1937         different (a small static map) on iOS and Windows to not have an overlapping name.
1938
1939         * platform/ios/PasteboardIOS.mm:
1940         (WebCore::Pasteboard::resourceMIMEType):
1941         (WebCore::utiTypeFromCocoaType):
1942         Adopt UTIFromMIMEType().
1943
1944         * platform/ios/PlatformPasteboardIOS.mm:
1945         (WebCore::PlatformPasteboard::writeObjectRepresentations):
1946         * platform/mac/PasteboardMac.mm:
1947         (WebCore::cocoaTypeFromHTMLClipboardType):
1948         Adopt isDeclaredUTI and UTIFromMIMEType().
1949
1950         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1951         (WebCore::WebCoreAVFResourceLoader::responseReceived):
1952         * platform/network/ios/WebCoreURLResponseIOS.mm:
1953         (WebCore::adjustMIMETypeIfNecessary):
1954         * platform/network/mac/WebCoreURLResponse.mm:
1955         (WebCore::adjustMIMETypeIfNecessary):
1956         * rendering/RenderThemeIOS.mm:
1957         (WebCore::iconForAttachment):
1958         * rendering/RenderThemeMac.mm:
1959         (WebCore::iconForAttachment):
1960         Deal with the fact that UTI utilities deal in Strings now.
1961
1962         * platform/network/mac/UTIUtilities.h:
1963         * platform/network/mac/UTIUtilities.mm:
1964         (WebCore::MIMETypeFromUTI):
1965         Added. This doesn't crawl up the UTI tree if the first conversion fails,
1966         which is what most of the existing code does. It's possible we want to
1967         use MIMETypeFromUTITree's logic everywhere, but I didn't want to change
1968         that in this patch.
1969
1970         (WebCore::MIMETypeFromUTITree):
1971         (WebCore::isDeclaredUTI):
1972         Take and return strings.
1973
1974         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
1975         (WebCore::UTIFromMIMEType):
1976         Add the aforementioned cache.
1977
1978 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
1979
1980         Make RenderLayer and RenderLayerBacking TextStream-loggable, and clean up compositing logging
1981         https://bugs.webkit.org/show_bug.cgi?id=175634
1982
1983         Reviewed by Zalan Bujtas.
1984
1985         Add operator<<(TextStream&) for RenderLayer and RenderLayer backing, and use them for compositing logging.
1986
1987         Convert CompositingUpdateType to an enum class.
1988
1989         * page/FrameView.cpp:
1990         (WebCore::FrameView::updateCompositingLayersAfterLayout):
1991         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
1992         * page/ios/FrameIOS.mm:
1993         (WebCore::Frame::viewportOffsetChanged):
1994         * rendering/RenderLayer.cpp:
1995         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
1996         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
1997         (WebCore::RenderLayer::calculateClipRects const):
1998         * rendering/RenderLayer.h:
1999         * rendering/RenderLayerBacking.cpp:
2000         (WebCore::RenderLayerBacking::updateAfterLayout):
2001         (WebCore::RenderLayerBacking::updateGeometry):
2002         (WebCore::operator<<):
2003         * rendering/RenderLayerBacking.h:
2004         * rendering/RenderLayerCompositor.cpp:
2005         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2006         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2007         (WebCore::RenderLayerCompositor::updateCompositingLayersTimerFired):
2008         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2009         (WebCore::RenderLayerCompositor::layerTreeAsText):
2010         (WebCore::operator<<):
2011         * rendering/RenderLayerCompositor.h:
2012
2013 2017-08-16  Eric Carlson  <eric.carlson@apple.com>
2014
2015         Consider allow gUM to be called from localhost without https
2016         https://bugs.webkit.org/show_bug.cgi?id=173457
2017         <rdar://problem/33900527>
2018
2019         Reviewed by Youenn Fablet.
2020
2021         Tests: http/tests/media/media-stream/get-user-media-localhost.html
2022                http/tests/media/media-stream/get-user-media-loopback-ip.html
2023
2024         * Modules/mediastream/UserMediaRequest.cpp:
2025         (WebCore::isSecure): Call SchemeRegistry::shouldTreatURLSchemeAsSecure instead of looking for
2026         the string 'https'.
2027         (WebCore::canCallGetUserMedia): Allow localhost or loopback address.
2028
2029         * page/SecurityOrigin.cpp:
2030         (WebCore::isLoopbackIPAddress): Add a comment.
2031         (WebCore::shouldTreatAsPotentionallyTrustworthy): Move tests for localhost and loopback address
2032         to isLocalHostOrLoopbackIPAddress, call it.
2033         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress): 
2034         * page/SecurityOrigin.h:
2035
2036 2017-08-16  Chris Dumez  <cdumez@apple.com>
2037
2038         EventSource: ignore IDs with U+0000
2039         https://bugs.webkit.org/show_bug.cgi?id=175178
2040
2041         Reviewed by Darin Adler.
2042
2043         EventSource: ignore IDs with U+0000 as per:
2044         https://github.com/whatwg/html/pull/2849
2045
2046         Test: imported/w3c/web-platform-tests/eventsource/format-field-id-null.htm
2047
2048         * page/EventSource.cpp:
2049         (WebCore::EventSource::parseEventStreamLine):
2050
2051 2017-08-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2052
2053         [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
2054         https://bugs.webkit.org/show_bug.cgi?id=174418
2055
2056         Reviewed by Michael Catanzaro.
2057
2058         HarfBuzzShaper should normalize the input text before collecting
2059         HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does
2060         the task. But, this function hasn't been called from anywhere
2061         since Bug 90951.
2062
2063         Test: fast/text/international/vietnamese-nfd.html
2064               imported/blink/fast/text/international/text-shaping-arabic-diffs.html
2065
2066         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2067         (WebCore::HarfBuzzShaper::HarfBuzzShaper):
2068         Call setNormalizedBuffer instead of normalizeCharacters.
2069         (WebCore::normalizeCharacters): Deleted.
2070         (WebCore::normalizeSpacesAndMirrorChars) Use
2071         FontCascade::treatAsZeroWidthSpaceInComplexScript instead of
2072         FontCascade::treatAsZeroWidthSpace to preserve ZWJ and ZWNJ.
2073
2074 2017-08-16  Antti Koivisto  <antti@apple.com>
2075
2076         Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
2077         https://bugs.webkit.org/show_bug.cgi?id=175627
2078
2079         Reviewed by Andreas Kling.
2080
2081         Render tree should not mutate itself. We already fixed this for first-letter, supporting code
2082         can now move to RenderTreeUpdater too.
2083
2084         * CMakeLists.txt:
2085         * WebCore.xcodeproj/project.pbxproj:
2086         * rendering/RenderBlock.cpp:
2087         (WebCore::styleForFirstLetter): Deleted.
2088         (WebCore::isPunctuationForFirstLetter): Deleted.
2089         (WebCore::shouldSkipForFirstLetter): Deleted.
2090         (WebCore::RenderBlock::updateFirstLetterStyle): Deleted.
2091         (WebCore::RenderBlock::createFirstLetterRenderer): Deleted.
2092         (WebCore::RenderBlock::updateFirstLetter): Deleted.
2093         * rendering/RenderBlock.h:
2094         * rendering/RenderRubyRun.cpp:
2095         (WebCore::RenderRubyRun::updateFirstLetter): Deleted.
2096         * rendering/RenderRubyRun.h:
2097         * rendering/RenderTable.cpp:
2098         (WebCore::RenderTable::updateFirstLetter): Deleted.
2099         * rendering/RenderTable.h:
2100
2101             Virtual overrides just disabled first letter for some RenderBlock subclasses. This is now achieved via
2102             supportsFirstLetter test in the first letter updater.
2103
2104         * rendering/TextAutoSizing.cpp:
2105         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2106         * rendering/svg/RenderSVGText.cpp:
2107         (WebCore::RenderSVGText::updateFirstLetter): Deleted.
2108         * rendering/svg/RenderSVGText.h:
2109         * style/RenderTreeUpdater.cpp:
2110         (WebCore::RenderTreeUpdater::popParent):
2111         * style/RenderTreeUpdater.h:
2112         * style/RenderTreeUpdaterFirstLetter.cpp: Added.
2113         (WebCore::styleForFirstLetter):
2114         (WebCore::isPunctuationForFirstLetter):
2115         (WebCore::shouldSkipForFirstLetter):
2116         (WebCore::updateFirstLetterStyle):
2117         (WebCore::createFirstLetterRenderer):
2118         (WebCore::supportsFirstLetter):
2119         (WebCore::RenderTreeUpdater::FirstLetter::update):
2120         * style/RenderTreeUpdaterFirstLetter.h: Added.
2121
2122 2017-08-16  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2123
2124         [GStreamer][EME] Rework handling key systems and UUIDs
2125         https://bugs.webkit.org/show_bug.cgi?id=175567
2126
2127         Reviewed by Žan Doberšek.
2128
2129         The UUIDs and key system strings were moved to the
2130         GStreamerEMEUtilities class because so far they were managed by
2131         the decryptors and that was ugly.
2132
2133         * platform/GStreamer.cmake:
2134         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2135         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
2136         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp: Added.
2137         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Added.
2138         (WebCore::GStreamerEMEUtilities::isClearKeyKeySystem):
2139         (WebCore::GStreamerEMEUtilities::keySystemToUuid):
2140         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2141         (webkit_media_clear_key_decrypt_class_init):
2142         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
2143
2144 2017-08-16  Andy Estes  <aestes@apple.com>
2145
2146         [Payment Request] Add an ENABLE flag and an experimental feature preference
2147         https://bugs.webkit.org/show_bug.cgi?id=175622
2148
2149         Reviewed by Tim Horton.
2150
2151         * Configurations/FeatureDefines.xcconfig:
2152         * page/Settings.in:
2153
2154 2017-08-15  Ryosuke Niwa  <rniwa@webkit.org>
2155
2156         Make DataTransferItemList work with plain text entries
2157         https://bugs.webkit.org/show_bug.cgi?id=175596
2158
2159         Reviewed by Wenson Hsieh.
2160
2161         Added the basic machinery to get the list of plain text items to DataTransferItemList and DataTransferItem.
2162
2163         Each DataTransferItem now depends on DataTransfer so it does ref-forwarding like DataTransferItemList to make
2164         DataTransfer alive as long as any DataTransferItem is alive.
2165
2166         Specifications: https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitem-interface
2167                         https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface
2168
2169         Tests: editing/pasteboard/datatransfer-items-drop-plaintext-file.html
2170                editing/pasteboard/datatransfer-items-paste-plaintext.html
2171
2172         * dom/DataTransferItem.cpp:
2173         (WebCore::DataTransferItem::DataTransferItem): Added two variants one for plain text and another one for a file.
2174         (WebCore::DataTransferItem::kind const): Rewritten.
2175         (WebCore::DataTransferItem::getAsString const): Implemented.
2176         (WebCore::DataTransferItem::getAsFile const): Implemented.
2177         * dom/DataTransferItem.h:
2178         (WebCore::DataTransferItem::ref): Added.
2179         (WebCore::DataTransferItem::deref): Added.
2180         (WebCore::DataTransferItem::type const): Returns String instead of AtomicString.
2181         (WebCore::DataTransferItem::kind const): Moved to cpp.
2182         * dom/DataTransferItem.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow.
2183         * dom/DataTransferItemList.cpp:
2184         (WebCore::DataTransferItemList::length): Implemented.
2185         (WebCore::DataTransferItemList::item): Ditto.
2186         (WebCore::isSupportedType): Added. For now, we only support text/plain.
2187         (WebCore::DataTransferItemList::ensureItems): Added. Constructs the list of DataTransferItems.
2188         * dom/DataTransferItemList.h:
2189         (DataTransferItemList): Added m_items. The list is filled lazily by ensureItems.
2190         * dom/DataTransferItemList.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow.
2191
2192 2017-08-15  Simon Fraser  <simon.fraser@apple.com>
2193
2194         Remove ScrollView::clipsRepaints() which was only used by Chromium
2195         https://bugs.webkit.org/show_bug.cgi?id=175594
2196
2197         Reviewed by Tim Horton.
2198
2199         clipsRepaints() was added in r74568 but was only used by Chromium. It's always
2200         true for other platforms, so remove conditionals that test for it and assume true.
2201
2202         * page/FrameView.cpp:
2203         (WebCore::FrameView::scrollContentsFastPath):
2204         * platform/ScrollView.cpp:
2205         (WebCore::ScrollView::repaintContentRectangle):
2206         (WebCore::ScrollView::setClipsRepaints): Deleted.
2207         * platform/ScrollView.h:
2208         (WebCore::ScrollView::clipsRepaints const): Deleted.
2209
2210 2017-08-15  Simon Fraser  <simon.fraser@apple.com>
2211
2212         Allow WebCore logging channels to be set from the UI process
2213         https://bugs.webkit.org/show_bug.cgi?id=175608
2214
2215         Reviewed by Tim Horton.
2216
2217         Change initializeLogChannelsIfNecessary() to take an optional String, which can
2218         be a list of log channels passed from the UI process.
2219
2220         * platform/LogInitialization.h:
2221         * platform/Logging.cpp:
2222         (WebCore::initializeLogChannelsIfNecessary):
2223
2224 2017-08-15  Chris Dumez  <cdumez@apple.com>
2225
2226         Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView
2227         https://bugs.webkit.org/show_bug.cgi?id=175600
2228
2229         Reviewed by Youenn Fablet.
2230
2231         Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView in Fetch & Beacon.
2232         If we don't set a Content-Type header, our underlying network stack is going to add a "application/x-www-form-urlencoded"
2233         Content-Type header, which is worse.
2234
2235         Chrome is already using "application/octet-stream" Content-Type in Beacon, but use no Content-Type in Fetch.
2236         The Fetch/Beacon specification says we should have no Content-Type header in this case but this is unfortunately
2237         not something we can support at the moment. Using "application/octet-stream" Content-Type for now seems like the
2238         lesser evil.
2239
2240         Test: http/wpt/fetch/fetch-request-arraybuffer-content-type.html
2241
2242         * Modules/fetch/FetchBody.cpp:
2243         (WebCore::FetchBody::extract):
2244         * platform/network/HTTPHeaderValues.cpp:
2245         (WebCore::HTTPHeaderValues::octetStreamContentType):
2246         * platform/network/HTTPHeaderValues.h:
2247
2248 2017-08-15  Robin Morisset  <rmorisset@apple.com>
2249
2250         Change the order of arguments of JSWithScope::create() for consistency
2251         https://bugs.webkit.org/show_bug.cgi?id=175585
2252
2253         Reviewed by Saam Barati.
2254
2255         No change of behavior.
2256
2257         * bindings/js/JSHTMLElementCustom.cpp:
2258         (WebCore::JSHTMLElement::pushEventHandlerScope const):
2259
2260 2017-08-15  Youenn Fablet  <youenn@apple.com>
2261
2262         [Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields are set
2263         https://bugs.webkit.org/show_bug.cgi?id=175538
2264
2265         Reviewed by Chris Dumez.
2266
2267         No change of behavior.
2268         This change ensures that response type is preserved when encoding/decoding ResourceResponse, in particular the error type.
2269         This will allow Cache API to preserve responses when reading them from a different process.
2270
2271         * platform/network/ResourceResponseBase.cpp:
2272         (WebCore::ResourceResponseBase::setType):
2273         * platform/network/ResourceResponseBase.h:
2274         (WebCore::ResourceResponseBase::setType):
2275
2276 2017-08-15  Chris Dumez  <cdumez@apple.com>
2277
2278         Update CachedResourceLoader::requestResource() to return a WTF::Expected
2279         https://bugs.webkit.org/show_bug.cgi?id=175505
2280
2281         Reviewed by Youenn Fablet.
2282
2283         Update CachedResourceLoader::requestResource() to return a WTF::Expected
2284         type instead of using an out parameter for the ResourceError in case of
2285         synchronous failure.
2286
2287         * Modules/beacon/NavigatorBeacon.cpp:
2288         (WebCore::NavigatorBeacon::sendBeacon):
2289         * bindings/js/CachedScriptFetcher.cpp:
2290         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
2291         * css/CSSFontFaceSrcValue.cpp:
2292         (WebCore::CSSFontFaceSrcValue::cachedFont):
2293         * css/CSSImageSetValue.cpp:
2294         (WebCore::CSSImageSetValue::loadBestFitImage):
2295         * css/CSSImageValue.cpp:
2296         (WebCore::CSSImageValue::loadImage):
2297         * css/StyleRuleImport.cpp:
2298         (WebCore::StyleRuleImport::requestStyleSheet):
2299         * dom/ProcessingInstruction.cpp:
2300         (WebCore::ProcessingInstruction::checkStyleSheet):
2301         * html/HTMLLinkElement.cpp:
2302         (WebCore::HTMLLinkElement::process):
2303         * loader/CrossOriginPreflightChecker.cpp:
2304         (WebCore::CrossOriginPreflightChecker::startPreflight):
2305         * loader/DocumentLoader.cpp:
2306         (WebCore::DocumentLoader::startLoadingMainResource):
2307         * loader/DocumentThreadableLoader.cpp:
2308         (WebCore::DocumentThreadableLoader::loadRequest):
2309         * loader/FrameLoader.cpp:
2310         (WebCore::FrameLoader::loadedResourceFromMemoryCache):
2311         * loader/FrameLoader.h:
2312         * loader/ImageLoader.cpp:
2313         (WebCore::ImageLoader::updateFromElement):
2314         * loader/LinkLoader.cpp:
2315         (WebCore::LinkLoader::preloadIfNeeded):
2316         * loader/MediaResourceLoader.cpp:
2317         (WebCore::MediaResourceLoader::requestResource):
2318         * loader/TextTrackLoader.cpp:
2319         (WebCore::TextTrackLoader::load):
2320         * loader/cache/CachedResourceLoader.cpp:
2321         (WebCore::castCachedResourceTo):
2322         (WebCore::CachedResourceLoader::requestImage):
2323         (WebCore::CachedResourceLoader::requestFont):
2324         (WebCore::CachedResourceLoader::requestTextTrack):
2325         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
2326         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2327         (WebCore::CachedResourceLoader::requestScript):
2328         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
2329         (WebCore::CachedResourceLoader::requestSVGDocument):
2330         (WebCore::CachedResourceLoader::requestLinkResource):
2331         (WebCore::CachedResourceLoader::requestMedia):
2332         (WebCore::CachedResourceLoader::requestIcon):
2333         (WebCore::CachedResourceLoader::requestRawResource):
2334         (WebCore::CachedResourceLoader::requestBeaconResource):
2335         (WebCore::CachedResourceLoader::requestMainResource):
2336         (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
2337         (WebCore::CachedResourceLoader::requestResource):
2338         (WebCore::CachedResourceLoader::preload):
2339         * loader/cache/CachedResourceLoader.h:
2340         * loader/cache/CachedSVGDocumentReference.cpp:
2341         (WebCore::CachedSVGDocumentReference::load):
2342         * loader/icon/IconLoader.cpp:
2343         (WebCore::IconLoader::startLoading):
2344         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2345         (WebCore::WebCoreAVFResourceLoader::startLoading):
2346         * svg/SVGFEImageElement.cpp:
2347         (WebCore::SVGFEImageElement::requestImageResource):
2348         * svg/SVGFontFaceUriElement.cpp:
2349         (WebCore::SVGFontFaceUriElement::loadFont):
2350         * svg/SVGUseElement.cpp:
2351         (WebCore::SVGUseElement::updateExternalDocument):
2352         * xml/XSLImportRule.cpp:
2353         (WebCore::XSLImportRule::loadSheet):
2354
2355 2017-08-15  Don Olmstead  <don.olmstead@sony.com>
2356
2357         [PAL] Move Sleep classes into PAL
2358         https://bugs.webkit.org/show_bug.cgi?id=175456
2359
2360         Reviewed by Ryosuke Niwa.
2361
2362         No new tests. No change in behavior.
2363
2364         * CMakeLists.txt:
2365         * PlatformMac.cmake:
2366         * WebCore.xcodeproj/project.pbxproj:
2367         * html/HTMLMediaElement.cpp:
2368         * html/HTMLMediaElement.h:
2369         * platform/audio/PlatformMediaSessionManager.cpp:
2370         * platform/audio/PlatformMediaSessionManager.h:
2371         * platform/mac/WebVideoFullscreenController.h:
2372         * platform/mac/WebVideoFullscreenController.mm:
2373
2374 2017-08-15  Youenn Fablet  <youenn@apple.com>
2375
2376         [Cache API] Adding generic support for CacheStorage and Cache methods
2377         https://bugs.webkit.org/show_bug.cgi?id=175455
2378
2379         Reviewed by Chris Dumez.
2380
2381         Covered by existing tests.
2382
2383         Adding a CacheStorageProvider abstraction that creates a CacheStorageConnection.
2384         The CacheStorageProvider is accessed from the page for Document calls.
2385         The CacheStorageConnection is responsible to implement the read/write operations on the cache database.
2386         At the moment, it does nothing but return not implemented errors.
2387
2388         Implementing CacheStorage APIs and Cache APIs based on the CacheStorageConnection except for Cache add and addAll which will be implemented later on.
2389         CacheStoragConnection is responsible to read/write CacheStorage list of caches and each individual cache.
2390         The CacheStorageConnection is a generic connection and not tied to any document/context.
2391         CacheStorage objects are manipulated by providing to the connection the origin of the context.
2392         CacheStorage are global to all contexts with the same origin.
2393         Cache objects are manipulated by an ID that is given initially by the CacheStorageEngine when opening the Cache object.
2394
2395         Adding various accessors and constructors for Fetch constructs as needed by the Cache API implementation.
2396
2397         * Modules/cache/Cache.cpp:
2398         (WebCore::Cache::Cache):
2399         (WebCore::Cache::~Cache):
2400         The CacheStorageConnection is a generic connection and not tied to any document/context.
2401         (WebCore::Cache::match): Implementation of https://www.w3.org/TR/service-workers-1/#cache-match.
2402         Redirect to matchAll as per spec.
2403         (WebCore::Cache::matchAll): Implementation of https://www.w3.org/TR/service-workers-1/#cache-matchAll.
2404         Checks for request as per spec. Then either refresh the request to response map and return all responses.
2405         Or call the query cache algorithm and return copies of the responses (using clone).
2406         (WebCore::Cache::put):
2407         Check the request and response as per spec.
2408         Add temporary rejection cases (being loaded responses, responses with ReadableStream) as there is no support for them right now.
2409         Call the batch put operation.
2410         (WebCore::Cache::remove):
2411         Check the request and response as per spec.
2412         Call the batch delete operation.
2413         (WebCore::Cache::keys):
2414         Refresh the request to response map and return corresponding requests.
2415         Making sure to reuse the same request objects as per spec.
2416         As per spec, the request to response map is ordered. We implement it as a Vector.
2417         (WebCore::Cache::refreshRequestToResponseMap):
2418         Use the cache storage connection to get an up-to-date list of cached records.
2419         (WebCore::Cache::queryCacheMatch):
2420         Implements the match algorithm defined in https://www.w3.org/TR/service-workers-1/#query-cache-algorithm.
2421         This is split for queryCache as cache storage engine will need to use it when implementing the delete operation.
2422         (WebCore::Cache::queryCache):
2423         Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with no targetStorage argument.
2424         (WebCore::Cache::queryCacheWithTargetStorage):
2425         Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with a provided targetStorage argument.
2426         (WebCore::Cache::batchDeleteOperation):
2427         Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm but dedicated to a delete operation.
2428         Delete operation are always done one at a time.
2429         (WebCore::Cache::batchPutOperation):
2430         Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm dedicated to a put operation.
2431         Put operation takes one record for put but can take several records in the case of addAll, hence the current design.
2432         (WebCore::Cache::updateRequestToResponseMap):
2433         Update the cache request to response map based on the records retrieved from the cache storage connection.
2434         * Modules/cache/Cache.h:
2435         (WebCore::Cache::create):
2436         (WebCore::Cache::name const):
2437         * Modules/cache/Cache.idl:
2438         * Modules/cache/CacheStorage.cpp:
2439         (WebCore::CacheStorage::origin const):
2440         Computing the cache origin that is passed to the CacheStorageConnection.
2441         (WebCore::CacheStorage::has):
2442         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-has.
2443         Call the cache storage connection to refresh its cache map.
2444         Then use it to check whether a cache exists.
2445         (WebCore::CacheStorage::refreshCacheMap):
2446         Use the cache storage connection to get the list of existing caches.
2447         (WebCore::CacheStorage::open):
2448         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-open.
2449         Refreshing the cache map so as to return a pre-existing cache if any.
2450         (WebCore::CacheStorage::remove):
2451         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-delete-method.
2452         Refreshing the cache map so as to do nothing if there is no cache to remove.
2453         (WebCore::CacheStorage::keys):
2454         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-keys-method.
2455         Refreshing the cache map and returnin its keys.
2456         As per spec, the cache map is ordered. We implement it as a Vector.
2457         (WebCore::CacheStorage::cacheMap):
2458         Get the list of cache objects, used as a private accessor for JS built-ins.
2459         * Modules/cache/CacheStorage.h:
2460         (WebCore::CacheStorage::create):
2461         (WebCore::CacheStorage::CacheStorage):
2462         * Modules/cache/CacheStorageConnection.cpp: Added.
2463         (WebCore::CacheStorageConnection::exceptionFromError):
2464         * Modules/cache/CacheStorageConnection.h: Added.
2465         Makes the link between Web facing Cache API and the cache storage engine.
2466         Envisioned implementation are:
2467         - One main thread connection used by all documents in the given process.
2468         - One connection per worker that forwards the calls to the main thread and use the main thread connection afterwards.
2469         (WebCore::CacheStorageConnection::create):
2470         (WebCore::CacheStorageConnection::open):
2471         (WebCore::CacheStorageConnection::remove):
2472         (WebCore::CacheStorageConnection::refreshCacheMap):
2473         (WebCore::CacheStorageConnection::refreshRequestToResponseMap):
2474         (WebCore::CacheStorageConnection::batchDeleteOperation):
2475         (WebCore::CacheStorageConnection::batchPutOperation):
2476         * Modules/cache/CacheStorageRecord.h: Added. A fetch record from the Web facing cache API perspective.
2477         * Modules/cache/DOMWindowCaches.cpp:
2478         (WebCore::DOMWindowCaches::caches const):
2479         * Modules/cache/WorkerGlobalScopeCaches.cpp:
2480         (WebCore::WorkerGlobalScopeCaches::from):
2481         (WebCore::WorkerGlobalScopeCaches::caches const):
2482         * Modules/cache/WorkerGlobalScopeCaches.h:
2483         (WebCore::WorkerGlobalScopeCaches::WorkerGlobalScopeCaches):
2484         * Modules/fetch/FetchBodyOwner.h:
2485         (WebCore::FetchBodyOwner::isReadableStreamBody const): Added getter as it is used by cache API.
2486         * Modules/fetch/FetchHeaders.h:
2487         (WebCore::FetchHeaders::create): Add another create as used by the cache API.
2488         (WebCore::FetchHeaders::guard const): Added getter and IPC serializer as this is something that will be stored by the cache engine.
2489         * Modules/fetch/FetchLoader.cpp:
2490         (WebCore::FetchLoader::start):
2491         * Modules/fetch/FetchRequest.cpp:
2492         (WebCore::buildOptions): In case FetchRequest::create is called from C++, there is no need to set init.window to a null value.
2493         Add a check so that no value at all is the same as a null/undefined value.
2494         (WebCore::FetchRequest::resourceRequest const):
2495         * Modules/fetch/FetchRequest.h:
2496         * Modules/fetch/FetchResponse.h:
2497         * WebCore.xcodeproj/project.pbxproj:
2498         * inspector/InspectorOverlay.cpp:
2499         (WebCore::InspectorOverlay::overlayPage):
2500         * page/CacheStorageProvider.h: Added.
2501         Interface to create main thread cache storage connection for the given page.
2502         There will be one provider for each process.
2503         Passing a sessionID so that we will create a connection per session.
2504         * page/Page.cpp:
2505         (WebCore::Page::Page):
2506         * page/Page.h:
2507         (WebCore::Page::cacheStorageProvider):
2508         * page/PageConfiguration.cpp:
2509         (WebCore::PageConfiguration::PageConfiguration):
2510         * page/PageConfiguration.h:
2511         * svg/graphics/SVGImage.cpp:
2512         (WebCore::SVGImage::dataChanged):
2513
2514 2017-08-15  Chris Dumez  <cdumez@apple.com>
2515
2516         Implement quota limitation for keepalive Fetch requests
2517         https://bugs.webkit.org/show_bug.cgi?id=175482
2518
2519         Reviewed by Sam Weinig and Youenn Fablet.
2520
2521         Implement quota limitation for keepalive Fetch requests as per:
2522         - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)
2523
2524         This partly works for Beacon as well, meaning that no Beacon with a body
2525         over 64Kb can be sent. However, we don't keep track about wether or not
2526         beacon loads are inflight or not.
2527
2528         Also update CachedResourceLoader::requestResource() so that the caller
2529         can get a ResourceError when it returns null. This is useful for both
2530         Fetch and Beacon to return better error messages.
2531
2532         Test: http/wpt/beacon/beacon-quota.html
2533
2534         * CMakeLists.txt:
2535         * Modules/beacon/NavigatorBeacon.cpp:
2536         (WebCore::NavigatorBeacon::sendBeacon):
2537         * Modules/fetch/FetchBodyOwner.cpp:
2538         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
2539         (WebCore::FetchBodyOwner::BlobLoader::didFail):
2540         * Modules/fetch/FetchBodyOwner.h:
2541         * Modules/fetch/FetchLoader.cpp:
2542         (WebCore::FetchLoader::start):
2543         (WebCore::FetchLoader::didFail):
2544         * Modules/fetch/FetchLoaderClient.h:
2545         * Modules/fetch/FetchResponse.cpp:
2546         (WebCore::FetchResponse::BodyLoader::didFail):
2547         * Modules/fetch/FetchResponse.h:
2548         * WebCore.xcodeproj/project.pbxproj:
2549         * loader/DocumentThreadableLoader.cpp:
2550         (WebCore::DocumentThreadableLoader::loadRequest):
2551         * loader/cache/CachedResource.cpp:
2552         (WebCore::CachedResource::load):
2553         * loader/cache/CachedResource.h:
2554         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
2555         * loader/cache/CachedResourceLoader.cpp:
2556         (WebCore::createResource):
2557         (WebCore::CachedResourceLoader::requestImage):
2558         (WebCore::CachedResourceLoader::requestFont):
2559         (WebCore::CachedResourceLoader::requestTextTrack):
2560         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
2561         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2562         (WebCore::CachedResourceLoader::requestScript):
2563         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
2564         (WebCore::CachedResourceLoader::requestSVGDocument):
2565         (WebCore::CachedResourceLoader::requestLinkResource):
2566         (WebCore::CachedResourceLoader::requestMedia):
2567         (WebCore::CachedResourceLoader::requestIcon):
2568         (WebCore::CachedResourceLoader::requestRawResource):
2569         (WebCore::CachedResourceLoader::requestBeaconResource):
2570         (WebCore::CachedResourceLoader::requestMainResource):
2571         (WebCore::CachedResourceLoader::requestResource):
2572         (WebCore::CachedResourceLoader::preload):
2573         * loader/cache/CachedResourceLoader.h:
2574         * loader/cache/KeepaliveRequestTracker.cpp: Added.
2575         (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
2576         (WebCore::KeepaliveRequestTracker::canLoadRequest):
2577         (WebCore::KeepaliveRequestTracker::registerRequest):
2578         (WebCore::KeepaliveRequestTracker::responseReceived):
2579         (WebCore::KeepaliveRequestTracker::notifyFinished):
2580         (WebCore::KeepaliveRequestTracker::unregisterRequest):
2581         * loader/cache/KeepaliveRequestTracker.h: Added.
2582         * platform/network/FormData.cpp:
2583         (WebCore::FormDataElement::lengthInBytes const):
2584         (WebCore::FormData::lengthInBytes const):
2585         * platform/network/FormData.h:
2586
2587 2017-08-15  Darin Adler  <darin@apple.com>
2588
2589         REGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer.html is crashing.
2590         https://bugs.webkit.org/show_bug.cgi?id=175107
2591
2592         Reviewed by Alexey Proskuryakov.
2593
2594         * loader/FrameLoader.cpp:
2595         (WebCore::FrameLoader::checkLoadComplete): Moved the assertion to after the null page check.
2596
2597 2017-08-15  Commit Queue  <commit-queue@webkit.org>
2598
2599         Unreviewed, rolling out r219504.
2600         https://bugs.webkit.org/show_bug.cgi?id=175580
2601
2602         Broke Arabic text shaping (Requested by mcatanzaro on
2603         #webkit).
2604
2605         Reverted changeset:
2606
2607         "[HarfBuzz] Decomposed Vietnamese characters are rendered
2608         incorrectly"
2609         https://bugs.webkit.org/show_bug.cgi?id=174418
2610         http://trac.webkit.org/changeset/219504
2611
2612 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2613
2614         WebDriver: handle click events on option elements
2615         https://bugs.webkit.org/show_bug.cgi?id=174710
2616         <rdar://problem/33459305>
2617
2618         Reviewed by Brian Burg.
2619
2620         Export WebCore symbols required by WebKit layer.
2621
2622         * html/HTMLOptGroupElement.h:
2623         * html/HTMLOptionElement.h:
2624
2625 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
2626
2627         Remove Proximity Events and related code
2628         https://bugs.webkit.org/show_bug.cgi?id=175545
2629
2630         Reviewed by Daniel Bates.
2631
2632         No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
2633         and other related code.
2634
2635         * CMakeLists.txt:
2636         * Configurations/FeatureDefines.xcconfig:
2637         * DerivedSources.cpp:
2638         * Modules/proximity/DeviceProximityClient.h: Removed.
2639         * Modules/proximity/DeviceProximityController.cpp: Removed.
2640         * Modules/proximity/DeviceProximityController.h: Removed.
2641         * Modules/proximity/DeviceProximityEvent.cpp: Removed.
2642         * Modules/proximity/DeviceProximityEvent.h: Removed.
2643         * Modules/proximity/DeviceProximityEvent.idl: Removed.
2644         * dom/EventNames.h:
2645         * dom/EventNames.in:
2646         * history/PageCache.cpp:
2647         (WebCore::canCachePage):
2648         * page/DOMWindow.cpp:
2649         (WebCore::DOMWindow::addEventListener):
2650         (WebCore::DOMWindow::removeEventListener):
2651         (WebCore::DOMWindow::removeAllEventListeners):
2652         * page/DOMWindow.idl:
2653         * page/DiagnosticLoggingKeys.cpp:
2654         (WebCore::DiagnosticLoggingKeys::deviceProximityKey): Deleted.
2655         * page/DiagnosticLoggingKeys.h:
2656         * testing/Internals.cpp:
2657         (WebCore::Internals::setDeviceProximity): Deleted.
2658         * testing/Internals.h:
2659         * testing/Internals.idl:
2660
2661 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
2662
2663         Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
2664         https://bugs.webkit.org/show_bug.cgi?id=175504
2665
2666         Reviewed by Sam Weinig.
2667         
2668         REQUEST_AUTOCOMPLETE was added in r133396 then removed in r148731, but brought back in r173596,
2669         however no further work was done, and it was left disabled. So remove the code.
2670
2671         * Configurations/FeatureDefines.xcconfig:
2672         * DerivedSources.make:
2673         * WebCore.xcodeproj/project.pbxproj:
2674         * dom/AutocompleteErrorEvent.h: Removed.
2675         * dom/AutocompleteErrorEvent.idl: Removed.
2676         * dom/EventNames.in:
2677         * dom/GlobalEventHandlers.idl:
2678         * html/HTMLFormElement.cpp:
2679         (WebCore::HTMLFormElement::HTMLFormElement):
2680         (WebCore::HTMLFormElement::requestAutocomplete): Deleted.
2681         (WebCore::HTMLFormElement::finishRequestAutocomplete): Deleted.
2682         (WebCore::HTMLFormElement::requestAutocompleteTimerFired): Deleted.
2683         * html/HTMLFormElement.h:
2684         * html/HTMLFormElement.idl:
2685         * loader/EmptyClients.cpp:
2686         * loader/FrameLoaderClient.h:
2687
2688 2017-08-14  Chris Dumez  <cdumez@apple.com>
2689
2690         XHR should only fire an abort event if the cancellation was requested by the client
2691         https://bugs.webkit.org/show_bug.cgi?id=175546
2692
2693         Reviewed by Youenn Fablet.
2694
2695         XHR should only fire an abort event if the cancellation was requested by the client, otherwise it should fire an error event.
2696         Blink and Gecko already match the specification.
2697
2698         Specification:
2699         - https://xhr.spec.whatwg.org/#handle-errors
2700         - https://xhr.spec.whatwg.org/#the-abort()-method
2701
2702         Test: http/tests/navigation/page-cache-xhr-in-pagehide.html
2703
2704         * xml/XMLHttpRequest.cpp:
2705         (WebCore::XMLHttpRequest::open):
2706         (WebCore::XMLHttpRequest::abort):
2707         (WebCore::XMLHttpRequest::abortError):
2708         (WebCore::XMLHttpRequest::didFail):
2709         * xml/XMLHttpRequest.h:
2710
2711 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
2712
2713         Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
2714         https://bugs.webkit.org/show_bug.cgi?id=175557
2715
2716         Reviewed by Jon Lee.
2717
2718         No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
2719
2720         * Configurations/FeatureDefines.xcconfig:
2721         * css/CSSValueKeywords.in:
2722         * css/MediaFeatureNames.h:
2723         * css/MediaQueryEvaluator.cpp:
2724         (WebCore::viewModeEvaluate): Deleted.
2725         * css/MediaQueryExpression.cpp:
2726         (WebCore::featureWithValidIdent):
2727         (WebCore::isFeatureValidWithoutValue):
2728         * page/Page.cpp:
2729         (WebCore::Page::stringToViewMode): Deleted.
2730         (WebCore::Page::setViewMode): Deleted.
2731         * page/Page.h:
2732         (WebCore::Page::viewMode const): Deleted.
2733
2734 2017-08-14  Myles C. Maxfield  <mmaxfield@apple.com>
2735
2736         Parse font-display
2737         https://bugs.webkit.org/show_bug.cgi?id=175382
2738
2739         Reviewed by Simon Fraser.
2740
2741         The syntax is very simple: font-display: auto | block | swap | fallback | optional.
2742         So, parsing support is quite straightfoward.
2743
2744         Test: fast/text/font-display/parse.html
2745
2746         * css/CSSComputedStyleDeclaration.cpp:
2747         (WebCore::ComputedStyleExtractor::propertyValue):
2748         * css/CSSFontFace.cpp:
2749         (WebCore::CSSFontFace::setLoadingBehavior):
2750         * css/CSSFontFace.h:
2751         * css/CSSFontSelector.cpp:
2752         (WebCore::CSSFontSelector::addFontFaceRule):
2753         * css/CSSPrimitiveValueMappings.h:
2754         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2755         (WebCore::CSSPrimitiveValue::operator FontLoadingBehavior const):
2756         * css/CSSProperties.json:
2757         * css/CSSProperty.cpp:
2758         (WebCore::CSSProperty::isDescriptorOnly):
2759         * css/CSSValueKeywords.in:
2760         * css/parser/CSSPropertyParser.cpp:
2761         (WebCore::consumeFontFaceFontDisplay):
2762         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
2763         * rendering/style/RenderStyleConstants.h:
2764
2765 2017-08-14  Jer Noble  <jer.noble@apple.com>
2766
2767         Obj-C exception crash in AVStreamSession when using EME in Private Browsing mode
2768         https://bugs.webkit.org/show_bug.cgi?id=175547
2769
2770         Reviewed by Eric Carlson.
2771
2772         When the storagePath() is empty, do not use those AVStreamSession APIs which require a valid file path to stored
2773         proof-of-key-release data.
2774
2775         Drive-by fix: return emptyString() from HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory() when in Private
2776         Browsing mode, to match the behavior of WebKitMediaKeySession.
2777
2778         * html/HTMLMediaElement.cpp:
2779         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
2780         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2781         (WebCore::CDMSessionAVStreamSession::releaseKeys):
2782         (WebCore::CDMSessionAVStreamSession::update):
2783         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
2784
2785 2017-08-14  Andy Estes  <aestes@apple.com>
2786
2787         REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
2788         https://bugs.webkit.org/show_bug.cgi?id=175548
2789         <rdar://problem/33866206>
2790
2791         Reviewed by Brady Eidson.
2792
2793         New API test: QuickLook.ShouldCreateForMIMEType
2794
2795         * WebCore.xcodeproj/project.pbxproj:
2796         * loader/ios/PreviewLoader.h:
2797         * loader/ios/PreviewLoader.mm:
2798         (WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before
2799         calling HashSet::contains().
2800
2801 2017-08-14  Andy Estes  <aestes@apple.com>
2802
2803         [Apple Pay] Add support for phonetic contact names
2804         https://bugs.webkit.org/show_bug.cgi?id=175537
2805         <rdar://problem/32002644>
2806
2807         Reviewed by Tim Horton.
2808
2809         * Modules/applepay/ApplePayError.idl: Defined "phoneticName" in ApplePayErrorContactField.
2810         * Modules/applepay/ApplePayPaymentContact.h: Defined phoneticGivenName and phoneticFamilyName
2811         in ApplePayPaymentContact.
2812         * Modules/applepay/ApplePayPaymentContact.idl: Ditto.
2813         * Modules/applepay/ApplePayPaymentRequest.h: Defined PhoneticName in
2814         ApplePayPaymentRequest::ContactField.
2815         * Modules/applepay/ApplePayPaymentRequest.idl: Defined "phoneticName" in ApplePayContactField.
2816         * Modules/applepay/ApplePaySession.cpp:
2817         (WebCore::convertAndValidate): Added a version parameter. Added code to convert
2818         ContactField::PhoneticName, throwing an exception if version is less than 3.
2819         * Modules/applepay/PaymentContact.h: Added a version parameter to fromApplePayPaymentContact().
2820         * Modules/applepay/PaymentRequest.h: Defined phoneticName in PaymentRequest::ContactFields
2821         and defined PhoneticName in PaymentError::ContactField.
2822         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2823         (WebCore::convert): Added a version parameter. Set a phoneticRepresentation on the
2824         PKContact's name if there are non-empty phonetic names and version is 3 or greater.
2825         (WebCore::PaymentContact::fromApplePayPaymentContact): Passed version to convert().
2826
2827 2017-08-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
2828
2829         The none smooth stroke applied to an SVG shape breaks its hit testing
2830         https://bugs.webkit.org/show_bug.cgi?id=175506
2831
2832         Reviewed by Simon Fraser.
2833
2834         Clear RenderSVGShape::m_path when calling RenderSVGRect::updateShapeFromElement().
2835         The m_path will be recalculated when RenderSVGShape::updateShapeFromElement()
2836         is called from RenderSVGRect::shapeDependentStrokeContains().
2837
2838         Test: svg/stroke/stroke-linejoin-click.html
2839
2840         * rendering/svg/RenderSVGRect.cpp:
2841         (WebCore::RenderSVGRect::updateShapeFromElement):
2842         * rendering/svg/RenderSVGShape.h:
2843         (WebCore::RenderSVGShape::clearPath):
2844
2845 2017-08-14  Adrian Perez de Castro  <aperez@igalia.com>
2846
2847         [WPE] Implement WebCore::standardUserAgent()
2848         https://bugs.webkit.org/show_bug.cgi?id=175507
2849
2850         Reviewed by Michael Catanzaro.
2851
2852         Remove "_GLIB" from user-agent version macros.
2853
2854         * platform/glib/UserAgentGLib.cpp:
2855         (WebCore::versionForUAString):
2856
2857 2017-08-14  Chris Dumez  <cdumez@apple.com>
2858
2859         Unreviewed, rollout r220622 & r220696
2860         https://bugs.webkit.org/show_bug.cgi?id=175482
2861         <rdar://problem/33860695>
2862
2863         Seems to have caused failures on iOS.
2864
2865         * CMakeLists.txt:
2866         * Modules/beacon/NavigatorBeacon.cpp:
2867         (WebCore::NavigatorBeacon::sendBeacon):
2868         * Modules/fetch/FetchBodyOwner.cpp:
2869         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
2870         (WebCore::FetchBodyOwner::BlobLoader::didFail):
2871         * Modules/fetch/FetchBodyOwner.h:
2872         * Modules/fetch/FetchLoader.cpp:
2873         (WebCore::FetchLoader::start):
2874         (WebCore::FetchLoader::didFail):
2875         * Modules/fetch/FetchLoaderClient.h:
2876         * Modules/fetch/FetchResponse.cpp:
2877         (WebCore::FetchResponse::BodyLoader::didFail):
2878         * Modules/fetch/FetchResponse.h:
2879         * WebCore.xcodeproj/project.pbxproj:
2880         * loader/DocumentThreadableLoader.cpp:
2881         (WebCore::DocumentThreadableLoader::loadRequest):
2882         * loader/cache/CachedRawResource.cpp:
2883         (WebCore::CachedRawResource::finishLoading):
2884         * loader/cache/CachedResource.cpp:
2885         (WebCore::CachedResource::load):
2886         * loader/cache/CachedResource.h:
2887         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
2888         * loader/cache/CachedResourceLoader.cpp:
2889         (WebCore::createResource):
2890         (WebCore::CachedResourceLoader::requestImage):
2891         (WebCore::CachedResourceLoader::requestFont):
2892         (WebCore::CachedResourceLoader::requestTextTrack):
2893         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
2894         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2895         (WebCore::CachedResourceLoader::requestScript):
2896         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
2897         (WebCore::CachedResourceLoader::requestSVGDocument):
2898         (WebCore::CachedResourceLoader::requestLinkResource):
2899         (WebCore::CachedResourceLoader::requestMedia):
2900         (WebCore::CachedResourceLoader::requestIcon):
2901         (WebCore::CachedResourceLoader::requestRawResource):
2902         (WebCore::CachedResourceLoader::requestBeaconResource):
2903         (WebCore::CachedResourceLoader::requestMainResource):
2904         (WebCore::CachedResourceLoader::requestResource):
2905         (WebCore::CachedResourceLoader::preload):
2906         * loader/cache/CachedResourceLoader.h:
2907         * loader/cache/KeepaliveRequestTracker.cpp: Removed.
2908         * loader/cache/KeepaliveRequestTracker.h: Removed.
2909         * platform/network/FormData.cpp:
2910         (WebCore::FormData::appendFile):
2911         (WebCore::FormData::appendFileRange):
2912         (WebCore::FormData::appendBlob):
2913         (WebCore::FormData::expandDataStore):
2914         * platform/network/FormData.h:
2915
2916 2017-08-14  Daniel Bates  <dabates@apple.com>
2917
2918         [css-ui] Implement caret-color support
2919         https://bugs.webkit.org/show_bug.cgi?id=166572
2920         <rdar://problem/33852589>
2921
2922         Reviewed by David Hyatt.
2923
2924         Add support for the CSS property caret-color as per <https://www.w3.org/TR/css-ui-3/#caret-color> (02 March 2017).
2925         The property caret-color specifies the color of the text insertion caret in an editable element,
2926         say an HTML textarea element.
2927
2928         Unlike other CSS color properties caret-color can have value "auto" and this is its initial
2929         value. Internally we treat value "auto" as an invalid caret color to simplify the code.
2930
2931         Tests: editing/pasteboard/preserve-caret-color.html
2932                fast/css/caret-color-auto.html
2933                fast/css/caret-color-fallback-to-color.html
2934                fast/css/caret-color-inherit.html
2935                fast/css/caret-color-span-inside-editable-parent.html
2936                fast/css/caret-color.html
2937                fast/history/visited-link-caret-color.html
2938
2939         * css/CSSComputedStyleDeclaration.cpp:
2940         (WebCore::ComputedStyleExtractor::propertyValue):
2941         * css/CSSProperties.json: Add property caret-color. We represent the initial  "auto" Also, fix up
2942         wording in a comment while I am here.
2943         * css/StyleResolver.cpp:
2944         (WebCore::isValidVisitedLinkProperty): Add caret-color to the list of properties that can be
2945         applied to visited hyperlinks.
2946         * css/parser/CSSParserFastPaths.cpp:
2947         (WebCore::parseCaretColor): Added.
2948         (WebCore::CSSParserFastPaths::maybeParseValue): Unlike other CSS color properties caret-color
2949         can be defined to be "auto". We explicitly check if the property is caret-color and use
2950         parseCaretColor() to parse its value.
2951         * css/parser/CSSPropertyParser.cpp:
2952         (WebCore::consumeCaretColor): Added.
2953         (WebCore::CSSPropertyParser::parseSingleValue): Similar to the change to CSSParserFastPaths::maybeParseValue()
2954         use a dedicated code path to parse caret-color.
2955         * editing/EditingStyle.cpp: Preserve caret-color during editing operations.
2956         * editing/FrameSelection.cpp:
2957         (WebCore::CaretBase::paintCaret const): Modified code to query property caret-color instead of
2958         color for the color of the text insertion caret. Always honor the caret-color of the editable
2959         element if it is valid color. Note that "caret-color: auto" is treated as an invalid color
2960         internally. A caret-color can have an invalid color if its inherits from the CSS color property
2961         with an invalid color. If caret-color is a valid color then we take it to be the color of the
2962         text insertion caret. Otherwise, we do what we do today and use a heuristic to determine the
2963         color of the text-insertion caret.
2964         (WebCore::disappearsIntoBackground): Deleted; moved logic into CaretBase::paintCaret().
2965         * page/animation/CSSPropertyAnimation.cpp:
2966         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add property wrapper
2967         to support animating caret-color.
2968         * rendering/style/RenderStyle.cpp:
2969         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const): Modified to consider
2970         changes to caret color.
2971         (WebCore::RenderStyle::colorIncludingFallback const): Modified to compute the appropriate
2972         color for property caret-color with respect to an unvisited or visited link.
2973         * rendering/style/RenderStyle.h:
2974         (WebCore::RenderStyle::setCaretColor): Added.
2975         (WebCore::RenderStyle::setVisitedLinkCaretColor): Added.
2976         (WebCore::RenderStyle::caretColor const): Added.
2977         (WebCore::RenderStyle::visitedLinkCaretColor const): Added.
2978         * rendering/style/StyleRareInheritedData.cpp:
2979         (WebCore::StyleRareInheritedData::StyleRareInheritedData): Modified to consider caret color.
2980         (WebCore::StyleRareInheritedData::operator== const): Ditto.
2981         * rendering/style/StyleRareInheritedData.h:
2982
2983 2017-08-14  Zan Dobersek  <zdobersek@igalia.com>
2984
2985         REGRESSION(r220517-r220521) [GTK] Various compositing tests fail
2986         https://bugs.webkit.org/show_bug.cgi?id=175478
2987
2988         Reviewed by Sergio Villar Senin.
2989
2990         Fix a regression introduced in r220519. Move a framebuffer binding in TextureMapperGL
2991         away from GraphicsContext3D and onto the OpenGL API to work around the framebuffer
2992         binding state that's kept in the GraphicsContext3D class. This mismatch in how the
2993         framebuffer was bound was causing a couple of test failures in compositing tests.
2994
2995         No new tests -- regressed tests have their failure expectations removed.
2996
2997         * platform/graphics/texmap/TextureMapperGL.cpp:
2998         (WebCore::TextureMapperGL::bindDefaultSurface): Don't use GraphicsContext3D for the
2999         glBindFramebuffer() call. This would be done in subsequent patches that would move
3000         TextureMapperGL off the GraphicsContext3D usage, but this specific use case clashes
3001         with the framebuffer binding that's done in BitmapTextureGL and was causing test
3002         failures.
3003
3004 2017-08-14  Chris Dumez  <cdumez@apple.com>
3005
3006         Unreviewed fix after r220622 to address crashes on iOS.
3007
3008         * loader/cache/CachedRawResource.cpp:
3009         (WebCore::CachedRawResource::finishLoading):
3010
3011 2017-08-14  Antti Koivisto  <antti@apple.com>
3012
3013         Factor text autosizing into a class
3014         https://bugs.webkit.org/show_bug.cgi?id=175530
3015
3016         Reviewed by Andreas Kling.
3017
3018         Move the remaining parts out of Document.
3019
3020         * css/StyleBuilderCustom.h:
3021         (WebCore::computeLineHeightMultiplierDueToFontSize):
3022         * dom/Document.cpp:
3023         (WebCore::Document::destroyRenderTree):
3024         (WebCore::Document::textAutoSizing):
3025         (WebCore::TextAutoSizingTraits::constructDeletedValue): Deleted.
3026         (WebCore::TextAutoSizingTraits::isDeletedValue): Deleted.
3027         (WebCore::Document::addAutoSizedNode): Deleted.
3028         (WebCore::Document::updateAutoSizedNodes): Deleted.
3029         (WebCore::Document::clearAutoSizedNodes): Deleted.
3030         * dom/Document.h:
3031         * rendering/RenderBlockFlow.cpp:
3032         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
3033         * rendering/RenderElement.cpp:
3034         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
3035         (WebCore::RenderElement::resetTextAutosizing):
3036         * rendering/TextAutoSizing.cpp:
3037         (WebCore::TextAutoSizingTraits::constructDeletedValue):
3038         (WebCore::TextAutoSizingTraits::isDeletedValue):
3039         (WebCore::TextAutoSizing::addTextNode):
3040         (WebCore::TextAutoSizing::updateRenderTree):
3041         (WebCore::TextAutoSizing::reset):
3042         * rendering/TextAutoSizing.h:
3043
3044 2017-08-14  Antti Koivisto  <antti@apple.com>
3045
3046         [Render Tree Mutation] First letter should not mutate the render tree while in layout.
3047         https://bugs.webkit.org/show_bug.cgi?id=163848
3048
3049         Reviewed by Zalan Bujtas.
3050
3051         RenderBlock::updateFirstLetter shouldn't be called during layout. Instead it should
3052         be invoked by the RenderTreeUpdater.
3053
3054         With this future patches can move updateFirstLetter() and the related functions
3055         completely out of the render tree.
3056
3057         * rendering/RenderBlock.cpp:
3058         (WebCore::RenderBlock::layout):
3059
3060             No more updateFirstLetter calls during layout...
3061
3062         (WebCore::RenderBlock::computePreferredLogicalWidths):
3063
3064             ...or preferred width computation.
3065
3066         (WebCore::RenderBlock::updateFirstLetter):
3067         * rendering/RenderBlock.h:
3068         * rendering/RenderRubyRun.cpp:
3069         (WebCore::RenderRubyRun::updateFirstLetter):
3070         * rendering/RenderRubyRun.h:
3071         * rendering/RenderTable.cpp:
3072         (WebCore::RenderTable::updateFirstLetter):
3073         * rendering/RenderTable.h:
3074         * rendering/svg/RenderSVGText.cpp:
3075         (WebCore::RenderSVGText::updateFirstLetter):
3076         * rendering/svg/RenderSVGText.h:
3077         * style/RenderTreeUpdater.cpp:
3078         (WebCore::RenderTreeUpdater::popParent):
3079
3080             Call updateFirstLetter when closing the element. All of of descedant renderers are known here
3081             so this can be resolved correctly.
3082
3083 2017-08-13  Manuel Rego Casasnovas  <rego@igalia.com>
3084
3085         Composition underline color is always black
3086         https://bugs.webkit.org/show_bug.cgi?id=174675
3087
3088         Reviewed by Ryosuke Niwa.
3089
3090         This patch uses the current color of the text instead of black
3091         for the composition underline marker.
3092         This makes it visible in the case we have a black/dark background.
3093
3094         Test: editing/composition-underline-color.html
3095
3096         * editing/CompositionUnderline.h:
3097         (WebCore::CompositionUnderline::CompositionUnderline):
3098         Added new attribute compositionUnderlineColor.
3099         * rendering/InlineTextBox.cpp:
3100         (WebCore::InlineTextBox::paintCompositionUnderline):
3101         Use the text color if compositionUnderlineColor is TextColor.
3102
3103 2017-08-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3104
3105         [GTK] stop kinetic scrolling when a zero movement is reached
3106         https://bugs.webkit.org/show_bug.cgi?id=175468
3107
3108         Reviewed by Michael Catanzaro.
3109
3110         This is GTK+ change by Christian Hergert.
3111         https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6
3112
3113         When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels,
3114         followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it
3115         feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement.
3116
3117         * platform/ScrollAnimationKinetic.cpp:
3118         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
3119
3120 2017-08-13  Chris Dumez  <cdumez@apple.com>
3121
3122         Drop non-const getter for CachedResource::resourceRequest()
3123         https://bugs.webkit.org/show_bug.cgi?id=175524
3124
3125         Reviewed by Youenn Fablet.
3126
3127         Drop non-const getter for CachedResource::resourceRequest(). It would be unsafe to modify the request of a CachedResource
3128         after it has been cached. Exposing such a getter is therefore a footgun.
3129
3130         * loader/LinkLoader.cpp:
3131         (WebCore::LinkLoader::preloadIfNeeded):
3132         * loader/cache/CachedImage.cpp:
3133         (WebCore::CachedImage::CachedImage):
3134         * loader/cache/CachedImage.h:
3135         * loader/cache/CachedResource.cpp:
3136         (WebCore::CachedResource::CachedResource):
3137         * loader/cache/CachedResource.h:
3138         (WebCore::CachedResource::resourceRequest const):
3139         (WebCore::CachedResource::ignoreForRequestCount const):
3140         (WebCore::CachedResource::setIgnoreForRequestCount):
3141         * loader/cache/CachedResourceLoader.cpp:
3142         (WebCore::CachedResourceLoader::requestResource):
3143         * loader/cache/CachedResourceRequest.h:
3144         (WebCore::CachedResourceRequest::ignoreForRequestCount const):
3145         (WebCore::CachedResourceRequest::setIgnoreForRequestCount):
3146         * loader/cache/MemoryCache.cpp:
3147         (WebCore::MemoryCache::addImageToCache):
3148         * platform/network/ResourceRequestBase.h:
3149
3150 2017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
3151
3152         [WPE] Implement WebCore::standardUserAgent()
3153         https://bugs.webkit.org/show_bug.cgi?id=175507
3154
3155         Reviewed by Carlos Alberto Lopez Perez.
3156
3157         Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
3158
3159         * PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp.
3160         * PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources.
3161         * platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp.
3162         (WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB".
3163
3164 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
3165
3166         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
3167         https://bugs.webkit.org/show_bug.cgi?id=175474
3168         <rdar://problem/33844628>
3169
3170         Reviewed by Wenson Hsieh.
3171
3172         Replaced the build flag by a runtime flag and added a stub implementation for DataTransferItemList
3173         and DataTransferItem to make it compile. DataTransferItemList is created lazily by DataTransfer.items,
3174         and its lifetime is tied to DataTransfer by forwarding ref and deref.
3175
3176         See https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface
3177
3178         Tests: editing/pasteboard/datatransfer-idl.html
3179
3180         * CMakeLists.txt:
3181         * Configurations/FeatureDefines.xcconfig:
3182         * WebCore.xcodeproj/project.pbxproj:
3183         * dom/DataTransfer.cpp:
3184         (WebCore::DataTransfer::items): Added. Create DataTransferItemList lazily
3185         * dom/DataTransfer.h:
3186         * dom/DataTransfer.idl:
3187         * dom/DataTransferItem.cpp:
3188         (WebCore::DataTransferItem::DataTransferItem): Added a stub implementation.
3189         (WebCore::DataTransferItem::~DataTransferItem): Ditto.
3190         (WebCore::DataTransferItem::getAsString const): Ditto.
3191         (WebCore::DataTransferItem::getAsFile const): Ditto.
3192         * dom/DataTransferItem.h:
3193         (WebCore::DataTransferItemList): Devirtualized functions.
3194         (WebCore::DataTransferItemList::kind const):
3195         (WebCore::DataTransferItemList::type const):
3196         * dom/DataTransferItem.idl:
3197         * dom/DataTransferItemList.cpp: Added.
3198         (WebCore::DataTransferItemList::length const): Added a stub implementation.
3199         (WebCore::DataTransferItemList::item): Ditto.
3200         (WebCore::DataTransferItemList::add): Ditto.
3201         (WebCore::DataTransferItemList::remove): Ditto.
3202         (WebCore::DataTransferItemList::clear): Ditto.
3203         * dom/DataTransferItemList.h:
3204         (WebCore::DataTransferItemList::DataTransferItemList):
3205         (WebCore::DataTransferItemList::~DataTransferItemList): Deleted.
3206         (WebCore::DataTransferItemList::ref): Forwards to DataTransfer's ref.
3207         (WebCore::DataTransferItemList::deref): Ditto.
3208         * dom/DataTransferItemList.idl: Updated to match the latest specification.
3209         * page/RuntimeEnabledFeatures.h:
3210         (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Added.
3211         (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Added.
3212
3213 2017-08-11  Brady Eidson  <beidson@apple.com>
3214
3215         Move files inside WebCore/workers to WebCore/workers/service.
3216         https://bugs.webkit.org/show_bug.cgi?id=175495
3217
3218         Rubberstamped by Tim Horton.
3219
3220         * CMakeLists.txt:
3221         * DerivedSources.make:
3222         * WebCore.xcodeproj/project.pbxproj:
3223
3224         * workers/service/ServiceWorker.cpp: Renamed from Source/WebCore/workers/ServiceWorker.cpp.
3225         * workers/service/ServiceWorker.h: Renamed from Source/WebCore/workers/ServiceWorker.h.
3226         * workers/service/ServiceWorker.idl: Renamed from Source/WebCore/workers/ServiceWorker.idl.
3227         * workers/service/ServiceWorkerContainer.cpp: Renamed from Source/WebCore/workers/ServiceWorkerContainer.cpp.
3228         * workers/service/ServiceWorkerContainer.h: Renamed from Source/WebCore/workers/ServiceWorkerContainer.h.
3229         * workers/service/ServiceWorkerContainer.idl: Renamed from Source/WebCore/workers/ServiceWorkerContainer.idl.
3230         * workers/service/ServiceWorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.cpp.
3231         * workers/service/ServiceWorkerGlobalScope.h: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.h.
3232         * workers/service/ServiceWorkerGlobalScope.idl: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.idl.
3233         * workers/service/ServiceWorkerJob.cpp: Renamed from Source/WebCore/workers/ServiceWorkerJob.cpp.
3234         * workers/service/ServiceWorkerJob.h: Renamed from Source/WebCore/workers/ServiceWorkerJob.h.
3235         * workers/service/ServiceWorkerJobClient.h: Renamed from Source/WebCore/workers/ServiceWorkerJobClient.h.
3236         * workers/service/ServiceWorkerProvider.cpp: Renamed from Source/WebCore/workers/ServiceWorkerProvider.cpp.
3237         * workers/service/ServiceWorkerProvider.h: Renamed from Source/WebCore/workers/ServiceWorkerProvider.h.
3238         * workers/service/ServiceWorkerRegistration.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.cpp.
3239         * workers/service/ServiceWorkerRegistration.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.h.
3240         * workers/service/ServiceWorkerRegistration.idl: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.idl.
3241         * workers/service/ServiceWorkerRegistrationOptions.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationOptions.h.
3242         * workers/service/ServiceWorkerRegistrationParameters.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.cpp.
3243         * workers/service/ServiceWorkerRegistrationParameters.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.h.
3244         * workers/service/ServiceWorkerUpdateViaCache.h: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.h.
3245         * workers/service/ServiceWorkerUpdateViaCache.idl: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.idl.
3246
3247 2017-08-11  Chris Dumez  <cdumez@apple.com>
3248
3249         Implement quota limitation for keepalive Fetch requests
3250         https://bugs.webkit.org/show_bug.cgi?id=175482
3251
3252         Reviewed by Sam Weinig and Youenn Fablet.
3253
3254         Implement quota limitation for keepalive Fetch requests as per:
3255         - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)
3256
3257         This partly works for Beacon as well, meaning that no Beacon with a body
3258         over 64Kb can be sent. However, we don't keep track about wether or not
3259         beacon loads are inflight or not.
3260
3261         Also update CachedResourceLoader::requestResource() so that the caller
3262         can get a ResourceError when it returns null. This is useful for both
3263         Fetch and Beacon to return better error messages.
3264
3265         Test: http/wpt/beacon/beacon-quota.html
3266
3267         * CMakeLists.txt:
3268         * Modules/beacon/NavigatorBeacon.cpp:
3269         (WebCore::NavigatorBeacon::sendBeacon):
3270         * Modules/fetch/FetchBodyOwner.cpp:
3271         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
3272         (WebCore::FetchBodyOwner::BlobLoader::didFail):
3273         * Modules/fetch/FetchBodyOwner.h:
3274         * Modules/fetch/FetchLoader.cpp:
3275         (WebCore::FetchLoader::start):
3276         (WebCore::FetchLoader::didFail):
3277         * Modules/fetch/FetchLoaderClient.h:
3278         * Modules/fetch/FetchResponse.cpp:
3279         (WebCore::FetchResponse::BodyLoader::didFail):
3280         * Modules/fetch/FetchResponse.h:
3281         * WebCore.xcodeproj/project.pbxproj:
3282         * loader/DocumentThreadableLoader.cpp:
3283         (WebCore::DocumentThreadableLoader::loadRequest):
3284         * loader/cache/CachedResource.cpp:
3285         (WebCore::CachedResource::load):
3286         * loader/cache/CachedResource.h:
3287         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
3288         * loader/cache/CachedResourceLoader.cpp:
3289         (WebCore::createResource):
3290         (WebCore::CachedResourceLoader::requestImage):
3291         (WebCore::CachedResourceLoader::requestFont):
3292         (WebCore::CachedResourceLoader::requestTextTrack):
3293         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
3294         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3295         (WebCore::CachedResourceLoader::requestScript):
3296         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
3297         (WebCore::CachedResourceLoader::requestSVGDocument):
3298         (WebCore::CachedResourceLoader::requestLinkResource):
3299         (WebCore::CachedResourceLoader::requestMedia):
3300         (WebCore::CachedResourceLoader::requestIcon):
3301         (WebCore::CachedResourceLoader::requestRawResource):
3302         (WebCore::CachedResourceLoader::requestBeaconResource):
3303         (WebCore::CachedResourceLoader::requestMainResource):
3304         (WebCore::CachedResourceLoader::requestResource):
3305         (WebCore::CachedResourceLoader::preload):
3306         * loader/cache/CachedResourceLoader.h:
3307         * loader/cache/KeepaliveRequestTracker.cpp: Added.
3308         (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
3309         (WebCore::KeepaliveRequestTracker::canLoadRequest):
3310         (WebCore::KeepaliveRequestTracker::registerRequest):
3311         (WebCore::KeepaliveRequestTracker::responseReceived):
3312         (WebCore::KeepaliveRequestTracker::notifyFinished):
3313         (WebCore::KeepaliveRequestTracker::unregisterRequest):
3314         * loader/cache/KeepaliveRequestTracker.h: Added.
3315         * platform/network/FormData.cpp:
3316         (WebCore::FormDataElement::lengthInBytes const):
3317         (WebCore::FormData::lengthInBytes const):
3318         * platform/network/FormData.h:
3319
3320 2017-08-11  Don Olmstead  <don.olmstead@sony.com>
3321
3322         [WTF] Move ValueToString into WTF
3323         https://bugs.webkit.org/show_bug.cgi?id=175469
3324
3325         Reviewed by Sam Weinig.
3326
3327         No new tests. No change in behavior.
3328
3329         * WebCore.xcodeproj/project.pbxproj:
3330         * html/HTMLMediaElement.h:
3331         (WTF::ValueToString<WebCore::TextTrackCue::string):
3332         (WebCore::ValueToString<TextTrackCue::string): Deleted.
3333         (WebCore::ValueToString<MediaTime>::string): Deleted.
3334         * platform/LayoutUnit.h:
3335         (WTF::ValueToString<WebCore::LayoutUnit>::string):
3336         (WebCore::ValueToString<LayoutUnit>::string): Deleted.
3337         * platform/PODInterval.h:
3338         * platform/PODIntervalTree.h:
3339         * platform/PODRedBlackTree.h:
3340         * platform/graphics/FloatPolygon.h:
3341         (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
3342         (WebCore::ValueToString<FloatPolygonEdge::string): Deleted.
3343         * rendering/FloatingObjects.h:
3344         (WTF::ValueToString<WebCore::FloatingObject::string):
3345         (WebCore::ValueToString<FloatingObject::string): Deleted.
3346         * rendering/RenderFlowThread.h:
3347         (WTF::ValueToString<WebCore::RenderRegion::string):
3348         (WebCore::ValueToString<RenderRegion::string): Deleted.
3349
3350 2017-08-11  Sam Weinig  <sam@webkit.org>
3351
3352         [Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references
3353         https://bugs.webkit.org/show_bug.cgi?id=175394
3354
3355         Reviewed by Chris Dumez.
3356
3357         * bindings/IDLTypes.h:
3358         (WebCore::IDLWrapper::convertToParameterType): Deleted.
3359
3360             Remove no longer used convertToParameterType.
3361
3362         * bindings/js/DOMPromiseProxy.h:
3363
3364             - Replace Variant<Value, Exception> with ExceptionOr<Value> / ExceptionOr<void>.
3365             - Update ResolveCallback to have a return type of IDLType::ParameterType, rather than
3366               IDLType::ImplementationType, now that WTF::Function supports references as the 
3367               return type. This is needed, since the IDLType::ParameterType for an interface T
3368               is T&.
3369
3370         * css/FontFace.cpp:
3371         * css/FontFace.h:
3372         * css/FontFaceSet.cpp:
3373         * css/FontFaceSet.h:
3374
3375             Update resolve callbacks to return a reference rather than a RefPtr, matching
3376             the new signature requirement.
3377
3378 2017-08-11  Sam Weinig  <sam@webkit.org>
3379
3380         [WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
3381         https://bugs.webkit.org/show_bug.cgi?id=175457
3382
3383         Reviewed by Chris Dumez.
3384
3385         * CMakeLists.txt:
3386         * DerivedSources.make:
3387         * WebCore.xcodeproj/project.pbxproj:
3388         * bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed.
3389         * bindings/js/JSCryptoAlgorithmBuilder.h: Removed.
3390         * bindings/js/JSCryptoKeyCustom.cpp: Removed.
3391
3392             Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm
3393             IDLs and headers.
3394
3395         * crypto/CryptoKey.cpp:
3396         * crypto/CryptoKey.h:
3397         * crypto/CryptoKey.idl:
3398         
3399             Replace custom algorithm attribute with a union of the supported key algorithms.
3400         
3401         * crypto/keys/CryptoAesKeyAlgorithm.h: Added.
3402         * crypto/keys/CryptoAesKeyAlgorithm.idl: Added.
3403         * crypto/keys/CryptoEcKeyAlgorithm.h: Added.
3404         * crypto/keys/CryptoEcKeyAlgorithm.idl: Added.
3405         * crypto/keys/CryptoHmacKeyAlgorithm.h: Added.
3406         * crypto/keys/CryptoHmacKeyAlgorithm.idl: Added.
3407         * crypto/keys/CryptoKeyAlgorithm.h: Added.
3408         * crypto/keys/CryptoKeyAlgorithm.idl: Added.
3409         * crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added.
3410         * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added.
3411         * crypto/keys/CryptoRsaKeyAlgorithm.h: Added.