Unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-10-05  Jer Noble  <jer.noble@apple.com>
2
3        Unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
4
5         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
6         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
7
8 2018-10-05  Eric Carlson  <eric.carlson@apple.com>
9
10         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
11         https://bugs.webkit.org/show_bug.cgi?id=190142
12         <rdar://problem/44911109>
13
14         Reviewed by Youenn Fablet.
15
16         No new tests, covered by existing tests.
17
18         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
19         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
20         to base class.
21
22         * Modules/mediastream/MediaDevicesRequest.cpp:
23         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
24         as passed salt.
25
26         * Modules/mediastream/MediaStreamTrack.cpp:
27         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
28         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
29         * Modules/mediastream/MediaStreamTrack.h:
30         * Modules/mediastream/MediaStreamTrack.idl:
31
32         * Modules/mediastream/UserMediaRequest.cpp:
33         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
34
35         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
36         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
37         to base class.
38
39         * Modules/webaudio/MediaStreamAudioSource.cpp:
40         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
41         * platform/mediastream/MediaConstraints.h:
42
43         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
44         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
45
46         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
47         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
48
49         * platform/mediastream/RealtimeMediaSource.cpp:
50         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
51         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
52         (WebCore::RealtimeMediaSource::hashedId const): New.
53         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
54         * platform/mediastream/RealtimeMediaSource.h:
55
56         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
57         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
58         a source.
59         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
60         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
61         * platform/mediastream/RealtimeMediaSourceCenter.h:
62
63         * platform/mediastream/RealtimeMediaSourceFactory.h:
64         * platform/mediastream/RealtimeVideoSource.cpp:
65         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
66         * platform/mediastream/RealtimeVideoSource.h:
67
68         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
69         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
70         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
71         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
72
73         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
74         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
75         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
76         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
77
78         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
79         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
80         (WebCore::MockRealtimeAudioSource::create): Ditto.
81         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
82         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
83
84         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
85         (WebCore::MockRealtimeVideoSource::create): Ditto.
86         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
87         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
88
89         * platform/mediastream/mac/AVVideoCaptureSource.h:
90         * platform/mediastream/mac/AVVideoCaptureSource.mm:
91         (WebCore::AVVideoCaptureSource::create): Ditto.
92         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
93         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
94         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
95
96         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
97         (WebCore::CoreAudioCaptureSource::create): Update parameters.
98         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
99         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
100         (WebCore::CoreAudioCaptureSource::settings): Ditto.
101         * platform/mediastream/mac/CoreAudioCaptureSource.h:
102
103         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
104         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
105         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
106
107         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
108         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
109         (WebCore::MockRealtimeAudioSource::create): Ditto.
110         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
111
112         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
113         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
114         (WebCore::MockRealtimeVideoSource::create): Ditto.
115         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
116
117         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
118
119         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
120         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
121         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
122         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
123         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
124         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
125         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
126
127         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
128         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
129         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
130
131         * platform/mock/MockRealtimeAudioSource.cpp:
132         (WebCore::MockRealtimeAudioSource::create): Ditto.
133         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
134         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
135         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
136         * platform/mock/MockRealtimeAudioSource.h:
137
138         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
139
140         * platform/mock/MockRealtimeVideoSource.cpp:
141         (WebCore::MockRealtimeVideoSource::create): Update parameters.
142         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
143         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
144         (WebCore::MockRealtimeVideoSource::settings): Ditto.
145         * platform/mock/MockRealtimeVideoSource.h:
146
147 2018-10-03  Jer Noble  <jer.noble@apple.com>
148
149         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
150         https://bugs.webkit.org/show_bug.cgi?id=190266
151
152         Reviewed by Eric Carlson.
153
154         Test: TestWebKitAPI.VideoQualityDisplayCompositing
155
156         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
157         constructor (rather than individual fields). Add a new setting to control visibility
158         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
159         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
160
161         * Modules/mediasource/VideoPlaybackQuality.cpp:
162         (WebCore::VideoPlaybackQuality::create):
163         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
164         * Modules/mediasource/VideoPlaybackQuality.h:
165         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
166         * Modules/mediasource/VideoPlaybackQuality.idl:
167         * html/HTMLMediaElement.cpp:
168         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
169         * html/HTMLMediaElement.h:
170         * html/HTMLMediaElement.idl:
171         * page/Settings.yaml:
172         * platform/graphics/MediaPlayer.h:
173         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
174         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
175         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
176         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
177         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
178         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
179         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
180
181 2018-10-05  Ryan Haddad  <ryanhaddad@apple.com>
182
183         Unreviewed, rolling out r236866.
184
185         Breaks internal builds.
186
187         Reverted changeset:
188
189         "Add support for reporting "display composited video frames"
190         through the VideoPlaybackQuality object."
191         https://bugs.webkit.org/show_bug.cgi?id=190266
192         https://trac.webkit.org/changeset/236866
193
194 2018-10-05  Antoine Quint  <graouts@apple.com>
195
196         [Web Animations] REGRESSION (r236809): crash under AnimationTimeline::updateCSSAnimationsForElement()
197         https://bugs.webkit.org/show_bug.cgi?id=190307
198         <rdar://problem/45009901>
199
200         Reviewed by Dean Jackson.
201
202         We could crash with an invalid access to cssAnimationsByName since cancelOrRemoveDeclarativeAnimation() already
203         does the job of clearing the m_elementToCSSAnimationByName entry for this particular element if there are no
204         animations targeting it anymore. This started happening in r236809 when we switched from a simple call to to cancel()
205         to a call to cancelOrRemoveDeclarativeAnimation(). We can safely remove the removal here since cancelOrRemoveDeclarativeAnimation()
206         will already have performed this task safely if needed.
207
208         * animation/AnimationTimeline.cpp:
209         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
210
211 2018-10-04  Jer Noble  <jer.noble@apple.com>
212
213         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
214         https://bugs.webkit.org/show_bug.cgi?id=190266
215
216         Reviewed by Eric Carlson.
217
218         Test: TestWebKitAPI.VideoQualityDisplayCompositing
219
220         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
221         constructor (rather than individual fields). Add a new setting to control visibility
222         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
223         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
224
225         * Modules/mediasource/VideoPlaybackQuality.cpp:
226         (WebCore::VideoPlaybackQuality::create):
227         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
228         * Modules/mediasource/VideoPlaybackQuality.h:
229         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
230         * Modules/mediasource/VideoPlaybackQuality.idl:
231         * html/HTMLMediaElement.cpp:
232         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
233         * html/HTMLMediaElement.h:
234         * html/HTMLMediaElement.idl:
235         * page/Settings.yaml:
236         * platform/graphics/MediaPlayer.h:
237         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
238         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
239         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
240         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
241         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
242         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
243         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
244
245 2018-10-04  Chris Dumez  <cdumez@apple.com>
246
247         A Document / Window should lose its browsing context as soon as its iframe is removed from the document
248         https://bugs.webkit.org/show_bug.cgi?id=190282
249
250         Reviewed by Ryosuke Niwa.
251
252         A Document / Window should lose its browsing context (aka Frame) as soon as its iframe is removed from
253         the document. In WebKit, a Document / Window's Frame was only getting nulled out when the frame gets
254         destroyed, which happens later usually after a GC happens.
255
256         Specification:
257         - https://html.spec.whatwg.org/#the-iframe-element
258         """
259         When an iframe element is removed from a document, the user agent must discard the element's nested browsing
260         context, if it is not null, and then set the element's nested browsing context to null.
261         """
262
263         This was not consistent with the specification or other browsers (tested Chrome and Firefox) so this
264         patch is aligning our behavior.
265
266         In a follow-up, I am planning to look into making the Window not be a FrameDestructionObserver, and instead
267         get its frame from the Document. This should make the code simpler.
268
269         No new tests, rebaselined existing tests.
270
271         * Modules/mediastream/MediaDevices.cpp:
272         (WebCore::MediaDevices::getUserMedia const):
273         * Modules/mediastream/MediaDevices.h:
274         Update getUserMedia() to reject a the Promise with an InvalidStateError when calling after the
275         document has been detached, instead of throwing an InvalidStateError. This behavior is as per
276         specification:
277         - https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia (Step 4)
278         I needed to make this change to keep one of our layout tests passing.
279
280         * dom/Document.cpp:
281         (WebCore::Document::attachToCachedFrame):
282         (WebCore::Document::detachFromFrame):
283         * dom/Document.h:
284         * page/DOMWindow.cpp:
285         (WebCore::DOMWindow::didSecureTransitionTo):
286         (WebCore::DOMWindow::willDetachDocumentFromFrame):
287         (WebCore::DOMWindow::setStatus):
288         (WebCore::DOMWindow::detachFromFrame):
289         (WebCore::DOMWindow::attachToFrame):
290         * page/DOMWindow.h:
291         * page/DOMWindowProperty.cpp:
292         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
293         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
294         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
295         * page/Frame.cpp:
296         (WebCore::Frame::disconnectOwnerElement):
297
298         * platform/mock/MockRealtimeVideoSource.cpp:
299         (WebCore::MockRealtimeVideoSource::drawText):
300         Calling drawText() with a null String hits an assertion in debug. This was triggered by one of
301         our layout tests so I made sure we only call drawText when the String is not null.
302
303 2018-10-04  Jeremy Jones  <jeremyj@apple.com>
304
305         Unify implementation in VideoFullscreenInterfaceAVKit
306         https://bugs.webkit.org/show_bug.cgi?id=190091
307         rdar://problem/44734523
308
309         Reviewed by Jer Noble.
310
311         No new tests because no behavior change.
312
313         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
314         any changes that had been made in the old path.
315
316         * platform/ios/VideoFullscreenInterfaceAVKit.h:
317         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
318         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
319         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
320         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
321         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
322         (VideoFullscreenControllerContext::requestUpdateInlineRect):
323         (VideoFullscreenControllerContext::requestVideoContentLayer):
324         (VideoFullscreenControllerContext::returnVideoContentLayer):
325         (VideoFullscreenControllerContext::didSetupFullscreen):
326         (VideoFullscreenControllerContext::didExitFullscreen):
327
328 2018-10-04  Justin Michaud  <justin_michaud@apple.com>
329
330         Bindings generator should support static attributes that are interfaces with CallWith
331         https://bugs.webkit.org/show_bug.cgi?id=190292
332
333         Reviewed by Chris Dumez.
334
335         Add support for static attributes that support callWith to the bindings generator. This
336         is needed for CSS.paintWorklet.
337
338         * bindings/scripts/CodeGeneratorJS.pm:
339         (GenerateAttributeGetterBodyDefinition):
340         * bindings/scripts/test/JS/JSTestObj.cpp:
341         (WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter):
342         (WebCore::jsTestObjConstructorTestStaticReadonlyObj):
343         * bindings/scripts/test/TestObj.idl:
344
345 2018-10-04  Matt Lewis  <jlewis3@apple.com>
346
347         Unreviewed, rolling out r236730.
348
349         This caused a consistent crash in test http/tests/media/media-stream/get-display-media-prompt.html.
350
351         Reverted changeset:
352
353         "[MediaStream] RealtimeMediaSource should be able to vend
354         hashed IDs"
355         https://bugs.webkit.org/show_bug.cgi?id=190142
356         https://trac.webkit.org/changeset/236730
357
358 2018-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
359
360         [macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2
361         https://bugs.webkit.org/show_bug.cgi?id=190289
362         <rdar://problem/45020806>
363
364         Reviewed by Ryosuke Niwa.
365
366         Makes some small adjustments to fix two bugs in font attribute conversion logic. See below for more detail.
367
368         Tests:  FontManagerTests.AddFontShadowUsingFontOptions
369                 FontManagerTests.AddAndRemoveColorsUsingFontOptions
370
371         * editing/FontAttributeChanges.cpp:
372         (WebCore::cssValueListForShadow):
373         * editing/cocoa/FontAttributesCocoa.mm:
374
375         Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
376         have negative dimensions, so a check for `isZero()` should be used instead.
377
378         (WebCore::FontAttributes::createDictionary const):
379         * platform/mac/WebCoreNSFontManagerExtras.mm:
380
381         Fall back to a transparent background color; this allows senders to remove the current background color by just
382         removing NSBackgroundColorAttributeName from the attribute dictionary, rather than explicitly setting it to the
383         transparent color (this scenario is exercised when using "Font > Styles…" to specify a font style without a
384         background color).
385
386         (WebCore::computedFontAttributeChanges):
387
388 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
389
390         MutationRecord doesn't keep JS wrappers of target, addedNodes, and removedNodes alive
391         https://bugs.webkit.org/show_bug.cgi?id=190277
392
393         Reviewed by Antti Koivisto.
394
395         The bug was caused by JSMutationRecord not visiting any of the nodes referenced by mutation records.
396
397         Fixed the bug by adding JSMutationRecord::visitAdditionalChildren, which adds the root nodes of
398         the root nodes of the target, addedNodes, and removedNodes in each mutation record.
399
400         Test: fast/dom/MutationObserver/mutation-record-keeps-js-wrappers-of-nodes-alive.html
401
402         * Sources.txt:
403         * WebCore.xcodeproj/project.pbxproj:
404         * bindings/js/JSMutationRecordCustom.cpp: Added.
405         (WebCore::JSMutationRecord::visitAdditionalChildren): Added.
406         * bindings/js/JSPerformanceObserverCustom.cpp: This file got dumped out of a unified build file
407         where using namespace JSC was defined. Use the fully qualified names to refer to JSC types.
408         (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
409         * dom/MutationRecord.cpp:
410         (WebCore::ChildListRecord::visitNodesConcurrently): Added.
411         (WebCore::RecordWithEmptyNodeLists::visitNodesConcurrently): Added.
412         (WebCore::MutationRecordWithNullOldValue::visitNodesConcurrently): Added.
413         * dom/MutationRecord.h:
414         * dom/MutationRecord.idl:
415
416 2018-10-04  Jiewen Tan  <jiewen_tan@apple.com>
417
418         [WebAuthN] Move time out control from WebProcess to UIProcess
419         https://bugs.webkit.org/show_bug.cgi?id=189642
420         <rdar://problem/44476765>
421
422         Reviewed by Chris Dumez.
423
424         Since now the control unit of WebAuthN has been moved to UI Process, i.e. AuthenticatorManager,
425         the time out timer should move to UI Process as well.
426
427         Tests: http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html
428                http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html
429
430         * Modules/webauthn/AuthenticatorCoordinator.cpp:
431         (WebCore::AuthenticatorCoordinator::create const):
432         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
433         (WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): Deleted.
434         (WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): Deleted.
435         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
436         (WebCore::PublicKeyCredentialCreationOptions::encode const):
437         (WebCore::PublicKeyCredentialCreationOptions::decode):
438         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
439         (WebCore::PublicKeyCredentialRequestOptions::encode const):
440         (WebCore::PublicKeyCredentialRequestOptions::decode):
441
442 2018-10-04  Chris Dumez  <cdumez@apple.com>
443
444         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
445         https://bugs.webkit.org/show_bug.cgi?id=190252
446
447         Reviewed by Alex Christensen.
448
449         Add a null check for element() after firing the 'input' event and before firing the 'change' event
450         in case the input event listener changes the input type.
451
452         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
453                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
454
455         * html/BaseCheckableInputType.cpp:
456         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
457
458 2018-10-04  Yuhan Wu  <yuhan_wu@apple.com>
459
460         runtime flag and IDL for MediaRecorder
461         https://bugs.webkit.org/show_bug.cgi?id=190018
462
463         Reviewed by Youenn Fablet and Chris Dumez.
464
465         Covered by tests:
466         imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
467         imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
468
469         Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.
470
471         * CMakeLists.txt:
472         * DerivedSources.make:
473         * Modules/mediarecorder/BlobEvent.h:
474         (WebCore::BlobEvent::create):
475         (WebCore::BlobEvent:::Event):
476         * Modules/mediarecorder/BlobEvent.idl:
477         * Modules/mediarecorder/MediaRecorder.cpp:
478         (WebCore::MediaRecorder::create):
479         (WebCore::MediaRecorder::MediaRecorder):
480         (WebCore::MediaRecorder::activeDOMObjectName const):
481         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
482         * Modules/mediarecorder/MediaRecorder.h: Added.
483         (WebCore::MediaRecorder::state const):
484         (WebCore::MediaRecorder::~MediaRecorder):
485         * Modules/mediarecorder/MediaRecorder.idl:
486         * Modules/mediastream/RTCRtpReceiver.cpp:
487         * Sources.txt:
488         * WebCore.xcodeproj/project.pbxproj:
489         * bindings/js/WebCoreBuiltinNames.h:
490         * page/RuntimeEnabledFeatures.h:
491         (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
492         (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):
493
494 2018-10-04  Chris Dumez  <cdumez@apple.com>
495
496         Unreviewed, rolling out r236803.
497
498         Caused crashes on some bots
499
500         Reverted changeset:
501
502         "Regression(r236779): Crash when changing the input element
503         type from inside an 'input' event listener"
504         https://bugs.webkit.org/show_bug.cgi?id=190252
505         https://trac.webkit.org/changeset/236803
506
507 2018-10-04  Dan Bernstein  <mitz@apple.com>
508
509         Tried to fix the Mojave build after r236832.
510
511         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
512         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
513         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
514
515 2018-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
516
517         ENABLE(ASSERT) used in grid code when !ASSERT_DISABLED is desired
518         https://bugs.webkit.org/show_bug.cgi?id=190145
519
520         Reviewed by Javier Fernandez.
521
522         Replace ENABLE(ASSERT), which doesn't exist, with !ASSERT_DISABLED.
523
524         * rendering/RenderGrid.cpp:
525         (WebCore::RenderGrid::placeItemsOnGrid const):
526         (WebCore::RenderGrid::baselinePosition const):
527         * rendering/style/GridArea.h:
528         (WebCore::GridSpan::GridSpan):
529
530 2018-10-04  Dan Bernstein  <mitz@apple.com>
531
532         WebCore part of [Xcode] Update some build settings as recommended by Xcode 10
533         https://bugs.webkit.org/show_bug.cgi?id=190250
534
535         Reviewed by Andy Estes.
536
537         * Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF,
538           CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, and CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS.
539
540         * WebCore.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck and remove a
541           duplicate reference in a Compile Sources build phase.
542
543         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Suppress -Wdeprecated-implementations
544           around implementations of deprecated accessibility methods.
545
546         * loader/TextResourceDecoder.cpp:
547         (WebCore::TextResourceDecoder::checkForBOM): Addressed CLANG_WARN_COMMA.
548
549         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
550         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
551           Suppress -Wdeprecated-implementations around implementations of this deprecated delegate method.
552         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): Ditto.
553
554 2018-10-02  Darin Adler  <darin@apple.com>
555
556         AudioNode.connect should use [ReturnValue]
557         https://bugs.webkit.org/show_bug.cgi?id=190231
558
559         Reviewed by Eric Carlson.
560
561         This is a slightly more efficient way to return a value that is always
562         identical to one of the arguments, so use it here.
563
564         * Modules/webaudio/AudioBasicInspectorNode.cpp:
565         (WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>.
566         * Modules/webaudio/AudioBasicInspectorNode.h: Ditto.
567         * Modules/webaudio/AudioNode.cpp:
568         (WebCore::AudioNode::connect): Ditto.
569         * Modules/webaudio/AudioNode.h: Ditto.
570
571         * Modules/webaudio/AudioNode.idl: Use [ReturnValue].
572
573 2018-10-03  Justin Michaud  <justin_michaud@apple.com>
574
575         Registered custom properties should allow inheritance to be controlled
576         https://bugs.webkit.org/show_bug.cgi?id=190038
577
578         Reviewed by Antti Koivisto.
579
580         Tests: css-custom-properties-api/inherits.html
581                css-custom-properties-api/length.html
582                css-custom-properties-api/length2.html
583
584         Add support for inherits property on registered css custom properties, as well
585         as a starting point for evaluating registered custom properties with types. Registered
586         custom properties are evaluated as length values before being substituted. Currently,
587         relative unit cycles are not detected.
588
589         A proper solution is still needed to resolve relative unit cycles, and to apply properties like font
590         and line-height before they are needed by custom properties. In this patch, the font-size property is
591         applied twice, once before and once after resolving custom property values.
592
593         * Sources.txt:
594         * WebCore.xcodeproj/project.pbxproj:
595         * css/CSSComputedStyleDeclaration.cpp:
596         (WebCore::ComputedStyleExtractor::customPropertyValue):
597         (WebCore::CSSComputedStyleDeclaration::length const):
598         (WebCore::CSSComputedStyleDeclaration::item const):
599
600         Allow JS to get custom properties that have been resolved to a length. Also add properties from
601         m_rareNonInheritedData.
602
603         * css/CSSCustomPropertyValue.cpp:
604         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
605         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
606         * css/CSSCustomPropertyValue.h:
607         * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h.
608         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
609         (WebCore::CSSRegisteredCustomProperty::initialValueCopy const):
610         * css/CSSRegisteredCustomProperty.h:
611         (WebCore::CSSRegisteredCustomProperty::initialValue const):
612         * css/CSSVariableData.cpp:
613         (WebCore::CSSVariableData::checkVariablesForCycles const):
614         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
615         (WebCore::CSSVariableData::resolveVariableFallback const):
616         (WebCore::CSSVariableData::resolveVariableReference const):
617         (WebCore::CSSVariableData::resolveVariableReferences const):
618         (WebCore::CSSVariableData::resolveTokenRange const):
619         * css/CSSVariableData.h:
620         * css/CSSVariableReferenceValue.cpp:
621         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
622         * css/CSSVariableReferenceValue.h:
623         * css/DOMCSSRegisterCustomProperty.cpp:
624         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
625
626         Use RenderStyle over passing in a customProperties map.
627
628         * css/StyleBuilder.h:
629         * css/StyleBuilderConverter.h:
630         (WebCore::StyleBuilderConverter::convertLength):
631         (WebCore::StyleBuilderConverter::convertLengthOrAuto):
632         (WebCore::StyleBuilderConverter::convertLengthSizing):
633         (WebCore::StyleBuilderConverter::convertLengthMaxSizing):
634         * css/StyleBuilderCustom.h:
635         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
636         (WebCore::StyleBuilderCustom::applyInheritCustomProperty):
637         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
638         * css/StyleResolver.cpp:
639         (WebCore::StyleResolver::useSVGZoomRules const):
640         (WebCore::StyleResolver::useSVGZoomRulesForLength const):
641         (WebCore::StyleResolver::applyProperty):
642         (WebCore::StyleResolver::resolvedVariableValue const):
643         (WebCore::StyleResolver::applyCascadedProperties):
644         (WebCore::StyleResolver::useSVGZoomRules): Deleted.
645         (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted.
646         (WebCore::StyleResolver::resolvedVariableValue): Deleted.
647         * css/StyleResolver.h:
648         * css/makeprop.pl:
649
650         Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with
651         inheritance, unset and revert values.
652
653         * css/parser/CSSParser.cpp:
654         (WebCore::CSSParser::parseValueWithVariableReferences):
655         * css/parser/CSSParser.h:
656         * css/parser/CSSParserContext.cpp:
657         (WebCore::CSSParserContext::CSSParserContext):
658         * css/parser/CSSParserContext.h:
659         * css/parser/CSSPropertyParser.cpp:
660         (WebCore::CSSPropertyParser::parseSingleValue):
661
662         Allow parsing custom property values as lengths.
663
664         * rendering/style/RenderStyle.cpp:
665         (WebCore::RenderStyle::checkVariablesInCustomProperties):
666         * rendering/style/RenderStyle.h:
667         (WebCore::RenderStyle::inheritedCustomProperties const):
668         (WebCore::RenderStyle::nonInheritedCustomProperties const):
669         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
670         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
671         (WebCore::RenderStyle::getCustomProperty const):
672         (WebCore::RenderStyle::customProperties const): Deleted.
673         (WebCore::RenderStyle::setCustomPropertyValue): Deleted.
674         * rendering/style/StyleRareNonInheritedData.cpp:
675         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
676         (WebCore::StyleRareNonInheritedData::operator== const):
677         * rendering/style/StyleRareNonInheritedData.h:
678         * style/StyleResolveForDocument.cpp:
679         (WebCore::Style::resolveForDocument):
680
681         Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find
682         cycles between them.
683
684 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
685
686         Clear m_pendingTargets in MutationObserver::takeRecords
687         https://bugs.webkit.org/show_bug.cgi?id=190240
688
689         Reviewed by Geoffrey Garen.
690
691         In r236781, we delayed the clearing of m_pendingTargets until the end of microtask to avoid a race between
692         mutation record's JS wrappers getting created and GC marking JS wrappers of elements in mutation records.
693
694         This patch shortens this delay to until mutation record's JS wrappers are created. Specifically, we make
695         MutationObserver::takeRecords() return a struct which has both pending targets hash set and the vector of
696         mutation records so that the hash set survives through the creation of JS wrappers for mutation records.
697
698         To do this, a new IDL extended attribute "ResultField" is introduced to specify the member variable in
699         which the result is stored.
700
701         No new tests. Unfortunately, this race condition appears to be impossible to capture in a regression test.
702
703         * bindings/scripts/CodeGeneratorJS.pm:
704         (GenerateOperationBodyDefinition):
705         * bindings/scripts/IDLAttributes.json:
706         * bindings/scripts/test/JS/JSTestInterface.cpp:
707         (WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody):
708         (WebCore::jsTestInterfacePrototypeFunctionTakeNodes):
709         * bindings/scripts/test/TestImplements.idl: Added a test case.
710         * dom/MutationObserver.cpp:
711         (WebCore::MutationObserver::takeRecords):
712         (WebCore::MutationObserver::deliver):
713         * dom/MutationObserver.h:
714         * dom/MutationObserver.idl:
715
716 2018-10-03  Youenn Fablet  <youenn@apple.com>
717
718         Add VP8 support to WebRTC
719         https://bugs.webkit.org/show_bug.cgi?id=189976
720
721         Reviewed by Eric Carlson.
722
723         Add a runtime flag to control activation of VP8 codec.
724         Bind this runtime flag to the video codec factories.
725         Test: webrtc/video-mute-vp8.html
726
727         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
728         (WebCore::createLibWebRTCPeerConnectionBackend):
729         * page/RuntimeEnabledFeatures.h:
730         (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
731         (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
732         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
733         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
734         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
735         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
736         * testing/Internals.cpp:
737         (WebCore::Internals::resetToConsistentState):
738         Enable VP8 codec for tests.
739
740 2018-09-28  Jiewen Tan  <jiewen_tan@apple.com>
741
742         [WebCrypto] ECDSA could not deal with invalid signature inputs
743         https://bugs.webkit.org/show_bug.cgi?id=189879
744         <rdar://problem/44701276>
745
746         Reviewed by Brent Fulgham.
747
748         Add some guards over detections of the start positions of r/s.
749
750         Covered by improved existing tests.
751
752         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
753         (WebCore::verifyECDSA):
754
755 2018-10-03  Jer Noble  <jer.noble@apple.com>
756
757         Add a quirk to disable Modern EME for sites which are broken with it enabled
758         https://bugs.webkit.org/show_bug.cgi?id=190051
759
760         Reviewed by Daniel Bates.
761
762         Add a new class, parallel to Settings, to track quirk behavior. Extend the bindings
763         generator to support a DisabledByQuirk attribute, and set this attribute for all
764         the Modern EME types. Check whether the quirk is set inside HTMLMediaElement in
765         addition to the existing Setting.
766
767         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
768         * Modules/encryptedmedia/MediaKeySession.idl:
769         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
770         * Modules/encryptedmedia/MediaKeySystemAccess.idl:
771         * Modules/encryptedmedia/MediaKeys.idl:
772         * Modules/encryptedmedia/NavigatorEME.idl:
773         * Sources.txt:
774         * WebCore.xcodeproj/project.pbxproj:
775         * bindings/scripts/CodeGenerator.pm:
776         (WK_ucfirst):
777         * bindings/scripts/CodeGeneratorJS.pm:
778         (NeedsRuntimeCheck):
779         (GenerateRuntimeEnableConditionalString):
780         * bindings/scripts/IDLAttributes.json:
781         * bindings/scripts/preprocess-idls.pl:
782         (GenerateConstructorAttributes):
783         * dom/Document.cpp:
784         (WebCore::Document::Document):
785         * dom/Document.h:
786         (WebCore::Document::quirks const):
787         * html/HTMLMediaElement.cpp:
788         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
789         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
790         * html/HTMLMediaElement.idl:
791         * page/Quirks.cpp: Added.
792         (Quirks::Quirks):
793         (Quirks::disableEncryptedMediaAPIQuirk const):
794         * page/Quirks.h: Added.
795
796 2018-10-03  Antoine Quint  <graouts@apple.com>
797
798         [Web Animations] REGRESSION: setting 'animation-name: none' after a 'fill: forwards' animation has completed does not revert to the unanimated style
799         https://bugs.webkit.org/show_bug.cgi?id=190257
800         <rdar://problem/41341473>
801
802         Reviewed by Dean Jackson.
803
804         Test: animations/animation-fill-forwards-removal.html
805
806         While we removed a declarative animation that was no longer targetting its element, we were not removing it from the declarative animation maps
807         on the timeline, which means that the animation would still be picked up when resolving styles. We now notify the timeline that the animation
808         was detached from the element. This preserves the DeclarativeAnimation relationship returning the element as its effect's target and the document
809         timeline as its timeline, but the document timeline will no longer see this animation as targeting this element.
810
811         * animation/AnimationTimeline.cpp:
812         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
813         * animation/DeclarativeAnimation.h:
814         (WebCore::DeclarativeAnimation::target const):
815
816 2018-10-03  Jer Noble  <jer.noble@apple.com>
817
818         CRASH in CVPixelBufferGetBytePointerCallback()
819         https://bugs.webkit.org/show_bug.cgi?id=190092
820
821         Reviewed by Eric Carlson.
822
823         Speculative fix for crash that occurs when callers of CVPixelBufferGetBytePointerCallback() attempt
824         to read the last byte of a CVPixelBuffer (as a pre-flight check) and crash due to a memory access
825         error. It's speculated that mismatching CVPixelBufferLockBytePointer / CVPixelBufferUnlockBytePointer
826         calls could result in an incorrect state inside the CVPixelBuffer. Add log count checks, locking, and
827         release logging to try to pinpoint if mismatch lock counts are occurring in this code path.
828
829         * platform/graphics/cv/PixelBufferConformerCV.cpp:
830         (WebCore::CVPixelBufferGetBytePointerCallback):
831         (WebCore::CVPixelBufferReleaseBytePointerCallback):
832         (WebCore::CVPixelBufferReleaseInfoCallback):
833         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
834
835 2018-10-03  Chris Dumez  <cdumez@apple.com>
836
837         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
838         https://bugs.webkit.org/show_bug.cgi?id=190252
839
840         Reviewed by Alex Christensen.
841
842         Add a null check for element() after firing the 'input' event and before firing the 'change' event
843         in case the input event listener changes the input type.
844
845         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
846                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
847
848         * html/BaseCheckableInputType.cpp:
849         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
850
851 2018-10-03  Chris Dumez  <cdumez@apple.com>
852
853         Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener
854         https://bugs.webkit.org/show_bug.cgi?id=190251
855
856         Reviewed by Alex Christensen.
857
858         Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener,
859         similarly to noopener=1:
860         - https://html.spec.whatwg.org/#window-open-steps (step 5)
861
862         It does not matter what the value is, if there is a key named "noopener", then the new window
863         should not have an opener.
864
865         No new tests, rebaselined existing test.
866
867         * page/WindowFeatures.cpp:
868         (WebCore::setWindowFeature):
869
870 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
871
872         GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
873         https://bugs.webkit.org/show_bug.cgi?id=190115
874
875         Reviewed by Geoffrey Garen.
876
877         Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
878
879         This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
880         target is kept alive and MutationObserverRegistration where each node which had been removed
881         from an observed tree is kept alive for a subtree observation.
882
883         No new test since the test which can reproduce this problem is too slow.
884
885         * dom/GCReachableRef.h:
886         (WebCore::GCReachableRef): Made it work with hash table.
887         (WebCore::GCReachableRef::operator T& const):
888         (WebCore::GCReachableRef::GCReachableRef):
889         (WebCore::GCReachableRef::isHashTableDeletedValue const):
890         (WebCore::GCReachableRef::isHashTableEmptyValue const):
891         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
892         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
893         (WebCore::GCReachableRef::assignToHashTableEmptyValue):
894         (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
895         (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
896         (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
897         (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
898         (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
899         (WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
900         * dom/MutationObserver.cpp:
901         (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
902         to be collected before elements in mutation records are accessed. We delay until the end of the current
903         microtask at which point deliver() function is called.
904         (WebCore::MutationObserver::disconnect):
905         (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
906         This is needed for a newly inserted node, a node with attribute change, etc...
907         (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
908         records are delivered to each observer. These are nodes which had been removed from a tree and whose
909         subtree had still been obsreved up until this point.
910         * dom/MutationObserver.h:
911         * dom/MutationObserverRegistration.cpp:
912         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
913         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
914         that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
915         function had been called.
916         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
917         * dom/MutationObserverRegistration.h:
918
919 2018-10-03  Dean Jackson  <dino@apple.com>
920
921         Make the Pointer Events feature description valid
922         https://bugs.webkit.org/show_bug.cgi?id=190254
923
924         Reviewed by Simon Fraser.
925
926         * features.json:
927
928 2018-10-03  Matt Lewis  <jlewis3@apple.com>
929
930         Unreviewed, rolling out r236781.
931
932         The test added with this commit is timing out consistently.
933
934         Reverted changeset:
935
936         "GC can collect JS wrappers of nodes in the mutation records
937         waiting to be delivered"
938         https://bugs.webkit.org/show_bug.cgi?id=190115
939         https://trac.webkit.org/changeset/236781
940
941 2018-10-03  Dean Jackson  <dino@apple.com>
942
943         [macOS] Switching to discrete GPU should be done in the UI process
944         https://bugs.webkit.org/show_bug.cgi?id=189361
945         <rdar://problem/43949622>
946
947         Try to fix the IOSMAC build.
948
949         * platform/graphics/GraphicsContext3D.h:
950
951 2018-10-03  Chris Dumez  <cdumez@apple.com>
952
953         input.checked is incorrect while we're parsing its children
954         https://bugs.webkit.org/show_bug.cgi?id=190227
955
956         Reviewed by Ryosuke Niwa.
957
958         input.checked was incorrect while we're parsing its children because we were delaying updating the
959         checked state until HTMLInputElement::finishParsingChildren() is called, to avoid a bad interaction
960         with form state restoration.
961
962         In this patch, we update the checked state as soon as the 'checked' attribute is set, when we know
963         that no form state to restore.
964
965         fast/forms/radio/state-restore-radio-group.html covers the form restoration case and is still
966         passing.
967
968         No new tests, rebaselined existing test.
969
970         * html/FormController.cpp:
971         (WebCore::FormController::hasFormStateToRestore const):
972         * html/FormController.h:
973         * html/HTMLInputElement.cpp:
974         (WebCore::HTMLInputElement::parseAttribute):
975
976 2018-10-03  Miguel Gomez  <magomez@igalia.com>
977
978         [GTK][WPE] Incorrect rendering of layers whose backingStore hasn't changed
979         https://bugs.webkit.org/show_bug.cgi?id=190249
980
981         Reviewed by Žan Doberšek.
982
983         Do not overwrite m_nicosia.performLayerSync when updating the content buffers or we lose
984         the value calculated during the layer flush. Use an OR instead to keep the old value.
985
986         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
987         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
988
989 2018-10-03  Youenn Fablet  <youenn@apple.com>
990
991         Enable H264 simulcast
992         https://bugs.webkit.org/show_bug.cgi?id=190167
993
994         Reviewed by Eric Carlson.
995
996         Activate H264 simulcast trial field.
997         Make track.getSettings() expose width and height for incoming tracks.
998
999         Test: webrtc/simulcast-h264.html
1000
1001         * Configurations/WebCore.xcconfig:
1002         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1003         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1004         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
1005         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
1006
1007 2018-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1008
1009         -Wunused-variable in RenderLayer::updateScrollableAreaSet
1010         https://bugs.webkit.org/show_bug.cgi?id=190200
1011
1012         Reviewed by Yusuke Suzuki.
1013
1014         Pass it through UNUSED_VARIABLE().
1015
1016         * rendering/RenderLayer.cpp:
1017         (WebCore::RenderLayer::calculateClipRects const):
1018
1019 2018-10-03  Zan Dobersek  <zdobersek@igalia.com>
1020
1021         Ref<FetchResponse> use-after-move in DOMCache::put()
1022         https://bugs.webkit.org/show_bug.cgi?id=190239
1023
1024         Reviewed by Youenn Fablet.
1025
1026         Retrieve reference from the Ref<FetchResponse> object before it's
1027         move-captured in the lambda that's passed to the
1028         FetchResponse::consumeBodyReceivedByChunk() method that is invoked on
1029         that very same object. This is a classic use-after-move bug that pops
1030         up on compilers with different C++ calling convention.
1031
1032         * Modules/cache/DOMCache.cpp:
1033         (WebCore::DOMCache::put):
1034
1035 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1036
1037         Enable selectionAcrossShadowBoundariesEnabled by default in WebKitLegacy
1038         https://bugs.webkit.org/show_bug.cgi?id=190238
1039
1040         Reviewed by Antti Koivisto.
1041
1042         Enable the feature by default.
1043
1044         * page/Settings.yaml:
1045
1046 2018-10-02  Ryosuke Niwa  <rniwa@webkit.org>
1047
1048         Copying content with shadow DOM doesn't copy any contents
1049         https://bugs.webkit.org/show_bug.cgi?id=157443
1050
1051         Reviewed by Wenson Hsieh.
1052
1053         This patch adds the support for copying and pasting content across shadow boundaries in HTML and plain text,
1054         which is enabled whenever selection across shadow boundaries is enabled.
1055
1056         To do this, TextIterator now has a constructor which takes two Positions, and the node traversal code in
1057         StyledMarkupAccumulator has been abstracted via helper functions as done for TextIterator.
1058
1059         When serializing a HTMl slot element, serialize it as a span with "display: contents" to make sure when
1060         the content is pasted into a shadow tree, it wouldn't affect the slot assignment of the shadow tree.
1061
1062         Tests: editing/pasteboard/copy-paste-across-shadow-boundaries-1.html
1063                editing/pasteboard/copy-paste-across-shadow-boundaries-2.html
1064                editing/pasteboard/copy-paste-across-shadow-boundaries-3.html
1065                editing/pasteboard/copy-paste-across-shadow-boundaries-4.html
1066                editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-1.html
1067                editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2.html
1068                editing/pasteboard/copy-paste-with-shadow-content.html
1069
1070         * dom/ComposedTreeIterator.h:
1071         (WebCore::assignedSlotIgnoringUserAgentShadow): Moved from TextIterator.cpp.
1072         (WebCore::shadowRootIgnoringUserAgentShadow): Ditto.
1073         (WebCore::firstChildInComposedTreeIgnoringUserAgentShadow): Ditto.
1074         (WebCore::nextSiblingInComposedTreeIgnoringUserAgentShadow): Ditto.
1075         * dom/Position.h:
1076         (WebCore::Position::treeScope const): Added.
1077         * editing/EditingStyle.cpp:
1078         (WebCore::EditingStyle::addDisplayContents): Added.
1079         * editing/EditingStyle.h:
1080         * editing/Editor.cpp:
1081         (WebCore::Editor::selectedText const): Use the new behavior when selectionAcrossShadowBoundariesEnabled is set.
1082         (WebCore::Editor::selectedTextForDataTransfer const): Ditto.
1083         * editing/MarkupAccumulator.cpp:
1084         (WebCore::MarkupAccumulator::appendEndElement): Renamed from appendEndTag. Now takes StringBuilder.
1085         * editing/MarkupAccumulator.h:
1086         (WebCore::MarkupAccumulator::appendEndTag):
1087         * editing/TextIterator.cpp:
1088         (WebCore::TextIterator::TextIterator): Added a new variant which takes two positions.
1089         (WebCore::TextIterator::init):
1090         (WebCore::firstChild):
1091         (WebCore::nextSibling):
1092         (WebCore::plainText): Ditto.
1093         * editing/TextIterator.h:
1094         * editing/cocoa/EditorCocoa.mm:
1095         (WebCore::Editor::selectionInHTMLFormat): Use the new behavior if selectionAcrossShadowBoundariesEnabled is set.
1096         * editing/gtk/EditorGtk.cpp:
1097         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
1098         * editing/markup.cpp:
1099         (WebCore::StyledMarkupAccumulator::parentNode): Added.
1100         (WebCore::StyledMarkupAccumulator::firstChild): Added.
1101         (WebCore::StyledMarkupAccumulator::nextSibling): Added.
1102         (WebCore::StyledMarkupAccumulator::nextSkippingChildren): Added.
1103         (WebCore::StyledMarkupAccumulator::hasChildNodes): Added.
1104         (WebCore::StyledMarkupAccumulator::isDescendantOf): Added.
1105         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
1106         (WebCore::StyledMarkupAccumulator::appendElement): Serialize a slot element as a span with display: contents.
1107         (WebCore::StyledMarkupAccumulator::appendEndElement): Added. Ditto.
1108         (WebCore::StyledMarkupAccumulator::serializeNodes):
1109         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Use the newly added helper functions to
1110         traverse the composed tree when m_useComposedTree is set.
1111         (WebCore::commonShadowIncludingAncestor): Added.
1112         (WebCore::serializePreservingVisualAppearanceInternal): Added SerializeComposedTree as an argument. Also use
1113         StyledMarkupAccumulator::parentNode to serialize special common ancestors; e.g. to preserve b, i, etc...
1114         (WebCore::serializePreservingVisualAppearance): Ditto to the variant which takes VisibleSelection.
1115         (WebCore::sanitizedMarkupForFragmentInDocument):
1116         * editing/markup.h:
1117         * editing/wpe/EditorWPE.cpp:
1118         (WebCore::Editor::writeSelectionToPasteboard):
1119         * loader/archive/cf/LegacyWebArchive.cpp:
1120         (WebCore::LegacyWebArchive::createFromSelection):
1121         * page/PageSerializer.cpp:
1122         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndElement):
1123         * testing/Internals.cpp:
1124         (WebCore::Internals::setSelectionWithoutValidation): Added. A helper function to create a selection across
1125         shadow boundaries for testing purposes.
1126         * testing/Internals.h:
1127         * testing/Internals.idl:
1128
1129 2018-10-02  Chris Dumez  <cdumez@apple.com>
1130
1131         MessageEvent.ports should return the same object
1132         https://bugs.webkit.org/show_bug.cgi?id=190151
1133
1134         Reviewed by Darin Adler.
1135
1136         MessageEvent.ports should return the same object it was initialized to instead of
1137         constructing a new JSValue every time.
1138
1139         No new tests, rebaselined existing test.
1140
1141         * bindings/js/JSMessageEventCustom.cpp:
1142         (WebCore::JSMessageEvent::ports const):
1143         (WebCore::JSMessageEvent::visitAdditionalChildren):
1144         * dom/MessageEvent.cpp:
1145         (WebCore::MessageEvent::initMessageEvent):
1146         * dom/MessageEvent.h:
1147         * dom/MessageEvent.idl:
1148
1149 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1150
1151         GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
1152         https://bugs.webkit.org/show_bug.cgi?id=190115
1153
1154         Reviewed by Geoffrey Garen.
1155
1156         Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
1157
1158         This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
1159         target is kept alive and MutationObserverRegistration where each node which had been removed
1160         from an observed tree is kept alive for a subtree observation.
1161
1162         Test: fast/dom/MutationObserver/mutation-observer-retains-js-wrappers-of-targets-alive.html
1163
1164         * dom/GCReachableRef.h:
1165         (WebCore::GCReachableRef): Made it work with hash table.
1166         (WebCore::GCReachableRef::operator T& const):
1167         (WebCore::GCReachableRef::GCReachableRef):
1168         (WebCore::GCReachableRef::isHashTableDeletedValue const):
1169         (WebCore::GCReachableRef::isHashTableEmptyValue const):
1170         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
1171         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
1172         (WebCore::GCReachableRef::assignToHashTableEmptyValue):
1173         (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
1174         (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
1175         (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
1176         (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
1177         (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
1178         (WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
1179         * dom/MutationObserver.cpp:
1180         (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
1181         to be collected before elements in mutation records are accessed. We delay until the end of the current
1182         microtask at which point deliver() function is called.
1183         (WebCore::MutationObserver::disconnect):
1184         (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
1185         This is needed for a newly inserted node, a node with attribute change, etc...
1186         (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
1187         records are delivered to each observer. These are nodes which had been removed from a tree and whose
1188         subtree had still been obsreved up until this point.
1189         * dom/MutationObserver.h:
1190         * dom/MutationObserverRegistration.cpp:
1191         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
1192         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
1193         that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
1194         function had been called.
1195         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
1196         * dom/MutationObserverRegistration.h:
1197
1198 2018-10-02  Chris Dumez  <cdumez@apple.com>
1199
1200         radio / checkbox inputs should fire "click, input, change" events in order when clicked
1201         https://bugs.webkit.org/show_bug.cgi?id=190223
1202
1203         Reviewed by Ryosuke Niwa.
1204
1205         radio / checkbox inputs should fire "click, input, change" events in order when clicked:
1206         - https://html.spec.whatwg.org/#radio-button-state-(type=radio)
1207         - https://html.spec.whatwg.org/#checkbox-state-(type=checkbox)
1208         - https://dom.spec.whatwg.org/#ref-for-eventtarget-activation-behavior③ (step 11)
1209
1210         Gecko and Blink already behave this way. However, WebKit has the following issues:
1211         - the input event is not fired
1212         - the click event is fired after the change event
1213
1214         No new tests, updated / rebaselined existing tests.
1215
1216         * html/BaseCheckableInputType.cpp:
1217         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
1218         * html/BaseCheckableInputType.h:
1219         * html/CheckboxInputType.cpp:
1220         (WebCore::CheckboxInputType::willDispatchClick):
1221         (WebCore::CheckboxInputType::didDispatchClick):
1222         * html/HTMLInputElement.cpp:
1223         (WebCore::HTMLInputElement::setChecked):
1224         * html/HTMLInputElement.h:
1225         * html/RadioInputType.cpp:
1226         (WebCore::RadioInputType::willDispatchClick):
1227         (WebCore::RadioInputType::didDispatchClick):
1228
1229 2018-10-02  Chris Dumez  <cdumez@apple.com>
1230
1231         fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection
1232         https://bugs.webkit.org/show_bug.cgi?id=190218
1233
1234         Reviewed by Alex Christensen.
1235
1236         fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection:
1237         - https://github.com/whatwg/html/commit/8beedf0c2ffd38853caddec67490288f47afc8eb
1238
1239         Gecko has always behaved this way. Blink aligned with Gecko and the HTML specification in December 2016:
1240         - https://bugs.chromium.org/p/chromium/issues/detail?id=665291
1241
1242         This simplifies our HTMLFieldSetElement code a lot.
1243
1244         Test: fast/forms/fieldset/fieldset-elements-htmlcollection.html
1245
1246         * html/CollectionType.h:
1247         * html/GenericCachedHTMLCollection.cpp:
1248         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
1249         * html/HTMLCollection.cpp:
1250         (WebCore::HTMLCollection::rootTypeFromCollectionType):
1251         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
1252         * html/HTMLFieldSetElement.cpp:
1253         (WebCore::HTMLFieldSetElement::elements):
1254         * html/HTMLFieldSetElement.h:
1255         * html/HTMLFieldSetElement.idl:
1256         * html/HTMLFormControlsCollection.cpp:
1257         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
1258         (WebCore:: const):
1259         (WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
1260         (WebCore::HTMLFormControlsCollection::ownerNode const):
1261         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1262         * html/HTMLFormControlsCollection.h:
1263
1264 2018-10-02  Devin Rousso  <drousso@apple.com>
1265
1266         Web Inspector: prevent layer events from firing until the layer information is re-requested
1267         https://bugs.webkit.org/show_bug.cgi?id=190159
1268
1269         Reviewed by Joseph Pecoraro.
1270
1271         Test: inspector/layers/layerTreeDidChange.html
1272
1273         * inspector/agents/InspectorLayerTreeAgent.h:
1274         * inspector/agents/InspectorLayerTreeAgent.cpp:
1275         (WebCore::InspectorLayerTreeAgent::reset):
1276         (WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
1277         (WebCore::InspectorLayerTreeAgent::layersForNode):
1278
1279 2018-10-02  Brian Burg  <bburg@apple.com>
1280
1281         Web Automation: tab default key handler should always cycle focus when page is controlled by automation
1282         https://bugs.webkit.org/show_bug.cgi?id=190221
1283         <rdar://problem/44914534>
1284
1285         Reviewed by Joseph Pecoraro.
1286
1287         This change progresses WPT WebDriver test special_keys.py::test_webdriver_special_key_sends_keydown[TAB-expected24].
1288
1289         * page/FocusController.cpp:
1290         (WebCore::FocusController::advanceFocusInDocumentOrder):
1291         Always cycle focus if the page is controlled by automation. If the chrome takes
1292         focus, then the first responder will be something other than the WebView, which
1293         causes subsequent WebDriver commands to hang.
1294
1295 2018-10-01  Dean Jackson  <dino@apple.com>
1296
1297         [macOS] Switching to discrete GPU should be done in the UI process
1298         https://bugs.webkit.org/show_bug.cgi?id=189361
1299         <rdar://problem/43949622>
1300
1301         Reviewed by Simon Fraser.
1302
1303         Based on an earlier patch by Per Arne Vollan.
1304
1305         Due to the fact we can't talk to the Window Server, the Web Process can
1306         no longer muxing to the discrete GPU directly. Instead we have to get the
1307         UI Process to process the change. Do this by adding a new Chrome client
1308         called GPUClient, that will have implementations provided by both WebKit
1309         and legacy WebKit.
1310
1311         Unfortunately this can't be tested by a regular WKTR since:
1312         - it requires specific hardware
1313         - swapping to/from the discrete GPU takes about 20 seconds
1314         - running concurrent tests could confuse the tests into thinking
1315           the wrong GPU is active
1316
1317         Instead we'll write a specific test for this functionality and
1318         run it on a separate bot.
1319
1320         * WebCore.xcodeproj/project.pbxproj: Add GPUClient files.
1321
1322         * page/Chrome.cpp: Drive by clean-up.
1323         (WebCore::Chrome::windowScreenDidChange):
1324
1325         * platform/graphics/GraphicsContext3D.h: We need to keep track of
1326         whether we've muxed for this context, in order to not respond to
1327         the screen change notifications (they are misleading in the case
1328         of muxing).
1329
1330         * platform/graphics/GraphicsContext3DManager.cpp: Rather than try
1331         to mux directly, call into GPUClient.
1332         (WebCore::GraphicsContext3DManager::displayWasReconfigured):
1333         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
1334         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
1335         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
1336         * platform/graphics/GraphicsContext3DManager.h:
1337
1338         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Only reconfigure
1339         the virtual display if it didn't happen from muxing.
1340         (WebCore::GraphicsContext3D::GraphicsContext3D):
1341         (WebCore::GraphicsContext3D::updateCGLContext):
1342         (WebCore::GraphicsContext3D::screenDidChange):
1343
1344         * platform/graphics/mac/SwitchingGPUClient.cpp: Added.
1345         (WebCore::SwitchingGPUClient::singleton):
1346         (WebCore::SwitchingGPUClient::setSingleton):
1347         * platform/graphics/mac/SwitchingGPUClient.h: Added.
1348
1349         * testing/Internals.cpp: Testing helper.
1350         (WebCore::Internals::hasMuxableGPU):
1351         * testing/Internals.h:
1352         * testing/Internals.idl:
1353
1354 2018-10-02  Chris Dumez  <cdumez@apple.com>
1355
1356         Image.__proto__ should be Function.prototype, not HTMLElement.prototype
1357         https://bugs.webkit.org/show_bug.cgi?id=190216
1358
1359         Reviewed by Alex Christensen.
1360
1361         Properties created for named constructors should always use Function.prototype as prototype, as per:
1362         - https://heycam.github.io/webidl/#named-constructors
1363
1364         Gecko and Blink agree with the Web IDL specification. However, WebKit was using the parent interface's
1365         prototype if such a parent existing. So Image.__proto__ would end up being HTMLElement.prototype
1366         instead of Function.prototype.
1367
1368         No new tests, rebaselined existing test.
1369
1370         * bindings/scripts/CodeGeneratorJS.pm:
1371         (GenerateConstructorHelperMethods):
1372
1373 2018-10-02  Alex Christensen  <achristensen@webkit.org>
1374
1375         Prepare WebCoreNSURLExtras for ARC
1376         https://bugs.webkit.org/show_bug.cgi?id=190219
1377
1378         Reviewed by Tim Horton.
1379
1380         ARC doesn't like the explicit sending of -release.
1381         Use RetainPtr instead.
1382
1383         * platform/mac/WebCoreNSURLExtras.mm:
1384         (WebCore::collectRangesThatNeedMapping):
1385         (WebCore::collectRangesThatNeedEncoding):
1386         (WebCore::collectRangesThatNeedDecoding):
1387         (WebCore::applyHostNameFunctionToMailToURLString):
1388         (WebCore::applyHostNameFunctionToURLString):
1389         (WebCore::mapHostNames):
1390         (WebCore::stringByTrimmingWhitespace):
1391         (WebCore::URLWithUserTypedString):
1392         (WebCore::userVisibleString):
1393         (WebCore::rangeOfURLScheme):
1394         (WebCore::looksLikeAbsoluteURL):
1395         (WebCore::retain): Deleted.
1396
1397 2018-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1398
1399         [Curl] Fix missing values of  resource timing API.
1400         https://bugs.webkit.org/show_bug.cgi?id=190193
1401
1402         Reviewed by Alex Christensen.
1403
1404         The property nextHopProtocol was not returned correctly. It was
1405         returned only when remote inspector is opened.
1406
1407         Tests: http/wpt/resource-timing/rt-nextHopProtocol.html
1408                http/wpt/resource-timing/rt-nextHopProtocol.worker.html
1409
1410         * platform/network/curl/CurlContext.cpp:
1411         (WebCore::CurlHandle::getNetworkLoadMetrics):
1412         (WebCore::CurlHandle::addExtraNetworkLoadMetrics):
1413
1414 2018-10-02  Alex Christensen  <achristensen@webkit.org>
1415
1416         Remove unused linked-on-or-before-iOS5 check
1417         https://bugs.webkit.org/show_bug.cgi?id=190164
1418
1419         Reviewed by Michael Saboff.
1420
1421         If an app hasn't been updated since iOS5, it can't run supported iOS.
1422         This value is also only checked in an uninstantiated template function.
1423
1424         * platform/URL.cpp:
1425         (WebCore::enableURLSchemeCanonicalization): Deleted.
1426         (WebCore::equal): Deleted.
1427         * platform/URL.h:
1428
1429 2018-10-02  Alex Christensen  <achristensen@webkit.org>
1430
1431         Remove ParsedURLString
1432         https://bugs.webkit.org/show_bug.cgi?id=190154
1433
1434         Reviewed by Chris Dumez.
1435
1436         Before the introduction of URLParser, it would indicate that we should assume the String
1437         is from a valid URL so we can skip canonicalization and just find the offsets inside the String
1438         to quickly create a URL.  It was a performance optimization that caused security issues when
1439         misused.  Since the introduction of URLParser, we have a fast path for all URL parsing, so
1440         right now it actually doesn't change any behavior.  It's just a relic of the past that complicates
1441         the URL class, making it harder to express which constructor to use and making it harder to move
1442         the class.
1443
1444         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
1445         (WebCore::NavigatorContentUtils::registerProtocolHandler):
1446         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
1447         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
1448         * dom/Document.cpp:
1449         (WebCore::Document::updateBaseURL):
1450         (WebCore::Document::initSecurityContext):
1451         * dom/ExtensionStyleSheets.cpp:
1452         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
1453         * dom/ProcessingInstruction.cpp:
1454         (WebCore::ProcessingInstruction::checkStyleSheet):
1455         * editing/markup.cpp:
1456         (WebCore::completeURLs):
1457         * fileapi/BlobURL.cpp:
1458         (WebCore::BlobURL::createBlobURL):
1459         * history/HistoryItem.cpp:
1460         (WebCore::HistoryItem::url const):
1461         (WebCore::HistoryItem::originalURL const):
1462         * html/HTMLFrameElementBase.cpp:
1463         (WebCore::HTMLFrameElementBase::location const):
1464         * html/HTMLMediaElement.cpp:
1465         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
1466         * html/PublicURLManager.cpp:
1467         (WebCore::PublicURLManager::stop):
1468         * inspector/InspectorStyleSheet.cpp:
1469         (WebCore::InspectorStyleSheet::resourceStyleSheetText const):
1470         * inspector/agents/InspectorPageAgent.cpp:
1471         (WebCore::InspectorPageAgent::getCookies):
1472         (WebCore::InspectorPageAgent::deleteCookie):
1473         (WebCore::InspectorPageAgent::getResourceContent):
1474         (WebCore::InspectorPageAgent::searchInResource):
1475         * inspector/agents/page/PageDebuggerAgent.cpp:
1476         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
1477         * loader/DocumentLoader.cpp:
1478         (WebCore::DocumentLoader::subresources const):
1479         * loader/FrameLoader.cpp:
1480         (WebCore::FrameLoader::init):
1481         (WebCore::FrameLoader::initForSynthesizedDocument):
1482         * loader/HistoryController.cpp:
1483         (WebCore::HistoryController::pushState):
1484         (WebCore::HistoryController::replaceState):
1485         * loader/appcache/ApplicationCache.cpp:
1486         (WebCore::ApplicationCache::addResource):
1487         (WebCore::ApplicationCache::resourceForURL):
1488         * loader/appcache/ApplicationCacheGroup.cpp:
1489         (WebCore::ApplicationCacheGroup::startLoadingEntry):
1490         (WebCore::ApplicationCacheGroup::addEntry):
1491         * loader/appcache/ApplicationCacheStorage.cpp:
1492         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
1493         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
1494         (WebCore::ApplicationCacheStorage::loadCache):
1495         (WebCore::ApplicationCacheStorage::manifestURLs):
1496         * loader/archive/cf/LegacyWebArchive.cpp:
1497         (WebCore::LegacyWebArchive::create):
1498         * page/DOMWindow.cpp:
1499         (WebCore::DOMWindow::createWindow):
1500         * page/PageSerializer.cpp:
1501         (WebCore::PageSerializer::urlForBlankFrame):
1502         * platform/URL.cpp:
1503         (WebCore::blankURL):
1504         * platform/URL.h:
1505         (): Deleted.
1506         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1507         (WebCore::MediaPlayerPrivateAVFoundation::load):
1508         * platform/network/BlobRegistryImpl.cpp:
1509         (WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
1510         * platform/network/ResourceRequestBase.h:
1511         (WebCore::ResourceRequestBase::decodeBase):
1512         * platform/network/ResourceResponseBase.cpp:
1513         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
1514         * platform/network/cf/DNSResolveQueueCFNet.cpp:
1515         (WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):
1516         * platform/network/cf/ResourceRequest.h:
1517         (WebCore::ResourceRequest::ResourceRequest):
1518         * platform/network/curl/CookieJarDB.cpp:
1519         (WebCore::CookieJarDB::searchCookies):
1520         (WebCore::CookieJarDB::setCookie):
1521         (WebCore::CookieJarDB::deleteCookie):
1522         * platform/network/curl/ResourceRequest.h:
1523         (WebCore::ResourceRequest::ResourceRequest):
1524         * platform/network/soup/ResourceRequest.h:
1525         (WebCore::ResourceRequest::ResourceRequest):
1526         * xml/XSLTProcessorLibxslt.cpp:
1527         (WebCore::docLoaderFunc):
1528
1529 2018-10-02  Per Arne Vollan  <pvollan@apple.com>
1530
1531         [WebVTT] Cue with line setting is not rendered correctly
1532         https://bugs.webkit.org/show_bug.cgi?id=190168
1533
1534         Reviewed by Eric Carlson.
1535
1536         When the line setting contains an optional alignment value, the cue is not rendered at the correct position,
1537         see https://w3c.github.io/webvtt/#webvtt-line-cue-setting. This patch does not implement correct handling of
1538         the line setting alignment values, it only makes sure parsing does not fail when the cue has line alignment
1539         settings.
1540
1541         Test: media/track/track-cue-line-position.html
1542
1543         * html/track/VTTCue.cpp:
1544         (WebCore::VTTCueBox::applyCSSProperties):
1545         (WebCore::VTTCue::getPositionCoordinates const):
1546         (WebCore::VTTCue::setCueSettings):
1547
1548 2018-10-02  Antti Koivisto  <antti@apple.com>
1549
1550         User installed fonts are not always disabled when they should be
1551         https://bugs.webkit.org/show_bug.cgi?id=190195
1552
1553         Reviewed by Geoffrey Garen.
1554
1555         SVG images and some theme cases fail to respect the setting. Besides the obvious problem this
1556         is also a performance issue as various font caches include this setting in the key.
1557
1558         * platform/graphics/FontDescription.cpp:
1559         (WebCore::m_shouldAllowUserInstalledFonts):
1560
1561         Initialize to 'No' by default. All paths where user fonts make sense already set the bit from
1562         settings. This fixes some cases in system themes that construct FontDescriptions from scratch.
1563
1564         * rendering/RenderElement.cpp:
1565         (WebCore::RenderElement::styleWillChange):
1566
1567         Add assertion. This verified the change with the existing tests.
1568
1569         * svg/graphics/SVGImage.cpp:
1570         (WebCore::SVGImage::dataChanged):
1571
1572         Always disallow user fonts in SVG used as images.
1573
1574 2018-10-01  Dean Jackson  <dino@apple.com>
1575
1576         Remove CSS Animation Triggers
1577         https://bugs.webkit.org/show_bug.cgi?id=190175
1578         <rdar://problem/44925626>
1579
1580         Reviewed by Simon Fraser.
1581
1582         Remove the never-properly specified CSS Animation Triggers.
1583
1584         * Configurations/FeatureDefines.xcconfig:
1585         * Sources.txt:
1586         * WebCore.xcodeproj/project.pbxproj:
1587         * css/CSSAnimationTriggerScrollValue.cpp: Removed.
1588         * css/CSSAnimationTriggerScrollValue.h: Removed.
1589         * css/CSSComputedStyleDeclaration.cpp:
1590         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1591         (WebCore::createAnimationTriggerValue): Deleted.
1592         (WebCore::animationTriggerValue): Deleted.
1593         * css/CSSProperties.json:
1594         * css/CSSToStyleMap.cpp:
1595         (WebCore::CSSToStyleMap::mapAnimationTrigger): Deleted.
1596         * css/CSSToStyleMap.h:
1597         * css/CSSValue.cpp:
1598         (WebCore::CSSValue::equals const):
1599         (WebCore::CSSValue::cssText const):
1600         (WebCore::CSSValue::destroy):
1601         * css/CSSValue.h:
1602         (WebCore::CSSValue::isAnimationTriggerScrollValue const): Deleted.
1603         * css/parser/CSSPropertyParser.cpp:
1604         (WebCore::consumeAnimationValue):
1605         (WebCore::CSSPropertyParser::parseSingleValue):
1606         (WebCore::consumeWebkitAnimationTrigger): Deleted.
1607         * page/FrameView.cpp:
1608         (WebCore::FrameView::sendScrollEvent):
1609         * page/RuntimeEnabledFeatures.h:
1610         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled): Deleted.
1611         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled const): Deleted.
1612         * page/animation/AnimationBase.cpp:
1613         (WebCore::AnimationBase::updateStateMachine):
1614         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1615         (WebCore::AnimationBase::timeToNextService):
1616         (WebCore::AnimationBase::getElapsedTime const):
1617         * page/animation/CSSAnimationController.cpp:
1618         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
1619         (WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll): Deleted.
1620         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll): Deleted.
1621         (WebCore::CSSAnimationControllerPrivate::scrollWasUpdated): Deleted.
1622         (WebCore::CSSAnimationController::wantsScrollUpdates const): Deleted.
1623         (WebCore::CSSAnimationController::scrollWasUpdated): Deleted.
1624         * page/animation/CSSAnimationController.h:
1625         * page/animation/CSSAnimationControllerPrivate.h:
1626         (WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates const): Deleted.
1627         (WebCore::CSSAnimationControllerPrivate::scrollPosition const): Deleted.
1628         * page/animation/CompositeAnimation.cpp:
1629         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1630         * page/animation/CompositeAnimation.h:
1631         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation const): Deleted.
1632         * platform/animation/Animation.cpp:
1633         (WebCore::Animation::Animation):
1634         (WebCore::Animation::operator=):
1635         (WebCore::Animation::animationsMatch const):
1636         * platform/animation/Animation.h:
1637         (WebCore::Animation::isTimingFunctionSet const):
1638         (WebCore::Animation::isEmpty const):
1639         (WebCore::Animation::clearTimingFunction):
1640         (WebCore::Animation::clearAll):
1641         (WebCore::Animation::animationMode const):
1642         (WebCore::Animation::setAnimationMode):
1643         (WebCore::Animation::initialTimingFunction):
1644         (WebCore::Animation::isTriggerSet const): Deleted.
1645         (WebCore::Animation::clearTrigger): Deleted.
1646         (WebCore::Animation::trigger const): Deleted.
1647         (WebCore::Animation::setTrigger): Deleted.
1648         (WebCore::Animation::initialTrigger): Deleted.
1649         * platform/animation/AnimationTrigger.h: Removed.
1650         * platform/graphics/ca/GraphicsLayerCA.cpp:
1651         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
1652 2018-10-02  Commit Queue  <commit-queue@webkit.org>
1653
1654         Unreviewed, rolling out r236624 and r236671.
1655         https://bugs.webkit.org/show_bug.cgi?id=190207
1656
1657         The change in r236624 introduced crashes on the bots
1658         (Requested by ryanhaddad on #webkit).
1659
1660         Reverted changesets:
1661
1662         "Refactoring: eliminate raw pointer usage in Fullscreen code"
1663         https://bugs.webkit.org/show_bug.cgi?id=188747
1664         https://trac.webkit.org/changeset/236624
1665
1666         "Unify implementation in VideoFullscreenInterfaceAVKit"
1667         https://bugs.webkit.org/show_bug.cgi?id=190091
1668         https://trac.webkit.org/changeset/236671
1669
1670 2018-10-02  Sihui Liu  <sihui_liu@apple.com>
1671
1672         Add release assertion to ensure m_owningPointerForClose is null in UniqueIDBDatabase::invokeOperationAndTransactionTimer()
1673         https://bugs.webkit.org/show_bug.cgi?id=190178
1674
1675         Reviewed by Chris Dumez.
1676
1677         This would help debug rdar://problem/44902833.
1678
1679         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1680         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
1681
1682 2018-10-02  Commit Queue  <commit-queue@webkit.org>
1683
1684         Unreviewed, rolling out r236719.
1685         https://bugs.webkit.org/show_bug.cgi?id=190197
1686
1687         this revision caused 39 layout test failures that tested for
1688         scrolling, a bug was also not present in the commit or change
1689         log. (Requested by Truitt on #webkit).
1690
1691         Reverted changeset:
1692
1693         "Unreviewed, fix unused variable in
1694         RenderLayer::updateScrollableAreaSet"
1695         https://trac.webkit.org/changeset/236719
1696
1697 2018-10-02  Alicia Boya García  <aboya@igalia.com>
1698
1699         [MSE][GStreamer] Add h264parse to accept MP4 without stss
1700         https://bugs.webkit.org/show_bug.cgi?id=190143
1701
1702         Reviewed by Xabier Rodriguez-Calvar.
1703
1704         The MP4 file used in this URL does not contain a stss (Sync Sample
1705         Box). In consequence, in acordance with the ISO BMFF spec, all samples
1706         are assumed to be sync frames... But in this case that is not true,
1707         it's just that the file is wrong (e.g. created with a buggy muxer).
1708
1709         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
1710
1711         The way it works in other browsers is because instead of trusting the
1712         MP4 stss table, they rely on parsing the h264 frames. We can do that
1713         too.
1714
1715         This patch also changes RELEASE_ASSERT() when creating the parsers
1716         to GLib criticals.
1717
1718         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1719         (WebCore::createOptionalParserForFormat):
1720
1721 2018-10-02  Eric Carlson  <eric.carlson@apple.com>
1722
1723         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
1724         https://bugs.webkit.org/show_bug.cgi?id=190142
1725         <rdar://problem/44911109>
1726
1727         Reviewed by Youenn Fablet.
1728
1729         No new tests, covered by existing tests.
1730
1731         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1732         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
1733         to base class.
1734
1735         * Modules/mediastream/MediaDevicesRequest.cpp:
1736         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
1737         as passed salt.
1738
1739         * Modules/mediastream/MediaStreamTrack.cpp:
1740         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
1741         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
1742         * Modules/mediastream/MediaStreamTrack.h:
1743         * Modules/mediastream/MediaStreamTrack.idl:
1744
1745         * Modules/mediastream/UserMediaRequest.cpp:
1746         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
1747
1748         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1749         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
1750         to base class.
1751
1752         * Modules/webaudio/MediaStreamAudioSource.cpp:
1753         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
1754         * platform/mediastream/MediaConstraints.h:
1755
1756         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
1757         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
1758
1759         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
1760         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
1761
1762         * platform/mediastream/RealtimeMediaSource.cpp:
1763         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
1764         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
1765         (WebCore::RealtimeMediaSource::hashedId const): New.
1766         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
1767         * platform/mediastream/RealtimeMediaSource.h:
1768
1769         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1770         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
1771         a source.
1772         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
1773         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
1774         * platform/mediastream/RealtimeMediaSourceCenter.h:
1775
1776         * platform/mediastream/RealtimeMediaSourceFactory.h:
1777         * platform/mediastream/RealtimeVideoSource.cpp:
1778         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
1779         * platform/mediastream/RealtimeVideoSource.h:
1780
1781         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1782         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
1783         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
1784         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
1785
1786         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1787         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
1788         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
1789         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
1790
1791         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
1792         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
1793         (WebCore::MockRealtimeAudioSource::create): Ditto.
1794         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
1795         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
1796
1797         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
1798         (WebCore::MockRealtimeVideoSource::create): Ditto.
1799         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
1800         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
1801
1802         * platform/mediastream/mac/AVVideoCaptureSource.h:
1803         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1804         (WebCore::AVVideoCaptureSource::create): Ditto.
1805         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
1806         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
1807         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
1808
1809         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1810         (WebCore::CoreAudioCaptureSource::create): Update parameters.
1811         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
1812         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
1813         (WebCore::CoreAudioCaptureSource::settings): Ditto.
1814         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1815
1816         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1817         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
1818         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1819
1820         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1821         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1822         (WebCore::MockRealtimeAudioSource::create): Ditto.
1823         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
1824
1825         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1826         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1827         (WebCore::MockRealtimeVideoSource::create): Ditto.
1828         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
1829
1830         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1831
1832         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
1833         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1834         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
1835         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
1836         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
1837         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
1838         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
1839
1840         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
1841         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
1842         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
1843
1844         * platform/mock/MockRealtimeAudioSource.cpp:
1845         (WebCore::MockRealtimeAudioSource::create): Ditto.
1846         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
1847         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
1848         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
1849         * platform/mock/MockRealtimeAudioSource.h:
1850
1851         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1852
1853         * platform/mock/MockRealtimeVideoSource.cpp:
1854         (WebCore::MockRealtimeVideoSource::create): Update parameters.
1855         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
1856         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
1857         (WebCore::MockRealtimeVideoSource::settings): Ditto.
1858         * platform/mock/MockRealtimeVideoSource.h:
1859
1860 2018-10-02  Philippe Normand  <pnormand@igalia.com>
1861
1862         [GStreamer][playbin3] Stream tag lists leaks
1863         https://bugs.webkit.org/show_bug.cgi?id=190192
1864
1865         Reviewed by Xabier Rodriguez-Calvar.
1866
1867         The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak.
1868         Also check the tags list pointer which might be NULL in some cases.
1869
1870         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1871         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
1872         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1873         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
1874         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1875         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
1876
1877 2018-10-01  Michael Catanzaro  <mcatanzaro@igalia.com>
1878
1879         Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet
1880
1881         * rendering/RenderLayer.cpp:
1882         (WebCore::RenderLayer::calculateClipRects const): This is a prepare-ChangeLog bug. I don't
1883         have any changes in this function....
1884
1885 2018-10-02  Alicia Boya García  <aboya@igalia.com>
1886
1887         [MSE][GStreamer] Make same thread assert non-release
1888         https://bugs.webkit.org/show_bug.cgi?id=189924
1889
1890         Reviewed by Xabier Rodriguez-Calvar.
1891
1892         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1893         (WebCore::AppendPipeline::handleNewAppsinkSample):
1894
1895 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1896
1897         Add a new variant of serializePreservingVisualAppearance which takes VisibleSelection
1898         https://bugs.webkit.org/show_bug.cgi?id=190108
1899
1900         Reviewed by Wenson Hsieh.
1901
1902         Added a version of serializePreservingVisualAppearance which takes VisibleSelection so that we can avoid creating
1903         a range simply to get the first node and the end node of the selection later. This simple change also fixes a bug
1904         demonstrated in editing/pasteboard/paste-table-003.html.
1905
1906         Test: editing/pasteboard/paste-table-003.html
1907
1908         * editing/cocoa/EditorCocoa.mm:
1909         (WebCore::Editor::selectionInHTMLFormat): Adopt the new variant.
1910         * editing/gtk/EditorGtk.cpp:
1911         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
1912         * editing/markup.cpp:
1913         (WebCore::serializePreservingVisualAppearance): Added.
1914         * editing/markup.h:
1915         * editing/wpe/EditorWPE.cpp:
1916         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
1917         * loader/archive/cf/LegacyWebArchive.cpp:
1918         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
1919         * platform/win/PasteboardWin.cpp:
1920         (WebCore::Pasteboard::writeSelection): Ditto.
1921
1922 2018-10-01  Alex Christensen  <achristensen@webkit.org>
1923
1924         Don't read from WebCore's bundle for IDNScriptWhiteList
1925         https://bugs.webkit.org/show_bug.cgi?id=190157
1926
1927         Reviewed by Dan Bernstein.
1928
1929         No change in behavior.  This increases performance by not reading from the WebCore bundle,
1930         and it makes it so that URL-related functionality can be moved to a place without
1931         a bundle for resources.
1932
1933         * Resources/IDNScriptWhiteList.txt: Removed.
1934         * WebCore.xcodeproj/project.pbxproj:
1935         * platform/mac/WebCoreNSURLExtras.mm:
1936         (WebCore::whiteListIDNScripts):
1937         (WebCore::allCharactersInIDNScriptWhiteList):
1938         (WebCore::readIDNScriptWhiteListFile): Deleted.
1939
1940 2018-10-01  Alex Christensen  <achristensen@webkit.org>
1941
1942         Unreviewed, rolling out r236551.
1943
1944         Fails URL validating too aggressively
1945
1946         Reverted changeset:
1947
1948         "URLWithUserTypedString should return nil for URLs deemed to
1949         be invalid by WebCore::URL"
1950         https://bugs.webkit.org/show_bug.cgi?id=189979
1951         https://trac.webkit.org/changeset/236551
1952
1953 2018-10-01  Keith Miller  <keith_miller@apple.com>
1954
1955         Create a RELEASE_AND_RETURN macro for ExceptionScopes
1956         https://bugs.webkit.org/show_bug.cgi?id=190163
1957
1958         Reviewed by Mark Lam.
1959
1960         The new RELEASE_AND_RETURN does all the work for cases
1961         where you want to return the result of some expression
1962         without explicitly checking for an exception. This is
1963         much like the existing RETURN_IF_EXCEPTION macro.
1964
1965         No new tests since this is a refactor.
1966
1967         * bridge/runtime_array.cpp:
1968         (JSC::RuntimeArray::put):
1969
1970 2018-10-01  Daniel Bates  <dabates@apple.com>
1971
1972         Attempt to fix the watchOS build after <https://trac.webkit.org/changeset/236678>
1973         (https://bugs.webkit.org/show_bug.cgi?id=189974)
1974
1975         Explicitly cast index to unsigned to make the operator[] call unambiguous.
1976
1977         * platform/ios/KeyEventIOS.mm:
1978         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1979
1980 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1981
1982         ASAN failure in ~GCReachableRef()
1983         https://bugs.webkit.org/show_bug.cgi?id=190113
1984
1985         Reviewed by Darin Adler.
1986
1987         The bug was caused by ~GCReachableRef accessing Ref after it had been poisoned for ASAN
1988         in Ref::leakRef via Ref(Ref&& other). Fixed the bug by using RefPtr instead since that's
1989         the simplest solution here although we could unpoison Ref temporarily as done in ~Ref.
1990
1991         * dom/GCReachableRef.h:
1992         (WebCore::GCReachableRef::GCReachableRef):
1993         (WebCore::GCReachableRef::~GCReachableRef):
1994         (WebCore::GCReachableRef::operator-> const):
1995         (WebCore::GCReachableRef::get const):
1996         (WebCore::GCReachableRef::operator T& const):
1997         (WebCore::GCReachableRef::operator! const):
1998         (WebCore::GCReachableRef::isNull const): Deleted.
1999
2000 2018-10-01  Sihui Liu  <sihui_liu@apple.com>
2001
2002         Remove StorageProcess
2003         https://bugs.webkit.org/show_bug.cgi?id=189975
2004
2005         Reviewed by Geoffrey Garen.
2006
2007         Clean up code. No behavior change.
2008
2009         * English.lproj/Localizable.strings:
2010
2011 2018-10-01  Alicia Boya García  <aboya@igalia.com>
2012
2013         [MSE][GStreamer] Set a minimum sample duration
2014         https://bugs.webkit.org/show_bug.cgi?id=190125
2015
2016         Reviewed by Xabier Rodriguez-Calvar.
2017
2018         The last sample of the audio track in the asset used in this test
2019         player has a tiny duration (100 ns):
2020
2021         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
2022
2023         So small, we were truncating it to zero. We're not supposed to have
2024         frames with zero duration. Instead, lets set a minimum frame duration
2025         for those fringe cases.
2026
2027         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
2028         (WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
2029
2030 2018-10-01  Daniel Bates  <dabates@apple.com>
2031
2032         [iOS] Special keys are misidentified in DOM keyboard events
2033         https://bugs.webkit.org/show_bug.cgi?id=189974
2034
2035         Reviewed by Wenson Hsieh.
2036
2037         This patch fixes two issues:
2038             1. Special keyboard keys would be misidentified in dispatched DOM keyboard events.
2039             2. DOM keypress events may not be dispatched for some special keys.
2040
2041         UIKit uses special input strings to identify the Page Up, Page Down, Escape, Up Arrow, Down Arrow,
2042         Left Arrow, and Right Arrow keys. It also uses ASCII control characters to represent some other
2043         special keys, including Num Lock / Clear, Home, End, Forward Delete, and F1, ..., F24. We need
2044         to explicitly handle these special keyboard keys in order to be able to identify the key that
2045         was pressed as well as to correctly disambiguate a key down to know whether to dispatch a DOM
2046         keypress event for the key.
2047
2048         Unlike UIKit, AppKit reserves Unicode Private Use Area (PUA) code points in 0xF700–0xF8FF to
2049         represent special keyboard keys. This makes it straightforward to disambiguate such keys using
2050         the input string of the keyboard event alone. To simplify the implementation for iOS
2051         we normalize the input string be AppKit compatible. See the explaination for WebCore::windowsKeyCodeForCharCode()
2052         below for more details on why this is done.
2053
2054         Tests: fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html
2055                fast/events/ios/keypress-keys-in-non-editable-element.html
2056
2057         * SourcesCocoa.txt:
2058         * WebCore.xcodeproj/project.pbxproj:
2059         Do not use unified source build strategy when building WebEvent.mm as it makes
2060         use of SoftLinking macros that are incompatible with this strategy.
2061
2062         * platform/ios/KeyEventIOS.mm:
2063         (WebCore::windowsKeyCodeForCharCode): Recognize some special AppKit special char codes.
2064         These special char codes are generated by WebKit. WebKit uses the same special char codes
2065         as AppKit as a convenience instead of defining our own constants for the same purpose.
2066         Encoding the special UIKit input strings (e.g. up arrow) as distinct char codes allows us
2067         to use integer arithmetic and switch blocks to map characters to Windows virtual key
2068         codes as opposed to special cased branches to perform pointer or string comparisions.
2069         The latter would be necessary in Modern WebKit in order for key down events to be properly
2070         disambiguated to dispatch a DOM keypress event because pointers are not perserved, though
2071         what they point to is, when sending the WebEvent from UIProcess to the WebProcess and
2072         vice versa.
2073         (WebCore::isFunctionKey): Convenience function that determines whether the specified char
2074         code corresponds to a function key on the keyboard. The term "function key" is taken from
2075         AppKit parlance to describe a special keyboard key. These keys include F1, F2, ..., F24,
2076         and cursor keys among other special keyboard keys.
2077         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Write in terms of isFunctionKey().
2078         * platform/ios/PlatformEventFactoryIOS.h:
2079         * platform/ios/PlatformEventFactoryIOS.mm:
2080         (WebCore::keyIdentifierForKeyEvent): Remove code to handle UIKit special input strings as
2081         we now map such special input strings to char codes and hence can use the default code path.
2082         (WebCore::keyForKeyEvent): Ditto.
2083         (WebCore::codeForKeyEvent): Remove code to compute the Window virtual key code corresponding
2084         to a UIKit special key command now that we map such special input strings to char codes and
2085         subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
2086         constructors). So, we can now use WebEvent.keyCode directly to compute the DOM UIEvents code
2087         for the event.
2088         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Remove code to fix up
2089         WebEvent.keyCode to account for UIKit special input strings now that we map such special key
2090         commands to char codes and subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
2091         constructors). So, we can now take WebEvent.keyCode verbatim to be the Window virtual key code.
2092         (WebCore::convertSpecialKeyToCharCode): Deleted.
2093         (WebCore::keyCodeForEvent): Deleted.
2094         * platform/ios/WebEvent.mm:
2095         (normalizedStringWithAppKitCompatibilityMapping): Added; converts a UIKit character string
2096         to the corresponding AppKit-compatible one (if not already compatible). See the explaination
2097         for WebCore::windowsKeyCodeForCharCode() above for more details on why this is done.
2098
2099         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
2100         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
2101         Normalize the character strings to be AppKit compatible.
2102
2103 2018-10-01  Simon Fraser  <simon.fraser@apple.com>
2104
2105         Optimize RenderStyle::diff() and clean up the code
2106         https://bugs.webkit.org/show_bug.cgi?id=190104
2107
2108         Reviewed by Dan Bernstein.
2109
2110         RenderStyle::changeRequiresLayout() and related should only check values on 
2111         m_rareNonInheritedData and m_rareInheritedData after checking for pointer equality.
2112         To reduce the chances of future changes regressing this, move code comparing values
2113         on StyleRare[Non]InheritedData into dedication functions.
2114         
2115         In addition, the transform comparison double-compared the transformOperations,
2116         because m_rareNonInheritedData->transform != other.m_rareNonInheritedData->transform
2117         is a deep comparison, and it was followed by *m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform.
2118         Change the first to be a pointer comparison.
2119
2120         * rendering/style/RenderStyle.cpp:
2121         (WebCore::rareNonInheritedDataChangeRequiresLayout):
2122         (WebCore::rareInheritedDataChangeRequiresLayout):
2123         (WebCore::RenderStyle::changeRequiresLayout const):
2124         (WebCore::rareNonInheritedDataChangeRequiresLayerRepaint):
2125         (WebCore::RenderStyle::changeRequiresLayerRepaint const):
2126         (WebCore::rareNonInheritedDataChangeRequiresRepaint):
2127         (WebCore::rareInheritedDataChangeRequiresRepaint):
2128         (WebCore::RenderStyle::changeRequiresRepaint const):
2129
2130 2018-10-01  Alex Christensen  <achristensen@webkit.org>
2131
2132         URL should not use TextEncoding internally
2133         https://bugs.webkit.org/show_bug.cgi?id=190111
2134
2135         Reviewed by Andy Estes.
2136
2137         That dependency makes it impossible to move or use elsewhere.
2138         Using TextEncoding was overkill because we know the credentials are UTF-8 percent-encoded in a parsed URL.
2139         No change in behavior as verified by new API tests.
2140
2141         * page/SecurityOrigin.cpp:
2142         * page/csp/ContentSecurityPolicySourceList.cpp:
2143         * platform/URL.cpp:
2144         (WebCore::decodeEscapeSequencesFromParsedURL):
2145         (WebCore::URL::user const):
2146         (WebCore::URL::pass const):
2147         (WebCore::URL::fileSystemPath const):
2148         (WebCore::decodeURLEscapeSequences): Deleted.
2149         * platform/URL.h:
2150         * platform/network/DataURLDecoder.cpp:
2151         * platform/text/TextEncoding.cpp:
2152         (WebCore::decodeURLEscapeSequences):
2153         * platform/text/TextEncoding.h:
2154
2155 2018-10-01  Simon Pieters  <zcorpan@gmail.com>
2156
2157         <form> in quirks mode should have margin-block-end: 1em
2158         https://bugs.webkit.org/show_bug.cgi?id=157788
2159
2160         Reviewed by Simon Fraser.
2161
2162         Change the default style for forms to take writing-mode into account
2163         in quirks mode. Matches the behavior of Gecko and Edge and the HTML
2164         standard.
2165
2166         Spec: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3
2167
2168         Test: imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/form-margin-quirk.html
2169
2170         * css/quirks.css:
2171         (form):
2172
2173 2018-10-01  Jeremy Jones  <jeremyj@apple.com>
2174
2175         Unify implementation in VideoFullscreenInterfaceAVKit
2176         https://bugs.webkit.org/show_bug.cgi?id=190091
2177         rdar://problem/44734523
2178
2179         Reviewed by Jer Noble.
2180
2181         No new tests because no behavior change.
2182
2183         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
2184         any changes that had been made in the old path.
2185
2186         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2187         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2188         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
2189         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
2190         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2191         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2192         (VideoFullscreenControllerContext::requestUpdateInlineRect):
2193         (VideoFullscreenControllerContext::requestVideoContentLayer):
2194         (VideoFullscreenControllerContext::returnVideoContentLayer):
2195         (VideoFullscreenControllerContext::didSetupFullscreen):
2196         (VideoFullscreenControllerContext::didExitFullscreen):
2197
2198 2018-10-01  Antoine Quint  <graouts@apple.com>
2199
2200         [Web Animations] Ensure renderers with accelerated animations have layers
2201         https://bugs.webkit.org/show_bug.cgi?id=189990
2202
2203         Reviewed by Simon Fraser.
2204
2205         In r236501 we added code that would make a RenderBox and a RenderInline query the document timeline for whether a given element has
2206         accelerated animations running on it. Since the calls to requiresLayer() are in a hot path, we instead keep a list of elements with
2207         exclusively accelerated animations running.
2208
2209         No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
2210         which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
2211
2212         * animation/AnimationTimeline.h:
2213         * animation/DocumentTimeline.cpp:
2214         (WebCore::DocumentTimeline::detachFromDocument):
2215         (WebCore::DocumentTimeline::animationWasAddedToElement):
2216         (WebCore::DocumentTimeline::animationWasRemovedFromElement):
2217         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
2218         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Iterate over an element's animations to determine
2219         whether all of its animations are running accelerated, then update the HashSet containing elements running accelerated animations to remove or
2220         add this element.
2221         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): Make a simple contains() call on the HashSet containing elements
2222         running accelerated animations.
2223         * animation/DocumentTimeline.h:
2224         * animation/KeyframeEffectReadOnly.cpp:
2225         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):
2226         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
2227         * rendering/RenderBoxModelObject.h:
2228
2229 2018-10-01  Alicia Boya García  <aboya@igalia.com>
2230
2231         [GStreamer] Fix abort in gst_sample_get_info()
2232         https://bugs.webkit.org/show_bug.cgi?id=190135
2233
2234         Reviewed by Philippe Normand.
2235
2236         A flush can occur before any frame has finished decoding -- especially
2237         in tests, where actions on the player often occur in quick succession.
2238
2239         Therefore, the code must not assume by the time a flush occurs any
2240         frame has reached the sink. This patch fixes a case when such wrong
2241         assumption was causing gst_sample_get_info() to abort (crashing
2242         WebKit).
2243
2244         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2245         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2246         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
2247
2248 2018-10-01  Olivier Blin  <olivier.blin@softathome.com>
2249
2250         [WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet()
2251         https://bugs.webkit.org/show_bug.cgi?id=190139
2252
2253         Reviewed by Michael Catanzaro.
2254
2255         Like done upstream for EFL in r210213
2256         https://bugs.webkit.org/show_bug.cgi?id=166622
2257
2258         This has been detected by a charactersAreAllASCII() assert failure.
2259
2260         This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
2261         mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
2262         It is thus incorrect to use StringImpl::createFromLiteral() that calls
2263         strlen() to get the string length.
2264
2265         The String::ConstructFromLiteral constructor can not be used, since it
2266         skips the last character.
2267
2268         * platform/wpe/RenderThemeWPE.cpp:
2269         (WebCore::RenderThemeWPE::mediaControlsStyleSheet):
2270         Explicitely pass the size to the String constructor.
2271
2272 2018-10-01  Rob Buis  <rbuis@igalia.com>
2273
2274         Align XMLHttpRequest's overrideMimeType() with the standard
2275         https://bugs.webkit.org/show_bug.cgi?id=169276
2276
2277         Reviewed by Chris Dumez.
2278
2279         Implement the overrideMimeType() as specified in that standard, i.e.
2280         add a check that the passed mime type is valid and if not fallback
2281         to application/octet-stream.
2282
2283         In order for this patch to have any effect, I went ahead and
2284         made an improvement to the ContentType parsing, parseContentType now
2285         will reject mime types that do not match the type / subtype format, I
2286         believe this is required by both RFC2045 and mimesniff specs.
2287
2288         This behavior matches Chrome and Firefox.
2289
2290         Test: web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm
2291
2292         * platform/network/ParsedContentType.cpp:
2293         (WebCore::parseContentType):
2294         * xml/XMLHttpRequest.cpp:
2295         (WebCore::XMLHttpRequest::overrideMimeType):
2296
2297
2298 2018-10-01  Chris Dumez  <cdumez@apple.com>
2299
2300         Make crossOriginObject.then undefined for promises
2301         https://bugs.webkit.org/show_bug.cgi?id=190094
2302
2303         Reviewed by Darin Adler.
2304
2305         Make crossOriginObject.then undefined for promises. This allows promises to work better with cross-origin WindowProxy
2306         and Location objects.
2307
2308         Specification:
2309         - https://github.com/whatwg/html/pull/3242
2310         - https://github.com/whatwg/dom/issues/536
2311
2312         This aligns our behavior with Blink and Gecko.
2313
2314         No new tests, rebaselined existing test.
2315
2316         * bindings/js/JSDOMWindowCustom.cpp:
2317         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2318         (WebCore::addCrossOriginWindowOwnPropertyNames):
2319         * bindings/js/JSLocationCustom.cpp:
2320         (WebCore::getOwnPropertySlotCommon):
2321         (WebCore::addCrossOriginLocationOwnPropertyNames):
2322
2323 2018-10-01  Xan Lopez  <xan@igalia.com>
2324
2325         [SOUP] Fix the build for libsoup > 2.61.90
2326         https://bugs.webkit.org/show_bug.cgi?id=190126
2327
2328         Reviewed by Michael Catanzaro.
2329
2330         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2331
2332 2018-10-01  Alicia Boya García  <aboya@igalia.com>
2333
2334         [MSE][GStreamer] Reset running time in PlaybackPipeline::flush()
2335         https://bugs.webkit.org/show_bug.cgi?id=190076
2336
2337         Reviewed by Philippe Normand.
2338
2339         Test: media/media-source/media-source-seek-redundant-append.html
2340
2341         PlaybackPipeline::flush() is called when already enqueued frames are
2342         appended again. This may be caused by a quality change or just a
2343         redundant append. Either way, the pipeline has to be flushed and
2344         playback begin again, but without changing the player position by
2345         much.
2346
2347         There are two kinds of time to consider here: stream time (i.e. the
2348         time of a frame as written in the file, e.g. a frame may have stream
2349         time 0:01:00), and running time (i.e. how much time since playback
2350         started should pass before the frame should be played, e.g. if we
2351         started playing at 0:00:59 that same frame would have a running time
2352         of just 1 second).
2353
2354         Notice how running time depends on where and when playback starts.
2355         Running time can also be optionally resetted after a flush. (This is
2356         indeed done currently by most demuxers after a seek.)
2357
2358         Instead of resetting running time, PlaybackPipeline used to modify the
2359         first GstSegment emitted after the flush. A GstSegment declares the
2360         mapping between stream time and running time for the following frames.
2361         There, PlaybackPipeline used to set `base` (the running time at which
2362         the segment starts) to the position reported by a position query
2363         (which is stream time).
2364
2365         This, of course, only worked when playback (or the last seek) started
2366         at stream time 0:00:00, since that's the only case where running time
2367         equals stream time. In other cases delays as long as the difference
2368         between these timelines would appear. This is demonstrated in the
2369         attached test, where seeks and appends are made in such an order that
2370         the difference is more than 5 minutes, making the playback stall for
2371         >5 minutes before playing 1 second of audio.
2372
2373         This patch fixes the problem by resetting running time with the flush
2374         and not modifying GstSegment.base anymore (it will be left as zero,
2375         which is now correct since the running time has been reset).
2376
2377         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2378         (WebCore::PlaybackPipeline::flush):
2379         (WebCore::segmentFixerProbe): Deleted.
2380
2381 2018-09-30  Ryosuke Niwa  <rniwa@webkit.org>
2382
2383         Use Position instead of Range in createMarkupInternal
2384         https://bugs.webkit.org/show_bug.cgi?id=190107
2385
2386         Reviewed by Darin Adler.
2387
2388         Use two Position's indicating start and end instead of Range in createMarkupInternal and StylizedMarkupAccumulator
2389         in order to support copy & paste across shadow boundaries in the bug 157443. This patch also removes the use of
2390         Range in MarkupAccumulator since all uses of range is via StylizedMarkupAccumulator.
2391
2392         Also renamed createMarkupInternal to serializePreservingVisualAppearanceInternal to match the rename in r236612.
2393
2394         * dom/Position.cpp:
2395         (WebCore::Position::firstNode const):  Added.
2396         * dom/Position.h:
2397         * editing/MarkupAccumulator.cpp:
2398         (WebCore::MarkupAccumulator::MarkupAccumulator): No longer takes Range.
2399         (WebCore::MarkupAccumulator::appendText): Removed the code to truncate string at the boundary points of the range.
2400         * editing/MarkupAccumulator.h:
2401         (WebCore::MarkupAccumulator): Made this class non-copyable.
2402         * editing/markup.cpp:
2403         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): Now takes and stores two positions.
2404
2405         (WebCore::StyledMarkupAccumulator::appendText): Use textContentRespectingRange in the case annotation is disabled
2406         instead of calling to MarkupAccumulator::appendText, which no longer respects boundary offsets.
2407
2408         (WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Renamed from renderedText. Updated to respect
2409         boundary offsets defined by m_start and m_end Positions instead of m_range Range.
2410
2411         (WebCore::StyledMarkupAccumulator::textContentRespectingRange): Renamed from stringValueForRange. Ditto.
2412
2413         (WebCore::StyledMarkupAccumulator::serializeNodes): Now computes startNode and pastEnd nodes from start and end
2414         Positions. Note that the end position is always the next node in the tree order  for a character node
2415         and computeNodeAfterPosition returns nullptr for a character data.
2416
2417         (WebCore::highestAncestorToWrapMarkup): Now takes two positions instead of a range.
2418
2419         (WebCore::serializePreservingVisualAppearanceInternal): Renamed from createMarkupInternal. Removed the obsolete
2420         comments which were added for DOMRange in WebKitLegacy.
2421
2422         (WebCore::serializePreservingVisualAppearance):
2423
2424         (WebCore::sanitizedMarkupForFragmentInDocument): Create positions instead of a range to pass to
2425         serializePreservingVisualAppearanceInternal.
2426
2427         (WebCore::serializeFragment):
2428
2429         * editing/markup.h:
2430         * page/PageSerializer.cpp:
2431         (WebCore::PageSerializer::SerializerMarkupAccumulator): Removed the unnecessary WebCore namespace qualifier.
2432
2433 2018-09-30  Walker Henderson  <wjahenderson@gmail.com>
2434
2435         AudioNode.connect should return passed destination node
2436         https://bugs.webkit.org/show_bug.cgi?id=188834
2437
2438         Reviewed by Eric Carlson.
2439
2440         No new tests, rebaselined existing test.
2441
2442         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2443         (WebCore::AudioBasicInspectorNode::connect): Deleted.
2444         * Modules/webaudio/AudioBasicInspectorNode.h:
2445         * Modules/webaudio/AudioNode.cpp:
2446         * Modules/webaudio/AudioNode.h:
2447         * Modules/webaudio/AudioNode.idl:
2448
2449 2018-09-30  Eric Carlson  <eric.carlson@apple.com>
2450
2451         [MediaStream] Clean up RealtimeMediaSource settings change handling
2452         https://bugs.webkit.org/show_bug.cgi?id=189998
2453         <rdar://problem/44797884>
2454
2455         Reviewed by Youenn Fablet.
2456
2457         No new tests, updated webrtc/video-disabled-black.html.
2458
2459         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2460         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
2461         (WebCore::CanvasCaptureMediaStreamTrack::Source::settings):
2462         (WebCore::CanvasCaptureMediaStreamTrack::Source::settingsDidChange):
2463         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
2464         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
2465         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2466         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2467         (WebCore::RealtimeIncomingVideoSource::settings):
2468         (WebCore::RealtimeIncomingVideoSource::settingsDidChange):
2469         * platform/mediastream/RealtimeIncomingVideoSource.h:
2470         * platform/mediastream/RealtimeMediaSource.cpp:
2471         (WebCore::RealtimeMediaSource::settingsDidChange):
2472         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
2473         (WebCore::RealtimeMediaSource::setSize):
2474         (WebCore::RealtimeMediaSource::setFrameRate):
2475         (WebCore::RealtimeMediaSource::setAspectRatio):
2476         (WebCore::RealtimeMediaSource::setFacingMode):
2477         (WebCore::RealtimeMediaSource::setVolume):
2478         (WebCore::RealtimeMediaSource::setSampleRate):
2479         (WebCore::RealtimeMediaSource::setSampleSize):
2480         (WebCore::RealtimeMediaSource::setEchoCancellation):
2481         * platform/mediastream/RealtimeMediaSource.h:
2482         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
2483         (WebCore::GStreamerAudioCaptureSource::settingsDidChange):
2484         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2485         (WebCore::GStreamerVideoCaptureSource::settingsDidChange):
2486         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2487         (WebCore::AVVideoCaptureSource::settingsDidChange):
2488         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2489         (WebCore::CoreAudioCaptureSource::settingsDidChange):
2490         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2491         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
2492         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2493         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
2494         * platform/mock/MockRealtimeAudioSource.cpp:
2495         (WebCore::MockRealtimeAudioSource::settingsDidChange):
2496         * platform/mock/MockRealtimeVideoSource.cpp:
2497         (WebCore::MockRealtimeVideoSource::settingsDidChange):
2498
2499 2018-09-30  Eric Carlson  <eric.carlson@apple.com>
2500
2501         [MediaStream] Use display-specific capture factories
2502         https://bugs.webkit.org/show_bug.cgi?id=190043
2503         <rdar://problem/44834412>
2504
2505         Reviewed by Youenn Fablet.
2506
2507         No new tests, no change in functionality.
2508
2509         * Sources.txt:
2510         * WebCore.xcodeproj/project.pbxproj:
2511         * platform/mediastream/RealtimeMediaSource.cpp:
2512         (WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted.
2513         (WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted.
2514         * platform/mediastream/RealtimeMediaSource.h:
2515         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2516         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
2517         (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
2518         * platform/mediastream/RealtimeMediaSourceCenter.h:
2519         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
2520         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
2521         * platform/mediastream/RealtimeMediaSourceFactory.cpp: Added.
2522         (WebCore::SingleSourceFactory::setActiveSource):
2523         (WebCore::SingleSourceFactory::unsetActiveSource):
2524         * platform/mediastream/RealtimeMediaSourceFactory.h: Added.
2525         (WebCore::SingleSourceFactory::activeSource):
2526         (WebCore::VideoCaptureFactory::setVideoCapturePageState):
2527         (WebCore::DisplayCaptureFactory::setDisplayCapturePageState):
2528         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2529         (WebCore::libWebRTCVideoCaptureSourceFactory):
2530         (WebCore::libWebRTCDisplayCaptureSourceFactory):
2531         (WebCore::GStreamerVideoCaptureSource::factory):
2532         (WebCore::GStreamerVideoCaptureSource::displayFactory):
2533         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
2534         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
2535         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory):
2536         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory):
2537         (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory):
2538         (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory):
2539         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
2540         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2541         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
2542         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2543         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2544         (WebCore::CoreAudioCaptureSource::factory):
2545         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2546         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2547         (WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory):
2548         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory):
2549         (WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory):
2550         (WebCore::RealtimeMediaSourceCenterMac::audioFactory):
2551         (WebCore::RealtimeMediaSourceCenterMac::videoFactory):
2552         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory):
2553         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
2554         * platform/mock/MockRealtimeAudioSource.cpp:
2555         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
2556         (WebCore::MockRealtimeAudioSource::startProducingData):
2557         (): Deleted.
2558         (WebCore::mockAudioCaptureSourceFactory): Deleted.
2559         (WebCore::MockRealtimeAudioSource::factory): Deleted.
2560         * platform/mock/MockRealtimeAudioSource.h:
2561         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2562         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState):
2563         (WebCore::MockRealtimeMediaSourceCenter::audioFactory):
2564         (WebCore::MockRealtimeMediaSourceCenter::videoFactory):
2565         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
2566         * platform/mock/MockRealtimeMediaSourceCenter.h:
2567         * platform/mock/MockRealtimeVideoSource.cpp:
2568         (): Deleted.
2569         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted.
2570         (WebCore::mockVideoCaptureSourceFactory): Deleted.
2571         (WebCore::MockRealtimeVideoSource::factory): Deleted.
2572         * platform/mock/MockRealtimeVideoSource.h:
2573
2574 2018-09-29  Oriol Brufau  <obrufau@igalia.com>
2575
2576         [css-grid] Properly align items next to collapsed tracks with gutters
2577         https://bugs.webkit.org/show_bug.cgi?id=190089
2578
2579         Reviewed by Manuel Rego Casasnovas.
2580
2581         gridAreaPositionForInFlowChild could return a wrong end position for
2582         grid items adjacent to a collapsed track, because it didn't take into
2583         account that gutters collapse in that case. Therefore, "center" or
2584         "end" alignments displayed the item at the wrong position.
2585
2586         Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-013.html
2587
2588         * rendering/RenderGrid.cpp:
2589         (WebCore::RenderGrid::gridAreaPositionForInFlowChild const):
2590
2591 2018-09-29  Alicia Boya García  <aboya@igalia.com>
2592
2593         [GStreamer][MSE] Use GObject for GST_TRACE_OBJECT
2594         https://bugs.webkit.org/show_bug.cgi?id=190045
2595
2596         Reviewed by Philippe Normand.
2597
2598         Passing a non-GObject object to GST_TRACE_OBJECT() can be
2599         theoretically misunderstood by the GStreamer logging function, so this
2600         patch avoids that.
2601
2602         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2603         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
2604         (WebCore::AppendPipeline::handleEndOfAppend):
2605         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
2606         (WebCore::AppendPipeline::pushNewBuffer):
2607
2608 2018-09-28  Zamiul Haque  <zhaque@apple.com>
2609
2610         Angled gradient backgrounds in body render vertically when body height is 0
2611         https://bugs.webkit.org/show_bug.cgi?id=177232
2612         <rdar://problem/34548230>.
2613
2614         Reviewed by Tim Horton.
2615
2616         Specifically, gradients displayed at an angle (ie. 45 degrees) are rendered
2617         as if they are vertical when the body tag containing the gradient
2618         has a height of 0. Other browsers do not render under these circumstances,
2619         so WebKit was modified to follow in suit. The problem was due to layout sizes for
2620         fill tiles being calculated with a minimum height of 1px. A simple change of the
2621         minimum height and width to 0px was enough to bring about the desired behavior.
2622
2623         Tests: angled-background-repeating-gradient-rendering-vertical.html
2624
2625         * rendering/RenderBoxModelObject.cpp:
2626         (WebCore::RenderBoxModelObject::calculateFillTileSize const):
2627
2628 2018-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2629
2630         No DOM API to instantiate an attachment for an img element
2631         https://bugs.webkit.org/show_bug.cgi?id=189934
2632         <rdar://problem/44743222>
2633
2634         Reviewed by Ryosuke Niwa.
2635
2636         Adds support for HTMLAttachmentElement.getAttachmentIdentifier, a function that internal WebKit clients can use
2637         to ensure that an image element is backed by a unique _WKAttachment. See below for more details.
2638
2639         Tests:  WKAttachmentTests.AddAttachmentToConnectedImageElement
2640                 WKAttachmentTests.ChangeFileWrapperForPastedImage
2641                 WKAttachmentTests.ConnectImageWithAttachmentToDocument
2642
2643         * dom/Document.cpp:
2644         (WebCore::Document::registerAttachmentIdentifier):
2645
2646         Add a new hook to register an empty _WKAttachment in the UI process with a given identifier. Used when creating
2647         a new empty attachment to back an image element.
2648
2649         * dom/Document.h:
2650         * editing/Editor.cpp:
2651         (WebCore::Editor::registerAttachmentIdentifier):
2652         (WebCore::Editor::notifyClientOfAttachmentUpdates):
2653         * editing/Editor.h:
2654         * html/HTMLAttachmentElement.cpp:
2655         (WebCore::HTMLAttachmentElement::getAttachmentIdentifier):
2656
2657         Creates an attachment element to back the image element, if an attachment does not already exist, and returns
2658         the unique identifier. This also causes an empty corresponding _WKAttachment to be created in the client, whose
2659         file wrapper determines the contents of the image.
2660
2661         (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
2662         (WebCore::HTMLAttachmentElement::hasEnclosingImage const):
2663         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
2664
2665         Add a helper that updates the source of the enclosing image element given a content type and image data, by
2666         creating a new blob and blob URL.
2667
2668         * html/HTMLAttachmentElement.h:
2669         * html/HTMLAttachmentElement.idl:
2670         * html/HTMLImageElement.idl:
2671
2672         Rename webkitAttachmentIdentifier to just attachmentIdentifier.
2673
2674         * page/EditorClient.h:
2675         (WebCore::EditorClient::registerAttachmentIdentifier):
2676         (WebCore::EditorClient::didInsertAttachmentWithIdentifier):
2677
2678 2018-09-28  Chris Dumez  <cdumez@apple.com>
2679
2680         The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString
2681         https://bugs.webkit.org/show_bug.cgi?id=190090
2682
2683         Reviewed by Ryosuke Niwa.
2684
2685         The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString:
2686         - https://html.spec.whatwg.org/#onbeforeunloadeventhandler
2687         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5)
2688
2689         In particular, this means that returning false in an OnBeforeUnloadEventHandler should NOT
2690         cancel the event when the event is a CustomEvent (and not a BeforeUnloadEvent). This is
2691         because the return value cannot be false at:
2692         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5. Otherwise case).
2693
2694         No new tests, rebaselined existing test.
2695
2696         * bindings/js/JSEventListener.cpp:
2697         (WebCore::JSEventListener::handleEvent):
2698
2699 2018-09-28  Simon Fraser  <simon.fraser@apple.com>
2700
2701         RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
2702         https://bugs.webkit.org/show_bug.cgi?id=190093
2703
2704         Reviewed by Dean Jackson and Zalan Bujtas.
2705         
2706         It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(),
2707         because this is called at style update time, and layout will be stale.
2708         
2709         It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update
2710         descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity
2711         changes and triggers layout accordingly, which will result in a full post-layout
2712         updateLayerPositions().
2713         
2714         This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout;
2715         we need it to trigger layout (for now) because it affects z-order.
2716
2717         Covered by existing tests.
2718
2719         * rendering/RenderLayer.cpp:
2720         (WebCore::RenderLayer::removeOnlyThisLayer):
2721         * rendering/style/RenderStyle.cpp:
2722         (WebCore::RenderStyle::changeRequiresLayout const):
2723
2724 2018-09-28  Jiewen Tan  <jiewen_tan@apple.com>
2725
2726         [WebAuthN] Polish WebAuthN auto-test environment
2727         https://bugs.webkit.org/show_bug.cgi?id=189283
2728         <rdar://problem/44117828>
2729
2730         Reviewed by Chris Dumez.
2731
2732         This patch removes the old mocking mechanism.
2733
2734         Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html
2735                http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html
2736                http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html
2737
2738         * DerivedSources.make:
2739         * WebCore.xcodeproj/project.pbxproj:
2740         * testing/Internals.cpp:
2741         (WebCore::Internals::Internals):
2742         (WebCore::Internals::mockAuthenticatorCoordinator const): Deleted.
2743         * testing/Internals.h:
2744         * testing/Internals.idl:
2745         * testing/MockAuthenticatorCoordinator.cpp: Removed.
2746         * testing/MockAuthenticatorCoordinator.h: Removed.
2747         * testing/MockAuthenticatorCoordinator.idl: Removed.
2748
2749 2018-09-28  Jer Noble  <jer.noble@apple.com>
2750
2751         Refactoring: eliminate raw pointer usage in Fullscreen code
2752         https://bugs.webkit.org/show_bug.cgi?id=188747
2753         <rdar://problem/43541164>
2754
2755         Reviewed by Alex Christensen.
2756
2757         Two sources of raw pointers in the Fullscreen code:
2758         - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
2759           they are passed around as raw references.
2760         - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
2761           VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
2762           be ref-able.
2763
2764         Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
2765         derefModel methods, overridden by implementing subclasses. Make every concrete observer
2766         inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
2767         the client interface.
2768
2769         Since every Interface class now holds a strong reference to its Model classes, and each
2770         Model class holds a weak reference to all its clients, no explicit invalidate() method
2771         is necessary.
2772
2773         Notes:
2774
2775         - Since the weak pointer methods need to be able to downcast to the abstract base class,
2776           observers need to inherit publically (rather than privately) from those base classes.
2777         - Media element Models should compose EventListener rather than inheriting from it, since
2778           EventListener has its own RefCount.
2779         - WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
2780           their underlying object is destroyed), so clients should be stored in a Vector instead.
2781         - Interfaces should be given all required Refs at creation time, so that they can store
2782           those parameters as Refs instead of RefPtrs.
2783
2784         * platform/cocoa/PlaybackSessionInterface.h:
2785         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
2786         * platform/cocoa/PlaybackSessionModel.h:
2787         (WebCore::PlaybackSessionModel::ref):
2788         (WebCore::PlaybackSessionModel::deref):
2789         (WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
2790         * platform/cocoa/PlaybackSessionModelMediaElement.h:
2791         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2792         (WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
2793         (WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
2794         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
2795         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
2796         (WebCore::PlaybackSessionModelMediaElement::addClient):
2797         (WebCore::PlaybackSessionModelMediaElement::removeClient):
2798         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
2799         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
2800         (WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
2801         * platform/cocoa/VideoFullscreenChangeObserver.h:
2802         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
2803         * platform/cocoa/VideoFullscreenModel.h:
2804         (WebCore::VideoFullscreenModel::ref):
2805         (WebCore::VideoFullscreenModel::deref):
2806         (WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
2807         * platform/cocoa/VideoFullscreenModelVideoElement.h:
2808         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
2809         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
2810         (VideoFullscreenModelVideoElement::setVideoElement):
2811         (VideoFullscreenModelVideoElement::addClient):
2812         (VideoFullscreenModelVideoElement::removeClient):
2813         (VideoFullscreenModelVideoElement::setHasVideo):
2814         (VideoFullscreenModelVideoElement::setVideoDimensions):
2815         (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
2816         (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
2817         (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
2818         (VideoFullscreenModelVideoElement::willExitPictureInPicture):
2819         (VideoFullscreenModelVideoElement::didExitPictureInPicture):
2820         (VideoFullscreenModelVideoElement::handleEvent): Deleted.
2821         * platform/ios/PlaybackSessionInterfaceAVKit.h:
2822         (WebCore::PlaybackSessionInterfaceAVKit::create):
2823         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
2824         (): Deleted.
2825         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2826         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
2827         (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
2828         (WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
2829         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2830         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2831         (-[WebAVPlayerLayer layoutSublayers]):
2832         (-[WebAVPlayerLayer resolveBounds]):
2833         (-[WebAVPlayerLayer setVideoGravity:]):
2834         (VideoFullscreenInterfaceAVKit::create):
2835         (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
2836         (VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
2837         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
2838         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
2839         (VideoFullscreenInterfaceAVKit::setupFullscreen):
2840         (VideoFullscreenInterfaceAVKit::presentingViewController):
2841         (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
2842         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
2843         (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
2844         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
2845         (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
2846         (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
2847         (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
2848         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2849         (VideoFullscreenInterfaceAVKit::doSetup):
2850         (VideoFullscreenInterfaceAVKit::setMode):
2851         (VideoFullscreenInterfaceAVKit::clearMode):
2852         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
2853         (VideoFullscreenInterfaceAVKit::invalidate): Deleted.
2854         * platform/ios/WebAVPlayerController.h:
2855         * platform/ios/WebAVPlayerController.mm:
2856         (-[WebAVPlayerController delegate]):
2857         (-[WebAVPlayerController playbackSessionInterface]):
2858         (-[WebAVPlayerController setPlaybackSessionInterface:]):
2859         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2860         (VideoFullscreenControllerContext::didCleanupFullscreen):
2861         (VideoFullscreenControllerContext::addClient):
2862         (VideoFullscreenControllerContext::removeClient):
2863         (VideoFullscreenControllerContext::willEnterPictureInPicture):
2864         (VideoFullscreenControllerContext::didEnterPictureInPicture):
2865         (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
2866         (VideoFullscreenControllerContext::willExitPictureInPicture):
2867         (VideoFullscreenControllerContext::didExitPictureInPicture):
2868         (VideoFullscreenControllerContext::setUpFullscreen):
2869         * platform/mac/PlaybackSessionInterfaceMac.h:
2870         * platform/mac/PlaybackSessionInterfaceMac.mm:
2871         (WebCore::PlaybackSessionInterfaceMac::create):
2872         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
2873         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
2874         (WebCore::PlaybackSessionInterfaceMac::rateChanged):
2875         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
2876         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
2877         (WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
2878         (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
2879         (WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
2880         (WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
2881         * platform/mac/VideoFullscreenInterfaceMac.h:
2882         (WebCore::VideoFullscreenInterfaceMac::create):
2883         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
2884         (WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
2885         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
2886         * platform/mac/VideoFullscreenInterfaceMac.mm:
2887         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
2888         (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
2889         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2890         (-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
2891         (-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
2892         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
2893         (WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
2894         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
2895         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
2896         (WebCore::VideoFullscreenInterfaceMac::setMode):
2897         (WebCore::VideoFullscreenInterfaceMac::clearMode):
2898         (WebCore::VideoFullscreenInterfaceMac::invalidate):
2899         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
2900         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
2901         * platform/mac/WebPlaybackControlsManager.mm:
2902         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
2903         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
2904         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
2905         (-[WebPlaybackControlsManager togglePlayback]):
2906         (-[WebPlaybackControlsManager setPlaying:]):
2907         (-[WebPlaybackControlsManager isPlaying]):
2908         (-[WebPlaybackControlsManager togglePictureInPicture]):
2909
2910 2018-09-28  Chris Dumez  <cdumez@apple.com>
2911
2912         Drop support for cross-origin-window-policy header
2913         https://bugs.webkit.org/show_bug.cgi?id=190081
2914
2915         Reviewed by Ryosuke Niwa.
2916
2917         Drop support for cross-origin-window-policy header as this was never enabled and its design has
2918         some issues we have not resolved. An alternative is being worked on but will be substantially
2919         different so there is not much value in keeping this code around.
2920
2921         * bindings/js/JSDOMBindingSecurity.cpp:
2922         * bindings/js/JSDOMBindingSecurity.h:
2923         * bindings/js/JSDOMWindowCustom.cpp:
2924         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2925         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2926         (WebCore::addCrossOriginWindowPropertyNames):
2927         (WebCore::addScopedChildrenIndexes):
2928         (WebCore::addCrossOriginWindowOwnPropertyNames):
2929         (WebCore::JSDOMWindow::getOwnPropertyNames):
2930         * bindings/js/JSDOMWindowCustom.h:
2931         * bindings/js/JSRemoteDOMWindowCustom.cpp:
2932         * bindings/scripts/CodeGeneratorJS.pm:
2933         (GenerateAttributeGetterBodyDefinition):
2934         (GenerateAttributeSetterBodyDefinition):
2935         (GenerateOperationBodyDefinition):
2936         * bindings/scripts/IDLAttributes.json:
2937         * dom/Document.cpp:
2938         (WebCore::Document::canNavigate):
2939         * loader/FrameLoader.cpp:
2940         (WebCore::FrameLoader::didBeginDocument):
2941         * page/AbstractDOMWindow.cpp:
2942         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
2943         * page/AbstractDOMWindow.h:
2944         * page/DOMWindow.idl:
2945         * page/Settings.yaml:
2946         * platform/network/HTTPParsers.cpp:
2947         * platform/network/HTTPParsers.h:
2948
2949 2018-09-28  Daniel Bates  <dabates@apple.com>
2950
2951         [iOS] Allow programmatic focus when hardware keyboard is attached
2952         https://bugs.webkit.org/show_bug.cgi?id=190017
2953         <rdar://problem/42270463>
2954
2955         Reviewed by Wenson Hsieh.
2956
2957         Add support for checking if the embedding client is WebKitTestRunner and export isDumpRenderTree()
2958         so that we can make use of it from WebKit. We will make use of these functions to keep the current
2959         behavior of disallowing programmatic focus when running tests in these apps. This is needed to
2960         keep testing deterministic. Otherwise, test results would be dependent on whether a hardware
2961         keyboard is attached. When running tests in Simulator.app the hardware keyboard may also not be
2962         connected (i.e. Hardware > Keyboard > Connect Hardware Keyboard is disabled).
2963
2964         * platform/RuntimeApplicationChecks.h:
2965         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2966         (WebCore::IOSApplication::isWebKitTestRunner): Added.
2967
2968 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2969
2970         REGRESSION(r236609): API tests for mso list preservation are failing
2971         https://bugs.webkit.org/show_bug.cgi?id=190095
2972
2973         Reviewed by Wenson Hsieh.
2974
2975         The regression was caused by appendNodeToPreserveMSOList called after an early return for not having renderer.
2976         Clearly, comment & style elements coming from a MS word document wouldn't have a renderer.
2977
2978         Fixed the bug by changing the order.
2979
2980         * editing/markup.cpp:
2981         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2982
2983 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2984
2985         Build fix after r236612.
2986
2987         * platform/win/PasteboardWin.cpp:
2988         (WebCore::Pasteboard::writeSelection):
2989
2990 2018-09-28  Andy Estes  <aestes@apple.com>
2991
2992         [Apple Pay] Remove the "in-store" button type
2993         https://bugs.webkit.org/show_bug.cgi?id=190079
2994
2995         Reviewed by Tim Horton.
2996
2997         According to <https://developer.apple.com/design/human-interface-guidelines/apple-pay/buttons-and-marks/buttons/>,
2998         this button is meant only for certain kinds of native apps. It shouldn't be available on the web.
2999
3000         Updated http/tests/ssl/applepay/ApplePayButton.html.
3001
3002         * css/CSSPrimitiveValueMappings.h:
3003         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3004         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
3005         * css/CSSValueKeywords.in:
3006         * css/parser/CSSParserFastPaths.cpp:
3007         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3008         * rendering/RenderThemeCocoa.mm:
3009         (WebCore::toPKPaymentButtonType):
3010         * rendering/style/RenderStyleConstants.h:
3011
3012 2018-09-28  Chris Dumez  <cdumez@apple.com>
3013
3014         document.open() should throw errors for cross-origin calls
3015         https://bugs.webkit.org/show_bug.cgi?id=189371
3016         <rdar://problem/44282700>
3017
3018         Reviewed by Youenn Fablet.
3019
3020         document.open() / document.write() should throw errors for cross-origin calls as per:
3021         - https://html.spec.whatwg.org/#document-open-steps (Step 4)
3022
3023         No new tests, rebaselined existing tests.
3024
3025         * dom/Document.cpp:
3026         (WebCore::Document::open):
3027         (WebCore::Document::write):
3028         (WebCore::Document::writeln):
3029         * dom/Document.h:
3030
3031 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
3032
3033         Rename createMarkup to serializePreservingVisualAppearance
3034         https://bugs.webkit.org/show_bug.cgi?id=190086
3035
3036         Reviewed by Wenson Hsieh.
3037
3038         Renamed the function to clarify what it does. Also removed the unused Range::toHTML.
3039
3040         * dom/Range.cpp:
3041         (WebCore::Range::toHTML const): Deleted.
3042         * dom/Range.h:
3043         * editing/CompositeEditCommand.cpp:
3044         (WebCore::CompositeEditCommand::moveParagraphs):
3045         * editing/cocoa/EditorCocoa.mm:
3046         (WebCore::Editor::selectionInHTMLFormat):
3047         * editing/gtk/EditorGtk.cpp:
3048         (WebCore::Editor::writeSelectionToPasteboard):
3049         * editing/markup.cpp:
3050         (WebCore::serializePreservingVisualAppearance):
3051         (WebCore::createMarkup): Deleted.
3052         * editing/markup.h:
3053         * editing/wpe/EditorWPE.cpp:
3054         (WebCore::Editor::writeSelectionToPasteboard):
3055         * loader/archive/cf/LegacyWebArchive.cpp:
3056         (WebCore::LegacyWebArchive::create):
3057         (WebCore::LegacyWebArchive::createFromSelection):
3058         * platform/win/PasteboardWin.cpp:
3059         (WebCore::Pasteboard::writeRangeToDataObject):
3060
3061 2018-09-28  Simon Fraser  <simon.fraser@apple.com>
3062
3063         Remove some unused RenderLayer code
3064         https://bugs.webkit.org/show_bug.cgi?id=190078
3065
3066         Reviewed by Zalan Bujtas.
3067
3068         The 'outOfFlowDescendantContainingBlocks' code was related to the accelerated overflow scrolling code that
3069         I removed recently.
3070         
3071         updateDescendantsLayerListsIfNeeded() is never called.
3072
3073         * rendering/RenderLayer.cpp:
3074         (WebCore::RenderLayer::updateDescendantDependentFlags):
3075         (WebCore::RenderLayer::calculateClipRects const):
3076         * rendering/RenderLayer.h:
3077
3078 2018-09-28  Commit Queue  <commit-queue@webkit.org>
3079
3080         Unreviewed, rolling out r236605.
3081         https://bugs.webkit.org/show_bug.cgi?id=190087
3082
3083         caused three API test timeouts (Requested by jernoble on
3084         #webkit).
3085
3086         Reverted changeset:
3087
3088         "Refactoring: eliminate raw pointer usage in Fullscreen code"
3089         https://bugs.webkit.org/show_bug.cgi?id=188747
3090         https://trac.webkit.org/changeset/236605
3091
3092 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
3093
3094         Simplify StyledMarkupAccumulator::traverseNodesForSerialization
3095         https://bugs.webkit.org/show_bug.cgi?id=190073
3096
3097         Reviewed by Antti Koivisto.
3098
3099         Simplified the range traversal algorithm in traverseNodesForSerialization as it was too complicated
3100         to support shadow DOM for copy and paste.
3101
3102         Instead of using NodeTraversal::next to traverse past ancestors and then figuring out which ancestor
3103         must be closed or to wrap the existing markup with, new code collects the list of ancestors as we
3104         traverse out of them.
3105
3106         Also extracted lambdas for generating markup and deciding whether to skip a node as well as keeping
3107         track of the depth of the current markup. This further reduces the code complexity of the actual
3108         node traversal algorithm. Keeping track of the depth allows us to now generate ancestor elements'
3109         closing tags without keeping a stack of ancestor nodes we opened at all times.
3110
3111         * editing/markup.cpp:
3112         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
3113
3114 2018-09-27  Ryosuke Niwa  <rniwa@webkit.org>
3115
3116         Replace every use of Node::offsetInCharacters() by Node::isCharacterDataNode()
3117         https://bugs.webkit.org/show_bug.cgi?id=190069
3118
3119         Reviewed by Zalan Bujtas.
3120
3121         Removed Node::offsetInCharacters() and replaced every use of it by isCharacterDataNode()
3122         because their implementations are identical.
3123
3124         Note that offsetInCharacters() sounds like a function which returns some kind of an offset
3125         but it doesn't. It returns true when called on a CharacterData and false elsewhere.
3126
3127         * accessibility/AXObjectCache.cpp:
3128         (WebCore::characterOffsetsInOrder):
3129         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
3130         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
3131         * dom/CharacterData.cpp:
3132         (WebCore::CharacterData::offsetInCharacters const): Deleted.
3133         * dom/CharacterData.h:
3134         * dom/Node.cpp:
3135         (WebCore::Node::offsetInCharacters const): Deleted.
3136         * dom/Node.h:
3137         * dom/Position.cpp:
3138         (WebCore::Position::parentAnchoredEquivalent const):
3139         * dom/Position.h:
3140         (WebCore::lastOffsetInNode):
3141         (WebCore::minOffsetForNode):
3142         (WebCore::offsetIsBeforeLastNodeOffset):
3143         * dom/Range.cpp:
3144         (WebCore::Range::firstNode const):
3145         (WebCore::Range::pastLastNode const):
3146         * dom/RangeBoundaryPoint.h:
3147         (WebCore::RangeBoundaryPoint::setOffset):
3148         (WebCore::RangeBoundaryPoint::setToEndOfNode):
3149         * editing/Editing.cpp:
3150         (WebCore::lastOffsetForEditing):
3151         * editing/TextIterator.cpp:
3152         (WebCore::nextInPreOrderCrossingShadowBoundaries):
3153         (WebCore::TextIterator::node const):
3154         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3155         * page/DOMSelection.cpp:
3156         (WebCore::DOMSelection::extend):
3157
3158 2018-09-28  Jer Noble  <jer.noble@apple.com>
3159
3160         Refactoring: eliminate raw pointer usage in Fullscreen code
3161         https://bugs.webkit.org/show_bug.cgi?id=188747
3162         <rdar://problem/43541164>
3163
3164         Reviewed by Alex Christensen.
3165
3166         Two sources of raw pointers in the Fullscreen code:
3167         - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
3168           they are passed around as raw references.
3169         - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
3170           VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
3171           be ref-able.
3172
3173         Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
3174         derefModel methods, overridden by implementing subclasses. Make every concrete observer
3175         inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
3176         the client interface.
3177
3178         Since every Interface class now holds a strong reference to its Model classes, and each
3179         Model class holds a weak reference to all its clients, no explicit invalidate() method
3180         is necessary.
3181
3182         Notes:
3183
3184         - Since the weak pointer methods need to be able to downcast to the abstract base class,
3185           observers need to inherit publically (rather than privately) from those base classes.
3186         - Media element Models should compose EventListener rather than inheriting from it, since
3187           EventListener has its own RefCount.
3188         - WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
3189           their underlying object is destroyed), so clients should be stored in a Vector instead.
3190         - Interfaces should be given all required Refs at creation time, so that they can store
3191           those parameters as Refs instead of RefPtrs.
3192
3193         * platform/cocoa/PlaybackSessionInterface.h:
3194         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
3195         * platform/cocoa/PlaybackSessionModel.h:
3196         (WebCore::PlaybackSessionModel::ref):
3197         (WebCore::PlaybackSessionModel::deref):
3198         (WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
3199         * platform/cocoa/PlaybackSessionModelMediaElement.h:
3200         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
3201         (WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
3202         (WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
3203         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
3204         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
3205         (WebCore::PlaybackSessionModelMediaElement::addClient):
3206         (WebCore::PlaybackSessionModelMediaElement::removeClient):
3207         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
3208         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
3209         (WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
3210         * platform/cocoa/VideoFullscreenChangeObserver.h:
3211         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
3212         * platform/cocoa/VideoFullscreenModel.h:
3213         (WebCore::VideoFullscreenModel::ref):
3214         (WebCore::VideoFullscreenModel::deref):
3215         (WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
3216         * platform/cocoa/VideoFullscreenModelVideoElement.h:
3217         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
3218         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
3219         (VideoFullscreenModelVideoElement::setVideoElement):
3220         (VideoFullscreenModelVideoElement::addClient):
3221         (VideoFullscreenModelVideoElement::removeClient):
3222         (VideoFullscreenModelVideoElement::setHasVideo):
3223         (VideoFullscreenModelVideoElement::setVideoDimensions):
3224         (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
3225         (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
3226         (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
3227         (VideoFullscreenModelVideoElement::willExitPictureInPicture):
3228         (VideoFullscreenModelVideoElement::didExitPictureInPicture):
3229         (VideoFullscreenModelVideoElement::handleEvent): Deleted.
3230         * platform/ios/PlaybackSessionInterfaceAVKit.h:
3231         (WebCore::PlaybackSessionInterfaceAVKit::create):
3232         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
3233         (): Deleted.
3234         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
3235         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
3236         (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
3237         (WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
3238         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3239         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3240         (-[WebAVPlayerLayer layoutSublayers]):
3241         (-[WebAVPlayerLayer resolveBounds]):
3242         (-[WebAVPlayerLayer setVideoGravity:]):
3243         (VideoFullscreenInterfaceAVKit::create):
3244         (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
3245         (VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
3246         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
3247         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
3248         (VideoFullscreenInterfaceAVKit::setupFullscreen):
3249         (VideoFullscreenInterfaceAVKit::presentingViewController):
3250         (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
3251         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
3252         (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
3253         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
3254         (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
3255         (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
3256         (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
3257         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
3258         (VideoFullscreenInterfaceAVKit::doSetup):
3259         (VideoFullscreenInterfaceAVKit::setMode):
3260         (VideoFullscreenInterfaceAVKit::clearMode):
3261         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
3262         (VideoFullscreenInterfaceAVKit::invalidate): Deleted.
3263         * platform/ios/WebAVPlayerController.h:
3264         * platform/ios/WebAVPlayerController.mm:
3265         (-[WebAVPlayerController delegate]):
3266         (-[WebAVPlayerController playbackSessionInterface]):
3267         (-[WebAVPlayerController setPlaybackSessionInterface:]):
3268         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3269         (VideoFullscreenControllerContext::didCleanupFullscreen):
3270         (VideoFullscreenControllerContext::addClient):
3271         (VideoFullscreenControllerContext::removeClient):
3272         (VideoFullscreenControllerContext::willEnterPictureInPicture):
3273         (VideoFullscreenControllerContext::didEnterPictureInPicture):
3274         (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
3275         (VideoFullscreenControllerContext::willExitPictureInPicture):
3276         (VideoFullscreenControllerContext::didExitPictureInPicture):
3277         (VideoFullscreenControllerContext::setUpFullscreen):
3278         * platform/mac/PlaybackSessionInterfaceMac.h:
3279         * platform/mac/PlaybackSessionInterfaceMac.mm:
3280         (WebCore::PlaybackSessionInterfaceMac::create):
3281         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
3282         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
3283         (WebCore::PlaybackSessionInterfaceMac::rateChanged):
3284         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
3285         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
3286         (WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
3287         (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
3288         (WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
3289         (WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
3290         * platform/mac/VideoFullscreenInterfaceMac.h:
3291         (WebCore::VideoFullscreenInterfaceMac::create):
3292         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
3293         (WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
3294         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
3295         * platform/mac/VideoFullscreenInterfaceMac.mm:
3296         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
3297         (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
3298         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
3299         (-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
3300         (-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
3301         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
3302         (WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
3303         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
3304         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
3305         (WebCore::VideoFullscreenInterfaceMac::setMode):
3306         (WebCore::VideoFullscreenInterfaceMac::clearMode):
3307         (WebCore::VideoFullscreenInterfaceMac::invalidate):
3308         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
3309         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
3310         * platform/mac/WebPlaybackControlsManager.mm:
3311         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
3312         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
3313         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
3314         (-[WebPlaybackControlsManager togglePlayback]):
3315         (-[WebPlaybackControlsManager setPlaying:]):
3316         (-[WebPlaybackControlsManager isPlaying]):
3317         (-[WebPlaybackControlsManager togglePictureInPicture]):
3318
3319 2018-09-28  Chris Dumez  <cdumez@apple.com>
3320
3321         Drop iOS specific quirk in SettingsBase::scriptEnabledChanged()
3322         https://bugs.webkit.org/show_bug.cgi?id=190077
3323         <rdar://problem/44812613>
3324
3325         Reviewed by Zalan Bujtas.
3326
3327         Drop iOS specific quirk in SettingsBase::scriptEnabledChanged() that would dirty style after the
3328         "JavaScriptEnabled" setting's state is toggled. I do not see a good reason to do this given that
3329         scripts would not get executed until a reload.
3330
3331         If we find out after dropping this that this is actually useful for some reason, then we can
3332         always bring it back and consider making this non-iOS specific, as well as documenting why this
3333         it is needed.
3334
3335         * page/Settings.yaml:
3336         * page/SettingsBase.cpp:
3337         (WebCore::SettingsBase::scriptEnabledChanged): Deleted.
3338         * page/SettingsBase.h:
3339
3340 2018-09-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3341
3342         [Curl] Fix priority issue with multiple cookies with different level of path.
3343         https://bugs.webkit.org/show_bug.cgi?id=189920
3344
3345         Reviewed by Fujii Hironori.
3346
3347         When multiple cookies are stored in the database for same site, the priority of
3348         multiple cookies which matches path criteria was not defined. The backend
3349         implementation `sqlite` then returns the first matching result, which is the one
3350         stored earlier.
3351
3352         Test: http/tests/cookies/cookie-with-multiple-level-path.html
3353
3354         * platform/network/curl/CookieJarDB.cpp:
3355         (WebCore::CookieJarDB::searchCookies):
3356
3357 2018-09-26  Ryosuke Niwa  <rniwa@webkit.org>
3358
3359         Use enum class in createMarkup arguments
3360         https://bugs.webkit.org/show_bug.cgi?id=190028
3361
3362         Reviewed by Wenson Hsieh.
3363
3364         Replaced enums used by createMarkup with equivalent enum classes: EChildrenOnly with SerializedNodes,
3365         EAbsoluteURLs with ResolveURLs, and EFragmentSerialization with SerializationSyntax.
3366
3367         Also replaced the boolean convertBlocksToInlines with an enum class of the same name.
3368
3369         Finally, renamed the createMarkup variant which doesn't serialize style and used for innerHTML and XMLSerializer
3370         to serializeFragment.
3371
3372         * dom/Element.cpp:
3373         (WebCore::Element::innerHTML const):
3374         (WebCore::Element::outerHTML const):
3375         * dom/ShadowRoot.cpp:
3376         (WebCore::ShadowRoot::innerHTML const):
3377         * editing/CompositeEditCommand.cpp:
3378         (WebCore::CompositeEditCommand::moveParagraphs):
3379         * editing/HTMLInterchange.h:
3380         (WebCore::AnnotateForInterchange): Renamed from EAnnotateForInterchange.
3381         * editing/MarkupAccumulator.cpp:
3382         (WebCore::MarkupAccumulator::MarkupAccumulator):
3383         (WebCore::MarkupAccumulator::serializeNodes):
3384         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
3385         (WebCore::MarkupAccumulator::resolveURLIfNeeded const):
3386         * editing/MarkupAccumulator.h:
3387         (WebCore::MarkupAccumulator::inXMLFragmentSerialization const):
3388         * editing/ReplaceRangeWithTextCommand.cpp:
3389         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
3390         * editing/ReplaceSelectionCommand.cpp:
3391         (WebCore::ReplaceSelectionCommand::willApplyCommand):
3392         * editing/SpellingCorrectionCommand.cpp:
3393         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
3394         * editing/cocoa/EditorCocoa.mm:
3395         (WebCore::Editor::selectionInHTMLFormat):
3396         * editing/cocoa/WebContentReaderCocoa.mm:
3397         (WebCore::WebContentMarkupReader::readRTFD):<