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