05949be24b6755555509935ddeb5f9f31f963327
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2
3         Null pointer dereference in JSC::WriteBarrierBase()
4         https://bugs.webkit.org/show_bug.cgi?id=191252
5
6         Reviewed by Keith Miller.
7
8         * bindings/js/JSCustomElementRegistryCustom.cpp:
9         (WebCore::JSCustomElementRegistry::whenDefined):
10         * bindings/js/JSDOMPromiseDeferred.cpp:
11         (WebCore::createDeferredPromise):
12         * bindings/js/JSDOMPromiseDeferred.h:
13         (WebCore::DeferredPromise::create):
14         (WebCore::callPromiseFunction):
15         * bindings/js/JSDOMWindowBase.cpp:
16         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
17         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
18         * bindings/js/ScriptModuleLoader.cpp:
19         (WebCore::ScriptModuleLoader::fetch):
20         (WebCore::rejectPromise):
21
22 2018-12-15  Darin Adler  <darin@apple.com>
23
24         Use warning-ignoring macros more consistently and simply
25         https://bugs.webkit.org/show_bug.cgi?id=192743
26
27         Reviewed by Mark Lam.
28
29         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
30         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
31         files like this one with non-clang compilers, and no need to worry about
32         them when choosing the macro.
33
34         * crypto/mac/CryptoKeyRSAMac.cpp:
35         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
36
37         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
38         the "unknown-pragmas" trick, which the macro should take care of.
39         * css/makevalues.pl: Ditto.
40         * platform/ColorData.gperf: Ditto.
41
42         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
43         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
44         (see rationale above for Objective-C++).
45
46         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
47         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
48         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
49         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
50         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
51
52         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
53         (see rationale above for Objective-C++).
54
55         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
56         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
57         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
58
59         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
60         (see rationale above for Objective-C++).
61
62         * platform/network/cocoa/ResourceResponseCocoa.mm:
63         (WebCore::ResourceResponse::platformCertificateInfo const): Use
64         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
65
66 2018-12-15  Darin Adler  <darin@apple.com>
67
68         Replace many uses of String::format with more type-safe alternatives
69         https://bugs.webkit.org/show_bug.cgi?id=192742
70
71         Reviewed by Mark Lam.
72
73         A while back, String::format was more efficient than string concatenation,
74         but that is no longer true, and we should prefer String::number, makeString,
75         or concatenation with the "+" operator to String::format for new code.
76
77         This is not as good for programmers who are fond of printf formatting
78         style, and in some cases it's a little harder to read the strings
79         interspersed with variables rather than a format string, but it's better
80         in a few ways:
81
82         - more efficient (I didn't measure the difference, but it's definitely
83           slower to use String::Format which calls vsnprintf twice than to use
84           the WTF code)
85         - works in a type-safe way without a need to use a format specifier such
86           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
87           subtle differences between platforms
88         - allows us to use StringView in some cases to sidestep the need to
89           allocate temporary WTF::String objects
90         - does not require converting each WTF::String to a C string, allowing
91           us to remove many cases of ".utf8().data()" and similar expressions,
92           eliminating the allocation of temporary WTF::CString objects
93
94         This patch covers a batch of easiest-to-convert call sites.
95         Later patches will allow us to deprecate or remove String::format.
96
97         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
98         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
99         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
100         (WebCore::IDBCursorInfo::loggingString const): Ditto.
101         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
102         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
103         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
104         (WebCore::IDBGetRecordData::loggingString const): Ditto.
105         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
106         (WebCore::IDBIndexInfo::loggingString const): Ditto.
107         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
108         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
109         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
110         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
111         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
112         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
113         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
114         * Modules/webdatabase/Database.cpp:
115         (WebCore::formatErrorMessage): Ditto.
116         * Modules/webdatabase/SQLError.h:
117         (WebCore::SQLError::create): Ditto.
118
119         * bindings/scripts/CodeGeneratorJS.pm:
120         (GenerateImplementation): Use makeString.
121
122         * bindings/scripts/test/JS/JSInterfaceName.cpp:
123         * bindings/scripts/test/JS/JSMapLike.cpp:
124         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
125         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
126         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
127         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
128         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
129         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
130         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
131         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
132         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
133         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
134         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
135         * bindings/scripts/test/JS/JSTestException.cpp:
136         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
137         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
138         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
139         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
140         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
141         * bindings/scripts/test/JS/JSTestInterface.cpp:
142         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
143         * bindings/scripts/test/JS/JSTestIterable.cpp:
144         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
145         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
146         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
147         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
148         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
149         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
150         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
151         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
152         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
153         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
154         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
155         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
156         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
157         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
158         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
159         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
160         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
161         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
162         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
163         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
164         * bindings/scripts/test/JS/JSTestNode.cpp:
165         * bindings/scripts/test/JS/JSTestObj.cpp:
166         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
167         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
168         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
169         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
170         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
171         * bindings/scripts/test/JS/JSTestSerialization.cpp:
172         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
173         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
174         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
175         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
176         * bindings/scripts/test/JS/JSTestStringifier.cpp:
177         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
178         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
179         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
180         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
181         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
182         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
183         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
184         Updated expected results.
185 :
186         * css/parser/CSSPropertyParserHelpers.cpp:
187         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
188         and makeString.
189
190         * html/HTMLSelectElement.cpp:
191         (WebCore::HTMLSelectElement::setLength): Use makeString.
192         * html/ImageDocument.cpp:
193         (WebCore::ImageDocument::imageUpdated): Ditto.
194         * html/parser/XSSAuditor.cpp:
195         (WebCore::XSSAuditor::init): Ditto.
196         * inspector/InspectorFrontendClientLocal.cpp:
197         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
198         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
199         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
200         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
201         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
202         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
203         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
204         * page/MemoryRelease.cpp:
205         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
206
207         * page/cocoa/ResourceUsageOverlayCocoa.mm:
208         (WebCore::formatByteNumber): Use String::number.
209         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
210
211         * page/cocoa/ResourceUsageThreadCocoa.mm:
212         (WebCore::logFootprintComparison): Use makeString.
213         * platform/animation/TimingFunction.cpp:
214         (WebCore::TimingFunction::cssText const): Ditto.
215
216         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
217         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
218         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
219         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
220
221         * platform/graphics/ca/GraphicsLayerCA.cpp:
222         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
223         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
224         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
225         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
226         * platform/mock/MockRealtimeVideoSource.cpp:
227         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
228
229         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
230
231         * platform/network/ParsedContentRange.cpp:
232         (WebCore::ParsedContentRange::headerValue const): Use makeString.
233
234         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
235         compiler conditionals and reorganized the start/stop of namespaces.
236         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
237
238         * platform/sql/SQLiteDatabase.cpp:
239         (WebCore::unauthorizedSQLFunction): Use makeString.
240         * rendering/RenderLayerCompositor.cpp:
241         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
242         * workers/service/server/RegistrationDatabase.cpp:
243         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
244         (WebCore::RegistrationDatabase::importRecords): Ditto.
245
246 2018-12-15  Youenn Fablet  <youenn@apple.com>
247
248         Make RTCRtpSender.setParameters to activate specific encodings
249         https://bugs.webkit.org/show_bug.cgi?id=192732
250
251         Reviewed by Eric Carlson.
252
253         The conversion between libwebrtc and WebCore is lossy for send parameters.
254         Libwebrtc checking the differences of values, call to setParameters will often fail.
255
256         Given some parameters cannot be exposed, the sender backend keeps the
257         current set of parameters when gathered and reuses them when parameters are set.
258
259         For encodings, we only change activate/maxBitRate/maxFrameRate as
260         these are the most important parameters to be able to modify.
261
262         Covered by added tests in webrtc/video.html.
263
264         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
265         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
266         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
267         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
268         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
269         (WebCore::fromRTCRtpSendParameters):
270         (WebCore::fromRTCEncodingParameters): Deleted.
271         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
272
273 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
274
275         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
276         https://bugs.webkit.org/show_bug.cgi?id=192724
277         <rdar://problem/46745911>
278
279         Reviewed by Devin Rousso.
280
281         iOS never installs the InspectorOverlay page as a page overlay.
282         It also uses its own node highlighting painting. Avoid any work
283         and resources associated with the overlay page for iOS.
284
285         * inspector/InspectorOverlay.cpp:
286         (WebCore::InspectorOverlay::paint):
287         (WebCore::InspectorOverlay::update):
288         (WebCore::InspectorOverlay::overlayPage):
289         (WebCore::evaluateCommandInOverlay):
290
291 2018-12-14  Youenn Fablet  <youenn@apple.com>
292
293         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
294         https://bugs.webkit.org/show_bug.cgi?id=192720
295
296         Reviewed by Eric Carlson.
297
298         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
299         as the latter is a ref counted object.
300         Made some refactoring to return early in case of error.
301
302         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
303         the MediaRecorder will stop listening for its tracks.
304         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
305
306         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
307
308         * Modules/mediarecorder/MediaRecorder.cpp:
309         (WebCore::MediaRecorder::didAddOrRemoveTrack):
310         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
311         * Modules/mediarecorder/MediaRecorder.h:
312         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
313         (WebCore::MediaRecorderPrivateAVFImpl::create):
314         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
315         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
316         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
317         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
318         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
319         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
320         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
321         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
322         (WebCore::MediaRecorderPrivateWriter::create):
323         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
324         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
325         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
326
327 2018-12-14  Youenn Fablet  <youenn@apple.com>
328
329         getSenders/getReceivers() should not return closed transceiver senders/receivers
330         https://bugs.webkit.org/show_bug.cgi?id=192706
331
332         Reviewed by Eric Carlson.
333
334         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
335         This forces us to compute the sender/receiver list at getter call time.
336         Updated the internal call sites of senders to use the list of transceivers instead.
337
338         Covered by updated WPT tests.
339
340         * Modules/mediastream/RTCPeerConnection.cpp:
341         (WebCore::RTCPeerConnection::addTrack):
342         (WebCore::RTCPeerConnection::getSenders const):
343         (WebCore::RTCPeerConnection::getReceivers const):
344         * Modules/mediastream/RTCPeerConnection.h:
345         * Modules/mediastream/RTCRtpTransceiver.cpp:
346         (WebCore::RTCRtpTransceiver::stopped const):
347         (WebCore::RtpTransceiverSet::append):
348         (WebCore::RtpTransceiverSet::senders const):
349         (WebCore::RtpTransceiverSet::receivers const):
350         * Modules/mediastream/RTCRtpTransceiver.h:
351         (WebCore::RtpTransceiverSet::senders const): Deleted.
352         (WebCore::RtpTransceiverSet::receivers const): Deleted.
353         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
354         (WebCore::findExistingSender):
355         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
356
357 2018-12-14  David Kilzer  <ddkilzer@apple.com>
358
359         clang-tidy: Fix unnecessary copy of objects for operator==() methods
360         <https://webkit.org/b/192712>
361         <rdar://problem/46739332>
362
363         Reviewed by Andy Estes.
364
365         * contentextensions/HashableActionList.h:
366         (WebCore::ContentExtensions::HashableActionList::operator== const):
367         (WebCore::ContentExtensions::HashableActionList::operator!= const):
368         * platform/network/FormData.h:
369         (WebCore::FormDataElement::EncodedFileData::operator== const):
370         (WebCore::FormDataElement::EncodedBlobData::operator== const):
371         - Change arguments from const to const reference to avoid
372           copies.
373
374 2018-12-14  Jer Noble  <jer.noble@apple.com>
375
376         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
377         https://bugs.webkit.org/show_bug.cgi?id=192713
378         <rdar://problem/46739706>
379
380         Reviewed by Eric Carlson.
381
382         A callback is being called twice, and the second time has a null Promise. Instead of these
383         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
384         have ASSERTS() that they are called once-and-only-once.
385
386         * platform/encryptedmedia/CDMInstanceSession.h:
387         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
388         (WebCore::CDMInstanceSessionClearKey::closeSession):
389         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
390         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
391         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
392         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
393         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
394         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
395
396 2018-12-14  David Kilzer  <ddkilzer@apple.com>
397
398         clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
399         <https://webkit.org/b/192708>
400         <rdar://problem/46735907>
401
402         Reviewed by Jer Noble.
403
404         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
405         (WebCore::toSample):
406         - Make argument a const reference.
407
408         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
409         - Update method signatures for implementation changes.
410         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
411         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
412         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
413         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
414         - Make RetainPtr<> argument an rvalue reference and use WTFMove().
415         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
416         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
417         - Make RetainPtr<> argument a const reference.
418
419         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
420         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
421         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
422         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
423         - Change for loop keys to be const references.
424
425         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
426         - Update method signatures for implementation changes.
427         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
428         (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
429         (WebCore::SourceBufferPrivateAVFObjC::seekToTime):
430         - Make Mediatime arguments a const reference.
431
432 2018-12-14  Simon Fraser  <simon.fraser@apple.com>
433
434         REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
435         https://bugs.webkit.org/show_bug.cgi?id=188655
436         rdar://problem/43382687
437
438         Reviewed by Antoine Quint.
439
440         The logic that computes animation extent, used by backing store attachment code, failed
441         to account for the behavior where a keyframe animation with a missing 0% keyframe uses
442         the transform from the unanimated style. This resulted in the computed extent being wrong,
443         which caused us to remove the layer's backing store in some scenarios.
444
445         Fix both animation code paths to use the renderer style if the first keyframe doesn't
446         contain a transform.
447
448         Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
449                legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html
450
451         * animation/KeyframeEffect.cpp:
452         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
453         * page/animation/KeyframeAnimation.cpp:
454         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
455
456 2018-12-14  Chris Dumez  <cdumez@apple.com>
457
458         [PSON] Stop exposing PolicyAction::Suspend to WebCore
459         https://bugs.webkit.org/show_bug.cgi?id=192701
460
461         Reviewed by Brady Eidson.
462
463         Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.
464
465         * loader/DocumentLoader.cpp:
466         (WebCore::DocumentLoader::continueAfterContentPolicy):
467         * loader/FrameLoaderTypes.h:
468         * loader/PolicyChecker.cpp:
469         (WebCore::PolicyChecker::checkNavigationPolicy):
470         (WebCore::PolicyChecker::checkNewWindowPolicy):
471
472 2018-12-14  Youenn Fablet  <youenn@apple.com>
473
474         IDB should store RTCCertificate
475         https://bugs.webkit.org/show_bug.cgi?id=192599
476
477         Reviewed by Brady Eidson.
478
479         In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
480         Instead, create an empty object so that the deserialization can still succeed.
481         This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.
482
483         Test: webrtc/certificates-indexeddb.html
484
485         * bindings/js/SerializedScriptValue.cpp:
486         (WebCore::CloneDeserializer::readTerminal):
487
488 2018-12-14  Zalan Bujtas  <zalan@apple.com>
489
490         [LFC][BFC] Transition to logical margin types.
491         https://bugs.webkit.org/show_bug.cgi?id=192699
492
493         Reviewed by Antti Koivisto.
494
495         This is in preparation for moving over to logical types.
496         (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))
497
498         * layout/FormattingContext.cpp:
499         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
500         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
501         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
502         * layout/FormattingContext.h:
503         * layout/FormattingContextGeometry.cpp:
504         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
505         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
506         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
507         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
508         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
509         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
510         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
511         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
512         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
513         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
514         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
515         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
516         * layout/FormattingContextQuirks.cpp:
517         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
518         * layout/MarginTypes.h:
519         (WebCore::Layout::VerticalMargin::usedValues const):
520         * layout/Verification.cpp:
521         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
522         * layout/blockformatting/BlockFormattingContext.cpp:
523         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
524         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
525         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
526         (WebCore::Layout::hasPrecomputedMarginBefore):
527         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
528         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
529         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
530         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
531         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
532         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
533         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
534         (WebCore::Layout::hasPrecomputedMarginTop): Deleted.
535         * layout/blockformatting/BlockFormattingContext.h:
536         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
537         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
538         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
539         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
540         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
541         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
542         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
543         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
544         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
545         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
546         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
547         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
548         (WebCore::Layout::hasMarginBeforeQuirkValue):
549         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
550         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
551         (WebCore::Layout::hasMarginTopQuirkValue): Deleted.
552         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
553         * layout/blockformatting/BlockMarginCollapse.cpp:
554         (WebCore::Layout::isMarginBeforeCollapsedWithSibling):
555         (WebCore::Layout::isMarginAfterCollapsedWithSibling):
556         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
557         (WebCore::Layout::isMarginAfterCollapsedThrough):
558         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
559         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
560         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
561         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
562         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
563         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
564         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
565         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
566         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
567         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
568         (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
569         (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
570         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
571         (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
572         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
573         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
574         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
575         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
576         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
577         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
578         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
579         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
580         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
581         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
582         * layout/displaytree/DisplayBox.cpp:
583         (WebCore::Display::Box::Box):
584         (WebCore::Display::Box::marginBox const):
585         (WebCore::Display::Box::nonCollapsedMarginBox const):
586         * layout/displaytree/DisplayBox.h:
587         (WebCore::Display::Box::rectWithMargin const):
588         (WebCore::Display::Box::estimatedMarginBefore const):
589         (WebCore::Display::Box::setEstimatedMarginBefore):
590         (WebCore::Display::Box::top const):
591         (WebCore::Display::Box::topLeft const):
592         (WebCore::Display::Box::setVerticalMargin):
593         (WebCore::Display::Box::marginBefore const):
594         (WebCore::Display::Box::marginStart const):
595         (WebCore::Display::Box::marginAfter const):
596         (WebCore::Display::Box::marginEnd const):
597         (WebCore::Display::Box::nonCollapsedMarginBefore const):
598         (WebCore::Display::Box::nonCollapsedMarginAfter const):
599         (WebCore::Display::Box::nonComputedMarginStart const):
600         (WebCore::Display::Box::nonComputedMarginEnd const):
601         (WebCore::Display::Box::estimatedMarginTop const): Deleted.
602         (WebCore::Display::Box::setEstimatedMarginTop): Deleted.
603         (WebCore::Display::Box::marginTop const): Deleted.
604         (WebCore::Display::Box::marginLeft const): Deleted.
605         (WebCore::Display::Box::marginBottom const): Deleted.
606         (WebCore::Display::Box::marginRight const): Deleted.
607         (WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
608         (WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
609         (WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
610         (WebCore::Display::Box::nonComputedMarginRight const): Deleted.
611         * layout/floats/FloatAvoider.cpp:
612         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
613         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
614         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
615         * layout/floats/FloatAvoider.h:
616         (WebCore::Layout::FloatAvoider::marginBefore const):
617         (WebCore::Layout::FloatAvoider::marginAfter const):
618         (WebCore::Layout::FloatAvoider::marginStart const):
619         (WebCore::Layout::FloatAvoider::marginEnd const):
620         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
621         (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
622         (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
623         (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
624         (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
625         * layout/floats/FloatBox.cpp:
626         (WebCore::Layout::FloatBox::rect const):
627         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
628         (WebCore::Layout::FloatBox::verticalPositionCandidate):
629         (WebCore::Layout::FloatBox::initialVerticalPosition const):
630         * layout/floats/FloatingContext.cpp:
631         (WebCore::Layout::FloatingContext::positionForFloat const):
632         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
633         * layout/inlineformatting/InlineFormattingContext.cpp:
634         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
635
636 2018-12-14  Zalan Bujtas  <zalan@apple.com>
637
638         [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
639         https://bugs.webkit.org/show_bug.cgi?id=192692
640
641         Reviewed by Antti Koivisto.
642
643         This is in preparation for completing block margin collapsing.
644
645         * WebCore.xcodeproj/project.pbxproj:
646         * layout/FormattingContext.cpp:
647         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
648         * layout/FormattingContext.h:
649         * layout/FormattingContextGeometry.cpp:
650         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
651         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
652         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
653         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
654         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
655         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
656         * layout/LayoutState.cpp:
657         (WebCore::Layout::LayoutState::LayoutState):
658         * layout/LayoutUnits.h:
659         (WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
660         * layout/MarginTypes.h: Added.
661         (WebCore::Layout::VerticalMargin::nonCollapsedValues const):
662         (WebCore::Layout::VerticalMargin::collapsedValues const):
663         (WebCore::Layout::VerticalMargin::setCollapsedValues):
664         (WebCore::Layout::VerticalMargin::VerticalMargin):
665         (WebCore::Layout::VerticalMargin::usedValues const):
666         * layout/blockformatting/BlockFormattingContext.cpp:
667         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
668         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
669         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
670         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
671         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
672         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
673         * layout/displaytree/DisplayBox.cpp:
674         (WebCore::Display::Box::Box):
675         * layout/displaytree/DisplayBox.h:
676         (WebCore::Display::Box::setHorizontalMargin):
677         (WebCore::Display::Box::setVerticalMargin):
678         (WebCore::Display::Box::setHorizontalNonComputedMargin):
679         (WebCore::Display::Box::verticalMargin const):
680         (WebCore::Display::Box::marginTop const):
681         (WebCore::Display::Box::marginLeft const):
682         (WebCore::Display::Box::marginBottom const):
683         (WebCore::Display::Box::marginRight const):
684         (WebCore::Display::Box::nonCollapsedMarginTop const):
685         (WebCore::Display::Box::nonCollapsedMarginBottom const):
686         (WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
687         * layout/floats/FloatingContext.cpp:
688         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
689         * layout/inlineformatting/InlineFormattingContext.cpp:
690         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
691
692 2018-12-14  Fujii Hironori  <Hironori.Fujii@sony.com>
693
694         [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
695         https://bugs.webkit.org/show_bug.cgi?id=192693
696
697         Reviewed by Ross Kirsling.
698
699         No new tests, no behavior changes.
700
701         * platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
702         * platform/win/CursorWin.cpp:
703         (WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
704         * platform/win/DefWndProcWindowClass.cpp:
705         (WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
706         * platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
707         * platform/win/PasteboardWin.cpp:
708         (WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
709         (WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
710         * platform/win/PlatformMouseEventWin.cpp:
711         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
712         * platform/win/PopupMenuWin.cpp:
713         (WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
714         * platform/win/PopupMenuWin.h: Marked override methods with 'override'.
715         * platform/win/SSLKeyGeneratorWin.cpp:
716         (WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace.
717         (WebCore::signedPublicKeyAndChallengeString): Ditto.
718         * platform/win/SearchPopupMenuDB.cpp:
719         (WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT.
720         * platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86).
721         * platform/win/SystemInfo.cpp:
722         (WebCore::osVersionForUAString): Added default case.
723
724 2018-12-13  Youenn Fablet  <youenn@apple.com>
725
726         RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
727         https://bugs.webkit.org/show_bug.cgi?id=192685
728
729         Reviewed by Eric Carlson.
730
731         In case the remote description contains a rejected m section,
732         the corresponding transceiver should be marked as stopped.
733         Libwebrtc backend has that information so pipe it up to JS.
734
735         Covered by updated WPT test.
736
737         * Modules/mediastream/RTCRtpTransceiver.cpp:
738         (WebCore::RTCRtpTransceiver::stopped const):
739         * Modules/mediastream/RTCRtpTransceiver.h:
740         (WebCore::RTCRtpTransceiver::stopped const): Deleted.
741         * Modules/mediastream/RTCRtpTransceiverBackend.h:
742         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
743         (WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
744         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
745
746 2018-12-13  Mark Lam  <mark.lam@apple.com>
747
748         Ensure that StructureFlags initialization always starts with Base::StructureFlags.
749         https://bugs.webkit.org/show_bug.cgi?id=192686
750
751         Reviewed by Keith Miller.
752
753         No new tests needed because there's no new functionality.  Just refactoring.
754
755         * bindings/js/JSDOMWindowProperties.h:
756         * bindings/scripts/CodeGeneratorJS.pm:
757         (GenerateHeader):
758         (GeneratePrototypeDeclaration):
759         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
760         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
761         * bindings/scripts/test/JS/JSTestEventTarget.h:
762         * bindings/scripts/test/JS/JSTestGlobalObject.h:
763         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
764         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
765         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
766         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
767         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
768         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
769         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
770         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
771         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
772         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
773         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
774         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
775         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
776         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
777         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
778         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
779         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
780         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
781         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
782         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
783         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
784         * bindings/scripts/test/JS/JSTestObj.h:
785         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
786         * bindings/scripts/test/JS/JSTestPluginInterface.h:
787         * bindings/scripts/test/JS/JSTestTypedefs.h:
788
789 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
790
791         Make HTMLConverter work across shadow boundaries
792         https://bugs.webkit.org/show_bug.cgi?id=192640
793
794         Reviewed by Wenson Hsieh.
795
796         Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions.
797
798         Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html
799                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html
800                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html
801                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html
802                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html
803                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html
804                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html
805                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html
806
807         * dom/Position.cpp:
808         (WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter
809         and serializePreservingVisualAppearanceInternal.
810         * dom/Position.h:
811         * editing/cocoa/HTMLConverter.mm:
812         (HTMLConverter::convert):
813         (HTMLConverterCaches::propertyValueForNode):
814         (HTMLConverterCaches::floatPropertyValueForNode):
815         (HTMLConverter::_blockLevelElementForNode):
816         (HTMLConverterCaches::colorPropertyValueForNode):
817         (HTMLConverter::aggregatedAttributesForAncestors):
818         (HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
819         (HTMLConverter::_processElement):
820         (HTMLConverter::_traverseNode):
821         (HTMLConverter::_traverseFooterNode):
822         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
823         (WebCore::attributedStringFromSelection):
824         * editing/markup.cpp:
825         (WebCore::commonShadowIncludingAncestor): Moved to Position.cpp.
826
827 2018-12-13  Youenn Fablet  <youenn@apple.com>
828
829         Trying to play a media element synchronously after setting srcObject should succeed without user gesture
830         https://bugs.webkit.org/show_bug.cgi?id=192679
831
832         Reviewed by Eric Carlson.
833
834         Check the srcObject mediaProvider value which is set synchronously.
835         Covered by updated fast/mediastream/local-audio-playing-event.html.
836
837         * html/HTMLMediaElement.h:
838         (WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):
839
840 2018-12-13  Wenson Hsieh  <wenson_hsieh@apple.com>
841
842         [iOS] Support dropping contact card data (public.vcard) in editable content
843         https://bugs.webkit.org/show_bug.cgi?id=192570
844         <rdar://problem/35626913>
845
846         Reviewed by Tim Horton.
847
848         Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details.
849
850         Tests:  DragAndDropTests.ExternalSourceContactIntoEditableAreas
851                 DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea
852                 DragAndDropTests.ExternalSourceMapItemIntoEditableAreas
853                 WKAttachmentTestsIOS.InsertDroppedContactAsAttachment
854                 WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment
855
856         * editing/WebContentReader.h:
857         * editing/cocoa/WebContentReaderCocoa.mm:
858         (WebCore::attachmentForFilePath):
859
860         Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths`
861         as well as `readVirtualContactFile`.
862
863         (WebCore::WebContentReader::readFilePaths):
864         (WebCore::WebContentReader::readVirtualContactFile):
865
866         Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting
867         fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is
868         empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a
869         contact, there is no associated URL, so we only have an attachment.
870
871         * platform/Pasteboard.h:
872         * platform/ios/PasteboardIOS.mm:
873         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
874
875         Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for
876         "public.vcard" data, which is then passed on to the web content reader. Additionally, by returning
877         `ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents
878         of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since
879         "public.vcard" conforms to "public.text").
880
881         (WebCore::Pasteboard::read):
882         (WebCore::Pasteboard::readRespectingUTIFidelities):
883         * platform/ios/WebItemProviderPasteboard.mm:
884         (-[NSItemProvider web_fileUploadContentTypes]):
885
886         Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is
887         tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only
888         suitable for deserialization into an `MKMapItem`.
889
890 2018-12-13  Devin Rousso  <drousso@apple.com>
891
892         Web Inspector: remove DOM.BackendNodeId and associated commands/events
893         https://bugs.webkit.org/show_bug.cgi?id=192478
894
895         Reviewed by Matt Baker.
896
897         Removing unused code, so no change in functionality.
898
899         * inspector/agents/InspectorDOMAgent.h:
900         * inspector/agents/InspectorDOMAgent.cpp:
901         (WebCore::InspectorDOMAgent::discardBindings):
902         (WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted.
903         (WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted.
904         (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted.
905
906 2018-12-13  Chris Dumez  <cdumez@apple.com>
907
908         [PSON] We should not need to navigate to 'about:blank' to suspend pages
909         https://bugs.webkit.org/show_bug.cgi?id=192668
910         <rdar://problem/46701466>
911
912         Reviewed by Alex Christensen.
913
914         * history/PageCache.cpp:
915         (WebCore::PageCache::addIfCacheable):
916         * history/PageCache.h:
917         * loader/DocumentLoader.cpp:
918         (WebCore::DocumentLoader::redirectReceived):
919         (WebCore::DocumentLoader::willSendRequest):
920         (WebCore::DocumentLoader::startLoadingMainResource):
921         * loader/DocumentLoader.h:
922         * loader/FrameLoader.cpp:
923         (WebCore::FrameLoader::init):
924         (WebCore::FrameLoader::stopAllLoaders):
925         (WebCore::FrameLoader::setDocumentLoader):
926         (WebCore::FrameLoader::commitProvisionalLoad):
927         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
928         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
929         * loader/FrameLoaderTypes.h:
930         * loader/PolicyChecker.cpp:
931         (WebCore::PolicyChecker::checkNavigationPolicy):
932         * loader/PolicyChecker.h:
933
934 2018-12-13  Per Arne Vollan  <pvollan@apple.com>
935
936         [macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences
937         https://bugs.webkit.org/show_bug.cgi?id=192638
938
939         Reviewed by Eric Carlson.
940
941         It is currently not possible to override caption styles generated from System Preferences with inline
942         WebVTT styles without adding !important. The reason for this is that the generated styles from
943         System preferences are author styles which have higher priority than the inline WebVTT styles, which
944         are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated
945         styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since
946         they are added after the generated styles. This patch also fixes a problem where inline styles could be
947         added twice to the video user agent shadow root.
948
949         Test: media/track/track-cue-css.html
950
951         * dom/ExtensionStyleSheets.cpp:
952         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
953         * html/track/VTTCue.cpp:
954         (WebCore::VTTCue::getDisplayTree):
955         * page/CaptionUserPreferences.cpp:
956         (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
957         * page/Page.cpp:
958         (WebCore::Page::setCaptionUserPreferencesStyleSheet):
959
960 2018-12-13  Jer Noble  <jer.noble@apple.com>
961
962         Fix leak of AVPlayer boundaryTimeObserver object.
963         https://bugs.webkit.org/show_bug.cgi?id=192674
964
965         Reviewed by Eric Carlson.
966
967         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
968         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
969
970 2018-12-13  Brent Fulgham  <bfulgham@apple.com>
971
972         Don't attempt to animate invalid CSS properties
973         https://bugs.webkit.org/show_bug.cgi?id=192630
974         <rdar://problem/46664433>
975
976         Reviewed by Antoine Quint.
977
978         Inherited animation properties can cause child elements to think they need to animate CSS properties
979         that they do not support, leading to nullptr crashes.
980
981         Recognize that CSSPropertyInvalid is a potential requested animation property, and handle it
982         cleanly.
983
984         Tests: animations/invalid-property-animation.html
985
986         * page/animation/CompositeAnimation.cpp:
987         (WebCore::CompositeAnimation::updateTransitions):
988         * svg/SVGAnimateElementBase.cpp:
989         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
990
991 2018-12-13  Timothy Hatcher  <timothy@apple.com>
992
993         REGRESSION (r230064): Focus rings on webpages are fainter than in native UI.
994         https://bugs.webkit.org/show_bug.cgi?id=192639
995         rdar://problem/42669297
996
997         Reviewed by Tim Horton.
998
999         The focus ring color passed to CoreGraphics is expected to be opaque, since they
1000         will apply opacity when drawing (because opacity is normally animated).
1001         We were getting this by accident before when the old `RenderThemeMac::systemColor()`
1002         used the old `convertNSColorToColor()`, which ignored alpha on NSColor.
1003         Existing tests use fixed test focus ring color.
1004
1005         * css/StyleResolver.cpp:
1006         (WebCore::StyleResolver::colorFromPrimitiveValue const): Use RenderTheme singleton for `focusRingColor()`.
1007         * html/canvas/CanvasRenderingContext2D.cpp:
1008         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Ditto.
1009         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1010         (WebCore::drawFocusRingAtTime): Use `CGContextStateSaver`.
1011         * platform/mac/ThemeMac.mm:
1012         (WebCore::drawCellFocusRingWithFrameAtTime): Force alpha to 1 on the focus ring color. Use `CGContextStateSaver`.
1013         * rendering/RenderElement.cpp:
1014         (WebCore::RenderElement::paintFocusRing): Use RenderTheme singleton for `focusRingColor()`.
1015         * rendering/RenderImage.cpp:
1016         (WebCore::RenderImage::paintAreaElementFocusRing): Ditto.
1017         * rendering/RenderTheme.cpp:
1018         (WebCore::RenderTheme::focusRingColor const): Made const. Cache the result of `platformFocusRingColor()`.
1019         * rendering/RenderTheme.h: Made `focusRingColor()` a member function instead of static.
1020         * rendering/RenderThemeMac.mm:
1021         (WebCore::RenderThemeMac::platformFocusRingColor const): Force alpha to 1 on the focus ring color.
1022         (WebCore::RenderThemeMac::systemColor const): Use `focusRingColor()`, instead of caching color here.
1023
1024 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
1025
1026         [MediaStream] Calculate width or height when constraints contain only the other
1027         https://bugs.webkit.org/show_bug.cgi?id=192632
1028         <rdar://problem/46665734>
1029
1030         Unreviewed, remove an unneeded assert.
1031
1032         * platform/mediastream/RealtimeVideoSource.cpp:
1033         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers):
1034
1035 2018-12-13  Zach Li  <zachli@apple.com>
1036
1037         Update Credit Card AutoFill button icon
1038         https://bugs.webkit.org/show_bug.cgi?id=192637
1039         rdar://problem/46545006
1040
1041         Reviewed by Chris Dumez.
1042
1043         * css/html.css:
1044         (input::-webkit-credit-card-auto-fill-button):
1045
1046 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
1047
1048         [MediaStream] Calculate width or height when constraints contain only the other
1049         https://bugs.webkit.org/show_bug.cgi?id=192632
1050         <rdar://problem/46665734>
1051
1052         Reviewed by Youenn Fablet.
1053
1054         Test: fast/mediastream/constraint-intrinsic-size.html
1055
1056         * platform/graphics/RemoteVideoSample.cpp:
1057         (WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR.
1058
1059         * platform/graphics/cv/ImageTransferSessionVT.h:
1060         (WebCore::ImageTransferSessionVT::pixelFormat const): New.
1061
1062         * platform/mediastream/RealtimeMediaSource.cpp:
1063         (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size.
1064         (WebCore::RealtimeMediaSource::setSize): Don't notify about width and height.
1065         (WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary.
1066         (WebCore::RealtimeMediaSource::setIntrinsicSize): New.
1067         (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted.
1068         * platform/mediastream/RealtimeMediaSource.h:
1069
1070         * platform/mediastream/RealtimeVideoSource.cpp:
1071         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable.
1072
1073         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1074         (WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly.
1075         (WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize().
1076         (WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable.
1077         (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted.
1078         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1079         (WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted.
1080
1081         * platform/mock/MockRealtimeVideoSource.cpp:
1082         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size.
1083         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup.
1084         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset):  Report intrinsic size.
1085         (WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source.
1086         * platform/mock/MockRealtimeVideoSource.h:
1087
1088 2018-12-13  David Kilzer  <ddkilzer@apple.com>
1089
1090         clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp
1091         <https://webkit.org/b/192661>
1092         <rdar://problem/46694035>
1093
1094         Reviewed by Daniel Bates.
1095
1096         * dom/Document.cpp:
1097         (WebCore::Document::updateIntersectionObservations):
1098         (WebCore::Document::notifyIntersectionObserversTimerFired):
1099         * dom/Element.cpp:
1100         (WebCore::Element::didMoveToNewDocument):
1101         (WebCore::Element::disconnectFromIntersectionObservers):
1102         - Change loop variables from `auto` to `const auto&` to prevent
1103           unnecessary copies of WeakPtr<IntersectionObserver> or
1104           struct IntersectionObserverRegistration objects.
1105
1106 2018-12-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1107
1108         [FreeType] Remove HarfBuzzFace
1109         https://bugs.webkit.org/show_bug.cgi?id=192589
1110
1111         Reviewed by Michael Catanzaro.
1112
1113         This was used to share the common implementation with the chromium port, but now that only freetype based ports
1114         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
1115         since we are already caching glyphs in Font.
1116
1117         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
1118         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
1119         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
1120         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1121         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
1122         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
1123         OpenType math.
1124         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1125         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
1126         (WebCore::doubleToHarfBuzzPosition): Ditto.
1127         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
1128         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
1129         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
1130         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
1131         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
1132         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
1133         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
1134         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
1135         * platform/graphics/harfbuzz/HbUniquePtr.h:
1136         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
1137         * platform/graphics/opentype/OpenTypeMathData.cpp:
1138         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
1139
1140 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1141
1142         [FreeType] Add initial implementation of variation fonts
1143         https://bugs.webkit.org/show_bug.cgi?id=192151
1144
1145         Reviewed by Michael Catanzaro.
1146
1147         * css/CSSFontFaceSource.cpp:
1148         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
1149         * loader/cache/CachedFont.cpp:
1150         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
1151         * platform/graphics/FontPlatformData.h:
1152         (WebCore::FontPlatformData::isFixedWidth const):
1153         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
1154         * platform/graphics/freetype/FontCacheFreeType.cpp:
1155         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
1156         pattern.
1157         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
1158         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
1159         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
1160         (WebCore::defaultVariationValues): Parse font variations table.
1161         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
1162         * platform/graphics/freetype/FontCacheFreeType.h: Added.
1163         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1164         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
1165         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
1166         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
1167         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
1168         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
1169         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
1170         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1171         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
1172         FC_FONT_VARIATIONS value from the pattern.
1173         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
1174         pattern.
1175         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
1176         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
1177         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
1178         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1179         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
1180         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1181         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
1182         * platform/graphics/win/FontCustomPlatformData.cpp:
1183         (WebCore::FontCustomPlatformData::fontPlatformData):
1184         * platform/graphics/win/FontCustomPlatformData.h:
1185
1186 2018-12-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1187
1188         [Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
1189         https://bugs.webkit.org/show_bug.cgi?id=192618
1190
1191         Reviewed by Alex Christensen.
1192
1193         No new tests, no behavior changes.
1194
1195         * platform/win/PopupMenuWin.h:
1196         * platform/win/WCDataObject.cpp:
1197         * platform/win/WCDataObject.h:
1198
1199 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
1200
1201         REGRESSION (r238090): CAPCHA UI jumps to the wrong location
1202         https://bugs.webkit.org/show_bug.cgi?id=192651
1203         rdar://problem/46531919
1204
1205         Reviewed by Zalan Bujtas.
1206         
1207         When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
1208         bit to say that descendants need their geometry updated (because they now have to
1209         compute their positions relative to a different ancestor). This wasn't happening
1210         in the layerStyleChanged() code path.
1211         
1212         In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
1213         we can address a FIXME and only dirty direct children, not all descendants (that code was
1214         written before the child-only dirty bit existed).
1215
1216         Test: compositing/geometry/update-child-geometry-on-compositing-change.html
1217
1218         * rendering/RenderLayerCompositor.cpp:
1219         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1220         (WebCore::RenderLayerCompositor::layerStyleChanged):
1221
1222 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
1223
1224         Make TextInputController.legacyAttributedString take DOM nodes and offsets
1225         https://bugs.webkit.org/show_bug.cgi?id=192653
1226
1227         Reviewed by Wenson Hsieh.
1228
1229         No new tests since there should be no observable behavioral change other than
1230         TextInputController API in DumpRenderTree.
1231
1232         * editing/cocoa/HTMLConverter.h:
1233         * editing/cocoa/HTMLConverter.mm:
1234         (WebCore::attributedStringFromSelection):
1235         (WebCore::attributedStringBetweenStartAndEnd): Added.
1236
1237 2018-12-12  Ryosuke Niwa  <rniwa@webkit.org>
1238
1239         Fix macOS builds after r239145.
1240
1241         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1242
1243 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
1244
1245         REGRESSION (r238357): Pins on Yelp map disappear
1246         https://bugs.webkit.org/show_bug.cgi?id=192597
1247         rdar://problem/46578285
1248
1249         Reviewed by Zalan Bujtas.
1250
1251         RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained
1252         a negative z-order child (triggering creation of a foreground layer), we'd fail to 
1253         call the "setChildren()" with the vector containing that foreground layer.
1254         
1255         When updateBackingAndHierarchy() stops visiting descendants because none are composited,
1256         it may still have to update the child list with the foreground layer, so make sure
1257         the code handles this case.
1258
1259         Tests: compositing/z-order/add-negative-z-child.html
1260                compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html
1261
1262         * rendering/RenderLayer.cpp:
1263         (WebCore::outputPaintOrderTreeRecursive):
1264         * rendering/RenderLayerCompositor.cpp:
1265         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1266
1267 2018-12-12  YUHAN WU  <yuhan_wu@apple.com>
1268
1269         Implement non-timeslice mode encoding for MediaRecorder
1270         https://bugs.webkit.org/show_bug.cgi?id=192069
1271         <rdar://problem/46443290>
1272
1273         Reviewed by Eric Carlson.
1274
1275         Implement the encoding for non-timeslice mode of MediaRecorder.
1276         It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
1277         Add a API in internals to allow testings to turn on the mock source.
1278
1279         Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
1280
1281         * Modules/mediarecorder/MediaRecorder.cpp:
1282         (WebCore::MediaRecorder::create):
1283         (WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
1284         (WebCore::MediaRecorder::getPrivateImpl):
1285         (WebCore::MediaRecorder::MediaRecorder):
1286         (WebCore::MediaRecorder::stopRecording):
1287         (WebCore::MediaRecorder::stopRecordingInternal):
1288         (WebCore::MediaRecorder::createRecordingDataBlob):
1289         (WebCore::MediaRecorder::scheduleDeferredTask):
1290         * Modules/mediarecorder/MediaRecorder.h:
1291         * Modules/mediarecorder/MediaRecorder.idl:
1292         * SourcesCocoa.txt:
1293         * WebCore.xcodeproj/project.pbxproj:
1294         * platform/mediarecorder/MediaRecorderPrivate.h:
1295         (WebCore::MediaRecorderPrivate::stopRecording):
1296         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
1297         (WebCore::MediaRecorderPrivateAVFImpl::create):
1298         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
1299         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
1300         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
1301         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
1302         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
1303         (WebCore::MediaRecorderPrivateAVFImpl::mimeType):
1304         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
1305         * platform/mediarecorder/MediaRecorderPrivateMock.cpp:
1306         (WebCore::MediaRecorderPrivateMock::fetchData):
1307         (WebCore::MediaRecorderPrivateMock::mimeType):
1308         * platform/mediarecorder/MediaRecorderPrivateMock.h:
1309         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added.
1310         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
1311         (WebCore::MediaRecorderPrivateWriter::clear):
1312         (WebCore::MediaRecorderPrivateWriter::setupWriter):
1313         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
1314         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
1315         (WebCore::copySampleBufferWithCurrentTimeStamp):
1316         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
1317         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1318         (WebCore::MediaRecorderPrivateWriter::stopRecording):
1319         * testing/Internals.cpp:
1320         (WebCore::createRecorderMockSource):
1321         (WebCore::Internals::setCustomPrivateRecorderCreator):
1322         * testing/Internals.h:
1323         * testing/Internals.idl:
1324
1325 2018-12-12  Justin Fan  <justin_fan@apple.com>
1326
1327         [WebGPU] Vertex buffers and WebGPUInputState
1328         https://bugs.webkit.org/show_bug.cgi?id=192611
1329
1330         Reviewed by Dean Jackson.
1331
1332         Test: webgpu/vertex-buffer-triangle-strip.html
1333
1334         Basic implementation of vertex buffers with Metal shading language in WebGPU. In 
1335         WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add 
1336         WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers.
1337
1338         Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode, 
1339         WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor:
1340         * CMakeLists.txt:
1341         * DerivedSources.make:
1342         * Sources.txt:
1343         * WebCore.xcodeproj/project.pbxproj:
1344         * bindings/js/WebCoreBuiltinNames.h:
1345
1346         Add and implement interfaces and dictionaries for WebGPUInputState:
1347         * Modules/webgpu/WebGPUBuffer.cpp:
1348         (WebCore::WebGPUBuffer::WebGPUBuffer):
1349         * Modules/webgpu/WebGPUBuffer.h:
1350         (WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer.
1351         * Modules/webgpu/WebGPUBufferDescriptor.h:
1352         * Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL.
1353         * Modules/webgpu/WebGPUDevice.h:
1354         * Modules/webgpu/WebGPUIndexFormat.h: Added.
1355         * Modules/webgpu/WebGPUIndexFormat.idl: Added. 
1356         * Modules/webgpu/WebGPUInputStateDescriptor.h: Added.
1357         * Modules/webgpu/WebGPUInputStateDescriptor.idl: Added.
1358         * Modules/webgpu/WebGPUInputStepMode.h: Added.
1359         * Modules/webgpu/WebGPUInputStepMode.idl: Added.
1360         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added.
1361         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added.
1362         * Modules/webgpu/WebGPUVertexFormat.h: Added.
1363         * Modules/webgpu/WebGPUVertexFormat.idl: Added.
1364         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Added.
1365         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added.
1366         * platform/graphics/gpu/GPUInputStateDescriptor.h: Added.
1367         * platform/graphics/gpu/GPURenderPassEncoder.h: Added.
1368         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added.
1369         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added.
1370         * platform/graphics/gpu/GPUVertexInputDescriptor.h: Added.
1371
1372         Refactor to support updated structure of pipeline descriptor in sketch IDL:
1373         * Modules/webgpu/WebGPUDevice.cpp:
1374         (WebCore::validateAndConvertPipelineStage):
1375         (WebCore::WebGPUDevice::createRenderPipeline const):
1376         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
1377         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
1378         * Modules/webgpu/WebGPUPipelineStageDescriptor.h:
1379         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
1380         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
1381         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
1382         * Modules/webgpu/WebGPUShaderStage.*: Removed.
1383
1384         Add and implement setVertexBuffers:
1385         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1386         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added. 
1387         * Modules/webgpu/WebGPURenderPassEncoder.h:
1388         * Modules/webgpu/WebGPURenderPassEncoder.idl: 
1389         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1390         (WebCore::GPURenderPassEncoder::setVertexBuffers):
1391         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1392         (WebCore::setInputStateForPipelineDescriptor):
1393         (WebCore::GPURenderPipeline::create):
1394
1395 2018-12-12  Tim Horton  <timothy_horton@apple.com>
1396
1397         REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight
1398         https://bugs.webkit.org/show_bug.cgi?id=192642
1399         <rdar://problem/46498246>
1400
1401         Reviewed by Geoffrey Garen.
1402
1403         No new tests; adjusted an existing test instead.
1404
1405         * platform/graphics/PathUtilities.cpp:
1406         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
1407         Instead of uniting when we fail to shrink-wrap, just return the original rects.
1408         This seems like a more reasonable default in most cases.
1409
1410 2018-12-12  Vivek Seth  <v_seth@apple.com>
1411
1412         HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
1413         https://bugs.webkit.org/show_bug.cgi?id=192375
1414         <rdar://problem/45851159>
1415
1416         Reviewed by Chris Dumez.
1417
1418         Use simulated redirect to tell clients that HTTPS Upgrade happened.
1419
1420         * platform/network/ResourceResponseBase.cpp:
1421         (WebCore::ResourceResponseBase::syntheticRedirectResponse):
1422         * platform/network/ResourceResponseBase.h:
1423         * platform/network/mac/WebCoreURLResponse.mm:
1424         (WebCore::synthesizeRedirectResponseIfNecessary):
1425
1426 2018-12-12  Chris Dumez  <cdumez@apple.com>
1427
1428         Add a preference to enable / disable devicemotion and deviceorientation events
1429         https://bugs.webkit.org/show_bug.cgi?id=192631
1430         <rdar://problem/46646244>
1431
1432         Reviewed by Geoffrey Garen.
1433
1434         Add setting to toggle support for the deviceorientation / devicemotion events:
1435         - https://w3c.github.io/deviceorientation/
1436
1437         * page/DOMWindow.cpp:
1438         (WebCore::DOMWindow::addEventListener):
1439         * page/Settings.yaml:
1440
1441 2018-12-11  Ryosuke Niwa  <rniwa@webkit.org>
1442
1443         Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
1444         https://bugs.webkit.org/show_bug.cgi?id=192613
1445
1446         Reviewed by Darin Adler.
1447
1448         This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with
1449         a selection which spans across shadow boundaries in the future.
1450
1451         No new tests since there should be no observable behavioral change.
1452
1453         * editing/cocoa/EditorCocoa.mm:
1454         (WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard.
1455         (WebCore::Editor::writeSelection): Ditto.
1456         * editing/cocoa/HTMLConverter.h:
1457         * editing/cocoa/HTMLConverter.mm:
1458         (HTMLConverter::HTMLConverter): Now takes two Position's.
1459         (HTMLConverter::convert): Updated to work with Position's.
1460         (HTMLConverter::_processText): Ditto.
1461         (HTMLConverter::_traverseNode): Ditto.
1462         (HTMLConverter::_traverseFooterNode): Ditto.
1463         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto.
1464         (WebCore::attributedStringFromRange): Ditto.
1465         (WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange
1466         in order to preserve the exact behavior.
1467
1468 2018-12-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1469
1470         Unreviewed manual rollout of r239100-r239102 and r239116
1471         https://bugs.webkit.org/show_bug.cgi?id=192151
1472         <rdar://problem/46655586>
1473
1474         * css/CSSFontFaceSource.cpp:
1475         (WebCore::CSSFontFaceSource::font):
1476         * loader/cache/CachedFont.cpp:
1477         (WebCore::CachedFont::platformDataFromCustomData):
1478         * platform/FreeType.cmake:
1479         * platform/graphics/FontPlatformData.h:
1480         (WebCore::FontPlatformData::isFixedWidth const): Deleted.
1481         * platform/graphics/cairo/FontCustomPlatformData.h:
1482         * platform/graphics/freetype/FontCacheFreeType.cpp:
1483         (WebCore::FontCache::systemFallbackForCharacters):
1484         (WebCore::FontCache::createFontPlatformData):
1485         (WebCore::getFontPropertiesFromPattern): Deleted.
1486         (WebCore::defaultVariationValues): Deleted.
1487         (WebCore::buildVariationSettings): Deleted.
1488         * platform/graphics/freetype/FontCacheFreeType.h: Removed.
1489         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1490         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
1491         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
1492         (WebCore::FontCustomPlatformData::fontPlatformData):
1493         (WebCore::FontCustomPlatformData::supportsFormat):
1494         (WebCore::defaultFontconfigOptions): Deleted.
1495         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1496         (WebCore::setCairoFontOptionsFromFontConfigPattern):
1497         (WebCore::getDefaultFontconfigOptions):
1498         (WebCore::FontPlatformData::FontPlatformData):
1499         (WebCore::FontPlatformData::operator=):
1500         (WebCore::FontPlatformData::harfBuzzFace const):
1501         (WebCore::FontPlatformData::platformIsEqual const):
1502         (WebCore::FontPlatformData::buildScaledFont):
1503         (WebCore::FontPlatformData::fcPattern const): Deleted.
1504         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted.
1505         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1506         (WebCore::Font::platformCreateScaledFont const):
1507         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1508         (WebCore::fontFeatures):
1509         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1510         (WebCore::floatToHarfBuzzPosition): Deleted.
1511         (WebCore::doubleToHarfBuzzPosition): Deleted.
1512         (WebCore::harfBuzzFontFunctions): Deleted.
1513         (WebCore::findScriptForVerticalGlyphSubstitution): Deleted.
1514         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added.
1515         (WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
1516         (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
1517         (WebCore::HarfBuzzFace::cache):
1518         (WebCore::HarfBuzzFace::HarfBuzzFace):
1519         (WebCore::HarfBuzzFace::~HarfBuzzFace):
1520         (WebCore::findScriptForVerticalGlyphSubstitution):
1521         (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
1522         * platform/graphics/harfbuzz/HarfBuzzFace.h: Added.
1523         (WebCore::HarfBuzzFace::CacheEntry::create):
1524         (WebCore::HarfBuzzFace::CacheEntry::face):
1525         (WebCore::HarfBuzzFace::CacheEntry::glyphCache):
1526         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added.
1527         (WebCore::floatToHarfBuzzPosition):
1528         (WebCore::doubleToHarfBuzzPosition):
1529         (WebCore::CairoGetGlyphWidthAndExtents):
1530         (WebCore::harfBuzzGetGlyph):
1531         (WebCore::harfBuzzGetGlyphHorizontalAdvance):
1532         (WebCore::harfBuzzGetGlyphHorizontalOrigin):
1533         (WebCore::harfBuzzGetGlyphExtents):
1534         (WebCore::harfBuzzCairoTextGetFontFuncs):
1535         (WebCore::harfBuzzCairoGetTable):
1536         (WebCore::HarfBuzzFace::createFace):
1537         (WebCore::HarfBuzzFace::createFont):
1538         * platform/graphics/harfbuzz/HbUniquePtr.h:
1539         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Deleted.
1540         * platform/graphics/opentype/OpenTypeMathData.cpp:
1541         (WebCore::OpenTypeMathData::OpenTypeMathData):
1542         * platform/graphics/win/FontCustomPlatformData.cpp:
1543         (WebCore::FontCustomPlatformData::fontPlatformData):
1544         * platform/graphics/win/FontCustomPlatformData.h:
1545         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
1546         (WebCore::FontCustomPlatformData::fontPlatformData):
1547
1548 2018-12-12  Chris Dumez  <cdumez@apple.com>
1549
1550         Unreviewed attempt to fix Windows Cairo build after r239100.
1551
1552         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
1553         (WebCore::FontCustomPlatformData::fontPlatformData):
1554
1555 2018-12-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1556
1557         [iOS] A few API tests are failing after r239086
1558         https://bugs.webkit.org/show_bug.cgi?id=192608
1559
1560         Reviewed by Zalan Bujtas.
1561
1562         These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing
1563         the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest
1564         fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab
1565         the highest fidelity path using Vector::first().
1566
1567         While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths,
1568         this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear.
1569
1570         * platform/PasteboardItemInfo.h:
1571         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
1572         * platform/ios/PasteboardIOS.mm:
1573         (WebCore::Pasteboard::readRespectingUTIFidelities):
1574         (WebCore::Pasteboard::readFilePaths):
1575
1576 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1577
1578         Unreviewed. Fix WPE build after r239101.
1579
1580         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h>
1581
1582 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1583
1584         [FreeType] Remove HarfBuzzFace
1585         https://bugs.webkit.org/show_bug.cgi?id=192589
1586
1587         Reviewed by Michael Catanzaro.
1588
1589         This was used to share the common implementation with the chromium port, but now that only freetype based ports
1590         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
1591         since we are already caching glyphs in Font.
1592
1593         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
1594         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
1595         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
1596         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1597         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
1598         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
1599         OpenType math.
1600         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1601         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
1602         (WebCore::doubleToHarfBuzzPosition): Ditto.
1603         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
1604         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
1605         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
1606         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
1607         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
1608         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
1609         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
1610         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
1611         * platform/graphics/harfbuzz/HbUniquePtr.h:
1612         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
1613         * platform/graphics/opentype/OpenTypeMathData.cpp:
1614         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
1615
1616 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1617
1618         [FreeType] Add initial implementation of variation fonts
1619         https://bugs.webkit.org/show_bug.cgi?id=192151
1620
1621         Reviewed by Michael Catanzaro.
1622
1623         * css/CSSFontFaceSource.cpp:
1624         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
1625         * loader/cache/CachedFont.cpp:
1626         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
1627         * platform/graphics/FontPlatformData.h:
1628         (WebCore::FontPlatformData::isFixedWidth const):
1629         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
1630         * platform/graphics/freetype/FontCacheFreeType.cpp:
1631         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
1632         pattern.
1633         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
1634         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
1635         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
1636         (WebCore::defaultVariationValues): Parse font variations table.
1637         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
1638         * platform/graphics/freetype/FontCacheFreeType.h: Added.
1639         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1640         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
1641         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
1642         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
1643         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
1644         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
1645         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
1646         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1647         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
1648         FC_FONT_VARIATIONS value from the pattern.
1649         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
1650         pattern.
1651         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
1652         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
1653         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
1654         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1655         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
1656         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1657         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
1658         * platform/graphics/win/FontCustomPlatformData.cpp:
1659         (WebCore::FontCustomPlatformData::fontPlatformData):
1660         * platform/graphics/win/FontCustomPlatformData.h:
1661
1662 2018-12-11  Justin Michaud  <justin_michaud@apple.com>
1663
1664         Implement feature flag for CSS Typed OM
1665         https://bugs.webkit.org/show_bug.cgi?id=192610
1666
1667         Reviewed by Ryosuke Niwa.
1668
1669         * Configurations/FeatureDefines.xcconfig:
1670         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
1671         * css/typedom/StylePropertyMapReadOnly.h:
1672         * css/typedom/StylePropertyMapReadOnly.idl:
1673         * css/typedom/TypedOMCSSImageValue.h:
1674         * css/typedom/TypedOMCSSImageValue.idl:
1675         * css/typedom/TypedOMCSSNumericValue.h:
1676         * css/typedom/TypedOMCSSNumericValue.idl:
1677         * css/typedom/TypedOMCSSStyleValue.h:
1678         * css/typedom/TypedOMCSSStyleValue.idl:
1679         * css/typedom/TypedOMCSSUnitValue.h:
1680         * css/typedom/TypedOMCSSUnitValue.idl:
1681         * css/typedom/TypedOMCSSUnparsedValue.h:
1682         * css/typedom/TypedOMCSSUnparsedValue.idl:
1683         * features.json:
1684         * html/ImageBitmap.cpp:
1685         * html/ImageBitmap.h:
1686         * html/canvas/CanvasDrawImage.idl:
1687         * html/canvas/CanvasFillStrokeStyles.idl:
1688         * html/canvas/CanvasRenderingContext2DBase.cpp:
1689         * html/canvas/CanvasRenderingContext2DBase.h:
1690         * inspector/InspectorCanvas.cpp:
1691         (WebCore::InspectorCanvas::buildAction):
1692         * page/RuntimeEnabledFeatures.h:
1693         (WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled):
1694         (WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const):
1695         * page/WindowOrWorkerGlobalScope.idl:
1696
1697 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
1698
1699         connectedCallback is invoked during the removal of the element inside another element's connectedCallback
1700         https://bugs.webkit.org/show_bug.cgi?id=183586
1701         <rdar://problem/38403504>
1702
1703         Reviewed by Frédéric Wang.
1704
1705         Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760
1706
1707         After much discussion, it's unclear that there is a clear path forward to fixing the oddness that
1708         the presence of a custom element reaction changes the timing at which another reaction callback gets invoked.
1709         So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability.
1710
1711         Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element
1712         does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in:
1713         https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction
1714             1. Let definition be element's custom element definition.
1715             2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName.
1716             3. If callback is null, then return
1717             4. If callbackName is "attributeChangedCallback", then:
1718                 1. Let attributeName be the first element of args.
1719                 2. If definition's observed attributes does not contain attributeName, then return.
1720             5. Add a new callback reaction to element's custom element reaction queue, with callback function callback
1721                and arguments args.
1722             6. Enqueue an element on the appropriate element queue given element.
1723
1724         Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html
1725
1726         * dom/CustomElementReactionQueue.cpp:
1727         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
1728         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
1729         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
1730         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
1731         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
1732         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
1733         (WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue.
1734         * dom/CustomElementReactionQueue.h:
1735
1736 2018-12-11  Justin Fan  <justin_fan@apple.com>
1737
1738         [WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU
1739         https://bugs.webkit.org/show_bug.cgi?id=192516
1740
1741         Reviewed by Dean Jackson.
1742
1743         Test: webgpu/buffers.html
1744
1745         Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation.
1746
1747         Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor:
1748         * CMakeLists.txt:
1749         * DerivedSources.make:
1750         * Sources.txt:
1751         * SourcesCocoa.txt:
1752         * WebCore.xcodeproj/project.pbxproj:
1753         * bindings/js/WebCoreBuiltinNames.h:
1754
1755         * Modules/webgpu/WebGPUBuffer.cpp: Added.
1756         (WebCore::WebGPUBuffer::create):
1757         (WebCore::WebGPUBuffer::WebGPUBuffer):
1758         * Modules/webgpu/WebGPUBuffer.h: Added.
1759         (WebCore::WebGPUBuffer::mapping const):
1760         (WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear.
1761         (WebCore::WebGPUBuffer::destroy): Unimplemented stub.
1762         * Modules/webgpu/WebGPUBuffer.idl: Added.
1763         * Modules/webgpu/WebGPUBufferDescriptor.h: Added.
1764         * Modules/webgpu/WebGPUBufferDescriptor.idl: Added.
1765         * Modules/webgpu/WebGPUDevice.cpp:
1766         (WebCore::WebGPUDevice::createBuffer const): Added.
1767         * platform/graphics/gpu/GPUBuffer.h:
1768         (WebCore::GPUBuffer::platformBuffer const):
1769         (WebCore::GPUBuffer::mapping const):
1770         * platform/graphics/gpu/GPUBufferDescriptor.h: Added.
1771         * platform/graphics/gpu/GPUDevice.cpp:
1772         (WebCore::GPUDevice::createBuffer const): Added.
1773         * platform/graphics/gpu/GPUDevice.h:
1774         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added.
1775         (WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer. 
1776         (WebCore::GPUBuffer::GPUBuffer):
1777         (WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first.
1778
1779         Small benign edits, most to make nullability more consistent in WebGPU classes:
1780         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1781         (WebCore::WebGPUCommandBuffer::create):
1782         (WebCore::WebGPUCommandBuffer::beginRenderPass):
1783         * Modules/webgpu/WebGPUCommandBuffer.h:
1784         * Modules/webgpu/WebGPUDevice.cpp:
1785         (WebCore::WebGPUDevice::create):
1786         (WebCore::WebGPUDevice::WebGPUDevice):
1787         (WebCore::WebGPUDevice::createShaderModule const):
1788         (WebCore::WebGPUDevice::createRenderPipeline const):
1789         (WebCore::WebGPUDevice::createCommandBuffer const):
1790         * Modules/webgpu/WebGPUDevice.h:
1791         (WebCore::WebGPUDevice::device const):
1792         * Modules/webgpu/WebGPUDevice.idl:
1793         * Modules/webgpu/WebGPUQueue.cpp:
1794         (WebCore::WebGPUQueue::create):
1795         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1796         (WebCore::WebGPURenderPassEncoder::create):
1797         * Modules/webgpu/WebGPURenderPassEncoder.h:
1798         * Modules/webgpu/WebGPUShaderModule.cpp:
1799         (WebCore::WebGPUShaderModule::create):
1800         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
1801         * Modules/webgpu/WebGPUShaderModule.h:
1802         (WebCore::WebGPUShaderModule::module const):
1803         * Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes.
1804         * Modules/webgpu/WebGPUTexture.cpp:
1805         (WebCore::WebGPUTexture::create):
1806         (WebCore::WebGPUTexture::createDefaultTextureView):
1807         * Modules/webgpu/WebGPUTextureView.cpp:
1808         (WebCore::WebGPUTextureView::create):
1809         * Modules/webgpu/WebGPUTextureView.h:
1810         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
1811         (WebCore::GPUQueue::create):
1812         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1813         (WebCore::GPURenderPipeline::create):
1814         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
1815         (WebCore::GPUShaderModule::create):
1816         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
1817         (WebCore::GPUSwapChain::setDevice):
1818         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
1819         (WebCore::GPUTexture::GPUTexture):
1820
1821 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
1822
1823         [Win][Clang] Fix warning -Wmissing-field-initializers
1824         https://bugs.webkit.org/show_bug.cgi?id=192584
1825
1826         Reviewed by Yusuke Suzuki.
1827
1828         Initialize a struct with '{ }' instead of '= {0}'.
1829
1830         No new tests, no behavior changes.
1831
1832         * platform/graphics/win/FontCacheWin.cpp:
1833         (WebCore::FontCache::lastResortFallbackFont):
1834         * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
1835         (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
1836         * platform/win/ClipboardUtilitiesWin.cpp:
1837         (WebCore::setFileDescriptorData):
1838         (WebCore::setFileContentData):
1839         (WebCore::setUCharData):
1840         (WebCore::setUtf8Data):
1841         (WebCore::setCFData):
1842         * platform/win/CursorWin.cpp:
1843         (WebCore::createSharedCursor):
1844         * platform/win/DefWndProcWindowClass.cpp:
1845         (WebCore::registerClass):
1846         * platform/win/DragImageWin.cpp:
1847         (WebCore::createDragImageIconForCachedImageFilename):
1848         * platform/win/PasteboardWin.cpp:
1849         (WebCore::writeURL):
1850         (WebCore::Pasteboard::writeString):
1851         (WebCore::Pasteboard::writeRangeToDataObject):
1852         (WebCore::Pasteboard::writePlainTextToDataObject):
1853         (WebCore::writeFileToDataObject):
1854         (WebCore::Pasteboard::writeMarkup):
1855         * platform/win/PopupMenuWin.cpp:
1856         (WebCore::PopupMenuWin::show):
1857         * platform/win/SSLKeyGeneratorWin.cpp:
1858         (WebCore::WebCore::signedPublicKeyAndChallengeString):
1859
1860 2018-12-11  Jer Noble  <jer.noble@apple.com>
1861
1862         Globally namespaced objects shouldn't use framework-prefixed names
1863         https://bugs.webkit.org/show_bug.cgi?id=192600
1864
1865         Reviewed by Eric Carlson.
1866
1867         Rename CMSampleBufferIs... -> isCMSampleBuffer...
1868
1869         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1870         (WebCore::isCMSampleBufferRandomAccess):
1871         (WebCore::isCMSampleBufferNonDisplaying):
1872         (WebCore::MediaSampleAVFObjC::flags const):
1873         (WebCore::CMSampleBufferIsRandomAccess): Deleted.
1874         (WebCore::CMSampleBufferIsNonDisplaying): Deleted.
1875
1876 2018-12-11  Brent Fulgham  <bfulgham@apple.com>
1877
1878         Don't attempt to compute animated values when there is no relevant animation
1879         https://bugs.webkit.org/show_bug.cgi?id=192591
1880         <rdar://problem/34336946>
1881
1882         Reviewed by Dean Jackson.
1883
1884         Check if the property is supposed to be animated, or has animatable features, before
1885         attempting to calculate the current animated value.
1886
1887         Test: svg/animations/avoid-calculating-for-non-animating-elements.html
1888
1889         * svg/SVGAnimateElementBase.cpp:
1890         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
1891
1892 2018-12-11  Chris Dumez  <cdumez@apple.com>
1893
1894         Unreviewed, fix typos in console log from r239087.
1895
1896         * page/DOMWindow.cpp:
1897         (WebCore::DOMWindow::addEventListener):
1898
1899 2018-12-11  Tim Horton  <timothy_horton@apple.com>
1900
1901         WebCore shouldn't have a Objective-C class named NSCursor
1902         https://bugs.webkit.org/show_bug.cgi?id=192602
1903         <rdar://problem/46615532>
1904
1905         Reviewed by Wenson Hsieh.
1906
1907         * platform/ios/wak/WAKAppKitStubs.h:
1908         * platform/ios/wak/WAKAppKitStubs.m:
1909         (+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
1910         Get rid of the class.
1911         Also remove a comment that seems to have detached from wherever it's supposed to be.
1912
1913 2018-12-11  Chris Dumez  <cdumez@apple.com>
1914
1915         Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
1916         https://bugs.webkit.org/show_bug.cgi?id=192595
1917         <rdar://problem/46382603>
1918
1919         Reviewed by Dean Jackson.
1920
1921         Tests: http/tests/events/device-orientation-motion-non-secure-context.html
1922                http/tests/events/device-orientation-motion-secure-context.html
1923
1924         * page/DOMWindow.cpp:
1925         (WebCore::DOMWindow::addEventListener):
1926         * page/SecurityOrigin.h:
1927         (WebCore::SecurityOrigin::setIsPotentiallyTrustworthy):
1928         * testing/Internals.cpp:
1929         (WebCore::Internals::markContextAsInsecure):
1930         (WebCore::Internals::postTask):
1931         * testing/Internals.h:
1932         * testing/Internals.idl:
1933
1934 2018-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1935
1936         [iOS] Send the full list of file upload URLs and types in PasteboardItemInfo
1937         https://bugs.webkit.org/show_bug.cgi?id=192598
1938         Work towards <rdar://problem/35626913>
1939
1940         Reviewed by Tim Horton.
1941
1942         Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just
1943         a "preferred" file upload URL and type. See below for more details.
1944
1945         * platform/PasteboardItemInfo.h:
1946         (WebCore::PasteboardItemInfo::pathForContentType const):
1947
1948         Add a helper method to find a file upload URL corresponding to a given type.
1949
1950         (WebCore::PasteboardItemInfo::encode const):
1951         (WebCore::PasteboardItemInfo::decode):
1952
1953         Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`.
1954
1955         * platform/ios/AbstractPasteboard.h:
1956         * platform/ios/PasteboardIOS.mm:
1957         (WebCore::Pasteboard::readRespectingUTIFidelities):
1958
1959         Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`.
1960
1961         (WebCore::Pasteboard::readFilePaths):
1962         * platform/ios/PlatformPasteboardIOS.mm:
1963         (WebCore::PlatformPasteboard::informationForItemAtIndex):
1964         * platform/ios/WebItemProviderPasteboard.h:
1965         * platform/ios/WebItemProviderPasteboard.mm:
1966         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
1967         (-[NSItemProvider web_fileUploadContentTypes]):
1968
1969         Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file
1970         upload content types (rather than just a `BOOL` indicating whether one or more of these types exist).
1971
1972         (-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]):
1973         (-[WebItemProviderPasteboard numberOfFiles]):
1974         (-[NSItemProvider web_containsFileUploadContent]): Deleted.
1975         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted.
1976
1977         Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest
1978         fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that
1979         shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal
1980         data serialization for an `NSURL` as a file on the web).
1981
1982         Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file
1983         uploads, and return all of these file types that we've loaded.
1984
1985 2018-12-11  Don Olmstead  <don.olmstead@sony.com>
1986
1987         Resource Load Statistics: Use common implementation within NetworkStorageSession
1988         https://bugs.webkit.org/show_bug.cgi?id=192592
1989
1990         Reviewed by Alex Christensen.
1991
1992         There's nothing within the resource load statistics implementation contained
1993         in NetworkStorageSessionCFNet that was CF specific. All of the resource load
1994         statistics methods are moved from that file to the root NetworkStorageSession
1995         implementation.
1996
1997         * platform/network/NetworkStorageSession.cpp:
1998         (WebCore::getPartitioningDomain):
1999         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
2000         (WebCore::NetworkStorageSession::shouldBlockCookies const):
2001         (WebCore::NetworkStorageSession::maxAgeCacheCap):
2002         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
2003         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
2004         (WebCore::NetworkStorageSession::removePrevalentDomains):
2005         (WebCore::NetworkStorageSession::hasStorageAccess const):
2006         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
2007         (WebCore::NetworkStorageSession::grantStorageAccess):
2008         (WebCore::NetworkStorageSession::removeStorageAccessForFrame):
2009         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
2010         (WebCore::NetworkStorageSession::removeAllStorageAccess):
2011         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
2012         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
2013         * platform/network/NetworkStorageSession.h:
2014         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2015         (WebCore::getPartitioningDomain): Deleted.
2016         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted.
2017         (WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted.
2018         (WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted.
2019         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted.
2020         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted.
2021         (WebCore::NetworkStorageSession::removePrevalentDomains): Deleted.
2022         (WebCore::NetworkStorageSession::hasStorageAccess const): Deleted.
2023         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted.
2024         (WebCore::NetworkStorageSession::grantStorageAccess): Deleted.
2025         (WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted.
2026         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
2027         (WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted.
2028         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted.
2029         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted.
2030
2031 2018-12-11  Devin Rousso  <drousso@apple.com>
2032
2033         Web Inspector: overlay bounds rulers don't match element when page is scrolled
2034         https://bugs.webkit.org/show_bug.cgi?id=192577
2035
2036         Reviewed by Joseph Pecoraro.
2037
2038         When drawing the highlight for a node, the canvas is translated based on the scroll position
2039         of the node. This translation was not applied to the bounds calculations, which meant that
2040         the bounds always drew where the node would have been if it wasn't scrolled.
2041
2042         * inspector/InspectorOverlayPage.js:
2043         (Bounds.prototype.get minX):
2044         (Bounds.prototype.get minY):
2045         (Bounds.prototype.get maxX):
2046         (Bounds.prototype.get maxY):
2047         (Bounds.prototype.offset): Added.
2048         (drawNodeHighlight):
2049         Drive-by: draw bounds for every node being highlighted instead of just the first one.
2050         Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast.
2051
2052 2018-12-11  Andy Estes  <aestes@apple.com>
2053
2054         Introduce makeBlockPtr for lambdas
2055         https://bugs.webkit.org/show_bug.cgi?id=192594
2056
2057         Reviewed by Alex Christensen.
2058
2059         Adopted makeBlockPtr.
2060
2061         * platform/cocoa/FileMonitorCocoa.mm:
2062         (WebCore::FileMonitor::FileMonitor):
2063         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
2064         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
2065         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm:
2066         (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
2067         * platform/network/cocoa/WebCoreNSURLSession.mm:
2068         (-[WebCoreNSURLSession addDelegateOperation:]):
2069         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
2070         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2071         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
2072
2073 2018-12-10  Brent Fulgham  <bfulgham@apple.com>
2074
2075         SVGViewSpec objects should mark relevant SVG elements
2076         https://bugs.webkit.org/show_bug.cgi?id=192567
2077         <rdar://problem/46491325>
2078
2079         Reviewed by Ryosuke Niwa.
2080
2081         SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to
2082         recognize the relevant SVGElement as active as long as the SVGViewSpec is active.
2083
2084         Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare
2085         pointer to the SVGElement, so switched to a WeakPtr.
2086
2087         Test: svg/animations/view-dependency-crash.html
2088
2089         * Sources.txt: Add new files.
2090         * WebCore.xcodeproj/project.pbxproj: Ditto.
2091         * bindings/js/JSSVGViewSpecCustom.cpp: Added.
2092         (WebCore::JSSVGViewSpec::visitAdditionalChildren):
2093         * svg/SVGElement.h:
2094         * svg/SVGPathElement.h:
2095         * svg/SVGViewSpec.cpp:
2096         (WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element.
2097         * svg/SVGViewSpec.h:
2098         * svg/SVGViewSpec.idl:
2099         * svg/properties/SVGAttributeOwnerProxy.cpp: Added.
2100         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to
2101         the underling SVGElement.
2102         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
2103         * svg/properties/SVGAttributeOwnerProxy.h:
2104         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file.
2105         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
2106         * svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use.
2107
2108 2018-12-10  Benjamin Poulain  <benjamin@webkit.org>
2109
2110         <rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading
2111         https://bugs.webkit.org/show_bug.cgi?id=192439
2112
2113         Reviewed by Dean Jackson.
2114
2115         This broken when WebKit switched to NSURLSession.
2116         In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW.
2117
2118         Test: http/tests/contentextensions/video-element-resource-type.html
2119
2120         * loader/ResourceLoadInfo.cpp:
2121         (WebCore::toResourceType):
2122
2123 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
2124
2125         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
2126         https://bugs.webkit.org/show_bug.cgi?id=192573
2127
2128         Reviewed by Simon Fraser.
2129
2130         * Configurations/FeatureDefines.xcconfig:
2131
2132 2018-12-10  Justin Michaud  <justin_michaud@apple.com>
2133
2134         CS Painting API should support multiple worklets.
2135         https://bugs.webkit.org/show_bug.cgi?id=192335
2136
2137         Reviewed by Dean Jackson.
2138
2139         Adds a new map to support separate paint worklet global scopes (one for each worklet). Also
2140         adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required
2141         for paint would not trigger a repaint if there had not been a valid value set before.
2142
2143         Test: fast/css-custom-paint/multiple-worklets.html
2144
2145         * css/CSSPaintImageValue.cpp:
2146         (WebCore::CSSPaintImageValue::image):
2147         * css/StyleResolver.cpp:
2148         (WebCore::StyleResolver::applyProperty):
2149         * dom/Document.cpp:
2150         (WebCore::Document::prepareForDestruction):
2151         (WebCore::Document::paintWorkletGlobalScope):
2152         (WebCore::Document::setPaintWorkletGlobalScope):
2153         * dom/Document.h:
2154         (WebCore::Document::paintWorkletGlobalScope): Deleted.
2155         * rendering/style/RenderStyle.cpp:
2156         (WebCore::changedCustomPaintWatchedProperty):
2157         * worklets/Worklet.cpp:
2158         (WebCore::Worklet::addModule):
2159         * worklets/WorkletGlobalScope.cpp:
2160         (WebCore::WorkletGlobalScope::prepareForDestruction):
2161
2162 2018-12-10  Youenn Fablet  <youenn@apple.com>
2163
2164         Remove derived classes of RealtimeMediaSourceCenter
2165         https://bugs.webkit.org/show_bug.cgi?id=192546
2166
2167         Reviewed by Eric Carlson.
2168
2169         Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it.
2170         Instead port specific implementation directly implement the needed default factory methods.
2171
2172         Renamed some methods for improved consistency.
2173         Moved some static variables as RealtimeMediaSourceCenter members.
2174
2175         No change of behavior.
2176
2177         * WebCore.xcodeproj/project.pbxproj:
2178         * page/DeprecatedGlobalSettings.cpp:
2179         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2180         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
2181         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
2182         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
2183         (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState):
2184         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
2185         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
2186         (WebCore::RealtimeMediaSourceCenter::audioCaptureFactory):
2187         (WebCore::RealtimeMediaSourceCenter::setVideoFactory):
2188         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
2189         (WebCore::RealtimeMediaSourceCenter::videoCaptureFactory):
2190         (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
2191         (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
2192         (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
2193         * platform/mediastream/RealtimeMediaSourceCenter.h:
2194         * platform/mediastream/RealtimeVideoSource.cpp:
2195         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
2196         (WebCore::RealtimeVideoSource::prepareToProduceData):
2197         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
2198         (WebCore::RealtimeMediaSourceCenter::singleton):
2199         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
2200         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
2201         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
2202         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed.
2203         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2204         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
2205         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2206         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2207         (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
2208         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
2209         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2210         (WebCore::RealtimeMediaSourceCenter::singleton):
2211         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
2212         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
2213         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
2214         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed.
2215         * platform/mock/MockRealtimeAudioSource.cpp:
2216         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
2217         (WebCore::MockRealtimeAudioSource::startProducingData):
2218         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2219         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
2220         (WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory):
2221         (WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory):
2222         * platform/mock/MockRealtimeMediaSourceCenter.h:
2223
2224 2018-12-10  Youenn Fablet  <youenn@apple.com>
2225
2226         DataChannels created asynchronously never open and are unusable
2227         https://bugs.webkit.org/show_bug.cgi?id=192566
2228
2229         Reviewed by Eric Carlson.
2230
2231         For every new data channel (remote or local), we should check the underlying backend state.
2232         This allows firing events if needed.
2233         We were not always doing that which was prohibiting sending some open
2234         events for data channels created after the SCTP connection is set up.
2235
2236         Covered by updated test.
2237
2238         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
2239         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
2240         (WebCore::LibWebRTCDataChannelHandler::setClient):
2241         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
2242         (WebCore::LibWebRTCDataChannelHandler::checkState):
2243         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2244
2245 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
2246
2247         Use WeakPtr to refer to VTTCue in VTTCueBox
2248         https://bugs.webkit.org/show_bug.cgi?id=192575
2249
2250         Reviewed by Eric Carlson.
2251
2252         Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away.
2253         This is implemented by simply using WeakPtr.
2254
2255         No new tests since there shoul be no behaivoral change.
2256
2257         * html/track/TextTrackCueGeneric.cpp:
2258         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
2259         * html/track/VTTCue.cpp:
2260         (WebCore::VTTCueBox::VTTCueBox):
2261         (WebCore::VTTCueBox::getCue const):
2262         (WebCore::VTTCueBox::applyCSSProperties):
2263         (WebCore::VTTCue::~VTTCue):
2264         * html/track/VTTCue.h:
2265         (WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const):
2266
2267 2018-12-10  Mark Lam  <mark.lam@apple.com>
2268
2269         PropertyAttribute needs a CustomValue bit.
2270         https://bugs.webkit.org/show_bug.cgi?id=191993
2271         <rdar://problem/46264467>
2272
2273         Reviewed by Saam Barati.
2274
2275         This patch revealed a bug in the CodeGenerator where a constructor property is
2276         set with a ReadOnly attribute.  This conflicts with the WebIDL link (see clause
2277         12 in https://heycam.github.io/webidl/#interface-prototype-object) which states
2278         that it should be [Writable].  The ReadOnly attribute is now removed.
2279
2280         On the WebCore side, this change is covered by existing tests.
2281
2282         * bindings/scripts/CodeGeneratorJS.pm:
2283         (GenerateImplementation):
2284         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2285         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
2286
2287 2018-12-10  Antti Koivisto  <antti@apple.com>
2288
2289         Rename "forced style recalc" to "full style rebuild"
2290         https://bugs.webkit.org/show_bug.cgi?id=192572
2291
2292         Reviewed by Zalan Bujtas.
2293
2294         The old name is confusing.
2295
2296         * css/CSSComputedStyleDeclaration.cpp:
2297         (WebCore::hasValidStyleForProperty):
2298         * dom/Document.cpp:
2299         (WebCore::Document::scheduleStyleRebuild):
2300         (WebCore::Document::scheduleStyleRecalc):
2301         (WebCore::Document::unscheduleStyleRecalc):
2302         (WebCore::Document::hasPendingStyleRebuild const):
2303         (WebCore::Document::resolveStyle):
2304         (WebCore::Document::needsStyleRecalc const):
2305         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2306         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
2307         (WebCore::Document::setDesignMode):
2308         (WebCore::Document::webkitDidExitFullScreenForElement):
2309         (WebCore::Document::setAnimatingFullScreen):
2310         (WebCore::Document::setFullscreenControlsHidden):
2311         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
2312         (WebCore::Document::hasPendingForcedStyleRecalc const): Deleted.
2313         * dom/Document.h:
2314         * dom/Element.cpp:
2315         (WebCore::Element::needsStyleInvalidation const):
2316         * page/Page.cpp:
2317         (WebCore::Page::updateStyleAfterChangeInEnvironment):
2318         * style/StyleScope.cpp:
2319         (WebCore::Style::Scope::updateActiveStyleSheets):
2320
2321 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
2322
2323         Include CoreGraphics.h from WebCorePrefix.h
2324         https://bugs.webkit.org/show_bug.cgi?id=192557
2325
2326         Reviewed by Tim Horton.
2327
2328         The theory is that this will improve build time. Let's try and see what bots say.
2329
2330         * WebCorePrefix.h:
2331
2332 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2333
2334         [iOS] Unable to upload data that conforms to "public.item" but not "public.content"
2335         https://bugs.webkit.org/show_bug.cgi?id=192555
2336         <rdar://problem/35204990>
2337
2338         Reviewed by Tim Horton.
2339
2340         Add support for uploading content that conforms to "public.item" via drag and drop. Currently, iOS WebKit only
2341         supports data that conforms to "public.content", but there exist several types of files that conform to
2342         "public.item" but not "public.content". See below for more detail.
2343
2344         Test: DragAndDropTests.ExternalSourcePKCS12ToSingleFileInput
2345
2346         * platform/ios/PasteboardIOS.mm:
2347         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
2348
2349         Update this to include "public.item", and remove "public.folder", which is now redundant because "public.folder"
2350         conforms to "public.item".
2351
2352         * platform/ios/WebItemProviderPasteboard.mm:
2353         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
2354
2355         Pull out the "contains content that is supported for file uploads" part of this helper method into a separate
2356         method, and use it within `-web_containsFileURLAndFileUploadContent`. Note that this prevents "public.url"-
2357         conformant data from being uploaded as files (i.e., we never want to upload a URL string *itself* as a file).
2358         Drawing this distinction ensures that we don't confuse item providers that contain just a URL as files when
2359         dropping into a file upload area or file input (see API test: ExternalSourceZIPArchiveAndURLToSingleFileInput
2360         for an example of this corner case).
2361
2362         (-[NSItemProvider web_containsFileUploadContent]):
2363         (-[WebItemProviderPasteboard numberOfFiles]):
2364
2365         Refactor this to use `-web_containsFileUploadContent`.
2366
2367 2018-12-10  Chris Dumez  <cdumez@apple.com>
2368
2369         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
2370         https://bugs.webkit.org/show_bug.cgi?id=192509
2371         <rdar://problem/46500832>
2372
2373         Reviewed by Alex Christensen.
2374
2375         * loader/DocumentLoader.h:
2376         (WebCore::DocumentLoader::setCustomUserAgent):
2377         (WebCore::DocumentLoader::customUserAgent const):
2378         * loader/FrameLoader.cpp:
2379         (WebCore::FrameLoader::userAgent const):
2380
2381 2018-12-10  Adrian Perez de Castro  <aperez@igalia.com>
2382
2383         [GLib] FileSystem::moveFile() should fall back to copying
2384         https://bugs.webkit.org/show_bug.cgi?id=192562
2385
2386         Reviewed by Michael Catanzaro.
2387
2388         No new tests needed.
2389
2390         * platform/glib/FileSystemGlib.cpp:
2391         (WebCore::FileSystem::moveFile): Use g_file_move() instead of a plain g_rename(), which
2392         provides a fall-back which does copy+delete when a direct move or rename cannot be done.
2393
2394 2018-12-10  Simon Fraser  <simon.fraser@apple.com>
2395
2396         Allow control over child order when adding nodes to the scrolling tree
2397         https://bugs.webkit.org/show_bug.cgi?id=176914
2398         <rdar://problem/46542237>
2399         
2400         Re-land r239010 after over-zealous rollout.
2401
2402         * page/scrolling/AsyncScrollingCoordinator.cpp:
2403         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
2404         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2405         * page/scrolling/AsyncScrollingCoordinator.h:
2406         * page/scrolling/ScrollingCoordinator.h:
2407         (WebCore::ScrollingCoordinator::attachToStateTree):
2408         * page/scrolling/ScrollingStateNode.cpp:
2409         (WebCore::ScrollingStateNode::insertChild):
2410         (WebCore::ScrollingStateNode::indexOfChild const):
2411         * page/scrolling/ScrollingStateNode.h:
2412         * page/scrolling/ScrollingStateTree.cpp:
2413         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
2414         (WebCore::ScrollingStateTree::attachNode):
2415         * page/scrolling/ScrollingStateTree.h:
2416
2417 2018-12-10  Antti Koivisto  <antti@apple.com>
2418
2419         Document should throttle style recalc even when m_pendingStyleRecalcShouldForce is true.
2420         https://bugs.webkit.org/show_bug.cgi?id=191695
2421
2422         Reviewed by Zalan Bujtas.
2423
2424         * dom/Document.cpp:
2425         (WebCore::Document::scheduleStyleRecalc):
2426
2427         Don't test for m_pendingStyleRecalcShouldForce.
2428
2429         (WebCore::Document::hasPendingStyleRecalc const):
2430         (WebCore::Document::hasPendingForcedStyleRecalc const):
2431
2432         Don't base the pending status of these function on whether the timer is running.
2433         Instead check if the style is invalid.
2434
2435 2018-12-10  Rob Buis  <rbuis@igalia.com>
2436
2437         XMLHttpRequest removes spaces from content-types before processing
2438         https://bugs.webkit.org/show_bug.cgi?id=8644
2439
2440         Reviewed by Chris Dumez.
2441
2442         Stop trimming white space characters from the middle of
2443         type/subtype value. Also make sure whitespace being parsed
2444         adheres to OWS definition from RFC 7230 Section 3.2.3
2445         (referenced by RFC 7231), i.e. space or HT.
2446
2447         Based on http://crrev.com/416586.
2448
2449         Behavior matches Firefox and Chrome.
2450
2451         Tests: http/tests/xmlhttprequest/supported-xml-content-types.html
2452                web-platform-tests/mimesniff/mime-types/parsing.any.html
2453                web-platform-tests/mimesniff/mime-types/parsing.any.worker.html
2454
2455         * platform/network/HTTPParsers.cpp:
2456         (WebCore::extractMIMETypeFromMediaType):
2457
2458 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2459
2460         [iOS] Caret is obscured by finger when dragging over an editable element
2461         https://bugs.webkit.org/show_bug.cgi?id=192499
2462         <rdar://problem/46570101>
2463
2464         Reviewed by Tim Horton.
2465
2466         * page/DragActions.h:
2467
2468         Move DragHandlingMethod to DragActions.h, and drive-by fix some minor issues (i.e. make a couple of enum classes
2469         use 8 bits, fix the indentation levels, and update the copyright year). Also add `EnumTraits` for
2470         DragHandlingMethod so that it may be encoded over IPC.
2471
2472         * page/DragController.cpp:
2473         (WebCore::dragIsHandledByDocument):
2474
2475         Simplify this helper function.
2476
2477         (WebCore::DragController::tryDocumentDrag):
2478         * page/DragController.h:
2479
2480         Expose the current DragHandlingMethod via a const getter method.
2481
2482         (WebCore::DragController::dragHandlingMethod const):
2483
2484 2018-12-10  Youenn Fablet  <youenn@apple.com>
2485
2486         Make mock capture happen in the process used for real capture
2487         https://bugs.webkit.org/show_bug.cgi?id=192544
2488
2489         Reviewed by Eric Carlson.
2490
2491         MockRealtimeMediaSourceCenter previously was setting its factories whenever mock capture is on.
2492         Add booleans to choose which source (audio, video, display) will actually be toggled on.
2493
2494         Covered by existing tests.
2495
2496         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2497         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
2498         * platform/mock/MockRealtimeMediaSourceCenter.h:
2499         (WebCore::MockRealtimeMediaSourceCenter::setMockAudioCaptureEnabled):
2500         (WebCore::MockRealtimeMediaSourceCenter::setMockVideoCaptureEnabled):
2501         (WebCore::MockRealtimeMediaSourceCenter::setMockDisplayCaptureEnabled):
2502
2503 2018-12-10  Dean Jackson  <dino@apple.com>
2504
2505         Use text/javascript as recommended by the HTML specification
2506         https://bugs.webkit.org/show_bug.cgi?id=192525
2507         <rdar://problem/46569636>
2508
2509         Reviewed by Jon Lee.
2510
2511         The HTML specification says we should use text/javascript for
2512         JavaScript files:
2513         https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type
2514
2515         * loader/cache/CachedScript.cpp: Replace application/javascript with text/javascript.
2516         (WebCore::CachedScript::CachedScript):
2517         * platform/network/ios/WebCoreURLResponseIOS.mm: Ditto.
2518         (WebCore::createExtensionToMIMETypeMap):
2519         * platform/network/mac/WebCoreURLResponse.mm: Ditto.
2520         (WebCore::createExtensionToMIMETypeMap):
2521
2522 2018-12-10  Dean Jackson  <dino@apple.com>
2523
2524         [iOS] Make WebGPU work with remote layer hosting
2525         https://bugs.webkit.org/show_bug.cgi?id=192508
2526         <rdar://problem/46560649>
2527
2528         Reviewed by Tim Horton.
2529
2530         WebGPU wasn't working on iOS because we were not correctly
2531         identifying the CALayers for remote hosting. Fix this by
2532         adding a new CALayer type, WebGPULayer. This will also
2533         eventually hold the code to render WebGPU into a canvas.
2534
2535         Covered by the existing reference tests (on device).
2536
2537         * SourcesCocoa.txt: Add new files.
2538         * WebCore.xcodeproj/project.pbxproj: Ditto.
2539
2540         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
2541         class for remote hosting.
2542         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2543         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2544
2545         * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
2546         from CAMetalLayer.
2547         * platform/graphics/cocoa/WebGPULayer.mm: Added.
2548         (-[WebGPULayer init]):
2549         (-[WebGPULayer copyImageSnapshotWithColorSpace:]):
2550
2551         * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
2552         than CALayer.
2553
2554         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
2555         the WebGPULayer has a reference back to this object, which it
2556         will use in the future.
2557         (WebCore::GPUSwapChain::create):
2558         (WebCore::GPUSwapChain::GPUSwapChain):
2559
2560 2018-12-10  Truitt Savell  <tsavell@apple.com>
2561
2562         Unreviewed, rolling out r238965.
2563
2564         Caused internal iOS build failures
2565
2566         Reverted changeset:
2567
2568         "[iOS] Make WebGPU work with remote layer hosting"
2569         https://bugs.webkit.org/show_bug.cgi?id=192508
2570         https://trac.webkit.org/changeset/238965
2571
2572 2018-12-10  Youenn Fablet  <youenn@apple.com>
2573
2574         MockLibWebRTCPeerConnectionFactory should isolate copy its test case
2575         https://bugs.webkit.org/show_bug.cgi?id=192545
2576
2577         Reviewed by Eric Carlson.
2578
2579         Isolate copy the test case member so that it can be destroyed on another thread.
2580         Covered by existing test that should no longer crash.
2581
2582         * testing/MockLibWebRTCPeerConnection.cpp:
2583         (WebCore::useMockRTCPeerConnectionFactory):
2584         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
2585         * testing/MockLibWebRTCPeerConnection.h:
2586         (WebCore::MockLibWebRTCPeerConnectionFactory::create):
2587
2588 2018-12-09  Youenn Fablet  <youenn@apple.com>
2589
2590         Move capture manager from RealtimeMediaSourceCenter to capture factory
2591         https://bugs.webkit.org/show_bug.cgi?id=192542
2592
2593         Reviewed by Eric Carlson.
2594
2595         We should be able to run mock captures in wither UIProcess or WebProcess.
2596         Currently, mock capture is only done in WebProcess.
2597         This patch is a first step towards that goal.
2598
2599         It also simplifies RealtimeMediaSourceCenter implementation by starting to remove virtual methods.
2600         Further refactoring will remove the need to subclass RealtimeMediaSourceCenter.
2601         Instead, remaining virtual methods will become non virtual and their
2602         implementation will become port specific.
2603
2604         Removed a JS internal method that is not longer used to further simplify RealtimeMediaSourceCenter.
2605
2606         No visible change of behavior.
2607         Covered by existing tests.
2608
2609         * platform/mediastream/CaptureDeviceManager.h:
2610         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2611         (WebCore::RealtimeMediaSourceCenter::singleton):
2612         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
2613         (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
2614         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
2615         (WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID):
2616         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
2617         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
2618         (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
2619         * platform/mediastream/RealtimeMediaSourceCenter.h:
2620         * platform/mediastream/RealtimeMediaSourceFactory.h:
2621         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
2622         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2623         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
2624         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
2625         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2626         (WebCore::CoreAudioCaptureSourceFactory::audioCaptureDeviceManager):
2627         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2628         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2629         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
2630         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2631         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
2632         (WebCore::MockRealtimeMediaSourceCenter::audioFactory):
2633         (WebCore::MockRealtimeMediaSourceCenter::videoFactory):
2634         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
2635         * platform/mock/MockRealtimeMediaSourceCenter.h:
2636         (WebCore::MockRealtimeMediaSourceCenter::audioCaptureDeviceManager):
2637         (WebCore::MockRealtimeMediaSourceCenter::videoCaptureDeviceManager):
2638         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureDeviceManager):
2639         * testing/Internals.cpp:
2640         * testing/Internals.h:
2641         * testing/Internals.idl:
2642
2643 2018-12-09  Commit Queue  <commit-queue@webkit.org>
2644
2645         Unreviewed, rolling out r239010.
2646         https://bugs.webkit.org/show_bug.cgi?id=192537
2647
2648         Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
2649         scrolling-layers-state.html again (Requested by ap on
2650         #webkit).
2651
2652         Reverted changeset:
2653
2654         "Allow control over child order when adding nodes to the
2655         scrolling tree"
2656         https://bugs.webkit.org/show_bug.cgi?id=176914
2657         https://trac.webkit.org/changeset/239010
2658
2659 2018-12-08  Eric Carlson  <eric.carlson@apple.com>
2660
2661         [MediaStream] Scaled video frames should be resized in letterbox mode
2662         https://bugs.webkit.org/show_bug.cgi?id=192528
2663         <rdar://problem/46576638>
2664
2665         Reviewed by Darin Adler.
2666
2667         Test: fast/mediastream/resize-letterbox.html
2668
2669         * platform/graphics/cv/ImageTransferSessionVT.mm:
2670         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): Use letterbox resize mode, not trim.
2671
2672         * platform/mock/MockRealtimeVideoSource.cpp:
2673         (WebCore::MockRealtimeVideoSource::captureSize const): "Capture" at the preset size, not 
2674         necessarily at the requested size to be more like a physical camera.
2675         (WebCore::MockRealtimeVideoSource::settingsDidChange):
2676         (WebCore::MockRealtimeVideoSource::drawAnimation):
2677         (WebCore::MockRealtimeVideoSource::drawBoxes):
2678         (WebCore::MockRealtimeVideoSource::drawText):
2679         (WebCore::MockRealtimeVideoSource::generateFrame):
2680         (WebCore::MockRealtimeVideoSource::imageBuffer const):
2681         * platform/mock/MockRealtimeVideoSource.h:
2682
2683 2018-12-08  Alex Christensen  <achristensen@webkit.org>
2684
2685         Don't programmatically capitalize safe browsing warning buttons
2686         https://bugs.webkit.org/show_bug.cgi?id=192531
2687         <rdar://problem/46417791>
2688
2689         Reviewed by Darin Adler.
2690
2691         This doesn't work so well in other languages.
2692         Capitalize the source strings in English instead.
2693
2694         * en.lproj/Localizable.strings:
2695
2696 2018-12-08  Frederic Wang  <fwang@igalia.com>
2697
2698         Allow control over child order when adding nodes to the scrolling tree
2699         https://bugs.webkit.org/show_bug.cgi?id=176914
2700         <rdar://problem/46542237>
2701
2702         Reviewed by Simon Fraser.
2703
2704         Based on an earlier patch by Simon Fraser.
2705
2706         Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent,
2707         but with no control over sibling order. To allow for correct hit-testing overflow and
2708         frame scrolling nodes, we have to build the scrolling tree in z-order.
2709
2710         This patch adds a 'childIndex' parameter to attachNode() which gives control over
2711         sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value
2712         for childIndex so the current behavior (appending new nodes at the end of child list) is
2713         preserved.
2714
2715         One test marked as flakey, since scrolling tree order is currently dependent on HashSet
2716         traversal order.
2717
2718         * page/scrolling/AsyncScrollingCoordinator.cpp:
2719         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
2720         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2721         * page/scrolling/AsyncScrollingCoordinator.h:
2722         * page/scrolling/ScrollingCoordinator.h:
2723         (WebCore::ScrollingCoordinator::attachToStateTree):
2724         * page/scrolling/ScrollingStateNode.cpp:
2725         (WebCore::ScrollingStateNode::insertChild):
2726         (WebCore::ScrollingStateNode::indexOfChild const):
2727         * page/scrolling/ScrollingStateNode.h:
2728         * page/scrolling/ScrollingStateTree.cpp:
2729         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
2730         (WebCore::ScrollingStateTree::attachNode):
2731         * page/scrolling/ScrollingStateTree.h:
2732
2733 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
2734
2735         [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
2736         https://bugs.webkit.org/show_bug.cgi?id=192511
2737         <rdar://problem/46562063>
2738
2739         Reviewed by Youenn Fablet.
2740
2741         Test: http/tests/media/media-stream/device-change-event-in-iframe.html
2742
2743         * Modules/mediastream/MediaDevices.cpp:
2744         (WebCore::MediaDevices::addEventListener): Don't fire the event unless the document can
2745         access a camera or microphone.
2746
2747 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
2748
2749         [MediaStream] Address post-review comments after r238904
2750         https://bugs.webkit.org/show_bug.cgi?id=192514
2751         <rdar://problem/46564302>
2752
2753         Reviewed by Youenn Fablet.
2754
2755         No new tests, no functional change.
2756
2757         * platform/graphics/cv/ImageTransferSessionVT.mm:
2758         (WebCore::ImageTransferSessionVT::setSize):
2759         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2760         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
2761
2762 2018-12-07  Antti Koivisto  <antti@apple.com>
2763
2764         [LFC] Rename LayoutFormattingState files to LayoutState
2765         https://bugs.webkit.org/show_bug.cgi?id=192520
2766
2767         Reviewed by Zalan Bujtas.
2768
2769         Match the class name.
2770
2771         * layout/FormattingContext.cpp:
2772         * layout/FormattingContextQuirks.cpp:
2773         * layout/FormattingState.h:
2774         * layout/LayoutFormattingState.cpp: Removed.
2775         * layout/LayoutFormattingState.h: Removed.
2776         * layout/LayoutState.cpp: Copied from Source/WebCore/layout/LayoutFormattingState.cpp.
2777         * layout/LayoutState.h: Copied from Source/WebCore/layout/LayoutFormattingState.h.
2778         * layout/Verification.cpp:
2779         * layout/blockformatting/BlockFormattingContext.cpp:
2780         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2781         * layout/blockformatting/BlockInvalidation.cpp:
2782         * layout/floats/FloatAvoider.cpp:
2783         * layout/floats/FloatingContext.cpp:
2784         * layout/floats/FloatingState.cpp:
2785         * layout/inlineformatting/InlineFormattingContext.cpp:
2786         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2787         * layout/inlineformatting/InlineInvalidation.cpp:
2788         * layout/layouttree/LayoutTreeBuilder.cpp:
2789         * page/FrameViewLayoutContext.cpp:
2790
2791 2018-12-07  Justin Michaud  <justin_michaud@apple.com>
2792
2793         CSS Painting API code cleanup
2794         https://bugs.webkit.org/show_bug.cgi?id=192480
2795
2796         Reviewed by Dean Jackson.
2797
2798         No new tests, since the existing tests should cover it.
2799
2800         * bindings/js/JSDOMWrapper.cpp:
2801         (WebCore::outputConstraintSubspaceFor):
2802         (WebCore::globalObjectOutputConstraintSubspaceFor):
2803         * bindings/js/JSWorkletGlobalScopeBase.cpp:
2804         (WebCore::toJS):
2805         * css/CSSPaintCallback.h:
2806         * platform/graphics/CustomPaintImage.cpp:
2807         (WebCore::CustomPaintImage::doCustomPaint):
2808         * platform/graphics/CustomPaintImage.h:
2809         * rendering/style/RenderStyle.cpp:
2810         (WebCore::RenderStyle::addCustomPaintWatchProperty):
2811         (WebCore::changedCustomPaintWatchedProperty):
2812         (WebCore::RenderStyle::changeRequiresRepaint const):
2813         * worklets/PaintWorkletGlobalScope.cpp:
2814         (WebCore::PaintWorkletGlobalScope::registerPaint):
2815         * worklets/PaintWorkletGlobalScope.h:
2816
2817 2018-12-07  Youenn Fablet  <youenn@apple.com>
2818
2819         Update libwebrtc up to 0d007d7c4f
2820         https://bugs.webkit.org/show_bug.cgi?id=192316
2821
2822         Reviewed by Eric Carlson.
2823
2824         Update include according new libwebrtc.
2825
2826         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2827
2828 2018-12-07  Dean Jackson  <dino@apple.com>
2829
2830         [iOS] Make WebGPU work with remote layer hosting
2831         https://bugs.webkit.org/show_bug.cgi?id=192508
2832         <rdar://problem/46560649>
2833
2834         Reviewed by Tim Horton.
2835
2836         WebGPU wasn't working on iOS because we were not correctly
2837         identifying the CALayers for remote hosting. Fix this by
2838         adding a new CALayer type, WebGPULayer. This will also
2839         eventually hold the code to render WebGPU into a canvas.
2840
2841         Covered by the existing reference tests (on device).
2842
2843         * SourcesCocoa.txt: Add new files.
2844         * WebCore.xcodeproj/project.pbxproj: Ditto.
2845
2846         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
2847         class for remote hosting.
2848         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2849         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2850
2851         * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
2852         from CAMetalLayer.
2853         * platform/graphics/cocoa/WebGPULayer.mm: Added.
2854         (-[WebGPULayer init]):
2855         (-[WebGPULayer copyImageSnapshotWithColorSpace:]):
2856
2857         * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
2858         than CALayer.
2859
2860         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
2861         the WebGPULayer has a reference back to this object, which it
2862         will use in the future.
2863         (WebCore::GPUSwapChain::create):
2864         (WebCore::GPUSwapChain::GPUSwapChain):
2865
2866 2018-12-07  Antti Koivisto  <antti@apple.com>
2867
2868         Rename LayoutState to RenderLayoutState
2869         https://bugs.webkit.org/show_bug.cgi?id=192504
2870
2871         Reviewed by Zalan Bujtas.
2872
2873         The name is better used in LFC.
2874
2875         * Sources.txt:
2876         * WebCore.xcodeproj/project.pbxproj:
2877         * page/FrameViewLayoutContext.cpp:
2878         (WebCore::FrameViewLayoutContext::layoutState const):
2879         (WebCore::FrameViewLayoutContext::pushLayoutState):
2880         (WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded):
2881         * page/FrameViewLayoutContext.h:
2882         * rendering/LayoutState.cpp: Removed.
2883         * rendering/LayoutState.h: Removed.
2884         * rendering/RenderBlock.cpp:
2885         * rendering/RenderBlock.h:
2886         * rendering/RenderBlockFlow.cpp:
2887         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
2888         * rendering/RenderBlockLineLayout.cpp:
2889         * rendering/RenderBox.cpp:
2890         * rendering/RenderEmbeddedObject.cpp:
2891         * rendering/RenderFragmentedFlow.cpp:
2892         * rendering/RenderGrid.cpp:
2893         * rendering/RenderImage.cpp:
2894         * rendering/RenderInline.cpp:
2895         * rendering/RenderLayoutState.cpp: Copied from Source/WebCore/rendering/LayoutState.cpp.
2896         (WebCore::RenderLayoutState::RenderLayoutState):
2897         (WebCore::RenderLayoutState::computeOffsets):
2898         (WebCore::RenderLayoutState::computeClipRect):
2899         (WebCore::RenderLayoutState::computePaginationInformation):
2900         (WebCore::RenderLayoutState::pageLogicalOffset const):
2901         (WebCore::RenderLayoutState::computeLineGridPaginationOrigin):
2902         (WebCore::RenderLayoutState::propagateLineGridInfo):
2903         (WebCore::RenderLayoutState::establishLineGrid):
2904         (WebCore::RenderLayoutState::addLayoutDelta):
2905         (WebCore::RenderLayoutState::layoutDeltaMatches const):
2906         (WebCore::LayoutState::LayoutState): Deleted.
2907         (WebCore::LayoutState::computeOffsets): Deleted.
2908         (WebCore::LayoutState::computeClipRect): Deleted.
2909         (WebCore::LayoutState::computePaginationInformation): Deleted.
2910         (WebCore::LayoutState::pageLogicalOffset const): Deleted.
2911         (WebCore::LayoutState::computeLineGridPaginationOrigin): Deleted.
2912         (WebCore::LayoutState::propagateLineGridInfo): Deleted.
2913         (WebCore::LayoutState::establishLineGrid): Deleted.
2914         (WebCore::LayoutState::addLayoutDelta): Deleted.
2915         (WebCore::LayoutState::layoutDeltaMatches const): Deleted.
2916         * rendering/RenderLayoutState.h: Copied from Source/WebCore/rendering/LayoutState.h.
2917         (WebCore::RenderLayoutState::RenderLayoutState):
2918         (WebCore::LayoutState::LayoutState): Deleted.
2919         (WebCore::LayoutState::isPaginated const): Deleted.
2920         (WebCore::LayoutState::pageLogicalHeight const): Deleted.
2921         (WebCore::LayoutState::pageLogicalHeightChanged const): Deleted.
2922         (WebCore::LayoutState::lineGrid const): Deleted.
2923         (WebCore::LayoutState::lineGridOffset const): Deleted.
2924         (WebCore::LayoutState::lineGridPaginationOrigin const): Deleted.
2925         (WebCore::LayoutState::paintOffset const): Deleted.
2926         (WebCore::LayoutState::layoutOffset const): Deleted.
2927         (WebCore::LayoutState::pageOffset const): Deleted.
2928         (WebCore::LayoutState::needsBlockDirectionLocationSetBeforeLayout const): Deleted.
2929         (WebCore::LayoutState::renderer const): Deleted.
2930         (WebCore::LayoutState::clipRect const): Deleted.
2931         (WebCore::LayoutState::isClipped const): Deleted.
2932         (WebCore::LayoutState::layoutDelta const): Deleted.
2933         * rendering/RenderListBox.cpp:
2934         * rendering/RenderMediaControlElements.cpp:
2935         * rendering/RenderMultiColumnFlow.cpp:
2936         * rendering/RenderTable.cpp:
2937         * rendering/RenderTableRow.cpp:
2938         * rendering/RenderTableSection.cpp:
2939         * rendering/RenderVTTCue.cpp:
2940         * rendering/RenderView.cpp:
2941         * rendering/RenderView.h:
2942         * rendering/RootInlineBox.cpp:
2943         * rendering/svg/RenderSVGRoot.cpp:
2944         (WebCore::RenderSVGRoot::layout):
2945
2946 2018-12-07  Antti Koivisto  <antti@apple.com>
2947
2948         [LFC] Rename formattingContext() to createFormattingContext()
2949         https://bugs.webkit.org/show_bug.cgi?id=192500
2950
2951         Reviewed by Zalan Bujtas.
2952
2953         * layout/FormattingContext.cpp:
2954         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2955         * layout/FormattingState.h:
2956         * layout/LayoutFormattingState.cpp:
2957         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2958         * layout/blockformatting/BlockFormattingState.cpp:
2959         (WebCore::Layout::BlockFormattingState::createFormattingContext):
2960         (WebCore::Layout::BlockFormattingState::formattingContext): Deleted.
2961         * layout/blockformatting/BlockFormattingState.h:
2962         * layout/inlineformatting/InlineFormattingContext.cpp:
2963         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2964         * layout/inlineformatting/InlineFormattingState.h:
2965
2966 2018-12-07  Truitt Savell  <tsavell@apple.com>
2967
2968         Unreviewed, rolling out r238947.
2969
2970         Revision caused fast/visual-viewport/tiled-drawing/zoomed-
2971         fixed-scrolling-layers-state.html to constantly fail
2972
2973         Reverted changeset:
2974
2975         "Allow control over child order when adding nodes to the
2976         scrolling tree"
2977         https://bugs.webkit.org/show_bug.cgi?id=176914
2978         https://trac.webkit.org/changeset/238947
2979
2980 2018-12-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2981
2982         [Attachment Support] Cloned attachment elements lose their unique identifiers
2983         https://bugs.webkit.org/show_bug.cgi?id=192483
2984
2985         Reviewed by Tim Horton.
2986
2987         This patch adds logic to ensure that the unique identifier of a cloned attachment element is the same as the
2988         unique identifier of the original attachment element. If the cloned attachment is inserted into the same
2989         document as the original attachment, then we will exercise the same codepath for copied-and-pasted attachments,
2990         and assign a new unique identifier to the attachment element, while creating a new `_WKAttachment` in the client
2991         that's backed by the same `NSFileWrapper`.
2992
2993         Test: WKAttachmentTests.AttachmentIdentifierOfClonedAttachment
2994
2995         * html/HTMLAttachmentElement.cpp:
2996         (WebCore::HTMLAttachmentElement::copyNonAttributePropertiesFromElement):
2997         * html/HTMLAttachmentElement.h:
2998
2999 2018-12-07  Rob Buis  <rbuis@igalia.com>
3000
3001         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
3002         https://bugs.webkit.org/show_bug.cgi?id=192288
3003
3004         Reviewed by Frédéric Wang.
3005
3006         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
3007         as they do the same thing. Also remove std::optional from parseAccessControlAllowList
3008         since the function can't fail.
3009
3010         * WebCore.order:
3011         * loader/CrossOriginAccessControl.cpp:
3012         (WebCore::validatePreflightResponse):
3013         * loader/CrossOriginPreflightResultCache.cpp:
3014         (WebCore::CrossOriginPreflightResultCacheItem::parse):
3015         * loader/CrossOriginPreflightResultCache.h:
3016         * platform/network/HTTPParsers.cpp:
3017         (WebCore::parseAccessControlExposeHeadersAllowList): Deleted.
3018         * platform/network/HTTPParsers.h:
3019         (WebCore::parseAccessControlAllowList):
3020         * platform/network/ResourceResponseBase.cpp:
3021         (WebCore::ResourceResponseBase::filter):
3022         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
3023
3024 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
3025
3026         [iOS] Don't update AVPlayerViewController currentTime while scrubbing
3027         https://bugs.webkit.org/show_bug.cgi?id=192438
3028         <rdar://problem/42977046>
3029
3030         Reviewed by Jer Noble.
3031
3032         No new tests, tested manually.
3033
3034         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
3035         (WebCore::PlaybackSessionInterfaceAVKit::currentTimeChanged): Don't report change during scrubbing.
3036
3037         * platform/ios/WebAVPlayerController.h:
3038         * platform/ios/WebAVPlayerController.mm:
3039         (-[WebAVPlayerController beginScrubbing:]): Set _isScrubbing.
3040         (-[WebAVPlayerController endScrubbing:]): Ditto.
3041         (-[WebAVPlayerController isScrubbing]): Return _isScrubbing.
3042
3043 2018-12-07  Thibault Saunier  <tsaunier@igalia.com>
3044
3045         [WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs
3046         https://bugs.webkit.org/show_bug.cgi?id=186933
3047
3048         Reusing the AudioSourceProviderGStreamer itself as it was doing almost everything we needed,
3049         just added a constructor to be able to create it from a MediaStreamTrackPrivate and made it a
3050         WebAudioSourceProvider which only means it is now a ThreadSafeRefCounted.
3051
3052         Sensibily refactored GStreamerMediaStreamSource so that we could reuse it to track a single
3053         MediaStreamTrack.
3054
3055         Reviewed by Philippe Normand.
3056
3057         Enabled all tests depending on that feature.
3058
3059         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
3060         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
3061         (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
3062         (WebCore::AudioSourceProviderGStreamer::setClient):
3063         * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
3064         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3065         (WebCore::MediaStreamTrackPrivate::audioSourceProvider):
3066         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
3067         (WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer):
3068         * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
3069         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
3070         (WebCore::webkitMediaStreamSrcSetupSrc):
3071         (WebCore::webkitMediaStreamSrcSetupAppSrc):
3072         (WebCore::webkitMediaStreamSrcAddTrack):
3073         (WebCore::webkitMediaStreamSrcSetStream):
3074         (WebCore::webkitMediaStreamSrcNew):
3075         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h:
3076         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
3077         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource):
3078         (WebCore::WrappedMockRealtimeAudioSource::start):
3079         (WebCore::WrappedMockRealtimeAudioSource::addHum):
3080         (WebCore::WrappedMockRealtimeAudioSource::render):
3081         (WebCore::WrappedMockRealtimeAudioSource::settingsDidChange):
3082         (WebCore::MockGStreamerAudioCaptureSource::startProducingData):
3083         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
3084         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Handle the case where input buffers
3085           are "big" and process all the data we can for each runs of the method.
3086
3087 2018-12-06  Alexey Proskuryakov  <ap@apple.com>
3088
3089         Move USE_NEW_THEME out of WebCore's config.h
3090         https://bugs.webkit.org/show_bug.cgi?id=192426
3091
3092         Reviewed by Tim Horton.
3093
3094         * config.h:
3095
3096 2018-12-06  Frederic Wang  <fwang@igalia.com>
3097
3098         Allow control over child order when adding nodes to the scrolling tree
3099         https://bugs.webkit.org/show_bug.cgi?id=176914
3100
3101         Reviewed by Simon Fraser.
3102
3103         Based on an earlier patch by Simon Fraser.
3104
3105         Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent,
3106         but with no control over sibling order. To allow for correct hit-testing overflow and
3107         frame scrolling nodes, we have to build the scrolling tree in z-order.
3108
3109         This patch adds a 'childIndex' parameter to attachNode() which gives control over
3110         sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value
3111         for childIndex so the current behavior (appending new nodes at the end of child list) is
3112         preserved.
3113
3114         No new tests, behavior unchanged and already covered by existing tests.
3115
3116         * page/scrolling/AsyncScrollingCoordinator.cpp:
3117         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
3118         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
3119         * page/scrolling/AsyncScrollingCoordinator.h:
3120         * page/scrolling/ScrollingCoordinator.h:
3121         (WebCore::ScrollingCoordinator::attachToStateTree):
3122         * page/scrolling/ScrollingStateNode.cpp:
3123         (WebCore::ScrollingStateNode::insertChild):
3124         (WebCore::ScrollingStateNode::indexOfChild const):
3125         * page/scrolling/ScrollingStateNode.h:
3126         * page/scrolling/ScrollingStateTree.cpp:
3127         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
3128         (WebCore::ScrollingStateTree::attachNode):
3129         * page/scrolling/ScrollingStateTree.h:
3130
3131 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
3132
3133         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
3134         https://bugs.webkit.org/show_bug.cgi?id=192377
3135         <rdar://problem/46364206>
3136
3137         Reviewed by Tim Horton.
3138
3139         If the page specifies width=device-width or initial-scale=1 in the viewport meta tag, we should use the
3140         native device width and ignore the minimum effective device width in ViewportConfiguration. The patch
3141         also introduces scalableNativeWebpageParameters() which uses the device width as default and also allows the page
3142         to shrink-to-fit. If a page doesn't have viewport meta tag, or if the width argument isn't device-width
3143         and the initial scale isn't 1, we will use scalableNativeWebpageParameters() as the default configuration.
3144
3145         Tests: fast/viewport/ios/ignore-minimum-device-width-for-page-with-viewport-device-width.html
3146                fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta.html
3147
3148         * page/ViewportConfiguration.cpp:
3149         (WebCore::ViewportConfiguration::updateDefaultConfiguration): pick the default configuration based on
3150             the page's viewport arguments. Also, we will always fall back to scalableNativeWebpageParameters() if we
3151             can ignore scaling constraints.
3152         (WebCore::ViewportConfiguration::setViewportArguments): When page sends us new ViewportArguments, pick
3153             up the correponsding default configuration before updating the configuration.
3154         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): When m_canIgnoreScalingConstraints is
3155             changed, try to pick up the correponsding default configuration.
3156         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Add a new default set of viewport Parameters
3157             this is very close to nativeWebpageParameters() excpet that it allows shrink to fit and its minimum scale
3158             is 0.25. We will use this Parameters for pages that doesn't have viewport meta tag; or the width is
3159             not device-width and initial scale is not 1.
3160         (WebCore::ViewportConfiguration::updateConfiguration): If the page's viewport argument doesn't override
3161             the default width, use the m_minimumLayoutSize.width().
3162         * page/ViewportConfiguration.h:
3163         (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const): A helper method to tell
3164             if we should avoid using minimum effective device width.
3165         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): If we are using a default
3166             configuration that is neither nativeWebpageParameters() nor scalableNativeWebpageParameters(), don't override
3167             it.
3168         (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const): Add a helper method to return minimum
3169             effective device width based on shouldIgnoreMinimumEffectiveDeviceWidth().
3170         (WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor const): Use minimumEffectiveDeviceWidth().
3171
3172 2018-12-06  Adrian Perez de Castro  <aperez@igalia.com>
3173
3174         Content Extensions: Misc fixes to debugging / perf testing code
3175         https://bugs.webkit.org/show_bug.cgi?id=192474
3176
3177         Reviewed by Mark Lam.
3178
3179         This make it possible to build the content extensions support with the
3180         debugging features enabled. In particular, building with
3181         CONTENT_EXTENSIONS_PERFORMANCE_REPORTING enabled was broken.
3182
3183         No new tests needed.
3184
3185         * contentextensions/ContentExtensionCompiler.cpp:
3186         (WebCore::ContentExtensions::compileRuleList): Remove usage of removed
3187         variables machinesWihthoutConditionsCount,
3188         totalBytecodeSizeForMachinesWithoutConditions,
3189         machinesWithConditionsCount, and
3190         totalBytecodeSizeForMachinesWithConditions.
3191         * contentextensions/DFA.cpp:
3192         (WebCore::ContentExtensions::DFA::debugPrintDot const):
3193         Use "%" PRIu64 instead of "%llu" to format uint64_t values.
3194         * contentextensions/NFA.cpp:
3195         (WebCore::ContentExtensions::NFA::debugPrintDot const):
3196         Use "%" PRIu64 instead of "%llu" to format uint64_t values.
3197
3198 2018-12-06  Alex Christensen  <achristensen@webkit.org>
3199
3200         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
3201         https://bugs.webkit.org/show_bug.cgi?id=192452
3202
3203         Reviewed by Anders Carlsson.
3204
3205         * loader/LoaderStrategy.h:
3206         * loader/ResourceLoader.cpp:
3207         (WebCore::ResourceLoader::didRetrieveDerivedDataFromCache): Deleted.
3208         * loader/ResourceLoader.h:
3209         * loader/ResourceLoaderOptions.h:
3210         * loader/SubresourceLoader.cpp:
3211         (WebCore::SubresourceLoader::didRetrieveDerivedDataFromCache): Deleted.
3212         * loader/SubresourceLoader.h:
3213         * loader/ThreadableLoader.cpp:
3214         (WebCore::ThreadableLoaderOptions::isolatedCopy const):
3215         * loader/cache/CachedResource.h:
3216         (WebCore::CachedResource::didRetrieveDerivedDataFromCache): Deleted.
3217
3218 2018-12-06  Zalan Bujtas  <zalan@apple.com>
3219
3220         [LFC][BFC][MarginCollapsing] HeightAndMargin::margin is always the non-collapsed margin value.
3221         https://bugs.webkit.org/show_bug.cgi?id=192345
3222
3223         Reviewed by Antti Koivisto.
3224
3225         Rename HeightAndMargin::margin to HeightAndMargin::nonCollapsedMargin.
3226
3227         * layout/FormattingContext.cpp:
3228         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3229         * layout/LayoutUnits.h:
3230         (WebCore::Layout::HeightAndMargin::usedMarginValues const):
3231         * layout/blockformatting/BlockFormattingContext.cpp:
3232         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3233         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3234         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3235         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3236         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3237         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3238         * layout/inlineformatting/InlineFormattingContext.cpp:
3239         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
3240
3241 2018-12-06  Zalan Bujtas  <zalan@apple.com>
3242
3243         [LFC][BFC][MarginCollapsing] Add MarginCollapse::establishesBlockFormattingContext
3244         https://bugs.webkit.org/show_bug.cgi?id=192297
3245
3246         Reviewed by Antti Koivisto.
3247
3248         WebKit treats the document element renderer as a block formatting context root.
3249
3250         * layout/blockformatting/BlockMarginCollapse.cpp:
3251         (WebCore::Layout::establishesBlockFormattingContext):
3252         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
3253         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
3254
3255 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
3256
3257         [GStreamer] -DENABLE_VIDEO=ON -DENABLE_OPENGL=OFF still tries to build GstreamerGL
3258         https://bugs.webkit.org/show_bug.cgi?id=191998
3259
3260         Reviewed by Philippe Normand.
3261
3262         Fix compilation with -DENABLE_VIDEO=ON and -DENABLE_OPENGL=OFF due to GStreamerGL.
3263
3264         No new tests required. Only fixing the build with certain flags.
3265
3266         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
3267         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): add required #if ENABLE(WEBGL).
3268
3269 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
3270
3271         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
3272         https://bugs.webkit.org/show_bug.cgi?id=191997
3273
3274         Reviewed by Philippe Normand.
3275
3276         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
3277
3278         No new tests required. Only fixing build.
3279
3280         * platform/gtk/PlatformWheelEventGtk.cpp:
3281         (WebCore::PlatformWheelEvent::PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
3282
3283 2018-12-05  Don Olmstead  <don.olmstead@sony.com>
3284
3285         [PlayStation] Enable WebCore
3286         https://bugs.webkit.org/show_bug.cgi?id=192384
3287
3288         Reviewed by Brent Fulgham.
3289
3290         Implements WebCore for the PlayStation platform.
3291
3292         * PlatformPlayStation.cmake: Added.
3293         * loader/cache/CachedResourceLoader.cpp:
3294         * platform/generic/KeyedDecoderGeneric.cpp: Added.
3295         (WebCore::KeyedDecoder::decoder):
3296         (WebCore::KeyedDecoderGeneric::KeyedDecoderGeneric):
3297         (WebCore::KeyedDecoderGeneric::~KeyedDecoderGeneric):
3298         (WebCore::KeyedDecoderGeneric::decodeBytes):
3299         (WebCore::KeyedDecoderGeneric::decodeBool):
3300         (WebCore::KeyedDecoderGeneric::decodeUInt32):
3301         (WebCore::KeyedDecoderGeneric::decodeUInt64):
3302         (WebCore::KeyedDecoderGeneric::decodeInt32):
3303         (WebCore::KeyedDecoderGeneric::decodeInt64):
3304         (WebCore::KeyedDecoderGeneric::decodeFloat):
3305         (WebCore::KeyedDecoderGeneric::decodeDouble):
3306         (WebCore::KeyedDecoderGeneric::decodeString):
3307         (WebCore::KeyedDecoderGeneric::beginObject):
3308         (WebCore::KeyedDecoderGeneric::endObject):
3309         (WebCore::KeyedDecoderGeneric::beginArray):
3310         (WebCore::KeyedDecoderGeneric::beginArrayElement):
3311         (WebCore::KeyedDecoderGeneric::endArrayElement):
3312         (WebCore::KeyedDecoderGeneric::endArray):
3313         * platform/generic/KeyedDecoderGeneric.h: Added.
3314         * platform/generic/KeyedEncoderGeneric.cpp: Added.
3315         (WebCore::KeyedEncoder::encoder):
3316         (WebCore::KeyedEncoderGeneric::KeyedEncoderGeneric):
3317         (WebCore::KeyedEncoderGeneric::~KeyedEncoderGeneric):
3318         (WebCore::KeyedEncoderGeneric::encodeBytes):
3319         (WebCore::KeyedEncoderGeneric::encodeBool):
3320         (WebCore::KeyedEncoderGeneric::encodeUInt32):
3321         (WebCore::KeyedEncoderGeneric::encodeUInt64):
3322         (WebCore::KeyedEncoderGeneric::encodeInt32):
3323         (WebCore::KeyedEncoderGeneric::encodeInt64):
3324         (WebCore::KeyedEncoderGeneric::encodeFloat):
3325         (WebCore::KeyedEncoderGeneric::encodeDouble):
3326         (WebCore::KeyedEncoderGeneric::encodeString):
3327         (WebCore::KeyedEncoderGeneric::beginObject):
3328         (WebCore::KeyedEncoderGeneric::endObject):
3329         (WebCore::KeyedEncoderGeneric::beginArray):
3330         (WebCore::KeyedEncoderGeneric::beginArrayElement):
3331         (WebCore::KeyedEncoderGeneric::endArrayElement):
3332         (WebCore::KeyedEncoderGeneric::endArray):
3333         (WebCore::KeyedEncoderGeneric::finishEncoding):
3334         * platform/generic/KeyedEncoderGeneric.h: Added.
3335         * platform/network/curl/NetworkStorageSessionCurl.cpp:
3336         (WebCore::defaultCookieJarPath):
3337         * platform/network/playstation/CurlSSLHandlePlayStation.cpp: Added.
3338         (WebCore::getCACertPathEnv):
3339         (WebCore::CurlSSLHandle::platformInitialize):
3340         * platform/network/playstation/NetworkStateNotifierPlayStation.cpp: Added.
3341         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
3342         (WebCore::NetworkStateNotifier::startObserving):
3343         * platform/playstation/EventLoopPlayStation.cpp: Added.
3344         (WebCore::EventLoop::cycle):
3345         * platform/playstation/MIMETypeRegistryPlayStation.cpp: Added.
3346         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
3347         (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
3348         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
3349         * platform/playstation/PlatformScreenPlayStation.cpp: Added.
3350         (WebCore::screenDepth):
3351         (WebCore::screenDepthPerComponent):
3352         (WebCore::screenIsMonochrome):
3353         (WebCore::screenHasInvertedColors):
3354         (WebCore::screenRect):
3355         (WebCore::screenAvailableRect):
3356         (WebCore::screenSupportsExtendedColor):
3357         * platform/playstation/ScrollbarThemePlayStation.cpp: Added.
3358         (WebCore::ScrollbarTheme::nativeTheme):
3359         (WebCore::ScrollbarThemePlayStation::scrollbarThickness):
3360         (WebCore::ScrollbarThemePlayStation::hasButtons):
3361         (WebCore::ScrollbarThemePlayStation::hasThumb):
3362         (WebCore::ScrollbarThemePlayStation::backButtonRect):
3363         (WebCore::ScrollbarThemePlayStation::forwardButtonRect):
3364         (WebCore::ScrollbarThemePlayStation::trackRect):
3365         (WebCore::ScrollbarThemePlayStation::paintTrackBackground):
3366         (WebCore::ScrollbarThemePlayStation::paintThumb):
3367         * platform/playstation/ScrollbarThemePlayStation.h: Added.
3368         * platform/playstation/UserAgentPlayStation.cpp: Added.
3369         (WebCore::standardUserAgent):
3370         (WebCore::standardUserAgentForURL):
3371         * rendering/RenderThemePlayStation.cpp: Added.
3372         (WebCore::RenderTheme::singleton):
3373         (WebCore::RenderThemePlayStation::updateCachedSystemFontDescription const):
3374         * rendering/RenderThemePlayStation.h: Added.
3375
3376 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
3377
3378         Null pointer crash in DocumentOrderedMap::getElementById via FormAssociatedElement::findAssociatedForm
3379         https://bugs.webkit.org/show_bug.cgi?id=192392
3380
3381         Reviewed by Dean Jackson.
3382
3383         The crash was caused by FormAssociatedElement::findAssociatedForm invoking DocumentOrderedMap::getElementById
3384         and de-referencing nullptr Attribute* via IdTargetObserver before Element::attributeChanged had updated
3385         ElementData::m_idForStyleResolution.
3386
3387         Fixed it by updating m_idForStyleResolution before invoking IdTargetObservers.
3388
3389         Test: fast/dom/remove-id-form-associated-elemet-id-observer-crash.html
3390
3391         * dom/Element.cpp:
3392         (WebCore::Element::attributeChanged): Fixed the bug.
3393
3394 2018-12-05  Youenn Fablet  <youenn@apple.com>
3395
3396         Enable the possibility to do video capture in UIProcess
3397         https://bugs.webkit.org/show_bug.cgi?id=192394
3398
3399         Reviewed by Eric Carlson.
3400
3401         Create IOSurface-backed sample buffers so that we can easily send them through IPC.
3402         Manually tested.
3403
3404         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3405         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
3406
3407 2018-12-05  Youenn Fablet  <youenn@apple.com>
3408
3409         Update ServiceWorkerContainer::getRegistration lambdas
3410         https://bugs.webkit.org/show_bug.cgi?id=192376
3411
3412         Reviewed by Chris Dumez.
3413
3414         There is no need to pass 'this' in lambdas as the last lambda
3415         takes a ScriptExecutionContext&.
3416         No change of behavior.
3417
3418         * workers/service/ServiceWorkerContainer.cpp:
3419         (WebCore::ServiceWorkerContainer::getRegistration):
3420         (WebCore::ServiceWorkerContainer::getRegistrations):
3421
3422 2018-12-05  Chris Dumez  <cdumez@apple.com>
3423
3424         Crash under WebCore::cachedDocumentWrapper()
3425         https://bugs.webkit.org/show_bug.cgi?id=192421
3426         <rdar://problem/37114163>
3427
3428         Reviewed by Alex Christensen.
3429
3430         Fix potential null defererence of the value returned by toJSDOMWindow(). For example,
3431         if the window is frameless, it would return null.
3432
3433         * bindings/js/JSDocumentCustom.cpp:
3434         (WebCore::cachedDocumentWrapper):
3435
3436 2018-12-05  Eric Carlson  <eric.carlson@apple.com>
3437
3438         [MediaStream] Cleanup up Mac screen capture class
3439         https://bugs.webkit.org/show_bug.cgi?id=192379
3440         <rdar://problem/46465458>
3441
3442         Reviewed by Youenn Fablet.
3443
3444         No new tests, tested manually.
3445
3446         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
3447         (WebCore::DisplayCaptureManagerCocoa::captureDevices): Initialize Screen devices first so
3448         they are first in the list of devices.
3449
3450         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
3451         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3452         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Cleanup. Always capture at the
3453         native screen size to work around a bug.
3454         (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange): Deleted.
3455
3456 2018-12-05  Commit Queue  <commit-queue@webkit.org>
3457
3458         Unreviewed, rolling out r238844, r238846, and r238874.
3459         https://bugs.webkit.org/show_bug.cgi?id=192414
3460
3461         The layout tests added with this change are flaky. (Requested
3462         by ryanhaddad on #webkit).
3463
3464         Reverted changesets:
3465
3466         "Implement non-timeslice mode encoding for MediaRecorder"
3467         https://bugs.webkit.org/show_bug.cgi?id=192069
3468         https://trac.webkit.org/changeset/238844
3469
3470         "Fix the build"
3471         https://trac.webkit.org/changeset/238846
3472
3473         "Fix MediaRecorder flaky tests"
3474         https://bugs.webkit.org/show_bug.cgi?id=192371
3475         https://trac.webkit.org/changeset/238874
3476
3477 2018-12-05  Frederic Wang  <fwang@igalia.com>
3478
3479         Minor refactoring of the scrolling code
3480         https://bugs.webkit.org/show_bug.cgi?id=192398
3481
3482         Reviewed by Simon Fraser.
3483
3484         Based on an earlier patch by Simon Fraser.
3485
3486         This patch performs some minor refactoring of the scrolling code:
3487         - Rename ScrollingCoordinator::uniqueScrollLayerID() to uniqueScrollingNodeID() since it
3488           is really a node id.
3489         - Inline ScrollingStateTree::setRootStateNode() so we only need to forward declare
3490           ScrollingStateFrameScrollingNode in headers.
3491         - Pass argument to ScrollingStateTree::addNode() as a reference rather than a pointer.
3492         - Initialize ScrollingStateTree::m_changedProperties and ScrollingStateTree::m_parent in
3493           the header file.
3494         - Remove obsolete comment about ScrollingCoordinatorMac.
3495
3496         No new tests, behavior unchanged.
3497
3498         * page/scrolling/ScrollingCoordinator.cpp:
3499         (WebCore::ScrollingCoordinator::uniqueScrollingNodeID):
3500         (WebCore::ScrollingCoordinator::uniqueScrollLayerID): Deleted.
3501         * page/scrolling/ScrollingCoordinator.h:
3502         * page/scrolling/ScrollingStateNode.cpp:
3503         (WebCore::ScrollingStateNode::ScrollingStateNode):
3504         * page/scrolling/ScrollingStateNode.h:
3505         * page/scrolling/ScrollingStateTree.cpp:
3506         (WebCore::ScrollingStateTree::attachNode):
3507         (WebCore::ScrollingStateTree::setRootStateNode):
3508         (WebCore::ScrollingStateTree::addNode):
3509         * page/scrolling/ScrollingStateTree.h:
3510         (WebCore::ScrollingStateTree::setRootStateNode): Deleted.
3511         * page/scrolling/ScrollingTree.cpp:
3512         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3513         * rendering/RenderLayerCompositor.cpp:
3514         (WebCore::RenderLayerCompositor::attachScrollingNode):
3515
3516 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3517
3518         Turn WritingDirection into an enum class
3519         https://bugs.webkit.org/show_bug.cgi?id=192401
3520         Work towards <rdar://problem/42075638>
3521
3522         Reviewed by Dan Bernstein.
3523
3524         Change WritingDirection from an enum to an enum class. No change in behavior.
3525
3526         * editing/ApplyStyleCommand.cpp:
3527         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
3528         (WebCore::ApplyStyleCommand::applyInlineStyle):
3529         * editing/EditingStyle.cpp:
3530         (WebCore::EditingStyle::textDirection const):
3531         (WebCore::EditingStyle::textDirectionForSelection):
3532         * editing/Editor.cpp:
3533         (WebCore::Editor::setBaseWritingDirection):
3534         (WebCore::Editor::baseWritingDirectionForSelectionStart const):
3535         * editing/EditorCommand.cpp:
3536         (WebCore::stateTextWritingDirectionLeftToRight):
3537         (WebCore::stateTextWritingDirectionNatural):
3538         (WebCore::stateTextWritingDirectionRightToLeft):
3539         * editing/WritingDirection.h:
3540
3541         Additionally wrap this enum in `namespace WebCore`, and update the copyright year.
3542
3543         * editing/ios/EditorIOS.mm:
3544         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
3545         * page/ContextMenuController.cpp:
3546         (WebCore::ContextMenuController::contextMenuItemSelected):
3547         * testing/Internals.cpp:
3548         (WebCore::Internals::setBaseWritingDirection):
3549
3550 2018-12-05  Alicia Boya García  <aboya@igalia.com>
3551
3552         [MSE][GStreamer] Remove the AppendPipeline state machine
3553         https://bugs.webkit.org/show_bug.cgi?id=192204
3554
3555         Reviewed by Xabier Rodriguez-Calvar.
3556
3557         This patch tries to reduce the complexity of the AppendPipeline by
3558         removing the appendState state machine and cleaning all the
3559         conditional code around it that is not necessary anymore.
3560
3561         For the most part the behavior is the same, but some edge cases have
3562         been improved in the process:
3563
3564         Demuxing errors now result in the append being flagged as
3565         ParsingFailed and the error being propagated to the application. This
3566         fixes media/media-source/media-source-error-crash.html (or at least
3567         gets it up to date with cross platform expectations).
3568
3569         AbortableTaskQueue now allows the task handler to perform an abort
3570         safely. This is used in the GstBus error message sync handler, since
3571         it needs to ask the MainThread to raise a parse error, which will in
3572         turn abort. An API test has been added for this new functionality.
3573         Also, code has been added to the API tests to ensure the correct
3574         destruction of the response object, especially in this case.
3575
3576         The code handling invalid track codecs has been made clearer by also
3577         explicitly raising a parse error, but it should not expose behavior
3578         differences for the application. A test has been added for this
3579         behavior: web-platform-tests/media-source/mediasource-invalid-codec.html
3580
3581         The reporting of EOS events have been made more rigorous. EOS is only
3582         expected after a demuxing error, otherwise it's a g_critical.
3583
3584         AppendPipeline::abort() has been renamed to
3585         AppendPipeline::resetParserState() to honor the fact that it's not
3586         only called when the user calls abort() and match better the names
3587         used in the spec.
3588
3589         Test: imported/w3c/web-platform-tests/media-source/mediasource-invalid-codec.html
3590
3591         * platform/AbortableTaskQueue.h:
3592         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3593         (WebCore::assertedElementSetState):
3594         (WebCore::AppendPipeline::AppendPipeline):
3595         (WebCore::AppendPipeline::~AppendPipeline):
3596         (WebCore::AppendPipeline::handleErrorSyncMessage):
3597         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
3598         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
3599         (WebCore::AppendPipeline::appsinkCapsChanged):
3600         (WebCore::AppendPipeline::handleEndOfAppend):
3601         (WebCore::AppendPipeline::appsinkNewSample):
3602         (WebCore::AppendPipeline::didReceiveInitializationSegment):
3603         (WebCore::AppendPipeline::resetParserState):
3604         (WebCore::AppendPipeline::pushNewBuffer):
3605         (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
3606         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromStreamingThread):
3607         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
3608         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
3609         (WebCore::AppendPipeline::dumpAppendState): Deleted.
3610         (WebCore::AppendPipeline::demuxerNoMorePads): Deleted.
3611         (WebCore::AppendPipeline::setAppendState): Deleted.
3612         (WebCore::AppendPipeline::appsinkEOS): Deleted.
3613         (WebCore::AppendPipeline::resetPipeline): Deleted.
3614         (WebCore::AppendPipeline::abort): Deleted.
3615         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3616         (WebCore::AppendPipeline::appendState): Deleted.
3617         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3618         (WebCore::MediaSourceClientGStreamerMSE::abort):
3619         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
3620         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
3621         (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed):
3622         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
3623
3624 2018-12-05  Rob Buis  <rbuis@igalia.com>
3625
3626         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
3627         https://bugs.webkit.org/show_bug.cgi?id=114965
3628
3629         Reviewed by Frédéric Wang.
3630
3631         HEAD requests should not be changed to GET after 303 redirects, see [1].
3632         This was fixed earlier for GTK [2].
3633
3634         Behavior matches Firefox and Chrome.
3635
3636         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
3637         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
3638
3639         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
3640                web-platform-tests/fetch/api/redirect/redirect-method-worker.html
3641                http/tests/xmlhttprequest/head-redirection.html
3642
3643         * platform/network/mac/ResourceHandleMac.mm:
3644         (WebCore::ResourceHandle::willSendRequest):
3645
3646 2018-12-05  Rob Buis  <rbuis@igalia.com>
3647
3648         Align with Fetch on data: URLs
3649         https://bugs.webkit.org/show_bug.cgi?id=182325
3650
3651         Reviewed by Alex Christensen.
3652
3653         Do not accept data URLs that do not contain a comma
3654         character, as specified in the relevant specs [1, 2].
3655
3656         Behavior matches Firefox and Chrome.
3657
3658         Test: web-platform-tests/fetch/api/basic/scheme-data.any.html
3659
3660         [1] https://tools.ietf.org/html/rfc2397
3661         [2] https://fetch.spec.whatwg.org/#data-url-processor
3662
3663         * platform/network/DataURLDecoder.cpp:
3664         (WebCore::DataURLDecoder::parseMediaType):
3665         (WebCore::DataURLDecoder::DecodeTask::DecodeTask):
3666         (WebCore::DataURLDecoder::DecodeTask::process):
3667         (WebCore::DataURLDecoder::createDecodeTask):
3668         (WebCore::DataURLDecoder::decode):
3669
3670 2018-12-05  Frederic Wang  <fwang@igalia.com>
3671
3672         Unreviewed build fix.
3673
3674         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Add missing header.
3675
3676 2018-12-05  Javier Fernandez  <jfernandez@igalia.com>
3677
3678         [css-grid] Crash on debug changing the style of a positioned element
3679         https://bugs.webkit.org/show_bug.cgi?id=191473
3680
3681         Reviewed by Dean Jackson and Zalan Bujtas.
3682
3683         When an box becomes {out-of,in}-flow, it may be re-parented and it may become a grid
3684         item. In that case, we must mark the RenderGrid as dirty, so that the grid items
3685         placement logic is executed again.
3686
3687         Test: fast/css-grid-layout/grid-crash-out-of-flow-positioned-element.html
3688
3689         * rendering/updating/RenderTreeBuilder.cpp:
3690         (WebCore::childFlowStateChangesAndAffectsParentBlock): Consider the case of a box's new parent being a grid container.
3691
3692 2018-12-04  Frederic Wang  <fwang@igalia.com>
3693
3694         Always pass scrollingGeometry to update*ScrollingNode functions
3695         https://bugs.webkit.org/show_bug.cgi?id=192358
3696
3697         Reviewed by Simon Fraser.
3698
3699         Currently, the scrollingGeometry parameter of updateOverflowScrollingNode is always used
3700         while the one of updateFrameScrollingNode is never used. Both of them are passed as possibly
3701         null pointers. This commit makes things more consistent by making the parameter a reference
3702         and explicitly setting the scrollingGeometry of updateFrameScrollingNode. This will help
3703         other efforts (such as support for macOS/iOS asynchronous scrolling of overflow nodes /
3704         subframes or for CSS overscroll-behavior) for which new data members have to be passed to the
3705         scrolling nodes.
3706
3707         No new tests, no behavior changes.
3708
3709         * page/scrolling/AsyncScrollingCoordinator.cpp:
3710         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
3711         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
3712         * page/scrolling/AsyncScrollingCoordinator.h:
3713         * page/scrolling/ScrollingCoordinator.h:
3714         (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
3715         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode):
3716         * rendering/RenderLayerCompositor.cpp:
3717         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
3718         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3719
3720 2018-12-04  Ryosuke Niwa  <rniwa@webkit.org>
3721
3722         Crash in HTMLCollection::updateNamedElementCache
3723         https://bugs.webkit.org/show_bug.cgi?id=192347
3724
3725         Reviewed by Darin Adler.
3726
3727         The bug was caused by CollectionIndexCache's nodeAt caching the length of 1
3728         when there are no matching elements in the subtree when the index is non-zero.
3729
3730         A related bug was fixed in r182125 but we were not considering the possibility
3731         that the index given to this function might be non-zero even when there were
3732         no matching elements.
3733
3734         Test: fast/dom/options-collection-zero-length-crash.html
3735
3736         * dom/CollectionIndexCache.h:
3737         (WebCore::CollectionIndexCache<Collection, Iterator>::nodeAt):
3738
3739 2018-11-30  Jiewen Tan  <jiewen_tan@apple.com>
3740
3741         Don't report resource timing to parent frame for history items
3742         https://bugs.webkit.org/show_bug.cgi?id=192273
3743         <rdar://problem/45163764>
3744
3745         Reviewed by Youenn Fablet.
3746
3747         We should not report history items to its parent frame as those are less
3748         interested to its parent and might not be the first navigation in the iframes.
3749
3750         This change aligns the behavior when a cached document is not available for the
3751         history item with the available case as we don't report resource timing for any
3752         cached main document.
3753
3754         Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html
3755
3756         * loader/FrameLoader.cpp:
3757         (WebCore::FrameLoader::loadDifferentDocumentItem):
3758
3759 2018-12-04  Simon Fraser  <simon.fraser@apple.com>
3760
3761         REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
3762         https://bugs.webkit.org/show_bug.cgi?id=192320
3763         <rdar://problem/46429833>
3764
3765         Reviewed by Zalan Bujtas.
3766         
3767         Re-land r238840 with a more reliable test.
3768         
3769         When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
3770         RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
3771         for viewport-constrained objects so we update them.
3772         
3773         This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
3774         does enough dirtying that fixed layers nested inside scrollers get updated.
3775
3776         Test: compositing/fixed-with-main-thread-scrolling.html
3777
3778         * rendering/RenderLayerCompositor.cpp:
3779         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3780
3781 2018-12-04  Youenn Fablet  <youenn@apple.com>
3782
3783         Fix MediaRecorder flaky tests
3784         https://bugs.webkit.org/show_bug.cgi?id=192371
3785
3786         Reviewed by Eric Carlson.
3787
3788         No change of behavior.
3789
3790         * testing/Internals.cpp:
3791         (WebCore::Internals::resetToConsistentState):
3792         Reset to use real MediaRecorder by default.
3793
3794 2018-12-04  Justin Michaud  <justin_michaud@apple.com>
3795
3796         CSS Painting API should allow image values in inputProperties
3797         https://bugs.webkit.org/show_bug.cgi?id=192200
3798
3799         Reviewed by Dean Jackson.
3800
3801         Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing).
3802         Finally, we let CanvasRenderingContext2DBase render these.
3803
3804         Tests: fast/css-custom-paint/arguments.html
3805                fast/css-custom-paint/image.html
3806
3807         * CMakeLists.txt:
3808         * DerivedSources.make:
3809         * Sources.txt:
3810         * WebCore.xcodeproj/project.pbxproj:
3811         * bindings/js/CallTracerTypes.h:
3812         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp.
3813         (WebCore::toJSNewlyCreated):
3814         (WebCore::toJS):
3815         * bindings/js/WebCoreBuiltinNames.h:
3816         * css/CSSComputedStyleDeclaration.cpp:
3817         (WebCore::ComputedStyleExtractor::customPropertyValue):
3818         * css/CSSCustomPropertyValue.cpp:
3819         (WebCore::CSSCustomPropertyValue::equals const):
3820         (WebCore::CSSCustomPropertyValue::customCSSText const):
3821         (WebCore::CSSCustomPropertyValue::tokens const):
3822         * css/CSSCustomPropertyValue.h:
3823         * css/CSSPaintImageValue.cpp:
3824         (WebCore::CSSPaintImageValue::image):
3825         * css/typedom/StylePropertyMapReadOnly.h:
3826         (WebCore::StylePropertyMapReadOnly::create):
3827         (WebCore::StylePropertyMapReadOnly::get const):
3828         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
3829         * css/typedom/StylePropertyMapReadOnly.idl:
3830         * css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h.
3831         * css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl.
3832         * css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h.
3833         * css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl.
3834         * css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h.
3835         (WebCore::TypedOMCSSStyleValue::isImageValue):
3836         * css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl.
3837         * css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h.
3838         * css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl.
3839         * css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h.
3840         * css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl.
3841         * html/ImageBitmap.cpp:
3842         (WebCore::ImageBitmap::createPromise):
3843         * html/ImageBitmap.h:
3844         * html/canvas/CanvasDrawImage.idl:
3845         * html/canvas/CanvasFillStrokeStyles.idl:
3846         * html/canvas/CanvasRenderingContext.cpp:
3847         (WebCore::CanvasRenderingContext::checkOrigin):
3848         * html/canvas/CanvasRenderingContext.h:
3849         * html/canvas/CanvasRenderingContext2DBase.cpp:
3850         (WebCore::size):
3851         (WebCore::CanvasRenderingContext2DBase::drawImage):
3852         (WebCore::CanvasRenderingContext2DBase::createPattern):
3853         * html/canvas/CanvasRenderingContext2DBase.h:
3854         * inspector/InspectorCanvas.cpp:
3855         (WebCore::InspectorCanvas::buildAction):
3856         * page/WindowOrWorkerGlobalScope.idl:
3857         * platform/graphics/CustomPaintImage.cpp:
3858         (WebCore::CustomPaintImage::doCustomPaint):
3859
3860 2018-12-04  Chris Dumez  <cdumez@apple.com>
3861
3862         Regression(r238817) PSON Page Cache API tests are failing
3863         https://bugs.webkit.org/show_bug.cgi?id=192348
3864
3865         Reviewed by Alex Christensen.
3866
3867         * page/MemoryRelease.cpp:
3868         (WebCore::releaseCriticalMemory):
3869         (WebCore::releaseMemory):
3870         * page/MemoryRelease.h:
3871
3872 2018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
3873
3874         Unreviewed, rolling out r238838.
3875
3876         The layout test added with this change is failing on iOS.
3877
3878         Reverted changeset:
3879
3880         "Thick overlines and line-throughs grow in the wrong
3881         direction"
3882         https://bugs.webkit.org/show_bug.cgi?id=192264
3883         https://trac.webkit.org/changeset/238838
3884
3885 2018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
3886
3887         Unreviewed, rolling out r238840.
3888
3889         The layout test added with this change is frequently failing.
3890
3891         Reverted changeset:
3892
3893         "REGRESSION (r238090): position:fixed sidebar on
3894         https://www.w3.org/TR/SVG2/coords.html does not stay fixed"
3895         https://bugs.webkit.org/show_bug.cgi?id=192320
3896         https://trac.webkit.org/changeset/238840
3897
3898 2018-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3899
3900         [SOUP] Move URLSoup back to WebCore after r238771
3901         https://bugs.webkit.org/show_bug.cgi?id=192306
3902
3903         Reviewed by Michael Catanzaro.
3904
3905         Add soupURIToURL() and urlToSoupURI() to replace the URL contructor taking a Soup URI and
3906         URL::createSoupURI(). Fix several build failures that showed up after removing the soup includes from URL
3907         header.
3908
3909         * platform/Cookie.h:
3910         * platform/SharedBuffer.h:
3911         * platform/SourcesSoup.txt:
3912         * platform/network/soup/CookieSoup.cpp:
3913         * platform/network/soup/GUniquePtrSoup.h: Renamed from Source/WTF/wtf/glib/GUniquePtrSoup.h.
3914         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3915         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
3916         (WebCore::NetworkStorageSession::deleteCookie const):
3917         (WebCore::NetworkStorageSession::getCookies):
3918         (WebCore::NetworkStorageSession::getRawCookies const):
3919         (WebCore::cookiesForSession):
3920         * platform/network/soup/ResourceErrorSoup.cpp:
3921         (WebCore::failingURI):
3922         * platform/network/soup/ResourceHandleSoup.cpp:
3923         * platform/network/soup/ResourceRequest.h:
3924         (WebCore::ResourceRequest::ResourceRequest):
3925         * platform/network/soup/ResourceRequestSoup.cpp:
3926         (WebCore::ResourceRequest::updateSoupMessageMembers const):
3927         (WebCore::ResourceRequest::updateFromSoupMessage):
3928         (WebCore::ResourceRequest::createSoupURI const):
3929         * platform/network/soup/ResourceResponseSoup.cpp:
3930         (WebCore::ResourceResponse::updateFromSoupMessage):
3931         * platform/network/soup/SocketStreamHandleImpl.h:
3932         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
3933         (WebCore::SocketStreamHandleImpl::create):
3934         * platform/network/soup/SoupNetworkSession.cpp:
3935         * platform/network/soup/URLSoup.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp.
3936         (WebCore::soupURIToURL):
3937         (WebCore::urlToSoupURI):
3938         * platform/network/soup/URLSoup.h: Renamed from Source/WTF/wtf/glib/URLSoup.cpp.
3939
3940 2018-12-04  Devin Rousso  <drousso@apple.com>
3941
3942         Web Inspector: Audit: tests should support async operations
3943         https://bugs.webkit.org/show_bug.cgi?id=192171
3944         <rdar://problem/46423562>
3945
3946         Reviewed by Joseph Pecoraro.
3947
3948         * page/Settings.yaml:
3949         * dom/ScriptExecutionContext.cpp:
3950         (ScriptExecutionContext::reportUnhandledPromiseRejection):
3951         Add setting for muting the "Unhandled Promise Rejection" console message.
3952
3953 2018-12-03  Tim Horton  <timothy_horton@apple.com>
3954
3955         Fix the build
3956
3957         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3958         Unified sources, of course.
3959
3960 2018-12-03  Youenn Fablet  <youenn@apple.com>
3961
3962         A sender created through addTransceiver and populated using addTrack should have its source set
3963         https://bugs.webkit.org/show_bug.cgi?id=192136
3964
3965         Reviewed by Eric Carlson.
3966
3967         In case libwebrtc backend is already created, we need to make sure to
3968         set the track source to the libwebrtc sender backend that is actually
3969         tied to the sender.
3970
3971         Covered by updated test.
3972
3973         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3974         (WebCore::LibWebRTCPeerConnectionBackend::removeTrack):