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