[WebAuthN] Import CTAP HID message and packet structure from Chromium
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-10-09  Jiewen Tan  <jiewen_tan@apple.com>
2
3         [WebAuthN] Import CTAP HID message and packet structure from Chromium
4         https://bugs.webkit.org/show_bug.cgi?id=189289
5         <rdar://problem/44120310>
6
7         Reviewed by Brent Fulgham.
8
9         This patch imports CTAP HID message and packet structure:
10         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-and-packet-structure
11         from Chromium. With this library, WebKit can now turn binaries into messages that CTAP devices could understand.
12         This patch contains the following Chromium files and modifies them to fit into WebKit:
13         https://cs.chromium.org/chromium/src/device/fido/fido_constants.cc?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
14         https://cs.chromium.org/chromium/src/device/fido/fido_constants.h?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
15         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.cc?l=1&rcl=387f3725de2842e0e6b7175a9b2ed472b0cf781a
16         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
17         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
18         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
19         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message_unittest.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
20
21         Covered by API tests.
22
23         * Modules/webauthn/fido/FidoConstants.cpp: Added.
24         (fido::isFidoHidDeviceCommand):
25         * Modules/webauthn/fido/FidoConstants.h: Added.
26         * Modules/webauthn/fido/FidoHidMessage.cpp: Added.
27         (fido::FidoHidMessage::create):
28         (fido::FidoHidMessage::createFromSerializedData):
29         (fido::FidoHidMessage::messageComplete const):
30         (fido::FidoHidMessage::getMessagePayload const):
31         (fido::FidoHidMessage::popNextPacket):
32         (fido::FidoHidMessage::addContinuationPacket):
33         (fido::FidoHidMessage::numPackets const):
34         (fido::FidoHidMessage::FidoHidMessage):
35         * Modules/webauthn/fido/FidoHidMessage.h: Added.
36         * Modules/webauthn/fido/FidoHidPacket.cpp: Added.
37         (fido::FidoHidPacket::FidoHidPacket):
38         (fido::FidoHidInitPacket::createFromSerializedData):
39         (fido::FidoHidInitPacket::FidoHidInitPacket):
40         (fido::FidoHidInitPacket::getSerializedData const):
41         (fido::FidoHidContinuationPacket::createFromSerializedData):
42         (fido::FidoHidContinuationPacket::FidoHidContinuationPacket):
43         (fido::FidoHidContinuationPacket::getSerializedData const):
44         * Modules/webauthn/fido/FidoHidPacket.h: Added.
45         * Modules/webauthn/fido/FidoParsingUtils.cpp: Added.
46         (fido::getInitPacketData):
47         (fido::getContinuationPacketData):
48         * Modules/webauthn/fido/FidoParsingUtils.h: Added.
49         * Sources.txt:
50         * WebCore.xcodeproj/project.pbxproj:
51
52 2018-10-09  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
53
54         [CoordGraphics] Remove the 'previous backing store' logic
55         https://bugs.webkit.org/show_bug.cgi?id=188838
56
57         Reviewed by Žan Doberšek.
58
59         Remove previousBackingStore from LayerState, since it's not needed anymore.
60         When there is scale adjustment, we now simply discard mainBackingStore and
61         recreate a new one.
62
63         No new tests required.
64
65         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h:
66         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
67         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
68         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
69         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
70
71 2018-10-09  Antti Koivisto  <antti@apple.com>
72
73         [PSON] Prewarm system UI font
74         https://bugs.webkit.org/show_bug.cgi?id=190397
75
76         Reviewed by Geoffrey Garen.
77
78         Cache system UI font fallbacks. Almost every web process needs these.
79
80         * page/ProcessWarming.cpp:
81         (WebCore::ProcessWarming::prewarmGlobally):
82
83 2018-10-09  Chris Dumez  <cdumez@apple.com>
84
85         REGRESSION (Safari 12): Download of Blob URL fails
86         https://bugs.webkit.org/show_bug.cgi?id=190351
87         <rdar://problem/45091181>
88
89         Reviewed by Geoffrey Garen.
90
91         When using both the download attribute and target="_blank" on an anchor element, we would
92         mistakenly drop the download attribute after the "new window" policy decision has been made.
93         As a result, we would try to load the blob instead of downloading it.
94
95         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html
96
97         * loader/FrameLoader.cpp:
98         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
99
100 2018-10-09  Alicia Boya García  <aboya@igalia.com>
101
102         [MSE][GStreamer] r236735 has some dead ASSERTs that need to be moved
103         https://bugs.webkit.org/show_bug.cgi?id=190394
104
105         Reviewed by Xabier Rodriguez-Calvar.
106
107         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
108         (WebCore::createOptionalParserForFormat):
109
110 2018-10-09  Chris Dumez  <cdumez@apple.com>
111
112         Have DOMWindow get its frame from its document
113         https://bugs.webkit.org/show_bug.cgi?id=190389
114
115         Reviewed by Geoff Garen.
116
117         Have DOMWindow get its frame from its document instead of having its own m_frame which can potentially
118         be out-of-sync.
119
120         * dom/Document.cpp:
121         (WebCore::Document::frameDestroyed):
122         (WebCore::Document::willDetachPage):
123         (WebCore::Document::attachToCachedFrame):
124         * dom/Document.h:
125         * page/DOMWindow.cpp:
126         (WebCore::DOMWindow::allowPopUp):
127         (WebCore::ContextDestructionObserver):
128         (WebCore::DOMWindow::didSecureTransitionTo):
129         (WebCore::DOMWindow::frameDestroyed):
130         (WebCore::DOMWindow::willDetachDocumentFromFrame):
131         (WebCore::DOMWindow::reconnectDOMWindowProperties):
132         (WebCore::DOMWindow::isCurrentlyDisplayedInFrame const):
133         (WebCore::DOMWindow::collectMatchingElementsInFlatTree):
134         (WebCore::DOMWindow::matchingElementInFlatTree):
135         (WebCore::DOMWindow::orientation const):
136         (WebCore::DOMWindow::console const):
137         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
138         (WebCore::DOMWindow::webkitNamespace):
139         (WebCore::DOMWindow::postMessage):
140         (WebCore::DOMWindow::postMessageTimerFired):
141         (WebCore::DOMWindow::frameElement const):
142         (WebCore::DOMWindow::focus):
143         (WebCore::DOMWindow::blur):
144         (WebCore::DOMWindow::close):
145         (WebCore::DOMWindow::print):
146         (WebCore::DOMWindow::stop):
147         (WebCore::DOMWindow::alert):
148         (WebCore::DOMWindow::confirm):
149         (WebCore::DOMWindow::prompt):
150         (WebCore::DOMWindow::find const):
151         (WebCore::DOMWindow::outerHeight const):
152         (WebCore::DOMWindow::outerWidth const):
153         (WebCore::DOMWindow::innerHeight const):
154         (WebCore::DOMWindow::innerWidth const):
155         (WebCore::DOMWindow::screenX const):
156         (WebCore::DOMWindow::screenY const):
157         (WebCore::DOMWindow::scrollX const):
158         (WebCore::DOMWindow::scrollY const):
159         (WebCore::DOMWindow::closed const):
160         (WebCore::DOMWindow::length const):
161         (WebCore::DOMWindow::name const):
162         (WebCore::DOMWindow::setName):
163         (WebCore::DOMWindow::setStatus):
164         (WebCore::DOMWindow::setDefaultStatus):
165         (WebCore::DOMWindow::self const):
166         (WebCore::DOMWindow::opener const):
167         (WebCore::DOMWindow::disownOpener):
168         (WebCore::DOMWindow::parent const):
169         (WebCore::DOMWindow::top const):
170         (WebCore::DOMWindow::getMatchedCSSRules const):
171         (WebCore::DOMWindow::devicePixelRatio const):
172         (WebCore::DOMWindow::scrollBy const):
173         (WebCore::DOMWindow::scrollTo const):
174         (WebCore::DOMWindow::allowedToChangeWindowGeometry const):
175         (WebCore::DOMWindow::moveBy const):
176         (WebCore::DOMWindow::moveTo const):
177         (WebCore::DOMWindow::resizeBy const):
178         (WebCore::DOMWindow::resizeTo const):
179         (WebCore::DOMWindow::clearTimeout):
180         (WebCore::DOMWindow::isSameSecurityOriginAsMainFrame const):
181         (WebCore::DOMWindow::finishedLoading):
182         (WebCore::DOMWindow::setLocation):
183         (WebCore::DOMWindow::open):
184         (WebCore::DOMWindow::showModalDialog):
185         (WebCore::DOMWindow::frame const):
186         (WebCore::FrameDestructionObserver): Deleted.
187         (WebCore::DOMWindow::willDetachPage): Deleted.
188         (WebCore::DOMWindow::detachFromFrame): Deleted.
189         (WebCore::DOMWindow::attachToFrame): Deleted.
190         * page/DOMWindow.h:
191
192 2018-10-09  Jer Noble  <jer.noble@apple.com>
193
194         ISOTrackEncryptionBox returns incorrect defaultKeyID
195         https://bugs.webkit.org/show_bug.cgi?id=190368
196
197         Reviewed by Eric Carlson.
198
199         Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
200
201         ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
202
203         Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
204
205         * WebCore.xcodeproj/project.pbxproj:
206         * platform/graphics/iso/ISOBox.h:
207         * platform/graphics/iso/ISOOriginalFormatBox.h:
208         * platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
209         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
210         * platform/graphics/iso/ISOSchemeInformationBox.h:
211         * platform/graphics/iso/ISOSchemeTypeBox.h:
212         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
213         (WebCore::ISOTrackEncryptionBox::parse):
214         * platform/graphics/iso/ISOTrackEncryptionBox.h:
215
216 2018-10-09  Youenn Fablet  <youenn@apple.com>
217
218         Add support for IceCandidate stats
219         https://bugs.webkit.org/show_bug.cgi?id=190329
220
221         Reviewed by Eric Carlson.
222
223         Convert IceCandidate stats gathered by libwebrtc.
224         Since networkType might be sensitive information, we currently do not expose it.
225         We do not expose address either if it is a host or prflx candidate.
226
227         Test: webrtc/candidate-stats.html
228
229         * Modules/mediastream/RTCStatsReport.h:
230         * Modules/mediastream/RTCStatsReport.idl:
231         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
232         (WebCore::iceCandidateState):
233         (WebCore::fillRTCIceCandidateStats):
234         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
235
236 2018-10-09  Philippe Normand  <pnormand@igalia.com>
237
238         [GStreamer] Stealing cross-origin video pixel with HLS
239         https://bugs.webkit.org/show_bug.cgi?id=190003
240
241         Reviewed by Xabier Rodriguez-Calvar.
242
243         Report the SecurityOrigin of downloaded adaptivedemux (HLS, DASH,
244         SmoothStreaming) fragments as tainted if their origin differs from
245         the manifest SecurityOrigin. SecurityOrigins are stored in the
246         CachedResourceStreamingClient implemented in the internal
247         GStreamer HTTP(S) source element.
248
249         The implementation is not ideal yet because the fragments download
250         is performed by the WebProcess, until bug 189967 is fixed. When
251         this bug is fixed, the m_hasTaintedOrigin member variable should
252         be removed and all checks be done unconditionally to the
253         webkithttpsrc element which will manage the download of the
254         manifests and fragments.
255
256         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
257         (WebCore::MediaPlayerPrivateGStreamer::loadFull): Reset the m_hasTaintedOrigin value.
258         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Get the
259         fragment URL from the adaptivedemux stats message and check if its
260         origin is tainted.
261         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
262         Initial implementation by checking the m_hasTaintedOrigin member
263         variable value.
264         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
265         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
266         (CachedResourceStreamingClient::responseReceived): Store the
267         resource origin internally so it can be checked later on by
268         webKitSrtcWouldTaintOrigin().
269         (webKitSrcWouldTaintOrigin): Check given origin against cached
270         origins. This implementation is similar to Cocoa's
271         WebCoreNSURLSession implementation.
272         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
273
274 2018-10-09  Antti Koivisto  <antti@apple.com>
275
276         Prewarm FontDatabase on process swap
277         https://bugs.webkit.org/show_bug.cgi?id=190312
278
279         Reviewed by Chris Dumez.
280
281         Implement basic prewarming of FontDatabase. When the domain of the first page load on
282         a new process is known we pass the list of font families previous used by that domain to the
283         process. This is used to prewarm CoreText font database. Initialization (which involves lots of
284         blocking IPC) happens outside the main thread so the fonts are ready to use when needed.
285
286         * WebCore.xcodeproj/project.pbxproj:
287         * page/PrewarmInformation.h: Added.
288         (WebCore::PrewarmInformation::encode const):
289         (WebCore::PrewarmInformation::decode):
290
291         Add data structure for prewarm information with encode/decode support.
292
293         * page/ProcessWarming.cpp:
294         (WebCore::ProcessWarming::collectPrewarmInformation):
295         (WebCore::ProcessWarming::prewarmWithInformation):
296
297         Prewarming interface to be used from WebKit.
298
299         * page/ProcessWarming.h:
300         * platform/graphics/FontCache.cpp:
301         (WebCore::FontCache::collectPrewarmInformation const):
302         (WebCore::FontCache::prewarm):
303         * platform/graphics/FontCache.h:
304         * platform/graphics/cocoa/FontCacheCoreText.cpp:
305         (WebCore::FontDatabase::collectionForFamily):
306         (WebCore::FontDatabase::fontForPostScriptName):
307         (WebCore::FontDatabase::clear):
308
309         Add mutex for thread safe access.
310
311         (WebCore::FontCache::createFontPlatformData):
312         (WebCore::FontCache::collectPrewarmInformation const):
313
314         Collect font families seen by this process.
315
316         (WebCore::FontCache::prewarm):
317
318         Prewarm FontDatabase in a dispatch queue.
319
320 2018-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
321
322         [Cocoa] [WK2] Add support for text alignment and text lists in font attributes
323         https://bugs.webkit.org/show_bug.cgi?id=190342
324         <rdar://problem/44767118>
325
326         Reviewed by Tim Horton.
327
328         Adds support for computing and encoding information about text alignment and enclosing list elements in the font
329         attributes dictionary, exposed to the UI delegate on Cocoa platforms. This is exposed through NSParagraphStyle,
330         which contains properties for both `NSTextAlignment` and an array of enclosing `NSTextList` objects.
331
332         Test:   FontAttributes.NestedTextListsWithHorizontalAlignment
333                 FontAttributes.FontAttributesAfterChangingSelection
334
335         * editing/Editor.cpp:
336         (WebCore::editableTextListsAtPositionInDescendingOrder):
337
338         Add a helper function to ascend the DOM, starting at the given position, in search of enclosing list elements.
339         For each enclosing list element we find within the scope of the editable root, we create a `TextList`
340         representing the list element.
341
342         (WebCore::Editor::fontAttributesAtSelectionStart const):
343
344         Compute and set enclosing text lists and text alignment. For text alignment, we convert the initial text-align
345         value, `start`, to NSTextAlignmentNatural (the default text alignment type on Cocoa platforms); other values
346         then map to Left, Right, Center, and Justified as expected (taking direction into account).
347
348         * editing/FontAttributes.h:
349         (WebCore::TextList::encode const):
350         (WebCore::TextList::decode):
351
352         Introduce TextList, a platform-agnostic representation of an unordered or ordered list. On Cocoa, this can be
353         used to construct a corresponding NSTextList.
354
355         * editing/cocoa/FontAttributesCocoa.mm:
356         (WebCore::cocoaTextListMarkerName):
357
358         Attempt to map a WebCore list style type to a `NSTextListMarker*` constant. While most of the Cocoa marker
359         formats have a corresponding web-exposed list style type, many web-exposed types have no Cocoa equivalent; as
360         such, fall back to default marker formats: "{disc}" for unordered lists and "{decimal}" for ordered lists.
361
362         (WebCore::TextList::createTextList const):
363         (WebCore::FontAttributes::createDictionary const):
364
365         Include an NSParagraphStyle in the dictionary of font attributes that includes information about text alignment
366         and enclosing text lists (per Cocoa convention, in order from outermost list to innermost list).
367
368 2018-10-08  Justin Fan  <justin_fan@apple.com>
369
370         WebGPU: Rename old WebGPU prototype to WebMetal
371         https://bugs.webkit.org/show_bug.cgi?id=190325
372         <rdar://problem/44990443>
373
374         Reviewed by Dean Jackson.
375
376         Existing WebGPU tests also renamed to reflect WebGPU -> WebMetal change.
377
378         Rename WebGPU prototype files to WebMetal in preparation for implementing the new (Oct 2018) WebGPU interface.
379
380         * CMakeLists.txt:
381         * Configurations/FeatureDefines.xcconfig:
382         * DerivedSources.make:
383         * Sources.txt:
384         * SourcesCocoa.txt:
385         * WebCore.xcodeproj/project.pbxproj:
386         * bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp.
387         (WebCore::toJSNewlyCreated):
388         (WebCore::toJS):
389         * bindings/js/JSWebMetalRenderingContextCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderingContextCustom.cpp.
390         (WebCore::JSWebMetalRenderingContext::visitAdditionalChildren):
391         * bindings/js/WebCoreBuiltinNames.h:
392         * dom/Document.cpp:
393         (WebCore::Document::getCSSCanvasContext):
394         * dom/Document.h:
395         * dom/Document.idl:
396         * html/HTMLCanvasElement.cpp:
397         (WebCore::HTMLCanvasElement::getContext):
398         (WebCore::HTMLCanvasElement::isWebMetalType):
399         (WebCore::HTMLCanvasElement::createContextWebMetal):
400         (WebCore::HTMLCanvasElement::getContextWebMetal):
401         (WebCore::HTMLCanvasElement::isWebGPUType): Deleted.
402         (WebCore::HTMLCanvasElement::createContextWebGPU): Deleted.
403         (WebCore::HTMLCanvasElement::getContextWebGPU): Deleted.
404         * html/HTMLCanvasElement.h:
405         * html/HTMLCanvasElement.idl:
406         * html/canvas/CanvasRenderingContext.h:
407         (WebCore::CanvasRenderingContext::isWebMetal const):
408         (WebCore::CanvasRenderingContext::isWebGPU const): Deleted.
409         * html/canvas/WebGPURenderingContext.cpp: Removed.
410         * html/canvas/WebMetalBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.cpp.
411         (WebCore::WebMetalBuffer::create):
412         (WebCore::WebMetalBuffer::WebMetalBuffer):
413         * html/canvas/WebMetalBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.h.
414         * html/canvas/WebMetalBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.idl.
415         * html/canvas/WebMetalCommandBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.cpp.
416         (WebCore::WebMetalCommandBuffer::create):
417         (WebCore::WebMetalCommandBuffer::WebMetalCommandBuffer):
418         (WebCore::WebMetalCommandBuffer::~WebMetalCommandBuffer):
419         (WebCore::WebMetalCommandBuffer::commit):
420         (WebCore::WebMetalCommandBuffer::presentDrawable):
421         (WebCore::WebMetalCommandBuffer::createRenderCommandEncoderWithDescriptor):
422         (WebCore::WebMetalCommandBuffer::createComputeCommandEncoder):
423         (WebCore::WebMetalCommandBuffer::completed):
424         * html/canvas/WebMetalCommandBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
425         * html/canvas/WebMetalCommandBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
426         * html/canvas/WebMetalCommandQueue.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.cpp.
427         (WebCore::WebMetalCommandQueue::create):
428         (WebCore::WebMetalCommandQueue::WebMetalCommandQueue):
429         (WebCore::WebMetalCommandQueue::createCommandBuffer):
430         * html/canvas/WebMetalCommandQueue.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.h.
431         * html/canvas/WebMetalCommandQueue.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.idl.
432         * html/canvas/WebMetalComputeCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.cpp.
433         (WebCore::GPUSizeMake):
434         (WebCore::WebMetalComputeCommandEncoder::create):
435         (WebCore::WebMetalComputeCommandEncoder::WebMetalComputeCommandEncoder):
436         (WebCore::WebMetalComputeCommandEncoder::setComputePipelineState):
437         (WebCore::WebMetalComputeCommandEncoder::setBuffer):
438         (WebCore::WebMetalComputeCommandEncoder::dispatch):
439         (WebCore::WebMetalComputeCommandEncoder::endEncoding):
440         * html/canvas/WebMetalComputeCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.h.
441         * html/canvas/WebMetalComputeCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.idl.
442         * html/canvas/WebMetalComputePipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.cpp.
443         (WebCore::WebMetalComputePipelineState::create):
444         (WebCore::WebMetalComputePipelineState::WebMetalComputePipelineState):
445         * html/canvas/WebMetalComputePipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.h.
446         * html/canvas/WebMetalComputePipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.idl.
447         * html/canvas/WebMetalDepthStencilDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.cpp.
448         (WebCore::WebMetalDepthStencilDescriptor::create):
449         (WebCore::WebMetalDepthStencilDescriptor::depthWriteEnabled const):
450         (WebCore::WebMetalDepthStencilDescriptor::setDepthWriteEnabled):
451         (WebCore::WebMetalDepthStencilDescriptor::depthCompareFunction const):
452         (WebCore::WebMetalDepthStencilDescriptor::setDepthCompareFunction):
453         * html/canvas/WebMetalDepthStencilDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.h.
454         * html/canvas/WebMetalDepthStencilDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.idl.
455         * html/canvas/WebMetalDepthStencilState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.cpp.
456         (WebCore::WebMetalDepthStencilState::create):
457         (WebCore::WebMetalDepthStencilState::WebMetalDepthStencilState):
458         (WebCore::WebMetalDepthStencilState::label const):
459         (WebCore::WebMetalDepthStencilState::setLabel):
460         * html/canvas/WebMetalDepthStencilState.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.h.
461         * html/canvas/WebMetalDepthStencilState.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.idl.
462         * html/canvas/WebMetalDrawable.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.cpp.
463         (WebCore::WebMetalDrawable::create):
464         (WebCore::WebMetalDrawable::WebMetalDrawable):
465         * html/canvas/WebMetalDrawable.h: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.h.
466         (WebCore::WebMetalDrawable::texture):
467         * html/canvas/WebMetalDrawable.idl: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.idl.
468         * html/canvas/WebMetalEnums.cpp: Renamed from Source/WebCore/html/canvas/WebGPUEnums.cpp.
469         (WebCore::toWebMetalCompareFunction):
470         (WebCore::web3DCompareFunctionName):
471         (WebCore::toGPUCompareFunction):
472         * html/canvas/WebMetalEnums.h: Renamed from Source/WebCore/html/canvas/WebGPUEnums.h.
473         * html/canvas/WebMetalEnums.idl: Renamed from Source/WebCore/html/canvas/WebGPUEnums.idl.
474         * html/canvas/WebMetalFunction.cpp: Renamed from Source/WebCore/html/canvas/WebGPUFunction.cpp.
475         (WebCore::WebMetalFunction::create):
476         (WebCore::WebMetalFunction::WebMetalFunction):
477         * html/canvas/WebMetalFunction.h: Renamed from Source/WebCore/html/canvas/WebGPUFunction.h.
478         * html/canvas/WebMetalFunction.idl: Renamed from Source/WebCore/html/canvas/WebGPUFunction.idl.
479         * html/canvas/WebMetalLibrary.cpp: Renamed from Source/WebCore/html/canvas/WebGPULibrary.cpp.
480         (WebCore::WebMetalLibrary::create):
481         (WebCore::WebMetalLibrary::WebMetalLibrary):
482         (WebCore::WebMetalLibrary::functionNames const):
483         (WebCore::WebMetalLibrary::functionWithName const):
484         * html/canvas/WebMetalLibrary.h: Renamed from Source/WebCore/html/canvas/WebGPULibrary.h.
485         * html/canvas/WebMetalLibrary.idl: Renamed from Source/WebCore/html/canvas/WebGPULibrary.idl.
486         * html/canvas/WebMetalRenderCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.cpp.
487         (WebCore::WebMetalRenderCommandEncoder::create):
488         (WebCore::WebMetalRenderCommandEncoder::WebMetalRenderCommandEncoder):
489         (WebCore::WebMetalRenderCommandEncoder::setRenderPipelineState):
490         (WebCore::WebMetalRenderCommandEncoder::setDepthStencilState):
491         (WebCore::WebMetalRenderCommandEncoder::setVertexBuffer):
492         (WebCore::WebMetalRenderCommandEncoder::setFragmentBuffer):
493         (WebCore::WebMetalRenderCommandEncoder::drawPrimitives):
494         (WebCore::WebMetalRenderCommandEncoder::endEncoding):
495         * html/canvas/WebMetalRenderCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.h.
496         * html/canvas/WebMetalRenderCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.idl.
497         * html/canvas/WebMetalRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.cpp.
498         (WebCore::WebMetalRenderPassAttachmentDescriptor::WebMetalRenderPassAttachmentDescriptor):
499         (WebCore::WebMetalRenderPassAttachmentDescriptor::loadAction const):
500         (WebCore::WebMetalRenderPassAttachmentDescriptor::setLoadAction):
501         (WebCore::WebMetalRenderPassAttachmentDescriptor::storeAction const):
502         (WebCore::WebMetalRenderPassAttachmentDescriptor::setStoreAction):
503         (WebCore::WebMetalRenderPassAttachmentDescriptor::texture const):
504         (WebCore::WebMetalRenderPassAttachmentDescriptor::setTexture):
505         * html/canvas/WebMetalRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.h.
506         * html/canvas/WebMetalRenderPassAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.idl.
507         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp.
508         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::create):
509         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::WebMetalRenderPassColorAttachmentDescriptor):
510         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::descriptor const):
511         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::clearColor const):
512         (WebCore::WebMetalRenderPassColorAttachmentDescriptor::setClearColor):
513         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.h.
514         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.idl.
515         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp.
516         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::create):
517         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::WebMetalRenderPassDepthAttachmentDescriptor):
518         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::clearDepth const):
519         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::setClearDepth):
520         (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::descriptor const):
521         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h.
522         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.idl.
523         * html/canvas/WebMetalRenderPassDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.cpp.
524         (WebCore::WebMetalRenderPassDescriptor::create):
525         (WebCore::WebMetalRenderPassDescriptor::depthAttachment):
526         (WebCore::WebMetalRenderPassDescriptor::colorAttachments):
527         * html/canvas/WebMetalRenderPassDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.h.
528         * html/canvas/WebMetalRenderPassDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.idl.
529         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp.
530         (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::create):
531         (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::WebMetalRenderPipelineColorAttachmentDescriptor):
532         (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::pixelFormat const):
533         (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::setPixelFormat):
534         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h.
535         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl.
536         * html/canvas/WebMetalRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.cpp.
537         (WebCore::WebMetalRenderPipelineDescriptor::create):
538         (WebCore::WebMetalRenderPipelineDescriptor::vertexFunction const):
539         (WebCore::WebMetalRenderPipelineDescriptor::setVertexFunction):
540         (WebCore::WebMetalRenderPipelineDescriptor::fragmentFunction const):
541         (WebCore::WebMetalRenderPipelineDescriptor::setFragmentFunction):
542         (WebCore::WebMetalRenderPipelineDescriptor::colorAttachments):
543         (WebCore::WebMetalRenderPipelineDescriptor::depthAttachmentPixelFormat const):
544         (WebCore::WebMetalRenderPipelineDescriptor::setDepthAttachmentPixelFormat):
545         (WebCore::WebMetalRenderPipelineDescriptor::reset):
546         * html/canvas/WebMetalRenderPipelineDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.h.
547         * html/canvas/WebMetalRenderPipelineDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.idl.
548         * html/canvas/WebMetalRenderPipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.cpp.
549         (WebCore::WebMetalRenderPipelineState::create):
550         (WebCore::WebMetalRenderPipelineState::WebMetalRenderPipelineState):
551         (WebCore::WebMetalRenderPipelineState::label const):
552         (WebCore::WebMetalRenderPipelineState::setLabel):
553         * html/canvas/WebMetalRenderPipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.h.
554         * html/canvas/WebMetalRenderPipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.idl.
555         * html/canvas/WebMetalRenderingContext.cpp: Added.
556         (WebCore::WebMetalRenderingContext::create):
557         (WebCore::WebMetalRenderingContext::WebMetalRenderingContext):
558         (WebCore::WebMetalRenderingContext::canvas const):
559         (WebCore::WebMetalRenderingContext::initializeNewContext):
560         (WebCore::WebMetalRenderingContext::clampedCanvasSize const):
561         (WebCore::WebMetalRenderingContext::hasPendingActivity const):
562         (WebCore::WebMetalRenderingContext::stop):
563         (WebCore::WebMetalRenderingContext::activeDOMObjectName const):
564         (WebCore::WebMetalRenderingContext::canSuspendForDocumentSuspension const):
565         (WebCore::WebMetalRenderingContext::platformLayer const):
566         (WebCore::WebMetalRenderingContext::markLayerComposited):
567         (WebCore::WebMetalRenderingContext::reshape):
568         (WebCore::WebMetalRenderingContext::createLibrary):
569         (WebCore::WebMetalRenderingContext::createRenderPipelineState):
570         (WebCore::WebMetalRenderingContext::createDepthStencilState):
571         (WebCore::WebMetalRenderingContext::createComputePipelineState):
572         (WebCore::WebMetalRenderingContext::createCommandQueue):
573         (WebCore::WebMetalRenderingContext::nextDrawable):
574         (WebCore::WebMetalRenderingContext::createBuffer):
575         (WebCore::WebMetalRenderingContext::createTexture):
576         * html/canvas/WebMetalRenderingContext.h: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.h.
577         * html/canvas/WebMetalRenderingContext.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.idl.
578         * html/canvas/WebMetalSize.h: Renamed from Source/WebCore/html/canvas/WebGPUSize.h.
579         * html/canvas/WebMetalSize.idl: Renamed from Source/WebCore/html/canvas/WebGPUSize.idl.
580         * html/canvas/WebMetalTexture.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTexture.cpp.
581         (WebCore::WebMetalTexture::create):
582         (WebCore::WebMetalTexture::WebMetalTexture):
583         * html/canvas/WebMetalTexture.h: Renamed from Source/WebCore/html/canvas/WebGPUTexture.h.
584         * html/canvas/WebMetalTexture.idl: Renamed from Source/WebCore/html/canvas/WebGPUTexture.idl.
585         * html/canvas/WebMetalTextureDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.cpp.
586         (WebCore::WebMetalTextureDescriptor::create):
587         (WebCore::WebMetalTextureDescriptor::WebMetalTextureDescriptor):
588         (WebCore::WebMetalTextureDescriptor::width const):
589         (WebCore::WebMetalTextureDescriptor::setWidth):
590         (WebCore::WebMetalTextureDescriptor::height const):
591         (WebCore::WebMetalTextureDescriptor::setHeight):
592         (WebCore::WebMetalTextureDescriptor::sampleCount const):
593         (WebCore::WebMetalTextureDescriptor::setSampleCount):
594         (WebCore::WebMetalTextureDescriptor::textureType const):
595         (WebCore::WebMetalTextureDescriptor::setTextureType):
596         (WebCore::WebMetalTextureDescriptor::storageMode const):
597         (WebCore::WebMetalTextureDescriptor::setStorageMode):
598         (WebCore::WebMetalTextureDescriptor::usage const):
599         (WebCore::WebMetalTextureDescriptor::setUsage):
600         * html/canvas/WebMetalTextureDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.h.
601         * html/canvas/WebMetalTextureDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.idl.
602         * inspector/InspectorCanvas.cpp:
603         (WebCore::InspectorCanvas::buildObjectForCanvas):
604         * inspector/agents/InspectorCanvasAgent.cpp:
605         (WebCore::InspectorCanvasAgent::requestContent):
606         (WebCore::contextAsScriptValue):
607         * page/RuntimeEnabledFeatures.h:
608         (WebCore::RuntimeEnabledFeatures::setWebMetalEnabled):
609         (WebCore::RuntimeEnabledFeatures::webMetalEnabled const):
610         (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): Deleted.
611         (WebCore::RuntimeEnabledFeatures::webGPUEnabled const): Deleted.
612         * platform/Logging.h:
613         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
614         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
615         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
616         * platform/graphics/cocoa/WebMetalLayer.h: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.h.
617         * platform/graphics/cocoa/WebMetalLayer.mm: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm.
618         (-[WebMetalLayer initWithGPUDevice:]):
619         * platform/graphics/gpu/GPUBuffer.cpp:
620         (WebCore::GPUBuffer::~GPUBuffer):
621         * platform/graphics/gpu/GPUBuffer.h:
622         * platform/graphics/gpu/GPUCommandBuffer.cpp:
623         (WebCore::GPUCommandBuffer::~GPUCommandBuffer):
624         * platform/graphics/gpu/GPUCommandBuffer.h:
625         * platform/graphics/gpu/GPUCommandQueue.cpp:
626         (WebCore::GPUCommandQueue::~GPUCommandQueue):
627         * platform/graphics/gpu/GPUCommandQueue.h:
628         * platform/graphics/gpu/GPUComputeCommandEncoder.cpp:
629         (WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
630         * platform/graphics/gpu/GPUComputeCommandEncoder.h:
631         * platform/graphics/gpu/GPUComputePipelineState.cpp:
632         (WebCore::GPUComputePipelineState::~GPUComputePipelineState):
633         * platform/graphics/gpu/GPUComputePipelineState.h:
634         * platform/graphics/gpu/GPUDepthStencilDescriptor.cpp:
635         (WebCore::GPUDepthStencilDescriptor::~GPUDepthStencilDescriptor):
636         * platform/graphics/gpu/GPUDepthStencilDescriptor.h:
637         * platform/graphics/gpu/GPUDepthStencilState.cpp:
638         (WebCore::GPUDepthStencilState::~GPUDepthStencilState):
639         * platform/graphics/gpu/GPUDepthStencilState.h:
640         * platform/graphics/gpu/GPUDevice.cpp:
641         (WebCore::GPUDevice::~GPUDevice):
642         * platform/graphics/gpu/GPUDevice.h:
643         (WebCore::GPUDevice::layer const):
644         * platform/graphics/gpu/GPUDrawable.cpp:
645         (WebCore::GPUDrawable::~GPUDrawable):
646         * platform/graphics/gpu/GPUDrawable.h:
647         * platform/graphics/gpu/GPUEnums.h:
648         * platform/graphics/gpu/GPUFunction.cpp:
649         (WebCore::GPUFunction::~GPUFunction):
650         * platform/graphics/gpu/GPUFunction.h:
651         * platform/graphics/gpu/GPULibrary.cpp:
652         (WebCore::GPULibrary::~GPULibrary):
653         * platform/graphics/gpu/GPULibrary.h:
654         * platform/graphics/gpu/GPURenderCommandEncoder.cpp:
655         (WebCore::GPURenderCommandEncoder::~GPURenderCommandEncoder):
656         * platform/graphics/gpu/GPURenderCommandEncoder.h:
657         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp:
658         (WebCore::GPURenderPassAttachmentDescriptor::~GPURenderPassAttachmentDescriptor):
659         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h:
660         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp:
661         (WebCore::GPURenderPassColorAttachmentDescriptor::~GPURenderPassColorAttachmentDescriptor):
662         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h:
663         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp:
664         (WebCore::GPURenderPassDepthAttachmentDescriptor::~GPURenderPassDepthAttachmentDescriptor):
665         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h:
666         * platform/graphics/gpu/GPURenderPassDescriptor.cpp:
667         (WebCore::GPURenderPassDescriptor::~GPURenderPassDescriptor):
668         * platform/graphics/gpu/GPURenderPassDescriptor.h:
669         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp:
670         (WebCore::GPURenderPipelineColorAttachmentDescriptor::~GPURenderPipelineColorAttachmentDescriptor):
671         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h:
672         * platform/graphics/gpu/GPURenderPipelineDescriptor.cpp:
673         (WebCore::GPURenderPipelineDescriptor::~GPURenderPipelineDescriptor):
674         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
675         * platform/graphics/gpu/GPURenderPipelineState.cpp:
676         (WebCore::GPURenderPipelineState::~GPURenderPipelineState):
677         * platform/graphics/gpu/GPURenderPipelineState.h:
678         * platform/graphics/gpu/GPUSize.h:
679         * platform/graphics/gpu/GPUTexture.cpp:
680         (WebCore::GPUTexture::~GPUTexture):
681         * platform/graphics/gpu/GPUTexture.h:
682         * platform/graphics/gpu/GPUTextureDescriptor.cpp:
683         (WebCore::GPUTextureDescriptor::~GPUTextureDescriptor):
684         * platform/graphics/gpu/GPUTextureDescriptor.h:
685         * platform/graphics/metal/GPUBufferMetal.mm:
686         (WebCore::GPUBuffer::GPUBuffer):
687         * platform/graphics/metal/GPUCommandBufferMetal.mm:
688         * platform/graphics/metal/GPUCommandQueueMetal.mm:
689         * platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
690         * platform/graphics/metal/GPUComputePipelineStateMetal.mm:
691         (WebCore::GPUComputePipelineState::GPUComputePipelineState):
692         * platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
693         * platform/graphics/metal/GPUDepthStencilStateMetal.mm:
694         (WebCore::GPUDepthStencilState::setLabel const):
695         * platform/graphics/metal/GPUDeviceMetal.mm:
696         (WebCore::GPUDevice::reshape const):
697         * platform/graphics/metal/GPUDrawableMetal.mm:
698         (WebCore::GPUDrawable::release):
699         * platform/graphics/metal/GPUFunctionMetal.mm:
700         * platform/graphics/metal/GPULibraryMetal.mm:
701         (WebCore::GPULibrary::GPULibrary):
702         * platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
703         (WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder):
704         * platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
705         * platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
706         * platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
707         * platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
708         * platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
709         * platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
710         * platform/graphics/metal/GPURenderPipelineStateMetal.mm:
711         (WebCore::GPURenderPipelineState::setLabel const):
712         * platform/graphics/metal/GPUTextureDescriptorMetal.mm:
713         * platform/graphics/metal/GPUTextureMetal.mm:
714         (WebCore::GPUTexture::GPUTexture):
715         * testing/InternalSettings.cpp:
716         (WebCore::InternalSettings::Backup::Backup):
717         (WebCore::InternalSettings::Backup::restoreTo):
718         (WebCore::InternalSettings::setWebMetalEnabled):
719         (WebCore::InternalSettings::setWebGPUEnabled): Deleted.
720         * testing/InternalSettings.h:
721         * testing/InternalSettings.idl:
722
723 2018-10-08  Dean Jackson  <dino@apple.com>
724
725         CrashTracer: backboardd at Recursion :: QuartzCore: CA::Render::Updater::prepare_sublayer0
726         https://bugs.webkit.org/show_bug.cgi?id=190376
727         <rdar://problem/44986520>
728
729         Reviewed by Tim Horton.
730
731         Very deep CoreAnimation layer trees can cause problems. Reduce our maximum
732         depth from 256 to 128.
733
734         Modified existing test: compositing/layer-creation/deep-tree.html
735
736         * platform/graphics/ca/GraphicsLayerCA.cpp: Cap the depth at 128.
737
738 2018-10-08  Commit Queue  <commit-queue@webkit.org>
739
740         Unreviewed, rolling out r236941.
741         https://bugs.webkit.org/show_bug.cgi?id=190374
742
743         Causing API test failures in new test (Requested by jernoble
744         on #webkit).
745
746         Reverted changeset:
747
748         "ISOTrackEncryptionBox returns incorrect defaultKeyID"
749         https://bugs.webkit.org/show_bug.cgi?id=190368
750         https://trac.webkit.org/changeset/236941
751
752 2018-10-08  Aditya Keerthi  <akeerthi@apple.com>
753
754         Make <input type=color> a runtime enabled (on-by-default) feature
755         https://bugs.webkit.org/show_bug.cgi?id=189162
756
757         Reviewed by Wenson Hsieh and Tim Horton.
758
759         Enable the build-time flag INPUT_TYPE_COLOR by default and introduce a runtime-enabled feature for input type
760         color, also on by default.
761
762         Covered by rebaselining existing layout tests.
763
764         * Configurations/FeatureDefines.xcconfig:
765         * html/InputType.cpp:
766         (WebCore::createInputTypeFactoryMap):
767         * page/RuntimeEnabledFeatures.h:
768         (WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const):
769         (WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled):
770
771 2018-10-08  Jer Noble  <jer.noble@apple.com>
772
773         ISOTrackEncryptionBox returns incorrect defaultKeyID
774         https://bugs.webkit.org/show_bug.cgi?id=190368
775
776         Reviewed by Eric Carlson.
777
778         Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
779
780         ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
781
782         Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
783
784         * WebCore.xcodeproj/project.pbxproj:
785         * platform/graphics/iso/ISOBox.h:
786         * platform/graphics/iso/ISOOriginalFormatBox.h:
787         * platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
788         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
789         * platform/graphics/iso/ISOSchemeInformationBox.h:
790         * platform/graphics/iso/ISOSchemeTypeBox.h:
791         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
792         (WebCore::ISOTrackEncryptionBox::parse):
793         * platform/graphics/iso/ISOTrackEncryptionBox.h:
794
795 2018-10-08  Antti Koivisto  <antti@apple.com>
796
797         Move SystemFontDatabase to a file of its own
798         https://bugs.webkit.org/show_bug.cgi?id=190347
799
800         Reviewed by Chris Dumez.
801
802         Also rename it to SystemFontDatabaseCoreText as it is CoreText specific.
803
804         * SourcesCocoa.txt:
805         * WebCore.xcodeproj/project.pbxproj:
806         * page/MemoryRelease.cpp:
807         (WebCore::releaseNoncriticalMemory):
808         * page/cocoa/MemoryReleaseCocoa.mm:
809
810         Release SystemFontDatabaseCoreText directly from platform specific cleanup code.
811
812         (WebCore::platformReleaseMemory):
813         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
814         (WebCore::FontDescription::invalidateCaches):
815         (WebCore::systemFontCascadeList):
816         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
817         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
818         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters): Deleted.
819         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue const): Deleted.
820         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const): Deleted.
821         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const): Deleted.
822         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash): Deleted.
823         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal): Deleted.
824         (): Deleted.
825         (WebCore::SystemFontDatabase::singleton): Deleted.
826         (WebCore::SystemFontDatabase::systemFontCascadeList): Deleted.
827         (WebCore::SystemFontDatabase::clear): Deleted.
828         (WebCore::SystemFontDatabase::SystemFontDatabase): Deleted.
829         (WebCore::SystemFontDatabase::applyWeightItalicsAndFallbackBehavior): Deleted.
830         (WebCore::SystemFontDatabase::removeCascadeList): Deleted.
831         (WebCore::SystemFontDatabase::computeCascadeList): Deleted.
832         (WebCore::systemFontParameters): Deleted.
833         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: Added.
834         (WebCore::SystemFontDatabaseCoreText::singleton):
835         (WebCore::SystemFontDatabaseCoreText::SystemFontDatabaseCoreText):
836         (WebCore::SystemFontDatabaseCoreText::systemFontCascadeList):
837         (WebCore::SystemFontDatabaseCoreText::clear):
838         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
839         (WebCore::SystemFontDatabaseCoreText::removeCascadeList):
840         (WebCore::SystemFontDatabaseCoreText::computeCascadeList):
841         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
842         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: Added.
843         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParameters):
844         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::isHashTableDeletedValue const):
845         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const):
846         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const):
847         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::hash):
848         (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::equal):
849         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
850
851 2018-10-08  Jeremy Jones  <jeremyj@apple.com>
852
853         Remove dead code: VideoFullscreenModel::isVisible()
854         https://bugs.webkit.org/show_bug.cgi?id=190356
855
856         Reviewed by Jon Lee.
857
858         No new tests because there is no behavior change.
859
860         Remove isVisible() since it is no longer used.
861
862         * platform/cocoa/VideoFullscreenModel.h:
863         * platform/cocoa/VideoFullscreenModelVideoElement.h:
864         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
865         (WebCore::VideoFullscreenModelVideoElement::isVisible const): Deleted.
866         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
867         (VideoFullscreenControllerContext::isVisible const): Deleted.
868
869 2018-10-08  Jeremy Jones  <jeremyj@apple.com>
870
871         Remove dead code: resetMediaState.
872         https://bugs.webkit.org/show_bug.cgi?id=190355
873
874         Reviewed by Jon Lee.
875
876         No new tests because no behavior change.
877
878         Remove resetMediaState since it is no longer used.
879
880         * platform/cocoa/PlaybackSessionInterface.h:
881         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
882         * platform/ios/PlaybackSessionInterfaceAVKit.h:
883         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
884         (WebCore::PlaybackSessionInterfaceAVKit::resetMediaState): Deleted.
885         * platform/ios/WebAVPlayerController.h:
886         * platform/ios/WebAVPlayerController.mm:
887         (-[WebAVPlayerController resetMediaState]): Deleted.
888         * platform/mac/PlaybackSessionInterfaceMac.h:
889         * platform/mac/PlaybackSessionInterfaceMac.mm:
890         (WebCore::PlaybackSessionInterfaceMac::resetMediaState): Deleted.
891
892 2018-10-08  Jeremy Jones  <jeremyj@apple.com>
893
894         Use MediaPlayerEnums::VideoGravity in VideoFullscreenModel.
895         https://bugs.webkit.org/show_bug.cgi?id=190357
896
897         Reviewed by Jon Lee.
898
899         No new tests because no behavior change.
900
901         Use MediaPlayerEnums::VideoGravity instead of creating another identical enum in VideoFullscreenModel.
902
903         * platform/cocoa/VideoFullscreenModel.h:
904         (): Deleted.
905         * platform/cocoa/VideoFullscreenModelVideoElement.h:
906         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
907         (WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity):
908         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
909         (-[WebAVPlayerLayer setVideoGravity:]):
910         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
911         (VideoFullscreenControllerContext::setVideoLayerGravity):
912         * platform/mac/VideoFullscreenInterfaceMac.mm:
913         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
914         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
915
916 2018-10-08  Devin Rousso  <drousso@apple.com>
917
918         Web Inspector: group media network entries by the node that triggered the request
919         https://bugs.webkit.org/show_bug.cgi?id=189606
920         <rdar://problem/44438527>
921
922         Reviewed by Brian Burg.
923
924         Test: http/tests/inspector/network/resource-initiatorNode.html
925
926         Add extra arguments to functions that create `ResourceRequest` objects for media resources so
927         that `initiatorNodeIdentifier` can be set for WebInspector frontend to use for grouping.
928
929         * html/HTMLMediaElement.cpp:
930         (WebCore::HTMLMediaElement::loadResource):
931         * html/HTMLVideoElement.cpp:
932         (WebCore::HTMLVideoElement::setDisplayMode):
933         * loader/FrameLoader.h:
934         * loader/FrameLoader.cpp:
935         (WebCore::FrameLoader::willLoadMediaElementURL):
936         Handles initial (e.g. DNT) resource requests.
937
938         * loader/ImageLoader.cpp:
939         (ImageLoader::updateFromElement):
940         Handles "poster" requests.
941
942         * loader/MediaResourceLoader.cpp:
943         (MediaResourceLoader::requestResource):
944         Handles byte-range requests.
945
946         * html/track/LoadableTextTrack.cpp:
947         (WebCore::LoadableTextTrack::loadTimerFired):
948         * loader/TextTrackLoader.h:
949         * loader/TextTrackLoader.cpp:
950         (WebCore::TextTrackLoader::load):
951         * html/HTMLTrackElement.h:
952         Handles <track> (e.g. subtitle) requests.
953
954         * inspector/agents/InspectorDOMAgent.cpp:
955         (WebCore::InspectorDOMAgent::identifierForNode):
956         * inspector/InspectorInstrumentation.h:
957         (WebCore::InspectorInstrumentation::identifierForNode):
958         * inspector/InspectorInstrumentation.cpp:
959         (WebCore::InspectorInstrumentation::identifierForNodeImpl):
960         Allows callers to get a `DOM.nodeId` for the given `Node`, which is (in this patch) attached
961         to the `ResourceRequest` and later used by `InspectorNetworkAgent`.
962
963         * inspector/agents/InspectorNetworkAgent.h:
964         * inspector/agents/InspectorNetworkAgent.cpp:
965         (WebCore::InspectorNetworkAgent::willSendRequest):
966         (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
967         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
968
969         * platform/network/ResourceRequestBase.h:
970         (WebCore::ResourceRequestBase::initiatorNodeIdentifier const):
971         (WebCore::ResourceRequestBase::setInitiatorNodeIdentifier):
972         * platform/network/ResourceRequestBase.cpp:
973         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
974         * platform/network/cf/ResourceRequestCFNet.cpp:
975         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
976         * loader/cache/CachedResourceLoader.cpp:
977         (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
978
979         * inspector/InspectorCanvas.h:
980         * inspector/InspectorCanvas.cpp:
981         (WebCore::InspectorCanvas::buildObjectForCanvas):
982         * inspector/agents/InspectorCanvasAgent.cpp:
983         (WebCore::InspectorCanvasAgent::enable):
984         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
985         Don't try to push the canvas' node to the frontend, as this will create a dangling node in
986         `InspectorDOMAgent` if the canvas' node is detached from the DOM.
987
988 2018-10-08  Andy Estes  <aestes@apple.com>
989
990         [Payment Request] Requests should be aborted after details settle when the user cancels
991         https://bugs.webkit.org/show_bug.cgi?id=190333
992
993         Reviewed by Alex Christensen.
994
995         In Payment Request's "update a PaymentRequest's details" algorithm, user agents are expected
996         to disable the payment UI when PaymentRequest details are being updated by the merchant.
997         This is to prevent the user from accepting a payment before updated details are displayed.
998
999         Further, Payment Request's "user aborts the payment request" algorithm says that the
1000         algorithm should be terminated prior to throwing an AbortError if the request is currently
1001         being updated, and also that user agents SHOULD ensure this never occurs. This is based on
1002         the assumption that payment UIs are disabled during details updates.
1003
1004         For Apple Pay, while it is true that a payment cannot be accepted by the user while details
1005         are being updated by the merchant, the payment UI is not completely disabled. In particular,
1006         the user is allowed to abort the payment while details are being updated. We need to honor
1007         the user's request to abort without doing so in the middle of a details update.
1008
1009         This patch defers a user-initiated abort until after details are settled, at which point the
1010         promise returned by show() is rejected with an AbortError. This behaves as if the details
1011         update promise were rejected by the merchant.
1012
1013         Added a test case to http/tests/paymentrequest/payment-request-show-method.https.html.
1014
1015         * Modules/paymentrequest/PaymentRequest.cpp:
1016         (WebCore::PaymentRequest::settleDetailsPromise):
1017         (WebCore::PaymentRequest::whenDetailsSettled):
1018         (WebCore::PaymentRequest::cancel):
1019         * Modules/paymentrequest/PaymentRequest.h:
1020
1021 2018-10-08  Chris Dumez  <cdumez@apple.com>
1022
1023         Have DOMWindowProperty get is frame from its associated DOMWindow
1024         https://bugs.webkit.org/show_bug.cgi?id=190341
1025
1026         Reviewed by Alex Christensen.
1027
1028         Have DOMWindowProperty get is frame from its associated DOMWindow, instead of having its own
1029         m_frame that can potentially get out-of-sync.
1030
1031         * Modules/cache/DOMWindowCaches.cpp:
1032         (WebCore::DOMWindowCaches::DOMWindowCaches):
1033         * Modules/geolocation/NavigatorGeolocation.cpp:
1034         (WebCore::NavigatorGeolocation::NavigatorGeolocation):
1035         (WebCore::NavigatorGeolocation::from):
1036         * Modules/geolocation/NavigatorGeolocation.h:
1037         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1038         (WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
1039         * Modules/mediastream/NavigatorMediaDevices.cpp:
1040         (WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
1041         (WebCore::NavigatorMediaDevices::from):
1042         * Modules/mediastream/NavigatorMediaDevices.h:
1043         * Modules/quota/DOMWindowQuota.cpp:
1044         (WebCore::DOMWindowQuota::DOMWindowQuota):
1045         * Modules/quota/NavigatorStorageQuota.cpp:
1046         (WebCore::NavigatorStorageQuota::NavigatorStorageQuota):
1047         * Modules/quota/NavigatorStorageQuota.h:
1048         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
1049         (WebCore::DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis):
1050         * css/StyleMedia.cpp:
1051         (WebCore::StyleMedia::StyleMedia):
1052         (WebCore::StyleMedia::type const):
1053         (WebCore::StyleMedia::matchMedium const):
1054         * css/StyleMedia.h:
1055         * loader/appcache/DOMApplicationCache.cpp:
1056         (WebCore::DOMApplicationCache::DOMApplicationCache):
1057         (WebCore::DOMApplicationCache::applicationCacheHost const):
1058         (WebCore::DOMApplicationCache::scriptExecutionContext const):
1059         * loader/appcache/DOMApplicationCache.h:
1060         * page/BarProp.cpp:
1061         (WebCore::BarProp::BarProp):
1062         (WebCore::BarProp::visible const):
1063         * page/BarProp.h:
1064         (WebCore::BarProp::create):
1065         * page/DOMSelection.cpp:
1066         (WebCore::DOMSelection::DOMSelection):
1067         (WebCore::DOMSelection::visibleSelection const):
1068         (WebCore::DOMSelection::anchorNode const):
1069         (WebCore::DOMSelection::anchorOffset const):
1070         (WebCore::DOMSelection::focusNode const):
1071         (WebCore::DOMSelection::focusOffset const):
1072         (WebCore::DOMSelection::baseNode const):
1073         (WebCore::DOMSelection::baseOffset const):
1074         (WebCore::DOMSelection::extentNode const):
1075         (WebCore::DOMSelection::extentOffset const):
1076         (WebCore::DOMSelection::isCollapsed const):
1077         (WebCore::DOMSelection::type const):
1078         (WebCore::DOMSelection::rangeCount const):
1079         (WebCore::DOMSelection::collapse):
1080         (WebCore::DOMSelection::collapseToEnd):
1081         (WebCore::DOMSelection::collapseToStart):
1082         (WebCore::DOMSelection::empty):
1083         (WebCore::DOMSelection::setBaseAndExtent):
1084         (WebCore::DOMSelection::setPosition):
1085         (WebCore::DOMSelection::modify):
1086         (WebCore::DOMSelection::extend):
1087         (WebCore::DOMSelection::getRangeAt):
1088         (WebCore::DOMSelection::removeAllRanges):
1089         (WebCore::DOMSelection::addRange):
1090         (WebCore::DOMSelection::deleteFromDocument):
1091         (WebCore::DOMSelection::containsNode const):
1092         (WebCore::DOMSelection::toString):
1093         (WebCore::DOMSelection::shadowAdjustedNode const):
1094         (WebCore::DOMSelection::shadowAdjustedOffset const):
1095         (WebCore::DOMSelection::isValidForPosition const):
1096         * page/DOMSelection.h:
1097         (WebCore::DOMSelection::create):
1098         * page/DOMWindow.cpp:
1099         (WebCore::DOMWindow::screen):
1100         (WebCore::DOMWindow::history):
1101         (WebCore::DOMWindow::locationbar):
1102         (WebCore::DOMWindow::menubar):
1103         (WebCore::DOMWindow::personalbar):
1104         (WebCore::DOMWindow::scrollbars):
1105         (WebCore::DOMWindow::statusbar):
1106         (WebCore::DOMWindow::toolbar):
1107         (WebCore::DOMWindow::applicationCache):
1108         (WebCore::DOMWindow::navigator):
1109         (WebCore::DOMWindow::location):
1110         (WebCore::DOMWindow::visualViewport):
1111         (WebCore::DOMWindow::webkitNamespace):
1112         (WebCore::DOMWindow::getSelection):
1113         (WebCore::DOMWindow::styleMedia):
1114         * page/DOMWindow.h:
1115         * page/DOMWindowExtension.cpp:
1116         (WebCore::DOMWindowExtension::DOMWindowExtension):
1117         * page/DOMWindowExtension.h:
1118         (WebCore::DOMWindowExtension::create):
1119         * page/DOMWindowProperty.cpp:
1120         (WebCore::DOMWindowProperty::DOMWindowProperty):
1121         (WebCore::DOMWindowProperty::~DOMWindowProperty):
1122         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
1123         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
1124         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
1125         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
1126         (WebCore::DOMWindowProperty::willDetachGlobalObjectFromFrame):
1127         (WebCore::DOMWindowProperty::frame const):
1128         * page/DOMWindowProperty.h:
1129         (WebCore::DOMWindowProperty::window const):
1130         * page/History.cpp:
1131         (WebCore::History::History):
1132         (WebCore::History::length const):
1133         (WebCore::History::scrollRestoration const):
1134         (WebCore::History::setScrollRestoration):
1135         (WebCore::History::stateInternal const):
1136         (WebCore::History::go):
1137         (WebCore::History::urlForState):
1138         (WebCore::History::stateObjectAdded):
1139         * page/History.h:
1140         * page/Location.cpp:
1141         (WebCore::Location::Location):
1142         (WebCore::Location::url const):
1143         (WebCore::Location::href const):
1144         (WebCore::Location::protocol const):
1145         (WebCore::Location::host const):
1146         (WebCore::Location::hostname const):
1147         (WebCore::Location::port const):
1148         (WebCore::Location::pathname const):
1149         (WebCore::Location::search const):
1150         (WebCore::Location::origin const):
1151         (WebCore::Location::ancestorOrigins const):
1152         (WebCore::Location::hash const):
1153         (WebCore::Location::setHref):
1154         (WebCore::Location::setProtocol):
1155         (WebCore::Location::setHost):
1156         (WebCore::Location::setHostname):
1157         (WebCore::Location::setPort):
1158         (WebCore::Location::setPathname):
1159         (WebCore::Location::setSearch):
1160         (WebCore::Location::setHash):
1161         (WebCore::Location::assign):
1162         (WebCore::Location::replace):
1163         (WebCore::Location::reload):
1164         (WebCore::Location::setLocation):
1165         * page/Location.h:
1166         (WebCore::Location::create):
1167         * page/Navigator.cpp:
1168         (WebCore::Navigator::Navigator):
1169         (WebCore::Navigator::appVersion const):
1170         (WebCore::Navigator::userAgent const):
1171         (WebCore::Navigator::share):
1172         (WebCore::Navigator::plugins):
1173         (WebCore::Navigator::mimeTypes):
1174         (WebCore::Navigator::cookieEnabled const):
1175         (WebCore::Navigator::javaEnabled const):
1176         (WebCore::Navigator::standalone const):
1177         * page/Navigator.h:
1178         * page/Performance.cpp:
1179         (WebCore::Performance::navigation):
1180         (WebCore::Performance::timing):
1181         * page/PerformanceNavigation.cpp:
1182         (WebCore::PerformanceNavigation::PerformanceNavigation):
1183         (WebCore::PerformanceNavigation::type const):
1184         (WebCore::PerformanceNavigation::redirectCount const):
1185         * page/PerformanceNavigation.h:
1186         (WebCore::PerformanceNavigation::create):
1187         * page/PerformanceTiming.cpp:
1188         (WebCore::PerformanceTiming::PerformanceTiming):
1189         (WebCore::PerformanceTiming::documentLoader const):
1190         (WebCore::PerformanceTiming::documentTiming const):
1191         * page/PerformanceTiming.h:
1192         (WebCore::PerformanceTiming::create):
1193         * page/Screen.cpp:
1194         (WebCore::Screen::Screen):
1195         (WebCore::Screen::height const):
1196         (WebCore::Screen::width const):
1197         (WebCore::Screen::colorDepth const):
1198         (WebCore::Screen::pixelDepth const):
1199         (WebCore::Screen::availLeft const):
1200         (WebCore::Screen::availTop const):
1201         (WebCore::Screen::availHeight const):
1202         (WebCore::Screen::availWidth const):
1203         * page/Screen.h:
1204         * page/VisualViewport.cpp:
1205         (WebCore::VisualViewport::VisualViewport):
1206         (WebCore::VisualViewport::scriptExecutionContext const):
1207         (WebCore::VisualViewport::addEventListener):
1208         (WebCore::VisualViewport::updateFrameLayout const):
1209         (WebCore::VisualViewport::offsetLeft const):
1210         (WebCore::VisualViewport::offsetTop const):
1211         (WebCore::VisualViewport::pageLeft const):
1212         (WebCore::VisualViewport::pageTop const):
1213         (WebCore::VisualViewport::width const):
1214         (WebCore::VisualViewport::height const):
1215         (WebCore::VisualViewport::scale const):
1216         (WebCore::VisualViewport::update):
1217         (WebCore::VisualViewport::enqueueResizeEvent):
1218         (WebCore::VisualViewport::enqueueScrollEvent):
1219         * page/VisualViewport.h:
1220         * page/WebKitNamespace.cpp:
1221         (WebCore::WebKitNamespace::WebKitNamespace):
1222         * page/WebKitNamespace.h:
1223         (WebCore::WebKitNamespace::create):
1224         * plugins/DOMMimeTypeArray.cpp:
1225         (WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
1226         (WebCore::DOMMimeTypeArray::item):
1227         (WebCore::DOMMimeTypeArray::namedItem):
1228         (WebCore::DOMMimeTypeArray::getPluginData const):
1229         * plugins/DOMMimeTypeArray.h:
1230         (WebCore::DOMMimeTypeArray::create):
1231         * plugins/DOMPluginArray.cpp:
1232         (WebCore::DOMPluginArray::DOMPluginArray):
1233         (WebCore::DOMPluginArray::item):
1234         (WebCore::DOMPluginArray::namedItem):
1235         (WebCore::DOMPluginArray::refresh):
1236         (WebCore::DOMPluginArray::pluginData const):
1237         * plugins/DOMPluginArray.h:
1238         (WebCore::DOMPluginArray::create):
1239         * storage/Storage.cpp:
1240         (WebCore::Storage::create):
1241         (WebCore::Storage::Storage):
1242         (WebCore::Storage::setItem):
1243         (WebCore::Storage::removeItem):
1244         (WebCore::Storage::clear):
1245         * storage/Storage.h:
1246
1247 2018-10-08  Antti Koivisto  <antti@apple.com>
1248
1249         Move FontCascadeDescription to a file of its own
1250         https://bugs.webkit.org/show_bug.cgi?id=190348
1251
1252         Reviewed by Chris Dumez.
1253
1254         * Sources.txt:
1255         * WebCore.xcodeproj/project.pbxproj:
1256         * platform/graphics/FontCascade.h:
1257         * platform/graphics/FontCascadeDescription.cpp: Copied from Source/WebCore/platform/graphics/FontDescription.cpp.
1258         (WebCore::FontDescription::FontDescription): Deleted.
1259         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
1260         (WebCore::FontDescription::setLocale): Deleted.
1261         (WebCore::FontDescription::invalidateCaches): Deleted.
1262         * platform/graphics/FontCascadeDescription.h: Copied from Source/WebCore/platform/graphics/FontDescription.h.
1263         (WebCore::FontDescription::operator!= const): Deleted.
1264         (WebCore::FontDescription::computedSize const): Deleted.
1265         (WebCore::FontDescription::computedPixelSize const): Deleted.
1266         (WebCore::FontDescription::italic const): Deleted.
1267         (WebCore::FontDescription::stretch const): Deleted.
1268         (WebCore::FontDescription::weight const): Deleted.
1269         (WebCore::FontDescription::fontSelectionRequest const): Deleted.
1270         (WebCore::FontDescription::renderingMode const): Deleted.
1271         (WebCore::FontDescription::textRenderingMode const): Deleted.
1272         (WebCore::FontDescription::script const): Deleted.
1273         (WebCore::FontDescription::locale const): Deleted.
1274         (WebCore::FontDescription::orientation const): Deleted.
1275         (WebCore::FontDescription::nonCJKGlyphOrientation const): Deleted.
1276         (WebCore::FontDescription::widthVariant const): Deleted.
1277         (WebCore::FontDescription::featureSettings const): Deleted.
1278         (WebCore::FontDescription::variationSettings const): Deleted.
1279         (WebCore::FontDescription::fontSynthesis const): Deleted.
1280         (WebCore::FontDescription::variantCommonLigatures const): Deleted.
1281         (WebCore::FontDescription::variantDiscretionaryLigatures const): Deleted.
1282         (WebCore::FontDescription::variantHistoricalLigatures const): Deleted.
1283         (WebCore::FontDescription::variantContextualAlternates const): Deleted.
1284         (WebCore::FontDescription::variantPosition const): Deleted.
1285         (WebCore::FontDescription::variantCaps const): Deleted.
1286         (WebCore::FontDescription::variantNumericFigure const): Deleted.
1287         (WebCore::FontDescription::variantNumericSpacing const): Deleted.
1288         (WebCore::FontDescription::variantNumericFraction const): Deleted.
1289         (WebCore::FontDescription::variantNumericOrdinal const): Deleted.
1290         (WebCore::FontDescription::variantNumericSlashedZero const): Deleted.
1291         (WebCore::FontDescription::variantAlternates const): Deleted.
1292         (WebCore::FontDescription::variantEastAsianVariant const): Deleted.
1293         (WebCore::FontDescription::variantEastAsianWidth const): Deleted.
1294         (WebCore::FontDescription::variantEastAsianRuby const): Deleted.
1295         (WebCore::FontDescription::variantSettings const): Deleted.
1296         (WebCore::FontDescription::opticalSizing const): Deleted.
1297         (WebCore::FontDescription::fontStyleAxis const): Deleted.
1298         (WebCore::FontDescription::shouldAllowUserInstalledFonts const): Deleted.
1299         (WebCore::FontDescription::setComputedSize): Deleted.
1300         (WebCore::FontDescription::setItalic): Deleted.
1301         (WebCore::FontDescription::setStretch): Deleted.
1302         (WebCore::FontDescription::setIsItalic): Deleted.
1303         (WebCore::FontDescription::setWeight): Deleted.
1304         (WebCore::FontDescription::setRenderingMode): Deleted.
1305         (WebCore::FontDescription::setTextRenderingMode): Deleted.
1306         (WebCore::FontDescription::setOrientation): Deleted.
1307         (WebCore::FontDescription::setNonCJKGlyphOrientation): Deleted.
1308         (WebCore::FontDescription::setWidthVariant): Deleted.
1309         (WebCore::FontDescription::setFeatureSettings): Deleted.
1310         (WebCore::FontDescription::setVariationSettings): Deleted.
1311         (WebCore::FontDescription::setFontSynthesis): Deleted.
1312         (WebCore::FontDescription::setVariantCommonLigatures): Deleted.
1313         (WebCore::FontDescription::setVariantDiscretionaryLigatures): Deleted.
1314         (WebCore::FontDescription::setVariantHistoricalLigatures): Deleted.
1315         (WebCore::FontDescription::setVariantContextualAlternates): Deleted.
1316         (WebCore::FontDescription::setVariantPosition): Deleted.
1317         (WebCore::FontDescription::setVariantCaps): Deleted.
1318         (WebCore::FontDescription::setVariantNumericFigure): Deleted.
1319         (WebCore::FontDescription::setVariantNumericSpacing): Deleted.
1320         (WebCore::FontDescription::setVariantNumericFraction): Deleted.
1321         (WebCore::FontDescription::setVariantNumericOrdinal): Deleted.
1322         (WebCore::FontDescription::setVariantNumericSlashedZero): Deleted.
1323         (WebCore::FontDescription::setVariantAlternates): Deleted.
1324         (WebCore::FontDescription::setVariantEastAsianVariant): Deleted.
1325         (WebCore::FontDescription::setVariantEastAsianWidth): Deleted.
1326         (WebCore::FontDescription::setVariantEastAsianRuby): Deleted.
1327         (WebCore::FontDescription::setOpticalSizing): Deleted.
1328         (WebCore::FontDescription::setFontStyleAxis): Deleted.
1329         (WebCore::FontDescription::setShouldAllowUserInstalledFonts): Deleted.
1330         (WebCore::FontDescription::operator== const): Deleted.
1331         * platform/graphics/FontDescription.cpp:
1332         (WebCore::FontDescription::invalidateCaches):
1333         (WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.
1334         (WebCore::FontCascadeDescription::effectiveFamilyCount const): Deleted.
1335         (WebCore::FontCascadeDescription::effectiveFamilyAt const): Deleted.
1336         (WebCore::FontCascadeDescription::lighterWeight): Deleted.
1337         (WebCore::FontCascadeDescription::bolderWeight): Deleted.
1338         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing const): Deleted.
1339         (WebCore::FontCascadeDescription::familyNamesAreEqual): Deleted.
1340         (WebCore::FontCascadeDescription::familyNameHash): Deleted.
1341         (WebCore::FontCascadeDescription::foldedFamilyName): Deleted.
1342         * platform/graphics/FontDescription.h:
1343         (WebCore::FontCascadeDescription::operator!= const): Deleted.
1344         (WebCore::FontCascadeDescription::familyCount const): Deleted.
1345         (WebCore::FontCascadeDescription::firstFamily const): Deleted.
1346         (WebCore::FontCascadeDescription::familyAt const): Deleted.
1347         (WebCore::FontCascadeDescription::families const): Deleted.
1348         (WebCore::FontCascadeDescription::specifiedSize const): Deleted.
1349         (WebCore::FontCascadeDescription::isAbsoluteSize const): Deleted.
1350         (WebCore::FontCascadeDescription::lighterWeight const): Deleted.
1351         (WebCore::FontCascadeDescription::bolderWeight const): Deleted.
1352         (WebCore::FontCascadeDescription::useFixedDefaultSize const): Deleted.
1353         (WebCore::FontCascadeDescription::kerning const): Deleted.
1354         (WebCore::FontCascadeDescription::keywordSize const): Deleted.
1355         (WebCore::FontCascadeDescription::keywordSizeAsIdentifier const): Deleted.
1356         (WebCore::FontCascadeDescription::fontSmoothing const): Deleted.
1357         (WebCore::FontCascadeDescription::isSpecifiedFont const): Deleted.
1358         (WebCore::FontCascadeDescription::setOneFamily): Deleted.
1359         (WebCore::FontCascadeDescription::setFamilies): Deleted.
1360         (WebCore::FontCascadeDescription::setSpecifiedSize): Deleted.
1361         (WebCore::FontCascadeDescription::setIsAbsoluteSize): Deleted.
1362         (WebCore::FontCascadeDescription::setKerning): Deleted.
1363         (WebCore::FontCascadeDescription::setKeywordSize): Deleted.
1364         (WebCore::FontCascadeDescription::setKeywordSizeFromIdentifier): Deleted.
1365         (WebCore::FontCascadeDescription::setFontSmoothing): Deleted.
1366         (WebCore::FontCascadeDescription::setIsSpecifiedFont): Deleted.
1367         (WebCore::FontCascadeDescription::equalForTextAutoSizing const): Deleted.
1368         (WebCore::FontCascadeDescription::initialItalic): Deleted.
1369         (WebCore::FontCascadeDescription::initialFontStyleAxis): Deleted.
1370         (WebCore::FontCascadeDescription::initialWeight): Deleted.
1371         (WebCore::FontCascadeDescription::initialStretch): Deleted.
1372         (WebCore::FontCascadeDescription::initialSmallCaps): Deleted.
1373         (WebCore::FontCascadeDescription::initialKerning): Deleted.
1374         (WebCore::FontCascadeDescription::initialFontSmoothing): Deleted.
1375         (WebCore::FontCascadeDescription::initialTextRenderingMode): Deleted.
1376         (WebCore::FontCascadeDescription::initialFontSynthesis): Deleted.
1377         (WebCore::FontCascadeDescription::initialVariantPosition): Deleted.
1378         (WebCore::FontCascadeDescription::initialVariantCaps): Deleted.
1379         (WebCore::FontCascadeDescription::initialVariantAlternates): Deleted.
1380         (WebCore::FontCascadeDescription::initialOpticalSizing): Deleted.
1381         (WebCore::FontCascadeDescription::initialLocale): Deleted.
1382         (WebCore::FontCascadeDescription::operator== const): Deleted.
1383         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1384         * rendering/style/RenderStyle.h:
1385
1386 2018-10-08  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1387
1388         [EME][GStreamer] Add support for WebM encrypted caps "application/x-webm-enc"
1389         https://bugs.webkit.org/show_bug.cgi?id=189239
1390
1391         Reviewed by Xabier Rodriguez-Calvar.
1392
1393         Add the support of GStreamer caps "application/x-webm-enc" in GStreamerCommon.
1394
1395         The DRM system id field in the encrypted event is set to GST_PROTECTION_UNSPECIFIED_SYSTEM_ID
1396         in case of WebM, for details, see https://bugzilla.gnome.org/attachment.cgi?id=365211.
1397
1398         Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-eventmse.html
1399                media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html
1400
1401         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1402         (WebCore::capsMediaType):
1403         (WebCore::areEncryptedCaps):
1404         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1405         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1406         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1407         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1408         (webkitMediaCommonEncryptionDecryptTransformCaps):
1409
1410 2018-10-07  Dan Bernstein  <mitz@apple.com>
1411
1412         Fixed building with the latest macOS SDK
1413
1414         * platform/graphics/cocoa/IOSurface.mm:
1415         (WebCore::IOSurface::ensurePlatformContext): Suppressed deprecation warnings around use of
1416           CGIOSurfaceContextSetDisplayMask.
1417
1418 2018-10-06  Justin Michaud  <justin_michaud@apple.com>
1419
1420         Properly determine if css custom property values are computationally independent
1421         https://bugs.webkit.org/show_bug.cgi?id=190303
1422
1423         Reviewed by Antti Koivisto.
1424
1425         Add getDirectComputationalDependencies method to determine if a value is computationally
1426         dependent. Use this method in CSS.registerProperty to replace existing substring checks.
1427         No new tests are needed because the existing tests cover this behaviour.
1428
1429         * css/CSSCalculationValue.cpp:
1430         (WebCore::determineCategory):
1431         * css/CSSCalculationValue.h:
1432         (WebCore::CSSCalcValue::getDirectComputationalDependencies const):
1433         (WebCore::CSSCalcValue::getDirectRootComputationalDependencies const):
1434         * css/CSSCustomPropertyValue.cpp:
1435         (WebCore::CSSCustomPropertyValue::customCSSText const):
1436         (WebCore::CSSCustomPropertyValue::tokens const):
1437         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
1438         * css/CSSCustomPropertyValue.h:
1439         * css/CSSPrimitiveValue.cpp:
1440         (WebCore::CSSPrimitiveValue::getDirectComputationalDependencies const):
1441         (WebCore::CSSPrimitiveValue::getDirectRootComputationalDependencies const):
1442         * css/CSSPrimitiveValue.h:
1443         * css/CSSValue.cpp:
1444         (WebCore::CSSValue::getDirectComputationalDependencies const):
1445         (WebCore::CSSValue::getDirectRootComputationalDependencies const):
1446         * css/CSSValue.h:
1447         * css/CSSVariableData.cpp:
1448         (WebCore::CSSVariableData::CSSVariableData):
1449         (WebCore::CSSVariableData::resolveVariableReference const):
1450         * css/DOMCSSRegisterCustomProperty.cpp:
1451         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
1452
1453 2018-10-05  Chris Dumez  <cdumez@apple.com>
1454
1455         Regression(r236862): Crash under DOMWindowExtension::willDetachGlobalObjectFromFrame()
1456         https://bugs.webkit.org/show_bug.cgi?id=190320
1457         <rdar://problem/45044814>
1458
1459         Reviewed by Geoffrey Garen.
1460
1461         r236862 caused DOMWindowProperty::willDetachGlobalObjectFromFrame() to get called several
1462         times. There was no effect for most DOMWindowProperty objects. However, it would cause
1463         crashes for DOMWindowExtension objects, which subclass DOMWindowProperty and override
1464         DOMWindowProperty::willDetachGlobalObjectFromFrame() because they dereference the frame
1465         without null checking it.
1466
1467         To address the issue, we now make sure DOMWindowProperty::willDetachGlobalObjectFromFrame()
1468         is not called several times.
1469
1470         * dom/Document.cpp:
1471         (WebCore::Document::detachFromFrame):
1472         Stop calling DOMWindow::willDetachDocumentFromFrame() here as most call sites already
1473         take care of calling DOMWindow::willDetachDocumentFromFrame() beforehand (e.g.
1474         Document::prepareForDestruction()).
1475         Also, return early if the Document is already detached from its frame.
1476
1477         (WebCore::Document::frameWasDisconnectedFromOwner):
1478         Add new utility function called when a Frame is disconnected from its owner which
1479         calls both Document::detachFromFrame() and DOMWindow::willDetachDocumentFromFrame().
1480
1481         * dom/Document.h:
1482         * page/DOMWindow.cpp:
1483         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1484         Return early if the Window is already detached from its frame.
1485
1486         * page/Frame.cpp:
1487         (WebCore::Frame::disconnectOwnerElement):
1488
1489 2018-10-05  Jer Noble  <jer.noble@apple.com>
1490
1491         Further unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
1492
1493         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1494         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
1495
1496 2018-10-05  Jer Noble  <jer.noble@apple.com>
1497
1498        Unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
1499
1500         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1501         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
1502
1503 2018-10-05  Eric Carlson  <eric.carlson@apple.com>
1504
1505         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
1506         https://bugs.webkit.org/show_bug.cgi?id=190142
1507         <rdar://problem/44911109>
1508
1509         Reviewed by Youenn Fablet.
1510
1511         No new tests, covered by existing tests.
1512
1513         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1514         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
1515         to base class.
1516
1517         * Modules/mediastream/MediaDevicesRequest.cpp:
1518         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
1519         as passed salt.
1520
1521         * Modules/mediastream/MediaStreamTrack.cpp:
1522         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
1523         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
1524         * Modules/mediastream/MediaStreamTrack.h:
1525         * Modules/mediastream/MediaStreamTrack.idl:
1526
1527         * Modules/mediastream/UserMediaRequest.cpp:
1528         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
1529
1530         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1531         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
1532         to base class.
1533
1534         * Modules/webaudio/MediaStreamAudioSource.cpp:
1535         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
1536         * platform/mediastream/MediaConstraints.h:
1537
1538         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
1539         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
1540
1541         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
1542         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
1543
1544         * platform/mediastream/RealtimeMediaSource.cpp:
1545         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
1546         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
1547         (WebCore::RealtimeMediaSource::hashedId const): New.
1548         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
1549         * platform/mediastream/RealtimeMediaSource.h:
1550
1551         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1552         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
1553         a source.
1554         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
1555         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
1556         * platform/mediastream/RealtimeMediaSourceCenter.h:
1557
1558         * platform/mediastream/RealtimeMediaSourceFactory.h:
1559         * platform/mediastream/RealtimeVideoSource.cpp:
1560         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
1561         * platform/mediastream/RealtimeVideoSource.h:
1562
1563         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1564         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
1565         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
1566         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
1567
1568         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1569         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
1570         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
1571         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
1572
1573         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
1574         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
1575         (WebCore::MockRealtimeAudioSource::create): Ditto.
1576         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
1577         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
1578
1579         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
1580         (WebCore::MockRealtimeVideoSource::create): Ditto.
1581         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
1582         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
1583
1584         * platform/mediastream/mac/AVVideoCaptureSource.h:
1585         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1586         (WebCore::AVVideoCaptureSource::create): Ditto.
1587         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
1588         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
1589         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
1590
1591         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1592         (WebCore::CoreAudioCaptureSource::create): Update parameters.
1593         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
1594         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
1595         (WebCore::CoreAudioCaptureSource::settings): Ditto.
1596         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1597
1598         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1599         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
1600         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1601
1602         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1603         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1604         (WebCore::MockRealtimeAudioSource::create): Ditto.
1605         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
1606
1607         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1608         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1609         (WebCore::MockRealtimeVideoSource::create): Ditto.
1610         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
1611
1612         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1613
1614         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
1615         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1616         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
1617         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
1618         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
1619         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
1620         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
1621
1622         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
1623         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
1624         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
1625
1626         * platform/mock/MockRealtimeAudioSource.cpp:
1627         (WebCore::MockRealtimeAudioSource::create): Ditto.
1628         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
1629         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
1630         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
1631         * platform/mock/MockRealtimeAudioSource.h:
1632
1633         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1634
1635         * platform/mock/MockRealtimeVideoSource.cpp:
1636         (WebCore::MockRealtimeVideoSource::create): Update parameters.
1637         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
1638         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
1639         (WebCore::MockRealtimeVideoSource::settings): Ditto.
1640         * platform/mock/MockRealtimeVideoSource.h:
1641
1642 2018-10-03  Jer Noble  <jer.noble@apple.com>
1643
1644         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
1645         https://bugs.webkit.org/show_bug.cgi?id=190266
1646
1647         Reviewed by Eric Carlson.
1648
1649         Test: TestWebKitAPI.VideoQualityDisplayCompositing
1650
1651         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
1652         constructor (rather than individual fields). Add a new setting to control visibility
1653         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
1654         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
1655
1656         * Modules/mediasource/VideoPlaybackQuality.cpp:
1657         (WebCore::VideoPlaybackQuality::create):
1658         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
1659         * Modules/mediasource/VideoPlaybackQuality.h:
1660         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
1661         * Modules/mediasource/VideoPlaybackQuality.idl:
1662         * html/HTMLMediaElement.cpp:
1663         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
1664         * html/HTMLMediaElement.h:
1665         * html/HTMLMediaElement.idl:
1666         * page/Settings.yaml:
1667         * platform/graphics/MediaPlayer.h:
1668         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1669         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1670         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
1671         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1672         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
1673         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
1674         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
1675
1676 2018-10-05  Ryan Haddad  <ryanhaddad@apple.com>
1677
1678         Unreviewed, rolling out r236866.
1679
1680         Breaks internal builds.
1681
1682         Reverted changeset:
1683
1684         "Add support for reporting "display composited video frames"
1685         through the VideoPlaybackQuality object."
1686         https://bugs.webkit.org/show_bug.cgi?id=190266
1687         https://trac.webkit.org/changeset/236866
1688
1689 2018-10-05  Antoine Quint  <graouts@apple.com>
1690
1691         [Web Animations] REGRESSION (r236809): crash under AnimationTimeline::updateCSSAnimationsForElement()
1692         https://bugs.webkit.org/show_bug.cgi?id=190307
1693         <rdar://problem/45009901>
1694
1695         Reviewed by Dean Jackson.
1696
1697         We could crash with an invalid access to cssAnimationsByName since cancelOrRemoveDeclarativeAnimation() already
1698         does the job of clearing the m_elementToCSSAnimationByName entry for this particular element if there are no
1699         animations targeting it anymore. This started happening in r236809 when we switched from a simple call to to cancel()
1700         to a call to cancelOrRemoveDeclarativeAnimation(). We can safely remove the removal here since cancelOrRemoveDeclarativeAnimation()
1701         will already have performed this task safely if needed.
1702
1703         * animation/AnimationTimeline.cpp:
1704         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
1705
1706 2018-10-04  Jer Noble  <jer.noble@apple.com>
1707
1708         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
1709         https://bugs.webkit.org/show_bug.cgi?id=190266
1710
1711         Reviewed by Eric Carlson.
1712
1713         Test: TestWebKitAPI.VideoQualityDisplayCompositing
1714
1715         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
1716         constructor (rather than individual fields). Add a new setting to control visibility
1717         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
1718         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
1719
1720         * Modules/mediasource/VideoPlaybackQuality.cpp:
1721         (WebCore::VideoPlaybackQuality::create):
1722         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
1723         * Modules/mediasource/VideoPlaybackQuality.h:
1724         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
1725         * Modules/mediasource/VideoPlaybackQuality.idl:
1726         * html/HTMLMediaElement.cpp:
1727         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
1728         * html/HTMLMediaElement.h:
1729         * html/HTMLMediaElement.idl:
1730         * page/Settings.yaml:
1731         * platform/graphics/MediaPlayer.h:
1732         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1733         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1734         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
1735         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1736         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
1737         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
1738         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
1739
1740 2018-10-04  Chris Dumez  <cdumez@apple.com>
1741
1742         A Document / Window should lose its browsing context as soon as its iframe is removed from the document
1743         https://bugs.webkit.org/show_bug.cgi?id=190282
1744
1745         Reviewed by Ryosuke Niwa.
1746
1747         A Document / Window should lose its browsing context (aka Frame) as soon as its iframe is removed from
1748         the document. In WebKit, a Document / Window's Frame was only getting nulled out when the frame gets
1749         destroyed, which happens later usually after a GC happens.
1750
1751         Specification:
1752         - https://html.spec.whatwg.org/#the-iframe-element
1753         """
1754         When an iframe element is removed from a document, the user agent must discard the element's nested browsing
1755         context, if it is not null, and then set the element's nested browsing context to null.
1756         """
1757
1758         This was not consistent with the specification or other browsers (tested Chrome and Firefox) so this
1759         patch is aligning our behavior.
1760
1761         In a follow-up, I am planning to look into making the Window not be a FrameDestructionObserver, and instead
1762         get its frame from the Document. This should make the code simpler.
1763
1764         No new tests, rebaselined existing tests.
1765
1766         * Modules/mediastream/MediaDevices.cpp:
1767         (WebCore::MediaDevices::getUserMedia const):
1768         * Modules/mediastream/MediaDevices.h:
1769         Update getUserMedia() to reject a the Promise with an InvalidStateError when calling after the
1770         document has been detached, instead of throwing an InvalidStateError. This behavior is as per
1771         specification:
1772         - https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia (Step 4)
1773         I needed to make this change to keep one of our layout tests passing.
1774
1775         * dom/Document.cpp:
1776         (WebCore::Document::attachToCachedFrame):
1777         (WebCore::Document::detachFromFrame):
1778         * dom/Document.h:
1779         * page/DOMWindow.cpp:
1780         (WebCore::DOMWindow::didSecureTransitionTo):
1781         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1782         (WebCore::DOMWindow::setStatus):
1783         (WebCore::DOMWindow::detachFromFrame):
1784         (WebCore::DOMWindow::attachToFrame):
1785         * page/DOMWindow.h:
1786         * page/DOMWindowProperty.cpp:
1787         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
1788         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
1789         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
1790         * page/Frame.cpp:
1791         (WebCore::Frame::disconnectOwnerElement):
1792
1793         * platform/mock/MockRealtimeVideoSource.cpp:
1794         (WebCore::MockRealtimeVideoSource::drawText):
1795         Calling drawText() with a null String hits an assertion in debug. This was triggered by one of
1796         our layout tests so I made sure we only call drawText when the String is not null.
1797
1798 2018-10-04  Jeremy Jones  <jeremyj@apple.com>
1799
1800         Unify implementation in VideoFullscreenInterfaceAVKit
1801         https://bugs.webkit.org/show_bug.cgi?id=190091
1802         rdar://problem/44734523
1803
1804         Reviewed by Jer Noble.
1805
1806         No new tests because no behavior change.
1807
1808         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
1809         any changes that had been made in the old path.
1810
1811         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1812         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1813         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
1814         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
1815         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1816         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1817         (VideoFullscreenControllerContext::requestUpdateInlineRect):
1818         (VideoFullscreenControllerContext::requestVideoContentLayer):
1819         (VideoFullscreenControllerContext::returnVideoContentLayer):
1820         (VideoFullscreenControllerContext::didSetupFullscreen):
1821         (VideoFullscreenControllerContext::didExitFullscreen):
1822
1823 2018-10-04  Justin Michaud  <justin_michaud@apple.com>
1824
1825         Bindings generator should support static attributes that are interfaces with CallWith
1826         https://bugs.webkit.org/show_bug.cgi?id=190292
1827
1828         Reviewed by Chris Dumez.
1829
1830         Add support for static attributes that support callWith to the bindings generator. This
1831         is needed for CSS.paintWorklet.
1832
1833         * bindings/scripts/CodeGeneratorJS.pm:
1834         (GenerateAttributeGetterBodyDefinition):
1835         * bindings/scripts/test/JS/JSTestObj.cpp:
1836         (WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter):
1837         (WebCore::jsTestObjConstructorTestStaticReadonlyObj):
1838         * bindings/scripts/test/TestObj.idl:
1839
1840 2018-10-04  Matt Lewis  <jlewis3@apple.com>
1841
1842         Unreviewed, rolling out r236730.
1843
1844         This caused a consistent crash in test http/tests/media/media-stream/get-display-media-prompt.html.
1845
1846         Reverted changeset:
1847
1848         "[MediaStream] RealtimeMediaSource should be able to vend
1849         hashed IDs"
1850         https://bugs.webkit.org/show_bug.cgi?id=190142
1851         https://trac.webkit.org/changeset/236730
1852
1853 2018-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1854
1855         [macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2
1856         https://bugs.webkit.org/show_bug.cgi?id=190289
1857         <rdar://problem/45020806>
1858
1859         Reviewed by Ryosuke Niwa.
1860
1861         Makes some small adjustments to fix two bugs in font attribute conversion logic. See below for more detail.
1862
1863         Tests:  FontManagerTests.AddFontShadowUsingFontOptions
1864                 FontManagerTests.AddAndRemoveColorsUsingFontOptions
1865
1866         * editing/FontAttributeChanges.cpp:
1867         (WebCore::cssValueListForShadow):
1868         * editing/cocoa/FontAttributesCocoa.mm:
1869
1870         Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
1871         have negative dimensions, so a check for `isZero()` should be used instead.
1872
1873         (WebCore::FontAttributes::createDictionary const):
1874         * platform/mac/WebCoreNSFontManagerExtras.mm:
1875
1876         Fall back to a transparent background color; this allows senders to remove the current background color by just
1877         removing NSBackgroundColorAttributeName from the attribute dictionary, rather than explicitly setting it to the
1878         transparent color (this scenario is exercised when using "Font > Styles…" to specify a font style without a
1879         background color).
1880
1881         (WebCore::computedFontAttributeChanges):
1882
1883 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1884
1885         MutationRecord doesn't keep JS wrappers of target, addedNodes, and removedNodes alive
1886         https://bugs.webkit.org/show_bug.cgi?id=190277
1887
1888         Reviewed by Antti Koivisto.
1889
1890         The bug was caused by JSMutationRecord not visiting any of the nodes referenced by mutation records.
1891
1892         Fixed the bug by adding JSMutationRecord::visitAdditionalChildren, which adds the root nodes of
1893         the root nodes of the target, addedNodes, and removedNodes in each mutation record.
1894
1895         Test: fast/dom/MutationObserver/mutation-record-keeps-js-wrappers-of-nodes-alive.html
1896
1897         * Sources.txt:
1898         * WebCore.xcodeproj/project.pbxproj:
1899         * bindings/js/JSMutationRecordCustom.cpp: Added.
1900         (WebCore::JSMutationRecord::visitAdditionalChildren): Added.
1901         * bindings/js/JSPerformanceObserverCustom.cpp: This file got dumped out of a unified build file
1902         where using namespace JSC was defined. Use the fully qualified names to refer to JSC types.
1903         (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
1904         * dom/MutationRecord.cpp:
1905         (WebCore::ChildListRecord::visitNodesConcurrently): Added.
1906         (WebCore::RecordWithEmptyNodeLists::visitNodesConcurrently): Added.
1907         (WebCore::MutationRecordWithNullOldValue::visitNodesConcurrently): Added.
1908         * dom/MutationRecord.h:
1909         * dom/MutationRecord.idl:
1910
1911 2018-10-04  Jiewen Tan  <jiewen_tan@apple.com>
1912
1913         [WebAuthN] Move time out control from WebProcess to UIProcess
1914         https://bugs.webkit.org/show_bug.cgi?id=189642
1915         <rdar://problem/44476765>
1916
1917         Reviewed by Chris Dumez.
1918
1919         Since now the control unit of WebAuthN has been moved to UI Process, i.e. AuthenticatorManager,
1920         the time out timer should move to UI Process as well.
1921
1922         Tests: http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html
1923                http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html
1924
1925         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1926         (WebCore::AuthenticatorCoordinator::create const):
1927         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
1928         (WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): Deleted.
1929         (WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): Deleted.
1930         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1931         (WebCore::PublicKeyCredentialCreationOptions::encode const):
1932         (WebCore::PublicKeyCredentialCreationOptions::decode):
1933         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
1934         (WebCore::PublicKeyCredentialRequestOptions::encode const):
1935         (WebCore::PublicKeyCredentialRequestOptions::decode):
1936
1937 2018-10-04  Chris Dumez  <cdumez@apple.com>
1938
1939         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
1940         https://bugs.webkit.org/show_bug.cgi?id=190252
1941
1942         Reviewed by Alex Christensen.
1943
1944         Add a null check for element() after firing the 'input' event and before firing the 'change' event
1945         in case the input event listener changes the input type.
1946
1947         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
1948                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
1949
1950         * html/BaseCheckableInputType.cpp:
1951         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
1952
1953 2018-10-04  Yuhan Wu  <yuhan_wu@apple.com>
1954
1955         runtime flag and IDL for MediaRecorder
1956         https://bugs.webkit.org/show_bug.cgi?id=190018
1957
1958         Reviewed by Youenn Fablet and Chris Dumez.
1959
1960         Covered by tests:
1961         imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
1962         imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
1963
1964         Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.
1965
1966         * CMakeLists.txt:
1967         * DerivedSources.make:
1968         * Modules/mediarecorder/BlobEvent.h:
1969         (WebCore::BlobEvent::create):
1970         (WebCore::BlobEvent:::Event):
1971         * Modules/mediarecorder/BlobEvent.idl:
1972         * Modules/mediarecorder/MediaRecorder.cpp:
1973         (WebCore::MediaRecorder::create):
1974         (WebCore::MediaRecorder::MediaRecorder):
1975         (WebCore::MediaRecorder::activeDOMObjectName const):
1976         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
1977         * Modules/mediarecorder/MediaRecorder.h: Added.
1978         (WebCore::MediaRecorder::state const):
1979         (WebCore::MediaRecorder::~MediaRecorder):
1980         * Modules/mediarecorder/MediaRecorder.idl:
1981         * Modules/mediastream/RTCRtpReceiver.cpp:
1982         * Sources.txt:
1983         * WebCore.xcodeproj/project.pbxproj:
1984         * bindings/js/WebCoreBuiltinNames.h:
1985         * page/RuntimeEnabledFeatures.h:
1986         (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
1987         (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):
1988
1989 2018-10-04  Chris Dumez  <cdumez@apple.com>
1990
1991         Unreviewed, rolling out r236803.
1992
1993         Caused crashes on some bots
1994
1995         Reverted changeset:
1996
1997         "Regression(r236779): Crash when changing the input element
1998         type from inside an 'input' event listener"
1999         https://bugs.webkit.org/show_bug.cgi?id=190252
2000         https://trac.webkit.org/changeset/236803
2001
2002 2018-10-04  Dan Bernstein  <mitz@apple.com>
2003
2004         Tried to fix the Mojave build after r236832.
2005
2006         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2007         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
2008         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
2009
2010 2018-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2011
2012         ENABLE(ASSERT) used in grid code when !ASSERT_DISABLED is desired
2013         https://bugs.webkit.org/show_bug.cgi?id=190145
2014
2015         Reviewed by Javier Fernandez.
2016
2017         Replace ENABLE(ASSERT), which doesn't exist, with !ASSERT_DISABLED.
2018
2019         * rendering/RenderGrid.cpp:
2020         (WebCore::RenderGrid::placeItemsOnGrid const):
2021         (WebCore::RenderGrid::baselinePosition const):
2022         * rendering/style/GridArea.h:
2023         (WebCore::GridSpan::GridSpan):
2024
2025 2018-10-04  Dan Bernstein  <mitz@apple.com>
2026
2027         WebCore part of [Xcode] Update some build settings as recommended by Xcode 10
2028         https://bugs.webkit.org/show_bug.cgi?id=190250
2029
2030         Reviewed by Andy Estes.
2031
2032         * Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF,
2033           CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, and CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS.
2034
2035         * WebCore.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck and remove a
2036           duplicate reference in a Compile Sources build phase.
2037
2038         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Suppress -Wdeprecated-implementations
2039           around implementations of deprecated accessibility methods.
2040
2041         * loader/TextResourceDecoder.cpp:
2042         (WebCore::TextResourceDecoder::checkForBOM): Addressed CLANG_WARN_COMMA.
2043
2044         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2045         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
2046           Suppress -Wdeprecated-implementations around implementations of this deprecated delegate method.
2047         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): Ditto.
2048
2049 2018-10-02  Darin Adler  <darin@apple.com>
2050
2051         AudioNode.connect should use [ReturnValue]
2052         https://bugs.webkit.org/show_bug.cgi?id=190231
2053
2054         Reviewed by Eric Carlson.
2055
2056         This is a slightly more efficient way to return a value that is always
2057         identical to one of the arguments, so use it here.
2058
2059         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2060         (WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>.
2061         * Modules/webaudio/AudioBasicInspectorNode.h: Ditto.
2062         * Modules/webaudio/AudioNode.cpp:
2063         (WebCore::AudioNode::connect): Ditto.
2064         * Modules/webaudio/AudioNode.h: Ditto.
2065
2066         * Modules/webaudio/AudioNode.idl: Use [ReturnValue].
2067
2068 2018-10-03  Justin Michaud  <justin_michaud@apple.com>
2069
2070         Registered custom properties should allow inheritance to be controlled
2071         https://bugs.webkit.org/show_bug.cgi?id=190038
2072
2073         Reviewed by Antti Koivisto.
2074
2075         Tests: css-custom-properties-api/inherits.html
2076                css-custom-properties-api/length.html
2077                css-custom-properties-api/length2.html
2078
2079         Add support for inherits property on registered css custom properties, as well
2080         as a starting point for evaluating registered custom properties with types. Registered
2081         custom properties are evaluated as length values before being substituted. Currently,
2082         relative unit cycles are not detected.
2083
2084         A proper solution is still needed to resolve relative unit cycles, and to apply properties like font
2085         and line-height before they are needed by custom properties. In this patch, the font-size property is
2086         applied twice, once before and once after resolving custom property values.
2087
2088         * Sources.txt:
2089         * WebCore.xcodeproj/project.pbxproj:
2090         * css/CSSComputedStyleDeclaration.cpp:
2091         (WebCore::ComputedStyleExtractor::customPropertyValue):
2092         (WebCore::CSSComputedStyleDeclaration::length const):
2093         (WebCore::CSSComputedStyleDeclaration::item const):
2094
2095         Allow JS to get custom properties that have been resolved to a length. Also add properties from
2096         m_rareNonInheritedData.
2097
2098         * css/CSSCustomPropertyValue.cpp:
2099         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
2100         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
2101         * css/CSSCustomPropertyValue.h:
2102         * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h.
2103         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
2104         (WebCore::CSSRegisteredCustomProperty::initialValueCopy const):
2105         * css/CSSRegisteredCustomProperty.h:
2106         (WebCore::CSSRegisteredCustomProperty::initialValue const):
2107         * css/CSSVariableData.cpp:
2108         (WebCore::CSSVariableData::checkVariablesForCycles const):
2109         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
2110         (WebCore::CSSVariableData::resolveVariableFallback const):
2111         (WebCore::CSSVariableData::resolveVariableReference const):
2112         (WebCore::CSSVariableData::resolveVariableReferences const):
2113         (WebCore::CSSVariableData::resolveTokenRange const):
2114         * css/CSSVariableData.h:
2115         * css/CSSVariableReferenceValue.cpp:
2116         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
2117         * css/CSSVariableReferenceValue.h:
2118         * css/DOMCSSRegisterCustomProperty.cpp:
2119         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2120
2121         Use RenderStyle over passing in a customProperties map.
2122
2123         * css/StyleBuilder.h:
2124         * css/StyleBuilderConverter.h:
2125         (WebCore::StyleBuilderConverter::convertLength):
2126         (WebCore::StyleBuilderConverter::convertLengthOrAuto):
2127         (WebCore::StyleBuilderConverter::convertLengthSizing):
2128         (WebCore::StyleBuilderConverter::convertLengthMaxSizing):
2129         * css/StyleBuilderCustom.h:
2130         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
2131         (WebCore::StyleBuilderCustom::applyInheritCustomProperty):
2132         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
2133         * css/StyleResolver.cpp:
2134         (WebCore::StyleResolver::useSVGZoomRules const):
2135         (WebCore::StyleResolver::useSVGZoomRulesForLength const):
2136         (WebCore::StyleResolver::applyProperty):
2137         (WebCore::StyleResolver::resolvedVariableValue const):
2138         (WebCore::StyleResolver::applyCascadedProperties):
2139         (WebCore::StyleResolver::useSVGZoomRules): Deleted.
2140         (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted.
2141         (WebCore::StyleResolver::resolvedVariableValue): Deleted.
2142         * css/StyleResolver.h:
2143         * css/makeprop.pl:
2144
2145         Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with
2146         inheritance, unset and revert values.
2147
2148         * css/parser/CSSParser.cpp:
2149         (WebCore::CSSParser::parseValueWithVariableReferences):
2150         * css/parser/CSSParser.h:
2151         * css/parser/CSSParserContext.cpp:
2152         (WebCore::CSSParserContext::CSSParserContext):
2153         * css/parser/CSSParserContext.h:
2154         * css/parser/CSSPropertyParser.cpp:
2155         (WebCore::CSSPropertyParser::parseSingleValue):
2156
2157         Allow parsing custom property values as lengths.
2158
2159         * rendering/style/RenderStyle.cpp:
2160         (WebCore::RenderStyle::checkVariablesInCustomProperties):
2161         * rendering/style/RenderStyle.h:
2162         (WebCore::RenderStyle::inheritedCustomProperties const):
2163         (WebCore::RenderStyle::nonInheritedCustomProperties const):
2164         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
2165         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
2166         (WebCore::RenderStyle::getCustomProperty const):
2167         (WebCore::RenderStyle::customProperties const): Deleted.
2168         (WebCore::RenderStyle::setCustomPropertyValue): Deleted.
2169         * rendering/style/StyleRareNonInheritedData.cpp:
2170         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2171         (WebCore::StyleRareNonInheritedData::operator== const):
2172         * rendering/style/StyleRareNonInheritedData.h:
2173         * style/StyleResolveForDocument.cpp:
2174         (WebCore::Style::resolveForDocument):
2175
2176         Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find
2177         cycles between them.
2178
2179 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
2180
2181         Clear m_pendingTargets in MutationObserver::takeRecords
2182         https://bugs.webkit.org/show_bug.cgi?id=190240
2183
2184         Reviewed by Geoffrey Garen.
2185
2186         In r236781, we delayed the clearing of m_pendingTargets until the end of microtask to avoid a race between
2187         mutation record's JS wrappers getting created and GC marking JS wrappers of elements in mutation records.
2188
2189         This patch shortens this delay to until mutation record's JS wrappers are created. Specifically, we make
2190         MutationObserver::takeRecords() return a struct which has both pending targets hash set and the vector of
2191         mutation records so that the hash set survives through the creation of JS wrappers for mutation records.
2192
2193         To do this, a new IDL extended attribute "ResultField" is introduced to specify the member variable in
2194         which the result is stored.
2195
2196         No new tests. Unfortunately, this race condition appears to be impossible to capture in a regression test.
2197
2198         * bindings/scripts/CodeGeneratorJS.pm:
2199         (GenerateOperationBodyDefinition):
2200         * bindings/scripts/IDLAttributes.json:
2201         * bindings/scripts/test/JS/JSTestInterface.cpp:
2202         (WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody):
2203         (WebCore::jsTestInterfacePrototypeFunctionTakeNodes):
2204         * bindings/scripts/test/TestImplements.idl: Added a test case.
2205         * dom/MutationObserver.cpp:
2206         (WebCore::MutationObserver::takeRecords):
2207         (WebCore::MutationObserver::deliver):
2208         * dom/MutationObserver.h:
2209         * dom/MutationObserver.idl:
2210
2211 2018-10-03  Youenn Fablet  <youenn@apple.com>
2212
2213         Add VP8 support to WebRTC
2214         https://bugs.webkit.org/show_bug.cgi?id=189976
2215
2216         Reviewed by Eric Carlson.
2217
2218         Add a runtime flag to control activation of VP8 codec.
2219         Bind this runtime flag to the video codec factories.
2220         Test: webrtc/video-mute-vp8.html
2221
2222         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2223         (WebCore::createLibWebRTCPeerConnectionBackend):
2224         * page/RuntimeEnabledFeatures.h:
2225         (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
2226         (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
2227         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2228         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2229         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2230         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2231         * testing/Internals.cpp:
2232         (WebCore::Internals::resetToConsistentState):
2233         Enable VP8 codec for tests.
2234
2235 2018-09-28  Jiewen Tan  <jiewen_tan@apple.com>
2236
2237         [WebCrypto] ECDSA could not deal with invalid signature inputs
2238         https://bugs.webkit.org/show_bug.cgi?id=189879
2239         <rdar://problem/44701276>
2240
2241         Reviewed by Brent Fulgham.
2242
2243         Add some guards over detections of the start positions of r/s.
2244
2245         Covered by improved existing tests.
2246
2247         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
2248         (WebCore::verifyECDSA):
2249
2250 2018-10-03  Jer Noble  <jer.noble@apple.com>
2251
2252         Add a quirk to disable Modern EME for sites which are broken with it enabled
2253         https://bugs.webkit.org/show_bug.cgi?id=190051
2254
2255         Reviewed by Daniel Bates.
2256
2257         Add a new class, parallel to Settings, to track quirk behavior. Extend the bindings
2258         generator to support a DisabledByQuirk attribute, and set this attribute for all
2259         the Modern EME types. Check whether the quirk is set inside HTMLMediaElement in
2260         addition to the existing Setting.
2261
2262         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
2263         * Modules/encryptedmedia/MediaKeySession.idl:
2264         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
2265         * Modules/encryptedmedia/MediaKeySystemAccess.idl:
2266         * Modules/encryptedmedia/MediaKeys.idl:
2267         * Modules/encryptedmedia/NavigatorEME.idl:
2268         * Sources.txt:
2269         * WebCore.xcodeproj/project.pbxproj:
2270         * bindings/scripts/CodeGenerator.pm:
2271         (WK_ucfirst):
2272         * bindings/scripts/CodeGeneratorJS.pm:
2273         (NeedsRuntimeCheck):
2274         (GenerateRuntimeEnableConditionalString):
2275         * bindings/scripts/IDLAttributes.json:
2276         * bindings/scripts/preprocess-idls.pl:
2277         (GenerateConstructorAttributes):
2278         * dom/Document.cpp:
2279         (WebCore::Document::Document):
2280         * dom/Document.h:
2281         (WebCore::Document::quirks const):
2282         * html/HTMLMediaElement.cpp:
2283         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
2284         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
2285         * html/HTMLMediaElement.idl:
2286         * page/Quirks.cpp: Added.
2287         (Quirks::Quirks):
2288         (Quirks::disableEncryptedMediaAPIQuirk const):
2289         * page/Quirks.h: Added.
2290
2291 2018-10-03  Antoine Quint  <graouts@apple.com>
2292
2293         [Web Animations] REGRESSION: setting 'animation-name: none' after a 'fill: forwards' animation has completed does not revert to the unanimated style
2294         https://bugs.webkit.org/show_bug.cgi?id=190257
2295         <rdar://problem/41341473>
2296
2297         Reviewed by Dean Jackson.
2298
2299         Test: animations/animation-fill-forwards-removal.html
2300
2301         While we removed a declarative animation that was no longer targetting its element, we were not removing it from the declarative animation maps
2302         on the timeline, which means that the animation would still be picked up when resolving styles. We now notify the timeline that the animation
2303         was detached from the element. This preserves the DeclarativeAnimation relationship returning the element as its effect's target and the document
2304         timeline as its timeline, but the document timeline will no longer see this animation as targeting this element.
2305
2306         * animation/AnimationTimeline.cpp:
2307         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
2308         * animation/DeclarativeAnimation.h:
2309         (WebCore::DeclarativeAnimation::target const):
2310
2311 2018-10-03  Jer Noble  <jer.noble@apple.com>
2312
2313         CRASH in CVPixelBufferGetBytePointerCallback()
2314         https://bugs.webkit.org/show_bug.cgi?id=190092
2315
2316         Reviewed by Eric Carlson.
2317
2318         Speculative fix for crash that occurs when callers of CVPixelBufferGetBytePointerCallback() attempt
2319         to read the last byte of a CVPixelBuffer (as a pre-flight check) and crash due to a memory access
2320         error. It's speculated that mismatching CVPixelBufferLockBytePointer / CVPixelBufferUnlockBytePointer
2321         calls could result in an incorrect state inside the CVPixelBuffer. Add log count checks, locking, and
2322         release logging to try to pinpoint if mismatch lock counts are occurring in this code path.
2323
2324         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2325         (WebCore::CVPixelBufferGetBytePointerCallback):
2326         (WebCore::CVPixelBufferReleaseBytePointerCallback):
2327         (WebCore::CVPixelBufferReleaseInfoCallback):
2328         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2329
2330 2018-10-03  Chris Dumez  <cdumez@apple.com>
2331
2332         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
2333         https://bugs.webkit.org/show_bug.cgi?id=190252
2334
2335         Reviewed by Alex Christensen.
2336
2337         Add a null check for element() after firing the 'input' event and before firing the 'change' event
2338         in case the input event listener changes the input type.
2339
2340         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
2341                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
2342
2343         * html/BaseCheckableInputType.cpp:
2344         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
2345
2346 2018-10-03  Chris Dumez  <cdumez@apple.com>
2347
2348         Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener
2349         https://bugs.webkit.org/show_bug.cgi?id=190251
2350
2351         Reviewed by Alex Christensen.
2352
2353         Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener,
2354         similarly to noopener=1:
2355         - https://html.spec.whatwg.org/#window-open-steps (step 5)
2356
2357         It does not matter what the value is, if there is a key named "noopener", then the new window
2358         should not have an opener.
2359
2360         No new tests, rebaselined existing test.
2361
2362         * page/WindowFeatures.cpp:
2363         (WebCore::setWindowFeature):
2364
2365 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
2366
2367         GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
2368         https://bugs.webkit.org/show_bug.cgi?id=190115
2369
2370         Reviewed by Geoffrey Garen.
2371
2372         Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
2373
2374         This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
2375         target is kept alive and MutationObserverRegistration where each node which had been removed
2376         from an observed tree is kept alive for a subtree observation.
2377
2378         No new test since the test which can reproduce this problem is too slow.
2379
2380         * dom/GCReachableRef.h:
2381         (WebCore::GCReachableRef): Made it work with hash table.
2382         (WebCore::GCReachableRef::operator T& const):
2383         (WebCore::GCReachableRef::GCReachableRef):
2384         (WebCore::GCReachableRef::isHashTableDeletedValue const):
2385         (WebCore::GCReachableRef::isHashTableEmptyValue const):
2386         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
2387         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
2388         (WebCore::GCReachableRef::assignToHashTableEmptyValue):
2389         (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
2390         (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
2391         (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
2392         (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
2393         (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
2394         (WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
2395         * dom/MutationObserver.cpp:
2396         (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
2397         to be collected before elements in mutation records are accessed. We delay until the end of the current
2398         microtask at which point deliver() function is called.
2399         (WebCore::MutationObserver::disconnect):
2400         (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
2401         This is needed for a newly inserted node, a node with attribute change, etc...
2402         (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
2403         records are delivered to each observer. These are nodes which had been removed from a tree and whose
2404         subtree had still been obsreved up until this point.
2405         * dom/MutationObserver.h:
2406         * dom/MutationObserverRegistration.cpp:
2407         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
2408         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
2409         that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
2410         function had been called.
2411         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
2412         * dom/MutationObserverRegistration.h:
2413
2414 2018-10-03  Dean Jackson  <dino@apple.com>
2415
2416         Make the Pointer Events feature description valid
2417         https://bugs.webkit.org/show_bug.cgi?id=190254
2418
2419         Reviewed by Simon Fraser.
2420
2421         * features.json:
2422
2423 2018-10-03  Matt Lewis  <jlewis3@apple.com>
2424
2425         Unreviewed, rolling out r236781.
2426
2427         The test added with this commit is timing out consistently.
2428
2429         Reverted changeset:
2430
2431         "GC can collect JS wrappers of nodes in the mutation records
2432         waiting to be delivered"
2433         https://bugs.webkit.org/show_bug.cgi?id=190115
2434         https://trac.webkit.org/changeset/236781
2435
2436 2018-10-03  Dean Jackson  <dino@apple.com>
2437
2438         [macOS] Switching to discrete GPU should be done in the UI process
2439         https://bugs.webkit.org/show_bug.cgi?id=189361
2440         <rdar://problem/43949622>
2441
2442         Try to fix the IOSMAC build.
2443
2444         * platform/graphics/GraphicsContext3D.h:
2445
2446 2018-10-03  Chris Dumez  <cdumez@apple.com>
2447
2448         input.checked is incorrect while we're parsing its children
2449         https://bugs.webkit.org/show_bug.cgi?id=190227
2450
2451         Reviewed by Ryosuke Niwa.
2452
2453         input.checked was incorrect while we're parsing its children because we were delaying updating the
2454         checked state until HTMLInputElement::finishParsingChildren() is called, to avoid a bad interaction
2455         with form state restoration.
2456
2457         In this patch, we update the checked state as soon as the 'checked' attribute is set, when we know
2458         that no form state to restore.
2459
2460         fast/forms/radio/state-restore-radio-group.html covers the form restoration case and is still
2461         passing.
2462
2463         No new tests, rebaselined existing test.
2464
2465         * html/FormController.cpp:
2466         (WebCore::FormController::hasFormStateToRestore const):
2467         * html/FormController.h:
2468         * html/HTMLInputElement.cpp:
2469         (WebCore::HTMLInputElement::parseAttribute):
2470
2471 2018-10-03  Miguel Gomez  <magomez@igalia.com>
2472
2473         [GTK][WPE] Incorrect rendering of layers whose backingStore hasn't changed
2474         https://bugs.webkit.org/show_bug.cgi?id=190249
2475
2476         Reviewed by Žan Doberšek.
2477
2478         Do not overwrite m_nicosia.performLayerSync when updating the content buffers or we lose
2479         the value calculated during the layer flush. Use an OR instead to keep the old value.
2480
2481         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2482         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2483
2484 2018-10-03  Youenn Fablet  <youenn@apple.com>
2485
2486         Enable H264 simulcast
2487         https://bugs.webkit.org/show_bug.cgi?id=190167
2488
2489         Reviewed by Eric Carlson.
2490
2491         Activate H264 simulcast trial field.
2492         Make track.getSettings() expose width and height for incoming tracks.
2493
2494         Test: webrtc/simulcast-h264.html
2495
2496         * Configurations/WebCore.xcconfig:
2497         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2498         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
2499         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2500         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2501
2502 2018-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2503
2504         -Wunused-variable in RenderLayer::updateScrollableAreaSet
2505         https://bugs.webkit.org/show_bug.cgi?id=190200
2506
2507         Reviewed by Yusuke Suzuki.
2508
2509         Pass it through UNUSED_VARIABLE().
2510
2511         * rendering/RenderLayer.cpp:
2512         (WebCore::RenderLayer::calculateClipRects const):
2513
2514 2018-10-03  Zan Dobersek  <zdobersek@igalia.com>
2515
2516         Ref<FetchResponse> use-after-move in DOMCache::put()
2517         https://bugs.webkit.org/show_bug.cgi?id=190239
2518
2519         Reviewed by Youenn Fablet.
2520
2521         Retrieve reference from the Ref<FetchResponse> object before it's
2522         move-captured in the lambda that's passed to the
2523         FetchResponse::consumeBodyReceivedByChunk() method that is invoked on
2524         that very same object. This is a classic use-after-move bug that pops
2525         up on compilers with different C++ calling convention.
2526
2527         * Modules/cache/DOMCache.cpp:
2528         (WebCore::DOMCache::put):
2529
2530 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
2531
2532         Enable selectionAcrossShadowBoundariesEnabled by default in WebKitLegacy
2533         https://bugs.webkit.org/show_bug.cgi?id=190238
2534
2535         Reviewed by Antti Koivisto.
2536
2537         Enable the feature by default.
2538
2539         * page/Settings.yaml:
2540
2541 2018-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2542
2543         Copying content with shadow DOM doesn't copy any contents
2544         https://bugs.webkit.org/show_bug.cgi?id=157443
2545
2546         Reviewed by Wenson Hsieh.
2547
2548         This patch adds the support for copying and pasting content across shadow boundaries in HTML and plain text,
2549         which is enabled whenever selection across shadow boundaries is enabled.
2550
2551         To do this, TextIterator now has a constructor which takes two Positions, and the node traversal code in
2552         StyledMarkupAccumulator has been abstracted via helper functions as done for TextIterator.
2553
2554         When serializing a HTMl slot element, serialize it as a span with "display: contents" to make sure when
2555         the content is pasted into a shadow tree, it wouldn't affect the slot assignment of the shadow tree.
2556
2557         Tests: editing/pasteboard/copy-paste-across-shadow-boundaries-1.html
2558                editing/pasteboard/copy-paste-across-shadow-boundaries-2.html
2559                editing/pasteboard/copy-paste-across-shadow-boundaries-3.html
2560                editing/pasteboard/copy-paste-across-shadow-boundaries-4.html
2561                editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-1.html
2562                editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2.html
2563                editing/pasteboard/copy-paste-with-shadow-content.html
2564
2565         * dom/ComposedTreeIterator.h:
2566         (WebCore::assignedSlotIgnoringUserAgentShadow): Moved from TextIterator.cpp.
2567         (WebCore::shadowRootIgnoringUserAgentShadow): Ditto.
2568         (WebCore::firstChildInComposedTreeIgnoringUserAgentShadow): Ditto.
2569         (WebCore::nextSiblingInComposedTreeIgnoringUserAgentShadow): Ditto.
2570         * dom/Position.h:
2571         (WebCore::Position::treeScope const): Added.
2572         * editing/EditingStyle.cpp:
2573         (WebCore::EditingStyle::addDisplayContents): Added.
2574         * editing/EditingStyle.h:
2575         * editing/Editor.cpp:
2576         (WebCore::Editor::selectedText const): Use the new behavior when selectionAcrossShadowBoundariesEnabled is set.
2577         (WebCore::Editor::selectedTextForDataTransfer const): Ditto.
2578         * editing/MarkupAccumulator.cpp:
2579         (WebCore::MarkupAccumulator::appendEndElement): Renamed from appendEndTag. Now takes StringBuilder.
2580         * editing/MarkupAccumulator.h:
2581         (WebCore::MarkupAccumulator::appendEndTag):
2582         * editing/TextIterator.cpp:
2583         (WebCore::TextIterator::TextIterator): Added a new variant which takes two positions.
2584         (WebCore::TextIterator::init):
2585         (WebCore::firstChild):
2586         (WebCore::nextSibling):
2587         (WebCore::plainText): Ditto.
2588         * editing/TextIterator.h:
2589         * editing/cocoa/EditorCocoa.mm:
2590         (WebCore::Editor::selectionInHTMLFormat): Use the new behavior if selectionAcrossShadowBoundariesEnabled is set.
2591         * editing/gtk/EditorGtk.cpp:
2592         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
2593         * editing/markup.cpp:
2594         (WebCore::StyledMarkupAccumulator::parentNode): Added.
2595         (WebCore::StyledMarkupAccumulator::firstChild): Added.
2596         (WebCore::StyledMarkupAccumulator::nextSibling): Added.
2597         (WebCore::StyledMarkupAccumulator::nextSkippingChildren): Added.
2598         (WebCore::StyledMarkupAccumulator::hasChildNodes): Added.
2599         (WebCore::StyledMarkupAccumulator::isDescendantOf): Added.
2600         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
2601         (WebCore::StyledMarkupAccumulator::appendElement): Serialize a slot element as a span with display: contents.
2602         (WebCore::StyledMarkupAccumulator::appendEndElement): Added. Ditto.
2603         (WebCore::StyledMarkupAccumulator::serializeNodes):
2604         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Use the newly added helper functions to
2605         traverse the composed tree when m_useComposedTree is set.
2606         (WebCore::commonShadowIncludingAncestor): Added.
2607         (WebCore::serializePreservingVisualAppearanceInternal): Added SerializeComposedTree as an argument. Also use
2608         StyledMarkupAccumulator::parentNode to serialize special common ancestors; e.g. to preserve b, i, etc...
2609         (WebCore::serializePreservingVisualAppearance): Ditto to the variant which takes VisibleSelection.
2610         (WebCore::sanitizedMarkupForFragmentInDocument):
2611         * editing/markup.h:
2612         * editing/wpe/EditorWPE.cpp:
2613         (WebCore::Editor::writeSelectionToPasteboard):
2614         * loader/archive/cf/LegacyWebArchive.cpp:
2615         (WebCore::LegacyWebArchive::createFromSelection):
2616         * page/PageSerializer.cpp:
2617         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndElement):
2618         * testing/Internals.cpp:
2619         (WebCore::Internals::setSelectionWithoutValidation): Added. A helper function to create a selection across
2620         shadow boundaries for testing purposes.
2621         * testing/Internals.h:
2622         * testing/Internals.idl:
2623
2624 2018-10-02  Chris Dumez  <cdumez@apple.com>
2625
2626         MessageEvent.ports should return the same object
2627         https://bugs.webkit.org/show_bug.cgi?id=190151
2628
2629         Reviewed by Darin Adler.
2630
2631         MessageEvent.ports should return the same object it was initialized to instead of
2632         constructing a new JSValue every time.
2633
2634         No new tests, rebaselined existing test.
2635
2636         * bindings/js/JSMessageEventCustom.cpp:
2637         (WebCore::JSMessageEvent::ports const):
2638         (WebCore::JSMessageEvent::visitAdditionalChildren):
2639         * dom/MessageEvent.cpp:
2640         (WebCore::MessageEvent::initMessageEvent):
2641         * dom/MessageEvent.h:
2642         * dom/MessageEvent.idl:
2643
2644 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
2645
2646         GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
2647         https://bugs.webkit.org/show_bug.cgi?id=190115
2648
2649         Reviewed by Geoffrey Garen.
2650
2651         Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
2652
2653         This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
2654         target is kept alive and MutationObserverRegistration where each node which had been removed
2655         from an observed tree is kept alive for a subtree observation.
2656
2657         Test: fast/dom/MutationObserver/mutation-observer-retains-js-wrappers-of-targets-alive.html
2658
2659         * dom/GCReachableRef.h:
2660         (WebCore::GCReachableRef): Made it work with hash table.
2661         (WebCore::GCReachableRef::operator T& const):
2662         (WebCore::GCReachableRef::GCReachableRef):
2663         (WebCore::GCReachableRef::isHashTableDeletedValue const):
2664         (WebCore::GCReachableRef::isHashTableEmptyValue const):
2665         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
2666         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
2667         (WebCore::GCReachableRef::assignToHashTableEmptyValue):
2668         (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
2669         (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
2670         (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
2671         (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
2672         (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
2673         (WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
2674         * dom/MutationObserver.cpp:
2675         (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
2676         to be collected before elements in mutation records are accessed. We delay until the end of the current
2677         microtask at which point deliver() function is called.
2678         (WebCore::MutationObserver::disconnect):
2679         (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
2680         This is needed for a newly inserted node, a node with attribute change, etc...
2681         (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
2682         records are delivered to each observer. These are nodes which had been removed from a tree and whose
2683         subtree had still been obsreved up until this point.
2684         * dom/MutationObserver.h:
2685         * dom/MutationObserverRegistration.cpp:
2686         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
2687         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
2688         that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
2689         function had been called.
2690         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
2691         * dom/MutationObserverRegistration.h:
2692
2693 2018-10-02  Chris Dumez  <cdumez@apple.com>
2694
2695         radio / checkbox inputs should fire "click, input, change" events in order when clicked
2696         https://bugs.webkit.org/show_bug.cgi?id=190223
2697
2698         Reviewed by Ryosuke Niwa.
2699
2700         radio / checkbox inputs should fire "click, input, change" events in order when clicked:
2701         - https://html.spec.whatwg.org/#radio-button-state-(type=radio)
2702         - https://html.spec.whatwg.org/#checkbox-state-(type=checkbox)
2703         - https://dom.spec.whatwg.org/#ref-for-eventtarget-activation-behavior③ (step 11)
2704
2705         Gecko and Blink already behave this way. However, WebKit has the following issues:
2706         - the input event is not fired
2707         - the click event is fired after the change event
2708
2709         No new tests, updated / rebaselined existing tests.
2710
2711         * html/BaseCheckableInputType.cpp:
2712         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
2713         * html/BaseCheckableInputType.h:
2714         * html/CheckboxInputType.cpp:
2715         (WebCore::CheckboxInputType::willDispatchClick):
2716         (WebCore::CheckboxInputType::didDispatchClick):
2717         * html/HTMLInputElement.cpp:
2718         (WebCore::HTMLInputElement::setChecked):
2719         * html/HTMLInputElement.h:
2720         * html/RadioInputType.cpp:
2721         (WebCore::RadioInputType::willDispatchClick):
2722         (WebCore::RadioInputType::didDispatchClick):
2723
2724 2018-10-02  Chris Dumez  <cdumez@apple.com>
2725
2726         fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection
2727         https://bugs.webkit.org/show_bug.cgi?id=190218
2728
2729         Reviewed by Alex Christensen.
2730
2731         fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection:
2732         - https://github.com/whatwg/html/commit/8beedf0c2ffd38853caddec67490288f47afc8eb
2733
2734         Gecko has always behaved this way. Blink aligned with Gecko and the HTML specification in December 2016:
2735         - https://bugs.chromium.org/p/chromium/issues/detail?id=665291
2736
2737         This simplifies our HTMLFieldSetElement code a lot.
2738
2739         Test: fast/forms/fieldset/fieldset-elements-htmlcollection.html
2740
2741         * html/CollectionType.h:
2742         * html/GenericCachedHTMLCollection.cpp:
2743         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
2744         * html/HTMLCollection.cpp:
2745         (WebCore::HTMLCollection::rootTypeFromCollectionType):
2746         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
2747         * html/HTMLFieldSetElement.cpp:
2748         (WebCore::HTMLFieldSetElement::elements):
2749         * html/HTMLFieldSetElement.h:
2750         * html/HTMLFieldSetElement.idl:
2751         * html/HTMLFormControlsCollection.cpp:
2752         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
2753         (WebCore:: const):
2754         (WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
2755         (WebCore::HTMLFormControlsCollection::ownerNode const):
2756         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
2757         * html/HTMLFormControlsCollection.h:
2758
2759 2018-10-02  Devin Rousso  <drousso@apple.com>
2760
2761         Web Inspector: prevent layer events from firing until the layer information is re-requested
2762         https://bugs.webkit.org/show_bug.cgi?id=190159
2763
2764         Reviewed by Joseph Pecoraro.
2765
2766         Test: inspector/layers/layerTreeDidChange.html
2767
2768         * inspector/agents/InspectorLayerTreeAgent.h:
2769         * inspector/agents/InspectorLayerTreeAgent.cpp:
2770         (WebCore::InspectorLayerTreeAgent::reset):
2771         (WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
2772         (WebCore::InspectorLayerTreeAgent::layersForNode):
2773
2774 2018-10-02  Brian Burg  <bburg@apple.com>
2775
2776         Web Automation: tab default key handler should always cycle focus when page is controlled by automation
2777         https://bugs.webkit.org/show_bug.cgi?id=190221
2778         <rdar://problem/44914534>
2779
2780         Reviewed by Joseph Pecoraro.
2781
2782         This change progresses WPT WebDriver test special_keys.py::test_webdriver_special_key_sends_keydown[TAB-expected24].
2783
2784         * page/FocusController.cpp:
2785         (WebCore::FocusController::advanceFocusInDocumentOrder):
2786         Always cycle focus if the page is controlled by automation. If the chrome takes
2787         focus, then the first responder will be something other than the WebView, which
2788         causes subsequent WebDriver commands to hang.
2789
2790 2018-10-01  Dean Jackson  <dino@apple.com>
2791
2792         [macOS] Switching to discrete GPU should be done in the UI process
2793         https://bugs.webkit.org/show_bug.cgi?id=189361
2794         <rdar://problem/43949622>
2795
2796         Reviewed by Simon Fraser.
2797
2798         Based on an earlier patch by Per Arne Vollan.
2799
2800         Due to the fact we can't talk to the Window Server, the Web Process can
2801         no longer muxing to the discrete GPU directly. Instead we have to get the
2802         UI Process to process the change. Do this by adding a new Chrome client
2803         called GPUClient, that will have implementations provided by both WebKit
2804         and legacy WebKit.
2805
2806         Unfortunately this can't be tested by a regular WKTR since:
2807         - it requires specific hardware
2808         - swapping to/from the discrete GPU takes about 20 seconds
2809         - running concurrent tests could confuse the tests into thinking
2810           the wrong GPU is active
2811
2812         Instead we'll write a specific test for this functionality and
2813         run it on a separate bot.
2814
2815         * WebCore.xcodeproj/project.pbxproj: Add GPUClient files.
2816
2817         * page/Chrome.cpp: Drive by clean-up.
2818         (WebCore::Chrome::windowScreenDidChange):
2819
2820         * platform/graphics/GraphicsContext3D.h: We need to keep track of
2821         whether we've muxed for this context, in order to not respond to
2822         the screen change notifications (they are misleading in the case
2823         of muxing).
2824
2825         * platform/graphics/GraphicsContext3DManager.cpp: Rather than try
2826         to mux directly, call into GPUClient.
2827         (WebCore::GraphicsContext3DManager::displayWasReconfigured):
2828         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
2829         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
2830         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
2831         * platform/graphics/GraphicsContext3DManager.h:
2832
2833         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Only reconfigure
2834         the virtual display if it didn't happen from muxing.
2835         (WebCore::GraphicsContext3D::GraphicsContext3D):
2836         (WebCore::GraphicsContext3D::updateCGLContext):
2837         (WebCore::GraphicsContext3D::screenDidChange):
2838
2839         * platform/graphics/mac/SwitchingGPUClient.cpp: Added.
2840         (WebCore::SwitchingGPUClient::singleton):
2841         (WebCore::SwitchingGPUClient::setSingleton):
2842         * platform/graphics/mac/SwitchingGPUClient.h: Added.
2843
2844         * testing/Internals.cpp: Testing helper.
2845         (WebCore::Internals::hasMuxableGPU):
2846         * testing/Internals.h:
2847         * testing/Internals.idl:
2848
2849 2018-10-02  Chris Dumez  <cdumez@apple.com>
2850
2851         Image.__proto__ should be Function.prototype, not HTMLElement.prototype
2852         https://bugs.webkit.org/show_bug.cgi?id=190216
2853
2854         Reviewed by Alex Christensen.
2855
2856         Properties created for named constructors should always use Function.prototype as prototype, as per:
2857         - https://heycam.github.io/webidl/#named-constructors
2858
2859         Gecko and Blink agree with the Web IDL specification. However, WebKit was using the parent interface's
2860         prototype if such a parent existing. So Image.__proto__ would end up being HTMLElement.prototype
2861         instead of Function.prototype.
2862
2863         No new tests, rebaselined existing test.
2864
2865         * bindings/scripts/CodeGeneratorJS.pm:
2866         (GenerateConstructorHelperMethods):
2867
2868 2018-10-02  Alex Christensen  <achristensen@webkit.org>
2869
2870         Prepare WebCoreNSURLExtras for ARC
2871         https://bugs.webkit.org/show_bug.cgi?id=190219
2872
2873         Reviewed by Tim Horton.
2874
2875         ARC doesn't like the explicit sending of -release.
2876         Use RetainPtr instead.
2877
2878         * platform/mac/WebCoreNSURLExtras.mm:
2879         (WebCore::collectRangesThatNeedMapping):
2880         (WebCore::collectRangesThatNeedEncoding):
2881         (WebCore::collectRangesThatNeedDecoding):
2882         (WebCore::applyHostNameFunctionToMailToURLString):
2883         (WebCore::applyHostNameFunctionToURLString):
2884         (WebCore::mapHostNames):
2885         (WebCore::stringByTrimmingWhitespace):
2886         (WebCore::URLWithUserTypedString):
2887         (WebCore::userVisibleString):
2888         (WebCore::rangeOfURLScheme):
2889         (WebCore::looksLikeAbsoluteURL):
2890         (WebCore::retain): Deleted.
2891
2892 2018-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2893
2894         [Curl] Fix missing values of  resource timing API.
2895         https://bugs.webkit.org/show_bug.cgi?id=190193
2896
2897         Reviewed by Alex Christensen.
2898
2899         The property nextHopProtocol was not returned correctly. It was
2900         returned only when remote inspector is opened.
2901
2902         Tests: http/wpt/resource-timing/rt-nextHopProtocol.html
2903                http/wpt/resource-timing/rt-nextHopProtocol.worker.html
2904
2905         * platform/network/curl/CurlContext.cpp:
2906         (WebCore::CurlHandle::getNetworkLoadMetrics):
2907         (WebCore::CurlHandle::addExtraNetworkLoadMetrics):
2908
2909 2018-10-02  Alex Christensen  <achristensen@webkit.org>
2910
2911         Remove unused linked-on-or-before-iOS5 check
2912         https://bugs.webkit.org/show_bug.cgi?id=190164
2913
2914         Reviewed by Michael Saboff.
2915
2916         If an app hasn't been updated since iOS5, it can't run supported iOS.
2917         This value is also only checked in an uninstantiated template function.
2918
2919         * platform/URL.cpp:
2920         (WebCore::enableURLSchemeCanonicalization): Deleted.
2921         (WebCore::equal): Deleted.
2922         * platform/URL.h:
2923
2924 2018-10-02  Alex Christensen  <achristensen@webkit.org>
2925
2926         Remove ParsedURLString
2927         https://bugs.webkit.org/show_bug.cgi?id=190154
2928
2929         Reviewed by Chris Dumez.
2930
2931         Before the introduction of URLParser, it would indicate that we should assume the String
2932         is from a valid URL so we can skip canonicalization and just find the offsets inside the String
2933         to quickly create a URL.  It was a performance optimization that caused security issues when
2934         misused.  Since the introduction of URLParser, we have a fast path for all URL parsing, so
2935         right now it actually doesn't change any behavior.  It's just a relic of the past that complicates
2936         the URL class, making it harder to express which constructor to use and making it harder to move
2937         the class.
2938
2939         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
2940         (WebCore::NavigatorContentUtils::registerProtocolHandler):
2941         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
2942         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
2943         * dom/Document.cpp:
2944         (WebCore::Document::updateBaseURL):
2945         (WebCore::Document::initSecurityContext):
2946         * dom/ExtensionStyleSheets.cpp:
2947         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
2948         * dom/ProcessingInstruction.cpp:
2949         (WebCore::ProcessingInstruction::checkStyleSheet):
2950         * editing/markup.cpp:
2951         (WebCore::completeURLs):
2952         * fileapi/BlobURL.cpp:
2953         (WebCore::BlobURL::createBlobURL):
2954         * history/HistoryItem.cpp:
2955         (WebCore::HistoryItem::url const):
2956         (WebCore::HistoryItem::originalURL const):
2957         * html/HTMLFrameElementBase.cpp:
2958         (WebCore::HTMLFrameElementBase::location const):
2959         * html/HTMLMediaElement.cpp:
2960         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
2961         * html/PublicURLManager.cpp:
2962         (WebCore::PublicURLManager::stop):
2963         * inspector/InspectorStyleSheet.cpp:
2964         (WebCore::InspectorStyleSheet::resourceStyleSheetText const):
2965         * inspector/agents/InspectorPageAgent.cpp:
2966         (WebCore::InspectorPageAgent::getCookies):
2967         (WebCore::InspectorPageAgent::deleteCookie):
2968         (WebCore::InspectorPageAgent::getResourceContent):
2969         (WebCore::InspectorPageAgent::searchInResource):
2970         * inspector/agents/page/PageDebuggerAgent.cpp:
2971         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
2972         * loader/DocumentLoader.cpp:
2973         (WebCore::DocumentLoader::subresources const):
2974         * loader/FrameLoader.cpp:
2975         (WebCore::FrameLoader::init):
2976         (WebCore::FrameLoader::initForSynthesizedDocument):
2977         * loader/HistoryController.cpp:
2978         (WebCore::HistoryController::pushState):
2979         (WebCore::HistoryController::replaceState):
2980         * loader/appcache/ApplicationCache.cpp:
2981         (WebCore::ApplicationCache::addResource):
2982         (WebCore::ApplicationCache::resourceForURL):
2983         * loader/appcache/ApplicationCacheGroup.cpp:
2984         (WebCore::ApplicationCacheGroup::startLoadingEntry):
2985         (WebCore::ApplicationCacheGroup::addEntry):
2986         * loader/appcache/ApplicationCacheStorage.cpp:
2987         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
2988         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
2989         (WebCore::ApplicationCacheStorage::loadCache):
2990         (WebCore::ApplicationCacheStorage::manifestURLs):
2991         * loader/archive/cf/LegacyWebArchive.cpp:
2992         (WebCore::LegacyWebArchive::create):
2993         * page/DOMWindow.cpp:
2994         (WebCore::DOMWindow::createWindow):
2995         * page/PageSerializer.cpp:
2996         (WebCore::PageSerializer::urlForBlankFrame):
2997         * platform/URL.cpp:
2998         (WebCore::blankURL):
2999         * platform/URL.h:
3000         (): Deleted.
3001         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3002         (WebCore::MediaPlayerPrivateAVFoundation::load):
3003         * platform/network/BlobRegistryImpl.cpp:
3004         (WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
3005         * platform/network/ResourceRequestBase.h:
3006         (WebCore::ResourceRequestBase::decodeBase):
3007         * platform/network/ResourceResponseBase.cpp:
3008         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
3009         * platform/network/cf/DNSResolveQueueCFNet.cpp:
3010         (WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):
3011         * platform/network/cf/ResourceRequest.h:
3012         (WebCore::ResourceRequest::ResourceRequest):
3013         * platform/network/curl/CookieJarDB.cpp:
3014         (WebCore::CookieJarDB::searchCookies):
3015         (WebCore::CookieJarDB::setCookie):
3016         (WebCore::CookieJarDB::deleteCookie):
3017         * platform/network/curl/ResourceRequest.h:
3018         (WebCore::ResourceRequest::ResourceRequest):
3019         * platform/network/soup/ResourceRequest.h:
3020         (WebCore::ResourceRequest::ResourceRequest):
3021         * xml/XSLTProcessorLibxslt.cpp:
3022         (WebCore::docLoaderFunc):
3023
3024 2018-10-02  Per Arne Vollan  <pvollan@apple.com>
3025
3026         [WebVTT] Cue with line setting is not rendered correctly
3027         https://bugs.webkit.org/show_bug.cgi?id=190168
3028
3029         Reviewed by Eric Carlson.
3030
3031         When the line setting contains an optional alignment value, the cue is not rendered at the correct position,
3032         see https://w3c.github.io/webvtt/#webvtt-line-cue-setting. This patch does not implement correct handling of
3033         the line setting alignment values, it only makes sure parsing does not fail when the cue has line alignment
3034         settings.
3035
3036         Test: media/track/track-cue-line-position.html
3037
3038         * html/track/VTTCue.cpp:
3039         (WebCore::VTTCueBox::applyCSSProperties):
3040         (WebCore::VTTCue::getPositionCoordinates const):
3041         (WebCore::VTTCue::setCueSettings):
3042
3043 2018-10-02  Antti Koivisto  <antti@apple.com>
3044
3045         User installed fonts are not always disabled when they should be
3046         https://bugs.webkit.org/show_bug.cgi?id=190195
3047
3048         Reviewed by Geoffrey Garen.
3049
3050         SVG images and some theme cases fail to respect the setting. Besides the obvious problem this
3051         is also a performance issue as various font caches include this setting in the key.
3052
3053         * platform/graphics/FontDescription.cpp:
3054         (WebCore::m_shouldAllowUserInstalledFonts):
3055
3056         Initialize to 'No' by default. All paths where user fonts make sense already set the bit from
3057         settings. This fixes some cases in system themes that construct FontDescriptions from scratch.
3058
3059         * rendering/RenderElement.cpp:
3060         (WebCore::RenderElement::styleWillChange):
3061
3062         Add assertion. This verified the change with the existing tests.
3063
3064         * svg/graphics/SVGImage.cpp:
3065         (WebCore::SVGImage::dataChanged):
3066
3067         Always disallow user fonts in SVG used as images.
3068
3069 2018-10-01  Dean Jackson  <dino@apple.com>
3070
3071         Remove CSS Animation Triggers
3072         https://bugs.webkit.org/show_bug.cgi?id=190175
3073         <rdar://problem/44925626>
3074
3075         Reviewed by Simon Fraser.
3076
3077         Remove the never-properly specified CSS Animation Triggers.
3078
3079         * Configurations/FeatureDefines.xcconfig:
3080         * Sources.txt:
3081         * WebCore.xcodeproj/project.pbxproj:
3082         * css/CSSAnimationTriggerScrollValue.cpp: Removed.
3083         * css/CSSAnimationTriggerScrollValue.h: Removed.
3084         * css/CSSComputedStyleDeclaration.cpp:
3085         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3086         (WebCore::createAnimationTriggerValue): Deleted.
3087         (WebCore::animationTriggerValue): Deleted.
3088         * css/CSSProperties.json:
3089         * css/CSSToStyleMap.cpp:
3090         (WebCore::CSSToStyleMap::mapAnimationTrigger): Deleted.
3091         * css/CSSToStyleMap.h:
3092         * css/CSSValue.cpp:
3093         (WebCore::CSSValue::equals const):
3094         (WebCore::CSSValue::cssText const):
3095         (WebCore::CSSValue::destroy):
3096         * css/CSSValue.h:
3097         (WebCore::CSSValue::isAnimationTriggerScrollValue const): Deleted.
3098         * css/parser/CSSPropertyParser.cpp:
3099         (WebCore::consumeAnimationValue):
3100         (WebCore::CSSPropertyParser::parseSingleValue):
3101         (WebCore::consumeWebkitAnimationTrigger): Deleted.
3102         * page/FrameView.cpp:
3103         (WebCore::FrameView::sendScrollEvent):
3104         * page/RuntimeEnabledFeatures.h:
3105         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled): Deleted.
3106         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled const): Deleted.
3107         * page/animation/AnimationBase.cpp:
3108         (WebCore::AnimationBase::updateStateMachine):
3109         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
3110         (WebCore::AnimationBase::timeToNextService):
3111         (WebCore::AnimationBase::getElapsedTime const):
3112         * page/animation/CSSAnimationController.cpp:
3113         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
3114         (WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll): Deleted.
3115         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll): Deleted.
3116         (WebCore::CSSAnimationControllerPrivate::scrollWasUpdated): Deleted.
3117         (WebCore::CSSAnimationController::wantsScrollUpdates const): Deleted.
3118         (WebCore::CSSAnimationController::scrollWasUpdated): Deleted.
3119         * page/animation/CSSAnimationController.h:
3120         * page/animation/CSSAnimationControllerPrivate.h:
3121         (WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates const): Deleted.
3122         (WebCore::CSSAnimationControllerPrivate::scrollPosition const): Deleted.
3123         * page/animation/CompositeAnimation.cpp:
3124         (WebCore::CompositeAnimation::updateKeyframeAnimations):
3125         * page/animation/CompositeAnimation.h:
3126         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation const): Deleted.
3127         * platform/animation/Animation.cpp:
3128         (WebCore::Animation::Animation):
3129         (WebCore::Animation::operator=):
3130         (WebCore::Animation::animationsMatch const):
3131         * platform/animation/Animation.h:
3132         (WebCore::Animation::isTimingFunctionSet const):
3133         (WebCore::Animation::isEmpty const):
3134         (WebCore::Animation::clearTimingFunction):
3135         (WebCore::Animation::clearAll):
3136         (WebCore::Animation::animationMode const):
3137         (WebCore::Animation::setAnimationMode):
3138         (WebCore::Animation::initialTimingFunction):
3139         (WebCore::Animation::isTriggerSet const): Deleted.
3140         (WebCore::Animation::clearTrigger): Deleted.
3141         (WebCore::Animation::trigger const): Deleted.
3142         (WebCore::Animation::setTrigger): Deleted.
3143         (WebCore::Animation::initialTrigger): Deleted.
3144         * platform/animation/AnimationTrigger.h: Removed.
3145         * platform/graphics/ca/GraphicsLayerCA.cpp:
3146         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
3147 2018-10-02  Commit Queue  <commit-queue@webkit.org>
3148
3149         Unreviewed, rolling out r236624 and r236671.
3150         https://bugs.webkit.org/show_bug.cgi?id=190207
3151
3152         The change in r236624 introduced crashes on the bots
3153         (Requested by ryanhaddad on #webkit).
3154
3155         Reverted changesets:
3156
3157         "Refactoring: eliminate raw pointer usage in Fullscreen code"
3158         https://bugs.webkit.org/show_bug.cgi?id=188747
3159         https://trac.webkit.org/changeset/236624
3160
3161         "Unify implementation in VideoFullscreenInterfaceAVKit"
3162         https://bugs.webkit.org/show_bug.cgi?id=190091
3163         https://trac.webkit.org/changeset/236671
3164
3165 2018-10-02  Sihui Liu  <sihui_liu@apple.com>
3166
3167         Add release assertion to ensure m_owningPointerForClose is null in UniqueIDBDatabase::invokeOperationAndTransactionTimer()
3168         https://bugs.webkit.org/show_bug.cgi?id=190178
3169
3170         Reviewed by Chris Dumez.
3171
3172         This would help debug rdar://problem/44902833.
3173
3174         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3175         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
3176
3177 2018-10-02  Commit Queue  <commit-queue@webkit.org>
3178
3179         Unreviewed, rolling out r236719.
3180         https://bugs.webkit.org/show_bug.cgi?id=190197
3181
3182         this revision caused 39 layout test failures that tested for
3183         scrolling, a bug was also not present in the commit or change
3184         log. (Requested by Truitt on #webkit).
3185
3186         Reverted changeset:
3187
3188         "Unreviewed, fix unused variable in
3189         RenderLayer::updateScrollableAreaSet"
3190         https://trac.webkit.org/changeset/236719
3191
3192 2018-10-02  Alicia Boya García  <aboya@igalia.com>
3193
3194         [MSE][GStreamer] Add h264parse to accept MP4 without stss
3195         https://bugs.webkit.org/show_bug.cgi?id=190143
3196
3197         Reviewed by Xabier Rodriguez-Calvar.
3198
3199         The MP4 file used in this URL does not contain a stss (Sync Sample
3200         Box). In consequence, in acordance with the ISO BMFF spec, all samples
3201         are assumed to be sync frames... But in this case that is not true,
3202         it's just that the file is wrong (e.g. created with a buggy muxer).
3203
3204         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
3205
3206         The way it works in other browsers is because instead of trusting the
3207         MP4 stss table, they rely on parsing the h264 frames. We can do that
3208         too.
3209
3210         This patch also changes RELEASE_ASSERT() when creating the parsers
3211         to GLib criticals.
3212
3213         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3214         (WebCore::createOptionalParserForFormat):
3215
3216 2018-10-02  Eric Carlson  <eric.carlson@apple.com>
3217
3218         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
3219         https://bugs.webkit.org/show_bug.cgi?id=190142
3220         <rdar://problem/44911109>
3221
3222         Reviewed by Youenn Fablet.
3223
3224         No new tests, covered by existing tests.
3225
3226         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
3227         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
3228         to base class.
3229
3230         * Modules/mediastream/MediaDevicesRequest.cpp:
3231         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
3232         as passed salt.
3233
3234         * Modules/mediastream/MediaStreamTrack.cpp:
3235         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
3236         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
3237         * Modules/mediastream/MediaStreamTrack.h:
3238         * Modules/mediastream/MediaStreamTrack.idl:
3239
3240         * Modules/mediastream/UserMediaRequest.cpp:
3241         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
3242
3243         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3244         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
3245         to base class.
3246
3247         * Modules/webaudio/MediaStreamAudioSource.cpp:
3248         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
3249         * platform/mediastream/MediaConstraints.h:
3250
3251         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
3252         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
3253
3254         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
3255         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
3256
3257         * platform/mediastream/RealtimeMediaSource.cpp:
3258         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
3259         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
3260         (WebCore::RealtimeMediaSource::hashedId const): New.
3261         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
3262         * platform/mediastream/RealtimeMediaSource.h:
3263
3264         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3265         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
3266         a source.
3267         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
3268         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
3269         * platform/mediastream/RealtimeMediaSourceCenter.h:
3270
3271         * platform/mediastream/RealtimeMediaSourceFactory.h:
3272         * platform/mediastream/RealtimeVideoSource.cpp:
3273         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
3274         * platform/mediastream/RealtimeVideoSource.h:
3275
3276         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
3277         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
3278         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
3279         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
3280
3281         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
3282         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
3283         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
3284         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
3285
3286         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
3287         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
3288         (WebCore::MockRealtimeAudioSource::create): Ditto.
3289         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
3290         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
3291
3292         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
3293         (WebCore::MockRealtimeVideoSource::create): Ditto.
3294         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
3295         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
3296
3297         * platform/mediastream/mac/AVVideoCaptureSource.h:
3298         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3299         (WebCore::AVVideoCaptureSource::create): Ditto.
3300         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
3301         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
3302         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
3303
3304         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3305         (WebCore::CoreAudioCaptureSource::create): Update parameters.
3306         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
3307         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
3308         (WebCore::CoreAudioCaptureSource::settings): Ditto.
3309         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3310
3311         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3312         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
3313         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
3314
3315         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3316         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3317         (WebCore::MockRealtimeAudioSource::create): Ditto.
3318         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
3319
3320         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
3321         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3322         (WebCore::MockRealtimeVideoSource::create): Ditto.
3323         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
3324
3325         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3326
3327         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
3328         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3329         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
3330         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
3331         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
3332         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
3333         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
3334
3335         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
3336         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
3337         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
3338
3339         * platform/mock/MockRealtimeAudioSource.cpp:
3340         (WebCore::MockRealtimeAudioSource::create): Ditto.
3341         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
3342         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
3343         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
3344         * platform/mock/MockRealtimeAudioSource.h:
3345
3346         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3347
3348         * platform/mock/MockRealtimeVideoSource.cpp:
3349         (WebCore::MockRealtimeVideoSource::create): Update parameters.
3350         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
3351         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
3352         (WebCore::MockRealtimeVideoSource::settings): Ditto.
3353         * platform/mock/MockRealtimeVideoSource.h:
3354
3355 2018-10-02  Philippe Normand  <pnormand@igalia.com>
3356
3357         [GStreamer][playbin3] Stream tag lists leaks
3358         https://bugs.webkit.org/show_bug.cgi?id=190192
3359
3360         Reviewed by Xabier Rodriguez-Calvar.
3361
3362         The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak.
3363         Also check the tags list pointer which might be NULL in some cases.
3364
3365         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
3366         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
3367         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3368         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
3369         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
3370         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
3371
3372 2018-10-01  Michael Catanzaro  <mcatanzaro@igalia.com>
3373
3374         Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet
3375
3376         * rendering/RenderLayer.cpp:
3377         (WebCore::RenderLayer::calculateClipRects const): This is a prepare-ChangeLog bug. I don't
3378         have any changes in this function....
3379
3380 2018-10-02  Alicia Boya García  <aboya@igalia.com>
3381
3382         [MSE][GStreamer] Make same thread assert non-release
3383         https://bugs.webkit.org/show_bug.cgi?id=189924