00426f2f6312d36acf2b67ec8cbd0340ffafa6a0
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-12-20  Jer Noble  <jer.noble@apple.com>
2
3         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
4         https://bugs.webkit.org/show_bug.cgi?id=192941
5         <rdar://problem/46874096>
6
7         Reviewed by Brent Fulgham.
8
9         Don't delete the locked lock before unlocking the lock. 
10
11         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
12         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
13
14 2018-12-20  Keith Rollin  <krollin@apple.com>
15
16         Improve release-level page-load logging
17         https://bugs.webkit.org/show_bug.cgi?id=192872
18         <rdar://problem/46850309>
19
20         Reviewed by Chris Dumez.
21
22         There are a number of reported bugs that are difficult or impossible
23         to track down with our current level of logging. Additionally, some
24         software groups lower in the page-loading stack have requested logging
25         sufficient for tracking a user-visible error message down to the
26         requested resource that caused the message. Add more-comprehensive
27         logging to address these issues/requests.
28
29         No new tests -- no changed functionality.
30
31         * loader/DocumentLoader.cpp:
32         (WebCore::DocumentLoader::setMainDocumentError):
33         (WebCore::DocumentLoader::mainReceivedError):
34         (WebCore::DocumentLoader::stopLoading):
35         (WebCore::DocumentLoader::notifyFinished):
36         (WebCore::DocumentLoader::willSendRequest):
37         (WebCore::DocumentLoader::continueAfterContentPolicy):
38         (WebCore::DocumentLoader::startLoadingMainResource):
39         (WebCore::DocumentLoader::loadMainResource):
40         (WebCore::DocumentLoader::cancelMainResourceLoad):
41         * loader/FrameLoader.cpp:
42         (WebCore::FrameLoader::urlSelected):
43         (WebCore::FrameLoader::loadURLIntoChildFrame):
44         (WebCore::FrameLoader::loadArchive):
45         (WebCore::FrameLoader::loadInSameDocument):
46         (WebCore::FrameLoader::loadFrameRequest):
47         (WebCore::FrameLoader::loadURL):
48         (WebCore::FrameLoader::load):
49         (WebCore::FrameLoader::loadWithNavigationAction):
50         (WebCore::FrameLoader::loadWithDocumentLoader):
51         (WebCore::FrameLoader::reloadWithOverrideEncoding):
52         (WebCore::FrameLoader::reload):
53         (WebCore::FrameLoader::setState):
54         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
55         (WebCore::FrameLoader::loadPostRequest):
56         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
57         (WebCore::FrameLoader::loadDifferentDocumentItem):
58         * loader/ProgressTracker.cpp:
59         (WebCore::ProgressItem::ProgressItem):
60         (WebCore::ProgressTracker::reset):
61         (WebCore::ProgressTracker::progressStarted):
62         (WebCore::ProgressTracker::progressCompleted):
63         (WebCore::ProgressTracker::finalProgressComplete):
64         (WebCore::ProgressTracker::incrementProgress):
65         (WebCore::ProgressTracker::completeProgress):
66         (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
67         * loader/ProgressTracker.h:
68         * loader/ResourceLoader.cpp:
69         (WebCore::ResourceLoader::loadDataURL):
70         (WebCore::ResourceLoader::willSendRequestInternal):
71         (WebCore::ResourceLoader::didFinishLoading):
72         (WebCore::ResourceLoader::didFail):
73         (WebCore::ResourceLoader::willSendRequestAsync):
74         (WebCore::ResourceLoader::wasBlocked):
75         (WebCore::ResourceLoader::cannotShowURL):
76         * loader/SubresourceLoader.cpp:
77         (WebCore::SubresourceLoader::willSendRequestInternal):
78         (WebCore::=):
79         (WebCore::SubresourceLoader::didReceiveResponse):
80         (WebCore::SubresourceLoader::didFinishLoading):
81         (WebCore::SubresourceLoader::didFail):
82         (WebCore::SubresourceLoader::willCancel):
83         * loader/cache/CachedResource.cpp:
84         (WebCore::CachedResource::load):
85
86 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
87
88         Switch tabs before retuning PiP video to inline.
89         https://bugs.webkit.org/show_bug.cgi?id=192767
90         rdar://problem/46006046
91
92         Reviewed by Jer Noble.
93
94         No new tests because this code path only happens with a user action on system UI.
95
96         When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
97
98         * platform/mac/VideoFullscreenInterfaceMac.mm:
99         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
100
101 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
102
103         Unreviewed, fix GTK build after r239410
104
105         It added a new file to the build, breaking the unified sources magic that obscured a bug in
106         URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
107         included via another source file in the unified source bundle.
108
109         * platform/network/soup/URLSoup.h:
110
111 2018-12-19  Chris Dumez  <cdumez@apple.com>
112
113         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
114         https://bugs.webkit.org/show_bug.cgi?id=192728
115         <rdar://problem/46746779>
116
117         Reviewed by Geoff Garen.
118
119         * Modules/*:
120         * animation/*:
121         * bindings/*:
122         * crypto/*:
123         * css/*:
124         * dom/*:
125         * editing/*:
126         * fileapi/*:
127         * html/*:
128         * inspector/*:
129         * layout/*:
130         * loader/*:
131         * mathml/*:
132         * page/*:
133         * platform/*:
134         * plugins/*:
135         * rendering/*:
136         * testing/*:
137         * workers/*:
138         * xml/*:
139
140 2018-12-19  Jer Noble  <jer.noble@apple.com>
141
142         Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
143         https://bugs.webkit.org/show_bug.cgi?id=192896
144         <rdar://46732186>
145
146         Reviewed by Eric Carlson.
147
148         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
149         (WebCore::AudioSourceProviderAVFObjC::initCallback):
150
151 2018-12-19  Timothy Hatcher  <timothy@apple.com>
152
153         REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
154         https://bugs.webkit.org/show_bug.cgi?id=188891
155         rdar://problem/42344352
156
157         Reviewed by Simon Fraser.
158
159         * rendering/RenderLayerCompositor.cpp:
160         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
161         Don't return early when m_layerForOverhangAreas is null to avoid skipping
162         setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
163
164 2018-12-19  Justin Fan  <justin_fan@apple.com>
165
166         [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
167         https://bugs.webkit.org/show_bug.cgi?id=192843
168         <rdar://problem/46820395>
169
170         Reviewed by Myles Maxfield.
171
172         Test: webgpu/pipeline-layouts.html
173
174         Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
175         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
176         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
177         * Modules/webgpu/WebGPUBindGroupLayout.h:
178         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
179         * Modules/webgpu/WebGPUDevice.cpp:
180         (WebCore::WebGPUDevice::createPipelineLayout const): Added.
181         * Modules/webgpu/WebGPUDevice.h:
182         * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
183         * Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
184         (WebCore::WebGPUPipelineLayout::create):
185         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
186         * Modules/webgpu/WebGPUPipelineLayout.h: Added.
187         * Modules/webgpu/WebGPUPipelineLayout.idl: Added.
188         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
189         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
190         * platform/graphics/gpu/GPUDevice.cpp:
191         (WebCore::GPUDevice::createPipelineLayout const): Added.
192         * platform/graphics/gpu/GPUDevice.h:
193         * platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
194         (WebCore::GPUPipelineLayout::create):
195         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
196         * platform/graphics/gpu/GPUPipelineLayout.h: Added.
197         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
198
199         Add files and symbols to project:
200         * CMakeLists.txt:
201         * DerivedSources.make:
202         * Sources.txt:
203         * WebCore.xcodeproj/project.pbxproj:
204         * bindings/js/WebCoreBuiltinNames.h:
205
206         Add missing include:
207         * Modules/webgpu/WebGPUQueue.h:
208
209 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
210
211         SVGUseElement::findTarget should return nullptr when there is a cycle
212         https://bugs.webkit.org/show_bug.cgi?id=192840
213
214         Reviewed by Tim Horton.
215
216         r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
217         Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
218         the SVG use element itself had a corresponding element.
219
220         No new tests since there should be no behavioral change.
221
222         * svg/SVGUseElement.cpp:
223         (WebCore::SVGUseElement::updateShadowTree):
224         (WebCore::SVGUseElement::findTarget const):
225
226 2018-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
227
228         [WHLSL] Add a handwritten lexer
229         https://bugs.webkit.org/show_bug.cgi?id=192294
230
231         Reviewed by Jon Lee.
232
233         This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
234         implementation matches the lexing rules in the spec (specifically, the rules that start
235         with an uppercase letter). The spec is at
236         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
237
238         This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
239
240         No new tests because the lexer isn't hooked up yet; there are tests in the parser,
241         once that gets committed.
242
243         * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
244         (WebCore::WHLSL::Lexer::Token::typeName):
245         (WebCore::WHLSL::Lexer::recognizeKeyword):
246         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
247         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
248         (WebCore::WHLSL::isWhitespace):
249         (WebCore::WHLSL::isNewline):
250         (WebCore::WHLSL::Lexer::skipWhitespace):
251         (WebCore::WHLSL::Lexer::skipLineComment):
252         (WebCore::WHLSL::Lexer::skipLongComment):
253         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
254         (WebCore::WHLSL::Lexer::decimalIntLiteral const):
255         (WebCore::WHLSL::Lexer::decimalUintLiteral const):
256         (WebCore::WHLSL::isHexadecimalCharacter):
257         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
258         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
259         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
260         (WebCore::WHLSL::Lexer::intLiteral const):
261         (WebCore::WHLSL::Lexer::uintLiteral const):
262         (WebCore::WHLSL::Lexer::digit const):
263         (WebCore::WHLSL::Lexer::digitStar const):
264         (WebCore::WHLSL::Lexer::character const):
265         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
266         (WebCore::WHLSL::Lexer::coreFloatLiteral const):
267         (WebCore::WHLSL::Lexer::floatLiteral const):
268         (WebCore::WHLSL::Lexer::validIdentifier const):
269         (WebCore::WHLSL::Lexer::identifier const):
270         (WebCore::WHLSL::Lexer::operatorName const):
271         * Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
272         (WebCore::WHLSL::Lexer::Lexer):
273         (WebCore::WHLSL::Lexer::consumeToken):
274         (WebCore::WHLSL::Lexer::unconsumeToken):
275         (WebCore::WHLSL::Lexer::state const):
276         (WebCore::WHLSL::Lexer::setState):
277         (WebCore::WHLSL::Lexer::isFullyConsumed const):
278         (WebCore::WHLSL::Lexer::errorString):
279         (WebCore::WHLSL::Lexer::string const):
280         (WebCore::WHLSL::Lexer::anyCharacter const):
281         * Sources.txt:
282         * WebCore.xcodeproj/project.pbxproj:
283
284 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
285
286         Web Inspector: Timelines: correctly label Intersection Observer callbacks
287         https://bugs.webkit.org/show_bug.cgi?id=192669
288         <rdar://problem/46702490>
289
290         Reviewed by Joseph Pecoraro.
291
292         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
293         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
294         that they get correctly labeled in the Inspector timeline.
295
296         * dom/MutationObserver.cpp:
297         (WebCore::MutationObserver::deliver):
298         * en.lproj/Localizable.strings:
299         * inspector/InspectorInstrumentation.cpp:
300         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
301         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
302         * inspector/InspectorInstrumentation.h:
303         (WebCore::InspectorInstrumentation::willFireObserverCallback):
304         (WebCore::InspectorInstrumentation::didFireObserverCallback):
305         * inspector/TimelineRecordFactory.cpp:
306         (WebCore::TimelineRecordFactory::createObserverCallbackData):
307         * inspector/TimelineRecordFactory.h:
308         * inspector/agents/InspectorTimelineAgent.cpp:
309         (WebCore::InspectorTimelineAgent::willFireObserverCallback):
310         (WebCore::InspectorTimelineAgent::didFireObserverCallback):
311         (WebCore::toProtocol):
312         * inspector/agents/InspectorTimelineAgent.h:
313         * page/IntersectionObserver.cpp:
314         (WebCore::IntersectionObserver::notify):
315         * page/PerformanceObserver.cpp:
316         (WebCore::PerformanceObserver::deliver):
317
318 2018-12-19  Claudio Saavedra  <csaavedra@igalia.com>
319
320         ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
321         https://bugs.webkit.org/show_bug.cgi?id=192854
322
323         Reviewed by Alex Christensen.
324
325         * contentextensions/DFANode.h: Define CharRange's chars as signed
326
327 2018-12-19  Youenn Fablet  <youenn@apple.com>
328
329         Remove RTCRtpTransceiver.setDirection
330         https://bugs.webkit.org/show_bug.cgi?id=192869
331
332         Reviewed by Alex Christensen.
333
334         Covered by rebased test.
335
336         * Modules/mediastream/RTCRtpTransceiver.idl:
337
338 2018-12-19  Jer Noble  <jer.noble@apple.com>
339
340         Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
341         https://bugs.webkit.org/show_bug.cgi?id=192856
342         <rdar://problem/46843245>
343
344         Reviewed by Alex Christensen.
345
346         Some decoders exposed through VideoToolbox will decode asynchronously even when 
347         kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
348
349         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
350         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
351
352 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
353
354         Allow clients to set the navigator platform
355         https://bugs.webkit.org/show_bug.cgi?id=192735
356
357         Reviewed by Tim Horton.
358
359         Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
360
361         Lots of piping to allow the setting of a custom navigator platform.
362
363         * loader/DocumentLoader.h:
364         (WebCore::DocumentLoader::setCustomNavigatorPlatform):
365         (WebCore::DocumentLoader::customNavigatorPlatform const):
366         * loader/FrameLoader.cpp:
367         (WebCore::FrameLoader::navigatorPlatform const):
368         * loader/FrameLoader.h:
369         * page/Navigator.cpp:
370         (WebCore::Navigator::platform const):
371         * page/Navigator.h:
372         * page/NavigatorBase.cpp:
373         (WebCore::NavigatorBase::platform const):
374         (WebCore::NavigatorBase::platform): Deleted.
375         * page/NavigatorBase.h:
376
377 2018-12-19  Ryan Haddad  <ryanhaddad@apple.com>
378
379         Unreviewed, rolling out r239347.
380
381         Caused the leaks bot to hit an exception and the new test
382         crashes on certain configurations.
383
384         Reverted changeset:
385
386         "Synchronous media query evaluation could destroy current
387         Frame/FrameView."
388         https://bugs.webkit.org/show_bug.cgi?id=192781
389         https://trac.webkit.org/changeset/239347
390
391 2018-12-19  Truitt Savell  <tsavell@apple.com>
392
393         Unreviewed, rolling out r239358.
394
395         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
396         crash on Debug bots
397
398         Reverted changeset:
399
400         "Clean up IndexedDB files between tests"
401         https://bugs.webkit.org/show_bug.cgi?id=192796
402         https://trac.webkit.org/changeset/239358
403
404 2018-12-19  Don Olmstead  <don.olmstead@sony.com>
405
406         Sync some include directories in WebCore
407         https://bugs.webkit.org/show_bug.cgi?id=192819
408
409         Reviewed by Michael Catanzaro.
410
411         Added missing include directories around features that have only been enabled on
412         Apple ports. Removes obsolete directories from list and moves harfbuzz directories
413         into the freetype cmake file.
414
415         * CMakeLists.txt:
416         * platform/FreeType.cmake:
417
418 2018-12-19  Alicia Boya García  <aboya@igalia.com>
419
420         [MSE] Remove unused method: stopAskingForMoreSamples()
421         https://bugs.webkit.org/show_bug.cgi?id=192754
422
423         Reviewed by Xabier Rodriguez-Calvar.
424
425         The stopAskingForMoreSamples() method from SourceBufferPrivate is not
426         being used by anyone. SourceBuffer is not calling it and no
427         SourceBufferPrivate is implementing it. Let's remove that noise.
428
429         * platform/graphics/SourceBufferPrivate.h:
430         (WebCore::SourceBufferPrivate::setActive):
431         (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
432         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
433         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
434         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
435
436 2018-12-19  Alicia Boya García  <aboya@igalia.com>
437
438         [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
439         https://bugs.webkit.org/show_bug.cgi?id=192827
440
441         Reviewed by Xabier Rodriguez-Calvar.
442
443         This patch makes two dead code removal changes in
444         SourceBufferPrivateClient:
445
446         First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
447         virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
448         is only inherited by SourceBuffer, it makes no sense to have default
449         implementations there (they will never be used), moreso it being a
450         client interface.
451
452         Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
453         to had an empty implementation, which SourceBuffer did not overwrite,
454         therefore making any calls to it useless.
455
456         All calls to sourceBufferPrivateSeekToTime() have been removed:
457
458         SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
459         itself, used to call this method. This patch deletes it completely.
460
461         MockSourceBufferPrivate::seekToTime(), which only called this empty
462         method, has also been removed along with its only usage in
463         MockMediaSourcePrivate::seekToTime().
464
465         * platform/graphics/SourceBufferPrivateClient.h:
466         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
467         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
468         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
469         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
470         (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
471         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
472         (WebCore::MockMediaSourcePrivate::seekToTime):
473         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
474         (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
475         * platform/mock/mediasource/MockSourceBufferPrivate.h:
476
477 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
478
479         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
480         https://bugs.webkit.org/show_bug.cgi?id=192815
481
482         Reviewed by Jer Noble.
483
484         https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
485         says that distinctiveIdentifier and persistentState default to
486         optional. Our implementation does not define a default leaving it
487         to the first option of the enum, which currently is Required.
488
489         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
490
491 2018-12-19  Rob Buis  <rbuis@igalia.com>
492
493         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
494         https://bugs.webkit.org/show_bug.cgi?id=192288
495
496         Reviewed by Frédéric Wang.
497
498         Prefer return value to out parameter for parseAccessControlAllowList.
499
500         * loader/CrossOriginPreflightResultCache.cpp:
501         (WebCore::CrossOriginPreflightResultCacheItem::parse):
502         * platform/network/HTTPParsers.h:
503         (WebCore::parseAccessControlAllowList):
504         * platform/network/ResourceResponseBase.cpp:
505         (WebCore::ResourceResponseBase::filter):
506         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
507
508 2018-12-18  Zan Dobersek  <zdobersek@igalia.com>
509
510         REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
511         https://bugs.webkit.org/show_bug.cgi?id=192230
512
513         Reviewed by Carlos Garcia Campos.
514
515         Single tile can after r235165 be assigned multiple content updates
516         without a commit occurring between each update, whereas before these
517         commits were done for each update.
518
519         To avoid repeating updates for a single tile purging information about
520         the previous update, these updates are now accumulated inside a Vector
521         and then iterated over during the commit phase.
522
523         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
524         (WebCore::CoordinatedBackingStoreTile::addUpdate):
525         (WebCore::CoordinatedBackingStoreTile::swapBuffers):
526         (WebCore::CoordinatedBackingStore::updateTile):
527         (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
528         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
529         (WebCore::CoordinatedBackingStoreTile::scale const):
530
531 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
532
533         [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
534         https://bugs.webkit.org/show_bug.cgi?id=192842
535         <rdar://problem/46823586>
536
537         Reviewed by Tim Horton.
538
539         Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
540         registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
541         inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
542         this is internally tracked in <rdar://problem/46830277>.
543
544         * platform/ios/PlatformPasteboardIOS.mm:
545         (WebCore::PlatformPasteboard::write):
546
547 2018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
548
549         Unreviewed, add a missing UNUSED_PARAM()
550
551         * Modules/mediarecorder/MediaRecorder.cpp:
552         (WebCore::MediaRecorder::getPrivateImpl):
553
554 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
555
556         Update CSS Properties and Values API to use new cycle fallback behaviour
557         https://bugs.webkit.org/show_bug.cgi?id=192800
558
559         Reviewed by Antti Koivisto.
560
561         Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
562         wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. 
563
564         * css/CSSCustomPropertyValue.h:
565         * css/CSSVariableReferenceValue.cpp:
566         (WebCore::resolveVariableReference):
567         * css/DOMCSSRegisterCustomProperty.cpp:
568         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
569         * css/StyleResolver.cpp:
570         (WebCore::StyleResolver::applyCascadedCustomProperty):
571         * css/parser/CSSPropertyParser.cpp:
572         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
573
574 2018-12-18  Daniel Bates  <dabates@apple.com>
575
576         Wrong value for key property in keydown and keyup events generated holding Control key
577         https://bugs.webkit.org/show_bug.cgi?id=192788
578         <rdar://problem/46795214>
579
580         Reviewed by Wenson Hsieh.
581
582         Similar to what we do on Mac, compute the DOM key property from the characters ignoring
583         modifier keys input string when the Control key is held down.
584
585         * platform/ios/PlatformEventFactoryIOS.mm:
586         (WebCore::keyForKeyEvent):
587         * platform/mac/PlatformEventFactoryMac.mm:
588         (WebCore::keyForKeyEvent):
589
590 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
591
592         Clean up IndexedDB files between tests
593         https://bugs.webkit.org/show_bug.cgi?id=192796
594
595         Reviewed by Geoffrey Garen.
596
597         We should clean up the IndexedDB files between tests to make sure each test is independent of others.
598
599         This patch also fixes some issues in IDB.
600
601         Covered by existing tests.
602
603         * Modules/indexeddb/server/IDBServer.cpp:
604         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
605         We should shut down all open databases instead of databases from open database connections before deleting 
606         files, because database starts accessing files before connection to database is established.
607
608         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
609         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
610         We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase 
611         and UniqueIDBDatabase can be destructed after shutdown.
612
613         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
614         didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be 
615         invoked during the hard close.
616
617         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
618         Tasks like didOpenBackingStore could be posted from database thread to main thread after 
619         immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any 
620         database operation. 
621
622         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
623         performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access 
624         m_backingStore when m_backingStore may already be deleted. 
625
626         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
627         immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. 
628         m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in 
629         transactionCompleted, so they do not need to be cleared here.
630
631 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
632
633         Thick overlines and line-throughs grow in the wrong direction
634         https://bugs.webkit.org/show_bug.cgi?id=192264
635
636         Reviewed by Dean Jackson.
637
638         Overlines should grow upward, and line-throughs should stay centered.
639
640         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
641
642         * rendering/TextDecorationPainter.cpp:
643         (WebCore::TextDecorationPainter::paintTextDecoration):
644         * style/InlineTextBoxStyle.cpp:
645         (WebCore::visualOverflowForDecorations):
646
647 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
648
649         Some iOS app crash in FrameLoader::checkCompleted
650         https://bugs.webkit.org/show_bug.cgi?id=192804
651         <rdar://problem/44240573>
652
653         Reviewed by Tim Horton.
654
655         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
656         is trying to send a delegate message. Disable the release assertion while this is happening
657         so that iOS app would not crash.
658
659         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
660         and this requires a race between the web thread & the main thread.
661
662         * dom/ScriptDisallowedScope.h:
663         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
664         * platform/ios/wak/WebCoreThread.h:
665         * platform/ios/wak/WebCoreThread.mm:
666         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
667         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
668         (SendDelegateMessage):
669
670 2018-12-18  David Kilzer  <ddkilzer@apple.com>
671
672         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
673         <https://webkit.org/b/192814>
674
675         Reviewed by Mark Lam.
676
677         * bindings/js/JSDOMConvertNumbers.h:
678         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
679
680 2018-12-18  Justin Fan  <justin_fan@apple.com>
681
682         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
683         https://bugs.webkit.org/show_bug.cgi?id=192817
684
685         Reviewed by Dean Jackson.
686
687         Update bind-group-layouts to test new functionality.
688
689         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
690         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
691         (WebCore::WebGPUBindGroupLayout::create):
692         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
693         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
694         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
695         * Modules/webgpu/WebGPUDevice.cpp:
696         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
697         * Modules/webgpu/WebGPUDevice.h:
698         * Modules/webgpu/WebGPUDevice.idl:
699         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
700         (WebCore::GPUBindGroupLayout::tryCreate):
701         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
702         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
703         * platform/graphics/gpu/GPUDevice.cpp:
704         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
705         * platform/graphics/gpu/GPUDevice.h:
706
707         Add files and symbols to project:
708         * CMakeLists.txt:
709         * DerivedSources.make:
710         * Sources.txt:
711         * WebCore.xcodeproj/project.pbxproj:
712         * bindings/js/WebCoreBuiltinNames.h:
713
714         Missing includes that were previously provided via UnifiedSources:
715         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
716         * platform/sql/SQLiteFileSystem.h:
717
718 2018-12-18  Youenn Fablet  <youenn@apple.com>
719
720         Make ReadableStreamXX constructs use PrivateIdentifier
721         https://bugs.webkit.org/show_bug.cgi?id=192771
722
723         Reviewed by Chris Dumez.
724
725         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
726         Covered by existing binding tests.
727
728         * Modules/streams/ReadableByteStreamController.idl:
729         * Modules/streams/ReadableStreamBYOBReader.idl:
730         * Modules/streams/ReadableStreamBYOBRequest.idl:
731         * Modules/streams/ReadableStreamDefaultController.idl:
732         * Modules/streams/ReadableStreamDefaultReader.idl:
733         * bindings/scripts/CodeGeneratorJS.pm:
734         (NeedsConstructorProperty):
735         * bindings/scripts/preprocess-idls.pl:
736         (shouldExposeInterface):
737         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
738         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
739         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
740
741 2018-12-18  Zalan Bujtas  <zalan@apple.com>
742
743         Synchronous media query evaluation could destroy current Frame/FrameView.
744         https://bugs.webkit.org/show_bug.cgi?id=192781
745         <rdar://problem/34416793>
746
747         Reviewed by Chris Dumez.
748
749         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
750
751         Test: printing/print-with-media-query-destory.html
752
753         * loader/DocumentLoader.cpp:
754         (WebCore::DocumentLoader::finishedLoading):
755         * page/Frame.cpp:
756         (WebCore::Frame::setPrinting):
757         * page/FrameView.cpp:
758         (WebCore::FrameView::forceLayoutForPagination):
759
760 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
761
762         Web Inspector: m3u8 content not shown, it should be text
763         https://bugs.webkit.org/show_bug.cgi?id=192731
764         <rdar://problem/46747728>
765
766         Reviewed by Devin Rousso.
767
768         * inspector/NetworkResourcesData.cpp:
769         (WebCore::NetworkResourcesData::setResourceContent):
770         Don't clobber data if setting empty content on a resource that has content.
771
772         * inspector/agents/InspectorNetworkAgent.cpp:
773         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
774         Additional non-"text/" mime types that can be treated as text.
775
776         * platform/MIMETypeRegistry.cpp:
777         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
778         * platform/MIMETypeRegistry.h:
779         Detect media playlist mime types that are text (m3u8/m3u).
780
781 2018-12-18  Daniel Bates  <dabates@apple.com>
782
783         Remove <meta http-equiv=set-cookie> support
784         https://bugs.webkit.org/show_bug.cgi?id=185077
785         <rdar://problem/41791397>
786
787         Reviewed by Brent Fulgham.
788
789         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
790         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
791         removed support for this pragma and Firefox has an open bug to remove it.
792
793         * dom/Document.cpp:
794         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
795         was ignored instead of setting the cookie.
796         * html/parser/XSSAuditor.cpp:
797         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
798         as dangerous and erase attribute http-equiv when we find it because we no longer honor
799         this pragma.
800
801 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
802
803         CSS Typed OM should expose attributeStyleMap
804         https://bugs.webkit.org/show_bug.cgi?id=192671
805
806         Reviewed by Ryosuke Niwa.
807
808         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
809         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
810
811         Test: css-typedom/attributeStyleMap.html
812
813         * CMakeLists.txt:
814         * DerivedSources.make:
815         * Sources.txt:
816         * WebCore.xcodeproj/project.pbxproj:
817         * bindings/js/WebCoreBuiltinNames.h:
818         * css/ElementCSSInlineStyle.idl:
819         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
820         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
821         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
822         (WebCore::StylePropertyMapReadOnly::reifyValue):
823         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
824         * css/typedom/StylePropertyMapReadOnly.h:
825         (WebCore::StylePropertyMapReadOnly::create): Deleted.
826         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
827         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
828         * css/typedom/StylePropertyMapReadOnly.idl:
829         * css/typedom/TypedOMCSSImageValue.h:
830         * dom/Element.cpp:
831         (WebCore::Element::attributeStyleMap):
832         (WebCore::Element::setAttributeStyleMap):
833         * dom/Element.h:
834         * dom/ElementRareData.cpp:
835         * dom/ElementRareData.h:
836         (WebCore::ElementRareData::attributeStyleMap):
837         (WebCore::ElementRareData::setAttributeStyleMap):
838         * dom/StyledElement.cpp:
839         (WebCore::StyledElement::ensureAttributeStyleMap):
840         * dom/StyledElement.h:
841         * html/canvas/CanvasRenderingContext2DBase.cpp:
842         (WebCore::size):
843         (WebCore::CanvasRenderingContext2DBase::drawImage):
844         * platform/graphics/CustomPaintImage.cpp:
845         (WebCore::extractComputedProperty):
846         (WebCore::CustomPaintImage::doCustomPaint):
847
848 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
849
850         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
851         https://bugs.webkit.org/show_bug.cgi?id=192785
852         <rdar://problem/45321184>
853
854         Reviewed by Tim Horton.
855
856         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
857         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
858         need to know when the user is typing in a text form control, but the page is preventing default text insertion
859         behavior and instead updating values programmatically.
860
861         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
862
863         * html/TextFieldInputType.cpp:
864         (WebCore::TextFieldInputType::setValue):
865
866 2018-12-18  Zalan Bujtas  <zalan@apple.com>
867
868         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
869         https://bugs.webkit.org/show_bug.cgi?id=192801
870
871         Reviewed by Antti Koivisto.
872
873         * layout/blockformatting/BlockFormattingContext.h:
874         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
875         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
876         * layout/blockformatting/BlockMarginCollapse.cpp:
877         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
878
879 2018-12-18  Zalan Bujtas  <zalan@apple.com>
880
881         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
882         https://bugs.webkit.org/show_bug.cgi?id=192799
883
884         Reviewed by Antti Koivisto.
885
886         * layout/blockformatting/BlockFormattingContext.h:
887         * layout/blockformatting/BlockMarginCollapse.cpp:
888         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
889         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
890
891 2018-12-18  Zalan Bujtas  <zalan@apple.com>
892
893         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
894         https://bugs.webkit.org/show_bug.cgi?id=192798
895
896         Reviewed by Antti Koivisto.
897
898         * layout/blockformatting/BlockFormattingContext.h:
899         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
900         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
901         * layout/blockformatting/BlockMarginCollapse.cpp:
902         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
903         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
904         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
905         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
906
907 2018-12-18  Zalan Bujtas  <zalan@apple.com>
908
909         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
910         https://bugs.webkit.org/show_bug.cgi?id=192794
911
912         Reviewed by Antti Koivisto.
913
914         * layout/blockformatting/BlockFormattingContext.h:
915         * layout/blockformatting/BlockMarginCollapse.cpp:
916         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
917         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
918         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
919
920 2018-12-18  Zalan Bujtas  <zalan@apple.com>
921
922         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
923         https://bugs.webkit.org/show_bug.cgi?id=192791
924
925         Reviewed by Antti Koivisto.
926
927         * layout/blockformatting/BlockMarginCollapse.cpp:
928         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
929         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
930
931 2018-12-18  Zalan Bujtas  <zalan@apple.com>
932
933         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
934         https://bugs.webkit.org/show_bug.cgi?id=192787
935
936         Reviewed by Antti Koivisto.
937
938         * layout/blockformatting/BlockFormattingContext.h:
939         * layout/blockformatting/BlockMarginCollapse.cpp:
940         (WebCore::Layout::hasClearance):
941         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
942         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
943         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
944         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
945
946 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
947
948         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
949         https://bugs.webkit.org/show_bug.cgi?id=192752
950
951         Reviewed by Don Olmstead.
952
953         No new tests, no behavior changes.
954
955         * platform/graphics/win/DIBPixelData.cpp:
956         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
957         * platform/graphics/win/FontPlatformDataWin.cpp:
958         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
959         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
960         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
961         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
962         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
963         Reorder the initializer list.
964         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
965         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
966         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
967         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
968         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
969         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
970         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
971         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
972         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
973         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
974         (WebCore::Font::boundsForGDIGlyph const): Ditto.
975         (WebCore::Font::widthForGDIGlyph const): Ditto.
976         * platform/graphics/win/UniscribeController.cpp:
977         (WebCore::UniscribeController::UniscribeController):
978         Reorder the initializer list.
979         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
980         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
981
982 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
983
984         [MediaStream] A stream's first video frame should be rendered
985         https://bugs.webkit.org/show_bug.cgi?id=192629
986         <rdar://problem/46664353>
987
988         Reviewed by Youenn Fablet.
989
990         Test: fast/mediastream/media-stream-renders-first-frame.html
991
992         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
993         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
994         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
995         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
996         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
997         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
998         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
999         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
1000         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
1001         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
1002         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
1003         * platform/mediastream/RealtimeMediaSource.cpp:
1004         (WebCore::RealtimeMediaSource::size const):
1005         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1006         (WebCore::AVVideoCaptureSource::processNewFrame):
1007         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1008         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
1009
1010 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
1011
1012         Bindings generator should support Conditional= along with CachedAttribute
1013         https://bugs.webkit.org/show_bug.cgi?id=192721
1014
1015         Reviewed by Ryosuke Niwa.
1016
1017         Fix a bug where specifying both attributes causes compilation errors because the compile-time
1018         condition is not included in the derived code.
1019
1020         * bindings/scripts/CodeGeneratorJS.pm:
1021         (GenerateImplementation):
1022         * bindings/scripts/test/JS/JSTestObj.cpp:
1023         (WebCore::jsTestObjCachedAttribute3Getter):
1024         (WebCore::jsTestObjCachedAttribute3):
1025         (WebCore::JSTestObj::visitChildren):
1026         * bindings/scripts/test/JS/JSTestObj.h:
1027         * bindings/scripts/test/TestObj.idl:
1028
1029 2018-12-17  David Kilzer  <ddkilzer@apple.com>
1030
1031         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
1032         <https://webkit.org/b/192707>
1033         <rdar://problem/46734926>
1034
1035         Reviewed by Daniel Bates.
1036
1037         * platform/CPUMonitor.cpp:
1038         (WebCore::CPUMonitor::setCPULimit):
1039         * platform/CPUMonitor.h:
1040         (WebCore::CPUMonitor::setCPULimit):
1041         - Change parameter to const reference to fix unnecessary copies.
1042
1043 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
1044
1045         offsetLeft and offsetParent should adjust across shadow boundaries
1046         https://bugs.webkit.org/show_bug.cgi?id=157437
1047         <rdar://problem/26154021>
1048
1049         Reviewed by Simon Fraser.
1050
1051         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
1052         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
1053         and https://github.com/w3c/webcomponents/issues/763
1054
1055         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
1056         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
1057         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
1058
1059         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
1060         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
1061         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
1062
1063         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
1064         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
1065         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
1066
1067         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
1068
1069         * dom/Element.cpp:
1070         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
1071         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
1072         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
1073         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
1074         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
1075         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
1076         until it finds the first offset parent which is a shadow-including ancestor.
1077         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
1078         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
1079         functions meant to be used for bindings code.
1080         * dom/Element.h:
1081         * html/HTMLElement.idl:
1082
1083 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
1084
1085         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
1086         https://bugs.webkit.org/show_bug.cgi?id=192780
1087         rdar://problem/43394387
1088
1089         Reviewed by Tim Horton.
1090         
1091         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
1092         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
1093         
1094         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
1095         and consult it when making decisions that affect layer backing store format.
1096
1097         Tested by new results for existing tests.
1098
1099         * platform/graphics/FontCascade.cpp:
1100         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
1101         * platform/graphics/FontCascade.h:
1102         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1103         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
1104         it once.
1105         * rendering/RenderLayerBacking.cpp:
1106         (WebCore::RenderLayerBacking::updateAfterDescendants):
1107         * testing/Internals.cpp:
1108         (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
1109
1110 2018-12-17  Daniel Bates  <dabates@apple.com>
1111
1112         Make DocumentMarker::allMarkers() constexpr
1113         https://bugs.webkit.org/show_bug.cgi?id=192634
1114
1115         Reviewed by Simon Fraser.
1116
1117         The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
1118         it constexpr to do just that.
1119
1120         * dom/DocumentMarker.h:
1121         (WebCore::DocumentMarker::allMarkers):
1122
1123 2018-12-17  Justin Fan  <justin_fan@apple.com>
1124
1125         [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
1126         https://bugs.webkit.org/show_bug.cgi?id=192726
1127
1128         Reviewed by Myles C. Maxfield.
1129
1130         Test: webgpu/bind-group-layouts.html
1131         Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
1132         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
1133         * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
1134         * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
1135         * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
1136         * Modules/webgpu/WebGPUShaderStageBit.h: Added.
1137         * Modules/webgpu/WebGPUShaderStageBit.idl: Added.
1138         * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
1139         * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
1140
1141         Add the new symbols and files to the project:
1142         * CMakeLists.txt:
1143         * DerivedSources.make:
1144         * Sources.txt:
1145         * WebCore.xcodeproj/project.pbxproj:
1146         * bindings/js/WebCoreBuiltinNames.h:
1147
1148         Small FIXME update for later:
1149         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1150         (WebCore::GPURenderPassEncoder::setVertexBuffers):
1151
1152 2018-12-17  Zalan Bujtas  <zalan@apple.com>
1153
1154         Unreviewed build fix.
1155
1156         * page/ios/FrameIOS.mm:
1157         (WebCore::Frame::interpretationsForCurrentRoot const):
1158
1159 2018-12-17  Zalan Bujtas  <zalan@apple.com>
1160
1161         Reproducible ASSERTion failure when toggling layer borders with find-in-page up
1162         https://bugs.webkit.org/show_bug.cgi?id=192762
1163         <rdar://problem/46676873>
1164
1165         Reviewed by Simon Fraser.
1166
1167         DocumentMarkerController::markersFor() should take a reference instead of a Node*.
1168
1169         Test: editing/document-marker-null-check.html
1170
1171         * dom/DocumentMarkerController.cpp:
1172         (DocumentMarkerController::hasMarkers):
1173         * dom/DocumentMarkerController.h:
1174         * editing/AlternativeTextController.cpp:
1175         (WebCore::AlternativeTextController::respondToChangedSelection):
1176         * editing/Editor.cpp:
1177         (WebCore::Editor::selectionStartHasMarkerFor const):
1178         * rendering/InlineTextBox.cpp:
1179         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
1180         * rendering/RenderReplaced.cpp:
1181         (WebCore::RenderReplaced::paint):
1182         * rendering/RenderText.cpp:
1183         (WebCore::RenderText::draggedContentRangesBetweenOffsets const):
1184         * rendering/SimpleLineLayout.cpp:
1185         (WebCore::SimpleLineLayout::canUseForWithReason):
1186         * testing/Internals.cpp:
1187         (WebCore::Internals::markerCountForNode):
1188
1189 2018-12-17  Commit Queue  <commit-queue@webkit.org>
1190
1191         Unreviewed, rolling out r239265 and r239274.
1192         https://bugs.webkit.org/show_bug.cgi?id=192765
1193
1194         unorm_normalize is deprecated, and broke an internal build
1195         (Requested by Truitt on #webkit).
1196
1197         Reverted changesets:
1198
1199         "[GTK][WPE] Need a function to convert internal URI to display
1200         ("pretty") URI"
1201         https://bugs.webkit.org/show_bug.cgi?id=174816
1202         https://trac.webkit.org/changeset/239265
1203
1204         "Fix the Apple Internal Mac build with a newer SDK"
1205         https://trac.webkit.org/changeset/239274
1206
1207 2018-12-17  Daniel Bates  <dabates@apple.com>
1208
1209         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
1210         https://bugs.webkit.org/show_bug.cgi?id=192633
1211
1212         Reviewed by Wenson Hsieh.
1213
1214         UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
1215         input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
1216         for binary compatibility.
1217
1218         * platform/ios/WebEvent.h:
1219         * platform/ios/WebEvent.mm:
1220         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
1221
1222 2018-12-17  Matt Lewis  <jlewis3@apple.com>
1223
1224         Unreviewed, rolling out r239254.
1225
1226         This broke the Windows 10 Debug build
1227
1228         Reverted changeset:
1229
1230         "Replace many uses of String::format with more type-safe
1231         alternatives"
1232         https://bugs.webkit.org/show_bug.cgi?id=192742
1233         https://trac.webkit.org/changeset/239254
1234
1235 2018-12-17  Antoine Quint  <graouts@apple.com>
1236
1237         [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
1238         https://bugs.webkit.org/show_bug.cgi?id=192758
1239
1240         Reviewed by Dean Jackson.
1241
1242         We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
1243         gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
1244         less bookkeeping to perform.
1245
1246         No new test since there is no user-observable change.
1247
1248         * animation/WebAnimation.cpp:
1249         (WebCore::WebAnimation::updateFinishedState):
1250         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
1251         (WebCore::WebAnimation::performMicrotask): Deleted.
1252         * animation/WebAnimation.h:
1253
1254 2018-12-17  Antoine Quint  <graouts@apple.com>
1255
1256         [Web Animations] Ensure we don't update an animation's finished state twice when updating animations
1257         https://bugs.webkit.org/show_bug.cgi?id=192757
1258
1259         Reviewed by Dean Jackson.
1260
1261         When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
1262         twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
1263         whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
1264         next call to resolve(), unless any of the timing properties have changed in the meantime.
1265
1266         No new test since there is no user-observable change.
1267
1268         * animation/WebAnimation.cpp:
1269         (WebCore::WebAnimation::timingDidChange):
1270         (WebCore::WebAnimation::tick):
1271         (WebCore::WebAnimation::resolve):
1272         * animation/WebAnimation.h:
1273
1274 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
1275
1276         REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
1277         https://bugs.webkit.org/show_bug.cgi?id=192725
1278         rdar://problem/46011418
1279
1280         Reviewed by Antoine Quint.
1281
1282         There were two problems with backing store attachment and animation.
1283         
1284         First, animations are an input into the "backing store attached" logic, so when they change
1285         we should set the CoverageRectChanged bit on GraphicsLayerCA.
1286         
1287         Secondly, when an ancestor has unknown animation extent, all its descendants need to
1288         get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
1289         the current layer has no animation extent.
1290
1291         Tests: compositing/backing/animate-into-view-with-descendant.html
1292                compositing/backing/animate-into-view.html
1293
1294         * platform/graphics/ca/GraphicsLayerCA.cpp:
1295         (WebCore::GraphicsLayerCA::addAnimation):
1296         (WebCore::GraphicsLayerCA::removeAnimation):
1297         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1298
1299 2018-12-17  Zalan Bujtas  <zalan@apple.com>
1300
1301         [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
1302         https://bugs.webkit.org/show_bug.cgi?id=192747
1303
1304         Reviewed by Antti Koivisto.
1305
1306         Rename some margin collapse getters.
1307
1308         * layout/blockformatting/BlockFormattingContext.h:
1309         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1310         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1311         * layout/blockformatting/BlockMarginCollapse.cpp:
1312         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
1313         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
1314         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
1315         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
1316         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
1317         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
1318         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
1319         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
1320         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
1321         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
1322         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
1323         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
1324         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
1325         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
1326         (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
1327         (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
1328         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
1329         (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
1330         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
1331         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
1332
1333 2018-12-17  David Kilzer  <ddkilzer@apple.com>
1334
1335         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
1336         <https://webkit.org/b/192751>
1337         <rdar://problem/46771623>
1338
1339         Reviewed by Daniel Bates.
1340
1341         Change loop variables to const references to avoid unnecessary
1342         copies.
1343
1344         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1345         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1346         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1347         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
1348         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1349         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
1350         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1351         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
1352         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1353         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
1354         (WebCore::IDBDatabaseInfo::loggingString const):
1355         * Modules/mediasource/SourceBuffer.cpp:
1356         (WebCore::removeSamplesFromTrackBuffer):
1357         * accessibility/AccessibilityRenderObject.cpp:
1358         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
1359         * accessibility/AccessibilityTableRow.cpp:
1360         (WebCore::AccessibilityTableRow::headerObject):
1361         * animation/KeyframeEffect.cpp:
1362         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
1363         * crypto/keys/CryptoKeyRSA.cpp:
1364         (WebCore::CryptoKeyRSA::importJwk):
1365         (WebCore::CryptoKeyRSA::exportJwk const):
1366         * css/CSSComputedStyleDeclaration.cpp:
1367         (WebCore::OrderedNamedLinesCollector::appendLines const):
1368         * dom/DataTransfer.cpp:
1369         (WebCore::readURLsFromPasteboardAsString):
1370         * dom/TreeScope.cpp:
1371         (WebCore::TreeScope::elementsFromPoint):
1372         * html/track/WebVTTParser.cpp:
1373         (WebCore::WebVTTParser::checkAndStoreRegion):
1374         * inspector/agents/InspectorTimelineAgent.cpp:
1375         (WebCore::InspectorTimelineAgent::setInstruments):
1376         * page/Page.cpp:
1377         (WebCore::Page::updateIntersectionObservations):
1378         * page/TextIndicator.cpp:
1379         (WebCore::estimatedBackgroundColorForRange):
1380         * page/animation/KeyframeAnimation.cpp:
1381         (WebCore::KeyframeAnimation::computeLayoutDependency):
1382         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1383         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1384         * platform/graphics/ca/GraphicsLayerCA.cpp:
1385         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
1386         (WebCore::GraphicsLayerCA::updateAnimations):
1387         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
1388         * platform/graphics/mac/ImageMac.mm:
1389         (WebCore::BitmapImage::tiffRepresentation):
1390         * rendering/HitTestResult.cpp:
1391         (WebCore::HitTestResult::append):
1392         * testing/Internals.cpp:
1393         (WebCore::Internals::acceleratedAnimationsForElement):
1394
1395 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
1396
1397         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
1398         https://bugs.webkit.org/show_bug.cgi?id=174816
1399
1400         Reviewed by Michael Catanzaro.
1401
1402         Tests: enabled fast/url/user-visible/.
1403
1404         * testing/Internals.cpp:
1405         (WebCore::Internals::userVisibleString): Enable method on all platforms.
1406
1407 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1408
1409         Null pointer dereference in JSC::WriteBarrierBase()
1410         https://bugs.webkit.org/show_bug.cgi?id=191252
1411
1412         Reviewed by Keith Miller.
1413
1414         * bindings/js/JSCustomElementRegistryCustom.cpp:
1415         (WebCore::JSCustomElementRegistry::whenDefined):
1416         * bindings/js/JSDOMPromiseDeferred.cpp:
1417         (WebCore::createDeferredPromise):
1418         * bindings/js/JSDOMPromiseDeferred.h:
1419         (WebCore::DeferredPromise::create):
1420         (WebCore::callPromiseFunction):
1421         * bindings/js/JSDOMWindowBase.cpp:
1422         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
1423         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
1424         * bindings/js/ScriptModuleLoader.cpp:
1425         (WebCore::ScriptModuleLoader::fetch):
1426         (WebCore::rejectPromise):
1427
1428 2018-12-15  Darin Adler  <darin@apple.com>
1429
1430         Use warning-ignoring macros more consistently and simply
1431         https://bugs.webkit.org/show_bug.cgi?id=192743
1432
1433         Reviewed by Mark Lam.
1434
1435         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
1436         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
1437         files like this one with non-clang compilers, and no need to worry about
1438         them when choosing the macro.
1439
1440         * crypto/mac/CryptoKeyRSAMac.cpp:
1441         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
1442
1443         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
1444         the "unknown-pragmas" trick, which the macro should take care of.
1445         * css/makevalues.pl: Ditto.
1446         * platform/ColorData.gperf: Ditto.
1447
1448         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1449         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
1450         (see rationale above for Objective-C++).
1451
1452         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1453         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
1454         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
1455         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1456         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
1457
1458         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
1459         (see rationale above for Objective-C++).
1460
1461         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1462         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
1463         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
1464
1465         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
1466         (see rationale above for Objective-C++).
1467
1468         * platform/network/cocoa/ResourceResponseCocoa.mm:
1469         (WebCore::ResourceResponse::platformCertificateInfo const): Use
1470         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
1471
1472 2018-12-15  Darin Adler  <darin@apple.com>
1473
1474         Replace many uses of String::format with more type-safe alternatives
1475         https://bugs.webkit.org/show_bug.cgi?id=192742
1476
1477         Reviewed by Mark Lam.
1478
1479         A while back, String::format was more efficient than string concatenation,
1480         but that is no longer true, and we should prefer String::number, makeString,
1481         or concatenation with the "+" operator to String::format for new code.
1482
1483         This is not as good for programmers who are fond of printf formatting
1484         style, and in some cases it's a little harder to read the strings
1485         interspersed with variables rather than a format string, but it's better
1486         in a few ways:
1487
1488         - more efficient (I didn't measure the difference, but it's definitely
1489           slower to use String::Format which calls vsnprintf twice than to use
1490           the WTF code)
1491         - works in a type-safe way without a need to use a format specifier such
1492           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
1493           subtle differences between platforms
1494         - allows us to use StringView in some cases to sidestep the need to
1495           allocate temporary WTF::String objects
1496         - does not require converting each WTF::String to a C string, allowing
1497           us to remove many cases of ".utf8().data()" and similar expressions,
1498           eliminating the allocation of temporary WTF::CString objects
1499
1500         This patch covers a batch of easiest-to-convert call sites.
1501         Later patches will allow us to deprecate or remove String::format.
1502
1503         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1504         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
1505         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1506         (WebCore::IDBCursorInfo::loggingString const): Ditto.
1507         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
1508         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
1509         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
1510         (WebCore::IDBGetRecordData::loggingString const): Ditto.
1511         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
1512         (WebCore::IDBIndexInfo::loggingString const): Ditto.
1513         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
1514         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
1515         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
1516         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1517         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
1518         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1519         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
1520         * Modules/webdatabase/Database.cpp:
1521         (WebCore::formatErrorMessage): Ditto.
1522         * Modules/webdatabase/SQLError.h:
1523         (WebCore::SQLError::create): Ditto.
1524
1525         * bindings/scripts/CodeGeneratorJS.pm:
1526         (GenerateImplementation): Use makeString.
1527
1528         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1529         * bindings/scripts/test/JS/JSMapLike.cpp:
1530         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1531         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1532         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1533         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1534         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1535         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1536         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1537         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1538         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1539         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1540         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1541         * bindings/scripts/test/JS/JSTestException.cpp:
1542         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1543         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1544         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1545         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1546         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1547         * bindings/scripts/test/JS/JSTestInterface.cpp:
1548         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1549         * bindings/scripts/test/JS/JSTestIterable.cpp:
1550         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1551         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1552         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1553         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1554         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1555         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1556         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1557         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1558         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1559         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1560         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1561         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1562         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1563         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1564         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1565         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1566         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1567         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1568         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1569         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1570         * bindings/scripts/test/JS/JSTestNode.cpp:
1571         * bindings/scripts/test/JS/JSTestObj.cpp:
1572         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1573         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1574         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1575         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1576         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1577         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1578         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1579         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1580         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1581         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1582         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1583         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1584         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1585         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1586         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1587         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1588         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1589         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1590         Updated expected results.
1591 :
1592         * css/parser/CSSPropertyParserHelpers.cpp:
1593         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
1594         and makeString.
1595
1596         * html/HTMLSelectElement.cpp:
1597         (WebCore::HTMLSelectElement::setLength): Use makeString.
1598         * html/ImageDocument.cpp:
1599         (WebCore::ImageDocument::imageUpdated): Ditto.
1600         * html/parser/XSSAuditor.cpp:
1601         (WebCore::XSSAuditor::init): Ditto.
1602         * inspector/InspectorFrontendClientLocal.cpp:
1603         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
1604         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
1605         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
1606         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
1607         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
1608         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
1609         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
1610         * page/MemoryRelease.cpp:
1611         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
1612
1613         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1614         (WebCore::formatByteNumber): Use String::number.
1615         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
1616
1617         * page/cocoa/ResourceUsageThreadCocoa.mm:
1618         (WebCore::logFootprintComparison): Use makeString.
1619         * platform/animation/TimingFunction.cpp:
1620         (WebCore::TimingFunction::cssText const): Ditto.
1621
1622         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1623         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
1624         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
1625         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
1626
1627         * platform/graphics/ca/GraphicsLayerCA.cpp:
1628         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
1629         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
1630         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
1631         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
1632         * platform/mock/MockRealtimeVideoSource.cpp:
1633         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
1634
1635         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
1636
1637         * platform/network/ParsedContentRange.cpp:
1638         (WebCore::ParsedContentRange::headerValue const): Use makeString.
1639
1640         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
1641         compiler conditionals and reorganized the start/stop of namespaces.
1642         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
1643
1644         * platform/sql/SQLiteDatabase.cpp:
1645         (WebCore::unauthorizedSQLFunction): Use makeString.
1646         * rendering/RenderLayerCompositor.cpp:
1647         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
1648         * workers/service/server/RegistrationDatabase.cpp:
1649         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
1650         (WebCore::RegistrationDatabase::importRecords): Ditto.
1651
1652 2018-12-15  Youenn Fablet  <youenn@apple.com>
1653
1654         Make RTCRtpSender.setParameters to activate specific encodings
1655         https://bugs.webkit.org/show_bug.cgi?id=192732
1656
1657         Reviewed by Eric Carlson.
1658
1659         The conversion between libwebrtc and WebCore is lossy for send parameters.
1660         Libwebrtc checking the differences of values, call to setParameters will often fail.
1661
1662         Given some parameters cannot be exposed, the sender backend keeps the
1663         current set of parameters when gathered and reuses them when parameters are set.
1664
1665         For encodings, we only change activate/maxBitRate/maxFrameRate as
1666         these are the most important parameters to be able to modify.
1667
1668         Covered by added tests in webrtc/video.html.
1669
1670         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1671         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
1672         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
1673         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1674         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1675         (WebCore::fromRTCRtpSendParameters):
1676         (WebCore::fromRTCEncodingParameters): Deleted.
1677         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
1678
1679 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
1680
1681         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
1682         https://bugs.webkit.org/show_bug.cgi?id=192724
1683         <rdar://problem/46745911>
1684
1685         Reviewed by Devin Rousso.
1686
1687         iOS never installs the InspectorOverlay page as a page overlay.
1688         It also uses its own node highlighting painting. Avoid any work
1689         and resources associated with the overlay page for iOS.
1690
1691         * inspector/InspectorOverlay.cpp:
1692         (WebCore::InspectorOverlay::paint):
1693         (WebCore::InspectorOverlay::update):
1694         (WebCore::InspectorOverlay::overlayPage):
1695         (WebCore::evaluateCommandInOverlay):
1696
1697 2018-12-14  Youenn Fablet  <youenn@apple.com>
1698
1699         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
1700         https://bugs.webkit.org/show_bug.cgi?id=192720
1701
1702         Reviewed by Eric Carlson.
1703
1704         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
1705         as the latter is a ref counted object.
1706         Made some refactoring to return early in case of error.
1707
1708         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
1709         the MediaRecorder will stop listening for its tracks.
1710         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
1711
1712         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
1713
1714         * Modules/mediarecorder/MediaRecorder.cpp:
1715         (WebCore::MediaRecorder::didAddOrRemoveTrack):
1716         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
1717         * Modules/mediarecorder/MediaRecorder.h:
1718         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
1719         (WebCore::MediaRecorderPrivateAVFImpl::create):
1720         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
1721         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
1722         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
1723         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
1724         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
1725         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
1726         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
1727         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1728         (WebCore::MediaRecorderPrivateWriter::create):
1729         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
1730         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1731         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
1732
1733 2018-12-14  Youenn Fablet  <youenn@apple.com>
1734
1735         getSenders/getReceivers() should not return closed transceiver senders/receivers
1736         https://bugs.webkit.org/show_bug.cgi?id=192706
1737
1738         Reviewed by Eric Carlson.
1739
1740         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
1741         This forces us to compute the sender/receiver list at getter call time.
1742         Updated the internal call sites of senders to use the list of transceivers instead.
1743
1744         Covered by updated WPT tests.
1745
1746         * Modules/mediastream/RTCPeerConnection.cpp:
1747         (WebCore::RTCPeerConnection::addTrack):
1748         (WebCore::RTCPeerConnection::getSenders const):
1749         (WebCore::RTCPeerConnection::getReceivers const):
1750         * Modules/mediastream/RTCPeerConnection.h:
1751         * Modules/mediastream/RTCRtpTransceiver.cpp:
1752         (WebCore::RTCRtpTransceiver::stopped const):
1753         (WebCore::RtpTransceiverSet::append):
1754         (WebCore::RtpTransceiverSet::senders const):
1755         (WebCore::RtpTransceiverSet::receivers const):
1756         * Modules/mediastream/RTCRtpTransceiver.h:
1757         (WebCore::RtpTransceiverSet::senders const): Deleted.
1758         (WebCore::RtpTransceiverSet::receivers const): Deleted.
1759         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1760         (WebCore::findExistingSender):
1761         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1762
1763 2018-12-14  David Kilzer  <ddkilzer@apple.com>
1764
1765         clang-tidy: Fix unnecessary copy of objects for operator==() methods
1766         <https://webkit.org/b/192712>
1767         <rdar://problem/46739332>
1768
1769         Reviewed by Andy Estes.
1770
1771         * contentextensions/HashableActionList.h:
1772         (WebCore::ContentExtensions::HashableActionList::operator== const):
1773         (WebCore::ContentExtensions::HashableActionList::operator!= const):
1774         * platform/network/FormData.h:
1775         (WebCore::FormDataElement::EncodedFileData::operator== const):
1776         (WebCore::FormDataElement::EncodedBlobData::operator== const):
1777         - Change arguments from const to const reference to avoid
1778           copies.
1779
1780 2018-12-14  Jer Noble  <jer.noble@apple.com>
1781
1782         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
1783         https://bugs.webkit.org/show_bug.cgi?id=192713
1784         <rdar://problem/46739706>
1785
1786         Reviewed by Eric Carlson.
1787
1788         A callback is being called twice, and the second time has a null Promise. Instead of these
1789         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
1790         have ASSERTS() that they are called once-and-only-once.
1791
1792         * platform/encryptedmedia/CDMInstanceSession.h:
1793         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1794         (WebCore::CDMInstanceSessionClearKey::closeSession):
1795         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1796         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
1797         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
1798         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
1799         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
1800         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
1801
1802 2018-12-14  David Kilzer  <ddkilzer@apple.com>
1803
1804         clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
1805         <https://webkit.org/b/192708>
1806         <rdar://problem/46735907>
1807
1808         Reviewed by Jer Noble.
1809
1810         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1811         (WebCore::toSample):
1812         - Make argument a const reference.
1813
1814         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1815         - Update method signatures for implementation changes.
1816         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1817         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
1818         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
1819         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
1820         - Make RetainPtr<> argument an rvalue reference and use WTFMove().
1821         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1822         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
1823         - Make RetainPtr<> argument a const reference.
1824
1825         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1826         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
1827         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
1828         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
1829         - Change for loop keys to be const references.
1830
1831         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1832         - Update method signatures for implementation changes.
1833         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1834         (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
1835         (WebCore::SourceBufferPrivateAVFObjC::seekToTime):
1836         - Make Mediatime arguments a const reference.
1837
1838 2018-12-14  Simon Fraser  <simon.fraser@apple.com>
1839
1840         REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
1841         https://bugs.webkit.org/show_bug.cgi?id=188655
1842         rdar://problem/43382687
1843
1844         Reviewed by Antoine Quint.
1845
1846         The logic that computes animation extent, used by backing store attachment code, failed
1847         to account for the behavior where a keyframe animation with a missing 0% keyframe uses
1848         the transform from the unanimated style. This resulted in the computed extent being wrong,
1849         which caused us to remove the layer's backing store in some scenarios.
1850
1851         Fix both animation code paths to use the renderer style if the first keyframe doesn't
1852         contain a transform.
1853
1854         Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
1855                legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html
1856
1857         * animation/KeyframeEffect.cpp:
1858         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
1859         * page/animation/KeyframeAnimation.cpp:
1860         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
1861
1862 2018-12-14  Chris Dumez  <cdumez@apple.com>
1863
1864         [PSON] Stop exposing PolicyAction::Suspend to WebCore
1865         https://bugs.webkit.org/show_bug.cgi?id=192701
1866
1867         Reviewed by Brady Eidson.
1868
1869         Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.
1870
1871         * loader/DocumentLoader.cpp:
1872         (WebCore::DocumentLoader::continueAfterContentPolicy):
1873         * loader/FrameLoaderTypes.h:
1874         * loader/PolicyChecker.cpp:
1875         (WebCore::PolicyChecker::checkNavigationPolicy):
1876         (WebCore::PolicyChecker::checkNewWindowPolicy):
1877
1878 2018-12-14  Youenn Fablet  <youenn@apple.com>
1879
1880         IDB should store RTCCertificate
1881         https://bugs.webkit.org/show_bug.cgi?id=192599
1882
1883         Reviewed by Brady Eidson.
1884
1885         In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
1886         Instead, create an empty object so that the deserialization can still succeed.
1887         This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.
1888
1889         Test: webrtc/certificates-indexeddb.html
1890
1891         * bindings/js/SerializedScriptValue.cpp:
1892         (WebCore::CloneDeserializer::readTerminal):
1893
1894 2018-12-14  Zalan Bujtas  <zalan@apple.com>
1895
1896         [LFC][BFC] Transition to logical margin types.
1897         https://bugs.webkit.org/show_bug.cgi?id=192699
1898
1899         Reviewed by Antti Koivisto.
1900
1901         This is in preparation for moving over to logical types.
1902         (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))
1903
1904         * layout/FormattingContext.cpp:
1905         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1906         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1907         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1908         * layout/FormattingContext.h:
1909         * layout/FormattingContextGeometry.cpp:
1910         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
1911         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1912         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1913         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1914         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1915         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1916         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1917         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1918         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1919         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1920         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1921         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1922         * layout/FormattingContextQuirks.cpp:
1923         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1924         * layout/MarginTypes.h:
1925         (WebCore::Layout::VerticalMargin::usedValues const):
1926         * layout/Verification.cpp:
1927         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1928         * layout/blockformatting/BlockFormattingContext.cpp:
1929         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
1930         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
1931         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1932         (WebCore::Layout::hasPrecomputedMarginBefore):
1933         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1934         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1935         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1936         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1937         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1938         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
1939         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
1940         (WebCore::Layout::hasPrecomputedMarginTop): Deleted.
1941         * layout/blockformatting/BlockFormattingContext.h:
1942         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1943         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1944         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1945         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1946         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1947         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1948         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1949         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
1950         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
1951         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
1952         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
1953         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1954         (WebCore::Layout::hasMarginBeforeQuirkValue):
1955         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1956         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
1957         (WebCore::Layout::hasMarginTopQuirkValue): Deleted.
1958         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
1959         * layout/blockformatting/BlockMarginCollapse.cpp:
1960         (WebCore::Layout::isMarginBeforeCollapsedWithSibling):
1961         (WebCore::Layout::isMarginAfterCollapsedWithSibling):
1962         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
1963         (WebCore::Layout::isMarginAfterCollapsedThrough):
1964         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
1965         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
1966         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
1967         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
1968         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
1969         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
1970         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
1971         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
1972         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
1973         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
1974         (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
1975         (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
1976         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
1977         (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
1978         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
1979         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
1980         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
1981         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
1982         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
1983         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
1984         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
1985         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
1986         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
1987         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
1988         * layout/displaytree/DisplayBox.cpp:
1989         (WebCore::Display::Box::Box):
1990         (WebCore::Display::Box::marginBox const):
1991         (WebCore::Display::Box::nonCollapsedMarginBox const):
1992         * layout/displaytree/DisplayBox.h:
1993         (WebCore::Display::Box::rectWithMargin const):
1994         (WebCore::Display::Box::estimatedMarginBefore const):
1995         (WebCore::Display::Box::setEstimatedMarginBefore):
1996         (WebCore::Display::Box::top const):
1997         (WebCore::Display::Box::topLeft const):
1998         (WebCore::Display::Box::setVerticalMargin):
1999         (WebCore::Display::Box::marginBefore const):
2000         (WebCore::Display::Box::marginStart const):
2001         (WebCore::Display::Box::marginAfter const):
2002         (WebCore::Display::Box::marginEnd const):
2003         (WebCore::Display::Box::nonCollapsedMarginBefore const):
2004         (WebCore::Display::Box::nonCollapsedMarginAfter const):
2005         (WebCore::Display::Box::nonComputedMarginStart const):
2006         (WebCore::Display::Box::nonComputedMarginEnd const):
2007         (WebCore::Display::Box::estimatedMarginTop const): Deleted.
2008         (WebCore::Display::Box::setEstimatedMarginTop): Deleted.
2009         (WebCore::Display::Box::marginTop const): Deleted.
2010         (WebCore::Display::Box::marginLeft const): Deleted.
2011         (WebCore::Display::Box::marginBottom const): Deleted.
2012         (WebCore::Display::Box::marginRight const): Deleted.
2013         (WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
2014         (WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
2015         (WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
2016         (WebCore::Display::Box::nonComputedMarginRight const): Deleted.
2017         * layout/floats/FloatAvoider.cpp:
2018         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
2019         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
2020         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
2021         * layout/floats/FloatAvoider.h:
2022         (WebCore::Layout::FloatAvoider::marginBefore const):
2023         (WebCore::Layout::FloatAvoider::marginAfter const):
2024         (WebCore::Layout::FloatAvoider::marginStart const):
2025         (WebCore::Layout::FloatAvoider::marginEnd const):
2026         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
2027         (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
2028         (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
2029         (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
2030         (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
2031         * layout/floats/FloatBox.cpp:
2032         (WebCore::Layout::FloatBox::rect const):
2033         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
2034         (WebCore::Layout::FloatBox::verticalPositionCandidate):
2035         (WebCore::Layout::FloatBox::initialVerticalPosition const):
2036         * layout/floats/FloatingContext.cpp:
2037         (WebCore::Layout::FloatingContext::positionForFloat const):
2038         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2039         * layout/inlineformatting/InlineFormattingContext.cpp:
2040         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2041
2042 2018-12-14  Zalan Bujtas  <zalan@apple.com>
2043
2044         [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
2045         https://bugs.webkit.org/show_bug.cgi?id=192692
2046
2047         Reviewed by Antti Koivisto.
2048
2049         This is in preparation for completing block margin collapsing.
2050
2051         * WebCore.xcodeproj/project.pbxproj:
2052         * layout/FormattingContext.cpp:
2053         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
2054         * layout/FormattingContext.h:
2055         * layout/FormattingContextGeometry.cpp:
2056         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2057         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2058         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2059         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2060         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
2061         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
2062         * layout/LayoutState.cpp:
2063         (WebCore::Layout::LayoutState::LayoutState):
2064         * layout/LayoutUnits.h:
2065         (WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
2066         * layout/MarginTypes.h: Added.
2067         (WebCore::Layout::VerticalMargin::nonCollapsedValues const):
2068         (WebCore::Layout::VerticalMargin::collapsedValues const):
2069         (WebCore::Layout::VerticalMargin::setCollapsedValues):
2070         (WebCore::Layout::VerticalMargin::VerticalMargin):
2071         (WebCore::Layout::VerticalMargin::usedValues const):
2072         * layout/blockformatting/BlockFormattingContext.cpp:
2073         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2074         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2075         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2076         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2077         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2078         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
2079         * layout/displaytree/DisplayBox.cpp:
2080         (WebCore::Display::Box::Box):
2081         * layout/displaytree/DisplayBox.h:
2082         (WebCore::Display::Box::setHorizontalMargin):
2083         (WebCore::Display::Box::setVerticalMargin):
2084         (WebCore::Display::Box::setHorizontalNonComputedMargin):
2085         (WebCore::Display::Box::verticalMargin const):
2086         (WebCore::Display::Box::marginTop const):
2087         (WebCore::Display::Box::marginLeft const):
2088         (WebCore::Display::Box::marginBottom const):
2089         (WebCore::Display::Box::marginRight const):
2090         (WebCore::Display::Box::nonCollapsedMarginTop const):
2091         (WebCore::Display::Box::nonCollapsedMarginBottom const):
2092         (WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
2093         * layout/floats/FloatingContext.cpp:
2094         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2095         * layout/inlineformatting/InlineFormattingContext.cpp:
2096         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2097
2098 2018-12-14  Fujii Hironori  <Hironori.Fujii@sony.com>
2099
2100         [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
2101         https://bugs.webkit.org/show_bug.cgi?id=192693
2102
2103         Reviewed by Ross Kirsling.
2104
2105         No new tests, no behavior changes.
2106
2107         * platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
2108         * platform/win/CursorWin.cpp:
2109         (WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
2110         * platform/win/DefWndProcWindowClass.cpp:
2111         (WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
2112         * platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
2113         * platform/win/PasteboardWin.cpp:
2114         (WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
2115         (WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
2116         * platform/win/PlatformMouseEventWin.cpp:
2117         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
2118         * platform/win/PopupMenuWin.cpp:
2119         (WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
2120         * platform/win/PopupMenuWin.h: Marked override methods with 'override'.
2121         * platform/win/SSLKeyGeneratorWin.cpp:
2122         (WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace.
2123         (WebCore::signedPublicKeyAndChallengeString): Ditto.
2124         * platform/win/SearchPopupMenuDB.cpp:
2125         (WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT.
2126         * platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86).
2127         * platform/win/SystemInfo.cpp:
2128         (WebCore::osVersionForUAString): Added default case.
2129
2130 2018-12-13  Youenn Fablet  <youenn@apple.com>
2131
2132         RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
2133         https://bugs.webkit.org/show_bug.cgi?id=192685
2134
2135         Reviewed by Eric Carlson.
2136
2137         In case the remote description contains a rejected m section,
2138         the corresponding transceiver should be marked as stopped.
2139         Libwebrtc backend has that information so pipe it up to JS.
2140
2141         Covered by updated WPT test.
2142
2143         * Modules/mediastream/RTCRtpTransceiver.cpp:
2144         (WebCore::RTCRtpTransceiver::stopped const):
2145         * Modules/mediastream/RTCRtpTransceiver.h:
2146         (WebCore::RTCRtpTransceiver::stopped const): Deleted.
2147         * Modules/mediastream/RTCRtpTransceiverBackend.h:
2148         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
2149         (WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
2150         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
2151
2152 2018-12-13  Mark Lam  <mark.lam@apple.com>
2153
2154         Ensure that StructureFlags initialization always starts with Base::StructureFlags.
2155         https://bugs.webkit.org/show_bug.cgi?id=192686
2156
2157         Reviewed by Keith Miller.
2158
2159         No new tests needed because there's no new functionality.  Just refactoring.
2160
2161         * bindings/js/JSDOMWindowProperties.h:
2162         * bindings/scripts/CodeGeneratorJS.pm:
2163         (GenerateHeader):
2164         (GeneratePrototypeDeclaration):
2165         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2166         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
2167         * bindings/scripts/test/JS/JSTestEventTarget.h:
2168         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2169         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
2170         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
2171         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
2172         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
2173         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
2174         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
2175         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
2176         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
2177         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
2178         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
2179         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
2180         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
2181         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
2182         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
2183         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
2184         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
2185         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
2186         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
2187         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
2188         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
2189         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
2190         * bindings/scripts/test/JS/JSTestObj.h:
2191         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2192         * bindings/scripts/test/JS/JSTestPluginInterface.h:
2193         * bindings/scripts/test/JS/JSTestTypedefs.h:
2194
2195 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
2196
2197         Make HTMLConverter work across shadow boundaries
2198         https://bugs.webkit.org/show_bug.cgi?id=192640
2199
2200         Reviewed by Wenson Hsieh.
2201
2202         Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions.
2203
2204         Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html
2205                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html
2206                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html
2207                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html
2208                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html
2209                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html
2210                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html
2211                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html
2212
2213         * dom/Position.cpp:
2214         (WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter
2215         and serializePreservingVisualAppearanceInternal.
2216         * dom/Position.h:
2217         * editing/cocoa/HTMLConverter.mm:
2218         (HTMLConverter::convert):
2219         (HTMLConverterCaches::propertyValueForNode):
2220         (HTMLConverterCaches::floatPropertyValueForNode):
2221         (HTMLConverter::_blockLevelElementForNode):
2222         (HTMLConverterCaches::colorPropertyValueForNode):
2223         (HTMLConverter::aggregatedAttributesForAncestors):
2224         (HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
2225         (HTMLConverter::_processElement):
2226         (HTMLConverter::_traverseNode):
2227         (HTMLConverter::_traverseFooterNode):
2228         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
2229         (WebCore::attributedStringFromSelection):
2230         * editing/markup.cpp:
2231         (WebCore::commonShadowIncludingAncestor): Moved to Position.cpp.
2232
2233 2018-12-13  Youenn Fablet  <youenn@apple.com>
2234
2235         Trying to play a media element synchronously after setting srcObject should succeed without user gesture
2236         https://bugs.webkit.org/show_bug.cgi?id=192679
2237
2238         Reviewed by Eric Carlson.
2239
2240         Check the srcObject mediaProvider value which is set synchronously.
2241         Covered by updated fast/mediastream/local-audio-playing-event.html.
2242
2243         * html/HTMLMediaElement.h:
2244         (WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):
2245
2246 2018-12-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2247
2248         [iOS] Support dropping contact card data (public.vcard) in editable content
2249         https://bugs.webkit.org/show_bug.cgi?id=192570
2250         <rdar://problem/35626913>
2251
2252         Reviewed by Tim Horton.
2253
2254         Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details.
2255
2256         Tests:  DragAndDropTests.ExternalSourceContactIntoEditableAreas
2257                 DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea
2258                 DragAndDropTests.ExternalSourceMapItemIntoEditableAreas
2259                 WKAttachmentTestsIOS.InsertDroppedContactAsAttachment
2260                 WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment
2261
2262         * editing/WebContentReader.h:
2263         * editing/cocoa/WebContentReaderCocoa.mm:
2264         (WebCore::attachmentForFilePath):
2265
2266         Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths`
2267         as well as `readVirtualContactFile`.
2268
2269         (WebCore::WebContentReader::readFilePaths):
2270         (WebCore::WebContentReader::readVirtualContactFile):
2271
2272         Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting
2273         fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is
2274         empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a
2275         contact, there is no associated URL, so we only have an attachment.
2276
2277         * platform/Pasteboard.h:
2278         * platform/ios/PasteboardIOS.mm:
2279         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
2280
2281         Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for
2282         "public.vcard" data, which is then passed on to the web content reader. Additionally, by returning
2283         `ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents
2284         of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since
2285         "public.vcard" conforms to "public.text").
2286
2287         (WebCore::Pasteboard::read):
2288         (WebCore::Pasteboard::readRespectingUTIFidelities):
2289         * platform/ios/WebItemProviderPasteboard.mm:
2290         (-[NSItemProvider web_fileUploadContentTypes]):
2291
2292         Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is
2293         tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only
2294         suitable for deserialization into an `MKMapItem`.
2295
2296 2018-12-13  Devin Rousso  <drousso@apple.com>
2297
2298         Web Inspector: remove DOM.BackendNodeId and associated commands/events
2299         https://bugs.webkit.org/show_bug.cgi?id=192478
2300
2301         Reviewed by Matt Baker.
2302
2303         Removing unused code, so no change in functionality.
2304
2305         * inspector/agents/InspectorDOMAgent.h:
2306         * inspector/agents/InspectorDOMAgent.cpp:
2307         (WebCore::InspectorDOMAgent::discardBindings):
2308         (WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted.
2309         (WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted.
2310         (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted.
2311
2312 2018-12-13  Chris Dumez  <cdumez@apple.com>
2313
2314         [PSON] We should not need to navigate to 'about:blank' to suspend pages
2315         https://bugs.webkit.org/show_bug.cgi?id=192668
2316         <rdar://problem/46701466>
2317
2318         Reviewed by Alex Christensen.
2319
2320         * history/PageCache.cpp:
2321         (WebCore::PageCache::addIfCacheable):
2322         * history/PageCache.h:
2323         * loader/DocumentLoader.cpp:
2324         (WebCore::DocumentLoader::redirectReceived):
2325         (WebCore::DocumentLoader::willSendRequest):
2326         (WebCore::DocumentLoader::startLoadingMainResource):
2327         * loader/DocumentLoader.h:
2328         * loader/FrameLoader.cpp:
2329         (WebCore::FrameLoader::init):
2330         (WebCore::FrameLoader::stopAllLoaders):
2331         (WebCore::FrameLoader::setDocumentLoader):
2332         (WebCore::FrameLoader::commitProvisionalLoad):
2333         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2334         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2335         * loader/FrameLoaderTypes.h:
2336         * loader/PolicyChecker.cpp:
2337         (WebCore::PolicyChecker::checkNavigationPolicy):
2338         * loader/PolicyChecker.h:
2339
2340 2018-12-13  Per Arne Vollan  <pvollan@apple.com>
2341
2342         [macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences
2343         https://bugs.webkit.org/show_bug.cgi?id=192638
2344
2345         Reviewed by Eric Carlson.
2346
2347         It is currently not possible to override caption styles generated from System Preferences with inline
2348         WebVTT styles without adding !important. The reason for this is that the generated styles from
2349         System preferences are author styles which have higher priority than the inline WebVTT styles, which
2350         are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated
2351         styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since
2352         they are added after the generated styles. This patch also fixes a problem where inline styles could be
2353         added twice to the video user agent shadow root.
2354
2355         Test: media/track/track-cue-css.html
2356
2357         * dom/ExtensionStyleSheets.cpp:
2358         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
2359         * html/track/VTTCue.cpp:
2360         (WebCore::VTTCue::getDisplayTree):
2361         * page/CaptionUserPreferences.cpp:
2362         (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
2363         * page/Page.cpp:
2364         (WebCore::Page::setCaptionUserPreferencesStyleSheet):
2365
2366 2018-12-13  Jer Noble  <jer.noble@apple.com>
2367
2368         Fix leak of AVPlayer boundaryTimeObserver object.
2369         https://bugs.webkit.org/show_bug.cgi?id=192674
2370
2371         Reviewed by Eric Carlson.
2372
2373         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2374         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
2375
2376 2018-12-13  Brent Fulgham  <bfulgham@apple.com>
2377
2378         Don't attempt to animate invalid CSS properties
2379         https://bugs.webkit.org/show_bug.cgi?id=192630
2380         <rdar://problem/46664433>
2381
2382         Reviewed by Antoine Quint.
2383
2384         Inherited animation properties can cause child elements to think they need to animate CSS properties
2385         that they do not support, leading to nullptr crashes.
2386
2387         Recognize that CSSPropertyInvalid is a potential requested animation property, and handle it
2388         cleanly.
2389
2390         Tests: animations/invalid-property-animation.html
2391
2392         * page/animation/CompositeAnimation.cpp:
2393         (WebCore::CompositeAnimation::updateTransitions):
2394         * svg/SVGAnimateElementBase.cpp:
2395         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2396
2397 2018-12-13  Timothy Hatcher  <timothy@apple.com>
2398
2399         REGRESSION (r230064): Focus rings on webpages are fainter than in native UI.
2400         https://bugs.webkit.org/show_bug.cgi?id=192639
2401         rdar://problem/42669297
2402
2403         Reviewed by Tim Horton.
2404
2405         The focus ring color passed to CoreGraphics is expected to be opaque, since they
2406         will apply opacity when drawing (because opacity is normally animated).
2407         We were getting this by accident before when the old `RenderThemeMac::systemColor()`
2408         used the old `convertNSColorToColor()`, which ignored alpha on NSColor.
2409         Existing tests use fixed test focus ring color.
2410
2411         * css/StyleResolver.cpp:
2412         (WebCore::StyleResolver::colorFromPrimitiveValue const): Use RenderTheme singleton for `focusRingColor()`.
2413         * html/canvas/CanvasRenderingContext2D.cpp:
2414         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Ditto.
2415         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2416         (WebCore::drawFocusRingAtTime): Use `CGContextStateSaver`.
2417         * platform/mac/ThemeMac.mm:
2418         (WebCore::drawCellFocusRingWithFrameAtTime): Force alpha to 1 on the focus ring color. Use `CGContextStateSaver`.
2419         * rendering/RenderElement.cpp:
2420         (WebCore::RenderElement::paintFocusRing): Use RenderTheme singleton for `focusRingColor()`.
2421         * rendering/RenderImage.cpp:
2422         (WebCore::RenderImage::paintAreaElementFocusRing): Ditto.
2423         * rendering/RenderTheme.cpp:
2424         (WebCore::RenderTheme::focusRingColor const): Made const. Cache the result of `platformFocusRingColor()`.
2425         * rendering/RenderTheme.h: Made `focusRingColor()` a member function instead of static.
2426         * rendering/RenderThemeMac.mm:
2427         (WebCore::RenderThemeMac::platformFocusRingColor const): Force alpha to 1 on the focus ring color.
2428         (WebCore::RenderThemeMac::systemColor const): Use `focusRingColor()`, instead of caching color here.
2429
2430 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
2431
2432         [MediaStream] Calculate width or height when constraints contain only the other
2433         https://bugs.webkit.org/show_bug.cgi?id=192632
2434         <rdar://problem/46665734>
2435
2436         Unreviewed, remove an unneeded assert.
2437
2438         * platform/mediastream/RealtimeVideoSource.cpp:
2439         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers):
2440
2441 2018-12-13  Zach Li  <zachli@apple.com>
2442
2443         Update Credit Card AutoFill button icon
2444         https://bugs.webkit.org/show_bug.cgi?id=192637
2445         rdar://problem/46545006
2446
2447         Reviewed by Chris Dumez.
2448
2449         * css/html.css:
2450         (input::-webkit-credit-card-auto-fill-button):
2451
2452 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
2453
2454         [MediaStream] Calculate width or height when constraints contain only the other
2455         https://bugs.webkit.org/show_bug.cgi?id=192632
2456         <rdar://problem/46665734>
2457
2458         Reviewed by Youenn Fablet.
2459
2460         Test: fast/mediastream/constraint-intrinsic-size.html
2461
2462         * platform/graphics/RemoteVideoSample.cpp:
2463         (WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR.
2464
2465         * platform/graphics/cv/ImageTransferSessionVT.h:
2466         (WebCore::ImageTransferSessionVT::pixelFormat const): New.
2467
2468         * platform/mediastream/RealtimeMediaSource.cpp:
2469         (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size.
2470         (WebCore::RealtimeMediaSource::setSize): Don't notify about width and height.
2471         (WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary.
2472         (WebCore::RealtimeMediaSource::setIntrinsicSize): New.
2473         (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted.
2474         * platform/mediastream/RealtimeMediaSource.h:
2475
2476         * platform/mediastream/RealtimeVideoSource.cpp:
2477         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable.
2478
2479         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2480         (WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly.
2481         (WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize().
2482         (WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable.
2483         (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted.
2484         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2485         (WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted.
2486
2487         * platform/mock/MockRealtimeVideoSource.cpp:
2488         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size.
2489         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup.
2490         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset):  Report intrinsic size.
2491         (WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source.
2492         * platform/mock/MockRealtimeVideoSource.h:
2493
2494 2018-12-13  David Kilzer  <ddkilzer@apple.com>
2495
2496         clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp
2497         <https://webkit.org/b/192661>
2498         <rdar://problem/46694035>
2499
2500         Reviewed by Daniel Bates.
2501
2502         * dom/Document.cpp:
2503         (WebCore::Document::updateIntersectionObservations):
2504         (WebCore::Document::notifyIntersectionObserversTimerFired):
2505         * dom/Element.cpp:
2506         (WebCore::Element::didMoveToNewDocument):
2507         (WebCore::Element::disconnectFromIntersectionObservers):
2508         - Change loop variables from `auto` to `const auto&` to prevent
2509           unnecessary copies of WeakPtr<IntersectionObserver> or
2510           struct IntersectionObserverRegistration objects.
2511
2512 2018-12-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2513
2514         [FreeType] Remove HarfBuzzFace
2515         https://bugs.webkit.org/show_bug.cgi?id=192589
2516
2517         Reviewed by Michael Catanzaro.
2518
2519         This was used to share the common implementation with the chromium port, but now that only freetype based ports
2520         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
2521         since we are already caching glyphs in Font.
2522
2523         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
2524         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
2525         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
2526         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2527         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
2528         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
2529         OpenType math.
2530         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2531         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
2532         (WebCore::doubleToHarfBuzzPosition): Ditto.
2533         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
2534         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
2535         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
2536         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
2537         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
2538         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
2539         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
2540         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
2541         * platform/graphics/harfbuzz/HbUniquePtr.h:
2542         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
2543         * platform/graphics/opentype/OpenTypeMathData.cpp:
2544         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
2545
2546 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2547
2548         [FreeType] Add initial implementation of variation fonts
2549         https://bugs.webkit.org/show_bug.cgi?id=192151
2550
2551         Reviewed by Michael Catanzaro.
2552
2553         * css/CSSFontFaceSource.cpp:
2554         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
2555         * loader/cache/CachedFont.cpp:
2556         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
2557         * platform/graphics/FontPlatformData.h:
2558         (WebCore::FontPlatformData::isFixedWidth const):
2559         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
2560         * platform/graphics/freetype/FontCacheFreeType.cpp:
2561         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
2562         pattern.
2563         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
2564         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
2565         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
2566         (WebCore::defaultVariationValues): Parse font variations table.
2567         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
2568         * platform/graphics/freetype/FontCacheFreeType.h: Added.
2569         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2570         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
2571         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
2572         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
2573         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
2574         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
2575         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
2576         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2577         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
2578         FC_FONT_VARIATIONS value from the pattern.
2579         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
2580         pattern.
2581         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
2582         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
2583         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
2584         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2585         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
2586         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2587         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
2588         * platform/graphics/win/FontCustomPlatformData.cpp:
2589         (WebCore::FontCustomPlatformData::fontPlatformData):
2590         * platform/graphics/win/FontCustomPlatformData.h:
2591
2592 2018-12-12  Fujii Hironori  <Hironori.Fujii@sony.com>
2593
2594         [Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
2595         https://bugs.webkit.org/show_bug.cgi?id=192618
2596
2597         Reviewed by Alex Christensen.
2598
2599         No new tests, no behavior changes.
2600
2601         * platform/win/PopupMenuWin.h:
2602         * platform/win/WCDataObject.cpp:
2603         * platform/win/WCDataObject.h:
2604
2605 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
2606
2607         REGRESSION (r238090): CAPCHA UI jumps to the wrong location
2608         https://bugs.webkit.org/show_bug.cgi?id=192651
2609         rdar://problem/46531919
2610
2611         Reviewed by Zalan Bujtas.
2612         
2613         When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
2614         bit to say that descendants need their geometry updated (because they now have to
2615         compute their positions relative to a different ancestor). This wasn't happening
2616         in the layerStyleChanged() code path.
2617         
2618         In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
2619         we can address a FIXME and only dirty direct children, not all descendants (that code was
2620         written before the child-only dirty bit existed).
2621
2622         Test: compositing/geometry/update-child-geometry-on-compositing-change.html
2623
2624         * rendering/RenderLayerCompositor.cpp:
2625         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2626         (WebCore::RenderLayerCompositor::layerStyleChanged):
2627
2628 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
2629
2630         Make TextInputController.legacyAttributedString take DOM nodes and offsets
2631         https://bugs.webkit.org/show_bug.cgi?id=192653
2632
2633         Reviewed by Wenson Hsieh.
2634
2635         No new tests since there should be no observable behavioral change other than
2636         TextInputController API in DumpRenderTree.
2637
2638         * editing/cocoa/HTMLConverter.h:
2639         * editing/cocoa/HTMLConverter.mm:
2640         (WebCore::attributedStringFromSelection):
2641         (WebCore::attributedStringBetweenStartAndEnd): Added.
2642
2643 2018-12-12  Ryosuke Niwa  <rniwa@webkit.org>
2644
2645         Fix macOS builds after r239145.
2646
2647         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2648
2649 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
2650
2651         REGRESSION (r238357): Pins on Yelp map disappear
2652         https://bugs.webkit.org/show_bug.cgi?id=192597
2653         rdar://problem/46578285
2654
2655         Reviewed by Zalan Bujtas.
2656
2657         RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained
2658         a negative z-order child (triggering creation of a foreground layer), we'd fail to 
2659         call the "setChildren()" with the vector containing that foreground layer.
2660         
2661         When updateBackingAndHierarchy() stops visiting descendants because none are composited,
2662         it may still have to update the child list with the foreground layer, so make sure
2663         the code handles this case.
2664
2665         Tests: compositing/z-order/add-negative-z-child.html
2666                compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html
2667
2668         * rendering/RenderLayer.cpp:
2669         (WebCore::outputPaintOrderTreeRecursive):
2670         * rendering/RenderLayerCompositor.cpp:
2671         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2672
2673 2018-12-12  YUHAN WU  <yuhan_wu@apple.com>
2674
2675         Implement non-timeslice mode encoding for MediaRecorder
2676         https://bugs.webkit.org/show_bug.cgi?id=192069
2677         <rdar://problem/46443290>
2678
2679         Reviewed by Eric Carlson.
2680
2681         Implement the encoding for non-timeslice mode of MediaRecorder.
2682         It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
2683         Add a API in internals to allow testings to turn on the mock source.
2684
2685         Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
2686
2687         * Modules/mediarecorder/MediaRecorder.cpp:
2688         (WebCore::MediaRecorder::create):
2689         (WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
2690         (WebCore::MediaRecorder::getPrivateImpl):
2691         (WebCore::MediaRecorder::MediaRecorder):
2692         (WebCore::MediaRecorder::stopRecording):
2693         (WebCore::MediaRecorder::stopRecordingInternal):
2694         (WebCore::MediaRecorder::createRecordingDataBlob):
2695         (WebCore::MediaRecorder::scheduleDeferredTask):
2696         * Modules/mediarecorder/MediaRecorder.h:
2697         * Modules/mediarecorder/MediaRecorder.idl:
2698         * SourcesCocoa.txt:
2699         * WebCore.xcodeproj/project.pbxproj:
2700         * platform/mediarecorder/MediaRecorderPrivate.h:
2701         (WebCore::MediaRecorderPrivate::stopRecording):
2702         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
2703         (WebCore::MediaRecorderPrivateAVFImpl::create):
2704         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
2705         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
2706         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
2707         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
2708         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
2709         (WebCore::MediaRecorderPrivateAVFImpl::mimeType):
2710         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
2711         * platform/mediarecorder/MediaRecorderPrivateMock.cpp:
2712         (WebCore::MediaRecorderPrivateMock::fetchData):
2713         (WebCore::MediaRecorderPrivateMock::mimeType):
2714         * platform/mediarecorder/MediaRecorderPrivateMock.h:
2715         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added.
2716         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
2717         (WebCore::MediaRecorderPrivateWriter::clear):
2718         (WebCore::MediaRecorderPrivateWriter::setupWriter):
2719         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
2720         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
2721         (WebCore::copySampleBufferWithCurrentTimeStamp):
2722         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
2723         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
2724         (WebCore::MediaRecorderPrivateWriter::stopRecording):
2725         * testing/Internals.cpp:
2726         (WebCore::createRecorderMockSource):
2727         (WebCore::Internals::setCustomPrivateRecorderCreator):
2728         * testing/Internals.h:
2729         * testing/Internals.idl:
2730
2731 2018-12-12  Justin Fan  <justin_fan@apple.com>
2732
2733         [WebGPU] Vertex buffers and WebGPUInputState
2734         https://bugs.webkit.org/show_bug.cgi?id=192611
2735
2736         Reviewed by Dean Jackson.
2737
2738         Test: webgpu/vertex-buffer-triangle-strip.html
2739
2740         Basic implementation of vertex buffers with Metal shading language in WebGPU. In 
2741         WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add 
2742         WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers.
2743
2744         Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode, 
2745         WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor:
2746         * CMakeLists.txt:
2747         * DerivedSources.make:
2748         * Sources.txt:
2749         * WebCore.xcodeproj/project.pbxproj:
2750         * bindings/js/WebCoreBuiltinNames.h:
2751
2752         Add and implement interfaces and dictionaries for WebGPUInputState:
2753         * Modules/webgpu/WebGPUBuffer.cpp:
2754         (WebCore::WebGPUBuffer::WebGPUBuffer):
2755         * Modules/webgpu/WebGPUBuffer.h:
2756         (WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer.
2757         * Modules/webgpu/WebGPUBufferDescriptor.h:
2758         * Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL.
2759         * Modules/webgpu/WebGPUDevice.h:
2760         * Modules/webgpu/WebGPUIndexFormat.h: Added.
2761         * Modules/webgpu/WebGPUIndexFormat.idl: Added. 
2762         * Modules/webgpu/WebGPUInputStateDescriptor.h: Added.
2763         * Modules/webgpu/WebGPUInputStateDescriptor.idl: Added.
2764         * Modules/webgpu/WebGPUInputStepMode.h: Added.
2765         * Modules/webgpu/WebGPUInputStepMode.idl: Added.
2766         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added.
2767         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added.
2768         * Modules/webgpu/WebGPUVertexFormat.h: Added.
2769         * Modules/webgpu/WebGPUVertexFormat.idl: Added.
2770         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Added.
2771         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added.
2772         * platform/graphics/gpu/GPUInputStateDescriptor.h: Added.
2773         * platform/graphics/gpu/GPURenderPassEncoder.h: Added.
2774         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added.
2775         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added.
2776         * platform/graphics/gpu/GPUVertexInputDescriptor.h: Added.
2777
2778         Refactor to support updated structure of pipeline descriptor in sketch IDL:
2779         * Modules/webgpu/WebGPUDevice.cpp:
2780         (WebCore::validateAndConvertPipelineStage):
2781         (WebCore::WebGPUDevice::createRenderPipeline const):
2782         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
2783         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
2784         * Modules/webgpu/WebGPUPipelineStageDescriptor.h:
2785         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
2786         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
2787         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
2788         * Modules/webgpu/WebGPUShaderStage.*: Removed.
2789
2790         Add and implement setVertexBuffers:
2791         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2792         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added. 
2793         * Modules/webgpu/WebGPURenderPassEncoder.h:
2794         * Modules/webgpu/WebGPURenderPassEncoder.idl: 
2795         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2796         (WebCore::GPURenderPassEncoder::setVertexBuffers):
2797         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2798         (WebCore::setInputStateForPipelineDescriptor):
2799         (WebCore::GPURenderPipeline::create):
2800
2801 2018-12-12  Tim Horton  <timothy_horton@apple.com>
2802
2803         REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight
2804         https://bugs.webkit.org/show_bug.cgi?id=192642
2805         <rdar://problem/46498246>
2806
2807         Reviewed by Geoffrey Garen.
2808
2809         No new tests; adjusted an existing test instead.
2810
2811         * platform/graphics/PathUtilities.cpp:
2812         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
2813         Instead of uniting when we fail to shrink-wrap, just return the original rects.
2814         This seems like a more reasonable default in most cases.
2815
2816 2018-12-12  Vivek Seth  <v_seth@apple.com>
2817
2818         HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
2819         https://bugs.webkit.org/show_bug.cgi?id=192375
2820         <rdar://problem/45851159>
2821
2822         Reviewed by Chris Dumez.
2823
2824         Use simulated redirect to tell clients that HTTPS Upgrade happened.
2825
2826         * platform/network/ResourceResponseBase.cpp:
2827         (WebCore::ResourceResponseBase::syntheticRedirectResponse):
2828         * platform/network/ResourceResponseBase.h:
2829         * platform/network/mac/WebCoreURLResponse.mm:
2830         (WebCore::synthesizeRedirectResponseIfNecessary):
2831
2832 2018-12-12  Chris Dumez  <cdumez@apple.com>
2833
2834         Add a preference to enable / disable devicemotion and deviceorientation events
2835         https://bugs.webkit.org/show_bug.cgi?id=192631
2836         <rdar://problem/46646244>
2837
2838         Reviewed by Geoffrey Garen.
2839
2840         Add setting to toggle support for the deviceorientation / devicemotion events:
2841         - https://w3c.github.io/deviceorientation/
2842
2843         * page/DOMWindow.cpp:
2844         (WebCore::DOMWindow::addEventListener):
2845         * page/Settings.yaml:
2846
2847 2018-12-11  Ryosuke Niwa  <rniwa@webkit.org>
2848
2849         Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
2850         https://bugs.webkit.org/show_bug.cgi?id=192613
2851
2852         Reviewed by Darin Adler.
2853
2854         This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with
2855         a selection which spans across shadow boundaries in the future.
2856
2857         No new tests since there should be no observable behavioral change.
2858
2859         * editing/cocoa/EditorCocoa.mm:
2860         (WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard.
2861         (WebCore::Editor::writeSelection): Ditto.
2862         * editing/cocoa/HTMLConverter.h:
2863         * editing/cocoa/HTMLConverter.mm:
2864         (HTMLConverter::HTMLConverter): Now takes two Position's.
2865         (HTMLConverter::convert): Updated to work with Position's.
2866         (HTMLConverter::_processText): Ditto.
2867         (HTMLConverter::_traverseNode): Ditto.
2868         (HTMLConverter::_traverseFooterNode): Ditto.
2869         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto.
2870         (WebCore::attributedStringFromRange): Ditto.
2871         (WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange
2872         in order to preserve the exact behavior.
2873
2874 2018-12-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2875
2876         Unreviewed manual rollout of r239100-r239102 and r239116
2877         https://bugs.webkit.org/show_bug.cgi?id=192151
2878         <rdar://problem/46655586>
2879
2880         * css/CSSFontFaceSource.cpp:
2881         (WebCore::CSSFontFaceSource::font):
2882         * loader/cache/CachedFont.cpp:
2883         (WebCore::CachedFont::platformDataFromCustomData):
2884         * platform/FreeType.cmake:
2885         * platform/graphics/FontPlatformData.h:
2886         (WebCore::FontPlatformData::isFixedWidth const): Deleted.
2887         * platform/graphics/cairo/FontCustomPlatformData.h:
2888         * platform/graphics/freetype/FontCacheFreeType.cpp:
2889         (WebCore::FontCache::systemFallbackForCharacters):
2890         (WebCore::FontCache::createFontPlatformData):
2891         (WebCore::getFontPropertiesFromPattern): Deleted.
2892         (WebCore::defaultVariationValues): Deleted.
2893         (WebCore::buildVariationSettings): Deleted.
2894         * platform/graphics/freetype/FontCacheFreeType.h: Removed.
2895         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2896         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
2897         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
2898         (WebCore::FontCustomPlatformData::fontPlatformData):
2899         (WebCore::FontCustomPlatformData::supportsFormat):
2900         (WebCore::defaultFontconfigOptions): Deleted.
2901         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2902         (WebCore::setCairoFontOptionsFromFontConfigPattern):
2903         (WebCore::getDefaultFontconfigOptions):
2904         (WebCore::FontPlatformData::FontPlatformData):
2905         (WebCore::FontPlatformData::operator=):
2906         (WebCore::FontPlatformData::harfBuzzFace const):
2907         (WebCore::FontPlatformData::platformIsEqual const):
2908         (WebCore::FontPlatformData::buildScaledFont):
2909         (WebCore::FontPlatformData::fcPattern const): Deleted.
2910         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted.
2911         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2912         (WebCore::Font::platformCreateScaledFont const):
2913         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2914         (WebCore::fontFeatures):
2915         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2916         (WebCore::floatToHarfBuzzPosition): Deleted.
2917         (WebCore::doubleToHarfBuzzPosition): Deleted.
2918         (WebCore::harfBuzzFontFunctions): Deleted.
2919         (WebCore::findScriptForVerticalGlyphSubstitution): Deleted.
2920         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added.
2921         (WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
2922         (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
2923         (WebCore::HarfBuzzFace::cache):
2924         (WebCore::HarfBuzzFace::HarfBuzzFace):
2925         (WebCore::HarfBuzzFace::~HarfBuzzFace):
2926         (WebCore::findScriptForVerticalGlyphSubstitution):
2927         (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
2928         * platform/graphics/harfbuzz/HarfBuzzFace.h: Added.
2929         (WebCore::HarfBuzzFace::CacheEntry::create):
2930         (WebCore::HarfBuzzFace::CacheEntry::face):
2931         (WebCore::HarfBuzzFace::CacheEntry::glyphCache):
2932         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added.
2933         (WebCore::floatToHarfBuzzPosition):
2934         (WebCore::doubleToHarfBuzzPosition):
2935         (WebCore::CairoGetGlyphWidthAndExtents):
2936         (WebCore::harfBuzzGetGlyph):
2937         (WebCore::harfBuzzGetGlyphHorizontalAdvance):
2938         (WebCore::harfBuzzGetGlyphHorizontalOrigin):
2939         (WebCore::harfBuzzGetGlyphExtents):
2940         (WebCore::harfBuzzCairoTextGetFontFuncs):
2941         (WebCore::harfBuzzCairoGetTable):
2942         (WebCore::HarfBuzzFace::createFace):
2943         (WebCore::HarfBuzzFace::createFont):
2944         * platform/graphics/harfbuzz/HbUniquePtr.h:
2945         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Deleted.
2946         * platform/graphics/opentype/OpenTypeMathData.cpp:
2947         (WebCore::OpenTypeMathData::OpenTypeMathData):
2948         * platform/graphics/win/FontCustomPlatformData.cpp:
2949         (WebCore::FontCustomPlatformData::fontPlatformData):
2950         * platform/graphics/win/FontCustomPlatformData.h:
2951         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2952         (WebCore::FontCustomPlatformData::fontPlatformData):
2953
2954 2018-12-12  Chris Dumez  <cdumez@apple.com>
2955
2956         Unreviewed attempt to fix Windows Cairo build after r239100.
2957
2958         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2959         (WebCore::FontCustomPlatformData::fontPlatformData):
2960
2961 2018-12-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2962
2963         [iOS] A few API tests are failing after r239086
2964         https://bugs.webkit.org/show_bug.cgi?id=192608
2965
2966         Reviewed by Zalan Bujtas.
2967
2968         These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing
2969         the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest
2970         fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab
2971         the highest fidelity path using Vector::first().
2972
2973         While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths,
2974         this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear.
2975
2976         * platform/PasteboardItemInfo.h:
2977         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
2978         * platform/ios/PasteboardIOS.mm:
2979         (WebCore::Pasteboard::readRespectingUTIFidelities):
2980         (WebCore::Pasteboard::readFilePaths):
2981
2982 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2983
2984         Unreviewed. Fix WPE build after r239101.
2985
2986         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h>
2987
2988 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2989
2990         [FreeType] Remove HarfBuzzFace
2991         https://bugs.webkit.org/show_bug.cgi?id=192589
2992
2993         Reviewed by Michael Catanzaro.
2994
2995         This was used to share the common implementation with the chromium port, but now that only freetype based ports
2996         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
2997         since we are already caching glyphs in Font.
2998
2999         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
3000         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
3001         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
3002         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3003         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
3004         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
3005         OpenType math.
3006         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
3007         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
3008         (WebCore::doubleToHarfBuzzPosition): Ditto.
3009         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
3010         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
3011         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
3012         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
3013         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
3014         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
3015         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
3016         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
3017         * platform/graphics/harfbuzz/HbUniquePtr.h:
3018         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
3019         * platform/graphics/opentype/OpenTypeMathData.cpp:
3020         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
3021
3022 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3023
3024         [FreeType] Add initial implementation of variation fonts
3025         https://bugs.webkit.org/show_bug.cgi?id=192151
3026
3027         Reviewed by Michael Catanzaro.
3028
3029         * css/CSSFontFaceSource.cpp:
3030         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
3031         * loader/cache/CachedFont.cpp:
3032         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
3033         * platform/graphics/FontPlatformData.h:
3034         (WebCore::FontPlatformData::isFixedWidth const):
3035         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
3036         * platform/graphics/freetype/FontCacheFreeType.cpp:
3037         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
3038         pattern.
3039         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
3040         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
3041         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
3042         (WebCore::defaultVariationValues): Parse font variations table.
3043         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
3044         * platform/graphics/freetype/FontCacheFreeType.h: Added.
3045         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
3046         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
3047         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
3048         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
3049         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
3050         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
3051         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
3052         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3053         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
3054         FC_FONT_VARIATIONS value from the pattern.
3055         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
3056         pattern.
3057         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
3058         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
3059         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
3060         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3061         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
3062         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
3063         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
3064         * platform/graphics/win/FontCustomPlatformData.cpp:
3065         (WebCore::FontCustomPlatformData::fontPlatformData):
3066         * platform/graphics/win/FontCustomPlatformData.h:
3067
3068 2018-12-11  Justin Michaud  <justin_michaud@apple.com>
3069
3070         Implement feature flag for CSS Typed OM
3071         https://bugs.webkit.org/show_bug.cgi?id=192610
3072
3073         Reviewed by Ryosuke Niwa.
3074
3075         * Configurations/FeatureDefines.xcconfig:
3076         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
3077         * css/typedom/StylePropertyMapReadOnly.h:
3078         * css/typedom/StylePropertyMapReadOnly.idl:
3079         * css/typedom/TypedOMCSSImageValue.h:
3080         * css/typedom/TypedOMCSSImageValue.idl:
3081         * css/typedom/TypedOMCSSNumericValue.h:
3082         * css/typedom/TypedOMCSSNumericValue.idl:
3083         * css/typedom/TypedOMCSSStyleValue.h:
3084         * css/typedom/TypedOMCSSStyleValue.idl:
3085         * css/typedom/TypedOMCSSUnitValue.h:
3086         * css/typedom/TypedOMCSSUnitValue.idl:
3087         * css/typedom/TypedOMCSSUnparsedValue.h:
3088         * css/typedom/TypedOMCSSUnparsedValue.idl:
3089         * features.json:
3090         * html/ImageBitmap.cpp:
3091         * html/ImageBitmap.h:
3092         * html/canvas/CanvasDrawImage.idl:
3093         * html/canvas/CanvasFillStrokeStyles.idl:
3094         * html/canvas/CanvasRenderingContext2DBase.cpp:
3095         * html/canvas/CanvasRenderingContext2DBase.h:
3096         * inspector/InspectorCanvas.cpp:
3097         (WebCore::InspectorCanvas::buildAction):
3098         * page/RuntimeEnabledFeatures.h:
3099         (WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled):
3100         (WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const):
3101         * page/WindowOrWorkerGlobalScope.idl:
3102
3103 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
3104
3105         connectedCallback is invoked during the removal of the element inside another element's connectedCallback
3106         https://bugs.webkit.org/show_bug.cgi?id=183586
3107         <rdar://problem/38403504>
3108
3109         Reviewed by Frédéric Wang.
3110
3111         Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760
3112
3113         After much discussion, it's unclear that there is a clear path forward to fixing the oddness that
3114         the presence of a custom element reaction changes the timing at which another reaction callback gets invoked.
3115         So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability.
3116
3117         Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element
3118         does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in:
3119         https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction
3120             1. Let definition be element's custom element definition.
3121             2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName.
3122             3. If callback is null, then return
3123             4. If callbackName is "attributeChangedCallback", then:
3124                 1. Let attributeName be the first element of args.
3125                 2. If definition's observed attributes does not contain attributeName, then return.
3126             5. Add a new callback reaction to element's custom element reaction queue, with callback function callback
3127                and arguments args.
3128             6. Enqueue an element on the appropriate element queue given element.
3129
3130         Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html
3131
3132         * dom/CustomElementReactionQueue.cpp:
3133         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
3134         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
3135         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
3136         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
3137         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
3138         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
3139         (WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue.
3140         * dom/CustomElementReactionQueue.h:
3141
3142 2018-12-11  Justin Fan  <justin_fan@apple.com>
3143
3144         [WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU
3145         https://bugs.webkit.org/show_bug.cgi?id=192516
3146
3147         Reviewed by Dean Jackson.
3148
3149         Test: webgpu/buffers.html
3150
3151         Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation.
3152
3153         Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor:
3154         * CMakeLists.txt:
3155         * DerivedSources.make:
3156         * Sources.txt:
3157         * SourcesCocoa.txt:
3158         * WebCore.xcodeproj/project.pbxproj:
3159         * bindings/js/WebCoreBuiltinNames.h:
3160
3161         * Modules/webgpu/WebGPUBuffer.cpp: Added.
3162         (WebCore::WebGPUBuffer::create):
3163         (WebCore::WebGPUBuffer::WebGPUBuffer):
3164         * Modules/webgpu/WebGPUBuffer.h: Added.
3165         (WebCore::WebGPUBuffer::mapping const):
3166         (WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear.
3167         (WebCore::WebGPUBuffer::destroy): Unimplemented stub.
3168         * Modules/webgpu/WebGPUBuffer.idl: Added.
3169         * Modules/webgpu/WebGPUBufferDescriptor.h: Added.
3170         * Modules/webgpu/WebGPUBufferDescriptor.idl: Added.
3171         * Modules/webgpu/WebGPUDevice.cpp:
3172         (WebCore::WebGPUDevice::createBuffer const): Added.
3173         * platform/graphics/gpu/GPUBuffer.h:
3174         (WebCore::GPUBuffer::platformBuffer const):
3175         (WebCore::GPUBuffer::mapping const):
3176         * platform/graphics/gpu/GPUBufferDescriptor.h: Added.
3177         * platform/graphics/gpu/GPUDevice.cpp:
3178         (WebCore::GPUDevice::createBuffer const): Added.
3179         * platform/graphics/gpu/GPUDevice.h:
3180         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added.
3181         (WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer. 
3182         (WebCore::GPUBuffer::GPUBuffer):
3183         (WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first.
3184
3185         Small benign edits, most to make nullability more consistent in WebGPU classes:
3186         * Modules/webgpu/WebGPUCommandBuffer.cpp:
3187         (WebCore::WebGPUCommandBuffer::create):
3188         (WebCore::WebGPUCommandBuffer::beginRenderPass):
3189         * Modules/webgpu/WebGPUCommandBuffer.h:
3190         * Modules/webgpu/WebGPUDevice.cpp:
3191         (WebCore::WebGPUDevice::create):
3192         (WebCore::WebGPUDevice::WebGPUDevice):
3193         (WebCore::WebGPUDevice::createShaderModule const):
3194         (WebCore::WebGPUDevice::createRenderPipeline const):
3195         (WebCore::WebGPUDevice::createCommandBuffer const):
3196         * Modules/webgpu/WebGPUDevice.h:
3197         (WebCore::WebGPUDevice::device const):
3198         * Modules/webgpu/WebGPUDevice.idl:
3199         * Modules/webgpu/WebGPUQueue.cpp:
3200         (WebCore::WebGPUQueue::create):
3201         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3202         (WebCore::WebGPURenderPassEncoder::create):
3203         * Modules/webgpu/WebGPURenderPassEncoder.h:
3204         * Modules/webgpu/WebGPUShaderModule.cpp:
3205         (WebCore::WebGPUShaderModule::create):
3206         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
3207         * Modules/webgpu/WebGPUShaderModule.h:
3208         (WebCore::WebGPUShaderModule::module const):
3209         * Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes.
3210         * Modules/webgpu/WebGPUTexture.cpp:
3211         (WebCore::WebGPUTexture::create):
3212         (WebCore::WebGPUTexture::createDefaultTextureView):
3213         * Modules/webgpu/WebGPUTextureView.cpp:
3214         (WebCore::WebGPUTextureView::create):
3215         * Modules/webgpu/WebGPUTextureView.h:
3216         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
3217         (WebCore::GPUQueue::create):
3218         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3219         (WebCore::GPURenderPipeline::create):
3220         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
3221         (WebCore::GPUShaderModule::create):
3222         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
3223         (WebCore::GPUSwapChain::setDevice):
3224         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
3225         (WebCore::GPUTexture::GPUTexture):
3226
3227 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
3228
3229         [Win][Clang] Fix warning -Wmissing-field-initializers
3230         https://bugs.webkit.org/show_bug.cgi?id=192584
3231
3232         Reviewed by Yusuke Suzuki.
3233
3234         Initialize a struct with '{ }' instead of '= {0}'.
3235
3236         No new tests, no behavior changes.
3237
3238         * platform/graphics/win/FontCacheWin.cpp:
3239         (WebCore::FontCache::lastResortFallbackFont):
3240         * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
3241         (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
3242         * platform/win/ClipboardUtilitiesWin.cpp:
3243         (WebCore::setFileDescriptorData):
3244         (WebCore::setFileContentData):
3245         (WebCore::setUCharData):
3246         (WebCore::setUtf8Data):
3247         (WebCore::setCFData):
3248         * platform/win/CursorWin.cpp:
3249         (WebCore::createSharedCursor):
3250         * platform/win/DefWndProcWindowClass.cpp:
3251         (WebCore::registerClass):
3252         * platform/win/DragImageWin.cpp:
3253         (WebCore::createDragImageIconForCachedImageFilename):
3254         * platform/win/PasteboardWin.cpp:
3255         (WebCore::writeURL):
3256         (WebCore::Pasteboard::writeString):
3257         (WebCore::Pasteboard::writeRangeToDataObject):
3258         (WebCore::Pasteboard::writePlainTextToDataObject):
3259         (WebCore::writeFileToDataObject):
3260         (WebCore::Pasteboard::writeMarkup):
3261         * platform/win/PopupMenuWin.cpp:
3262         (WebCore::PopupMenuWin::show):
3263         * platform/win/SSLKeyGeneratorWin.cpp:
3264         (WebCore::WebCore::signedPublicKeyAndChallengeString):
3265
3266 2018-12-11  Jer Noble  <jer.noble@apple.com>
3267
3268         Globally namespaced objects shouldn't use framework-prefixed names
3269         https://bugs.webkit.org/show_bug.cgi?id=192600
3270
3271         Reviewed by Eric Carlson.
3272
3273         Rename CMSampleBufferIs... -> isCMSampleBuffer...
3274
3275         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
3276         (WebCore::isCMSampleBufferRandomAccess):
3277         (WebCore::isCMSampleBufferNonDisplaying):
3278         (WebCore::MediaSampleAVFObjC::flags const):
3279         (WebCore::CMSampleBufferIsRandomAccess): Deleted.
3280         (WebCore::CMSampleBufferIsNonDisplaying): Deleted.
3281
3282 2018-12-11  Brent Fulgham  <bfulgham@apple.com>
3283
3284         Don't attempt to compute animated values when there is no relevant animation
3285         https://bugs.webkit.org/show_bug.cgi?id=192591
3286         <rdar://problem/34336946>
3287
3288         Reviewed by Dean Jackson.
3289
3290         Check if the property is supposed to be animated, or has animatable features, before
3291         attempting to calculate the current animated value.
3292
3293         Test: svg/animations/avoid-calculating-for-non-animating-elements.html
3294
3295         * svg/SVGAnimateElementBase.cpp:
3296         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
3297
3298 2018-12-11  Chris Dumez  <cdumez@apple.com>
3299
3300         Unreviewed, fix typos in console log from r239087.
3301
3302         * page/DOMWindow.cpp:
3303         (WebCore::DOMWindow::addEventListener):
3304
3305 2018-12-11  Tim Horton  <timothy_horton@apple.com>
3306
3307         WebCore shouldn't have a Objective-C class named NSCursor
3308         https://bugs.webkit.org/show_bug.cgi?id=192602
3309         <rdar://problem/46615532>
3310
3311         Reviewed by Wenson Hsieh.
3312
3313         * platform/ios/wak/WAKAppKitStubs.h:
3314         * platform/ios/wak/WAKAppKitStubs.m:
3315         (+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
3316         Get rid of the class.
3317         Also remove a comment that seems to have detached from wherever it's supposed to be.
3318
3319 2018-12-11  Chris Dumez  <cdumez@apple.com>
3320
3321         Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
3322         https://bugs.webkit.org/show_bug.cgi?id=192595
3323         <rdar://problem/46382603>
3324
3325         Reviewed by Dean Jackson.
3326
3327         Tests: http/tests/events/device-orientation-motion-non-secure-context.html
3328                http/tests/events/device-orientation-motion-secure-context.html
3329
3330         * page/DOMWindow.cpp:
3331         (WebCore::DOMWindow::addEventListener):
3332         * page/SecurityOrigin.h:
3333         (WebCore::SecurityOrigin::setIsPotentiallyTrustworthy):
3334         * testing/Internals.cpp:
3335         (WebCore::Internals::markContextAsInsecure):
3336         (WebCore::Internals::postTask):
3337         * testing/Internals.h:
3338         * testing/Internals.idl:
3339
3340 2018-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3341
3342         [iOS] Send the full list of file upload URLs and types in PasteboardItemInfo
3343         https://bugs.webkit.org/show_bug.cgi?id=192598
3344         Work towards <rdar://problem/35626913>
3345
3346         Reviewed by Tim Horton.
3347
3348         Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just
3349         a "preferred" file upload URL and type. See below for more details.
3350
3351         * platform/PasteboardItemInfo.h:
3352         (WebCore::PasteboardItemInfo::pathForContentType const):
3353
3354         Add a helper method to find a file upload URL corresponding to a given type.
3355
3356         (WebCore::PasteboardItemInfo::encode const):
3357         (WebCore::PasteboardItemInfo::decode):
3358
3359         Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`.
3360
3361         * platform/ios/AbstractPasteboard.h:
3362         * platform/ios/PasteboardIOS.mm:
3363         (WebCore::Pasteboard::readRespectingUTIFidelities):
3364
3365         Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`.
3366
3367         (WebCore::Pasteboard::readFilePaths):
3368         * platform/ios/PlatformPasteboardIOS.mm:
3369         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3370         * platform/ios/WebItemProviderPasteboard.h:
3371         * platform/ios/WebItemProviderPasteboard.mm:
3372         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
3373         (-[NSItemProvider web_fileUploadContentTypes]):
3374
3375         Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file
3376         upload content types (rather than just a `BOOL` indicating whether one or more of these types exist).
3377
3378         (-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]):
3379         (-[WebItemProviderPasteboard numberOfFiles]):
3380         (-[NSItemProvider web_containsFileUploadContent]): Deleted.
3381         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted.
3382
3383         Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest
3384         fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that
3385         shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal
3386         data serialization for an `NSURL` as a file on the web).
3387
3388         Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file
3389         uploads, and return all of these file types that we've loaded.
3390
3391 2018-12-11  Don Olmstead  <don.olmstead@sony.com>
3392
3393         Resource Load Statistics: Use common implementation within NetworkStorageSession
3394         https://bugs.webkit.org/show_bug.cgi?id=192592
3395
3396         Reviewed by Alex Christensen.
3397
3398         There's nothing within the resource load statistics implementation contained
3399         in NetworkStorageSessionCFNet that was CF specific. All of the resource load
3400         statistics methods are moved from that file to the root NetworkStorageSession
3401         implementation.
3402
3403         * platform/network/NetworkStorageSession.cpp:
3404         (WebCore::getPartitioningDomain):
3405         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
3406         (WebCore::NetworkStorageSession::shouldBlockCookies const):
3407         (WebCore::NetworkStorageSession::maxAgeCacheCap):
3408         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
3409         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
3410         (WebCore::NetworkStorageSession::removePrevalentDomains):
3411         (WebCore::NetworkStorageSession::hasStorageAccess const):
3412         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
3413         (WebCore::NetworkStorageSession::grantStorageAccess):
3414         (WebCore::NetworkStorageSession::removeStorageAccessForFrame):
3415         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
3416         (WebCore::NetworkStorageSession::removeAllStorageAccess):
3417         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
3418         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
3419         * platform/network/NetworkStorageSession.h:
3420         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3421         (WebCore::getPartitioningDomain): Deleted.
3422         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted.
3423         (WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted.
3424         (WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted.
3425         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted.
3426         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted.
3427         (WebCore::NetworkStorageSession::removePrevalentDomains): Deleted.
3428         (WebCore::NetworkStorageSession::hasStorageAccess const): Deleted.
3429         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted.
3430         (WebCore::NetworkStorageSession::grantStorageAccess): Deleted.
3431         (WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted.
3432         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
3433         (WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted.
3434         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted.
3435         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted.
3436
3437 2018-12-11  Devin Rousso  <drousso@apple.com>
3438
3439         Web Inspector: overlay bounds rulers don't match element when page is scrolled
3440         https://bugs.webkit.org/show_bug.cgi?id=192577
3441
3442         Reviewed by Joseph Pecoraro.
3443
3444         When drawing the highlight for a node, the canvas is translated based on the scroll position
3445         of the node. This translation was not applied to the bounds calculations, which meant that
3446         the bounds always drew where the node would have been if it wasn't scrolled.
3447
3448         * inspector/InspectorOverlayPage.js:
3449         (Bounds.prototype.get minX):
3450         (Bounds.prototype.get minY):
3451         (Bounds.prototype.get maxX):
3452         (Bounds.prototype.get maxY):
3453         (Bounds.prototype.offset): Added.
3454         (drawNodeHighlight):
3455         Drive-by: draw bounds for every node being highlighted instead of just the first one.
3456         Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast.
3457
3458 2018-12-11  Andy Estes  <aestes@apple.com>
3459
3460         Introduce makeBlockPtr for lambdas
3461         https://bugs.webkit.org/show_bug.cgi?id=192594
3462
3463         Reviewed by Alex Christensen.
3464
3465         Adopted makeBlockPtr.
3466
3467         * platform/cocoa/FileMonitorCocoa.mm:
3468         (WebCore::FileMonitor::FileMonitor):
3469         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
3470         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
3471         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm:
3472         (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
3473         * platform/network/cocoa/WebCoreNSURLSession.mm:
3474         (-[WebCoreNSURLSession addDelegateOperation:]):
3475         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
3476         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3477         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
3478
3479 2018-12-10  Brent Fulgham  <bfulgham@apple.com>
3480
3481         SVGViewSpec objects should mark relevant SVG elements
3482         https://bugs.webkit.org/show_bug.cgi?id=192567
3483         <rdar://problem/46491325>
3484
3485         Reviewed by Ryosuke Niwa.
3486
3487         SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to
3488         recognize the relevant SVGElement as active as long as the SVGViewSpec is active.
3489
3490         Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare
3491         pointer to the SVGElement, so switched to a WeakPtr.
3492
3493         Test: svg/animations/view-dependency-crash.html
3494
3495         * Sources.txt: Add new files.
3496         * WebCore.xcodeproj/project.pbxproj: Ditto.
3497         * bindings/js/JSSVGViewSpecCustom.cpp: Added.
3498         (WebCore::JSSVGViewSpec::visitAdditionalChildren):
3499         * svg/SVGElement.h:
3500         * svg/SVGPathElement.h:
3501         * svg/SVGViewSpec.cpp:
3502         (WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element.
3503         * svg/SVGViewSpec.h:
3504         * svg/SVGViewSpec.idl:
3505         * svg/properties/SVGAttributeOwnerProxy.cpp: Added.
3506         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to
3507         the underling SVGElement.
3508         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
3509         * svg/properties/SVGAttributeOwnerProxy.h:
3510         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file.
3511         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
3512         * svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use.
3513
3514 2018-12-10  Benjamin Poulain  <benjamin@webkit.org>
3515
3516         <rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading
3517         https://bugs.webkit.org/show_bug.cgi?id=192439
3518
3519         Reviewed by Dean Jackson.
3520
3521         This broken when WebKit switched to NSURLSession.
3522         In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW.
3523
3524         Test: http/tests/contentextensions/video-element-resource-type.html
3525
3526         * loader/ResourceLoadInfo.cpp:
3527         (WebCore::toResourceType):
3528
3529 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
3530
3531         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
3532         https://bugs.webkit.org/show_bug.cgi?id=192573
3533
3534         Reviewed by Simon Fraser.
3535
3536         * Configurations/FeatureDefines.xcconfig:
3537
3538 2018-12-10  Justin Michaud  <justin_michaud@apple.com>
3539
3540         CS Painting API should support multiple worklets.
3541         https://bugs.webkit.org/show_bug.cgi?id=192335
3542
3543         Reviewed by Dean Jackson.
3544
3545         Adds a new map to support separate paint worklet global scopes (one for each worklet). Also
3546         adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required
3547         for paint would not trigger a repaint if there had not been a valid value set before.
3548
3549         Test: fast/css-custom-paint/multiple-worklets.html
3550
3551         * css/CSSPaintImageValue.cpp:
3552         (WebCore::CSSPaintImageValue::image):
3553         * css/StyleResolver.cpp:
3554         (WebCore::StyleResolver::applyProperty):
3555         * dom/Document.cpp:
3556         (WebCore::Document::prepareForDestruction):
3557         (WebCore::Document::paintWorkletGlobalScope):
3558         (WebCore::Document::setPaintWorkletGlobalScope):
3559         * dom/Document.h:
3560         (WebCore::Document::paintWorkletGlobalScope): Deleted.
3561         * rendering/style/RenderStyle.cpp:
3562         (WebCore::changedCustomPaintWatchedProperty):
3563         * worklets/Worklet.cpp:
3564         (WebCore::Worklet::addModule):
3565         * worklets/WorkletGlobalScope.cpp:
3566         (WebCore::WorkletGlobalScope::prepareForDestruction):
3567
3568 2018-12-10  Youenn Fablet  <youenn@apple.com>
3569
3570         Remove derived classes of RealtimeMediaSourceCenter
3571         https://bugs.webkit.org/show_bug.cgi?id=192546
3572
3573         Reviewed by Eric Carlson.
3574
3575         Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it.
3576         Instead port specific implementation directly implement the needed default factory methods.
3577
3578         Renamed some methods for improved consistency.
3579         Moved some static variables as RealtimeMediaSourceCenter members.
3580
3581         No change of behavior.
3582
3583         * WebCore.xcodeproj/project.pbxproj:
3584         * page/DeprecatedGlobalSettings.cpp:
3585         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3586         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
3587         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
3588         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
3589         (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState):
3590         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
3591         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
3592         (WebCore::RealtimeMediaSourceCenter::audioCaptureFactory):
3593         (WebCore::RealtimeMediaSourceCenter::setVideoFactory):
3594         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
3595         (WebCore::RealtimeMediaSourceCenter::videoCaptureFactory):
3596         (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
3597         (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
3598         (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
3599         * platform/mediastream/RealtimeMediaSourceCenter.h:
3600         * platform/mediastream/RealtimeVideoSource.cpp:
3601         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
3602         (WebCore::RealtimeVideoSource::prepareToProduceData):
3603         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
3604         (WebCore::RealtimeMediaSourceCenter::singleton):
3605         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
3606         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
3607         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
3608         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed.
3609         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3610         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
3611         (WebCore::AVVideoCaptureSource::setupCaptureSession):
3612         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3613         (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
3614         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
3615         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3616         (WebCore::RealtimeMediaSourceCenter::singleton):
3617         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
3618         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
3619         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
3620         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed.
3621         * platform/mock/MockRealtimeAudioSource.cpp:
3622         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
3623         (WebCore::MockRealtimeAudioSource::startProducingData):
3624         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3625         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
3626         (WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory):
3627         (WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory):
3628         * platform/mock/MockRealtimeMediaSourceCenter.h:
3629
3630 2018-12-10  Youenn Fablet  <youenn@apple.com>
3631
3632         DataChannels created asynchronously never open and are unusable
3633         https://bugs.webkit.org/show_bug.cgi?id=192566
3634
3635         Reviewed by Eric Carlson.
3636
3637         For every new data channel (remote or local), we should check the underlying backend state.
3638         This allows firing events if needed.
3639         We were not always doing that which was prohibiting sending some open
3640         events for data channels created after the SCTP connection is set up.
3641
3642         Covered by updated test.
3643
3644         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
3645         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
3646         (WebCore::LibWebRTCDataChannelHandler::setClient):
3647         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
3648         (WebCore::LibWebRTCDataChannelHandler::checkState):
3649         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
3650
3651 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
3652
3653         Use WeakPtr to refer to VTTCue in VTTCueBox
3654         https://bugs.webkit.org/show_bug.cgi?id=192575
3655
3656         Reviewed by Eric Carlson.
3657
3658         Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away.
3659         This is implemented by simply using WeakPtr.
3660
3661         No new tests since there shoul be no behaivoral change.
3662
3663         * html/track/TextTrackCueGeneric.cpp:
3664         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
3665         * html/track/VTTCue.cpp:
3666         (WebCore::VTTCueBox::VTTCueBox):
3667         (WebCore::VTTCueBox::getCue const):
3668         (WebCore::VTTCueBox::applyCSSProperties):
3669         (WebCore::VTTCue::~VTTCue):
3670         * html/track/VTTCue.h:
3671         (WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const):
3672
3673 2018-12-10  Mark Lam  <mark.lam@apple.com>
3674
3675         PropertyAttribute needs a CustomValue bit.
3676         https://bugs.webkit.org/show_bug.cgi?id=191993
3677         <rdar://problem/46264467>
3678
3679         Reviewed by Saam Barati.
3680
3681         This patch revealed a bug in the CodeGenerator where a constructor property is
3682         set with a ReadOnly attribute.  This conflicts with the WebIDL link (see clause
3683         12 in https://heycam.github.io/webidl/#interface-prototype-object) which states
3684         that it should be [Writable].  The ReadOnly attribute is now removed.
3685
3686         On the WebCore side, this change is covered by existing tests.
3687
3688         * bindings/scripts/CodeGeneratorJS.pm:
3689         (GenerateImplementation):
3690         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3691         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
3692
3693 2018-12-10  Antti Koivisto  <antti@apple.com>
3694
3695         Rename "forced style recalc" to "full style rebuild"
3696         https://bugs.webkit.org/show_bug.cgi?id=192572
3697
3698         Reviewed by Zalan Bujtas.
3699
3700         The old name is confusing.
3701
3702         * css/CSSComputedStyleDeclaration.cpp:
3703         (WebCore::hasValidStyleForProperty):
3704         * dom/Document.cpp:
3705         (WebCore::Document::scheduleStyleRebuild):
3706         (WebCore::Document::scheduleStyleRecalc):
3707         (WebCore::Document::unscheduleStyleRecalc):
3708         (WebCore::Document::hasPendingStyleRebuild const):
3709         (WebCore::Document::resolveStyle):
3710         (WebCore::Document::needsStyleRecalc const):
3711         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
3712         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
3713         (WebCore::Document::setDesignMode):
3714         (WebCore::Document::webkitDidExitFullScreenForElement):
3715         (WebCore::Document::setAnimatingFullScreen):
3716         (WebCore::Document::setFullscreenControlsHidden):
3717         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
3718         (WebCore::Document::hasPendingForcedStyleRecalc const): Deleted.
3719         * dom/Document.h:
3720         * dom/Element.cpp:
3721         (WebCore::Element::needsStyleInvalidation const):
3722         * page/Page.cpp:
3723         (WebCore::Page::updateStyleAfterChangeInEnvironment):
3724         * style/StyleScope.cpp:
3725         (WebCore::Style::Scope::updateActiveStyleSheets):
3726
3727 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
3728
3729         Include CoreGraphics.h from WebCorePrefix.h
3730         https://bugs.webkit.org/show_bug.cgi?id=192557
3731
3732         Reviewed by Tim Horton.
3733
3734         The theory is that this will improve build time. Let's try and see what bots say.
3735
3736         * WebCorePrefix.h:
3737
3738 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3739
3740         [iOS] Unable to upload data that conforms to "public.item" but not "public.content"
3741         https://bugs.webkit.org/show_bug.cgi?id=192555
3742         <rdar://problem/35204990>
3743
3744         Reviewed by Tim Horton.
3745
3746         Add support for uploading content that conforms to "public.item" via drag and drop. Currently, iOS WebKit only
3747         supports data that conforms to "public.content", but there exist several types of files that conform to
3748         "public.item" but not "public.content". See below for more detail.
3749
3750         Test: DragAndDropTests.ExternalSourcePKCS12ToSingleFileInput
3751
3752         * platform/ios/PasteboardIOS.mm:
3753         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
3754
3755         Update this to include "public.item", and remove "public.folder", which is now redundant because "public.folder"
3756         conforms to "public.item".
3757
3758         * platform/ios/WebItemProviderPasteboard.mm:
3759         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
3760
3761         Pull out the "contains content that is supported for file uploads" part of this helper method into a separate
3762         method, and use it within `-web_containsFileURLAndFileUploadContent`. Note that this prevents "public.url"-
3763         conformant data from being uploaded as files (i.e., we never want to upload a URL string *itself* as a file).
3764         Drawing this distinction ensures that we don't confuse item providers that contain just a URL as files when
3765         dropping into a file upload area or file input (see API test: ExternalSourceZIPArchiveAndURLToSingleFileInput
3766         for an example of this corner case).
3767
3768         (-[NSItemProvider web_containsFileUploadContent]):
3769         (-[WebItemProviderPasteboard numberOfFiles]):
3770
3771         Refactor this to use `-web_containsFileUploadContent`.
3772
3773 2018-12-10  Chris Dumez  <cdumez@apple.com>
3774
3775         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
3776         https://bugs.webkit.org/show_bug.cgi?id=192509
3777         <rdar://problem/46500832>
3778
3779         Reviewed by Alex Christensen.
3780
3781         * loader/DocumentLoader.h:
3782         (WebCore::DocumentLoader::setCustomUserAgent):
3783         (WebCore::DocumentLoader::customUserAgent const):
3784         * loader/FrameLoader.cpp:
3785         (WebCore::FrameLoader::userAgent const):
3786
3787 2018-12-10  Adrian Perez de Castro  <aperez@igalia.com>
3788
3789         [GLib] FileSystem::moveFile() should fall back to copying
3790         https://bugs.webkit.org/show_bug.cgi?id=192562
3791
3792         Reviewed by Michael Catanzaro.
3793
3794         No new tests needed.
3795
3796         * platform/glib/FileSystemGlib.cpp:
3797         (WebCore::FileSystem::moveFile): Use g_file_move() instead of a plain g_rename(), which
3798         provides a fall-back which does copy+delete when a direct move or rename cannot be done.
3799
3800 2018-12-10  Simon Fraser  <simon.fraser@apple.com>
3801
3802         Allow control over child order when adding nodes to the scrolling tree
3803         https://bugs.webkit.org/show_bug.cgi?id=176914
3804         <rdar://problem/46542237>
3805         
3806         Re-land r239010 after over-zealous rollout.
3807
3808         * page/scrolling/AsyncScrollingCoordinator.cpp:
3809         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
3810         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
3811         * page/scrolling/AsyncScrollingCoordinator.h:
3812         * page/scrolling/ScrollingCoordinator.h:
3813         (WebCore::ScrollingCoordinator::attachToStateTree):
3814         * page/scrolling/ScrollingStateNode.cpp:
3815         (WebCore::ScrollingStateNode::insertChild):
3816         (WebCore::ScrollingStateNode::indexOfChild const):
3817         * page/scrolling/ScrollingStateNode.h:
3818         * page/scrolling/ScrollingStateTree.cpp:
3819         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
3820         (WebCore::ScrollingStateTree::attachNode):
3821         * page/scrolling/ScrollingStateTree.h:
3822
3823 2018-12-10  Antti Koivisto  <antti@apple.com>
3824
3825         Document should throttle style recalc even when m_pendingStyleRecalcShouldForce is true.
3826         https://bugs.webkit.org/show_bug.cgi?id=191695
3827
3828         Reviewed by Zalan Bujtas.
3829
3830         * dom/Document.cpp:
3831         (WebCore::Document::scheduleStyleRecalc):
3832
3833         Don't test for m_pendingStyleRecalcShouldForce.
3834
3835         (WebCore::Document::hasPendingStyleRecalc const):
3836         (WebCore::Document::hasPendingForcedStyleRecalc const):
3837
3838         Don't base the pending status of these function on whether the timer is running.
3839         Instead check if the style is invalid.
3840
3841 2018-12-10  Rob Buis  <rbuis@igalia.com>
3842
3843         XMLHttpRequest removes spaces from content-types before processing
3844         https://bugs.webkit.org/show_bug.cgi?id=8644
3845
3846         Reviewed by Chris Dumez.
3847
3848         Stop trimming white space characters from the middle of
3849         type/subtype value. Also make sure whitespace being parsed
3850         adheres to OWS definition from RFC 7230 Section 3.2.3
3851         (referenced by RFC 7231), i.e. space or HT.
3852
3853         Based on http://crrev.com/416586.
3854
3855         Behavior matches Firefox and Chrome.
3856
3857         Tests: http/tests/xmlhttprequest/supported-xml-content-types.html
3858                web-platform-tests/mimesniff/mime-types/parsing.any.html
3859                web-platform-tests/mimesniff/mime-types/parsing.any.worker.html
3860
3861         * platform/network/HTTPParsers.cpp:
3862         (WebCore::extractMIMETypeFromMediaType):
3863
3864 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3865
3866         [iOS] Caret is obscured by finger when dragging over an editable element
3867         https://bugs.webkit.org/show_bug.cgi?id=192499
3868         <rdar://problem/46570101>
3869
3870         Reviewed by Tim Horton.
3871
3872         * page/DragActions.h:
3873
3874         Move DragHandlingMethod to DragActions.h, and drive-by fix some minor issues (i.e. make a couple of enum classes
3875         use 8 bits, fix the indentation levels, and update the copyright year). Also add `EnumTraits` for
3876         DragHandlingMethod so that it may be encoded over IPC.
3877
3878         * page/DragController.cpp:
3879         (WebCore::dragIsHandledByDocument):
3880
3881         Simplify this helper function.
3882
3883         (WebCore::DragController::tryDocumentDrag):
3884         * page/DragController.h:
3885
3886         Expose the current DragHandlingMethod via a const getter method.
3887
3888         (WebCore::DragController::dragHandlingMethod const):
3889
3890 2018-12-10  Youenn Fablet  <youenn@apple.com>
3891
3892         Make mock capture happen in the process used for real capture
3893         https://bugs.webkit.org/show_bug.cgi?id=192544
3894
3895         Reviewed by Eric Carlson.
3896
3897         MockRealtimeMediaSourceCenter previously was setting its factories whenever mock capture is on.
3898         Add booleans to choose which source (audio, video, display) will actually be toggled on.
3899
3900         Covered by existing tests.
3901
3902         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3903         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
3904         * platform/mock/MockRealtimeMediaSourceCenter.h:
3905         (WebCore::MockRealtimeMediaSourceCenter::setMockAudioCaptureEnabled):
3906         (WebCore::MockRealtimeMediaSourceCenter::setMockVideoCaptureEnabled):
3907         (WebCore::MockRealtimeMediaSourceCenter::setMockDisplayCaptureEnabled):
3908
3909 2018-12-10  Dean Jackson  <dino@apple.com>
3910
3911         Use text/javascript as recommended by the HTML specification
3912         https://bugs.webkit.org/show_bug.cgi?id=192525
3913         <rdar://problem/46569636>
3914
3915         Reviewed by Jon Lee.
3916
3917         The HTML specification says we should use text/javascript for
3918         JavaScript files:
3919         https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type
3920
3921         * loader/cache/CachedScript.cpp: Replace application/javascript with text/javascript.
3922         (WebCore::CachedScript::CachedScript):
3923         * platform/network/ios/WebCoreURLResponseIOS.mm: Ditto.
3924         (WebCore::createExtensionToMIMETypeMap):
3925         * platform/network/mac/WebCoreURLResponse.mm: Ditto.
3926         (WebCore::createExtensionToMIMETypeMap):
3927
3928 2018-12-10  Dean Jackson  <dino@apple.com>
3929
3930         [iOS] Make WebGPU work with remote layer hosting
3931         https://bugs.webkit.org/show_bug.cgi?id=192508
3932         <rdar://problem/46560649>
3933
3934         Reviewed by Tim Horton.
3935
3936         WebGPU wasn't working on iOS because we were not correctly
3937         identifying the CALayers for remote hosting. Fix this by
3938         adding a new CALayer type, WebGPULayer. This will also
3939         eventually hold the code to render WebGPU into a canvas.
3940
3941         Covered by the existing reference tests (on device).
3942
3943         * SourcesCocoa.txt: Add new files.
3944         * WebCore.xcodeproj/project.pbxproj: Ditto.
3945
3946         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
3947         class for remote hosting.
3948         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
3949         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
3950
3951         * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
3952         from CAMetalLayer.
3953         * platform/graphics/cocoa/WebGPULayer.mm: Added.
3954         (-[WebGPULayer init]):
3955         (-[WebGPULayer copyImageSnapshotWithColorSpace:]):
3956
3957         * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
3958         than CALayer.
3959
3960         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
3961         the WebGPULayer has a reference back to this object, which it
3962         will use in the future.
3963         (WebCore::GPUSwapChain::create):
3964         (WebCore::GPUSwapChain::GPUSwapChain):
3965
3966 2018-12-10  Truitt Savell  <tsavell@apple.com>
3967
3968         Unreviewed, rolling out r238965.
3969
3970         Caused internal iOS build failures
3971
3972         Reverted changeset:
3973
3974         "[iOS] Make WebGPU work with remote layer hosting"
3975         https://bugs.webkit.org/show_bug.cgi?id=192508
3976         https://trac.webkit.org/changeset/238965
3977
3978 2018-12-10  Youenn&n