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