Share some code to dirty z-order and normal flow lists when child layers are added...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
2
3         Share some code to dirty z-order and normal flow lists when child layers are added or removed
4         https://bugs.webkit.org/show_bug.cgi?id=190585
5
6         Reviewed by Zalan Bujtas.
7
8         Factor code which dirties the normal flow list and child stacking context z-order lists
9         when a layer is added or removed.
10
11         * rendering/RenderLayer.cpp:
12         (WebCore::RenderLayer::addChild):
13         (WebCore::RenderLayer::removeChild):
14         (WebCore::RenderLayer::dirtyPaintOrderListsOnChildChange):
15         * rendering/RenderLayer.h:
16
17 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
18
19         Make a helper function to check for reflection layers
20         https://bugs.webkit.org/show_bug.cgi?id=190584
21
22         Reviewed by Zalan Bujtas.
23
24         Add RenderLayer::isReflectionLayer() which returns true if the passed layer
25         is the layer of this layer's reflection. It's used in z-order list building.
26
27         * rendering/RenderLayer.cpp:
28         (WebCore::RenderLayer::updateNormalFlowList):
29         (WebCore::RenderLayer::rebuildZOrderLists):
30         (WebCore::RenderLayer::collectLayers):
31         (WebCore::expandClipRectForDescendantsAndReflection):
32         (WebCore::RenderLayer::calculateClipRects const):
33         * rendering/RenderLayer.h:
34
35 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
36
37         RenderLayer::addChild() and removeChild() should take references
38         https://bugs.webkit.org/show_bug.cgi?id=190582
39
40         Reviewed by Zalan Bujtas.
41
42         Pass the layer to be added or removed as a reference; it's never null.
43
44         * rendering/RenderElement.cpp:
45         (WebCore::addLayers):
46         (WebCore::RenderElement::removeLayers):
47         (WebCore::RenderElement::moveLayers):
48         * rendering/RenderLayer.cpp:
49         (WebCore::RenderLayer::addChild):
50         (WebCore::RenderLayer::removeChild):
51         (WebCore::RenderLayer::insertOnlyThisLayer):
52         (WebCore::RenderLayer::removeOnlyThisLayer):
53         * rendering/RenderLayer.h:
54
55 2018-10-15  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
56
57         [Cairo] Incorrect rendering for 135-deg skews
58         https://bugs.webkit.org/show_bug.cgi?id=190513
59
60         Compensation value to zero the the translation components
61         of the transformation matrix is incorrect if the matrix
62         has a shear factor.
63
64         Reviewed by Žan Doberšek.
65
66         Tests: fast/transforms/skew-x-135deg-with-gradient.html
67                fast/transforms/skew-y-135deg-with-gradient.html
68
69         * platform/graphics/cairo/CairoUtilities.cpp:
70         (WebCore::drawPatternToCairoContext):
71
72 2018-10-15  Christopher Reid  <chris.reid@sony.com>
73
74         [Curl][WinCairo] Add Public Suffix support to WinCairo
75         https://bugs.webkit.org/show_bug.cgi?id=183060
76
77         Reviewed by Alex Christensen.
78
79         Add Public Suffix support to WinCairo using LibPSL.
80         LibPSL has been added to WinCairoRequirements in v2018.10.09.
81
82         * platform/Curl.cmake:
83         * platform/network/curl/CookieJarDB.cpp:
84         (WebCore::CookieJarDB::searchCookies): Search for cookies using the topPrivatelyControlledDomain
85         (WebCore::CookieJarDB::setCookie): Prevent cookies from being added under TLDs
86         * platform/network/curl/PublicSuffixCurl.cpp: Added.
87         (WebCore::isPublicSuffix):
88         (WebCore::topPrivatelyControlledDomainInternal):
89         (WebCore::topPrivatelyControlledDomain):
90
91 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
92
93         RenderLayer tree-related cleanup
94         https://bugs.webkit.org/show_bug.cgi?id=190572
95
96         Reviewed by Zalan Bujtas.
97
98         Move code around so that functions related to parent/child and z-order tree structure
99         are near the top of RenderLayer.cpp, since this is one of the primary functions of layers.
100         
101         Attempts to use inheritance or composition to separate out tree structure resulted in
102         unwieldy code and/or performance regressions.
103         
104         The only behavior change is to store a bit for m_isStackingContext so that we don't have
105         to consult the old style to know if it changed.
106
107         * rendering/RenderLayer.cpp:
108         (WebCore::RenderLayer::RenderLayer):
109         (WebCore::RenderLayer::addChild):
110         (WebCore::RenderLayer::removeChild):
111         (WebCore::RenderLayer::insertOnlyThisLayer):
112         (WebCore::RenderLayer::removeOnlyThisLayer):
113         (WebCore::canCreateStackingContext):
114         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
115         (WebCore::RenderLayer::shouldBeStackingContext const):
116         (WebCore::RenderLayer::setIsNormalFlowOnly):
117         (WebCore::RenderLayer::setIsStackingContext):
118         (WebCore::RenderLayer::setParent):
119         (WebCore::RenderLayer::dirtyZOrderLists):
120         (WebCore::RenderLayer::dirtyStackingContextZOrderLists):
121         (WebCore::RenderLayer::dirtyNormalFlowList):
122         (WebCore::RenderLayer::updateNormalFlowList):
123         (WebCore::RenderLayer::rebuildZOrderLists):
124         (WebCore::RenderLayer::collectLayers):
125         (WebCore::RenderLayer::updateLayerListsIfNeeded):
126         (WebCore::RenderLayer::beginTransparencyLayers):
127         (WebCore::RenderLayer::willBeDestroyed):
128         (WebCore::RenderLayer::isDescendantOf const):
129         (WebCore::RenderLayer::calculateClipRects const):
130         (WebCore::compareZIndex): Deleted.
131         * rendering/RenderLayer.h:
132
133 2018-10-15  Antti Koivisto  <antti@apple.com>
134
135         [PSON] Prewarm system fallback fonts
136         https://bugs.webkit.org/show_bug.cgi?id=190517
137
138         Reviewed by Ryosuke Niwa.
139
140         This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages
141         after process swaps.
142
143         * page/PrewarmInformation.h:
144         (WebCore::PrewarmInformation::encode const):
145         (WebCore::PrewarmInformation::decode):
146         * page/ProcessWarming.cpp:
147         (WebCore::ProcessWarming::collectPrewarmInformation):
148         (WebCore::ProcessWarming::prewarmWithInformation):
149         * platform/graphics/FontCache.cpp:
150         (WebCore::FontCache::collectPrewarmInformation const):
151         (WebCore::FontCache::prewarm):
152         * platform/graphics/FontCache.h:
153         (WebCore::FontCache::PrewarmInformation::isolatedCopy const):
154         (WebCore::FontCache::PrewarmInformation::encode const):
155         (WebCore::FontCache::PrewarmInformation::decode):
156
157         Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope.
158
159         * platform/graphics/cocoa/FontCacheCoreText.cpp:
160         (WebCore::FontDatabase::collectionForFamily):
161         (WebCore::FontCache::systemFallbackForCharacters):
162
163         Collect the names of fonts that end up needing character specific system fallbacks.
164
165         (WebCore::FontCache::collectPrewarmInformation const):
166
167         Include them into prewarm information.
168
169         (WebCore::FontCache::prewarm):
170
171         Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully
172         prewarm it for fallbacks (independent of size, locale or other characteristics).
173         Any future calls to systemFallbackForCharacters are fast.
174
175 2018-10-15  Chris Dumez  <cdumez@apple.com>
176
177         Restrict browsing context lookup by name to frames that are related to one another
178         https://bugs.webkit.org/show_bug.cgi?id=190475
179
180         Reviewed by Alex Christensen.
181
182         Update our frame lookup by name logic to take in the active / requesting frame and
183         only a return a frame that is related to it. By related to it, I mean:
184         - Ancestor <-> Descendant relationship
185         - Opener <-> Openee relationship
186
187         Being able to look up unrelated frames makes process swapping difficult so we need
188         to be stricter.
189
190         This change is being discussed at:
191         - https://github.com/whatwg/html/issues/313
192
193         Tests: http/tests/dom/new-window-can-target-opener.html
194                http/tests/dom/noopener-window-cannot-target-opener.html
195                http/tests/dom/noopener-window-not-targetable.html
196                http/tests/dom/noopener-window-not-targetable2.html
197                http/tests/dom/noreferrer-window-not-targetable.html
198                http/tests/dom/opened-window-not-targetable-after-disowning-opener.html
199
200         * loader/FrameLoader.cpp:
201         (WebCore::FrameLoader::findFrameForNavigation):
202         * page/FrameTree.cpp:
203         (WebCore::isFrameFamiliarWith):
204         (WebCore::FrameTree::find const):
205         * page/FrameTree.h:
206         * rendering/HitTestResult.cpp:
207         (WebCore::HitTestResult::targetFrame const):
208
209 2018-10-15  Alex Christensen  <achristensen@webkit.org>
210
211         Shrink more enum classes
212         https://bugs.webkit.org/show_bug.cgi?id=190540
213
214         Reviewed by Chris Dumez.
215
216         * Modules/notifications/NotificationDirection.h:
217         * dom/Document.h:
218         * loader/FrameLoader.h:
219         * loader/FrameLoaderClient.h:
220         * loader/HistoryController.h:
221         * loader/ShouldSkipSafeBrowsingCheck.h:
222         * loader/ShouldTreatAsContinuingLoad.h:
223         * page/AutoplayEvent.h:
224         * page/ChromeClient.h:
225         * page/DiagnosticLoggingClient.h:
226         * page/Page.h:
227         * platform/CookiesStrategy.h:
228         * platform/audio/AudioSession.h:
229         * platform/network/NetworkStorageSession.h:
230         * platform/network/StoredCredentialsPolicy.h:
231         * workers/service/SWClientConnection.h:
232         * workers/service/ServiceWorkerContainer.h:
233         * workers/service/ServiceWorkerRegistrationData.h:
234         * workers/service/ServiceWorkerRegistrationOptions.h:
235         * workers/service/ServiceWorkerTypes.h:
236         * workers/service/ServiceWorkerUpdateViaCache.h:
237         * workers/service/server/SWServer.h:
238         * workers/service/server/SWServerRegistration.h:
239
240 2018-10-15  Patrick Griffis  <pgriffis@igalia.com>
241
242         [GTK][WPE] Implement subprocess sandboxing
243         https://bugs.webkit.org/show_bug.cgi?id=188568
244
245         Reviewed by Michael Catanzaro.
246
247         Link against libseccomp.
248
249         * PlatformGTK.cmake:
250
251 2018-10-15  YUHAN WU  <yuhan_wu@apple.com>
252
253         Implement error handler of MediaRecorder
254         https://bugs.webkit.org/show_bug.cgi?id=190438
255
256         Reviewed by Youenn Fablet.
257
258         Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-error.html
259
260         Implement error event handler (onerror) for MediaRecorder and basic architecture of start() function.
261
262         * CMakeLists.txt:
263         * DerivedSources.make:
264         * Modules/mediarecorder/MediaRecorder.cpp:
265         (WebCore::MediaRecorder::MediaRecorder):
266         (WebCore::MediaRecorder::~MediaRecorder):
267         (WebCore::MediaRecorder::stop):
268         (WebCore::MediaRecorder::start):
269         (WebCore::MediaRecorder::setNewRecordingState):
270         (WebCore::MediaRecorder::scheduleDeferredTask):
271         (WebCore::MediaRecorder::didAddOrRemoveTrack):
272         * Modules/mediarecorder/MediaRecorder.h:
273         * Modules/mediarecorder/MediaRecorder.idl:
274         * Modules/mediarecorder/MediaRecorderErrorEvent.cpp: Added.
275         (WebCore::MediaRecorderErrorEvent::create):
276         (WebCore::MediaRecorderErrorEvent::MediaRecorderErrorEvent):
277         (WebCore::MediaRecorderErrorEvent::eventInterface const):
278         * Modules/mediarecorder/MediaRecorderErrorEvent.h: Added.
279         * Modules/mediarecorder/MediaRecorderErrorEvent.idl: Added.
280         * Sources.txt:
281         * WebCore.xcodeproj/project.pbxproj:
282         * bindings/js/WebCoreBuiltinNames.h:
283         * dom/EventNames.in:
284         * dom/EventTargetFactory.in:
285
286 2018-10-15  Chris Dumez  <cdumez@apple.com>
287
288         Window's properties such as 'location' should not become null when it loses its browsing context
289         https://bugs.webkit.org/show_bug.cgi?id=190539
290
291         Reviewed by Alex Christensen.
292
293         Window's properties such as 'location' should not become null when it loses its browsing context.
294         This Webkit behavior is not standard and does not match other browsers so this patch makes it so
295         that those properties persist.
296
297         Tests: http/tests/dom/cross-origin-detached-window-properties.html
298                http/tests/dom/same-origin-detached-window-properties.html
299
300         * bindings/js/JSDOMBindingSecurity.cpp:
301         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
302         * bindings/js/JSDOMBindingSecurity.h:
303         * bindings/js/JSDOMWindowProperties.cpp:
304         (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
305         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
306         * bindings/js/JSLocationCustom.cpp:
307         (WebCore::getOwnPropertySlotCommon):
308         (WebCore::putCommon):
309         (WebCore::JSLocation::deleteProperty):
310         (WebCore::JSLocation::deletePropertyByIndex):
311         (WebCore::JSLocation::getOwnPropertyNames):
312         (WebCore::JSLocation::defineOwnProperty):
313         (WebCore::JSLocation::getPrototype):
314         (WebCore::JSLocation::toStringName):
315         * bindings/scripts/CodeGeneratorJS.pm:
316         (GenerateAttributeGetterBodyDefinition):
317         (GenerateAttributeSetterBodyDefinition):
318         (GenerateOperationBodyDefinition):
319         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
320         (WebCore::jsTestActiveDOMObjectExcitingAttrGetter):
321         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody):
322         * crypto/SubtleCrypto.cpp:
323         (WebCore::SubtleCrypto::SubtleCrypto):
324         * crypto/SubtleCrypto.h:
325         (WebCore::SubtleCrypto::create):
326         * dom/Document.cpp:
327         (WebCore::Document::~Document):
328         * page/Crypto.cpp:
329         (WebCore::Crypto::Crypto):
330         * page/Crypto.h:
331         (WebCore::Crypto::create):
332         * page/DOMWindow.cpp:
333         (WebCore::DOMWindow::~DOMWindow):
334         (WebCore::DOMWindow::frameDestroyed):
335         (WebCore::DOMWindow::screen):
336         (WebCore::DOMWindow::history):
337         (WebCore::DOMWindow::crypto):
338         (WebCore::DOMWindow::locationbar):
339         (WebCore::DOMWindow::menubar):
340         (WebCore::DOMWindow::personalbar):
341         (WebCore::DOMWindow::scrollbars):
342         (WebCore::DOMWindow::statusbar):
343         (WebCore::DOMWindow::toolbar):
344         (WebCore::DOMWindow::console const):
345         (WebCore::DOMWindow::applicationCache):
346         (WebCore::DOMWindow::navigator):
347         (WebCore::DOMWindow::performance const):
348         (WebCore::DOMWindow::location):
349         (WebCore::DOMWindow::visualViewport):
350         (WebCore::DOMWindow::styleMedia):
351         * page/DOMWindow.h:
352         * page/DOMWindow.idl:
353         * workers/WorkerGlobalScope.cpp:
354         (WebCore::WorkerGlobalScope::crypto):
355
356 2018-10-15  Alex Christensen  <achristensen@webkit.org>
357
358         Include EnumTraits.h less
359         https://bugs.webkit.org/show_bug.cgi?id=190535
360
361         Reviewed by Chris Dumez.
362
363         * Modules/applepay/ApplePaySessionPaymentRequest.h:
364         * Modules/applepay/PaymentAuthorizationStatus.h:
365         * Modules/applicationmanifest/ApplicationManifest.h:
366         * Modules/fetch/FetchHeaders.h:
367         * Modules/webauthn/AuthenticatorTransport.h:
368         * Modules/webauthn/PublicKeyCredentialType.h:
369         * loader/ShouldSkipSafeBrowsingCheck.h:
370         * loader/ShouldTreatAsContinuingLoad.h:
371         * platform/Cookie.h:
372         * platform/audio/AudioSession.h:
373         * platform/mediastream/CaptureDevice.h:
374         * platform/mediastream/MediaStreamRequest.h:
375         * platform/mediastream/RealtimeMediaSourceSettings.h:
376         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
377         * platform/network/NetworkLoadInformation.h:
378         * workers/service/ServiceWorkerClientType.h:
379         * workers/service/ServiceWorkerTypes.h:
380         * workers/service/ServiceWorkerUpdateViaCache.h:
381
382 2018-10-15  Alex Christensen  <achristensen@webkit.org>
383
384         Remove InjectedBundle processing of back/forward lists
385         https://bugs.webkit.org/show_bug.cgi?id=190459
386
387         Reviewed by Chris Dumez.
388
389         The uses of these functions are dead code I removed in rdar://problem/45180545
390         Removing these functions is a step towards fixing the PSON history bugs.
391
392         * loader/EmptyFrameLoaderClient.h:
393         * loader/FrameLoaderClient.h:
394         * loader/HistoryController.cpp:
395         (WebCore::HistoryController::goToItem):
396
397 2018-10-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
398
399         [JSC] Remove Option::useAsyncIterator
400         https://bugs.webkit.org/show_bug.cgi?id=190567
401
402         Reviewed by Saam Barati.
403
404         * Configurations/FeatureDefines.xcconfig:
405
406 2018-10-15  Philippe Normand  <pnormand@igalia.com>
407
408         [GStreamer] Fix EME build for GStreamer 1.14.x
409         https://bugs.webkit.org/show_bug.cgi?id=190471
410
411         Reviewed by Xabier Rodriguez-Calvar.
412
413         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
414         (webkitMediaCommonEncryptionDecryptTransformCaps): The
415         GST_PROTECTION_UNSPECIFIED_SYSTEM_ID #define won't be shipped
416         until the GStreamer 1.16.0 release, so its use needs to be wrapped
417         between a version check.
418         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
419         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Ditto.
420
421 2018-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
422
423         [iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view
424         https://bugs.webkit.org/show_bug.cgi?id=190504
425         <rdar://problem/45117760>
426
427         Reviewed by Tim Horton.
428
429         Add support in ViewportConfiguration for applying a layout size scale factor to the viewport. See below for
430         more details.
431
432         Tests: fast/viewport/ios/constant-width-viewport-after-changing-view-scale.html
433                fast/viewport/ios/device-width-viewport-after-changing-view-scale.html
434
435         * page/ViewportConfiguration.cpp:
436         (WebCore::ViewportConfiguration::setViewLayoutSize):
437
438         The viewport's layout size may now be changed alongside the layout size scale factor. If either of these two
439         variables change, we recompute our minimum layout size and viewport configuration parameters.
440
441         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
442         (WebCore::ViewportConfiguration::nativeWebpageParameters):
443         (WebCore::ViewportConfiguration::testingParameters):
444         (WebCore::ViewportConfiguration::updateConfiguration):
445
446         Multiply the minimum scale, initial scale, and maximum scale by the layout size scale factor. This allows us to
447         keep the document well-proportioned within the viewport, while still laying out at a different layout size.
448
449         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
450
451         Compute the minimum layout size by scaling the default layout size derived from our view's size.
452
453         (WebCore::ViewportConfiguration::layoutWidth const):
454         (WebCore::ViewportConfiguration::layoutHeight const):
455         * page/ViewportConfiguration.h:
456
457         Maintain the original initial scale, unaffected by the layout size scale factor. This is used when computing
458         layout width and height to prevent scaling by the layout size scale factor twice when computing layout sizes.
459
460         (WebCore::ViewportConfiguration::description const):
461
462         Include the layout size scale factor in ViewportConfiguration's description string.
463
464         (WebCore::ViewportConfiguration::Parameters::operator== const):
465         (WebCore::operator<<):
466
467 2018-10-12  Youenn Fablet  <youenn@apple.com>
468
469         Use downcast for use of RealtimeMediaSource in LibWebRTCMediaEndpoint
470         https://bugs.webkit.org/show_bug.cgi?id=190533
471
472         Reviewed by Chris Dumez.
473
474         Clean-up work.
475         No change of behavior.
476
477         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
478         (WebCore::setExistingReceiverSourceTrack):
479         * platform/mediastream/RealtimeIncomingAudioSource.h:
480         (isType):
481         * platform/mediastream/RealtimeIncomingVideoSource.h:
482         (isType):
483         * platform/mediastream/RealtimeMediaSource.h:
484
485 2018-10-12  Jer Noble  <jer.noble@apple.com>
486
487         WebAVSampleBufferErrorListener's parent should be a WeakPtr.
488         https://bugs.webkit.org/show_bug.cgi?id=190524
489         <rdar://problem/44359307>
490
491         Reviewed by Eric Carlson.
492
493         Once WebAVSampleBufferErrorListener's parent is a WeakPtr, we no longer need to pass
494         protectedSelf into the callOnMainThread lambdas; we can pass in the parent itself.
495
496         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
497         (-[WebAVSampleBufferErrorListener initWithParent:]):
498         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
499         (-[WebAVSampleBufferErrorListener layerFailedToDecode:]):
500         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
501         (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers):
502
503 2018-10-12  Ryosuke Niwa  <rniwa@webkit.org>
504
505         Address the review comment which was meant to be addressed in r237025.
506
507         * editing/MarkupAccumulator.cpp:
508         (WebCore::elementCannotHaveEndTag):
509
510 2018-10-12  Youenn Fablet  <youenn@apple.com> and Alejandro G. Castro  <alex@igalia.com>
511
512         Refresh libwebrtc up to 343f4144be
513         https://bugs.webkit.org/show_bug.cgi?id=190361
514
515         Reviewed by Chris Dumez.
516
517         This refresh should not change behavior but will allow us to implement better
518         mdns candidate support and simulcast activation surfacing through addTransceiver.
519         Covered by existing tests.
520
521         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
522         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
523         * testing/MockLibWebRTCPeerConnection.cpp:
524         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
525         * testing/MockLibWebRTCPeerConnection.h:
526         (WebCore::MockRtpSender::GetParameters): Deleted.
527         (WebCore::MockRtpSender::SetParameters): Deleted.
528         (WebCore::MockRtpSender::GetDtmfSender const): Deleted.
529
530 2018-10-12  Alex Christensen  <achristensen@webkit.org>
531
532         Allow encoding of small enum classes
533         https://bugs.webkit.org/show_bug.cgi?id=190531
534
535         Reviewed by Tim Horton.
536
537         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
538         * dom/Document.h:
539         * editing/FontAttributeChanges.h:
540         * history/CachedFrame.h:
541         * loader/FrameLoaderTypes.h:
542         * platform/CookiesStrategy.h:
543         * platform/PasteboardItemInfo.h:
544         * platform/ReferrerPolicy.h:
545
546 2018-10-12  Rob Buis  <rbuis@igalia.com>
547
548         Solve the confusion around blankURL() and isBlankURL() in URL
549         https://bugs.webkit.org/show_bug.cgi?id=158988
550
551         Reviewed by Alex Christensen.
552
553         The name isBlankURL is not accurate as the function tests the
554         protocol, not the full URL. Choose protocolIsAbout to align with
555         exisiting protocolIsData, protocolIsBlob etc.
556
557         No tests as no change in functionality.
558
559         * WebCore.order:
560         * loader/DocumentLoader.cpp:
561         (WebCore::DocumentLoader::loadApplicationManifest):
562         (WebCore::DocumentLoader::startIconLoading):
563         * loader/NavigationAction.cpp:
564         (WebCore::shouldTreatAsSameOriginNavigation):
565         * loader/PolicyChecker.cpp:
566         (WebCore::PolicyChecker::checkNavigationPolicy):
567         * loader/ResourceLoadObserver.cpp:
568         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
569         * page/PageSerializer.cpp:
570         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendCustomAttributes):
571         (WebCore::PageSerializer::serializeFrame):
572         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
573         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame const):
574         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource const):
575         * platform/URL.cpp:
576         (WebCore::URL::protocolIsAbout const):
577         (WebCore::URL::isBlankURL const): Deleted.
578         * platform/URL.h:
579         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
580         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
581
582 2018-10-12  Youenn Fablet  <youenn@apple.com>
583
584         DOMCache should dereference itself as soon as stopped
585         https://bugs.webkit.org/show_bug.cgi?id=190441
586
587         Reviewed by Chris Dumez.
588
589         Dereference the DOMCache as soon as its context is stopped instead of waiting for garbage collection.
590         This allows freeing resources sooner in the network process.
591         No observable change of behavior since the DOMCache becomes no-op when its context is stopped.
592
593         * Modules/cache/DOMCache.cpp:
594         (WebCore::DOMCache::~DOMCache):
595         (WebCore::DOMCache::stop):
596
597 2018-10-12  Jer Noble  <jer.noble@apple.com>
598
599         CRASH in WebCore::MediaPlayerPrivateAVFoundation::setPreload
600         https://bugs.webkit.org/show_bug.cgi?id=190485
601         <rdar://problem/34613350>
602
603         Reviewed by Eric Carlson.
604
605         Crash analytics show that a pure-virtual function is called by MediaPlayerPrivateAVFoundation::setPreload(), and
606         the likely cause of that pure-virtual function call is that the MediaPlayerPrivateAVFoundation object itself has
607         been destroyed, likely as a side effect of calling MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL().
608         The usual suspect for this kind of crash is due to calling into JS (e.g., from a callback passed up to
609         HTMLMediaElement). Code inspection hasn't yielded any good hints about why this might be occurring, so we will
610         add a ScriptDisallowedScope assertion inside HTMLMediaElement::prepareToPlay(), to generate a good crashlog
611         showing exactly what callback is resulting in a JS call. But just in case the deallocation is not due to JS,
612         also add an explicit strong-ref inside MediaPlayer::prepareToPlay.
613
614         * html/HTMLMediaElement.cpp:
615         (WebCore::HTMLMediaElement::prepareToPlay):
616         * platform/graphics/MediaPlayer.cpp:
617         (WebCore::MediaPlayer::prepareToPlay):
618
619 2018-10-12  Jer Noble  <jer.noble@apple.com>
620
621         Null-dereference in SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged
622         https://bugs.webkit.org/show_bug.cgi?id=190490
623         <rdar://problem/42213807>
624
625         Reviewed by Eric Carlson.
626
627         Crash analytics show a null dereference occurring, likely because m_mediaSource is null.
628
629         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
630         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
631
632 2018-10-11  Don Olmstead  <don.olmstead@sony.com>
633
634         Add Houdini specs to features.json
635         https://bugs.webkit.org/show_bug.cgi?id=190494
636         <rdar://problem/45211879>
637
638         Unreviewed fix.
639
640         Specifications should not reference other specifications. Also
641         move Worklet into the specifications section.
642
643         * features.json:
644
645 2018-10-11  Youenn Fablet  <youenn@apple.com>
646
647         IOS 12 - Service worker cache not shared when added to homescreen
648         https://bugs.webkit.org/show_bug.cgi?id=190269
649         <rdar://problem/45009961>
650
651         Reviewed by Alex Christensen.
652
653         Expose Cache Storage API when Service Worker API is exposed.
654         This is used for API tests.
655
656         * dom/ScriptExecutionContext.h: Make hasServiceWorkerScheme
657         available outside SERVICE_WORKER compilation flag since used by DOMWindowCaches.
658         * dom/ScriptExecutionContext.cpp: Ditto.
659         * Modules/cache/DOMWindowCaches.idl:
660
661 2018-10-10  Simon Fraser  <simon.fraser@apple.com>
662
663         Hide RenderLayer z-order and normal flow lists behind iterators
664         https://bugs.webkit.org/show_bug.cgi?id=190457
665
666         Reviewed by Zalan Bujtas.
667
668         Expose the positive z-order, negative z-order and normal flow lists
669         from RenderLayer as iterators rather than vectors of raw pointers.
670         
671         This hides the fact that the vectors can be null, and allows for easier casting in future.
672
673         * rendering/RenderLayer.cpp:
674         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
675         (WebCore::RenderLayer::paintLayerContents):
676         (WebCore::RenderLayer::paintList):
677         (WebCore::RenderLayer::hitTestLayer):
678         (WebCore::RenderLayer::hitTestList):
679         (WebCore::RenderLayer::calculateClipRects const):
680         * rendering/RenderLayer.h:
681         * rendering/RenderLayerBacking.cpp:
682         (WebCore::traverseVisibleNonCompositedDescendantLayers):
683         * rendering/RenderLayerCompositor.cpp:
684         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
685         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
686         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
687         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
688         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
689         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
690         (WebCore::RenderLayerCompositor::needsContentsCompositingLayer const):
691         (WebCore::RenderLayerCompositor::layerHas3DContent const):
692         * rendering/RenderTreeAsText.cpp:
693         (WebCore::writeLayers):
694
695 2018-10-11  Don Olmstead  <don.olmstead@sony.com>
696
697         Add Houdini specs to features.json
698         https://bugs.webkit.org/show_bug.cgi?id=190494
699
700         Reviewed by Simon Fraser.
701
702         Add CSS Typed OM Level 1, CSS Layout API Level 1, CSS Animation
703         Worklet, and group them under a Houdini feature set.
704
705         * features.json:
706
707 2018-10-11  Ross Kirsling  <ross.kirsling@sony.com>
708
709         [WTF] Semaphore.h conflicts with POSIX header
710         https://bugs.webkit.org/show_bug.cgi?id=190486
711
712         Reviewed by Yusuke Suzuki.
713
714         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
715
716 2018-10-11  Thibault Saunier  <tsaunier@igalia.com>
717
718         [GStreamer] Support arbitrary video resolution in getUserMedia API
719         https://bugs.webkit.org/show_bug.cgi?id=189734
720
721         Reviewed by Xabier Rodriguez-Calvar.
722
723         Implement arbitrary video resolution for the getUserMedia API in GStreamer.
724
725         Fix the MockRealtimeMediaSource device list to make devices properties match
726         test expectations.
727
728         Reactivate tests that were failling because of that.
729
730         * platform/mediastream/RealtimeVideoSource.cpp:
731         (WebCore::RealtimeVideoSource::standardVideoSizes):
732         (WebCore::standardVideoSizes): Deleted.
733         * platform/mediastream/RealtimeVideoSource.h:
734         * platform/mediastream/VideoPreset.h:
735         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
736         (WebCore::GStreamerVideoPreset::create):
737         (WebCore::GStreamerVideoPreset::GStreamerVideoPreset):
738         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
739         (WebCore::GStreamerVideoCaptureSource::capabilities):
740         (WebCore::GStreamerVideoCaptureSource::generatePresets):
741         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
742         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
743         (WebCore::defaultDevices):
744
745 2018-10-11  Keith Rollin  <krollin@apple.com>
746
747         CURRENT_ARCH should not be used in Run Script phase.
748         https://bugs.webkit.org/show_bug.cgi?id=190407
749         <rdar://problem/45133556>
750
751         Reviewed by Alexey Proskuryakov.
752
753         CURRENT_ARCH is used in a number of Xcode Run Script phases. However,
754         CURRENT_ARCH is not well-defined during this phase (and may even have
755         the value "undefined") since this phase is run just once per build
756         rather than once per supported architecture. Migrate away from
757         CURRENT_ARCH in favor of ARCHS, either by iterating over ARCHS and
758         performing an operation for each value, or by picking the first entry
759         in ARCHS and using that as a representative value.
760
761         No new tests -- no functional changes.
762
763         * DerivedSources.make: When forming TARGET_TRIPLE_FLAGS, grab the
764         first entry in ARCHS rather than use CURRENT_ARCH.
765
766 2018-10-11  Daniel Bates  <dabates@apple.com>
767
768         Support building WebKit for macOS Mojave using a newer SDK
769         https://bugs.webkit.org/show_bug.cgi?id=190431
770
771         Reviewed by Andy Estes.
772
773         * platform/network/cocoa/CookieCocoa.mm:
774         (WebCore::coreSameSitePolicy):
775         (WebCore::nsSameSitePolicy):
776
777 2018-10-11  Daniel Bates  <dabates@apple.com>
778
779         [iOS] Add typedef for WebEvent keyboard flags
780         https://bugs.webkit.org/show_bug.cgi?id=190435
781
782         Reviewed by Wenson Hsieh.
783
784         Currently WebEvent and UIKit SPI are intertwined when it comes to keyboard flags. It seems sufficient
785         to have WebEvent defined its own keyboard flags so that callers do not need to be aware of UIKit SPI.
786
787         No functionality changed. So, no new tests.
788
789         * platform/ios/WebEvent.h:
790         * platform/ios/WebEvent.mm:
791         (-[WebEvent keyboardFlags]):
792
793 2018-10-11  Antti Koivisto  <antti@apple.com>
794
795         Use finer grained locking in FontDatabase
796         https://bugs.webkit.org/show_bug.cgi?id=190467
797
798         Reviewed by Alex Christensen.
799
800         * platform/graphics/FontCache.h:
801
802         Also use ListHashSet for prewarming info so we can prewarm in the same order the fonts were
803         seen last time.
804
805         * platform/graphics/cocoa/FontCacheCoreText.cpp:
806         (WebCore::FontDatabase::collectionForFamily):
807
808         Only hold the lock when accessing the hashmap. There is no need to hold it during font construction
809         which can take a long time.
810
811         (WebCore::FontDatabase::fontForPostScriptName):
812
813         This is currently not prewarmed from a thread so no need for locking.
814
815         (WebCore::FontDatabase::clear):
816
817 2018-10-11  Thibault Saunier  <tsaunier@igalia.com>
818
819         [GStreamer] Fix race condition in GStreamerVideoDecoder
820         https://bugs.webkit.org/show_bug.cgi?id=190470
821
822         The GStreamerVideoDecoder.m_dtsPtsMap filed is accessed from
823         the main thread and some GStreamer streaming thread, make sure
824         to protect its access.
825
826         And use WTF::StdMap instead of std::map.
827
828         Reviewed by Philippe Normand.
829
830         Manually tested and a random crash is gone.
831
832         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
833         (WebCore::GStreamerVideoDecoder::newSampleCallback):
834
835 2018-10-11  Enrique Ocaña González  <eocanha@igalia.com>
836
837         [GStreamer][MSE] Fix height calculation for streams with source aspect ratio
838         https://bugs.webkit.org/show_bug.cgi?id=190464
839
840         Reviewed by Xabier Rodriguez-Calvar.
841
842         This patch is authored by Nikola Veljkovic <Nikola.Veljkovic@zenterio.com>
843
844         * platform/graphics/gstreamer/GStreamerCommon.cpp:
845         (WebCore::getVideoResolutionFromCaps): Reverse the SAR adjustment to "undo" it
846         instead of applying it twice.
847
848 2018-10-11  Alejandro G. Castro  <alex@igalia.com>
849
850         [GTK][WPE] Add mediaDevices.enumerateDevices support
851         https://bugs.webkit.org/show_bug.cgi?id=185761
852
853         Reviewed by Youenn Fablet.
854
855         We are adopting the same policy COCOA is using when returning the
856         list of media devices if the user does not have persistent
857         access. Namely, we just return the first media device for audio
858         and video capture.
859
860         * Modules/mediastream/MediaDevicesRequest.cpp:
861         (WebCore::MediaDevicesRequest::filterDeviceList): Add support for
862         other platforms when filtering devices if there is no persistent
863         access to the origin.
864
865 2018-10-10  Chris Dumez  <cdumez@apple.com>
866
867         Rename a couple of DOMWindowProperty virtual functions
868         https://bugs.webkit.org/show_bug.cgi?id=190458
869
870         Reviewed by Geoffrey Garen.
871
872         Rename a couple of DOMWindowProperty virtual functions as the current naming no longer makes
873         sense after recent refactoring.
874
875         disconnectFrameForDocumentSuspension() was renamed to suspendForPageCache(), and
876         reconnectFrameFromDocumentSuspension(Frame*) was renamed to resumeFromPageCache().
877         DOMWindowProperty objects no longer need to disconnect / reconnect from their
878         frame since they now get their frame from their associated Window. However, some
879         DOMWindowProperty subclasses do have some page cache suspension / resuming logic
880         implemented of overrides of these functions.
881
882         Also drop the disconnectDOMWindowProperties() / reconnectDOMWindowProperties()
883         methods in DOMWindow. The naming made little sense as it does not really
884         disconnect those properties in any way. Instead, inline them in
885         DOMWindow's suspendForPageCache() / resumeFromPageCache() since these are
886         the only callers.
887
888         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
889         (WebCore::DOMWindowIndexedDatabase::suspendForPageCache):
890         (WebCore::DOMWindowIndexedDatabase::resumeFromPageCache):
891         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension): Deleted.
892         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension): Deleted.
893         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
894         * history/CachedFrame.cpp:
895         (WebCore::CachedFrame::CachedFrame):
896         * loader/FrameLoader.cpp:
897         (WebCore::FrameLoader::open):
898         * loader/appcache/DOMApplicationCache.cpp:
899         (WebCore::DOMApplicationCache::suspendForPageCache):
900         (WebCore::DOMApplicationCache::resumeFromPageCache):
901         (WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension): Deleted.
902         (WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension): Deleted.
903         * loader/appcache/DOMApplicationCache.h:
904         * page/DOMWindow.cpp:
905         (WebCore::DOMWindow::suspendForPageCache):
906         (WebCore::DOMWindow::resumeFromPageCache):
907         (WebCore::DOMWindow::suspendForDocumentSuspension): Deleted.
908         (WebCore::DOMWindow::resumeFromDocumentSuspension): Deleted.
909         (WebCore::DOMWindow::disconnectDOMWindowProperties): Deleted.
910         (WebCore::DOMWindow::reconnectDOMWindowProperties): Deleted.
911         * page/DOMWindow.h:
912         * page/DOMWindowExtension.cpp:
913         (WebCore::DOMWindowExtension::suspendForPageCache):
914         (WebCore::DOMWindowExtension::resumeFromPageCache):
915         (WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension): Deleted.
916         (WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension): Deleted.
917         * page/DOMWindowExtension.h:
918         * page/DOMWindowProperty.cpp:
919         (WebCore::DOMWindowProperty::suspendForPageCache):
920         (WebCore::DOMWindowProperty::resumeFromPageCache):
921         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension): Deleted.
922         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension): Deleted.
923         * page/DOMWindowProperty.h:
924
925 2018-10-10  Devin Rousso  <drousso@apple.com>
926
927         Web Inspector: create special Network waterfall for media events
928         https://bugs.webkit.org/show_bug.cgi?id=189773
929         <rdar://problem/44626605>
930
931         Reviewed by Joseph Pecoraro.
932
933         Test: http/tests/inspector/dom/didFireEvent.html
934
935         * html/HTMLMediaElement.cpp:
936         (WebCore::HTMLMediaElement::HTMLMediaElement):
937
938         * inspector/InspectorInstrumentation.h:
939         (WebCore::InspectorInstrumentation::addEventListenersToNode): Added.
940         * inspector/InspectorInstrumentation.cpp:
941         (WebCore::InspectorInstrumentation::addEventListenersToNodeImpl): Added.
942
943         * inspector/agents/InspectorDOMAgent.h:
944         * inspector/agents/InspectorDOMAgent.cpp:
945         (WebCore::EventFiredCallback): Added.
946         (WebCore::EventFiredCallback::create): Added.
947         (WebCore::EventFiredCallback::operator==): Added.
948         (WebCore::EventFiredCallback::handleEvent): Added.
949         (WebCore::EventFiredCallback::EventFiredCallback): Added.
950         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
951         (WebCore::InspectorDOMAgent::addEventListenersToNode): Added.
952
953 2018-10-10  Daniel Bates  <dabates@apple.com>
954
955         [iOS] Cleanup -[WAKView _selfHandleEvent:] and -[WAKWindow sendEventSynchronously:]
956         https://bugs.webkit.org/show_bug.cgi?id=190402
957
958         Reviewed by Anders Carlsson.
959
960         Unindent case statements. Remove use of default case statements with body ASSERT_NOT_REACHED()
961         to catch the cases of a missing enumerator. By omitting the default case statement we turn
962         such a scenario into a compile-time error instead of handling it as a runtime error.
963
964         * platform/ios/wak/WAKView.mm:
965         (-[WAKView _selfHandleEvent:]):
966         * platform/ios/wak/WAKWindow.mm:
967         (-[WAKWindow sendEventSynchronously:]):
968
969 2018-10-05  Ryosuke Niwa  <rniwa@webkit.org>
970
971         Rename MarkupAccumulator::appendStartTag, appendElement, etc... for clarity
972         https://bugs.webkit.org/show_bug.cgi?id=190308
973
974         Reviewed by Darin Adler.
975
976         Renamed appendStartTag and appendEndTag to startAppendingNode and endAppendingNode since serialize any node,
977         not just elements which produce start and end tags.
978
979         Renamed appendElement and appendEndElement to appendStartTag and appendEndTag since that's what they do.
980
981         * editing/MarkupAccumulator.cpp:
982         (WebCore::elementCannotHaveEndTag): Made this a static local function.
983         (WebCore::shouldSelfClose): Ditto.
984         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
985         (WebCore::MarkupAccumulator::startAppendingNode): Renamed from appendStartTag.
986         (WebCore::MarkupAccumulator::endAppendingNode): Renamed from appendEndElement and merged appendEndMarkup here.
987         (WebCore::MarkupAccumulator::appendTextSubstring): Deleted. This was only used by StyledMarkupAccumulator.
988         (WebCore::MarkupAccumulator::appendStringView): Added.
989         (WebCore::MarkupAccumulator::appendStartTag): Renamed from appendElement.
990         (WebCore::MarkupAccumulator::appendCloseTag):
991         (WebCore::MarkupAccumulator::appendNonElementNode): Renamed from appendStartMarkup. No longer serializes
992         an element. StyledMarkupAccumulator had a check before calling this function already so this clarifies
993         the purpose of this function.
994         (WebCore::MarkupAccumulator::appendElement): Deleted.
995         (WebCore::MarkupAccumulator::appendEndMarkup): Deleted. Merged into appendEndTag.
996         * editing/MarkupAccumulator.h:
997         (WebCore::MarkupAccumulator::appendNodeEnd): Renamed from appendEndTag.
998         * editing/markup.cpp:
999         (WebCore::StyledMarkupAccumulator::wrapWithNode):
1000         (WebCore::StyledMarkupAccumulator::appendStartTag): Renamed from appendElement.
1001         (WebCore::StyledMarkupAccumulator::appendEndTag): Renamed from appendEndElement.
1002         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
1003         (WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Use String::substring directly instead of
1004         going through appendTextSubstring which has been deleted.
1005         * page/PageSerializer.cpp:
1006         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag): Renamed from appendElement.
1007         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndTag): Renamed from appendEndElement.
1008
1009 2018-10-10  Ryan Haddad  <ryanhaddad@apple.com>
1010
1011         Unreviewed, attempt to fix the build with current SDKs.
1012
1013         * crypto/mac/CryptoKeyRSAMac.cpp:
1014         (WebCore::getPublicKeyComponents):
1015
1016 2018-10-10  Brent Fulgham  <bfulgham@apple.com>
1017
1018         Only report the supported WebGL version
1019         https://bugs.webkit.org/show_bug.cgi?id=190434
1020         <rdar://problem/45024677>
1021
1022         Reviewed by Dean Jackson.
1023
1024         Tested by fast/canvas/webgl/gl-getstring.html
1025
1026         Revise getParameter(gl.VERSION) to only return the WebGL version without the hardware and
1027         driver-specific details available through the low-level OpenGL driver interface. These details
1028         are not needed for WebGL use and expose information about the user's system that we do not
1029         need to share.
1030
1031         * html/canvas/WebGL2RenderingContext.cpp:
1032         (WebCore::WebGL2RenderingContext::getParameter):
1033         * html/canvas/WebGLRenderingContext.cpp:
1034         (WebCore::WebGLRenderingContext::getParameter):
1035
1036 2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1037
1038         Unreviewed, add missing headers for inline functions
1039         https://bugs.webkit.org/show_bug.cgi?id=190429
1040
1041         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1042
1043 2018-10-10  Tim Horton  <timothy_horton@apple.com>
1044
1045         Share more WKShareSheet code between macOS and iOS, and fix a few bugs
1046         https://bugs.webkit.org/show_bug.cgi?id=190420
1047
1048         Reviewed by Simon Fraser.
1049
1050         Test: fast/web-share/share-with-no-url.html
1051
1052         * page/Navigator.cpp:
1053         (WebCore::Navigator::share):
1054         * page/ShareData.h:
1055         Make 'url' an optional field on ShareDataWithParsedURL, and don't
1056         reject the share() promise if the URL is totally empty (as opposed to invalid).
1057
1058 2018-10-10  Devin Rousso  <drousso@apple.com>
1059
1060         Web Inspector: notify the frontend when a canvas has started recording via console.record
1061         https://bugs.webkit.org/show_bug.cgi?id=190306
1062
1063         Reviewed by Brian Burg.
1064
1065         Updated existing tests: LayoutTests/inspector/canvas/recording-2d.html
1066                                 LayoutTests/inspector/canvas/recording-bitmaprenderer.html
1067                                 LayoutTests/inspector/canvas/recording-webgl-snapshots.html
1068                                 LayoutTests/inspector/canvas/recording-webgl.html
1069
1070         * inspector/agents/InspectorCanvasAgent.cpp:
1071         (WebCore::InspectorCanvasAgent::startRecording):
1072         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
1073
1074         * inspector/InspectorCanvas.h:
1075         Default `singleFrame` to false to better match the default behaviour of other `console`
1076         functions (`profile` doesn't stop until `profileEnd` is called, so the same should be true
1077         of `record` and `recordEnd`).
1078
1079 2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1080
1081         [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
1082         https://bugs.webkit.org/show_bug.cgi?id=190429
1083
1084         Reviewed by Saam Barati.
1085
1086         Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
1087
1088         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
1089         (WebCore::CDMSessionClearKey::cachedKeyForKeyID const):
1090         * Modules/plugins/QuickTimePluginReplacement.mm:
1091         (WebCore::jsValueWithDictionaryInContext):
1092         * Modules/webaudio/AudioBuffer.cpp:
1093         (WebCore::AudioBuffer::AudioBuffer):
1094         (WebCore::AudioBuffer::getChannelData):
1095         * Modules/webvr/VREyeParameters.cpp:
1096         (WebCore::VREyeParameters::offset const):
1097         * Modules/webvr/VRFrameData.cpp:
1098         (WebCore::matrixToArray):
1099         * Modules/webvr/VRPose.cpp:
1100         (WebCore::optionalFloat3ToJSCArray):
1101         (WebCore::VRPose::position const):
1102         (WebCore::VRPose::orientation const):
1103         * Modules/webvr/VRStageParameters.cpp:
1104         (WebCore::VRStageParameters::sittingToStandingTransform const):
1105         * bindings/js/ReadableStreamDefaultController.h:
1106         (WebCore::ReadableStreamDefaultController::enqueue):
1107         * bindings/js/SerializedScriptValue.cpp:
1108         (WebCore::CloneDeserializer::readArrayBufferView):
1109         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1110         (WebCore::CryptoKeyRSA::algorithm const):
1111         * crypto/mac/CryptoKeyRSAMac.cpp:
1112         (WebCore::CryptoKeyRSA::algorithm const):
1113         * css/DOMMatrixReadOnly.cpp:
1114         (WebCore::DOMMatrixReadOnly::toFloat32Array const):
1115         (WebCore::DOMMatrixReadOnly::toFloat64Array const):
1116         * css/FontFace.cpp:
1117         (WebCore::FontFace::create):
1118         * dom/TextEncoder.cpp:
1119         (WebCore::TextEncoder::encode const):
1120         * html/ImageData.cpp:
1121         (WebCore::ImageData::ImageData):
1122         * html/ImageData.h:
1123         (WebCore::ImageData::data const):
1124         (): Deleted.
1125         * html/canvas/WebGL2RenderingContext.cpp:
1126         (WebCore::WebGL2RenderingContext::bufferData):
1127         (WebCore::WebGL2RenderingContext::bufferSubData):
1128         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
1129         (WebCore::WebGL2RenderingContext::getParameter):
1130         * html/canvas/WebGLRenderingContext.cpp:
1131         (WebCore::WebGLRenderingContext::getParameter):
1132         * html/canvas/WebGLRenderingContextBase.cpp:
1133         (WebCore::WebGLRenderingContextBase::getUniform):
1134         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
1135         (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
1136         (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
1137         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1138         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
1139         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1140         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
1141         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1142         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1143         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1144         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
1145         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
1146         (WebCore::CDMSessionAVContentKeySession::update):
1147         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
1148         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1149         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
1150         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1151         (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
1152         (WebCore::CDMSessionAVStreamSession::releaseKeys):
1153         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
1154         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1155         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1156         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1157         (WebCore::MediaSampleAVFObjC::getRGBAImageData const):
1158         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1159         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1160         * platform/graphics/cairo/ImageBufferCairo.cpp:
1161         (WebCore::getImageData):
1162         * platform/graphics/cg/ImageBufferDataCG.cpp:
1163         (WebCore::ImageBufferData::getData const):
1164         * platform/graphics/filters/FEGaussianBlur.cpp:
1165         (WebCore::FEGaussianBlur::platformApplySoftware):
1166         * platform/graphics/filters/FilterEffect.cpp:
1167         (WebCore::FilterEffect::unmultipliedResult):
1168         (WebCore::FilterEffect::premultipliedResult):
1169         (WebCore::FilterEffect::copyUnmultipliedResult):
1170         (WebCore::FilterEffect::copyPremultipliedResult):
1171         (WebCore::FilterEffect::createUnmultipliedImageResult):
1172         (WebCore::FilterEffect::createPremultipliedImageResult):
1173         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1174         (WebCore::ImageBufferData::getData const):
1175         * platform/mac/SerializedPlatformRepresentationMac.mm:
1176         (WebCore::jsValueWithDictionaryInContext):
1177         * platform/mock/mediasource/MockBox.cpp:
1178         (WebCore::MockBox::peekType):
1179         (WebCore::MockBox::peekLength):
1180         (WebCore::MockTrackBox::MockTrackBox):
1181         (WebCore::MockInitializationBox::MockInitializationBox):
1182         (WebCore::MockSampleBox::MockSampleBox):
1183         * rendering/shapes/Shape.cpp:
1184         (WebCore::Shape::createRasterShape):
1185         * testing/LegacyMockCDM.cpp:
1186         (WebCore::initDataPrefix):
1187         (WebCore::keyPrefix):
1188         (WebCore::keyRequest):
1189
1190 2018-10-10  Daniel Bates  <dabates@apple.com>
1191
1192         [iOS] Compare input string to UIKeyInput constants using string comparison instead of pointer comparison
1193         https://bugs.webkit.org/show_bug.cgi?id=190432
1194
1195         Reviewed by Tim Horton.
1196
1197         Pointer comparision is brittle. We should be more forgiving and perform string comparision
1198         of an input string to a UIKeyInput constant.
1199
1200         * platform/ios/WebEvent.mm:
1201         (normalizedStringWithAppKitCompatibilityMapping):
1202
1203 2018-10-10  Chris Dumez  <cdumez@apple.com>
1204
1205         Unreviewed, rolling out r236802.
1206
1207         Working on getting the HTML spec updated instead
1208         (https://github.com/whatwg/html/pull/4079)
1209
1210         Reverted changeset:
1211
1212         "Passing noopener=NOOPENER to window.open() should cause the
1213         new window to not have an opener"
1214         https://bugs.webkit.org/show_bug.cgi?id=190251
1215         https://trac.webkit.org/changeset/236802
1216
1217 2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1218
1219         XMLHttpRequest should use reportExtraMemoryAllocated/reportExtraMemoryVisited instead of deprecatedReportExtraMemory
1220         https://bugs.webkit.org/show_bug.cgi?id=190279
1221
1222         Reviewed by Ryosuke Niwa.
1223
1224         This patch switches deprecatedReportExtraMemory to reportExtraMemoryAllocated/reportExtraMemoryVisited
1225         in XMLHttpRequest. We report extra memory allocation when the readyState becomes DONE. And memoryCost
1226         function returns the memory cost which is based on the readyState and m_responseBuilder.
1227         We annotate XMLHttpRequest with ReportExtraMemoryCost to use reportExtraMemoryVisited automatically with
1228         memoryCost() function.
1229
1230         * xml/XMLHttpRequest.cpp:
1231         (WebCore::XMLHttpRequest::changeState):
1232         (WebCore::XMLHttpRequest::abort):
1233         (WebCore::XMLHttpRequest::internalAbort):
1234         (WebCore::XMLHttpRequest::networkErrorTimerFired):
1235         (WebCore::XMLHttpRequest::memoryCost const):
1236         (WebCore::XMLHttpRequest::didFinishLoading):
1237         (WebCore::XMLHttpRequest::didReachTimeout):
1238         (WebCore::XMLHttpRequest::dropProtection): Deleted.
1239         * xml/XMLHttpRequest.h:
1240         * xml/XMLHttpRequest.idl:
1241
1242 2018-10-09  Antoine Quint  <graouts@apple.com>
1243
1244         Remove the frames() timing function
1245         https://bugs.webkit.org/show_bug.cgi?id=190034
1246         <rdar://problem/44827544>
1247
1248         Reviewed by Dean Jackson.
1249
1250         * css/CSSComputedStyleDeclaration.cpp:
1251         (WebCore::createTimingFunctionValue):
1252         * css/CSSTimingFunctionValue.cpp:
1253         (WebCore::CSSFramesTimingFunctionValue::customCSSText const): Deleted.
1254         (WebCore::CSSFramesTimingFunctionValue::equals const): Deleted.
1255         * css/CSSTimingFunctionValue.h:
1256         * css/CSSToStyleMap.cpp:
1257         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
1258         * css/CSSValue.cpp:
1259         (WebCore::CSSValue::equals const):
1260         (WebCore::CSSValue::cssText const):
1261         (WebCore::CSSValue::destroy):
1262         * css/CSSValue.h:
1263         (WebCore::CSSValue::isStepsTimingFunctionValue const):
1264         (WebCore::CSSValue::isFramesTimingFunctionValue const): Deleted.
1265         * css/CSSValueKeywords.in:
1266         * css/parser/CSSPropertyParser.cpp:
1267         (WebCore::consumeAnimationTimingFunction):
1268         (WebCore::consumeFrames): Deleted.
1269         * platform/animation/TimingFunction.cpp:
1270         (WebCore::operator<<):
1271         (WebCore::TimingFunction::transformTime const):
1272         (WebCore::TimingFunction::createFromCSSValue):
1273         * platform/animation/TimingFunction.h:
1274         (WebCore::TimingFunction::isStepsTimingFunction const):
1275         (WebCore::TimingFunction::isFramesTimingFunction const): Deleted.
1276         * platform/graphics/ca/GraphicsLayerCA.cpp:
1277         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
1278         (WebCore::animationHasFramesTimingFunction): Deleted.
1279
1280 2018-10-09  Devin Rousso  <drousso@apple.com>
1281
1282         Web Inspector: show redirect requests in Network and Timelines tabs
1283         https://bugs.webkit.org/show_bug.cgi?id=150005
1284         <rdar://problem/5378164>
1285
1286         Reviewed by Joseph Pecoraro.
1287
1288         Updated existing test http/tests/inspector/network/resource-timing.html.
1289
1290         * inspector/agents/InspectorNetworkAgent.cpp:
1291         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
1292         (WebCore::InspectorNetworkAgent::didFinishLoading):
1293         Add missing fields for `Network.types.ResourceTiming`.
1294
1295 2018-10-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1296
1297         REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only
1298         https://bugs.webkit.org/show_bug.cgi?id=190411
1299
1300         Reviewed by Simon Fraser.
1301
1302         Test: svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html
1303
1304         When changing the attributes of the SVGLangSpace, we should invalidate
1305         the renderer of the SVGGeometryElement descendant only. Renderer of other
1306         elements, like SVGStopElement, should not be invalidated because they do
1307         not have geometry and they can be used as resources for drawing another
1308         SVGGeometryElement.
1309
1310         * svg/SVGElement.h:
1311         (WebCore::SVGElement::isSVGGeometryElement const):
1312         * svg/SVGGeometryElement.h:
1313         (isType):
1314         * svg/SVGLangSpace.cpp:
1315         (WebCore::SVGLangSpace::svgAttributeChanged):
1316
1317 2018-10-09  Chris Dumez  <cdumez@apple.com>
1318
1319         Anchor target should be ignored on activation when the download attribute is set
1320         https://bugs.webkit.org/show_bug.cgi?id=190408
1321
1322         Reviewed by Geoffrey Garen.
1323
1324         Anchor target should be ignored on activation when the download attribute is set:
1325         - https://html.spec.whatwg.org/#the-a-element:downloading-hyperlinks-2
1326
1327         When the download attribute is set, we should use the "download the hyperlink" algorithm [1]
1328         instead of the "follow the hyperlink" [2] algorithm.
1329
1330         Note that the "download the hyperlink" triggers a download and ignores the target attribute
1331         entirely.
1332
1333         This is important as an anchor element with target=_blank and the download attribute set may
1334         fail because of Safari's popup blocker if we do not disregard the anchor target.
1335
1336         [1] https://html.spec.whatwg.org/#downloading-hyperlinks
1337         [2] https://html.spec.whatwg.org/#following-hyperlinks-2
1338
1339         Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-base-target-popup-not-allowed.html
1340                fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target-popup-not-allowed.html
1341
1342         * loader/FrameLoader.cpp:
1343         (WebCore::FrameLoader::loadURL):
1344
1345 2018-10-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1346
1347         [WPE][GTK] Complex text crashes with harfbuzz 1.8.8
1348         https://bugs.webkit.org/show_bug.cgi?id=190409
1349
1350         Reviewed by Žan Doberšek.
1351
1352         We discovered that harfbuzz 1.8.8 breaks WebKit by changing the ownership semantics of
1353         hb_icu_get_unicode_funcs() from (transfer full) to (transfer none). Our code was actually
1354         expecting (transfer none), so it's not immediately clear to me why it's crashing now, but
1355         doesn't matter as Behdad recommends removing this line of code because it hasn't been
1356         been needed for many years.
1357
1358         This should be covered by all our complex text tests if the bots were upgraded to the newer
1359         harfbuzz.
1360
1361         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1362         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1363
1364 2018-10-09  Daniel Bates  <dabates@apple.com>
1365
1366         [iOS] Cleanup EventHandler::passSubframeEventToSubframe()
1367         https://bugs.webkit.org/show_bug.cgi?id=190390
1368
1369         Reviewed by Wenson Hsieh.
1370
1371         Unindent case statements in switch block and use more auto.
1372
1373         * page/ios/EventHandlerIOS.mm:
1374         (WebCore::EventHandler::passSubframeEventToSubframe):
1375
1376 2018-10-09  Daniel Bates  <dabates@apple.com>
1377
1378         Cleanup WebEvent.mm
1379         https://bugs.webkit.org/show_bug.cgi?id=190391
1380
1381         Reviewed by Wenson Hsieh.
1382
1383         Unindent case statements in switch blocks.
1384
1385         * platform/ios/WebEvent.mm:
1386         (-[WebEvent _typeDescription]):
1387         (-[WebEvent _modiferFlagsDescription]):
1388         (-[WebEvent _touchPhaseDescription:]):
1389         (-[WebEvent _eventDescription]):
1390
1391 2018-10-09  Oriol Brufau  <obrufau@igalia.com>
1392
1393         Resolve inset properties to computed style when there is overconstraintment
1394         https://bugs.webkit.org/show_bug.cgi?id=188711
1395
1396         Reviewed by Manuel Rego Casasnovas.
1397
1398         This patch makes WebKit behave closer to Blink. Specifically,
1399          - In overconstrained relative or absolute positioning, inset properties resolve
1400            to the computed value (absolutizing percentages) instead of to the used value.
1401          - In fixed positioning, the resolved value of non-'auto' values is no longer
1402            increased by the border of the containg block.
1403
1404         This patch can slighlty alter the resolved value if it's a long decimal number.
1405
1406         Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-absolute.html
1407                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-fixed.html
1408                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-nobox.html
1409                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-relative.html
1410                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-static.html
1411                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky.html
1412
1413         * css/CSSComputedStyleDeclaration.cpp:
1414         (WebCore::positionOffsetValue):
1415         * rendering/RenderBox.h:
1416
1417 2018-10-09  Jiewen Tan  <jiewen_tan@apple.com>
1418
1419         [WebAuthN] Import CTAP HID message and packet structure from Chromium
1420         https://bugs.webkit.org/show_bug.cgi?id=189289
1421         <rdar://problem/44120310>
1422
1423         Reviewed by Brent Fulgham.
1424
1425         This patch imports CTAP HID message and packet structure:
1426         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-and-packet-structure
1427         from Chromium. With this library, WebKit can now turn binaries into messages that CTAP devices could understand.
1428         This patch contains the following Chromium files and modifies them to fit into WebKit:
1429         https://cs.chromium.org/chromium/src/device/fido/fido_constants.cc?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
1430         https://cs.chromium.org/chromium/src/device/fido/fido_constants.h?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
1431         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.cc?l=1&rcl=387f3725de2842e0e6b7175a9b2ed472b0cf781a
1432         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
1433         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
1434         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
1435         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message_unittest.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
1436
1437         Covered by API tests.
1438
1439         * Modules/webauthn/fido/FidoConstants.cpp: Added.
1440         (fido::isFidoHidDeviceCommand):
1441         * Modules/webauthn/fido/FidoConstants.h: Added.
1442         * Modules/webauthn/fido/FidoHidMessage.cpp: Added.
1443         (fido::FidoHidMessage::create):
1444         (fido::FidoHidMessage::createFromSerializedData):
1445         (fido::FidoHidMessage::messageComplete const):
1446         (fido::FidoHidMessage::getMessagePayload const):
1447         (fido::FidoHidMessage::popNextPacket):
1448         (fido::FidoHidMessage::addContinuationPacket):
1449         (fido::FidoHidMessage::numPackets const):
1450         (fido::FidoHidMessage::FidoHidMessage):
1451         * Modules/webauthn/fido/FidoHidMessage.h: Added.
1452         * Modules/webauthn/fido/FidoHidPacket.cpp: Added.
1453         (fido::FidoHidPacket::FidoHidPacket):
1454         (fido::FidoHidInitPacket::createFromSerializedData):
1455         (fido::FidoHidInitPacket::FidoHidInitPacket):
1456         (fido::FidoHidInitPacket::getSerializedData const):
1457         (fido::FidoHidContinuationPacket::createFromSerializedData):
1458         (fido::FidoHidContinuationPacket::FidoHidContinuationPacket):
1459         (fido::FidoHidContinuationPacket::getSerializedData const):
1460         * Modules/webauthn/fido/FidoHidPacket.h: Added.
1461         * Modules/webauthn/fido/FidoParsingUtils.cpp: Added.
1462         (fido::getInitPacketData):
1463         (fido::getContinuationPacketData):
1464         * Modules/webauthn/fido/FidoParsingUtils.h: Added.
1465         * Sources.txt:
1466         * WebCore.xcodeproj/project.pbxproj:
1467
1468 2018-10-09  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1469
1470         [CoordGraphics] Remove the 'previous backing store' logic
1471         https://bugs.webkit.org/show_bug.cgi?id=188838
1472
1473         Reviewed by Žan Doberšek.
1474
1475         Remove previousBackingStore from LayerState, since it's not needed anymore.
1476         When there is scale adjustment, we now simply discard mainBackingStore and
1477         recreate a new one.
1478
1479         No new tests required.
1480
1481         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h:
1482         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1483         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
1484         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
1485         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
1486
1487 2018-10-09  Antti Koivisto  <antti@apple.com>
1488
1489         [PSON] Prewarm system UI font
1490         https://bugs.webkit.org/show_bug.cgi?id=190397
1491
1492         Reviewed by Geoffrey Garen.
1493
1494         Cache system UI font fallbacks. Almost every web process needs these.
1495
1496         * page/ProcessWarming.cpp:
1497         (WebCore::ProcessWarming::prewarmGlobally):
1498
1499 2018-10-09  Chris Dumez  <cdumez@apple.com>
1500
1501         REGRESSION (Safari 12): Download of Blob URL fails
1502         https://bugs.webkit.org/show_bug.cgi?id=190351
1503         <rdar://problem/45091181>
1504
1505         Reviewed by Geoffrey Garen.
1506
1507         When using both the download attribute and target="_blank" on an anchor element, we would
1508         mistakenly drop the download attribute after the "new window" policy decision has been made.
1509         As a result, we would try to load the blob instead of downloading it.
1510
1511         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html
1512
1513         * loader/FrameLoader.cpp:
1514         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1515
1516 2018-10-09  Alicia Boya García  <aboya@igalia.com>
1517
1518         [MSE][GStreamer] r236735 has some dead ASSERTs that need to be moved
1519         https://bugs.webkit.org/show_bug.cgi?id=190394
1520
1521         Reviewed by Xabier Rodriguez-Calvar.
1522
1523         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1524         (WebCore::createOptionalParserForFormat):
1525
1526 2018-10-09  Chris Dumez  <cdumez@apple.com>
1527
1528         Have DOMWindow get its frame from its document
1529         https://bugs.webkit.org/show_bug.cgi?id=190389
1530
1531         Reviewed by Geoff Garen.
1532
1533         Have DOMWindow get its frame from its document instead of having its own m_frame which can potentially
1534         be out-of-sync.
1535
1536         * dom/Document.cpp:
1537         (WebCore::Document::frameDestroyed):
1538         (WebCore::Document::willDetachPage):
1539         (WebCore::Document::attachToCachedFrame):
1540         * dom/Document.h:
1541         * page/DOMWindow.cpp:
1542         (WebCore::DOMWindow::allowPopUp):
1543         (WebCore::ContextDestructionObserver):
1544         (WebCore::DOMWindow::didSecureTransitionTo):
1545         (WebCore::DOMWindow::frameDestroyed):
1546         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1547         (WebCore::DOMWindow::reconnectDOMWindowProperties):
1548         (WebCore::DOMWindow::isCurrentlyDisplayedInFrame const):
1549         (WebCore::DOMWindow::collectMatchingElementsInFlatTree):
1550         (WebCore::DOMWindow::matchingElementInFlatTree):
1551         (WebCore::DOMWindow::orientation const):
1552         (WebCore::DOMWindow::console const):
1553         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
1554         (WebCore::DOMWindow::webkitNamespace):
1555         (WebCore::DOMWindow::postMessage):
1556         (WebCore::DOMWindow::postMessageTimerFired):
1557         (WebCore::DOMWindow::frameElement const):
1558         (WebCore::DOMWindow::focus):
1559         (WebCore::DOMWindow::blur):
1560         (WebCore::DOMWindow::close):
1561         (WebCore::DOMWindow::print):
1562         (WebCore::DOMWindow::stop):
1563         (WebCore::DOMWindow::alert):
1564         (WebCore::DOMWindow::confirm):
1565         (WebCore::DOMWindow::prompt):
1566         (WebCore::DOMWindow::find const):
1567         (WebCore::DOMWindow::outerHeight const):
1568         (WebCore::DOMWindow::outerWidth const):
1569         (WebCore::DOMWindow::innerHeight const):
1570         (WebCore::DOMWindow::innerWidth const):
1571         (WebCore::DOMWindow::screenX const):
1572         (WebCore::DOMWindow::screenY const):
1573         (WebCore::DOMWindow::scrollX const):
1574         (WebCore::DOMWindow::scrollY const):
1575         (WebCore::DOMWindow::closed const):
1576         (WebCore::DOMWindow::length const):
1577         (WebCore::DOMWindow::name const):
1578         (WebCore::DOMWindow::setName):
1579         (WebCore::DOMWindow::setStatus):
1580         (WebCore::DOMWindow::setDefaultStatus):
1581         (WebCore::DOMWindow::self const):
1582         (WebCore::DOMWindow::opener const):
1583         (WebCore::DOMWindow::disownOpener):
1584         (WebCore::DOMWindow::parent const):
1585         (WebCore::DOMWindow::top const):
1586         (WebCore::DOMWindow::getMatchedCSSRules const):
1587         (WebCore::DOMWindow::devicePixelRatio const):
1588         (WebCore::DOMWindow::scrollBy const):
1589         (WebCore::DOMWindow::scrollTo const):
1590         (WebCore::DOMWindow::allowedToChangeWindowGeometry const):
1591         (WebCore::DOMWindow::moveBy const):
1592         (WebCore::DOMWindow::moveTo const):
1593         (WebCore::DOMWindow::resizeBy const):
1594         (WebCore::DOMWindow::resizeTo const):
1595         (WebCore::DOMWindow::clearTimeout):
1596         (WebCore::DOMWindow::isSameSecurityOriginAsMainFrame const):
1597         (WebCore::DOMWindow::finishedLoading):
1598         (WebCore::DOMWindow::setLocation):
1599         (WebCore::DOMWindow::open):
1600         (WebCore::DOMWindow::showModalDialog):
1601         (WebCore::DOMWindow::frame const):
1602         (WebCore::FrameDestructionObserver): Deleted.
1603         (WebCore::DOMWindow::willDetachPage): Deleted.
1604         (WebCore::DOMWindow::detachFromFrame): Deleted.
1605         (WebCore::DOMWindow::attachToFrame): Deleted.
1606         * page/DOMWindow.h:
1607
1608 2018-10-09  Jer Noble  <jer.noble@apple.com>
1609
1610         ISOTrackEncryptionBox returns incorrect defaultKeyID
1611         https://bugs.webkit.org/show_bug.cgi?id=190368
1612
1613         Reviewed by Eric Carlson.
1614
1615         Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
1616
1617         ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
1618
1619         Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
1620
1621         * WebCore.xcodeproj/project.pbxproj:
1622         * platform/graphics/iso/ISOBox.h:
1623         * platform/graphics/iso/ISOOriginalFormatBox.h:
1624         * platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
1625         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
1626         * platform/graphics/iso/ISOSchemeInformationBox.h:
1627         * platform/graphics/iso/ISOSchemeTypeBox.h:
1628         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
1629         (WebCore::ISOTrackEncryptionBox::parse):
1630         * platform/graphics/iso/ISOTrackEncryptionBox.h:
1631
1632 2018-10-09  Youenn Fablet  <youenn@apple.com>
1633
1634         Add support for IceCandidate stats
1635         https://bugs.webkit.org/show_bug.cgi?id=190329
1636
1637         Reviewed by Eric Carlson.
1638
1639         Convert IceCandidate stats gathered by libwebrtc.
1640         Since networkType might be sensitive information, we currently do not expose it.
1641         We do not expose address either if it is a host or prflx candidate.
1642
1643         Test: webrtc/candidate-stats.html
1644
1645         * Modules/mediastream/RTCStatsReport.h:
1646         * Modules/mediastream/RTCStatsReport.idl:
1647         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
1648         (WebCore::iceCandidateState):
1649         (WebCore::fillRTCIceCandidateStats):
1650         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
1651
1652 2018-10-09  Philippe Normand  <pnormand@igalia.com>
1653
1654         [GStreamer] Stealing cross-origin video pixel with HLS
1655         https://bugs.webkit.org/show_bug.cgi?id=190003
1656
1657         Reviewed by Xabier Rodriguez-Calvar.
1658
1659         Report the SecurityOrigin of downloaded adaptivedemux (HLS, DASH,
1660         SmoothStreaming) fragments as tainted if their origin differs from
1661         the manifest SecurityOrigin. SecurityOrigins are stored in the
1662         CachedResourceStreamingClient implemented in the internal
1663         GStreamer HTTP(S) source element.
1664
1665         The implementation is not ideal yet because the fragments download
1666         is performed by the WebProcess, until bug 189967 is fixed. When
1667         this bug is fixed, the m_hasTaintedOrigin member variable should
1668         be removed and all checks be done unconditionally to the
1669         webkithttpsrc element which will manage the download of the
1670         manifests and fragments.
1671
1672         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1673         (WebCore::MediaPlayerPrivateGStreamer::loadFull): Reset the m_hasTaintedOrigin value.
1674         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Get the
1675         fragment URL from the adaptivedemux stats message and check if its
1676         origin is tainted.
1677         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
1678         Initial implementation by checking the m_hasTaintedOrigin member
1679         variable value.
1680         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1681         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1682         (CachedResourceStreamingClient::responseReceived): Store the
1683         resource origin internally so it can be checked later on by
1684         webKitSrtcWouldTaintOrigin().
1685         (webKitSrcWouldTaintOrigin): Check given origin against cached
1686         origins. This implementation is similar to Cocoa's
1687         WebCoreNSURLSession implementation.
1688         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
1689
1690 2018-10-09  Antti Koivisto  <antti@apple.com>
1691
1692         Prewarm FontDatabase on process swap
1693         https://bugs.webkit.org/show_bug.cgi?id=190312
1694
1695         Reviewed by Chris Dumez.
1696
1697         Implement basic prewarming of FontDatabase. When the domain of the first page load on
1698         a new process is known we pass the list of font families previous used by that domain to the
1699         process. This is used to prewarm CoreText font database. Initialization (which involves lots of
1700         blocking IPC) happens outside the main thread so the fonts are ready to use when needed.
1701
1702         * WebCore.xcodeproj/project.pbxproj:
1703         * page/PrewarmInformation.h: Added.
1704         (WebCore::PrewarmInformation::encode const):
1705         (WebCore::PrewarmInformation::decode):
1706
1707         Add data structure for prewarm information with encode/decode support.
1708
1709         * page/ProcessWarming.cpp:
1710         (WebCore::ProcessWarming::collectPrewarmInformation):
1711         (WebCore::ProcessWarming::prewarmWithInformation):
1712
1713         Prewarming interface to be used from WebKit.
1714
1715         * page/ProcessWarming.h:
1716         * platform/graphics/FontCache.cpp:
1717         (WebCore::FontCache::collectPrewarmInformation const):
1718         (WebCore::FontCache::prewarm):
1719         * platform/graphics/FontCache.h:
1720         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1721         (WebCore::FontDatabase::collectionForFamily):
1722         (WebCore::FontDatabase::fontForPostScriptName):
1723         (WebCore::FontDatabase::clear):
1724
1725         Add mutex for thread safe access.
1726
1727         (WebCore::FontCache::createFontPlatformData):
1728         (WebCore::FontCache::collectPrewarmInformation const):
1729
1730         Collect font families seen by this process.
1731
1732         (WebCore::FontCache::prewarm):
1733
1734         Prewarm FontDatabase in a dispatch queue.
1735
1736 2018-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1737
1738         [Cocoa] [WK2] Add support for text alignment and text lists in font attributes
1739         https://bugs.webkit.org/show_bug.cgi?id=190342
1740         <rdar://problem/44767118>
1741
1742         Reviewed by Tim Horton.
1743
1744         Adds support for computing and encoding information about text alignment and enclosing list elements in the font
1745         attributes dictionary, exposed to the UI delegate on Cocoa platforms. This is exposed through NSParagraphStyle,
1746         which contains properties for both `NSTextAlignment` and an array of enclosing `NSTextList` objects.
1747
1748         Test:   FontAttributes.NestedTextListsWithHorizontalAlignment
1749                 FontAttributes.FontAttributesAfterChangingSelection
1750
1751         * editing/Editor.cpp:
1752         (WebCore::editableTextListsAtPositionInDescendingOrder):
1753
1754         Add a helper function to ascend the DOM, starting at the given position, in search of enclosing list elements.
1755         For each enclosing list element we find within the scope of the editable root, we create a `TextList`
1756         representing the list element.
1757
1758         (WebCore::Editor::fontAttributesAtSelectionStart const):
1759
1760         Compute and set enclosing text lists and text alignment. For text alignment, we convert the initial text-align
1761         value, `start`, to NSTextAlignmentNatural (the default text alignment type on Cocoa platforms); other values
1762         then map to Left, Right, Center, and Justified as expected (taking direction into account).
1763
1764         * editing/FontAttributes.h:
1765         (WebCore::TextList::encode const):
1766         (WebCore::TextList::decode):
1767
1768         Introduce TextList, a platform-agnostic representation of an unordered or ordered list. On Cocoa, this can be
1769         used to construct a corresponding NSTextList.
1770
1771         * editing/cocoa/FontAttributesCocoa.mm:
1772         (WebCore::cocoaTextListMarkerName):
1773
1774         Attempt to map a WebCore list style type to a `NSTextListMarker*` constant. While most of the Cocoa marker
1775         formats have a corresponding web-exposed list style type, many web-exposed types have no Cocoa equivalent; as
1776         such, fall back to default marker formats: "{disc}" for unordered lists and "{decimal}" for ordered lists.
1777
1778         (WebCore::TextList::createTextList const):
1779         (WebCore::FontAttributes::createDictionary const):
1780
1781         Include an NSParagraphStyle in the dictionary of font attributes that includes information about text alignment
1782         and enclosing text lists (per Cocoa convention, in order from outermost list to innermost list).
1783
1784 2018-10-08  Justin Fan  <justin_fan@apple.com>
1785
1786         WebGPU: Rename old WebGPU prototype to WebMetal
1787         https://bugs.webkit.org/show_bug.cgi?id=190325
1788         <rdar://problem/44990443>
1789
1790         Reviewed by Dean Jackson.
1791
1792         Existing WebGPU tests also renamed to reflect WebGPU -> WebMetal change.
1793
1794         Rename WebGPU prototype files to WebMetal in preparation for implementing the new (Oct 2018) WebGPU interface.
1795
1796         * CMakeLists.txt:
1797         * Configurations/FeatureDefines.xcconfig:
1798         * DerivedSources.make:
1799         * Sources.txt:
1800         * SourcesCocoa.txt:
1801         * WebCore.xcodeproj/project.pbxproj:
1802         * bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp.
1803         (WebCore::toJSNewlyCreated):
1804         (WebCore::toJS):
1805         * bindings/js/JSWebMetalRenderingContextCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderingContextCustom.cpp.
1806         (WebCore::JSWebMetalRenderingContext::visitAdditionalChildren):
1807         * bindings/js/WebCoreBuiltinNames.h:
1808         * dom/Document.cpp:
1809         (WebCore::Document::getCSSCanvasContext):
1810         * dom/Document.h:
1811         * dom/Document.idl:
1812         * html/HTMLCanvasElement.cpp:
1813         (WebCore::HTMLCanvasElement::getContext):
1814         (WebCore::HTMLCanvasElement::isWebMetalType):
1815         (WebCore::HTMLCanvasElement::createContextWebMetal):
1816         (WebCore::HTMLCanvasElement::getContextWebMetal):
1817         (WebCore::HTMLCanvasElement::isWebGPUType): Deleted.
1818         (WebCore::HTMLCanvasElement::createContextWebGPU): Deleted.
1819         (WebCore::HTMLCanvasElement::getContextWebGPU): Deleted.
1820         * html/HTMLCanvasElement.h:
1821         * html/HTMLCanvasElement.idl:
1822         * html/canvas/CanvasRenderingContext.h:
1823         (WebCore::CanvasRenderingContext::isWebMetal const):
1824         (WebCore::CanvasRenderingContext::isWebGPU const): Deleted.
1825         * html/canvas/WebGPURenderingContext.cpp: Removed.
1826         * html/canvas/WebMetalBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.cpp.
1827         (WebCore::WebMetalBuffer::create):
1828         (WebCore::WebMetalBuffer::WebMetalBuffer):
1829         * html/canvas/WebMetalBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.h.
1830         * html/canvas/WebMetalBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.idl.
1831         * html/canvas/WebMetalCommandBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.cpp.
1832         (WebCore::WebMetalCommandBuffer::create):
1833         (WebCore::WebMetalCommandBuffer::WebMetalCommandBuffer):
1834         (WebCore::WebMetalCommandBuffer::~WebMetalCommandBuffer):
1835         (WebCore::WebMetalCommandBuffer::commit):
1836         (WebCore::WebMetalCommandBuffer::presentDrawable):
1837         (WebCore::WebMetalCommandBuffer::createRenderCommandEncoderWithDescriptor):
1838         (WebCore::WebMetalCommandBuffer::createComputeCommandEncoder):
1839         (WebCore::WebMetalCommandBuffer::completed):
1840         * html/canvas/WebMetalCommandBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
1841         * html/canvas/WebMetalCommandBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
1842         * html/canvas/WebMetalCommandQueue.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.cpp.
1843         (WebCore::WebMetalCommandQueue::create):
1844         (WebCore::WebMetalCommandQueue::WebMetalCommandQueue):
1845         (WebCore::WebMetalCommandQueue::createCommandBuffer):
1846         * html/canvas/WebMetalCommandQueue.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.h.
1847         * html/canvas/WebMetalCommandQueue.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.idl.
1848         * html/canvas/WebMetalComputeCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.cpp.
1849         (WebCore::GPUSizeMake):
1850         (WebCore::WebMetalComputeCommandEncoder::create):
1851         (WebCore::WebMetalComputeCommandEncoder::WebMetalComputeCommandEncoder):
1852         (WebCore::WebMetalComputeCommandEncoder::setComputePipelineState):
1853         (WebCore::WebMetalComputeCommandEncoder::setBuffer):
1854         (WebCore::WebMetalComputeCommandEncoder::dispatch):
1855         (WebCore::WebMetalComputeCommandEncoder::endEncoding):
1856         * html/canvas/WebMetalComputeCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.h.
1857         * html/canvas/WebMetalComputeCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.idl.
1858         * html/canvas/WebMetalComputePipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.cpp.
1859         (WebCore::WebMetalComputePipelineState::create):
1860         (WebCore::WebMetalComputePipelineState::WebMetalComputePipelineState):
1861         * html/canvas/WebMetalComputePipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.h.
1862         * html/canvas/WebMetalComputePipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.idl.
1863         * html/canvas/WebMetalDepthStencilDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.cpp.
1864         (WebCore::WebMetalDepthStencilDescriptor::create):
1865         (WebCore::WebMetalDepthStencilDescriptor::depthWriteEnabled const):
1866         (WebCore::WebMetalDepthStencilDescriptor::setDepthWriteEnabled):
1867         (WebCore::WebMetalDepthStencilDescriptor::depthCompareFunction const):
1868         (WebCore::WebMetalDepthStencilDescriptor::setDepthCompareFunction):
1869         * html/canvas/WebMetalDepthStencilDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.h.
1870         * html/canvas/WebMetalDepthStencilDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.idl.
1871         * html/canvas/WebMetalDepthStencilState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.cpp.
1872         (WebCore::WebMetalDepthStencilState::create):
1873         (WebCore::WebMetalDepthStencilState::WebMetalDepthStencilState):
1874         (WebCore::WebMetalDepthStencilState::label const):
1875         (WebCore::WebMetalDepthStencilState::setLabel):
1876         * html/canvas/WebMetalDepthStencilState.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.h.
1877         * html/canvas/WebMetalDepthStencilState.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.idl.
1878         * html/canvas/WebMetalDrawable.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.cpp.
1879         (WebCore::WebMetalDrawable::create):
1880         (WebCore::WebMetalDrawable::WebMetalDrawable):
1881         * html/canvas/WebMetalDrawable.h: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.h.
1882         (WebCore::WebMetalDrawable::texture):
1883         * html/canvas/WebMetalDrawable.idl: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.idl.
1884         * html/canvas/WebMetalEnums.cpp: Renamed from Source/WebCore/html/canvas/WebGPUEnums.cpp.
1885         (WebCore::toWebMetalCompareFunction):
1886         (WebCore::web3DCompareFunctionName):
1887         (WebCore::toGPUCompareFunction):
1888         * html/canvas/WebMetalEnums.h: Renamed from Source/WebCore/html/canvas/WebGPUEnums.h.
1889         * html/canvas/WebMetalEnums.idl: Renamed from Source/WebCore/html/canvas/WebGPUEnums.idl.
1890         * html/canvas/WebMetalFunction.cpp: Renamed from Source/WebCore/html/canvas/WebGPUFunction.cpp.
1891         (WebCore::WebMetalFunction::create):
1892         (WebCore::WebMetalFunction::WebMetalFunction):
1893         * html/canvas/WebMetalFunction.h: Renamed from Source/WebCore/html/canvas/WebGPUFunction.h.
1894         * html/canvas/WebMetalFunction.idl: Renamed from Source/WebCore/html/canvas/WebGPUFunction.idl.
1895         * html/canvas/WebMetalLibrary.cpp: Renamed from Source/WebCore/html/canvas/WebGPULibrary.cpp.
1896         (WebCore::WebMetalLibrary::create):
1897         (WebCore::WebMetalLibrary::WebMetalLibrary):
1898         (WebCore::WebMetalLibrary::functionNames const):
1899         (WebCore::WebMetalLibrary::functionWithName const):
1900         * html/canvas/WebMetalLibrary.h: Renamed from Source/WebCore/html/canvas/WebGPULibrary.h.
1901         * html/canvas/WebMetalLibrary.idl: Renamed from Source/WebCore/html/canvas/WebGPULibrary.idl.
1902         * html/canvas/WebMetalRenderCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.cpp.
1903         (WebCore::WebMetalRenderCommandEncoder::create):
1904         (WebCore::WebMetalRenderCommandEncoder::WebMetalRenderCommandEncoder):
1905         (WebCore::WebMetalRenderCommandEncoder::setRenderPipelineState):
1906         (WebCore::WebMetalRenderCommandEncoder::setDepthStencilState):
1907         (WebCore::WebMetalRenderCommandEncoder::setVertexBuffer):
1908         (WebCore::WebMetalRenderCommandEncoder::setFragmentBuffer):
1909         (WebCore::WebMetalRenderCommandEncoder::drawPrimitives):
1910         (WebCore::WebMetalRenderCommandEncoder::endEncoding):
1911         * html/canvas/WebMetalRenderCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.h.
1912         * html/canvas/WebMetalRenderCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.idl.
1913         * html/canvas/WebMetalRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.cpp.
1914         (WebCore::WebMetalRenderPassAttachmentDescriptor::WebMetalRenderPassAttachmentDescriptor):
1915         (WebCore::WebMetalRenderPassAttachmentDescriptor::loadAction const):
1916         (WebCore::WebMetalRenderPassAttachmentDescriptor::setLoadAction):
1917         (WebCore::WebMetalRenderPassAttachmentDescriptor::storeAction const):
1918         (WebCore::WebMetalRenderPassAttachmentDescriptor::setStoreAction):
1919         (WebCore::WebMetalRenderPassAttachmentDescriptor::texture const):
1920         (WebCore::WebMetalRenderPassAttachmentDescriptor::setTexture):
1921         * html/canvas/WebMetalRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.h.
1922         * html/canvas/WebMetalRenderPassAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.idl.
1923         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp.
1924         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::create):
1925         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::WebMetalRenderPassColorAttachmentDescriptor):
1926         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::descriptor const):
1927         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::clearColor const):
1928         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::setClearColor):
1929         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.h.
1930         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.idl.
1931         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp.
1932         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::create):
1933         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::WebMetalRenderPassDepthAttachmentDescriptor):
1934         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::clearDepth const):
1935         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::setClearDepth):
1936         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::descriptor const):
1937         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h.
1938         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.idl.
1939         * html/canvas/WebMetalRenderPassDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.cpp.
1940         (WebCore::WebMetalRenderPassDescriptor::create):
1941         (WebCore::WebMetalRenderPassDescriptor::depthAttachment):
1942         (WebCore::WebMetalRenderPassDescriptor::colorAttachments):
1943         * html/canvas/WebMetalRenderPassDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.h.
1944         * html/canvas/WebMetalRenderPassDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.idl.
1945         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp.
1946         (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::create):
1947         (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::WebMetalRenderPipelineColorAttachmentDescriptor):
1948         (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::pixelFormat const):
1949         (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::setPixelFormat):
1950         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h.
1951         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl.
1952         * html/canvas/WebMetalRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.cpp.
1953         (WebCore::WebMetalRenderPipelineDescriptor::create):
1954         (WebCore::WebMetalRenderPipelineDescriptor::vertexFunction const):
1955         (WebCore::WebMetalRenderPipelineDescriptor::setVertexFunction):
1956         (WebCore::WebMetalRenderPipelineDescriptor::fragmentFunction const):
1957         (WebCore::WebMetalRenderPipelineDescriptor::setFragmentFunction):
1958         (WebCore::WebMetalRenderPipelineDescriptor::colorAttachments):
1959         (WebCore::WebMetalRenderPipelineDescriptor::depthAttachmentPixelFormat const):
1960         (WebCore::WebMetalRenderPipelineDescriptor::setDepthAttachmentPixelFormat):
1961         (WebCore::WebMetalRenderPipelineDescriptor::reset):
1962         * html/canvas/WebMetalRenderPipelineDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.h.
1963         * html/canvas/WebMetalRenderPipelineDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.idl.
1964         * html/canvas/WebMetalRenderPipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.cpp.
1965         (WebCore::WebMetalRenderPipelineState::create):
1966         (WebCore::WebMetalRenderPipelineState::WebMetalRenderPipelineState):
1967         (WebCore::WebMetalRenderPipelineState::label const):
1968         (WebCore::WebMetalRenderPipelineState::setLabel):
1969         * html/canvas/WebMetalRenderPipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.h.
1970         * html/canvas/WebMetalRenderPipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.idl.
1971         * html/canvas/WebMetalRenderingContext.cpp: Added.
1972         (WebCore::WebMetalRenderingContext::create):
1973         (WebCore::WebMetalRenderingContext::WebMetalRenderingContext):
1974         (WebCore::WebMetalRenderingContext::canvas const):
1975         (WebCore::WebMetalRenderingContext::initializeNewContext):
1976         (WebCore::WebMetalRenderingContext::clampedCanvasSize const):
1977         (WebCore::WebMetalRenderingContext::hasPendingActivity const):
1978         (WebCore::WebMetalRenderingContext::stop):
1979         (WebCore::WebMetalRenderingContext::activeDOMObjectName const):
1980         (WebCore::WebMetalRenderingContext::canSuspendForDocumentSuspension const):
1981         (WebCore::WebMetalRenderingContext::platformLayer const):
1982         (WebCore::WebMetalRenderingContext::markLayerComposited):
1983         (WebCore::WebMetalRenderingContext::reshape):
1984         (WebCore::WebMetalRenderingContext::createLibrary):
1985         (WebCore::WebMetalRenderingContext::createRenderPipelineState):
1986         (WebCore::WebMetalRenderingContext::createDepthStencilState):
1987         (WebCore::WebMetalRenderingContext::createComputePipelineState):
1988         (WebCore::WebMetalRenderingContext::createCommandQueue):
1989         (WebCore::WebMetalRenderingContext::nextDrawable):
1990         (WebCore::WebMetalRenderingContext::createBuffer):
1991         (WebCore::WebMetalRenderingContext::createTexture):
1992         * html/canvas/WebMetalRenderingContext.h: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.h.
1993         * html/canvas/WebMetalRenderingContext.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.idl.
1994         * html/canvas/WebMetalSize.h: Renamed from Source/WebCore/html/canvas/WebGPUSize.h.
1995         * html/canvas/WebMetalSize.idl: Renamed from Source/WebCore/html/canvas/WebGPUSize.idl.
1996         * html/canvas/WebMetalTexture.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTexture.cpp.
1997         (WebCore::WebMetalTexture::create):
1998         (WebCore::WebMetalTexture::WebMetalTexture):
1999         * html/canvas/WebMetalTexture.h: Renamed from Source/WebCore/html/canvas/WebGPUTexture.h.
2000         * html/canvas/WebMetalTexture.idl: Renamed from Source/WebCore/html/canvas/WebGPUTexture.idl.
2001         * html/canvas/WebMetalTextureDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.cpp.
2002         (WebCore::WebMetalTextureDescriptor::create):
2003         (WebCore::WebMetalTextureDescriptor::WebMetalTextureDescriptor):
2004         (WebCore::WebMetalTextureDescriptor::width const):
2005         (WebCore::WebMetalTextureDescriptor::setWidth):
2006         (WebCore::WebMetalTextureDescriptor::height const):
2007         (WebCore::WebMetalTextureDescriptor::setHeight):
2008         (WebCore::WebMetalTextureDescriptor::sampleCount const):
2009         (WebCore::WebMetalTextureDescriptor::setSampleCount):
2010         (WebCore::WebMetalTextureDescriptor::textureType const):
2011         (WebCore::WebMetalTextureDescriptor::setTextureType):
2012         (WebCore::WebMetalTextureDescriptor::storageMode const):
2013         (WebCore::WebMetalTextureDescriptor::setStorageMode):
2014         (WebCore::WebMetalTextureDescriptor::usage const):
2015         (WebCore::WebMetalTextureDescriptor::setUsage):
2016         * html/canvas/WebMetalTextureDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.h.
2017         * html/canvas/WebMetalTextureDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.idl.
2018         * inspector/InspectorCanvas.cpp:
2019         (WebCore::InspectorCanvas::buildObjectForCanvas):
2020         * inspector/agents/InspectorCanvasAgent.cpp:
2021         (WebCore::InspectorCanvasAgent::requestContent):
2022         (WebCore::contextAsScriptValue):
2023         * page/RuntimeEnabledFeatures.h:
2024         (WebCore::RuntimeEnabledFeatures::setWebMetalEnabled):
2025         (WebCore::RuntimeEnabledFeatures::webMetalEnabled const):
2026         (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): Deleted.
2027         (WebCore::RuntimeEnabledFeatures::webGPUEnabled const): Deleted.
2028         * platform/Logging.h:
2029         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2030         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2031         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2032         * platform/graphics/cocoa/WebMetalLayer.h: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.h.
2033         * platform/graphics/cocoa/WebMetalLayer.mm: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm.
2034         (-[WebMetalLayer initWithGPUDevice:]):
2035         * platform/graphics/gpu/GPUBuffer.cpp:
2036         (WebCore::GPUBuffer::~GPUBuffer):
2037         * platform/graphics/gpu/GPUBuffer.h:
2038         * platform/graphics/gpu/GPUCommandBuffer.cpp:
2039         (WebCore::GPUCommandBuffer::~GPUCommandBuffer):
2040         * platform/graphics/gpu/GPUCommandBuffer.h:
2041         * platform/graphics/gpu/GPUCommandQueue.cpp:
2042         (WebCore::GPUCommandQueue::~GPUCommandQueue):
2043         * platform/graphics/gpu/GPUCommandQueue.h:
2044         * platform/graphics/gpu/GPUComputeCommandEncoder.cpp:
2045         (WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
2046         * platform/graphics/gpu/GPUComputeCommandEncoder.h:
2047         * platform/graphics/gpu/GPUComputePipelineState.cpp:
2048         (WebCore::GPUComputePipelineState::~GPUComputePipelineState):
2049         * platform/graphics/gpu/GPUComputePipelineState.h:
2050         * platform/graphics/gpu/GPUDepthStencilDescriptor.cpp:
2051         (WebCore::GPUDepthStencilDescriptor::~GPUDepthStencilDescriptor):
2052         * platform/graphics/gpu/GPUDepthStencilDescriptor.h:
2053         * platform/graphics/gpu/GPUDepthStencilState.cpp:
2054         (WebCore::GPUDepthStencilState::~GPUDepthStencilState):
2055         * platform/graphics/gpu/GPUDepthStencilState.h:
2056         * platform/graphics/gpu/GPUDevice.cpp:
2057         (WebCore::GPUDevice::~GPUDevice):
2058         * platform/graphics/gpu/GPUDevice.h:
2059         (WebCore::GPUDevice::layer const):
2060         * platform/graphics/gpu/GPUDrawable.cpp:
2061         (WebCore::GPUDrawable::~GPUDrawable):
2062         * platform/graphics/gpu/GPUDrawable.h:
2063         * platform/graphics/gpu/GPUEnums.h:
2064         * platform/graphics/gpu/GPUFunction.cpp:
2065         (WebCore::GPUFunction::~GPUFunction):
2066         * platform/graphics/gpu/GPUFunction.h:
2067         * platform/graphics/gpu/GPULibrary.cpp:
2068         (WebCore::GPULibrary::~GPULibrary):
2069         * platform/graphics/gpu/GPULibrary.h:
2070         * platform/graphics/gpu/GPURenderCommandEncoder.cpp:
2071         (WebCore::GPURenderCommandEncoder::~GPURenderCommandEncoder):
2072         * platform/graphics/gpu/GPURenderCommandEncoder.h:
2073         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp:
2074         (WebCore::GPURenderPassAttachmentDescriptor::~GPURenderPassAttachmentDescriptor):
2075         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h:
2076         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp:
2077         (WebCore::GPURenderPassColorAttachmentDescriptor::~GPURenderPassColorAttachmentDescriptor):
2078         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h:
2079         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp:
2080         (WebCore::GPURenderPassDepthAttachmentDescriptor::~GPURenderPassDepthAttachmentDescriptor):
2081         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h:
2082         * platform/graphics/gpu/GPURenderPassDescriptor.cpp:
2083         (WebCore::GPURenderPassDescriptor::~GPURenderPassDescriptor):
2084         * platform/graphics/gpu/GPURenderPassDescriptor.h:
2085         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp:
2086         (WebCore::GPURenderPipelineColorAttachmentDescriptor::~GPURenderPipelineColorAttachmentDescriptor):
2087         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h:
2088         * platform/graphics/gpu/GPURenderPipelineDescriptor.cpp:
2089         (WebCore::GPURenderPipelineDescriptor::~GPURenderPipelineDescriptor):
2090         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
2091         * platform/graphics/gpu/GPURenderPipelineState.cpp:
2092         (WebCore::GPURenderPipelineState::~GPURenderPipelineState):
2093         * platform/graphics/gpu/GPURenderPipelineState.h:
2094         * platform/graphics/gpu/GPUSize.h:
2095         * platform/graphics/gpu/GPUTexture.cpp:
2096         (WebCore::GPUTexture::~GPUTexture):
2097         * platform/graphics/gpu/GPUTexture.h:
2098         * platform/graphics/gpu/GPUTextureDescriptor.cpp:
2099         (WebCore::GPUTextureDescriptor::~GPUTextureDescriptor):
2100         * platform/graphics/gpu/GPUTextureDescriptor.h:
2101         * platform/graphics/metal/GPUBufferMetal.mm:
2102         (WebCore::GPUBuffer::GPUBuffer):
2103         * platform/graphics/metal/GPUCommandBufferMetal.mm:
2104         * platform/graphics/metal/GPUCommandQueueMetal.mm:
2105         * platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
2106         * platform/graphics/metal/GPUComputePipelineStateMetal.mm:
2107         (WebCore::GPUComputePipelineState::GPUComputePipelineState):
2108         * platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
2109         * platform/graphics/metal/GPUDepthStencilStateMetal.mm:
2110         (WebCore::GPUDepthStencilState::setLabel const):
2111         * platform/graphics/metal/GPUDeviceMetal.mm:
2112         (WebCore::GPUDevice::reshape const):
2113         * platform/graphics/metal/GPUDrawableMetal.mm:
2114         (WebCore::GPUDrawable::release):
2115         * platform/graphics/metal/GPUFunctionMetal.mm:
2116         * platform/graphics/metal/GPULibraryMetal.mm:
2117         (WebCore::GPULibrary::GPULibrary):
2118         * platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
2119         (WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder):
2120         * platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
2121         * platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
2122         * platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
2123         * platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
2124         * platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
2125         * platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
2126         * platform/graphics/metal/GPURenderPipelineStateMetal.mm:
2127         (WebCore::GPURenderPipelineState::setLabel const):
2128         * platform/graphics/metal/GPUTextureDescriptorMetal.mm:
2129         * platform/graphics/metal/GPUTextureMetal.mm:
2130         (WebCore::GPUTexture::GPUTexture):
2131         * testing/InternalSettings.cpp:
2132         (WebCore::InternalSettings::Backup::Backup):
2133         (WebCore::InternalSettings::Backup::restoreTo):
2134         (WebCore::InternalSettings::setWebMetalEnabled):
2135         (WebCore::InternalSettings::setWebGPUEnabled): Deleted.
2136         * testing/InternalSettings.h:
2137         * testing/InternalSettings.idl:
2138
2139 2018-10-08  Dean Jackson  <dino@apple.com>
2140
2141         CrashTracer: backboardd at Recursion :: QuartzCore: CA::Render::Updater::prepare_sublayer0
2142         https://bugs.webkit.org/show_bug.cgi?id=190376
2143         <rdar://problem/44986520>
2144
2145         Reviewed by Tim Horton.
2146
2147         Very deep CoreAnimation layer trees can cause problems. Reduce our maximum
2148         depth from 256 to 128.
2149
2150         Modified existing test: compositing/layer-creation/deep-tree.html
2151
2152         * platform/graphics/ca/GraphicsLayerCA.cpp: Cap the depth at 128.
2153
2154 2018-10-08  Commit Queue  <commit-queue@webkit.org>
2155
2156         Unreviewed, rolling out r236941.
2157         https://bugs.webkit.org/show_bug.cgi?id=190374
2158
2159         Causing API test failures in new test (Requested by jernoble
2160         on #webkit).
2161
2162         Reverted changeset:
2163
2164         "ISOTrackEncryptionBox returns incorrect defaultKeyID"
2165         https://bugs.webkit.org/show_bug.cgi?id=190368
2166         https://trac.webkit.org/changeset/236941
2167
2168 2018-10-08  Aditya Keerthi  <akeerthi@apple.com>
2169
2170         Make <input type=color> a runtime enabled (on-by-default) feature
2171         https://bugs.webkit.org/show_bug.cgi?id=189162
2172
2173         Reviewed by Wenson Hsieh and Tim Horton.
2174
2175         Enable the build-time flag INPUT_TYPE_COLOR by default and introduce a runtime-enabled feature for input type
2176         color, also on by default.
2177
2178         Covered by rebaselining existing layout tests.
2179
2180         * Configurations/FeatureDefines.xcconfig:
2181         * html/InputType.cpp:
2182         (WebCore::createInputTypeFactoryMap):
2183         * page/RuntimeEnabledFeatures.h:
2184         (WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const):
2185         (WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled):
2186
2187 2018-10-08  Jer Noble  <jer.noble@apple.com>
2188
2189         ISOTrackEncryptionBox returns incorrect defaultKeyID
2190         https://bugs.webkit.org/show_bug.cgi?id=190368
2191
2192         Reviewed by Eric Carlson.
2193
2194         Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
2195
2196         ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
2197
2198         Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
2199
2200         * WebCore.xcodeproj/project.pbxproj:
2201         * platform/graphics/iso/ISOBox.h:
2202         * platform/graphics/iso/ISOOriginalFormatBox.h:
2203         * platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
2204         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
2205         * platform/graphics/iso/ISOSchemeInformationBox.h:
2206         * platform/graphics/iso/ISOSchemeTypeBox.h:
2207         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
2208         (WebCore::ISOTrackEncryptionBox::parse):
2209         * platform/graphics/iso/ISOTrackEncryptionBox.h:
2210
2211 2018-10-08  Antti Koivisto  <antti@apple.com>
2212
2213         Move SystemFontDatabase to a file of its own
2214         https://bugs.webkit.org/show_bug.cgi?id=190347
2215
2216         Reviewed by Chris Dumez.
2217
2218         Also rename it to SystemFontDatabaseCoreText as it is CoreText specific.
2219
2220         * SourcesCocoa.txt:
2221         * WebCore.xcodeproj/project.pbxproj:
2222         * page/MemoryRelease.cpp:
2223         (WebCore::releaseNoncriticalMemory):
2224         * page/cocoa/MemoryReleaseCocoa.mm:
2225
2226         Release SystemFontDatabaseCoreText directly from platform specific cleanup code.
2227
2228         (WebCore::platformReleaseMemory):
2229         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2230         (WebCore::FontDescription::invalidateCaches):
2231         (WebCore::systemFontCascadeList):
2232         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
2233         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
2234         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters): Deleted.
2235         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue const): Deleted.
2236         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const): Deleted.
2237         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const): Deleted.
2238         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash): Deleted.
2239         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal): Deleted.
2240         (): Deleted.
2241         (WebCore::SystemFontDatabase::singleton): Deleted.
2242         (WebCore::SystemFontDatabase::systemFontCascadeList): Deleted.
2243         (WebCore::SystemFontDatabase::clear): Deleted.
2244         (WebCore::SystemFontDatabase::SystemFontDatabase): Deleted.
2245         (WebCore::SystemFontDatabase::applyWeightItalicsAndFallbackBehavior): Deleted.
2246         (WebCore::SystemFontDatabase::removeCascadeList): Deleted.
2247         (WebCore::SystemFontDatabase::computeCascadeList): Deleted.
2248         (WebCore::systemFontParameters): Deleted.
2249         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: Added.
2250         (WebCore::SystemFontDatabaseCoreText::singleton):
2251         (WebCore::SystemFontDatabaseCoreText::SystemFontDatabaseCoreText):
2252         (WebCore::SystemFontDatabaseCoreText::systemFontCascadeList):
2253         (WebCore::SystemFontDatabaseCoreText::clear):
2254         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
2255         (WebCore::SystemFontDatabaseCoreText::removeCascadeList):
2256         (WebCore::SystemFontDatabaseCoreText::computeCascadeList):
2257         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
2258         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: Added.
2259         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParameters):
2260         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::isHashTableDeletedValue const):
2261         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const):
2262         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const):
2263         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::hash):
2264         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::equal):
2265         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2266
2267 2018-10-08  Jeremy Jones  <jeremyj@apple.com>
2268
2269         Remove dead code: VideoFullscreenModel::isVisible()
2270         https://bugs.webkit.org/show_bug.cgi?id=190356
2271
2272         Reviewed by Jon Lee.
2273
2274         No new tests because there is no behavior change.
2275
2276         Remove isVisible() since it is no longer used.
2277
2278         * platform/cocoa/VideoFullscreenModel.h:
2279         * platform/cocoa/VideoFullscreenModelVideoElement.h:
2280         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
2281         (WebCore::VideoFullscreenModelVideoElement::isVisible const): Deleted.
2282         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2283         (VideoFullscreenControllerContext::isVisible const): Deleted.
2284
2285 2018-10-08  Jeremy Jones  <jeremyj@apple.com>
2286
2287         Remove dead code: resetMediaState.
2288         https://bugs.webkit.org/show_bug.cgi?id=190355
2289
2290         Reviewed by Jon Lee.
2291
2292         No new tests because no behavior change.
2293
2294         Remove resetMediaState since it is no longer used.
2295
2296         * platform/cocoa/PlaybackSessionInterface.h:
2297         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
2298         * platform/ios/PlaybackSessionInterfaceAVKit.h:
2299         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2300         (WebCore::PlaybackSessionInterfaceAVKit::resetMediaState): Deleted.
2301         * platform/ios/WebAVPlayerController.h:
2302         * platform/ios/WebAVPlayerController.mm:
2303         (-[WebAVPlayerController resetMediaState]): Deleted.
2304         * platform/mac/PlaybackSessionInterfaceMac.h:
2305         * platform/mac/PlaybackSessionInterfaceMac.mm:
2306         (WebCore::PlaybackSessionInterfaceMac::resetMediaState): Deleted.
2307
2308 2018-10-08  Jeremy Jones  <jeremyj@apple.com>
2309
2310         Use MediaPlayerEnums::VideoGravity in VideoFullscreenModel.
2311         https://bugs.webkit.org/show_bug.cgi?id=190357
2312
2313         Reviewed by Jon Lee.
2314
2315         No new tests because no behavior change.
2316
2317         Use MediaPlayerEnums::VideoGravity instead of creating another identical enum in VideoFullscreenModel.
2318
2319         * platform/cocoa/VideoFullscreenModel.h:
2320         (): Deleted.
2321         * platform/cocoa/VideoFullscreenModelVideoElement.h:
2322         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
2323         (WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity):
2324         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2325         (-[WebAVPlayerLayer setVideoGravity:]):
2326         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2327         (VideoFullscreenControllerContext::setVideoLayerGravity):
2328         * platform/mac/VideoFullscreenInterfaceMac.mm:
2329         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
2330         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2331
2332 2018-10-08  Devin Rousso  <drousso@apple.com>
2333
2334         Web Inspector: group media network entries by the node that triggered the request
2335         https://bugs.webkit.org/show_bug.cgi?id=189606
2336         <rdar://problem/44438527>
2337
2338         Reviewed by Brian Burg.
2339
2340         Test: http/tests/inspector/network/resource-initiatorNode.html
2341
2342         Add extra arguments to functions that create `ResourceRequest` objects for media resources so
2343         that `initiatorNodeIdentifier` can be set for WebInspector frontend to use for grouping.
2344
2345         * html/HTMLMediaElement.cpp:
2346         (WebCore::HTMLMediaElement::loadResource):
2347         * html/HTMLVideoElement.cpp:
2348         (WebCore::HTMLVideoElement::setDisplayMode):
2349         * loader/FrameLoader.h:
2350         * loader/FrameLoader.cpp:
2351         (WebCore::FrameLoader::willLoadMediaElementURL):
2352         Handles initial (e.g. DNT) resource requests.
2353
2354         * loader/ImageLoader.cpp:
2355         (ImageLoader::updateFromElement):
2356         Handles "poster" requests.
2357
2358         * loader/MediaResourceLoader.cpp:
2359         (MediaResourceLoader::requestResource):
2360         Handles byte-range requests.
2361
2362         * html/track/LoadableTextTrack.cpp:
2363         (WebCore::LoadableTextTrack::loadTimerFired):
2364         * loader/TextTrackLoader.h:
2365         * loader/TextTrackLoader.cpp:
2366         (WebCore::TextTrackLoader::load):
2367         * html/HTMLTrackElement.h:
2368         Handles <track> (e.g. subtitle) requests.
2369
2370         * inspector/agents/InspectorDOMAgent.cpp:
2371         (WebCore::InspectorDOMAgent::identifierForNode):
2372         * inspector/InspectorInstrumentation.h:
2373         (WebCore::InspectorInstrumentation::identifierForNode):
2374         * inspector/InspectorInstrumentation.cpp:
2375         (WebCore::InspectorInstrumentation::identifierForNodeImpl):
2376         Allows callers to get a `DOM.nodeId` for the given `Node`, which is (in this patch) attached
2377         to the `ResourceRequest` and later used by `InspectorNetworkAgent`.
2378
2379         * inspector/agents/InspectorNetworkAgent.h:
2380         * inspector/agents/InspectorNetworkAgent.cpp:
2381         (WebCore::InspectorNetworkAgent::willSendRequest):
2382         (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
2383         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
2384
2385         * platform/network/ResourceRequestBase.h:
2386         (WebCore::ResourceRequestBase::initiatorNodeIdentifier const):
2387         (WebCore::ResourceRequestBase::setInitiatorNodeIdentifier):
2388         * platform/network/ResourceRequestBase.cpp:
2389         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
2390         * platform/network/cf/ResourceRequestCFNet.cpp:
2391         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
2392         * loader/cache/CachedResourceLoader.cpp:
2393         (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
2394
2395         * inspector/InspectorCanvas.h:
2396         * inspector/InspectorCanvas.cpp:
2397         (WebCore::InspectorCanvas::buildObjectForCanvas):
2398         * inspector/agents/InspectorCanvasAgent.cpp:
2399         (WebCore::InspectorCanvasAgent::enable):
2400         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
2401         Don't try to push the canvas' node to the frontend, as this will create a dangling node in
2402         `InspectorDOMAgent` if the canvas' node is detached from the DOM.
2403
2404 2018-10-08  Andy Estes  <aestes@apple.com>
2405
2406         [Payment Request] Requests should be aborted after details settle when the user cancels
2407         https://bugs.webkit.org/show_bug.cgi?id=190333
2408
2409         Reviewed by Alex Christensen.
2410
2411         In Payment Request's "update a PaymentRequest's details" algorithm, user agents are expected
2412         to disable the payment UI when PaymentRequest details are being updated by the merchant.
2413         This is to prevent the user from accepting a payment before updated details are displayed.
2414
2415         Further, Payment Request's "user aborts the payment request" algorithm says that the
2416         algorithm should be terminated prior to throwing an AbortError if the request is currently
2417         being updated, and also that user agents SHOULD ensure this never occurs. This is based on
2418         the assumption that payment UIs are disabled during details updates.
2419
2420         For Apple Pay, while it is true that a payment cannot be accepted by the user while details
2421         are being updated by the merchant, the payment UI is not completely disabled. In particular,
2422         the user is allowed to abort the payment while details are being updated. We need to honor
2423         the user's request to abort without doing so in the middle of a details update.
2424
2425         This patch defers a user-initiated abort until after details are settled, at which point the
2426         promise returned by show() is rejected with an AbortError. This behaves as if the details
2427         update promise were rejected by the merchant.
2428
2429         Added a test case to http/tests/paymentrequest/payment-request-show-method.https.html.
2430
2431         * Modules/paymentrequest/PaymentRequest.cpp:
2432         (WebCore::PaymentRequest::settleDetailsPromise):
2433         (WebCore::PaymentRequest::whenDetailsSettled):
2434         (WebCore::PaymentRequest::cancel):
2435         * Modules/paymentrequest/PaymentRequest.h:
2436
2437 2018-10-08  Chris Dumez  <cdumez@apple.com>
2438
2439         Have DOMWindowProperty get is frame from its associated DOMWindow
2440         https://bugs.webkit.org/show_bug.cgi?id=190341
2441
2442         Reviewed by Alex Christensen.
2443
2444         Have DOMWindowProperty get is frame from its associated DOMWindow, instead of having its own
2445         m_frame that can potentially get out-of-sync.
2446
2447         * Modules/cache/DOMWindowCaches.cpp:
2448         (WebCore::DOMWindowCaches::DOMWindowCaches):
2449         * Modules/geolocation/NavigatorGeolocation.cpp:
2450         (WebCore::NavigatorGeolocation::NavigatorGeolocation):
2451         (WebCore::NavigatorGeolocation::from):
2452         * Modules/geolocation/NavigatorGeolocation.h:
2453         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2454         (WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
2455         * Modules/mediastream/NavigatorMediaDevices.cpp:
2456         (WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
2457         (WebCore::NavigatorMediaDevices::from):
2458         * Modules/mediastream/NavigatorMediaDevices.h:
2459         * Modules/quota/DOMWindowQuota.cpp:
2460         (WebCore::DOMWindowQuota::DOMWindowQuota):
2461         * Modules/quota/NavigatorStorageQuota.cpp:
2462         (WebCore::NavigatorStorageQuota::NavigatorStorageQuota):
2463         * Modules/quota/NavigatorStorageQuota.h:
2464         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
2465         (WebCore::DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis):
2466         * css/StyleMedia.cpp:
2467         (WebCore::StyleMedia::StyleMedia):
2468         (WebCore::StyleMedia::type const):
2469         (WebCore::StyleMedia::matchMedium const):
2470         * css/StyleMedia.h:
2471         * loader/appcache/DOMApplicationCache.cpp:
2472         (WebCore::DOMApplicationCache::DOMApplicationCache):
2473         (WebCore::DOMApplicationCache::applicationCacheHost const):
2474         (WebCore::DOMApplicationCache::scriptExecutionContext const):
2475         * loader/appcache/DOMApplicationCache.h:
2476         * page/BarProp.cpp:
2477         (WebCore::BarProp::BarProp):
2478         (WebCore::BarProp::visible const):
2479         * page/BarProp.h:
2480         (WebCore::BarProp::create):
2481         * page/DOMSelection.cpp:
2482         (WebCore::DOMSelection::DOMSelection):
2483         (WebCore::DOMSelection::visibleSelection const):
2484         (WebCore::DOMSelection::anchorNode const):
2485         (WebCore::DOMSelection::anchorOffset const):
2486         (WebCore::DOMSelection::focusNode const):
2487         (WebCore::DOMSelection::focusOffset const):
2488         (WebCore::DOMSelection::baseNode const):
2489         (WebCore::DOMSelection::baseOffset const):
2490         (WebCore::DOMSelection::extentNode const):
2491         (WebCore::DOMSelection::extentOffset const):
2492         (WebCore::DOMSelection::isCollapsed const):
2493         (WebCore::DOMSelection::type const):
2494         (WebCore::DOMSelection::rangeCount const):
2495         (WebCore::DOMSelection::collapse):
2496         (WebCore::DOMSelection::collapseToEnd):
2497         (WebCore::DOMSelection::collapseToStart):
2498         (WebCore::DOMSelection::empty):
2499         (WebCore::DOMSelection::setBaseAndExtent):
2500         (WebCore::DOMSelection::setPosition):
2501         (WebCore::DOMSelection::modify):
2502         (WebCore::DOMSelection::extend):
2503         (WebCore::DOMSelection::getRangeAt):
2504         (WebCore::DOMSelection::removeAllRanges):
2505         (WebCore::DOMSelection::addRange):
2506         (WebCore::DOMSelection::deleteFromDocument):
2507         (WebCore::DOMSelection::containsNode const):
2508         (WebCore::DOMSelection::toString):
2509         (WebCore::DOMSelection::shadowAdjustedNode const):
2510         (WebCore::DOMSelection::shadowAdjustedOffset const):
2511         (WebCore::DOMSelection::isValidForPosition const):
2512         * page/DOMSelection.h:
2513         (WebCore::DOMSelection::create):
2514         * page/DOMWindow.cpp:
2515         (WebCore::DOMWindow::screen):
2516         (WebCore::DOMWindow::history):
2517         (WebCore::DOMWindow::locationbar):
2518         (WebCore::DOMWindow::menubar):
2519         (WebCore::DOMWindow::personalbar):
2520         (WebCore::DOMWindow::scrollbars):
2521         (WebCore::DOMWindow::statusbar):
2522         (WebCore::DOMWindow::toolbar):
2523         (WebCore::DOMWindow::applicationCache):
2524         (WebCore::DOMWindow::navigator):
2525         (WebCore::DOMWindow::location):
2526         (WebCore::DOMWindow::visualViewport):
2527         (WebCore::DOMWindow::webkitNamespace):
2528         (WebCore::DOMWindow::getSelection):
2529         (WebCore::DOMWindow::styleMedia):
2530         * page/DOMWindow.h:
2531         * page/DOMWindowExtension.cpp:
2532         (WebCore::DOMWindowExtension::DOMWindowExtension):
2533         * page/DOMWindowExtension.h:
2534         (WebCore::DOMWindowExtension::create):
2535         * page/DOMWindowProperty.cpp:
2536         (WebCore::DOMWindowProperty::DOMWindowProperty):
2537         (WebCore::DOMWindowProperty::~DOMWindowProperty):
2538         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
2539         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
2540         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
2541         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
2542         (WebCore::DOMWindowProperty::willDetachGlobalObjectFromFrame):
2543         (WebCore::DOMWindowProperty::frame const):
2544         * page/DOMWindowProperty.h:
2545         (WebCore::DOMWindowProperty::window const):
2546         * page/History.cpp:
2547         (WebCore::History::History):
2548         (WebCore::History::length const):
2549         (WebCore::History::scrollRestoration const):
2550         (WebCore::History::setScrollRestoration):
2551         (WebCore::History::stateInternal const):
2552         (WebCore::History::go):
2553         (WebCore::History::urlForState):
2554         (WebCore::History::stateObjectAdded):
2555         * page/History.h:
2556         * page/Location.cpp:
2557         (WebCore::Location::Location):
2558         (WebCore::Location::url const):
2559         (WebCore::Location::href const):
2560         (WebCore::Location::protocol const):
2561         (WebCore::Location::host const):
2562         (WebCore::Location::hostname const):
2563         (WebCore::Location::port const):
2564         (WebCore::Location::pathname const):
2565         (WebCore::Location::search const):
2566         (WebCore::Location::origin const):
2567         (WebCore::Location::ancestorOrigins const):
2568         (WebCore::Location::hash const):
2569         (WebCore::Location::setHref):
2570         (WebCore::Location::setProtocol):
2571         (WebCore::Location::setHost):
2572         (WebCore::Location::setHostname):
2573         (WebCore::Location::setPort):
2574         (WebCore::Location::setPathname):
2575         (WebCore::Location::setSearch):
2576         (WebCore::Location::setHash):
2577         (WebCore::Location::assign):
2578         (WebCore::Location::replace):
2579         (WebCore::Location::reload):
2580         (WebCore::Location::setLocation):
2581         * page/Location.h:
2582         (WebCore::Location::create):
2583         * page/Navigator.cpp:
2584         (WebCore::Navigator::Navigator):
2585         (WebCore::Navigator::appVersion const):
2586         (WebCore::Navigator::userAgent const):
2587         (WebCore::Navigator::share):
2588         (WebCore::Navigator::plugins):
2589         (WebCore::Navigator::mimeTypes):
2590         (WebCore::Navigator::cookieEnabled const):
2591         (WebCore::Navigator::javaEnabled const):
2592         (WebCore::Navigator::standalone const):
2593         * page/Navigator.h:
2594         * page/Performance.cpp:
2595         (WebCore::Performance::navigation):
2596         (WebCore::Performance::timing):
2597         * page/PerformanceNavigation.cpp:
2598         (WebCore::PerformanceNavigation::PerformanceNavigation):
2599         (WebCore::PerformanceNavigation::type const):
2600         (WebCore::PerformanceNavigation::redirectCount const):
2601         * page/PerformanceNavigation.h:
2602         (WebCore::PerformanceNavigation::create):
2603         * page/PerformanceTiming.cpp:
2604         (WebCore::PerformanceTiming::PerformanceTiming):
2605         (WebCore::PerformanceTiming::documentLoader const):
2606         (WebCore::PerformanceTiming::documentTiming const):
2607         * page/PerformanceTiming.h:
2608         (WebCore::PerformanceTiming::create):
2609         * page/Screen.cpp:
2610         (WebCore::Screen::Screen):
2611         (WebCore::Screen::height const):
2612         (WebCore::Screen::width const):
2613         (WebCore::Screen::colorDepth const):
2614         (WebCore::Screen::pixelDepth const):
2615         (WebCore::Screen::availLeft const):
2616         (WebCore::Screen::availTop const):
2617         (WebCore::Screen::availHeight const):
2618         (WebCore::Screen::availWidth const):
2619         * page/Screen.h:
2620         * page/VisualViewport.cpp:
2621         (WebCore::VisualViewport::VisualViewport):
2622         (WebCore::VisualViewport::scriptExecutionContext const):
2623         (WebCore::VisualViewport::addEventListener):
2624         (WebCore::VisualViewport::updateFrameLayout const):
2625         (WebCore::VisualViewport::offsetLeft const):
2626         (WebCore::VisualViewport::offsetTop const):
2627         (WebCore::VisualViewport::pageLeft const):
2628         (WebCore::VisualViewport::pageTop const):
2629         (WebCore::VisualViewport::width const):
2630         (WebCore::VisualViewport::height const):
2631         (WebCore::VisualViewport::scale const):
2632         (WebCore::VisualViewport::update):
2633         (WebCore::VisualViewport::enqueueResizeEvent):
2634         (WebCore::VisualViewport::enqueueScrollEvent):
2635         * page/VisualViewport.h:
2636         * page/WebKitNamespace.cpp:
2637         (WebCore::WebKitNamespace::WebKitNamespace):
2638         * page/WebKitNamespace.h:
2639         (WebCore::WebKitNamespace::create):
2640         * plugins/DOMMimeTypeArray.cpp:
2641         (WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
2642         (WebCore::DOMMimeTypeArray::item):
2643         (WebCore::DOMMimeTypeArray::namedItem):
2644         (WebCore::DOMMimeTypeArray::getPluginData const):
2645         * plugins/DOMMimeTypeArray.h:
2646         (WebCore::DOMMimeTypeArray::create):
2647         * plugins/DOMPluginArray.cpp:
2648         (WebCore::DOMPluginArray::DOMPluginArray):
2649         (WebCore::DOMPluginArray::item):
2650         (WebCore::DOMPluginArray::namedItem):
2651         (WebCore::DOMPluginArray::refresh):
2652         (WebCore::DOMPluginArray::pluginData const):
2653         * plugins/DOMPluginArray.h:
2654         (WebCore::DOMPluginArray::create):
2655         * storage/Storage.cpp:
2656         (WebCore::Storage::create):
2657         (WebCore::Storage::Storage):
2658         (WebCore::Storage::setItem):
2659         (WebCore::Storage::removeItem):
2660         (WebCore::Storage::clear):
2661         * storage/Storage.h:
2662
2663 2018-10-08  Antti Koivisto  <antti@apple.com>
2664
2665         Move FontCascadeDescription to a file of its own
2666         https://bugs.webkit.org/show_bug.cgi?id=190348
2667
2668         Reviewed by Chris Dumez.
2669
2670         * Sources.txt:
2671         * WebCore.xcodeproj/project.pbxproj:
2672         * platform/graphics/FontCascade.h:
2673         * platform/graphics/FontCascadeDescription.cpp: Copied from Source/WebCore/platform/graphics/FontDescription.cpp.
2674         (WebCore::FontDescription::FontDescription): Deleted.
2675         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
2676         (WebCore::FontDescription::setLocale): Deleted.
2677         (WebCore::FontDescription::invalidateCaches): Deleted.
2678         * platform/graphics/FontCascadeDescription.h: Copied from Source/WebCore/platform/graphics/FontDescription.h.
2679         (WebCore::FontDescription::operator!= const): Deleted.
2680         (WebCore::FontDescription::computedSize const): Deleted.
2681         (WebCore::FontDescription::computedPixelSize const): Deleted.
2682         (WebCore::FontDescription::italic const): Deleted.
2683         (WebCore::FontDescription::stretch const): Deleted.
2684         (WebCore::FontDescription::weight const): Deleted.
2685         (WebCore::FontDescription::fontSelectionRequest const): Deleted.
2686         (WebCore::FontDescription::renderingMode const): Deleted.
2687         (WebCore::FontDescription::textRenderingMode const): Deleted.
2688         (WebCore::FontDescription::script const): Deleted.
2689         (WebCore::FontDescription::locale const): Deleted.
2690         (WebCore::FontDescription::orientation const): Deleted.
2691         (WebCore::FontDescription::nonCJKGlyphOrientation const): Deleted.
2692         (WebCore::FontDescription::widthVariant const): Deleted.
2693         (WebCore::FontDescription::featureSettings const): Deleted.
2694         (WebCore::FontDescription::variationSettings const): Deleted.
2695         (WebCore::FontDescription::fontSynthesis const): Deleted.
2696         (WebCore::FontDescription::variantCommonLigatures const): Deleted.
2697         (WebCore::FontDescription::variantDiscretionaryLigatures const): Deleted.
2698         (WebCore::FontDescription::variantHistoricalLigatures const): Deleted.
2699         (WebCore::FontDescription::variantContextualAlternates const): Deleted.
2700         (WebCore::FontDescription::variantPosition const): Deleted.
2701         (WebCore::FontDescription::variantCaps const): Deleted.
2702         (WebCore::FontDescription::variantNumericFigure const): Deleted.
2703         (WebCore::FontDescription::variantNumericSpacing const): Deleted.
2704         (WebCore::FontDescription::variantNumericFraction const): Deleted.
2705         (WebCore::FontDescription::variantNumericOrdinal const): Deleted.
2706         (WebCore::FontDescription::variantNumericSlashedZero const): Deleted.
2707         (WebCore::FontDescription::variantAlternates const): Deleted.
2708         (WebCore::FontDescription::variantEastAsianVariant const): Deleted.
2709         (WebCore::FontDescription::variantEastAsianWidth const): Deleted.
2710         (WebCore::FontDescription::variantEastAsianRuby const): Deleted.
2711         (WebCore::FontDescription::variantSettings const): Deleted.
2712         (WebCore::FontDescription::opticalSizing const): Deleted.
2713         (WebCore::FontDescription::fontStyleAxis const): Deleted.
2714         (WebCore::FontDescription::shouldAllowUserInstalledFonts const): Deleted.
2715         (WebCore::FontDescription::setComputedSize): Deleted.
2716         (WebCore::FontDescription::setItalic): Deleted.
2717         (WebCore::FontDescription::setStretch): Deleted.
2718         (WebCore::FontDescription::setIsItalic): Deleted.
2719         (WebCore::FontDescription::setWeight): Deleted.
2720         (WebCore::FontDescription::setRenderingMode): Deleted.
2721         (WebCore::FontDescription::setTextRenderingMode): Deleted.
2722         (WebCore::FontDescription::setOrientation): Deleted.
2723         (WebCore::FontDescription::setNonCJKGlyphOrientation): Deleted.
2724         (WebCore::FontDescription::setWidthVariant): Deleted.
2725         (WebCore::FontDescription::setFeatureSettings): Deleted.
2726         (WebCore::FontDescription::setVariationSettings): Deleted.
2727         (WebCore::FontDescription::setFontSynthesis): Deleted.
2728         (WebCore::FontDescription::setVariantCommonLigatures): Deleted.
2729         (WebCore::FontDescription::setVariantDiscretionaryLigatures): Deleted.
2730         (WebCore::FontDescription::setVariantHistoricalLigatures): Deleted.
2731         (WebCore::FontDescription::setVariantContextualAlternates): Deleted.
2732         (WebCore::FontDescription::setVariantPosition): Deleted.
2733         (WebCore::FontDescription::setVariantCaps): Deleted.
2734         (WebCore::FontDescription::setVariantNumericFigure): Deleted.
2735         (WebCore::FontDescription::setVariantNumericSpacing): Deleted.
2736         (WebCore::FontDescription::setVariantNumericFraction): Deleted.
2737         (WebCore::FontDescription::setVariantNumericOrdinal): Deleted.
2738         (WebCore::FontDescription::setVariantNumericSlashedZero): Deleted.
2739         (WebCore::FontDescription::setVariantAlternates): Deleted.
2740         (WebCore::FontDescription::setVariantEastAsianVariant): Deleted.
2741         (WebCore::FontDescription::setVariantEastAsianWidth): Deleted.
2742         (WebCore::FontDescription::setVariantEastAsianRuby): Deleted.
2743         (WebCore::FontDescription::setOpticalSizing): Deleted.
2744         (WebCore::FontDescription::setFontStyleAxis): Deleted.
2745         (WebCore::FontDescription::setShouldAllowUserInstalledFonts): Deleted.
2746         (WebCore::FontDescription::operator== const): Deleted.
2747         * platform/graphics/FontDescription.cpp:
2748         (WebCore::FontDescription::invalidateCaches):
2749         (WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.
2750         (WebCore::FontCascadeDescription::effectiveFamilyCount const): Deleted.
2751         (WebCore::FontCascadeDescription::effectiveFamilyAt const): Deleted.
2752         (WebCore::FontCascadeDescription::lighterWeight): Deleted.
2753         (WebCore::FontCascadeDescription::bolderWeight): Deleted.
2754         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing const): Deleted.
2755         (WebCore::FontCascadeDescription::familyNamesAreEqual): Deleted.
2756         (WebCore::FontCascadeDescription::familyNameHash): Deleted.
2757         (WebCore::FontCascadeDescription::foldedFamilyName): Deleted.
2758         * platform/graphics/FontDescription.h:
2759         (WebCore::FontCascadeDescription::operator!= const): Deleted.
2760         (WebCore::FontCascadeDescription::familyCount const): Deleted.
2761         (WebCore::FontCascadeDescription::firstFamily const): Deleted.
2762         (WebCore::FontCascadeDescription::familyAt const): Deleted.
2763         (WebCore::FontCascadeDescription::families const): Deleted.
2764         (WebCore::FontCascadeDescription::specifiedSize const): Deleted.
2765         (WebCore::FontCascadeDescription::isAbsoluteSize const): Deleted.
2766         (WebCore::FontCascadeDescription::lighterWeight const): Deleted.
2767         (WebCore::FontCascadeDescription::bolderWeight const): Deleted.
2768         (WebCore::FontCascadeDescription::useFixedDefaultSize const): Deleted.
2769         (WebCore::FontCascadeDescription::kerning const): Deleted.
2770         (WebCore::FontCascadeDescription::keywordSize const): Deleted.
2771         (WebCore::FontCascadeDescription::keywordSizeAsIdentifier const): Deleted.
2772         (WebCore::FontCascadeDescription::fontSmoothing const): Deleted.
2773         (WebCore::FontCascadeDescription::isSpecifiedFont const): Deleted.
2774         (WebCore::FontCascadeDescription::setOneFamily): Deleted.
2775         (WebCore::FontCascadeDescription::setFamilies): Deleted.
2776         (WebCore::FontCascadeDescription::setSpecifiedSize): Deleted.
2777         (WebCore::FontCascadeDescription::setIsAbsoluteSize): Deleted.
2778         (WebCore::FontCascadeDescription::setKerning): Deleted.
2779         (WebCore::FontCascadeDescription::setKeywordSize): Deleted.
2780         (WebCore::FontCascadeDescription::setKeywordSizeFromIdentifier): Deleted.
2781         (WebCore::FontCascadeDescription::setFontSmoothing): Deleted.
2782         (WebCore::FontCascadeDescription::setIsSpecifiedFont): Deleted.
2783         (WebCore::FontCascadeDescription::equalForTextAutoSizing const): Deleted.
2784         (WebCore::FontCascadeDescription::initialItalic): Deleted.
2785         (WebCore::FontCascadeDescription::initialFontStyleAxis): Deleted.
2786         (WebCore::FontCascadeDescription::initialWeight): Deleted.
2787         (WebCore::FontCascadeDescription::initialStretch): Deleted.
2788         (WebCore::FontCascadeDescription::initialSmallCaps): Deleted.
2789         (WebCore::FontCascadeDescription::initialKerning): Deleted.
2790         (WebCore::FontCascadeDescription::initialFontSmoothing): Deleted.
2791         (WebCore::FontCascadeDescription::initialTextRenderingMode): Deleted.
2792         (WebCore::FontCascadeDescription::initialFontSynthesis): Deleted.
2793         (WebCore::FontCascadeDescription::initialVariantPosition): Deleted.
2794         (WebCore::FontCascadeDescription::initialVariantCaps): Deleted.
2795         (WebCore::FontCascadeDescription::initialVariantAlternates): Deleted.
2796         (WebCore::FontCascadeDescription::initialOpticalSizing): Deleted.
2797         (WebCore::FontCascadeDescription::initialLocale): Deleted.
2798         (WebCore::FontCascadeDescription::operator== const): Deleted.
2799         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2800         * rendering/style/RenderStyle.h:
2801
2802 2018-10-08  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2803
2804         [EME][GStreamer] Add support for WebM encrypted caps "application/x-webm-enc"
2805         https://bugs.webkit.org/show_bug.cgi?id=189239
2806
2807         Reviewed by Xabier Rodriguez-Calvar.
2808
2809         Add the support of GStreamer caps "application/x-webm-enc" in GStreamerCommon.
2810
2811         The DRM system id field in the encrypted event is set to GST_PROTECTION_UNSPECIFIED_SYSTEM_ID
2812         in case of WebM, for details, see https://bugzilla.gnome.org/attachment.cgi?id=365211.
2813
2814         Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-eventmse.html
2815                media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html
2816
2817         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2818         (WebCore::capsMediaType):
2819         (WebCore::areEncryptedCaps):
2820         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2821         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
2822         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2823         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2824         (webkitMediaCommonEncryptionDecryptTransformCaps):
2825
2826 2018-10-07  Dan Bernstein  <mitz@apple.com>
2827
2828         Fixed building with the latest macOS SDK
2829
2830         * platform/graphics/cocoa/IOSurface.mm:
2831         (WebCore::IOSurface::ensurePlatformContext): Suppressed deprecation warnings around use of
2832           CGIOSurfaceContextSetDisplayMask.
2833
2834 2018-10-06  Justin Michaud  <justin_michaud@apple.com>
2835
2836         Properly determine if css custom property values are computationally independent
2837         https://bugs.webkit.org/show_bug.cgi?id=190303
2838
2839         Reviewed by Antti Koivisto.
2840
2841         Add getDirectComputationalDependencies method to determine if a value is computationally
2842         dependent. Use this method in CSS.registerProperty to replace existing substring checks.
2843         No new tests are needed because the existing tests cover this behaviour.
2844
2845         * css/CSSCalculationValue.cpp:
2846         (WebCore::determineCategory):
2847         * css/CSSCalculationValue.h:
2848         (WebCore::CSSCalcValue::getDirectComputationalDependencies const):
2849         (WebCore::CSSCalcValue::getDirectRootComputationalDependencies const):
2850         * css/CSSCustomPropertyValue.cpp:
2851         (WebCore::CSSCustomPropertyValue::customCSSText const):
2852         (WebCore::CSSCustomPropertyValue::tokens const):
2853         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
2854         * css/CSSCustomPropertyValue.h:
2855         * css/CSSPrimitiveValue.cpp:
2856         (WebCore::CSSPrimitiveValue::getDirectComputationalDependencies const):
2857         (WebCore::CSSPrimitiveValue::getDirectRootComputationalDependencies const):
2858         * css/CSSPrimitiveValue.h:
2859         * css/CSSValue.cpp:
2860         (WebCore::CSSValue::getDirectComputationalDependencies const):
2861         (WebCore::CSSValue::getDirectRootComputationalDependencies const):
2862         * css/CSSValue.h:
2863         * css/CSSVariableData.cpp:
2864         (WebCore::CSSVariableData::CSSVariableData):
2865         (WebCore::CSSVariableData::resolveVariableReference const):
2866         * css/DOMCSSRegisterCustomProperty.cpp:
2867         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2868
2869 2018-10-05  Chris Dumez  <cdumez@apple.com>
2870
2871         Regression(r236862): Crash under DOMWindowExtension::willDetachGlobalObjectFromFrame()
2872         https://bugs.webkit.org/show_bug.cgi?id=190320
2873         <rdar://problem/45044814>
2874
2875         Reviewed by Geoffrey Garen.
2876
2877         r236862 caused DOMWindowProperty::willDetachGlobalObjectFromFrame() to get called several
2878         times. There was no effect for most DOMWindowProperty objects. However, it would cause
2879         crashes for DOMWindowExtension objects, which subclass DOMWindowProperty and override
2880         DOMWindowProperty::willDetachGlobalObjectFromFrame() because they dereference the frame
2881         without null checking it.
2882
2883         To address the issue, we now make sure DOMWindowProperty::willDetachGlobalObjectFromFrame()
2884         is not called several times.
2885
2886         * dom/Document.cpp:
2887         (WebCore::Document::detachFromFrame):
2888         Stop calling DOMWindow::willDetachDocumentFromFrame() here as most call sites already
2889         take care of calling DOMWindow::willDetachDocumentFromFrame() beforehand (e.g.
2890         Document::prepareForDestruction()).
2891         Also, return early if the Document is already detached from its frame.
2892
2893         (WebCore::Document::frameWasDisconnectedFromOwner):
2894         Add new utility function called when a Frame is disconnected from its owner which
2895         calls both Document::detachFromFrame() and DOMWindow::willDetachDocumentFromFrame().
2896
2897         * dom/Document.h:
2898         * page/DOMWindow.cpp:
2899         (WebCore::DOMWindow::willDetachDocumentFromFrame):
2900         Return early if the Window is already detached from its frame.
2901
2902         * page/Frame.cpp:
2903         (WebCore::Frame::disconnectOwnerElement):
2904
2905 2018-10-05  Jer Noble  <jer.noble@apple.com>
2906
2907         Further unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
2908
2909         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2910         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
2911
2912 2018-10-05  Jer Noble  <jer.noble@apple.com>
2913
2914        Unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
2915
2916         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2917         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
2918
2919 2018-10-05  Eric Carlson  <eric.carlson@apple.com>
2920
2921         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
2922         https://bugs.webkit.org/show_bug.cgi?id=190142
2923         <rdar://problem/44911109>
2924
2925         Reviewed by Youenn Fablet.
2926
2927         No new tests, covered by existing tests.
2928
2929         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2930         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
2931         to base class.
2932
2933         * Modules/mediastream/MediaDevicesRequest.cpp:
2934         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
2935         as passed salt.
2936
2937         * Modules/mediastream/MediaStreamTrack.cpp:
2938         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
2939         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
2940         * Modules/mediastream/MediaStreamTrack.h:
2941         * Modules/mediastream/MediaStreamTrack.idl:
2942
2943         * Modules/mediastream/UserMediaRequest.cpp:
2944         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
2945
2946         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2947         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
2948         to base class.
2949
2950         * Modules/webaudio/MediaStreamAudioSource.cpp:
2951         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
2952         * platform/mediastream/MediaConstraints.h:
2953
2954         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
2955         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
2956
2957         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2958         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
2959
2960         * platform/mediastream/RealtimeMediaSource.cpp:
2961         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
2962         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
2963         (WebCore::RealtimeMediaSource::hashedId const): New.
2964         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
2965         * platform/mediastream/RealtimeMediaSource.h:
2966
2967         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2968         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
2969         a source.
2970         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
2971         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
2972         * platform/mediastream/RealtimeMediaSourceCenter.h:
2973
2974         * platform/mediastream/RealtimeMediaSourceFactory.h:
2975         * platform/mediastream/RealtimeVideoSource.cpp:
2976         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
2977         * platform/mediastream/RealtimeVideoSource.h:
2978
2979         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
2980         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
2981         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
2982         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
2983
2984         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2985         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
2986         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
2987         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
2988
2989         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2990         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
2991         (WebCore::MockRealtimeAudioSource::create): Ditto.
2992         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
2993         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
2994
2995         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
2996         (WebCore::MockRealtimeVideoSource::create): Ditto.
2997         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
2998         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
2999
3000         * platform/mediastream/mac/AVVideoCaptureSource.h:
3001         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3002         (WebCore::AVVideoCaptureSource::create): Ditto.
3003         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
3004         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
3005         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
3006
3007         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3008         (WebCore::CoreAudioCaptureSource::create): Update parameters.
3009         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
3010         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
3011         (WebCore::CoreAudioCaptureSource::settings): Ditto.
3012         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3013
3014         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3015         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
3016         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
3017
3018         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3019         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3020         (WebCore::MockRealtimeAudioSource::create): Ditto.
3021         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
3022
3023         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
3024         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3025         (WebCore::MockRealtimeVideoSource::create): Ditto.
3026         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
3027
3028         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3029
3030         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
3031         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3032         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
3033         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
3034         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
3035         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
3036         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
3037
3038         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
3039         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
3040         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
3041
3042         * platform/mock/MockRealtimeAudioSource.cpp:
3043         (WebCore::MockRealtimeAudioSource::create): Ditto.
3044         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
3045         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
3046         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
3047         * platform/mock/MockRealtimeAudioSource.h:
3048
3049         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3050
3051         * platform/mock/MockRealtimeVideoSource.cpp:
3052         (WebCore::MockRealtimeVideoSource::create): Update parameters.
3053         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
3054         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
3055         (WebCore::MockRealtimeVideoSource::settings): Ditto.
3056         * platform/mock/MockRealtimeVideoSource.h:
3057
3058 2018-10-03  Jer Noble  <jer.noble@apple.com>
3059
3060         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
3061         https://bugs.webkit.org/show_bug.cgi?id=190266
3062
3063         Reviewed by Eric Carlson.
3064
3065         Test: TestWebKitAPI.VideoQualityDisplayCompositing
3066
3067         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
3068         constructor (rather than individual fields). Add a new setting to control visibility
3069         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
3070         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
3071
3072         * Modules/mediasource/VideoPlaybackQuality.cpp:
3073         (WebCore::VideoPlaybackQuality::create):
3074         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
3075         * Modules/mediasource/VideoPlaybackQuality.h:
3076         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
3077         * Modules/mediasource/VideoPlaybackQuality.idl:
3078         * html/HTMLMediaElement.cpp:
3079         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
3080         * html/HTMLMediaElement.h:
3081         * html/HTMLMediaElement.idl:
3082         * page/Settings.yaml:
3083         * platform/graphics/MediaPlayer.h:
3084         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3085         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3086         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
3087         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3088         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
3089         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
3090         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
3091
3092 2018-10-05  Ryan Haddad  <ryanhaddad@apple.com>
3093
3094         Unreviewed, rolling out r236866.
3095
3096         Breaks internal builds.
3097
3098         Reverted changeset:
3099
3100         "Add support for reporting "display composited video frames"
3101         through the VideoPlaybackQuality object."
3102         https://bugs.webkit.org/show_bug.cgi?id=190266
3103         https://trac.webkit.org/changeset/236866
3104
3105 2018-10-05  Antoine Quint  <graouts@apple.com>
3106
3107         [Web Animations] REGRESSION (r236809): crash under AnimationTimeline::updateCSSAnimationsForElement()
3108         https://bugs.webkit.org/show_bug.cgi?id=190307
3109         <rdar://problem/45009901>
3110
3111         Reviewed by Dean Jackson.
3112
3113         We could crash with an invalid access to cssAnimationsByName since cancelOrRemoveDeclarativeAnimation() already
3114         does the job of clearing the m_elementToCSSAnimationByName entry for this particular element if there are no
3115         animations targeting it anymore. This started happening in r236809 when we switched from a simple call to to cancel()
3116         to a call to cancelOrRemoveDeclarativeAnimation(). We can safely remove the removal here since cancelOrRemoveDeclarativeAnimation()
3117         will already have performed this task safely if needed.
3118
3119         * animation/AnimationTimeline.cpp:
3120         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
3121
3122 2018-10-04  Jer Noble  <jer.noble@apple.com>
3123
3124         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
3125         https://bugs.webkit.org/show_bug.cgi?id=190266
3126
3127         Reviewed by Eric Carlson.
3128
3129         Test: TestWebKitAPI.VideoQualityDisplayCompositing
3130
3131         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
3132         constructor (rather than individual fields). Add a new setting to control visibility
3133         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
3134         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
3135
3136         * Modules/mediasource/VideoPlaybackQuality.cpp:
3137         (WebCore::VideoPlaybackQuality::create):
3138         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
3139         * Modules/mediasource/VideoPlaybackQuality.h:
3140         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
3141         * Modules/mediasource/VideoPlaybackQuality.idl:
3142         * html/HTMLMediaElement.cpp:
3143         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
3144         * html/HTMLMediaElement.h:
3145         * html/HTMLMediaElement.idl:
3146         * page/Settings.yaml:
3147         * platform/graphics/MediaPlayer.h:
3148         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3149         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3150         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
3151         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3152         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
3153         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
3154         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
3155
3156 2018-10-04  Chris Dumez  <cdumez@apple.com>
3157
3158         A Document / Window should lose its browsing context as soon as its iframe is removed from the document
3159         https://bugs.webkit.org/show_bug.cgi?id=190282
3160
3161         Reviewed by Ryosuke Niwa.
3162
3163         A Document / Window should lose its browsing context (aka Frame) as soon as its iframe is removed from
3164         the document. In WebKit, a Document / Window's Frame was only getting nulled out when the frame gets
3165         destroyed, which happens later usually after a GC happens.
3166
3167         Specification:
3168         - https://html.spec.whatwg.org/#the-iframe-element
3169         """
3170         When an iframe element is removed from a document, the user agent must discard the element's nested browsing
3171         context, if it is not null, and then set the element's nested browsing context to null.
3172         """
3173
3174         This was not consistent with the specification or other browsers (tested Chrome and Firefox) so this
3175         patch is aligning our behavior.
3176
3177         In a follow-up, I am planning to look into making the Window not be a FrameDestructionObserver, and instead
3178         get its frame from the Document. This should make the code simpler.
3179
3180         No new tests, rebaselined existing tests.
3181
3182         * Modules/mediastream/MediaDevices.cpp:
3183         (WebCore::MediaDevices::getUserMedia const):
3184         * Modules/mediastream/MediaDevices.h:
3185         Update getUserMedia() to reject a the Promise with an InvalidStateError when calling after the
3186         document has been detached, instead of throwing an InvalidStateError. This behavior is as per
3187         specification:
3188         - https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia (Step 4)
3189         I needed to make this change to keep one of our layout tests passing.
3190
3191         * dom/Document.cpp:
3192         (WebCore::Document::attachToCachedFrame):
3193         (WebCore::Document::detachFromFrame):
3194         * dom/Document.h:
3195         * page/DOMWindow.cpp:
3196         (WebCore::DOMWindow::didSecureTransitionTo):
3197         (WebCore::DOMWindow::willDetachDocumentFromFrame):
3198         (WebCore::DOMWindow::setStatus):
3199         (WebCore::DOMWindow::detachFromFrame):
3200         (WebCore::DOMWindow::attachToFrame):
3201         * page/DOMWindow.h:
3202         * page/DOMWindowProperty.cpp:
3203         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
3204         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
3205         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
3206         * page/Frame.cpp:
3207         (WebCore::Frame::disconnectOwnerElement):
3208
3209         * platform/mock/MockRealtimeVideoSource.cpp:
3210         (WebCore::MockRealtimeVideoSource::drawText):
3211         Calling drawText() with a null String hits an assertion in debug. This was triggered by one of
3212         our layout tests so I made sure we only call drawText when the String is not null.
3213
3214 2018-10-04  Jeremy Jones  <jeremyj@apple.com>
3215
3216         Unify implementation in VideoFullscreenInterfaceAVKit
3217         https://bugs.webkit.org/show_bug.cgi?id=190091
3218         rdar://problem/44734523
3219
3220         Reviewed by Jer Noble.
3221
3222         No new tests because no behavior change.
3223
3224         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
3225         any changes that had been made in the old path.
3226
3227         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3228         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3229         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
3230         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
3231         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
3232         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3233         (VideoFullscreenControllerContext::requestUpdateInlineRect):
3234         (VideoFullscreenControllerContext::requestVideoContentLayer):
3235         (VideoFullscreenControllerContext::returnVideoContentLayer):
3236         (VideoFullscreenControllerContext::didSetupFullscreen):
3237         (VideoFullscreenControllerContext::didExitFullscreen):
3238
3239 2018-10-04  Justin Michaud  <justin_michaud@apple.com>
3240
3241         Bindings generator should support static attributes that are interfaces with CallWith
3242         https://bugs.webkit.org/show_bug.cgi?id=190292
3243
3244         Reviewed by Chris Dumez.
3245
3246         Add support for static attributes that support callWith to the bindings generator. This
3247         is needed for CSS.paintWorklet.
3248
3249         * bindings/scripts/CodeGeneratorJS.pm:
3250         (GenerateAttributeGetterBodyDefinition):
3251         * bindings/scripts/test/JS/JSTestObj.cpp:
3252         (WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter):
3253         (WebCore::jsTestObjConstructorTestStaticReadonlyObj):
3254         * bindings/scripts/test/TestObj.idl:
3255
3256 2018-10-04  Matt Lewis  <jlewis3@apple.com>
3257
3258         Unreviewed, rolling out r236730.
3259
3260         This caused a consistent crash in test http/tests/media/media-stream/get-display-media-prompt.html.
3261
3262         Reverted changeset:
3263
3264         "[MediaStream] RealtimeMediaSource should be able to vend
3265         hashed IDs"
3266         https://bugs.webkit.org/show_bug.cgi?id=190142
3267         https://trac.webkit.org/changeset/236730
3268
3269 2018-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3270
3271         [macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2
3272         https://bugs.webkit.org/show_bug.cgi?id=190289
3273         <rdar://problem/45020806>
3274
3275         Reviewed by Ryosuke Niwa.
3276
3277         Makes some small adjustments to fix two bugs in font attribute conversion logic. See below for more detail.
3278
3279         Tests:  FontManagerTests.AddFontShadowUsingFontOptions
3280                 FontManagerTests.AddAndRemoveColorsUsingFontOptions
3281
3282         * editing/FontAttributeChanges.cpp:
3283         (WebCore::cssValueListForShadow):
3284         * editing/cocoa/FontAttributesCocoa.mm:
3285
3286         Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
3287         have negative dimensions, so a check for `isZero()` should be used instead.
3288
3289         (WebCore::FontAttributes::createDictionary const):
3290         * platform/mac/WebCoreNSFontManagerExtras.mm:
3291
3292         Fall back to a transparent background color; this allows senders to remove the current background color by just
3293         removing NSBackgroundColorAttributeName from the attribute dictionary, rather than explicitly setting it to the
3294         transparent color (this scenario is exercised when using "Font > Styles…" to specify a font style without a
3295         background color).
3296
3297         (WebCore::computedFontAttributeChanges):
3298
3299 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
3300
3301         MutationRecord doesn't keep JS wrappers of target, addedNodes, and removedNodes alive
3302         https://bugs.webkit.org/show_bug.cgi?id=190277
3303
3304         Reviewed by Antti Koivisto.
3305
3306         The bug was caused by JSMutationRecord not visiting any of the nodes referenced by mutation records.
3307
3308         Fixed the bug by adding JSMutationRecord::visitAdditionalChildren, which adds the root nodes of
3309         the root nodes of the target, addedNodes, and removedNodes in each mutation record.
3310
3311         Test: fast/dom/MutationObserver/mutation-record-keeps-js-wrappers-of-nodes-alive.html
3312
3313         * Sources.txt:
3314         * WebCore.xcodeproj/project.pbxproj:
3315         * bindings/js/JSMutationRecordCustom.cpp: Added.
3316         (WebCore::JSMutationRecord::visitAdditionalChildren): Added.
3317         * bindings/js/JSPerformanceObserverCustom.cpp: This file got dumped out of a unified build file
3318         where using namespace JSC was defined. Use the fully qualified names to refer to JSC types.
3319         (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
3320         * dom/MutationRecord.cpp:
3321         (WebCore::ChildListRecord::visitNodesConcurrently): Added.
3322         (WebCore::RecordWithEmptyNodeLists::visitNodesConcurrently): Added.
3323         (WebCore::MutationRecordWithNullOldValue::visitNodesConcurrently): Added.
3324         * dom/MutationRecord.h:
3325         * dom/MutationRecord.idl:
3326
3327 2018-10-04  Jiewen Tan  <jiewen_tan@apple.com>
3328
3329         [WebAuthN] Move time out control from WebProcess to UIProcess
3330         https://bugs.webkit.org/show_bug.cgi?id=189642
3331         <rdar://problem/44476765>
3332
3333         Reviewed by Chris Dumez.
3334
3335         Since now the control unit of WebAuthN has been moved to UI Process, i.e. AuthenticatorManager,
3336         the time out timer should move to UI Process as well.
3337
3338         Tests: http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html
3339                http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html
3340
3341         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3342         (WebCore::AuthenticatorCoordinator::create const):
3343         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
3344         (WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): Deleted.
3345         (WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): Deleted.
3346         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3347         (WebCore::PublicKeyCredentialCreationOptions::encode const):
3348         (WebCore::PublicKeyCredentialCreationOptions::decode):
3349         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
3350         (WebCore::PublicKeyCredentialRequestOptions::encode const):
3351         (WebCore::PublicKeyCredentialRequestOptions::decode):
3352
3353 2018-10-04  Chris Dumez  <cdumez@apple.com>
3354
3355         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
3356         https://bugs.webkit.org/show_bug.cgi?id=190252
3357
3358         Reviewed by Alex Christensen.
3359
3360         Add a null check for element() after firing the 'input' event and before firing the 'change' event
3361         in case the input event listener changes the input type.
3362
3363         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
3364                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
3365
3366         * html/BaseCheckableInputType.cpp:
3367         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
3368
3369 2018-10-04  Yuhan Wu  <yuhan_wu@apple.com>
3370
3371         runtime flag and IDL for MediaRecorder
3372         https://bugs.webkit.org/show_bug.cgi?id=190018
3373
3374         Reviewed by Youenn Fablet and Chris Dumez.
3375
3376         Covered by tests:
3377         imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
3378         imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
3379
3380         Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.
3381
3382         * CMakeLists.txt:
3383         * DerivedSources.make:
3384         * Modules/mediarecorder/BlobEvent.h:
3385         (WebCore::BlobEvent::create):
3386         (WebCore::BlobEvent:::Event):
3387         * Modules/mediarecorder/BlobEvent.idl:
3388         * Modules/mediarecorder/MediaRecorder.cpp:
3389         (WebCore::MediaRecorder::create):
3390         (WebCore::MediaRecorder::MediaRecorder):
3391         (WebCore::MediaRecorder::activeDOMObjectName const):
3392         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
3393         * Modules/mediarecorder/MediaRecorder.h: Added.
3394         (WebCore::MediaRecorder::state const):
3395         (WebCore::MediaRecorder::~MediaRecorder):
3396         * Modules/mediarecorder/MediaRecorder.idl:
3397         * Modules/mediastream/RTCRtpReceiver.cpp:
3398         * Sources.txt:
3399         * WebCore.xcodeproj/project.pbxproj:
3400         * bindings/js/WebCoreBuiltinNames.h:
3401         * page/RuntimeEnabledFeatures.h:
3402         (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
3403         (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):
3404
3405 2018-10-04  Chris Dumez  <cdumez@apple.com>
3406