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