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