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