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