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