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