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