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