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