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