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