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