[GTK] fast/css/pseudo-visited-background-color-on-input.html is failing since r237425
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [GTK] fast/css/pseudo-visited-background-color-on-input.html is failing since r237425
4         https://bugs.webkit.org/show_bug.cgi?id=190712
5
6         Reviewed by Tim Horton.
7
8         Ensure that color inputs are enabled by default on GTK, and that color inputs have a `-webkit-appearance` of
9         `color-well` by default. Fixes fast/css/pseudo-visited-background-color-on-input.html on GTK.
10
11         * page/RuntimeEnabledFeatures.cpp:
12         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
13         * rendering/RenderTheme.cpp:
14         (WebCore::RenderTheme::colorInputStyleSheet const):
15         * rendering/RenderTheme.h:
16         (WebCore::RenderTheme::platformUsesColorWellAppearance const):
17         (WebCore::RenderTheme::platformColorInputStyleSheet const): Deleted.
18
19         Replace this with a platform hook that determines whether we want to use `-webkit-appearance: color-well;` by
20         default for inputs of type color. For now, only iOS overrides this to return false; in the future, we should
21         support `-webkit-appearance: color-well;` on iOS, and remove this platform hook entirely.
22
23         * rendering/RenderThemeIOS.h:
24         * rendering/RenderThemeMac.h:
25         * rendering/RenderThemeMac.mm:
26         (WebCore::RenderThemeMac::platformColorInputStyleSheet const): Deleted.
27
28 2018-10-18  Youenn Fablet  <youenn@apple.com>
29
30         Handle MDNS resolution of candidates through libwebrtc directly
31         https://bugs.webkit.org/show_bug.cgi?id=190681
32
33         Reviewed by Eric Carlson.
34
35         Remove the previous MDNS resolution mechanism.
36         Instead, add support for the AsyncResolver mechanism added to libwebrtc.
37         Covered by current mdns webrtc test that is unflaked.
38
39         * Modules/mediastream/PeerConnectionBackend.cpp:
40         (WebCore::PeerConnectionBackend::addIceCandidate):
41         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
42         (WebCore::LibWebRTCProvider::createPeerConnection):
43         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
44         * testing/MockLibWebRTCPeerConnection.cpp:
45         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
46         * testing/MockLibWebRTCPeerConnection.h:
47
48 2018-10-18  Ali Juma  <ajuma@chromium.org>
49
50         [IntersectionObserver] Factor out rect mapping and clipping logic from computeRectForRepaint
51         https://bugs.webkit.org/show_bug.cgi?id=189833
52
53         Reviewed by Simon Fraser.
54
55         Factor out the rect mapping and clipping logic from computeRectForRepaint to a new
56         computeVisibleRectInContainer method that computeRectForRepaint now calls. Make
57         computeVisibleRectInContainer take a VisibleRectContext with options to use
58         edge-inclusive intersection and to apply all clips and scrolls rather than only
59         the clips and scrolls that are currently applied by the repaint logic. These
60         options will be used by IntersectionObserver in a future patch.
61
62         No new tests, no change in behavior.
63
64         * platform/graphics/FloatRect.cpp:
65         (WebCore::FloatRect::edgeInclusiveIntersect):
66         * platform/graphics/FloatRect.h:
67         * platform/graphics/LayoutRect.cpp:
68         (WebCore::LayoutRect::edgeInclusiveIntersect):
69         * platform/graphics/LayoutRect.h:
70         * rendering/RenderBox.cpp:
71         (WebCore::RenderBox::applyCachedClipAndScrollPosition const):
72         (WebCore::RenderBox::computeVisibleRectUsingPaintOffset const):
73         (WebCore::RenderBox::computeVisibleRectInContainer const):
74         (WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint const): Deleted.
75         (WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint const): Deleted.
76         The iOS-specific logic in this method has moved to RenderObject::shouldApplyCompositedContainerScrollsForRepaint.
77         (WebCore::RenderBox::computeRectForRepaint const): Deleted.
78         * rendering/RenderBox.h:
79         (WebCore::RenderBox::computeRectForRepaint): Deleted.
80         * rendering/RenderInline.cpp:
81         (WebCore::RenderInline::clippedOverflowRectForRepaint const):
82         (WebCore::RenderInline::computeVisibleRectUsingPaintOffset const):
83         (WebCore::RenderInline::computeVisibleRectInContainer const):
84         (WebCore::RenderInline::computeRectForRepaint const): Deleted.
85         * rendering/RenderInline.h:
86         (WebCore::RenderInline::computeRectForRepaint): Deleted.
87         * rendering/RenderObject.cpp:
88         (WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint):
89         (WebCore::RenderObject::visibleRectContextForRepaint):
90         (WebCore::RenderObject::computeRectForRepaint const):
91         (WebCore::RenderObject::computeFloatRectForRepaint const):
92         (WebCore::RenderObject::computeVisibleRectInContainer const):
93         (WebCore::RenderObject::computeFloatVisibleRectInContainer const):
94         * rendering/RenderObject.h:
95         (WebCore::RenderObject::computeAbsoluteRepaintRect const):
96         (WebCore::RenderObject::VisibleRectContext::VisibleRectContext):
97         (WebCore::RenderObject::RepaintContext::RepaintContext): Deleted.
98         (WebCore::RenderObject::computeRectForRepaint): Deleted.
99         * rendering/RenderTableCell.cpp:
100         (WebCore::RenderTableCell::computeVisibleRectInContainer const):
101         (WebCore::RenderTableCell::computeRectForRepaint const): Deleted.
102         * rendering/RenderTableCell.h:
103         * rendering/RenderView.cpp:
104         (WebCore::RenderView::computeVisibleRectInContainer const):
105         (WebCore::RenderView::computeRectForRepaint const): Deleted.
106         * rendering/RenderView.h:
107         * rendering/svg/RenderSVGForeignObject.cpp:
108         (WebCore::RenderSVGForeignObject::computeFloatVisibleRectInContainer const):
109         (WebCore::RenderSVGForeignObject::computeVisibleRectInContainer const):
110         (WebCore::RenderSVGForeignObject::computeFloatRectForRepaint const): Deleted.
111         (WebCore::RenderSVGForeignObject::computeRectForRepaint const): Deleted.
112         * rendering/svg/RenderSVGForeignObject.h:
113         * rendering/svg/RenderSVGInline.cpp:
114         (WebCore::RenderSVGInline::computeFloatVisibleRectInContainer const):
115         (WebCore::RenderSVGInline::computeFloatRectForRepaint const): Deleted.
116         * rendering/svg/RenderSVGInline.h:
117         * rendering/svg/RenderSVGModelObject.cpp:
118         (WebCore::RenderSVGModelObject::computeFloatVisibleRectInContainer const):
119         (WebCore::RenderSVGModelObject::computeFloatRectForRepaint const): Deleted.
120         * rendering/svg/RenderSVGModelObject.h:
121         * rendering/svg/RenderSVGRoot.cpp:
122         (WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const):
123         (WebCore::RenderSVGRoot::computeFloatRectForRepaint const): Deleted.
124         * rendering/svg/RenderSVGRoot.h:
125         * rendering/svg/RenderSVGText.cpp:
126         (WebCore::RenderSVGText::computeVisibleRectInContainer const):
127         (WebCore::RenderSVGText::computeFloatVisibleRectInContainer const):
128         (WebCore::RenderSVGText::computeRectForRepaint const): Deleted.
129         (WebCore::RenderSVGText::computeFloatRectForRepaint const): Deleted.
130         * rendering/svg/RenderSVGText.h:
131         * rendering/svg/SVGRenderSupport.cpp:
132         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
133         (WebCore::SVGRenderSupport::computeFloatVisibleRectInContainer):
134         (WebCore::SVGRenderSupport::computeFloatRectForRepaint): Deleted.
135         * rendering/svg/SVGRenderSupport.h:
136
137 2018-10-17  Wenson Hsieh  <wenson_hsieh@apple.com>
138
139         Enable the datalist element by default on iOS and macOS
140         https://bugs.webkit.org/show_bug.cgi?id=190594
141         <rdar://problem/45281159>
142
143         Reviewed by Ryosuke Niwa and Tim Horton.
144
145         Rebaselined existing layout tests.
146
147         * Configurations/FeatureDefines.xcconfig:
148         * bindings/js/WebCoreBuiltinNames.h:
149         * css/CSSDefaultStyleSheets.cpp:
150         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
151         * css/CSSDefaultStyleSheets.h:
152         * css/InspectorCSSOMWrappers.cpp:
153         (WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
154         * css/html.css:
155
156         Remove color input and datalist style rules from the default UA stylesheet.
157
158         (input[type="color"]::-webkit-color-swatch-wrapper): Deleted.
159         * html/HTMLDataListElement.idl:
160
161         Make HTMLDataListElement runtime-enabled.
162
163         * html/HTMLTagNames.in:
164         * html/RangeInputType.cpp:
165
166         Make a slight adjustment here so that inputs of type range respect the list attribute. Fixes a few layout tests
167         that add a datalist to an input of type range. See <https://bugs.webkit.org/show_bug.cgi?id=190613> for more
168         details.
169
170         (WebCore::RangeInputType::shouldRespectListAttribute):
171         * html/TextFieldInputType.cpp:
172         (WebCore::TextFieldInputType::shouldRespectListAttribute):
173         * page/RuntimeEnabledFeatures.h:
174
175         Add a runtime-enabled feature for the datalist element. Additionally, make the runtime-enabled feature for input
176         type color false by default, so that it's off in WebKitLegacy.
177
178         (WebCore::RuntimeEnabledFeatures::dataListElementEnabled const):
179         (WebCore::RuntimeEnabledFeatures::setDataListElementEnabled):
180         * rendering/RenderTheme.cpp:
181         (WebCore::RenderTheme::colorInputStyleSheet const):
182
183         Add new style-sheet hooks for datalist and input type color, so that style rules for color inputs and datalists
184         can be added at runtime only if the feature is enabled. This ensures that in WebKitLegacy (or other ports where
185         either or both elements are disabled), we don't still apply rules for datalist and input[type="color"]. Notably,
186         this allows fallback content inside datalist elements to still work in WebKitLegacy (which would otherwise be
187         hidden when using the default stylesheet since `display: none` is applied to datalist by default). This also
188         prevents inputs of type color from having a smaller size, no outline, and the appearance of a color well on
189         macOS.
190
191         (WebCore::RenderTheme::dataListStyleSheet const):
192         * rendering/RenderTheme.h:
193         (WebCore::RenderTheme::platformColorInputStyleSheet const):
194         * rendering/RenderThemeMac.h:
195         * rendering/RenderThemeMac.mm:
196         (WebCore::RenderThemeMac::platformColorInputStyleSheet const):
197
198 2018-10-17  Justin Michaud  <justin_michaud@apple.com>
199
200         Parse paint() and store paint callbacks for CSS Painting API
201         https://bugs.webkit.org/show_bug.cgi?id=190657
202
203         Reviewed by Dean Jackson.
204
205         Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map.
206
207         * Sources.txt:
208         * WebCore.xcodeproj/project.pbxproj:
209         * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp:
210         (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren):
211         (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint):
212         * css/CSSImageGeneratorValue.cpp:
213         (WebCore::CSSImageGeneratorValue::image):
214         (WebCore::CSSImageGeneratorValue::isFixedSize const):
215         (WebCore::CSSImageGeneratorValue::fixedSize):
216         (WebCore::CSSImageGeneratorValue::isPending const):
217         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
218         (WebCore::CSSImageGeneratorValue::loadSubimages):
219         * css/CSSPaintImageValue.cpp: Added.
220         (WebCore::CSSPaintImageValue::customCSSText const):
221         * css/CSSPaintImageValue.h: Added.
222         * css/CSSPaintWorkletGlobalScope.h:
223         * css/CSSPaintWorkletGlobalScope.idl:
224         * css/CSSValue.cpp:
225         (WebCore::CSSValue::equals const):
226         (WebCore::CSSValue::cssText const):
227         (WebCore::CSSValue::destroy):
228         * css/CSSValue.h:
229         (WebCore::CSSValue::isPaintImageValue const):
230         * css/CSSValueKeywords.in:
231         * css/parser/CSSPropertyParserHelpers.cpp:
232         (WebCore::CSSPropertyParserHelpers::consumeCustomPaint):
233         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
234         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
235         * platform/mediastream/mac/RealtimeVideoUtilities.h:
236
237 2018-10-17  Eric Carlson  <eric.carlson@apple.com>
238
239         [MediaStream] Consolidate all image conversion and resizing into one class
240         https://bugs.webkit.org/show_bug.cgi?id=190519
241         <rdar://problem/45224307>
242
243         Try to fix the iOSMac build after r237236.
244
245         * platform/graphics/cv/ImageTransferSessionVT.h:
246         * platform/graphics/cv/ImageTransferSessionVT.mm:
247
248 2018-10-17  Justin Fan  <justin_fan@apple.com>
249
250         [WebGPU] Implement WebGPU bindings up through WebGPUDevice creation
251         https://bugs.webkit.org/show_bug.cgi?id=190653
252
253         Reviewed by Dean Jackson.
254
255         Test: webgpu/webgpu-enabled.html
256
257         Add WebGPU Sketch bindings for window.webgpu, WebGPUAdapter, WebGPUAdapterDescriptor,
258         and WebGPUDevice creation. Based off IDL commit version b6c61ee. 
259         https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
260
261         * CMakeLists.txt:
262         * DerivedSources.make:
263         * Modules/webgpu/DOMWindowWebGPU.cpp: Added.
264         (WebCore::DOMWindowWebGPU::DOMWindowWebGPU):
265         (WebCore::DOMWindowWebGPU::supplementName):
266         (WebCore::DOMWindowWebGPU::from):
267         (WebCore::DOMWindowWebGPU::webgpu):
268         (WebCore::DOMWindowWebGPU::webgpu const):
269         * Modules/webgpu/DOMWindowWebGPU.h: Added.
270         * Modules/webgpu/DOMWindowWebGPU.idl: Added.
271         * Modules/webgpu/WebGPU.cpp: Added.
272         (WebCore::WebGPU::create):
273         (WebCore::WebGPU::requestAdapter const):
274         * Modules/webgpu/WebGPU.h: Added.
275         * Modules/webgpu/WebGPU.idl: Added.
276         * Modules/webgpu/WebGPUAdapter.cpp: Added.
277         (WebCore::WebGPUAdapter::create):
278         (WebCore::WebGPUAdapter::WebGPUAdapter):
279         (WebCore::WebGPUAdapter::createDevice):
280         * Modules/webgpu/WebGPUAdapter.h: Added.
281         * Modules/webgpu/WebGPUAdapter.idl: Added.
282         * Modules/webgpu/WebGPUAdapterDescriptor.h: Added.
283         * Modules/webgpu/WebGPUAdapterDescriptor.idl: Added.
284         * Modules/webgpu/WebGPUDevice.cpp: Added.
285         (WebCore::WebGPUDevice::create):
286         (WebCore::WebGPUDevice::WebGPUDevice):
287         * Modules/webgpu/WebGPUDevice.h: Added.
288         (WebCore::WebGPUDevice::adapter const):
289         * Modules/webgpu/WebGPUDevice.idl: Added.
290         * Sources.txt:
291         * WebCore.xcodeproj/project.pbxproj:
292         * bindings/js/WebCoreBuiltinNames.h:
293
294 2018-10-17  Andy Estes  <aestes@apple.com>
295
296         [Apple Pay] Increment the API version to 5
297         https://bugs.webkit.org/show_bug.cgi?id=190686
298         <rdar://problem/45348523>
299
300         Reviewed by Simon Fraser.
301
302         Test: http/tests/ssl/applepay/ApplePaySessionV5.html
303
304         * testing/MockPaymentCoordinator.cpp:
305         (WebCore::MockPaymentCoordinator::supportsVersion):
306
307 2018-10-17  Eric Carlson  <eric.carlson@apple.com>
308
309         [MediaStream] Consolidate all image conversion and resizing into one class
310         https://bugs.webkit.org/show_bug.cgi?id=190519
311         <rdar://problem/45224307>
312
313         Reviewed by Youenn Fablet.
314
315         No new tests, no functional change.
316
317         * SourcesCocoa.txt: Add ImageTransferSessionVT.
318         * WebCore.xcodeproj/project.pbxproj: Ditto.
319
320         * platform/MediaSample.h:
321         (WebCore::MediaSample::videoPixelFormat const): New.
322
323         * platform/cocoa/VideoToolboxSoftLink.cpp: Add new kVTPixelTransferProperty keys.
324         * platform/cocoa/VideoToolboxSoftLink.h:
325
326         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
327         (WebCore::MediaSampleAVFObjC::create): Remove unimplemented variant.
328         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
329         (WebCore::MediaSampleAVFObjC::videoPixelFormat const): New.
330
331         * platform/graphics/cv/ImageTransferSessionVT.h: Added.
332         (WebCore::ImageTransferSessionVT::create):
333         * platform/graphics/cv/ImageTransferSessionVT.mm: Added.
334         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
335         (WebCore::ImageTransferSessionVT::~ImageTransferSessionVT):
336         (WebCore::ImageTransferSessionVT::setSize):
337         (WebCore::ImageTransferSessionVT::createPixelBuffer):
338         (WebCore::ImageTransferSessionVT::createCMSampleBuffer):
339         (WebCore::roundUpToMacroblockMultiple):
340         (WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions):
341         (WebCore::ImageTransferSessionVT::createMediaSample):
342
343         * platform/graphics/cv/PixelBufferResizer.h: Removed.
344         * platform/graphics/cv/PixelBufferResizer.mm: Removed.
345
346         * platform/mediastream/mac/AVVideoCaptureSource.h:
347         * platform/mediastream/mac/AVVideoCaptureSource.mm:
348         (WebCore::AVVideoCaptureSource::prefersPreset):
349         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Remove
350         the resizing logic, it is handled by the base class.
351
352         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
353         (WebCore::DisplayCaptureSourceCocoa::capabilities):
354         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
355         (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize):
356         (WebCore::DisplayCaptureSourceCocoa::emitFrame): Remove resizing logic, just use a transfer
357         session to create an image from the capture source native output format.
358         (WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Deleted.
359         (WebCore::roundUpToMacroblockMultiple): Deleted.
360         (WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Deleted.
361         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
362
363         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
364         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
365         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Use image transfer session.
366         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Deleted.
367         (WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage const): Deleted.
368         (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset): Deleted.
369
370         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
371         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
372         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
373         (WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return the IOSurface directly.
374
375         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
376         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
377         (WebCore::WindowDisplayCaptureSourceMac::generateFrame): Return the CGImage directly.
378         (WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage): Deleted.
379
380         * platform/mock/MockRealtimeVideoSource.cpp:
381         (WebCore::MockRealtimeVideoSource::capabilities): Only the camera supports device ID.
382         (WebCore::MockRealtimeVideoSource::settings): Ditto.
383
384 2018-10-17  Eric Carlson  <eric.carlson@apple.com>
385
386         [MediaStream] Clean up capture source factory management
387         https://bugs.webkit.org/show_bug.cgi?id=190502
388         <rdar://problem/45212447>
389
390         Reviewed by Youenn Fablet.
391
392         No new tests, no functional change.
393
394         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
395         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
396         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
397         (WebCore::RealtimeMediaSourceCenter::audioFactory):
398         (WebCore::RealtimeMediaSourceCenter::setVideoFactory):
399         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
400         (WebCore::RealtimeMediaSourceCenter::videoFactory):
401         (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
402         (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
403         (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
404         * platform/mediastream/RealtimeMediaSourceCenter.h:
405         (WebCore::RealtimeMediaSourceCenter::setAudioFactory): Deleted.
406         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): Deleted.
407         (): Deleted.
408         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
409         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactoryPrivate):
410         (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactoryPrivate):
411         (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactoryPrivate):
412         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory): Deleted.
413         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory): Deleted.
414         (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory): Deleted.
415         (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory): Deleted.
416         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
417         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
418         (WebCore::RealtimeMediaSourceCenterMac::audioFactoryPrivate):
419         (WebCore::RealtimeMediaSourceCenterMac::videoFactoryPrivate):
420         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactoryPrivate):
421         (WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory): Deleted.
422         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory): Deleted.
423         (WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory): Deleted.
424         (WebCore::RealtimeMediaSourceCenterMac::audioFactory): Deleted.
425         (WebCore::RealtimeMediaSourceCenterMac::videoFactory): Deleted.
426         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory): Deleted.
427         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
428         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
429         (WebCore::MockRealtimeMediaSourceCenter::audioFactoryPrivate):
430         (WebCore::MockRealtimeMediaSourceCenter::videoFactoryPrivate):
431         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactoryPrivate):
432         (WebCore::MockRealtimeMediaSourceCenter::audioFactory): Deleted.
433         (WebCore::MockRealtimeMediaSourceCenter::videoFactory): Deleted.
434         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory): Deleted.
435         * platform/mock/MockRealtimeMediaSourceCenter.h:
436
437 2018-10-17  Alex Christensen  <achristensen@webkit.org>
438
439         BackForwardClient needs to be able to support UIProcess-only back/forward lists
440         https://bugs.webkit.org/show_bug.cgi?id=190675
441
442         Reviewed by Chris Dumez.
443
444         Return a RefPtr<HistoryItem> instead of a HistoryItem so that we will be able to return a
445         HistoryItem that has been created instead of a pointer to a HistoryItem that is owned by something else.
446         Also use unsigned for the back and forward list counts because they can never be negative.
447
448         * history/BackForwardClient.h:
449         * history/BackForwardController.cpp:
450         (WebCore::BackForwardController::backItem):
451         (WebCore::BackForwardController::currentItem):
452         (WebCore::BackForwardController::forwardItem):
453         (WebCore::BackForwardController::canGoBackOrForward const):
454         (WebCore::BackForwardController::goBackOrForward):
455         (WebCore::BackForwardController::goBack):
456         (WebCore::BackForwardController::goForward):
457         (WebCore::BackForwardController::count const):
458         (WebCore::BackForwardController::backCount const):
459         (WebCore::BackForwardController::forwardCount const):
460         (WebCore::BackForwardController::itemAtIndex):
461         * history/BackForwardController.h:
462         (WebCore::BackForwardController::backItem): Deleted.
463         (WebCore::BackForwardController::currentItem): Deleted.
464         (WebCore::BackForwardController::forwardItem): Deleted.
465         * loader/EmptyClients.cpp:
466         * loader/NavigationScheduler.cpp:
467         (WebCore::NavigationScheduler::scheduleHistoryNavigation):
468
469 2018-10-17  Antoine Quint  <graouts@apple.com>
470
471         [Web Animations] Do not create a DocumentTimeline to suspend or resume animations
472         https://bugs.webkit.org/show_bug.cgi?id=190660
473
474         Reviewed by Dean Jackson.
475
476         We check that there is an existing timeline before trying to suspend or resume its animations, otherwise
477         we're creating a DocumentTimeline when nothing requires for it to exist. We also have to check that we
478         suspend animations when a DocumentTimeline is created while the page is not visible.
479
480         No new tests as there is no change in behavior here.
481
482         * animation/DocumentTimeline.cpp:
483         (WebCore::DocumentTimeline::DocumentTimeline):
484         * dom/Document.cpp:
485         (WebCore::Document::didBecomeCurrentDocumentInFrame):
486         (WebCore::Document::resume):
487         * page/Frame.cpp:
488         (WebCore::Frame::clearTimers):
489         * page/Page.cpp:
490         (WebCore::Page::setIsVisibleInternal):
491         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
492
493 2018-10-17  Antti Koivisto  <antti@apple.com>
494
495         Tiling CSS gradients is slow
496         https://bugs.webkit.org/show_bug.cgi?id=190615
497
498         Reviewed by Tim Horton.
499
500         Painting blocks the main thread on CG rendering queue to make a copy of the backing store.
501
502         * platform/graphics/BitmapImage.cpp:
503         (WebCore::BitmapImage::drawPattern):
504
505         Also use sinkIntoImage for bitmap image pattern drawing.
506
507         * platform/graphics/GradientImage.cpp:
508         (WebCore::GradientImage::drawPattern):
509
510         Sink the gradient into an Image after generating it. Unlike ImageBuffer, painting it doesn't involve inefficient copies.
511         Previous isCompatibleWithContext test is replaced with an equivalent scale factor test.
512
513         * platform/graphics/GradientImage.h:
514
515 2018-10-17  Chris Dumez  <cdumez@apple.com>
516
517         Update more DOMWindow getters to return references instead of raw pointers
518         https://bugs.webkit.org/show_bug.cgi?id=190654
519
520         Reviewed by Youenn Fablet.
521
522         Update more DOMWindow getters to return references instead of raw pointers, since they
523         can no longer return null after recent refactoring.
524
525         * Modules/gamepad/GamepadManager.cpp:
526         (WebCore::navigatorGamepadFromDOMWindow):
527         * bindings/js/JSDOMWindowCustom.cpp:
528         (WebCore::JSDOMWindow::heapSnapshot):
529         * dom/Document.cpp:
530         (WebCore::Document::location const):
531         (WebCore::Document::dispatchPopstateEvent):
532         * dom/Event.cpp:
533         (WebCore::Event::timeStampForBindings const):
534         * loader/DocumentThreadableLoader.cpp:
535         (WebCore::DocumentThreadableLoader::loadRequest):
536         * loader/ResourceTimingInformation.cpp:
537         (WebCore::ResourceTimingInformation::addResourceTiming):
538         * page/DOMWindow.cpp:
539         (WebCore::DOMWindow::screen):
540         (WebCore::DOMWindow::history):
541         (WebCore::DOMWindow::crypto const):
542         (WebCore::DOMWindow::locationbar):
543         (WebCore::DOMWindow::menubar):
544         (WebCore::DOMWindow::personalbar):
545         (WebCore::DOMWindow::scrollbars):
546         (WebCore::DOMWindow::statusbar):
547         (WebCore::DOMWindow::toolbar):
548         (WebCore::DOMWindow::applicationCache):
549         (WebCore::DOMWindow::navigator):
550         (WebCore::DOMWindow::performance const):
551         (WebCore::DOMWindow::nowTimestamp const):
552         (WebCore::DOMWindow::location):
553         (WebCore::DOMWindow::visualViewport):
554         (WebCore::DOMWindow::styleMedia):
555         * page/DOMWindow.h:
556         * page/FrameView.cpp:
557         (WebCore::FrameView::updateLayoutViewport):
558         * page/History.cpp:
559         (WebCore::History::stateObjectAdded):
560         * page/IntersectionObserver.cpp:
561         (WebCore::IntersectionObserver::createTimestamp const):
562         * page/PerformanceObserver.cpp:
563         (WebCore::PerformanceObserver::PerformanceObserver):
564         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
565         (WebCore::VideoFullscreenModelVideoElement::requestFullscreenMode):
566
567 2018-10-17  Chris Fleizach  <cfleizach@apple.com>
568
569         AX: Certain tags should identify their context to iOS API
570         https://bugs.webkit.org/show_bug.cgi?id=190622
571         <rdar://problem/45308194>
572
573         Reviewed by Zalan Bujtas.
574
575         Convey the semantic meaning of <code> tag to the iOS API so VoiceOver can make use of it.
576
577         Tests: accessibility/ios-simulator/text-context-attributes.html
578
579         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
580         (-[WebAccessibilityObjectWrapper accessibilityTextualContext]):
581         (AXAttributeStringSetStyle):
582
583 2018-10-17  Youenn Fablet  <youenn@apple.com>
584
585         Remove unused code from RealtimeOutgoingVideoSourceCocoa
586         https://bugs.webkit.org/show_bug.cgi?id=190666
587
588         Reviewed by Eric Carlson.
589
590         No change of behavior, removed no longer used code.
591
592         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
593         (): Deleted.
594
595 2018-10-17  Ali Juma  <ajuma@chromium.org>
596
597         Flaky IntersectionObserver web platform tests involving style updates
598         https://bugs.webkit.org/show_bug.cgi?id=189091
599
600         Reviewed by Simon Fraser.
601
602         Update intersection observations when flushing layers from the WebProcess
603         to the UIProcess to make the timing of these updates more predictable, and
604         more consistent with the IntersectionObserver spec, since the spec expects
605         these updates to happen as part of the "Update the rendering" step in the
606         HTML EventLoop.
607
608         Getting a similar approach to work with WK1 seems to add more complexity than it's
609         worth, since flushes don't happen for scrolls handled by platform widgets, and
610         flushes for other invalidations only happen when in compositing mode.
611
612         The only remaining timer-driven intersection observation update is for handling
613         the initial observation on a newly added target, which needs to happen even if
614         there are no changes triggering a flush.
615
616         Tested by the following tests no longer being flaky:
617             imported/w3c/web-platform-tests/intersection-observer/bounding-box.html
618             imported/w3c/web-platform-tests/intersection-observer/display-none.html
619             imported/w3c/web-platform-tests/intersection-observer/containing-block.html
620
621         * dom/Document.cpp:
622         (WebCore::Document::resolveStyle):
623         (WebCore::Document::updateIntersectionObservations):
624         (WebCore::Document::scheduleForcedIntersectionObservationUpdate):
625         (WebCore::Document::scheduleIntersectionObservationUpdate): Deleted.
626         * dom/Document.h:
627         * page/FrameView.cpp:
628         (WebCore::FrameView::flushCompositingStateForThisFrame):
629         (WebCore::FrameView::viewportContentsChanged):
630         * page/IntersectionObserver.cpp:
631         (WebCore::IntersectionObserver::observe):
632         * page/Page.cpp:
633         (WebCore::Page::Page):
634         (WebCore::Page::willDisplayPage):
635         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate):
636         (WebCore::Page::updateIntersectionObservations):
637         (WebCore::Page::scheduleForcedIntersectionObservationUpdate):
638         * page/Page.h:
639
640 2018-10-17  Charlie Turner  <cturner@igalia.com>
641
642         [EME] Sanity check key ID length in the keyids init data format
643         https://bugs.webkit.org/show_bug.cgi?id=190629
644
645         Reviewed by Xabier Rodriguez-Calvar.
646
647         Covered by web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
648
649         * Modules/encryptedmedia/InitDataRegistry.cpp:
650         (WebCore::extractKeyIDsKeyids): Ensure the decoded key id length
651         is at least 1 byte and no more than 512 bytes.
652
653 2018-10-16  Chris Dumez  <cdumez@apple.com>
654
655         Regression(r236795) Check boxes are sometimes checked when they should not be
656         https://bugs.webkit.org/show_bug.cgi?id=190651
657         <rdar://problem/45319934>
658
659         Reviewed by Ryosuke Niwa.
660
661         r236795 mistakenly dropped the statement resetting m_reflectsCheckedAttribute to true
662         in HTMLInputElement::parseAttribute() because it looked like a no-op given that we
663         made sure it was true a couple of line above. However, I overlooked that calling
664         HTMLInputElement::setChecked() sets m_reflectsCheckedAttribute to false.
665
666         This patch thus re-introduces the statement. It also renames m_reflectsCheckedAttribute
667         to m_dirtyCheckednessFlag and reverses its value in order to match the specification
668         more closely:
669         - https://html.spec.whatwg.org/#concept-input-checked-dirty-flag
670
671         Test: fast/dom/HTMLInputElement/checkbox-dirty-checkedness-flag.html
672
673         * html/HTMLInputElement.cpp:
674         (WebCore::HTMLInputElement::HTMLInputElement):
675         (WebCore::HTMLInputElement::parseAttribute):
676         (WebCore::HTMLInputElement::finishParsingChildren):
677         (WebCore::HTMLInputElement::reset):
678         (WebCore::HTMLInputElement::setChecked):
679         (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
680         * html/HTMLInputElement.h:
681
682 2018-10-16  Sihui Liu  <sihui_liu@apple.com>
683
684         Add a switch for Web SQL
685         https://bugs.webkit.org/show_bug.cgi?id=190271
686
687         Reviewed by Ryosuke Niwa.
688
689         Web SQL is still enabled by default.
690
691         * Modules/webdatabase/DOMWindowWebDatabase.idl:
692         * Modules/webdatabase/Database.idl:
693         * Modules/webdatabase/SQLError.idl:
694         * Modules/webdatabase/SQLResultSet.idl:
695         * Modules/webdatabase/SQLResultSetRowList.idl:
696         * bindings/js/WebCoreBuiltinNames.h:
697         * page/RuntimeEnabledFeatures.h:
698         (WebCore::RuntimeEnabledFeatures::setWebSQLDisabled):
699         (WebCore::RuntimeEnabledFeatures::webSQLEnabled const):
700
701 2018-10-16  Chris Dumez  <cdumez@apple.com>
702
703         window.performance should not become null after the window loses its browsing context
704         https://bugs.webkit.org/show_bug.cgi?id=190636
705
706         Reviewed by Ryosuke Niwa.
707
708         window.performance should not become null after the window loses its browsing context. This
709         WebKit behavior does not match the HTML specification nor the behavior of other browsers.
710
711         Also note that the attribute is not nullable in the specification:
712         - https://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute
713
714         No new tests, updated existing test.
715
716         * page/DOMWindow.cpp:
717         (WebCore::DOMWindow::performance const):
718         * page/Performance.cpp:
719         (WebCore::Performance::Performance):
720         * page/Performance.h:
721         * platform/GenericTaskQueue.h:
722         (WebCore::TaskDispatcher::TaskDispatcher):
723         (WebCore::TaskDispatcher::postTask):
724         (WebCore::GenericTaskQueue::GenericTaskQueue):
725         (WebCore::GenericTaskQueue::isClosed const):
726         * workers/WorkerGlobalScope.cpp:
727         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
728
729 2018-10-16  Jer Noble  <jer.noble@apple.com>
730
731         Refactoring: Convert HTMLMediaElement::scheduleDelayedAction() to individually schedulable & cancelable tasks
732         https://bugs.webkit.org/show_bug.cgi?id=188208
733
734         Reviewed by Eric Carlson.
735
736         Rather than have a single, monolithic, zero-duration-timer based dispatch for
737         a bunch of methods to be performed in a future run-loop, convert them all to
738         use a DeferrableTask, which in turn is a kind of GenericTaskQueue which can
739         enqueue only a single task at a time. Convert some other zero-duration-timer
740         and GenericTaskQueue dispatches to this new DeferrableTask.
741
742         * WebCore.xcodeproj/project.pbxproj:
743         * html/HTMLMediaElement.cpp:
744         (WebCore::HTMLMediaElement::HTMLMediaElement):
745         (WebCore::HTMLMediaElement::finishParsingChildren):
746         (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
747         (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
748         (WebCore::HTMLMediaElement::prepareForLoad):
749         (WebCore::HTMLMediaElement::setReadyState):
750         (WebCore::HTMLMediaElement::seekWithTolerance):
751         (WebCore::HTMLMediaElement::setMuted):
752         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
753         (WebCore::HTMLMediaElement::didAddTextTrack):
754         (WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
755         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
756         (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
757         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
758         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
759         (WebCore::HTMLMediaElement::scheduleUpdatePlayState):
760         (WebCore::HTMLMediaElement::updatePlayState):
761         (WebCore::HTMLMediaElement::setPlaying):
762         (WebCore::HTMLMediaElement::setPausedInternal):
763         (WebCore::HTMLMediaElement::cancelPendingTasks):
764         (WebCore::HTMLMediaElement::userCancelledLoad):
765         (WebCore::HTMLMediaElement::clearMediaPlayer):
766         (WebCore::HTMLMediaElement::contextDestroyed):
767         (WebCore::HTMLMediaElement::stop):
768         (WebCore::HTMLMediaElement::suspend):
769         (WebCore::HTMLMediaElement::resume):
770         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
771         (WebCore::HTMLMediaElement::dispatchEvent):
772         (WebCore::HTMLMediaElement::removeEventListener):
773         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
774         (WebCore::HTMLMediaElement::didBecomeFullscreenElement):
775         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured):
776         (WebCore::HTMLMediaElement::scheduleUpdateMediaState):
777         (WebCore::HTMLMediaElement::updateMediaState):
778         (WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired):
779         (WebCore::setFlags): Deleted.
780         (WebCore::clearFlags): Deleted.
781         (WebCore::actionName): Deleted.
782         (WebCore::HTMLMediaElement::scheduleDelayedAction): Deleted.
783         (WebCore::HTMLMediaElement::pendingActionTimerFired): Deleted.
784         * html/HTMLMediaElement.h:
785         * html/HTMLMediaElementEnums.h:
786         * platform/DeferrableTask.h: Added.
787         (WebCore::DeferrableTask::DeferrableTask):
788         (WebCore::DeferrableTask::scheduleTask):
789         (WebCore::DeferrableTask::close):
790         (WebCore::DeferrableTask::cancelTask):
791         (WebCore::DeferrableTask::hasPendingTask const):
792
793 2018-10-16  Timothy Hatcher  <timothy@apple.com>
794
795         Add <meta name="supported-color-schemes"> to control what color schemes the page supports
796         https://bugs.webkit.org/show_bug.cgi?id=190526
797         rdar://problem/45230140
798
799         Reviewed by Dean Jackson.
800
801         Test: css-dark-mode/supported-color-schemes.html
802
803         * dom/Document.cpp:
804         (WebCore::isColorSchemeSeparator): Added.
805         (WebCore::processColorSchemes): Added.
806         (WebCore::Document::processSupportedColorSchemes): Added.
807         (WebCore::Document::useDarkAppearance const): Take system appearance and document's
808         suppoerted color shcemes into account.
809         * dom/Document.h:
810         * editing/cocoa/WebContentReaderCocoa.mm:
811         (WebCore::createFragment): Update use of LocalDefaultSystemAppearance.
812         * html/HTMLMetaElement.cpp:
813         (WebCore::HTMLMetaElement::process): Added supported-color-schemes behind runtime feature check.
814         * inspector/InspectorOverlay.cpp:
815         (WebCore::InspectorOverlay::paint): Update use of LocalDefaultSystemAppearance.
816         * platform/mac/DragImageMac.mm:
817         (WebCore::createDragImageForLink): Update use of LocalDefaultSystemAppearance.
818         * platform/mac/LocalDefaultSystemAppearance.h:
819         * platform/mac/LocalDefaultSystemAppearance.mm:
820         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
821         Drop the need for useSystemAppearance. This is accounted for in Document::useDarkAppearance.
822         * platform/mac/ThemeMac.mm:
823         (WebCore::ThemeMac::paint): Update use of LocalDefaultSystemAppearance.
824         * rendering/RenderLayerBacking.cpp:
825         (WebCore::RenderLayerBacking::paintContents): Update use of LocalDefaultSystemAppearance.
826         * rendering/RenderLayerCompositor.cpp:
827         (WebCore::RenderLayerCompositor::paintContents): Update use of LocalDefaultSystemAppearance.
828         * rendering/RenderTheme.cpp:
829         (WebCore::RenderTheme::paint): Use document instead of page.
830         * rendering/RenderThemeCocoa.mm:
831         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Update use of LocalDefaultSystemAppearance.
832         * rendering/RenderThemeMac.mm:
833         (WebCore::RenderThemeMac::documentViewFor const): Update use of LocalDefaultSystemAppearance.
834         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Ditto.
835         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
836         (WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Ditto.
837         (WebCore::RenderThemeMac::supportsSelectionForegroundColors const): Ditto.
838         (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const): Ditto.
839         (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const): Ditto.
840         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
841         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): Ditto.
842         (WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const): Ditto.
843         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const): Ditto.
844         (WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Ditto.
845         (WebCore::RenderThemeMac::colorCache const): Ditto.
846         (WebCore::RenderThemeMac::systemColor const): Ditto.
847         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary): Ditto.
848         (WebCore::RenderThemeMac::paintSliderThumb): Ditto.
849         (WebCore::RenderThemeMac::usingDarkAppearance const): No need to limit to macOS here.
850         * svg/graphics/SVGImage.cpp:
851         (WebCore::SVGImage::draw): Update use of LocalDefaultSystemAppearance.
852
853 2018-10-16  Rob Buis  <rbuis@igalia.com>
854
855         Remove superfluous VIDEO build guard
856         https://bugs.webkit.org/show_bug.cgi?id=190624
857
858         Reviewed by Michael Catanzaro.
859
860         Remove some instances where the VIDEO build guard is included within another VIDEO build guard.
861
862         No new tests. No change in behavior.
863
864         * platform/graphics/MediaPlayer.cpp:
865         (WebCore::buildMediaEnginesVector):
866         * platform/graphics/MediaPlayer.h:
867         * platform/graphics/MediaPlayerPrivate.h:
868
869 2018-10-16  Youenn Fablet  <youenn@apple.com>
870
871         Support RTCConfiguration.certificates
872         https://bugs.webkit.org/show_bug.cgi?id=190603
873
874         Reviewed by Eric Carlson.
875
876         Update RTCConfiguration to have a certificates member.
877         Add the conversion from RTCCertificate to libwebrtc certificates.
878         Add check to ensure that certificates are not expired.
879         Add check to ensure that certificates passed to setConfiguration were
880         the same as the ones passed to RTCPeerConnection constructor.
881         Once these checks are done, we reuse the certificates created at
882         RCPeerConnection creation time when setting the configuration again.
883
884         Covered by rebased WPT test.
885
886         * Modules/mediastream/RTCConfiguration.h:
887         * Modules/mediastream/RTCConfiguration.idl:
888         * Modules/mediastream/RTCPeerConnection.cpp:
889         (WebCore::certificatesFromConfiguration):
890         (WebCore::RTCPeerConnection::initializeConfiguration):
891         (WebCore::RTCPeerConnection::setConfiguration):
892         * Modules/mediastream/RTCPeerConnection.h:
893         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
894         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
895         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
896         (WebCore::configurationFromMediaEndpointConfiguration):
897         * platform/mediastream/MediaEndpointConfiguration.cpp:
898         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
899         * platform/mediastream/MediaEndpointConfiguration.h:
900
901 2018-10-16  Ryan Haddad  <ryanhaddad@apple.com>
902
903         Unreviewed, rolling out r237163.
904
905         Introduced layout test failures on iOS Simulator.
906
907         Reverted changeset:
908
909         "[CG] Adopt CG SPI for non-even cornered rounded rects"
910         https://bugs.webkit.org/show_bug.cgi?id=190155
911         https://trac.webkit.org/changeset/237163
912
913 2018-10-16  Devin Rousso  <drousso@apple.com>
914
915         Web Inspector: Canvas: capture previously saved states and add them to the recording payload
916         https://bugs.webkit.org/show_bug.cgi?id=190473
917
918         Reviewed by Joseph Pecoraro.
919
920         Updated existing tests: inspector/canvas/recording-2d.html
921                                 inspector/model/recording.html
922
923         Instead of sending a single object of the current state of the context, send an array of
924         objects, one for each restore point.
925
926         * html/canvas/CanvasRenderingContext2DBase.h:
927         * html/canvas/CanvasRenderingContext2DBase.cpp:
928         (WebCore::CanvasRenderingContext2DBase::stateStack): Added.
929
930         * inspector/InspectorCanvas.h:
931         * inspector/InspectorCanvas.cpp:
932         (WebCore::InspectorCanvas::stringIndexForKey): Added.
933         (WebCore::InspectorCanvas::buildInitialState):
934
935 2018-10-16  Justin Michaud  <justin_michaud@apple.com>
936
937         Implement feature flag and bindings for CSS Painting API
938         https://bugs.webkit.org/show_bug.cgi?id=190237
939
940         Reviewed by Ryosuke Niwa.
941
942         Add feature flag and bindings for CSS Painting API. This adds a new property,
943         CSS.paintWorkletGlobalScope, which will be a temporary way to access the paint
944         worklet global scope untill CSS.paintWorklet is implemented.
945
946         There are a few small changes, mostly adding headers and "using" declarations,
947         that were required to get this to build. This is probably related to unified sources.
948
949         Tests: fast/css-custom-paint/basic.html
950                fast/css-custom-paint/registerPaintBindings.html
951
952         * CMakeLists.txt:
953         * Configurations/FeatureDefines.xcconfig:
954         * DerivedSources.make:
955         * Sources.txt:
956         * WebCore.xcodeproj/project.pbxproj:
957         * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: Added.
958         (WebCore::throwInvalidModificationError):
959         (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint):
960         * bindings/js/JSEventListener.cpp:
961         * bindings/js/JSRemoteDOMWindowCustom.cpp:
962         * bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp:
963         * bindings/js/WebCoreBuiltinNames.h:
964         * css/CSSPaintCallback.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
965         (WebCore::CSSPaintCallback::~CSSPaintCallback):
966         * css/CSSPaintCallback.idl: Added.
967         * css/CSSPaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
968         (WebCore::CSSPaintWorkletGlobalScope::create):
969         (WebCore::CSSPaintWorkletGlobalScope::CSSPaintWorkletGlobalScope):
970         (WebCore::CSSPaintWorkletGlobalScope::devicePixelRatio):
971         (WebCore::CSSPaintWorkletGlobalScope::addRegisteredPaint):
972         * css/CSSPaintWorkletGlobalScope.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
973         (WebCore::CSSPaintWorkletGlobalScope::paintDefinitionMap):
974         * css/CSSPaintWorkletGlobalScope.idl: Added.
975         * css/DOMCSSPaintWorklet.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
976         (WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope):
977         (WebCore::DOMCSSPaintWorklet::from):
978         (WebCore::DOMCSSPaintWorklet::supplementName):
979         * css/DOMCSSPaintWorklet.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
980         * css/DOMCSSPaintWorklet.idl: Added.
981         * css/MediaQueryParserContext.cpp:
982         * css/StyleBuilder.h:
983         * dom/Document.cpp:
984         (WebCore::Document::ensureCSSPaintWorkletGlobalScope):
985         * dom/Document.h:
986         * features.json:
987         * page/RuntimeEnabledFeatures.h:
988         (WebCore::RuntimeEnabledFeatures::setCSSPaintingAPIEnabled):
989         (WebCore::RuntimeEnabledFeatures::cssPaintingAPIEnabled const):
990
991 2018-10-16  Per Arne Vollan  <pvollan@apple.com>
992
993         [WebVTT] Support inline WebVTT styles
994         https://bugs.webkit.org/show_bug.cgi?id=190369
995
996         Reviewed by Eric Carlson.
997
998         Add support for inline WebVTT styles, see https://w3c.github.io/webvtt/#styling. The parsed
999         style strings from the VTT file are added to an optional vector of style strings in the
1000         TextTrack class. These styles are then added as HTMLStyleElement children to the parent of
1001         the cue span element.
1002
1003         Test: media/track/track-cue-css.html
1004
1005         * html/track/InbandGenericTextTrack.cpp:
1006         (WebCore::InbandGenericTextTrack::newStyleSheetsParsed):
1007         * html/track/InbandGenericTextTrack.h:
1008         * html/track/InbandWebVTTTextTrack.cpp:
1009         (WebCore::InbandWebVTTTextTrack::newStyleSheetsParsed):
1010         * html/track/InbandWebVTTTextTrack.h:
1011         * html/track/LoadableTextTrack.cpp:
1012         (WebCore::LoadableTextTrack::newStyleSheetsAvailable):
1013         * html/track/LoadableTextTrack.h:
1014         * html/track/TextTrack.h:
1015         (WebCore::TextTrack::styleSheets const):
1016         * html/track/VTTCue.cpp:
1017         (WebCore::VTTCue::getDisplayTree):
1018         * html/track/WebVTTParser.cpp:
1019         (WebCore::WebVTTParser::getNewCues):
1020         (WebCore::WebVTTParser::getStyleSheets):
1021         (WebCore::WebVTTParser::parse):
1022         (WebCore::WebVTTParser::collectWebVTTBlock):
1023         (WebCore::WebVTTParser::collectStyleSheet):
1024         (WebCore::WebVTTParser::checkStyleSheet):
1025         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
1026         * html/track/WebVTTParser.h:
1027         * loader/TextTrackLoader.cpp:
1028         (WebCore::TextTrackLoader::newStyleSheetsParsed):
1029         (WebCore::TextTrackLoader::getNewStyleSheets):
1030         * loader/TextTrackLoader.h:
1031
1032 2018-10-16  Chris Dumez  <cdumez@apple.com>
1033
1034         window.navigator should not become null after the window loses its browsing context
1035         https://bugs.webkit.org/show_bug.cgi?id=190595
1036
1037         Reviewed by Ryosuke Niwa.
1038
1039         window.navigator should not become null after the window loses its browsing context.
1040         This does not match the HTML specification or the behavior of other browsers.
1041
1042         No new tests, updated existing tests.
1043
1044         * Modules/geolocation/NavigatorGeolocation.cpp:
1045         (WebCore::NavigatorGeolocation::geolocation const):
1046         * page/DOMWindow.cpp:
1047         (WebCore::DOMWindow::navigator):
1048         * page/Navigator.cpp:
1049         (WebCore::Navigator::Navigator):
1050         * page/Navigator.h:
1051         * page/NavigatorBase.cpp:
1052         (WebCore::NavigatorBase::NavigatorBase):
1053         * page/NavigatorBase.h:
1054         * page/WorkerNavigator.cpp:
1055         (WebCore::WorkerNavigator::WorkerNavigator):
1056         * workers/service/ServiceWorkerContainer.cpp:
1057         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
1058         * workers/service/ServiceWorkerContainer.h:
1059
1060 2018-10-16  Alex Christensen  <achristensen@webkit.org>
1061
1062         Replace HistoryItem* with HistoryItem& where possible
1063         https://bugs.webkit.org/show_bug.cgi?id=190617
1064
1065         Reviewed by Chris Dumez.
1066
1067         * history/BackForwardClient.h:
1068         * history/BackForwardController.cpp:
1069         (WebCore::BackForwardController::setCurrentItem):
1070         * history/BackForwardController.h:
1071         * history/HistoryItem.cpp:
1072         (WebCore::defaultNotifyHistoryItemChanged):
1073         (WebCore::HistoryItem::setAlternateTitle):
1074         (WebCore::HistoryItem::setURLString):
1075         (WebCore::HistoryItem::setOriginalURLString):
1076         (WebCore::HistoryItem::setReferrer):
1077         (WebCore::HistoryItem::setTitle):
1078         (WebCore::HistoryItem::setTarget):
1079         (WebCore::HistoryItem::setShouldRestoreScrollPosition):
1080         (WebCore::HistoryItem::setStateObject):
1081         (WebCore::HistoryItem::notifyChanged):
1082         * history/HistoryItem.h:
1083         * loader/EmptyClients.cpp:
1084         * loader/FrameLoader.cpp:
1085         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1086         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1087         (WebCore::FrameLoader::loadSameDocumentItem):
1088         * loader/HistoryController.cpp:
1089         (WebCore::HistoryController::goToItem):
1090         (WebCore::HistoryController::updateForCommit):
1091         (WebCore::HistoryController::recursiveUpdateForCommit):
1092         (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
1093         (WebCore::HistoryController::setCurrentItem):
1094         (WebCore::HistoryController::createItem):
1095         (WebCore::HistoryController::itemsAreClones const):
1096         (WebCore::HistoryController::currentFramesMatchItem const):
1097         * loader/HistoryController.h:
1098
1099 2018-10-16  Alex Christensen  <achristensen@webkit.org>
1100
1101         Remove unused WebHistoryItem._transientPropertyForKey
1102         https://bugs.webkit.org/show_bug.cgi?id=190606
1103
1104         Reviewed by Chris Dumez.
1105
1106         This is unnecessary complexity in HistoryItem.
1107
1108         * history/HistoryItem.h:
1109         * history/mac/HistoryItemMac.mm:
1110         (WebCore::HistoryItem::getTransientProperty const): Deleted.
1111         (WebCore::HistoryItem::setTransientProperty): Deleted.
1112
1113 2018-10-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1114
1115         [Curl] Separate SSL Class for platform dependent way of setup.
1116         https://bugs.webkit.org/show_bug.cgi?id=190597
1117
1118         Reviewed by Alex Christensen.
1119
1120         SSL setup is very platform dependent. This patch separate the class to allow
1121         platform-dependent setup at the SSL handle instantiation.
1122
1123         No new tests because there's no behaviro changes.
1124
1125         * PlatformWinCairo.cmake:
1126         * platform/network/curl/CurlSSLHandle.cpp:
1127         (WebCore::CurlSSLHandle::CurlSSLHandle):
1128         (WebCore::CurlSSLHandle::getCACertPathEnv): Moved.
1129         * platform/network/curl/CurlSSLHandle.h:
1130         * platform/network/win/CurlSSLHandleWin.cpp:
1131         (WebCore::getCACertPathEnv):
1132         (WebCore::CurlSSLHandle::platformInitialize):
1133
1134 2018-10-15  Keith Miller  <keith_miller@apple.com>
1135
1136         Support arm64 CPUs with a 32-bit address space
1137         https://bugs.webkit.org/show_bug.cgi?id=190273
1138
1139         Reviewed by Michael Saboff.
1140
1141         Fix missing namespace annotation.
1142
1143         * cssjit/SelectorCompiler.cpp:
1144         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
1145
1146 2018-10-15  Justin Fan  <justin_fan@apple.com>
1147
1148         Add WebGPU 2018 feature flag and experimental feature flag
1149         https://bugs.webkit.org/show_bug.cgi?id=190509
1150
1151         Reviewed by Dean Jackson.
1152
1153         Re-add ENABLE_WEBGPU, an experimental feature flag, and a RuntimeEnabledFeature
1154         for the 2018 WebGPU prototype.
1155
1156         * Configurations/FeatureDefines.xcconfig:
1157         * page/RuntimeEnabledFeatures.h:
1158         (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled):
1159         (WebCore::RuntimeEnabledFeatures::webGPUEnabled const):
1160
1161 2018-10-15  Commit Queue  <commit-queue@webkit.org>
1162
1163         Unreviewed, rolling out r237162.
1164         https://bugs.webkit.org/show_bug.cgi?id=190612
1165
1166         Broke Windows build (Requested by dolmstead on #webkit).
1167
1168         Reverted changeset:
1169
1170         "Add stub implementation for accessibility objects"
1171         https://bugs.webkit.org/show_bug.cgi?id=190608
1172         https://trac.webkit.org/changeset/237162
1173
1174 2018-10-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
1175
1176         [CG] Adopt CG SPI for non-even cornered rounded rects
1177         https://bugs.webkit.org/show_bug.cgi?id=190155
1178
1179         Reviewed by Simon Fraser.
1180
1181         Instead of creating bezier curves for the non-even corners of the rounded
1182         rects, we should use the optimized SPI provided by CG.
1183
1184         * platform/graphics/cg/PathCG.cpp:
1185         (WebCore::Path::platformAddPathForRoundedRect):
1186
1187 2018-10-15  Don Olmstead  <don.olmstead@sony.com>
1188
1189         Add stub implementation for accessibility objects
1190         https://bugs.webkit.org/show_bug.cgi?id=190608
1191
1192         Reviewed by Michael Catanzaro.
1193
1194         No new tests. No change in behavior.
1195
1196         Add default implementation to associated cpp file. Removes the WPE
1197         specific stubs.
1198
1199         * SourcesWPE.txt:
1200         * accessibility/AXObjectCache.cpp:
1201         (WebCore::AXObjectCache::detachWrapper):
1202         (WebCore::AXObjectCache::attachWrapper):
1203         (WebCore::AXObjectCache::postPlatformNotification):
1204         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1205         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
1206         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
1207         (WebCore::AXObjectCache::handleScrolledToAnchor):
1208         * accessibility/AccessibilityObject.cpp:
1209         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
1210         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1211         * accessibility/AccessibilityObject.h:
1212         * accessibility/wpe/AXObjectCacheWPE.cpp: Removed.
1213         * accessibility/wpe/AccessibilityObjectWPE.cpp: Removed.
1214
1215 2018-10-15  Alex Christensen  <achristensen@webkit.org>
1216
1217         Modernize BackForwardClient.h
1218         https://bugs.webkit.org/show_bug.cgi?id=190610
1219
1220         Reviewed by Chris Dumez.
1221
1222         * editing/markup.cpp:
1223         (WebCore::createPageForSanitizingWebContent):
1224         * history/BackForwardClient.h:
1225         * history/BackForwardController.h:
1226         (WebCore::BackForwardController::client):
1227         (WebCore::BackForwardController::client const):
1228         * inspector/InspectorOverlay.cpp:
1229         (WebCore::InspectorOverlay::overlayPage):
1230         * loader/EmptyClients.cpp:
1231         (WebCore::pageConfigurationWithEmptyClients):
1232         (WebCore::createEmptyFrameNetworkingContext): Deleted.
1233         (WebCore::fillWithEmptyClients): Deleted.
1234         (WebCore::createEmptyEditorClient): Deleted.
1235         * loader/EmptyClients.h:
1236         * page/Page.cpp:
1237         (WebCore::Page::Page):
1238         * page/PageConfiguration.cpp:
1239         (WebCore::PageConfiguration::PageConfiguration):
1240         * page/PageConfiguration.h:
1241         * svg/graphics/SVGImage.cpp:
1242         (WebCore::SVGImage::dataChanged):
1243
1244 2018-10-15  Timothy Hatcher  <timothy@apple.com>
1245
1246         Add support for prefers-color-scheme media query
1247         https://bugs.webkit.org/show_bug.cgi?id=190499
1248         rdar://problem/45212025
1249
1250         Reviewed by Dean Jackson.
1251
1252         Test: css-dark-mode/prefers-color-scheme.html
1253
1254         * Configurations/FeatureDefines.xcconfig: Added ENABLE_DARK_MODE_CSS.
1255         * css/CSSValueKeywords.in: Added light and dark.
1256         * css/MediaFeatureNames.h: Added prefers-color-scheme.
1257         * css/MediaQueryEvaluator.cpp:
1258         (WebCore::prefersColorSchemeEvaluate): Added.
1259         * css/MediaQueryExpression.cpp:
1260         (WebCore::featureWithValidIdent): Added prefers-color-scheme.
1261         * page/RuntimeEnabledFeatures.h:
1262         (WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Added.
1263         (WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Added.
1264         * testing/InternalSettings.cpp:
1265         (WebCore::InternalSettings::resetToConsistentState): Reset setUseDarkAppearance.
1266         (WebCore::InternalSettings::setUseDarkAppearance): Added.
1267         * testing/InternalSettings.h: Added setUseDarkAppearance.
1268         * testing/InternalSettings.idl: Ditto.
1269
1270 2018-10-15  Alex Christensen  <achristensen@webkit.org>
1271
1272         Remove unused WebView._globalHistoryItem
1273         https://bugs.webkit.org/show_bug.cgi?id=190601
1274
1275         Reviewed by Chris Dumez.
1276
1277         This was a hack to give the client a more reliable current back/forward item, but it hasn't been used for years
1278         and it's adding unnecessary complexity to the history code.
1279
1280         * loader/EmptyFrameLoaderClient.h:
1281         * loader/FrameLoader.cpp:
1282         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1283         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1284         * loader/FrameLoaderClient.h:
1285         * loader/HistoryController.cpp:
1286         (WebCore::HistoryController::goToItem):
1287         (WebCore::HistoryController::updateForStandardLoad):
1288         (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
1289
1290 2018-10-15  Chris Dumez  <cdumez@apple.com>
1291
1292         Experiment: target=_blank on anchors should imply rel=noopener
1293         https://bugs.webkit.org/show_bug.cgi?id=190481
1294
1295         Reviewed by Alex Christensen.
1296
1297         As an experiment, try and make it so that target=_blank on anchors implies `rel=noopener` for improved security.
1298         WebContent can then request an opener relationship by using `rel=opener` instead.
1299
1300         This change was discussed at:
1301         - https://github.com/whatwg/html/issues/4078
1302
1303         We want to attempt this change is STP to see if it is Web-compatible. Preliminary testing seems to indicate
1304         that OAuth workflows still work.
1305
1306         * html/HTMLAnchorElement.cpp:
1307         (WebCore::HTMLAnchorElement::parseAttribute):
1308         (WebCore::HTMLAnchorElement::handleClick):
1309         (WebCore::HTMLAnchorElement::effectiveTarget const):
1310         * html/HTMLAnchorElement.h:
1311         * page/RuntimeEnabledFeatures.h:
1312         (WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled):
1313         (WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const):
1314
1315 2018-10-15  Andy Estes  <aestes@apple.com>
1316
1317         [Apple Pay] New shipping methods are ignored when updating after the shippingaddresschange event
1318         https://bugs.webkit.org/show_bug.cgi?id=190560
1319         <rdar://problem/44559075>
1320
1321         Reviewed by Youenn Fablet.
1322
1323         When a PaymentDetailsUpdate with shipping options was specified to updateWith() after the
1324         shippingaddresschange event fires, ApplePayPaymentHandler needs to convert the shipping
1325         options to ShippingMethods and add them to the ShippingContactUpdate so that the Apple Pay
1326         UI renders the new options.
1327
1328         Added test cases to http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrors.https.html.
1329
1330         * Modules/applepay/ApplePayShippingMethod.idl:
1331         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1332         (WebCore::ApplePayPaymentHandler::computeShippingMethods):
1333         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
1334         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1335         * testing/MockPaymentCoordinator.cpp:
1336         (WebCore::convert):
1337         (WebCore::MockPaymentCoordinator::showPaymentUI):
1338         (WebCore::MockPaymentCoordinator::completeShippingContactSelection):
1339         * testing/MockPaymentCoordinator.h:
1340         * testing/MockPaymentCoordinator.idl:
1341
1342 2018-10-15  Youenn Fablet  <youenn@apple.com>
1343
1344         RTCPeerConnection.generateCertificate is not a function
1345         https://bugs.webkit.org/show_bug.cgi?id=173541
1346         <rdar://problem/32638029>
1347
1348         Reviewed by Eric Carlson.
1349
1350         Add support for RTCCertificate generation through libwebrtc certificate generator.
1351         Make generation in the webrtc network thread.
1352         Support is as per spec (ECDSA and RSASSA_PKCS).
1353
1354         Partially covered by WPT tests.
1355
1356         * css/StyleBuilder.h: Fixing build.
1357         * CMakeLists.txt:
1358         * DerivedSources.make:
1359         * Modules/webauthn/PublicKeyCredential.cpp: Fixing build.
1360         * Modules/mediastream/PeerConnectionBackend.cpp:
1361         (WebCore::PeerConnectionBackend::generateCertificate):
1362         * Modules/mediastream/PeerConnectionBackend.h:
1363         (WebCore::PeerConnectionBackend::CertificateInformation::RSASSA_PKCS1_v1_5):
1364         (WebCore::PeerConnectionBackend::CertificateInformation::ECDSA_P256):
1365         (WebCore::PeerConnectionBackend::CertificateInformation::CertificateInformation):
1366         * Modules/mediastream/RTCCertificate.cpp: Added.
1367         (WebCore::RTCCertificate::create):
1368         (WebCore::RTCCertificate::RTCCertificate):
1369         * Modules/mediastream/RTCCertificate.h: Added.
1370         (WebCore::RTCCertificate::expires const):
1371         (WebCore::RTCCertificate::getFingerprints const):
1372         * Modules/mediastream/RTCCertificate.idl: Added.
1373         * Modules/mediastream/RTCPeerConnection.cpp:
1374         (WebCore::certificateTypeFromAlgorithmIdentifier):
1375         (WebCore::RTCPeerConnection::generateCertificate):
1376         * Modules/mediastream/RTCPeerConnection.h:
1377         * Modules/mediastream/RTCPeerConnection.idl:
1378         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: Added.
1379         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
1380         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::~RTCCertificateGeneratorCallback):
1381         (WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
1382         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
1383         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h: Added.
1384         * Sources.txt:
1385         * WebCore.xcodeproj/project.pbxproj:
1386         * bindings/js/WebCoreBuiltinNames.h:
1387         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1388         (WebCore::LibWebRTCProvider::certificateGenerator):
1389         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1390
1391 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
1392
1393         Add compact logging for the paint-order RenderLayer tree
1394         https://bugs.webkit.org/show_bug.cgi?id=190592
1395
1396         Reviewed by Zalan Bujtas.
1397
1398         Add a way to dump the RenderLayer tree in paint order, which will be extended in future
1399         to show more dirty bit state.
1400
1401         * rendering/RenderLayer.cpp:
1402         (WebCore::outputPaintOrderTreeLegend):
1403         (WebCore::outputIdent):
1404         (WebCore::outputPaintOrderTreeRecursive):
1405         (WebCore::showPaintOrderTree):
1406         * rendering/RenderLayer.h:
1407
1408 2018-10-15  Alex Christensen  <achristensen@webkit.org>
1409
1410         Remove unused parameters from FrameLoaderClient::createFrame
1411         https://bugs.webkit.org/show_bug.cgi?id=190587
1412
1413         Reviewed by Chris Dumez.
1414
1415         * loader/EmptyClients.cpp:
1416         (WebCore::EmptyFrameLoaderClient::createFrame):
1417         * loader/EmptyFrameLoaderClient.h:
1418         * loader/FrameLoaderClient.h:
1419         * loader/SubframeLoader.cpp:
1420         (WebCore::SubframeLoader::loadSubframe):
1421
1422 2018-10-15  Andy Estes  <aestes@apple.com>
1423
1424         [Apple Pay] Payment authorization results with ApplePayErrors should never be considered final
1425         https://bugs.webkit.org/show_bug.cgi?id=190559
1426         <rdar://problem/37250908>
1427
1428         Reviewed by Anders Carlsson.
1429
1430         When PaymentCoordinator thinks a payment authorization result is final it releases the
1431         active ApplePaySession. The Apple Pay UI is dismissed after a receiving a final result.
1432
1433         However, WebCore::isFinalStateResult had the wrong idea about what was a final state,
1434         in some cases causing PaymentCoordinator to release the active session even when the UI is
1435         still presented. If the user authorizes payment again, the website will not receive another
1436         paymentauthorized event, and the Apple Pay UI will eventually time out waiting for a result.
1437
1438         Specifically, isFinalStateResult thought that:
1439
1440         (1) results with STATUS_SUCCESS were always final, even if they had errors
1441         (2) errors with code "unknown" were final
1442
1443         Both of these assumptions are wrong. PassKit considers any result with errors to be
1444         non-final, even if an error has code "unknown."
1445
1446         Fixed WebCore::isFinalStateResult to agree with what PassKit considers to be final results.
1447
1448         Test: http/tests/ssl/applepay/ApplePaySessionFinalState.https.html
1449
1450         * Modules/applepay/ApplePaySessionPaymentRequest.cpp:
1451         (WebCore::isFinalStateResult):
1452         * testing/MockPaymentCoordinator.cpp:
1453         (WebCore::MockPaymentCoordinator::completePaymentSession):
1454
1455 2018-10-15  Andy Estes  <aestes@apple.com>
1456
1457         [Payment Request] PaymentResponse should be a ContextDestructionObserver
1458         https://bugs.webkit.org/show_bug.cgi?id=190558
1459
1460         Reviewed by Alex Christensen.
1461
1462         Make PaymentResponse a ContextDestructionObserver so it has a ScriptExecutionContext to
1463         return for its override of EventTarget::scriptExecutionContext(). Do this instead of
1464         downcasting m_request to an ActiveDOMObject to ask for its context.
1465
1466         * Modules/paymentrequest/PaymentRequest.cpp:
1467         (WebCore::PaymentRequest::accept):
1468         * Modules/paymentrequest/PaymentResponse.cpp:
1469         (WebCore::PaymentResponse::PaymentResponse):
1470         (WebCore::PaymentResponse::scriptExecutionContext const): Deleted.
1471         * Modules/paymentrequest/PaymentResponse.h:
1472
1473 2018-10-15  Andy Estes  <aestes@apple.com>
1474
1475         [Payment Request] Use a PendingActivity token rather than calling (un)setPendingActivity
1476         https://bugs.webkit.org/show_bug.cgi?id=190557
1477
1478         Reviewed by Alex Christensen.
1479
1480         PaymentRequest has pending activity whenever there is an active payment handler, since
1481         user-initiated events can occur whenever the payment UI is displayed.
1482
1483         Rather than manually track the pending activity with setPendingActivity() and
1484         unsetPendingActivity(), use a PendingActivity token tied to the lifetime of the active
1485         payment handler. Also, rewrite canSuspendForDocumentSuspension() in terms of
1486         hasPendingActivity().
1487
1488         * Modules/paymentrequest/PaymentRequest.cpp:
1489         (WebCore::PaymentRequest::show):
1490         (WebCore::PaymentRequest::abortWithException):
1491         (WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
1492         (WebCore::PaymentRequest::paymentMethodChanged):
1493         (WebCore::PaymentRequest::completeMerchantValidation):
1494         (WebCore::PaymentRequest::settleDetailsPromise):
1495         (WebCore::PaymentRequest::complete):
1496         (WebCore::PaymentRequest::cancel):
1497         * Modules/paymentrequest/PaymentRequest.h:
1498
1499 2018-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1500
1501         Changing view scale should zoom to initial scale if the page is already at initial scale
1502         https://bugs.webkit.org/show_bug.cgi?id=190570
1503         <rdar://problem/45261877>
1504
1505         Reviewed by Tim Horton.
1506
1507         Add a getter for ViewportConfiguration's layout size scale factor.
1508         See Source/WebKit/ChangeLog for more details.
1509
1510         * page/ViewportConfiguration.h:
1511         (WebCore::ViewportConfiguration::layoutSizeScaleFactor const):
1512
1513 2018-10-15  Charlie Turner  <cturner@igalia.com>
1514
1515         Fix build error with !LOG_DISABLED in Release mode
1516         https://bugs.webkit.org/show_bug.cgi?id=190465
1517
1518         Reviewed by Michael Catanzaro.
1519
1520         No tests due to no new functionality.
1521
1522         * workers/service/ServiceWorkerRegistrationKey.cpp:
1523         * workers/service/ServiceWorkerRegistrationKey.h:
1524
1525 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
1526
1527         LayerListMutationDetector should take a reference
1528         https://bugs.webkit.org/show_bug.cgi?id=190586
1529
1530         Reviewed by Zalan Bujtas.
1531         
1532         Change LayerListMutationDetector to take a RenderLayer&.
1533
1534         * rendering/RenderLayer.cpp:
1535         (WebCore::RenderLayer::paintList):
1536         (WebCore::RenderLayer::hitTestLayer):
1537         (WebCore::RenderLayer::calculateClipRects const):
1538         * rendering/RenderLayer.h:
1539         (WebCore::LayerListMutationDetector::LayerListMutationDetector):
1540         (WebCore::LayerListMutationDetector::~LayerListMutationDetector):
1541         * rendering/RenderLayerBacking.cpp:
1542         (WebCore::traverseVisibleNonCompositedDescendantLayers):
1543         * rendering/RenderLayerCompositor.cpp:
1544         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
1545         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1546         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1547         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
1548         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
1549         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
1550         (WebCore::RenderLayerCompositor::layerHas3DContent const):
1551
1552 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
1553
1554         Share some code to dirty z-order and normal flow lists when child layers are added or removed
1555         https://bugs.webkit.org/show_bug.cgi?id=190585
1556
1557         Reviewed by Zalan Bujtas.
1558
1559         Factor code which dirties the normal flow list and child stacking context z-order lists
1560         when a layer is added or removed.
1561
1562         * rendering/RenderLayer.cpp:
1563         (WebCore::RenderLayer::addChild):
1564         (WebCore::RenderLayer::removeChild):
1565         (WebCore::RenderLayer::dirtyPaintOrderListsOnChildChange):
1566         * rendering/RenderLayer.h:
1567
1568 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
1569
1570         Make a helper function to check for reflection layers
1571         https://bugs.webkit.org/show_bug.cgi?id=190584
1572
1573         Reviewed by Zalan Bujtas.
1574
1575         Add RenderLayer::isReflectionLayer() which returns true if the passed layer
1576         is the layer of this layer's reflection. It's used in z-order list building.
1577
1578         * rendering/RenderLayer.cpp:
1579         (WebCore::RenderLayer::updateNormalFlowList):
1580         (WebCore::RenderLayer::rebuildZOrderLists):
1581         (WebCore::RenderLayer::collectLayers):
1582         (WebCore::expandClipRectForDescendantsAndReflection):
1583         (WebCore::RenderLayer::calculateClipRects const):
1584         * rendering/RenderLayer.h:
1585
1586 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
1587
1588         RenderLayer::addChild() and removeChild() should take references
1589         https://bugs.webkit.org/show_bug.cgi?id=190582
1590
1591         Reviewed by Zalan Bujtas.
1592
1593         Pass the layer to be added or removed as a reference; it's never null.
1594
1595         * rendering/RenderElement.cpp:
1596         (WebCore::addLayers):
1597         (WebCore::RenderElement::removeLayers):
1598         (WebCore::RenderElement::moveLayers):
1599         * rendering/RenderLayer.cpp:
1600         (WebCore::RenderLayer::addChild):
1601         (WebCore::RenderLayer::removeChild):
1602         (WebCore::RenderLayer::insertOnlyThisLayer):
1603         (WebCore::RenderLayer::removeOnlyThisLayer):
1604         * rendering/RenderLayer.h:
1605
1606 2018-10-15  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
1607
1608         [Cairo] Incorrect rendering for 135-deg skews
1609         https://bugs.webkit.org/show_bug.cgi?id=190513
1610
1611         Compensation value to zero the the translation components
1612         of the transformation matrix is incorrect if the matrix
1613         has a shear factor.
1614
1615         Reviewed by Žan Doberšek.
1616
1617         Tests: fast/transforms/skew-x-135deg-with-gradient.html
1618                fast/transforms/skew-y-135deg-with-gradient.html
1619
1620         * platform/graphics/cairo/CairoUtilities.cpp:
1621         (WebCore::drawPatternToCairoContext):
1622
1623 2018-10-15  Christopher Reid  <chris.reid@sony.com>
1624
1625         [Curl][WinCairo] Add Public Suffix support to WinCairo
1626         https://bugs.webkit.org/show_bug.cgi?id=183060
1627
1628         Reviewed by Alex Christensen.
1629
1630         Add Public Suffix support to WinCairo using LibPSL.
1631         LibPSL has been added to WinCairoRequirements in v2018.10.09.
1632
1633         * platform/Curl.cmake:
1634         * platform/network/curl/CookieJarDB.cpp:
1635         (WebCore::CookieJarDB::searchCookies): Search for cookies using the topPrivatelyControlledDomain
1636         (WebCore::CookieJarDB::setCookie): Prevent cookies from being added under TLDs
1637         * platform/network/curl/PublicSuffixCurl.cpp: Added.
1638         (WebCore::isPublicSuffix):
1639         (WebCore::topPrivatelyControlledDomainInternal):
1640         (WebCore::topPrivatelyControlledDomain):
1641
1642 2018-10-15  Simon Fraser  <simon.fraser@apple.com>
1643
1644         RenderLayer tree-related cleanup
1645         https://bugs.webkit.org/show_bug.cgi?id=190572
1646
1647         Reviewed by Zalan Bujtas.
1648
1649         Move code around so that functions related to parent/child and z-order tree structure
1650         are near the top of RenderLayer.cpp, since this is one of the primary functions of layers.
1651         
1652         Attempts to use inheritance or composition to separate out tree structure resulted in
1653         unwieldy code and/or performance regressions.
1654         
1655         The only behavior change is to store a bit for m_isStackingContext so that we don't have
1656         to consult the old style to know if it changed.
1657
1658         * rendering/RenderLayer.cpp:
1659         (WebCore::RenderLayer::RenderLayer):
1660         (WebCore::RenderLayer::addChild):
1661         (WebCore::RenderLayer::removeChild):
1662         (WebCore::RenderLayer::insertOnlyThisLayer):
1663         (WebCore::RenderLayer::removeOnlyThisLayer):
1664         (WebCore::canCreateStackingContext):
1665         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
1666         (WebCore::RenderLayer::shouldBeStackingContext const):
1667         (WebCore::RenderLayer::setIsNormalFlowOnly):
1668         (WebCore::RenderLayer::setIsStackingContext):
1669         (WebCore::RenderLayer::setParent):
1670         (WebCore::RenderLayer::dirtyZOrderLists):
1671         (WebCore::RenderLayer::dirtyStackingContextZOrderLists):
1672         (WebCore::RenderLayer::dirtyNormalFlowList):
1673         (WebCore::RenderLayer::updateNormalFlowList):
1674         (WebCore::RenderLayer::rebuildZOrderLists):
1675         (WebCore::RenderLayer::collectLayers):
1676         (WebCore::RenderLayer::updateLayerListsIfNeeded):
1677         (WebCore::RenderLayer::beginTransparencyLayers):
1678         (WebCore::RenderLayer::willBeDestroyed):
1679         (WebCore::RenderLayer::isDescendantOf const):
1680         (WebCore::RenderLayer::calculateClipRects const):
1681         (WebCore::compareZIndex): Deleted.
1682         * rendering/RenderLayer.h:
1683
1684 2018-10-15  Antti Koivisto  <antti@apple.com>
1685
1686         [PSON] Prewarm system fallback fonts
1687         https://bugs.webkit.org/show_bug.cgi?id=190517
1688
1689         Reviewed by Ryosuke Niwa.
1690
1691         This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages
1692         after process swaps.
1693
1694         * page/PrewarmInformation.h:
1695         (WebCore::PrewarmInformation::encode const):
1696         (WebCore::PrewarmInformation::decode):
1697         * page/ProcessWarming.cpp:
1698         (WebCore::ProcessWarming::collectPrewarmInformation):
1699         (WebCore::ProcessWarming::prewarmWithInformation):
1700         * platform/graphics/FontCache.cpp:
1701         (WebCore::FontCache::collectPrewarmInformation const):
1702         (WebCore::FontCache::prewarm):
1703         * platform/graphics/FontCache.h:
1704         (WebCore::FontCache::PrewarmInformation::isolatedCopy const):
1705         (WebCore::FontCache::PrewarmInformation::encode const):
1706         (WebCore::FontCache::PrewarmInformation::decode):
1707
1708         Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope.
1709
1710         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1711         (WebCore::FontDatabase::collectionForFamily):
1712         (WebCore::FontCache::systemFallbackForCharacters):
1713
1714         Collect the names of fonts that end up needing character specific system fallbacks.
1715
1716         (WebCore::FontCache::collectPrewarmInformation const):
1717
1718         Include them into prewarm information.
1719
1720         (WebCore::FontCache::prewarm):
1721
1722         Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully
1723         prewarm it for fallbacks (independent of size, locale or other characteristics).
1724         Any future calls to systemFallbackForCharacters are fast.
1725
1726 2018-10-15  Chris Dumez  <cdumez@apple.com>
1727
1728         Restrict browsing context lookup by name to frames that are related to one another
1729         https://bugs.webkit.org/show_bug.cgi?id=190475
1730
1731         Reviewed by Alex Christensen.
1732
1733         Update our frame lookup by name logic to take in the active / requesting frame and
1734         only a return a frame that is related to it. By related to it, I mean:
1735         - Ancestor <-> Descendant relationship
1736         - Opener <-> Openee relationship
1737
1738         Being able to look up unrelated frames makes process swapping difficult so we need
1739         to be stricter.
1740
1741         This change is being discussed at:
1742         - https://github.com/whatwg/html/issues/313
1743
1744         Tests: http/tests/dom/new-window-can-target-opener.html
1745                http/tests/dom/noopener-window-cannot-target-opener.html
1746                http/tests/dom/noopener-window-not-targetable.html
1747                http/tests/dom/noopener-window-not-targetable2.html
1748                http/tests/dom/noreferrer-window-not-targetable.html
1749                http/tests/dom/opened-window-not-targetable-after-disowning-opener.html
1750
1751         * loader/FrameLoader.cpp:
1752         (WebCore::FrameLoader::findFrameForNavigation):
1753         * page/FrameTree.cpp:
1754         (WebCore::isFrameFamiliarWith):
1755         (WebCore::FrameTree::find const):
1756         * page/FrameTree.h:
1757         * rendering/HitTestResult.cpp:
1758         (WebCore::HitTestResult::targetFrame const):
1759
1760 2018-10-15  Alex Christensen  <achristensen@webkit.org>
1761
1762         Shrink more enum classes
1763         https://bugs.webkit.org/show_bug.cgi?id=190540
1764
1765         Reviewed by Chris Dumez.
1766
1767         * Modules/notifications/NotificationDirection.h:
1768         * dom/Document.h:
1769         * loader/FrameLoader.h:
1770         * loader/FrameLoaderClient.h:
1771         * loader/HistoryController.h:
1772         * loader/ShouldSkipSafeBrowsingCheck.h:
1773         * loader/ShouldTreatAsContinuingLoad.h:
1774         * page/AutoplayEvent.h:
1775         * page/ChromeClient.h:
1776         * page/DiagnosticLoggingClient.h:
1777         * page/Page.h:
1778         * platform/CookiesStrategy.h:
1779         * platform/audio/AudioSession.h:
1780         * platform/network/NetworkStorageSession.h:
1781         * platform/network/StoredCredentialsPolicy.h:
1782         * workers/service/SWClientConnection.h:
1783         * workers/service/ServiceWorkerContainer.h:
1784         * workers/service/ServiceWorkerRegistrationData.h:
1785         * workers/service/ServiceWorkerRegistrationOptions.h:
1786         * workers/service/ServiceWorkerTypes.h:
1787         * workers/service/ServiceWorkerUpdateViaCache.h:
1788         * workers/service/server/SWServer.h:
1789         * workers/service/server/SWServerRegistration.h:
1790
1791 2018-10-15  Patrick Griffis  <pgriffis@igalia.com>
1792
1793         [GTK][WPE] Implement subprocess sandboxing
1794         https://bugs.webkit.org/show_bug.cgi?id=188568
1795
1796         Reviewed by Michael Catanzaro.
1797
1798         Link against libseccomp.
1799
1800         * PlatformGTK.cmake:
1801
1802 2018-10-15  YUHAN WU  <yuhan_wu@apple.com>
1803
1804         Implement error handler of MediaRecorder
1805         https://bugs.webkit.org/show_bug.cgi?id=190438
1806
1807         Reviewed by Youenn Fablet.
1808
1809         Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-error.html
1810
1811         Implement error event handler (onerror) for MediaRecorder and basic architecture of start() function.
1812
1813         * CMakeLists.txt:
1814         * DerivedSources.make:
1815         * Modules/mediarecorder/MediaRecorder.cpp:
1816         (WebCore::MediaRecorder::MediaRecorder):
1817         (WebCore::MediaRecorder::~MediaRecorder):
1818         (WebCore::MediaRecorder::stop):
1819         (WebCore::MediaRecorder::start):
1820         (WebCore::MediaRecorder::setNewRecordingState):
1821         (WebCore::MediaRecorder::scheduleDeferredTask):
1822         (WebCore::MediaRecorder::didAddOrRemoveTrack):
1823         * Modules/mediarecorder/MediaRecorder.h:
1824         * Modules/mediarecorder/MediaRecorder.idl:
1825         * Modules/mediarecorder/MediaRecorderErrorEvent.cpp: Added.
1826         (WebCore::MediaRecorderErrorEvent::create):
1827         (WebCore::MediaRecorderErrorEvent::MediaRecorderErrorEvent):
1828         (WebCore::MediaRecorderErrorEvent::eventInterface const):
1829         * Modules/mediarecorder/MediaRecorderErrorEvent.h: Added.
1830         * Modules/mediarecorder/MediaRecorderErrorEvent.idl: Added.
1831         * Sources.txt:
1832         * WebCore.xcodeproj/project.pbxproj:
1833         * bindings/js/WebCoreBuiltinNames.h:
1834         * dom/EventNames.in:
1835         * dom/EventTargetFactory.in:
1836
1837 2018-10-15  Chris Dumez  <cdumez@apple.com>
1838
1839         Window's properties such as 'location' should not become null when it loses its browsing context
1840         https://bugs.webkit.org/show_bug.cgi?id=190539
1841
1842         Reviewed by Alex Christensen.
1843
1844         Window's properties such as 'location' should not become null when it loses its browsing context.
1845         This Webkit behavior is not standard and does not match other browsers so this patch makes it so
1846         that those properties persist.
1847
1848         Tests: http/tests/dom/cross-origin-detached-window-properties.html
1849                http/tests/dom/same-origin-detached-window-properties.html
1850
1851         * bindings/js/JSDOMBindingSecurity.cpp:
1852         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
1853         * bindings/js/JSDOMBindingSecurity.h:
1854         * bindings/js/JSDOMWindowProperties.cpp:
1855         (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
1856         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
1857         * bindings/js/JSLocationCustom.cpp:
1858         (WebCore::getOwnPropertySlotCommon):
1859         (WebCore::putCommon):
1860         (WebCore::JSLocation::deleteProperty):
1861         (WebCore::JSLocation::deletePropertyByIndex):
1862         (WebCore::JSLocation::getOwnPropertyNames):
1863         (WebCore::JSLocation::defineOwnProperty):
1864         (WebCore::JSLocation::getPrototype):
1865         (WebCore::JSLocation::toStringName):
1866         * bindings/scripts/CodeGeneratorJS.pm:
1867         (GenerateAttributeGetterBodyDefinition):
1868         (GenerateAttributeSetterBodyDefinition):
1869         (GenerateOperationBodyDefinition):
1870         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1871         (WebCore::jsTestActiveDOMObjectExcitingAttrGetter):
1872         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody):
1873         * crypto/SubtleCrypto.cpp:
1874         (WebCore::SubtleCrypto::SubtleCrypto):
1875         * crypto/SubtleCrypto.h:
1876         (WebCore::SubtleCrypto::create):
1877         * dom/Document.cpp:
1878         (WebCore::Document::~Document):
1879         * page/Crypto.cpp:
1880         (WebCore::Crypto::Crypto):
1881         * page/Crypto.h:
1882         (WebCore::Crypto::create):
1883         * page/DOMWindow.cpp:
1884         (WebCore::DOMWindow::~DOMWindow):
1885         (WebCore::DOMWindow::frameDestroyed):
1886         (WebCore::DOMWindow::screen):
1887         (WebCore::DOMWindow::history):
1888         (WebCore::DOMWindow::crypto):
1889         (WebCore::DOMWindow::locationbar):
1890         (WebCore::DOMWindow::menubar):
1891         (WebCore::DOMWindow::personalbar):
1892         (WebCore::DOMWindow::scrollbars):
1893         (WebCore::DOMWindow::statusbar):
1894         (WebCore::DOMWindow::toolbar):
1895         (WebCore::DOMWindow::console const):
1896         (WebCore::DOMWindow::applicationCache):
1897         (WebCore::DOMWindow::navigator):
1898         (WebCore::DOMWindow::performance const):
1899         (WebCore::DOMWindow::location):
1900         (WebCore::DOMWindow::visualViewport):
1901         (WebCore::DOMWindow::styleMedia):
1902         * page/DOMWindow.h:
1903         * page/DOMWindow.idl:
1904         * workers/WorkerGlobalScope.cpp:
1905         (WebCore::WorkerGlobalScope::crypto):
1906
1907 2018-10-15  Alex Christensen  <achristensen@webkit.org>
1908
1909         Include EnumTraits.h less
1910         https://bugs.webkit.org/show_bug.cgi?id=190535
1911
1912         Reviewed by Chris Dumez.
1913
1914         * Modules/applepay/ApplePaySessionPaymentRequest.h:
1915         * Modules/applepay/PaymentAuthorizationStatus.h:
1916         * Modules/applicationmanifest/ApplicationManifest.h:
1917         * Modules/fetch/FetchHeaders.h:
1918         * Modules/webauthn/AuthenticatorTransport.h:
1919         * Modules/webauthn/PublicKeyCredentialType.h:
1920         * loader/ShouldSkipSafeBrowsingCheck.h:
1921         * loader/ShouldTreatAsContinuingLoad.h:
1922         * platform/Cookie.h:
1923         * platform/audio/AudioSession.h:
1924         * platform/mediastream/CaptureDevice.h:
1925         * platform/mediastream/MediaStreamRequest.h:
1926         * platform/mediastream/RealtimeMediaSourceSettings.h:
1927         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1928         * platform/network/NetworkLoadInformation.h:
1929         * workers/service/ServiceWorkerClientType.h:
1930         * workers/service/ServiceWorkerTypes.h:
1931         * workers/service/ServiceWorkerUpdateViaCache.h:
1932
1933 2018-10-15  Alex Christensen  <achristensen@webkit.org>
1934
1935         Remove InjectedBundle processing of back/forward lists
1936         https://bugs.webkit.org/show_bug.cgi?id=190459
1937
1938         Reviewed by Chris Dumez.
1939
1940         The uses of these functions are dead code I removed in rdar://problem/45180545
1941         Removing these functions is a step towards fixing the PSON history bugs.
1942
1943         * loader/EmptyFrameLoaderClient.h:
1944         * loader/FrameLoaderClient.h:
1945         * loader/HistoryController.cpp:
1946         (WebCore::HistoryController::goToItem):
1947
1948 2018-10-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1949
1950         [JSC] Remove Option::useAsyncIterator
1951         https://bugs.webkit.org/show_bug.cgi?id=190567
1952
1953         Reviewed by Saam Barati.
1954
1955         * Configurations/FeatureDefines.xcconfig:
1956
1957 2018-10-15  Philippe Normand  <pnormand@igalia.com>
1958
1959         [GStreamer] Fix EME build for GStreamer 1.14.x
1960         https://bugs.webkit.org/show_bug.cgi?id=190471
1961
1962         Reviewed by Xabier Rodriguez-Calvar.
1963
1964         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1965         (webkitMediaCommonEncryptionDecryptTransformCaps): The
1966         GST_PROTECTION_UNSPECIFIED_SYSTEM_ID #define won't be shipped
1967         until the GStreamer 1.16.0 release, so its use needs to be wrapped
1968         between a version check.
1969         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1970         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Ditto.
1971
1972 2018-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1973
1974         [iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view
1975         https://bugs.webkit.org/show_bug.cgi?id=190504
1976         <rdar://problem/45117760>
1977
1978         Reviewed by Tim Horton.
1979
1980         Add support in ViewportConfiguration for applying a layout size scale factor to the viewport. See below for
1981         more details.
1982
1983         Tests: fast/viewport/ios/constant-width-viewport-after-changing-view-scale.html
1984                fast/viewport/ios/device-width-viewport-after-changing-view-scale.html
1985
1986         * page/ViewportConfiguration.cpp:
1987         (WebCore::ViewportConfiguration::setViewLayoutSize):
1988
1989         The viewport's layout size may now be changed alongside the layout size scale factor. If either of these two
1990         variables change, we recompute our minimum layout size and viewport configuration parameters.
1991
1992         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
1993         (WebCore::ViewportConfiguration::nativeWebpageParameters):
1994         (WebCore::ViewportConfiguration::testingParameters):
1995         (WebCore::ViewportConfiguration::updateConfiguration):
1996
1997         Multiply the minimum scale, initial scale, and maximum scale by the layout size scale factor. This allows us to
1998         keep the document well-proportioned within the viewport, while still laying out at a different layout size.
1999
2000         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
2001
2002         Compute the minimum layout size by scaling the default layout size derived from our view's size.
2003
2004         (WebCore::ViewportConfiguration::layoutWidth const):
2005         (WebCore::ViewportConfiguration::layoutHeight const):
2006         * page/ViewportConfiguration.h:
2007
2008         Maintain the original initial scale, unaffected by the layout size scale factor. This is used when computing
2009         layout width and height to prevent scaling by the layout size scale factor twice when computing layout sizes.
2010
2011         (WebCore::ViewportConfiguration::description const):
2012
2013         Include the layout size scale factor in ViewportConfiguration's description string.
2014
2015         (WebCore::ViewportConfiguration::Parameters::operator== const):
2016         (WebCore::operator<<):
2017
2018 2018-10-12  Youenn Fablet  <youenn@apple.com>
2019
2020         Use downcast for use of RealtimeMediaSource in LibWebRTCMediaEndpoint
2021         https://bugs.webkit.org/show_bug.cgi?id=190533
2022
2023         Reviewed by Chris Dumez.
2024
2025         Clean-up work.
2026         No change of behavior.
2027
2028         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2029         (WebCore::setExistingReceiverSourceTrack):
2030         * platform/mediastream/RealtimeIncomingAudioSource.h:
2031         (isType):
2032         * platform/mediastream/RealtimeIncomingVideoSource.h:
2033         (isType):
2034         * platform/mediastream/RealtimeMediaSource.h:
2035
2036 2018-10-12  Jer Noble  <jer.noble@apple.com>
2037
2038         WebAVSampleBufferErrorListener's parent should be a WeakPtr.
2039         https://bugs.webkit.org/show_bug.cgi?id=190524
2040         <rdar://problem/44359307>
2041
2042         Reviewed by Eric Carlson.
2043
2044         Once WebAVSampleBufferErrorListener's parent is a WeakPtr, we no longer need to pass
2045         protectedSelf into the callOnMainThread lambdas; we can pass in the parent itself.
2046
2047         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2048         (-[WebAVSampleBufferErrorListener initWithParent:]):
2049         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2050         (-[WebAVSampleBufferErrorListener layerFailedToDecode:]):
2051         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2052         (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers):
2053
2054 2018-10-12  Ryosuke Niwa  <rniwa@webkit.org>
2055
2056         Address the review comment which was meant to be addressed in r237025.
2057
2058         * editing/MarkupAccumulator.cpp:
2059         (WebCore::elementCannotHaveEndTag):
2060
2061 2018-10-12  Youenn Fablet  <youenn@apple.com> and Alejandro G. Castro  <alex@igalia.com>
2062
2063         Refresh libwebrtc up to 343f4144be
2064         https://bugs.webkit.org/show_bug.cgi?id=190361
2065
2066         Reviewed by Chris Dumez.
2067
2068         This refresh should not change behavior but will allow us to implement better
2069         mdns candidate support and simulcast activation surfacing through addTransceiver.
2070         Covered by existing tests.
2071
2072         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2073         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
2074         * testing/MockLibWebRTCPeerConnection.cpp:
2075         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
2076         * testing/MockLibWebRTCPeerConnection.h:
2077         (WebCore::MockRtpSender::GetParameters): Deleted.
2078         (WebCore::MockRtpSender::SetParameters): Deleted.
2079         (WebCore::MockRtpSender::GetDtmfSender const): Deleted.
2080
2081 2018-10-12  Alex Christensen  <achristensen@webkit.org>
2082
2083         Allow encoding of small enum classes
2084         https://bugs.webkit.org/show_bug.cgi?id=190531
2085
2086         Reviewed by Tim Horton.
2087
2088         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2089         * dom/Document.h:
2090         * editing/FontAttributeChanges.h:
2091         * history/CachedFrame.h:
2092         * loader/FrameLoaderTypes.h:
2093         * platform/CookiesStrategy.h:
2094         * platform/PasteboardItemInfo.h:
2095         * platform/ReferrerPolicy.h:
2096
2097 2018-10-12  Rob Buis  <rbuis@igalia.com>
2098
2099         Solve the confusion around blankURL() and isBlankURL() in URL
2100         https://bugs.webkit.org/show_bug.cgi?id=158988
2101
2102         Reviewed by Alex Christensen.
2103
2104         The name isBlankURL is not accurate as the function tests the
2105         protocol, not the full URL. Choose protocolIsAbout to align with
2106         exisiting protocolIsData, protocolIsBlob etc.
2107
2108         No tests as no change in functionality.
2109
2110         * WebCore.order:
2111         * loader/DocumentLoader.cpp:
2112         (WebCore::DocumentLoader::loadApplicationManifest):
2113         (WebCore::DocumentLoader::startIconLoading):
2114         * loader/NavigationAction.cpp:
2115         (WebCore::shouldTreatAsSameOriginNavigation):
2116         * loader/PolicyChecker.cpp:
2117         (WebCore::PolicyChecker::checkNavigationPolicy):
2118         * loader/ResourceLoadObserver.cpp:
2119         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2120         * page/PageSerializer.cpp:
2121         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendCustomAttributes):
2122         (WebCore::PageSerializer::serializeFrame):
2123         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2124         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame const):
2125         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource const):
2126         * platform/URL.cpp:
2127         (WebCore::URL::protocolIsAbout const):
2128         (WebCore::URL::isBlankURL const): Deleted.
2129         * platform/URL.h:
2130         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2131         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2132
2133 2018-10-12  Youenn Fablet  <youenn@apple.com>
2134
2135         DOMCache should dereference itself as soon as stopped
2136         https://bugs.webkit.org/show_bug.cgi?id=190441
2137
2138         Reviewed by Chris Dumez.
2139
2140         Dereference the DOMCache as soon as its context is stopped instead of waiting for garbage collection.
2141         This allows freeing resources sooner in the network process.
2142         No observable change of behavior since the DOMCache becomes no-op when its context is stopped.
2143
2144         * Modules/cache/DOMCache.cpp:
2145         (WebCore::DOMCache::~DOMCache):
2146         (WebCore::DOMCache::stop):
2147
2148 2018-10-12  Jer Noble  <jer.noble@apple.com>
2149
2150         CRASH in WebCore::MediaPlayerPrivateAVFoundation::setPreload
2151         https://bugs.webkit.org/show_bug.cgi?id=190485
2152         <rdar://problem/34613350>
2153
2154         Reviewed by Eric Carlson.
2155
2156         Crash analytics show that a pure-virtual function is called by MediaPlayerPrivateAVFoundation::setPreload(), and
2157         the likely cause of that pure-virtual function call is that the MediaPlayerPrivateAVFoundation object itself has
2158         been destroyed, likely as a side effect of calling MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL().
2159         The usual suspect for this kind of crash is due to calling into JS (e.g., from a callback passed up to
2160         HTMLMediaElement). Code inspection hasn't yielded any good hints about why this might be occurring, so we will
2161         add a ScriptDisallowedScope assertion inside HTMLMediaElement::prepareToPlay(), to generate a good crashlog
2162         showing exactly what callback is resulting in a JS call. But just in case the deallocation is not due to JS,
2163         also add an explicit strong-ref inside MediaPlayer::prepareToPlay.
2164
2165         * html/HTMLMediaElement.cpp:
2166         (WebCore::HTMLMediaElement::prepareToPlay):
2167         * platform/graphics/MediaPlayer.cpp:
2168         (WebCore::MediaPlayer::prepareToPlay):
2169
2170 2018-10-12  Jer Noble  <jer.noble@apple.com>
2171
2172         Null-dereference in SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged
2173         https://bugs.webkit.org/show_bug.cgi?id=190490
2174         <rdar://problem/42213807>
2175
2176         Reviewed by Eric Carlson.
2177
2178         Crash analytics show a null dereference occurring, likely because m_mediaSource is null.
2179
2180         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2181         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2182
2183 2018-10-11  Don Olmstead  <don.olmstead@sony.com>
2184
2185         Add Houdini specs to features.json
2186         https://bugs.webkit.org/show_bug.cgi?id=190494
2187         <rdar://problem/45211879>
2188
2189         Unreviewed fix.
2190
2191         Specifications should not reference other specifications. Also
2192         move Worklet into the specifications section.
2193
2194         * features.json:
2195
2196 2018-10-11  Youenn Fablet  <youenn@apple.com>
2197
2198         IOS 12 - Service worker cache not shared when added to homescreen
2199         https://bugs.webkit.org/show_bug.cgi?id=190269
2200         <rdar://problem/45009961>
2201
2202         Reviewed by Alex Christensen.
2203
2204         Expose Cache Storage API when Service Worker API is exposed.
2205         This is used for API tests.
2206
2207         * dom/ScriptExecutionContext.h: Make hasServiceWorkerScheme
2208         available outside SERVICE_WORKER compilation flag since used by DOMWindowCaches.
2209         * dom/ScriptExecutionContext.cpp: Ditto.
2210         * Modules/cache/DOMWindowCaches.idl:
2211
2212 2018-10-10  Simon Fraser  <simon.fraser@apple.com>
2213
2214         Hide RenderLayer z-order and normal flow lists behind iterators
2215         https://bugs.webkit.org/show_bug.cgi?id=190457
2216
2217         Reviewed by Zalan Bujtas.
2218
2219         Expose the positive z-order, negative z-order and normal flow lists
2220         from RenderLayer as iterators rather than vectors of raw pointers.
2221         
2222         This hides the fact that the vectors can be null, and allows for easier casting in future.
2223
2224         * rendering/RenderLayer.cpp:
2225         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
2226         (WebCore::RenderLayer::paintLayerContents):
2227         (WebCore::RenderLayer::paintList):
2228         (WebCore::RenderLayer::hitTestLayer):
2229         (WebCore::RenderLayer::hitTestList):
2230         (WebCore::RenderLayer::calculateClipRects const):
2231         * rendering/RenderLayer.h:
2232         * rendering/RenderLayerBacking.cpp:
2233         (WebCore::traverseVisibleNonCompositedDescendantLayers):
2234         * rendering/RenderLayerCompositor.cpp:
2235         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2236         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2237         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2238         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
2239         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
2240         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
2241         (WebCore::RenderLayerCompositor::needsContentsCompositingLayer const):
2242         (WebCore::RenderLayerCompositor::layerHas3DContent const):
2243         * rendering/RenderTreeAsText.cpp:
2244         (WebCore::writeLayers):
2245
2246 2018-10-11  Don Olmstead  <don.olmstead@sony.com>
2247
2248         Add Houdini specs to features.json
2249         https://bugs.webkit.org/show_bug.cgi?id=190494
2250
2251         Reviewed by Simon Fraser.
2252
2253         Add CSS Typed OM Level 1, CSS Layout API Level 1, CSS Animation
2254         Worklet, and group them under a Houdini feature set.
2255
2256         * features.json:
2257
2258 2018-10-11  Ross Kirsling  <ross.kirsling@sony.com>
2259
2260         [WTF] Semaphore.h conflicts with POSIX header
2261         https://bugs.webkit.org/show_bug.cgi?id=190486
2262
2263         Reviewed by Yusuke Suzuki.
2264
2265         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2266
2267 2018-10-11  Thibault Saunier  <tsaunier@igalia.com>
2268
2269         [GStreamer] Support arbitrary video resolution in getUserMedia API
2270         https://bugs.webkit.org/show_bug.cgi?id=189734
2271
2272         Reviewed by Xabier Rodriguez-Calvar.
2273
2274         Implement arbitrary video resolution for the getUserMedia API in GStreamer.
2275
2276         Fix the MockRealtimeMediaSource device list to make devices properties match
2277         test expectations.
2278
2279         Reactivate tests that were failling because of that.
2280
2281         * platform/mediastream/RealtimeVideoSource.cpp:
2282         (WebCore::RealtimeVideoSource::standardVideoSizes):
2283         (WebCore::standardVideoSizes): Deleted.
2284         * platform/mediastream/RealtimeVideoSource.h:
2285         * platform/mediastream/VideoPreset.h:
2286         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2287         (WebCore::GStreamerVideoPreset::create):
2288         (WebCore::GStreamerVideoPreset::GStreamerVideoPreset):
2289         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
2290         (WebCore::GStreamerVideoCaptureSource::capabilities):
2291         (WebCore::GStreamerVideoCaptureSource::generatePresets):
2292         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
2293         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2294         (WebCore::defaultDevices):
2295
2296 2018-10-11  Keith Rollin  <krollin@apple.com>
2297
2298         CURRENT_ARCH should not be used in Run Script phase.
2299         https://bugs.webkit.org/show_bug.cgi?id=190407
2300         <rdar://problem/45133556>
2301
2302         Reviewed by Alexey Proskuryakov.
2303
2304         CURRENT_ARCH is used in a number of Xcode Run Script phases. However,
2305         CURRENT_ARCH is not well-defined during this phase (and may even have
2306         the value "undefined") since this phase is run just once per build
2307         rather than once per supported architecture. Migrate away from
2308         CURRENT_ARCH in favor of ARCHS, either by iterating over ARCHS and
2309         performing an operation for each value, or by picking the first entry
2310         in ARCHS and using that as a representative value.
2311
2312         No new tests -- no functional changes.
2313
2314         * DerivedSources.make: When forming TARGET_TRIPLE_FLAGS, grab the
2315         first entry in ARCHS rather than use CURRENT_ARCH.
2316
2317 2018-10-11  Daniel Bates  <dabates@apple.com>
2318
2319         Support building WebKit for macOS Mojave using a newer SDK
2320         https://bugs.webkit.org/show_bug.cgi?id=190431
2321
2322         Reviewed by Andy Estes.
2323
2324         * platform/network/cocoa/CookieCocoa.mm:
2325         (WebCore::coreSameSitePolicy):
2326         (WebCore::nsSameSitePolicy):
2327
2328 2018-10-11  Daniel Bates  <dabates@apple.com>
2329
2330         [iOS] Add typedef for WebEvent keyboard flags
2331         https://bugs.webkit.org/show_bug.cgi?id=190435
2332
2333         Reviewed by Wenson Hsieh.
2334
2335         Currently WebEvent and UIKit SPI are intertwined when it comes to keyboard flags. It seems sufficient
2336         to have WebEvent defined its own keyboard flags so that callers do not need to be aware of UIKit SPI.
2337
2338         No functionality changed. So, no new tests.
2339
2340         * platform/ios/WebEvent.h:
2341         * platform/ios/WebEvent.mm:
2342         (-[WebEvent keyboardFlags]):
2343
2344 2018-10-11  Antti Koivisto  <antti@apple.com>
2345
2346         Use finer grained locking in FontDatabase
2347         https://bugs.webkit.org/show_bug.cgi?id=190467
2348
2349         Reviewed by Alex Christensen.
2350
2351         * platform/graphics/FontCache.h:
2352
2353         Also use ListHashSet for prewarming info so we can prewarm in the same order the fonts were
2354         seen last time.
2355
2356         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2357         (WebCore::FontDatabase::collectionForFamily):
2358
2359         Only hold the lock when accessing the hashmap. There is no need to hold it during font construction
2360         which can take a long time.
2361
2362         (WebCore::FontDatabase::fontForPostScriptName):
2363
2364         This is currently not prewarmed from a thread so no need for locking.
2365
2366         (WebCore::FontDatabase::clear):
2367
2368 2018-10-11  Thibault Saunier  <tsaunier@igalia.com>
2369
2370         [GStreamer] Fix race condition in GStreamerVideoDecoder
2371         https://bugs.webkit.org/show_bug.cgi?id=190470
2372
2373         The GStreamerVideoDecoder.m_dtsPtsMap filed is accessed from
2374         the main thread and some GStreamer streaming thread, make sure
2375         to protect its access.
2376
2377         And use WTF::StdMap instead of std::map.
2378
2379         Reviewed by Philippe Normand.
2380
2381         Manually tested and a random crash is gone.
2382
2383         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
2384         (WebCore::GStreamerVideoDecoder::newSampleCallback):
2385
2386 2018-10-11  Enrique Ocaña González  <eocanha@igalia.com>
2387
2388         [GStreamer][MSE] Fix height calculation for streams with source aspect ratio
2389         https://bugs.webkit.org/show_bug.cgi?id=190464
2390
2391         Reviewed by Xabier Rodriguez-Calvar.
2392
2393         This patch is authored by Nikola Veljkovic <Nikola.Veljkovic@zenterio.com>
2394
2395         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2396         (WebCore::getVideoResolutionFromCaps): Reverse the SAR adjustment to "undo" it
2397         instead of applying it twice.
2398
2399 2018-10-11  Alejandro G. Castro  <alex@igalia.com>
2400
2401         [GTK][WPE] Add mediaDevices.enumerateDevices support
2402         https://bugs.webkit.org/show_bug.cgi?id=185761
2403
2404         Reviewed by Youenn Fablet.
2405
2406         We are adopting the same policy COCOA is using when returning the
2407         list of media devices if the user does not have persistent
2408         access. Namely, we just return the first media device for audio
2409         and video capture.
2410
2411         * Modules/mediastream/MediaDevicesRequest.cpp:
2412         (WebCore::MediaDevicesRequest::filterDeviceList): Add support for
2413         other platforms when filtering devices if there is no persistent
2414         access to the origin.
2415
2416 2018-10-10  Chris Dumez  <cdumez@apple.com>
2417
2418         Rename a couple of DOMWindowProperty virtual functions
2419         https://bugs.webkit.org/show_bug.cgi?id=190458
2420
2421         Reviewed by Geoffrey Garen.
2422
2423         Rename a couple of DOMWindowProperty virtual functions as the current naming no longer makes
2424         sense after recent refactoring.
2425
2426         disconnectFrameForDocumentSuspension() was renamed to suspendForPageCache(), and
2427         reconnectFrameFromDocumentSuspension(Frame*) was renamed to resumeFromPageCache().
2428         DOMWindowProperty objects no longer need to disconnect / reconnect from their
2429         frame since they now get their frame from their associated Window. However, some
2430         DOMWindowProperty subclasses do have some page cache suspension / resuming logic
2431         implemented of overrides of these functions.
2432
2433         Also drop the disconnectDOMWindowProperties() / reconnectDOMWindowProperties()
2434         methods in DOMWindow. The naming made little sense as it does not really
2435         disconnect those properties in any way. Instead, inline them in
2436         DOMWindow's suspendForPageCache() / resumeFromPageCache() since these are
2437         the only callers.
2438
2439         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2440         (WebCore::DOMWindowIndexedDatabase::suspendForPageCache):
2441         (WebCore::DOMWindowIndexedDatabase::resumeFromPageCache):
2442         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension): Deleted.
2443         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension): Deleted.
2444         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
2445         * history/CachedFrame.cpp:
2446         (WebCore::CachedFrame::CachedFrame):
2447         * loader/FrameLoader.cpp:
2448         (WebCore::FrameLoader::open):
2449         * loader/appcache/DOMApplicationCache.cpp:
2450         (WebCore::DOMApplicationCache::suspendForPageCache):
2451         (WebCore::DOMApplicationCache::resumeFromPageCache):
2452         (WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension): Deleted.
2453         (WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension): Deleted.
2454         * loader/appcache/DOMApplicationCache.h:
2455         * page/DOMWindow.cpp:
2456         (WebCore::DOMWindow::suspendForPageCache):
2457         (WebCore::DOMWindow::resumeFromPageCache):
2458         (WebCore::DOMWindow::suspendForDocumentSuspension): Deleted.
2459         (WebCore::DOMWindow::resumeFromDocumentSuspension): Deleted.
2460         (WebCore::DOMWindow::disconnectDOMWindowProperties): Deleted.
2461         (WebCore::DOMWindow::reconnectDOMWindowProperties): Deleted.
2462         * page/DOMWindow.h:
2463         * page/DOMWindowExtension.cpp:
2464         (WebCore::DOMWindowExtension::suspendForPageCache):
2465         (WebCore::DOMWindowExtension::resumeFromPageCache):
2466         (WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension): Deleted.
2467         (WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension): Deleted.
2468         * page/DOMWindowExtension.h:
2469         * page/DOMWindowProperty.cpp:
2470         (WebCore::DOMWindowProperty::suspendForPageCache):
2471         (WebCore::DOMWindowProperty::resumeFromPageCache):
2472         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension): Deleted.
2473         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension): Deleted.
2474         * page/DOMWindowProperty.h:
2475
2476 2018-10-10  Devin Rousso  <drousso@apple.com>
2477
2478         Web Inspector: create special Network waterfall for media events
2479         https://bugs.webkit.org/show_bug.cgi?id=189773
2480         <rdar://problem/44626605>
2481
2482         Reviewed by Joseph Pecoraro.
2483
2484         Test: http/tests/inspector/dom/didFireEvent.html
2485
2486         * html/HTMLMediaElement.cpp:
2487         (WebCore::HTMLMediaElement::HTMLMediaElement):
2488
2489         * inspector/InspectorInstrumentation.h:
2490         (WebCore::InspectorInstrumentation::addEventListenersToNode): Added.
2491         * inspector/InspectorInstrumentation.cpp:
2492         (WebCore::InspectorInstrumentation::addEventListenersToNodeImpl): Added.
2493
2494         * inspector/agents/InspectorDOMAgent.h:
2495         * inspector/agents/InspectorDOMAgent.cpp:
2496         (WebCore::EventFiredCallback): Added.
2497         (WebCore::EventFiredCallback::create): Added.
2498         (WebCore::EventFiredCallback::operator==): Added.
2499         (WebCore::EventFiredCallback::handleEvent): Added.
2500         (WebCore::EventFiredCallback::EventFiredCallback): Added.
2501         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
2502         (WebCore::InspectorDOMAgent::addEventListenersToNode): Added.
2503
2504 2018-10-10  Daniel Bates  <dabates@apple.com>
2505
2506         [iOS] Cleanup -[WAKView _selfHandleEvent:] and -[WAKWindow sendEventSynchronously:]
2507         https://bugs.webkit.org/show_bug.cgi?id=190402
2508
2509         Reviewed by Anders Carlsson.
2510
2511         Unindent case statements. Remove use of default case statements with body ASSERT_NOT_REACHED()
2512         to catch the cases of a missing enumerator. By omitting the default case statement we turn
2513         such a scenario into a compile-time error instead of handling it as a runtime error.
2514
2515         * platform/ios/wak/WAKView.mm:
2516         (-[WAKView _selfHandleEvent:]):
2517         * platform/ios/wak/WAKWindow.mm:
2518         (-[WAKWindow sendEventSynchronously:]):
2519
2520 2018-10-05  Ryosuke Niwa  <rniwa@webkit.org>
2521
2522         Rename MarkupAccumulator::appendStartTag, appendElement, etc... for clarity
2523         https://bugs.webkit.org/show_bug.cgi?id=190308
2524
2525         Reviewed by Darin Adler.
2526
2527         Renamed appendStartTag and appendEndTag to startAppendingNode and endAppendingNode since serialize any node,
2528         not just elements which produce start and end tags.
2529
2530         Renamed appendElement and appendEndElement to appendStartTag and appendEndTag since that's what they do.
2531
2532         * editing/MarkupAccumulator.cpp:
2533         (WebCore::elementCannotHaveEndTag): Made this a static local function.
2534         (WebCore::shouldSelfClose): Ditto.
2535         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
2536         (WebCore::MarkupAccumulator::startAppendingNode): Renamed from appendStartTag.
2537         (WebCore::MarkupAccumulator::endAppendingNode): Renamed from appendEndElement and merged appendEndMarkup here.
2538         (WebCore::MarkupAccumulator::appendTextSubstring): Deleted. This was only used by StyledMarkupAccumulator.
2539         (WebCore::MarkupAccumulator::appendStringView): Added.
2540         (WebCore::MarkupAccumulator::appendStartTag): Renamed from appendElement.
2541         (WebCore::MarkupAccumulator::appendCloseTag):
2542         (WebCore::MarkupAccumulator::appendNonElementNode): Renamed from appendStartMarkup. No longer serializes
2543         an element. StyledMarkupAccumulator had a check before calling this function already so this clarifies
2544         the purpose of this function.
2545         (WebCore::MarkupAccumulator::appendElement): Deleted.
2546         (WebCore::MarkupAccumulator::appendEndMarkup): Deleted. Merged into appendEndTag.
2547         * editing/MarkupAccumulator.h:
2548         (WebCore::MarkupAccumulator::appendNodeEnd): Renamed from appendEndTag.
2549         * editing/markup.cpp:
2550         (WebCore::StyledMarkupAccumulator::wrapWithNode):
2551         (WebCore::StyledMarkupAccumulator::appendStartTag): Renamed from appendElement.
2552         (WebCore::StyledMarkupAccumulator::appendEndTag): Renamed from appendEndElement.
2553         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2554         (WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Use String::substring directly instead of
2555         going through appendTextSubstring which has been deleted.
2556         * page/PageSerializer.cpp:
2557         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag): Renamed from appendElement.
2558         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndTag): Renamed from appendEndElement.
2559
2560 2018-10-10  Ryan Haddad  <ryanhaddad@apple.com>
2561
2562         Unreviewed, attempt to fix the build with current SDKs.
2563
2564         * crypto/mac/CryptoKeyRSAMac.cpp:
2565         (WebCore::getPublicKeyComponents):
2566
2567 2018-10-10  Brent Fulgham  <bfulgham@apple.com>
2568
2569         Only report the supported WebGL version
2570         https://bugs.webkit.org/show_bug.cgi?id=190434
2571         <rdar://problem/45024677>
2572
2573         Reviewed by Dean Jackson.
2574
2575         Tested by fast/canvas/webgl/gl-getstring.html
2576
2577         Revise getParameter(gl.VERSION) to only return the WebGL version without the hardware and
2578         driver-specific details available through the low-level OpenGL driver interface. These details
2579         are not needed for WebGL use and expose information about the user's system that we do not
2580         need to share.
2581
2582         * html/canvas/WebGL2RenderingContext.cpp:
2583         (WebCore::WebGL2RenderingContext::getParameter):
2584         * html/canvas/WebGLRenderingContext.cpp:
2585         (WebCore::WebGLRenderingContext::getParameter):
2586
2587 2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2588
2589         Unreviewed, add missing headers for inline functions
2590         https://bugs.webkit.org/show_bug.cgi?id=190429
2591
2592         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2593
2594 2018-10-10  Tim Horton  <timothy_horton@apple.com>
2595
2596         Share more WKShareSheet code between macOS and iOS, and fix a few bugs
2597         https://bugs.webkit.org/show_bug.cgi?id=190420
2598
2599         Reviewed by Simon Fraser.
2600
2601         Test: fast/web-share/share-with-no-url.html
2602
2603         * page/Navigator.cpp:
2604         (WebCore::Navigator::share):
2605         * page/ShareData.h:
2606         Make 'url' an optional field on ShareDataWithParsedURL, and don't
2607         reject the share() promise if the URL is totally empty (as opposed to invalid).
2608
2609 2018-10-10  Devin Rousso  <drousso@apple.com>
2610
2611         Web Inspector: notify the frontend when a canvas has started recording via console.record
2612         https://bugs.webkit.org/show_bug.cgi?id=190306
2613
2614         Reviewed by Brian Burg.
2615
2616         Updated existing tests: LayoutTests/inspector/canvas/recording-2d.html
2617                                 LayoutTests/inspector/canvas/recording-bitmaprenderer.html
2618                                 LayoutTests/inspector/canvas/recording-webgl-snapshots.html
2619                                 LayoutTests/inspector/canvas/recording-webgl.html
2620
2621         * inspector/agents/InspectorCanvasAgent.cpp:
2622         (WebCore::InspectorCanvasAgent::startRecording):
2623         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
2624
2625         * inspector/InspectorCanvas.h:
2626         Default `singleFrame` to false to better match the default behaviour of other `console`
2627         functions (`profile` doesn't stop until `profileEnd` is called, so the same should be true
2628         of `record` and `recordEnd`).
2629
2630 2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2631
2632         [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
2633         https://bugs.webkit.org/show_bug.cgi?id=190429
2634
2635         Reviewed by Saam Barati.
2636
2637         Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
2638
2639         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
2640         (WebCore::CDMSessionClearKey::cachedKeyForKeyID const):
2641         * Modules/plugins/QuickTimePluginReplacement.mm:
2642         (WebCore::jsValueWithDictionaryInContext):
2643         * Modules/webaudio/AudioBuffer.cpp:
2644         (WebCore::AudioBuffer::AudioBuffer):
2645         (WebCore::AudioBuffer::getChannelData):
2646         * Modules/webvr/VREyeParameters.cpp:
2647         (WebCore::VREyeParameters::offset const):
2648         * Modules/webvr/VRFrameData.cpp:
2649         (WebCore::matrixToArray):
2650         * Modules/webvr/VRPose.cpp:
2651         (WebCore::optionalFloat3ToJSCArray):
2652         (WebCore::VRPose::position const):
2653         (WebCore::VRPose::orientation const):
2654         * Modules/webvr/VRStageParameters.cpp:
2655         (WebCore::VRStageParameters::sittingToStandingTransform const):
2656         * bindings/js/ReadableStreamDefaultController.h:
2657         (WebCore::ReadableStreamDefaultController::enqueue):
2658         * bindings/js/SerializedScriptValue.cpp:
2659         (WebCore::CloneDeserializer::readArrayBufferView):
2660         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2661         (WebCore::CryptoKeyRSA::algorithm const):
2662         * crypto/mac/CryptoKeyRSAMac.cpp:
2663         (WebCore::CryptoKeyRSA::algorithm const):
2664         * css/DOMMatrixReadOnly.cpp:
2665         (WebCore::DOMMatrixReadOnly::toFloat32Array const):
2666         (WebCore::DOMMatrixReadOnly::toFloat64Array const):
2667         * css/FontFace.cpp:
2668         (WebCore::FontFace::create):
2669         * dom/TextEncoder.cpp:
2670         (WebCore::TextEncoder::encode const):
2671         * html/ImageData.cpp:
2672         (WebCore::ImageData::ImageData):
2673         * html/ImageData.h:
2674         (WebCore::ImageData::data const):
2675         (): Deleted.
2676         * html/canvas/WebGL2RenderingContext.cpp:
2677         (WebCore::WebGL2RenderingContext::bufferData):
2678         (WebCore::WebGL2RenderingContext::bufferSubData):
2679         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
2680         (WebCore::WebGL2RenderingContext::getParameter):
2681         * html/canvas/WebGLRenderingContext.cpp:
2682         (WebCore::WebGLRenderingContext::getParameter):
2683         * html/canvas/WebGLRenderingContextBase.cpp:
2684         (WebCore::WebGLRenderingContextBase::getUniform):
2685         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
2686         (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
2687         (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
2688         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2689         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
2690         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2691         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
2692         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2693         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
2694         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2695         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
2696         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
2697         (WebCore::CDMSessionAVContentKeySession::update):
2698         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
2699         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2700         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
2701         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2702         (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
2703         (WebCore::CDMSessionAVStreamSession::releaseKeys):
2704         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
2705         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2706         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2707         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2708         (WebCore::MediaSampleAVFObjC::getRGBAImageData const):
2709         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2710         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2711         * platform/graphics/cairo/ImageBufferCairo.cpp:
2712         (WebCore::getImageData):
2713         * platform/graphics/cg/ImageBufferDataCG.cpp:
2714         (WebCore::ImageBufferData::getData const):
2715         * platform/graphics/filters/FEGaussianBlur.cpp:
2716         (WebCore::FEGaussianBlur::platformApplySoftware):
2717         * platform/graphics/filters/FilterEffect.cpp:
2718         (WebCore::FilterEffect::unmultipliedResult):
2719         (WebCore::FilterEffect::premultipliedResult):
2720         (WebCore::FilterEffect::copyUnmultipliedResult):
2721         (WebCore::FilterEffect::copyPremultipliedResult):
2722         (WebCore::FilterEffect::createUnmultipliedImageResult):
2723         (WebCore::FilterEffect::createPremultipliedImageResult):
2724         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2725         (WebCore::ImageBufferData::getData const):
2726         * platform/mac/SerializedPlatformRepresentationMac.mm:
2727         (WebCore::jsValueWithDictionaryInContext):
2728         * platform/mock/mediasource/MockBox.cpp:
2729         (WebCore::MockBox::peekType):
2730         (WebCore::MockBox::peekLength):
2731         (WebCore::MockTrackBox::MockTrackBox):
2732         (WebCore::MockInitializationBox::MockInitializationBox):
2733         (WebCore::MockSampleBox::MockSampleBox):
2734         * rendering/shapes/Shape.cpp:
2735         (WebCore::Shape::createRasterShape):
2736         * testing/LegacyMockCDM.cpp:
2737         (WebCore::initDataPrefix):
2738         (WebCore::keyPrefix):
2739         (WebCore::keyRequest):
2740
2741 2018-10-10  Daniel Bates  <dabates@apple.com>
2742
2743         [iOS] Compare input string to UIKeyInput constants using string comparison instead of pointer comparison
2744         https://bugs.webkit.org/show_bug.cgi?id=190432
2745
2746         Reviewed by Tim Horton.
2747
2748         Pointer comparision is brittle. We should be more forgiving and perform string comparision
2749         of an input string to a UIKeyInput constant.
2750
2751         * platform/ios/WebEvent.mm:
2752         (normalizedStringWithAppKitCompatibilityMapping):
2753
2754 2018-10-10  Chris Dumez  <cdumez@apple.com>
2755
2756         Unreviewed, rolling out r236802.
2757
2758         Working on getting the HTML spec updated instead
2759         (https://github.com/whatwg/html/pull/4079)
2760
2761         Reverted changeset:
2762
2763         "Passing noopener=NOOPENER to window.open() should cause the
2764         new window to not have an opener"
2765         https://bugs.webkit.org/show_bug.cgi?id=190251
2766         https://trac.webkit.org/changeset/236802
2767
2768 2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2769
2770         XMLHttpRequest should use reportExtraMemoryAllocated/reportExtraMemoryVisited instead of deprecatedReportExtraMemory
2771         https://bugs.webkit.org/show_bug.cgi?id=190279
2772
2773         Reviewed by Ryosuke Niwa.
2774
2775         This patch switches deprecatedReportExtraMemory to reportExtraMemoryAllocated/reportExtraMemoryVisited
2776         in XMLHttpRequest. We report extra memory allocation when the readyState becomes DONE. And memoryCost
2777         function returns the memory cost which is based on the readyState and m_responseBuilder.
2778         We annotate XMLHttpRequest with ReportExtraMemoryCost to use reportExtraMemoryVisited automatically with
2779         memoryCost() function.
2780
2781         * xml/XMLHttpRequest.cpp:
2782         (WebCore::XMLHttpRequest::changeState):
2783         (WebCore::XMLHttpRequest::abort):
2784         (WebCore::XMLHttpRequest::internalAbort):
2785         (WebCore::XMLHttpRequest::networkErrorTimerFired):
2786         (WebCore::XMLHttpRequest::memoryCost const):
2787         (WebCore::XMLHttpRequest::didFinishLoading):
2788         (WebCore::XMLHttpRequest::didReachTimeout):
2789         (WebCore::XMLHttpRequest::dropProtection): Deleted.
2790         * xml/XMLHttpRequest.h:
2791         * xml/XMLHttpRequest.idl:
2792
2793 2018-10-09  Antoine Quint  <graouts@apple.com>
2794
2795         Remove the frames() timing function
2796         https://bugs.webkit.org/show_bug.cgi?id=190034
2797         <rdar://problem/44827544>
2798
2799         Reviewed by Dean Jackson.
2800
2801         * css/CSSComputedStyleDeclaration.cpp:
2802         (WebCore::createTimingFunctionValue):
2803         * css/CSSTimingFunctionValue.cpp:
2804         (WebCore::CSSFramesTimingFunctionValue::customCSSText const): Deleted.
2805         (WebCore::CSSFramesTimingFunctionValue::equals const): Deleted.
2806         * css/CSSTimingFunctionValue.h:
2807         * css/CSSToStyleMap.cpp:
2808         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
2809         * css/CSSValue.cpp:
2810         (WebCore::CSSValue::equals const):
2811         (WebCore::CSSValue::cssText const):
2812         (WebCore::CSSValue::destroy):
2813         * css/CSSValue.h:
2814         (WebCore::CSSValue::isStepsTimingFunctionValue const):
2815         (WebCore::CSSValue::isFramesTimingFunctionValue const): Deleted.
2816         * css/CSSValueKeywords.in:
2817         * css/parser/CSSPropertyParser.cpp:
2818         (WebCore::consumeAnimationTimingFunction):
2819         (WebCore::consumeFrames): Deleted.
2820         * platform/animation/TimingFunction.cpp:
2821         (WebCore::operator<<):
2822         (WebCore::TimingFunction::transformTime const):
2823         (WebCore::TimingFunction::createFromCSSValue):
2824         * platform/animation/TimingFunction.h:
2825         (WebCore::TimingFunction::isStepsTimingFunction const):
2826         (WebCore::TimingFunction::isFramesTimingFunction const): Deleted.
2827         * platform/graphics/ca/GraphicsLayerCA.cpp:
2828         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
2829         (WebCore::animationHasFramesTimingFunction): Deleted.
2830
2831 2018-10-09  Devin Rousso  <drousso@apple.com>
2832
2833         Web Inspector: show redirect requests in Network and Timelines tabs
2834         https://bugs.webkit.org/show_bug.cgi?id=150005
2835         <rdar://problem/5378164>
2836
2837         Reviewed by Joseph Pecoraro.
2838
2839         Updated existing test http/tests/inspector/network/resource-timing.html.
2840
2841         * inspector/agents/InspectorNetworkAgent.cpp:
2842         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
2843         (WebCore::InspectorNetworkAgent::didFinishLoading):
2844         Add missing fields for `Network.types.ResourceTiming`.
2845
2846 2018-10-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
2847
2848         REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only
2849         https://bugs.webkit.org/show_bug.cgi?id=190411
2850
2851         Reviewed by Simon Fraser.
2852
2853         Test: svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html
2854
2855         When changing the attributes of the SVGLangSpace, we should invalidate
2856         the renderer of the SVGGeometryElement descendant only. Renderer of other
2857         elements, like SVGStopElement, should not be invalidated because they do
2858         not have geometry and they can be used as resources for drawing another
2859         SVGGeometryElement.
2860
2861         * svg/SVGElement.h:
2862         (WebCore::SVGElement::isSVGGeometryElement const):
2863         * svg/SVGGeometryElement.h:
2864         (isType):
2865         * svg/SVGLangSpace.cpp:
2866         (WebCore::SVGLangSpace::svgAttributeChanged):
2867
2868 2018-10-09  Chris Dumez  <cdumez@apple.com>
2869
2870         Anchor target should be ignored on activation when the download attribute is set
2871         https://bugs.webkit.org/show_bug.cgi?id=190408
2872
2873         Reviewed by Geoffrey Garen.
2874
2875         Anchor target should be ignored on activation when the download attribute is set:
2876         - https://html.spec.whatwg.org/#the-a-element:downloading-hyperlinks-2
2877
2878         When the download attribute is set, we should use the "download the hyperlink" algorithm [1]
2879         instead of the "follow the hyperlink" [2] algorithm.
2880
2881         Note that the "download the hyperlink" triggers a download and ignores the target attribute
2882         entirely.
2883
2884         This is important as an anchor element with target=_blank and the download attribute set may
2885         fail because of Safari's popup blocker if we do not disregard the anchor target.
2886
2887         [1] https://html.spec.whatwg.org/#downloading-hyperlinks
2888         [2] https://html.spec.whatwg.org/#following-hyperlinks-2
2889
2890         Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-base-target-popup-not-allowed.html
2891                fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target-popup-not-allowed.html
2892
2893         * loader/FrameLoader.cpp:
2894         (WebCore::FrameLoader::loadURL):
2895
2896 2018-10-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2897
2898         [WPE][GTK] Complex text crashes with harfbuzz 1.8.8
2899         https://bugs.webkit.org/show_bug.cgi?id=190409
2900
2901         Reviewed by Žan Doberšek.
2902
2903         We discovered that harfbuzz 1.8.8 breaks WebKit by changing the ownership semantics of
2904         hb_icu_get_unicode_funcs() from (transfer full) to (transfer none). Our code was actually
2905         expecting (transfer none), so it's not immediately clear to me why it's crashing now, but
2906         doesn't matter as Behdad recommends removing this line of code because it hasn't been
2907         been needed for many years.
2908
2909         This should be covered by all our complex text tests if the bots were upgraded to the newer
2910         harfbuzz.
2911
2912         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2913         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2914
2915 2018-10-09  Daniel Bates  <dabates@apple.com>
2916
2917         [iOS] Cleanup EventHandler::passSubframeEventToSubframe()
2918         https://bugs.webkit.org/show_bug.cgi?id=190390
2919
2920         Reviewed by Wenson Hsieh.
2921
2922         Unindent case statements in switch block and use more auto.
2923
2924         * page/ios/EventHandlerIOS.mm:
2925         (WebCore::EventHandler::passSubframeEventToSubframe):
2926
2927 2018-10-09  Daniel Bates  <dabates@apple.com>
2928
2929         Cleanup WebEvent.mm
2930         https://bugs.webkit.org/show_bug.cgi?id=190391
2931
2932         Reviewed by Wenson Hsieh.
2933
2934         Unindent case statements in switch blocks.
2935
2936         * platform/ios/WebEvent.mm:
2937         (-[WebEvent _typeDescription]):
2938         (-[WebEvent _modiferFlagsDescription]):
2939         (-[WebEvent _touchPhaseDescription:]):
2940         (-[WebEvent _eventDescription]):
2941
2942 2018-10-09  Oriol Brufau  <obrufau@igalia.com>
2943
2944         Resolve inset properties to computed style when there is overconstraintment
2945         https://bugs.webkit.org/show_bug.cgi?id=188711
2946
2947         Reviewed by Manuel Rego Casasnovas.
2948
2949         This patch makes WebKit behave closer to Blink. Specifically,
2950          - In overconstrained relative or absolute positioning, inset properties resolve
2951            to the computed value (absolutizing percentages) instead of to the used value.
2952          - In fixed positioning, the resolved value of non-'auto' values is no longer
2953            increased by the border of the containg block.
2954
2955         This patch can slighlty alter the resolved value if it's a long decimal number.
2956
2957         Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-absolute.html
2958                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-fixed.html
2959                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-nobox.html
2960                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-relative.html
2961                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-static.html
2962                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky.html
2963
2964         * css/CSSComputedStyleDeclaration.cpp:
2965         (WebCore::positionOffsetValue):
2966         * rendering/RenderBox.h:
2967
2968 2018-10-09  Jiewen Tan  <jiewen_tan@apple.com>
2969
2970         [WebAuthN] Import CTAP HID message and packet structure from Chromium
2971         https://bugs.webkit.org/show_bug.cgi?id=189289
2972         <rdar://problem/44120310>
2973
2974         Reviewed by Brent Fulgham.
2975
2976         This patch imports CTAP HID message and packet structure:
2977         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-and-packet-structure
2978         from Chromium. With this library, WebKit can now turn binaries into messages that CTAP devices could understand.
2979         This patch contains the following Chromium files and modifies them to fit into WebKit:
2980         https://cs.chromium.org/chromium/src/device/fido/fido_constants.cc?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
2981         https://cs.chromium.org/chromium/src/device/fido/fido_constants.h?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
2982         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.cc?l=1&rcl=387f3725de2842e0e6b7175a9b2ed472b0cf781a
2983         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
2984         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
2985         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
2986         https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message_unittest.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
2987
2988         Covered by API tests.
2989
2990         * Modules/webauthn/fido/FidoConstants.cpp: Added.
2991         (fido::isFidoHidDeviceCommand):
2992         * Modules/webauthn/fido/FidoConstants.h: Added.
2993         * Modules/webauthn/fido/FidoHidMessage.cpp: Added.
2994         (fido::FidoHidMessage::create):
2995         (fido::FidoHidMessage::createFromSerializedData):
2996         (fido::FidoHidMessage::messageComplete const):
2997         (fido::FidoHidMessage::getMessagePayload const):
2998         (fido::FidoHidMessage::popNextPacket):
2999         (fido::FidoHidMessage::addContinuationPacket):
3000         (fido::FidoHidMessage::numPackets const):
3001         (fido::FidoHidMessage::FidoHidMessage):
3002         * Modules/webauthn/fido/FidoHidMessage.h: Added.
3003         * Modules/webauthn/fido/FidoHidPacket.cpp: Added.
3004         (fido::FidoHidPacket::FidoHidPacket):
3005         (fido::FidoHidInitPacket::createFromSerializedData):
3006         (fido::FidoHidInitPacket::FidoHidInitPacket):
3007         (fido::FidoHidInitPacket::getSerializedData const):
3008         (fido::FidoHidContinuationPacket::createFromSerializedData):
3009         (fido::FidoHidContinuationPacket::FidoHidContinuationPacket):
3010         (fido::FidoHidContinuationPacket::getSerializedData const):
3011         * Modules/webauthn/fido/FidoHidPacket.h: Added.
3012         * Modules/webauthn/fido/FidoParsingUtils.cpp: Added.
3013         (fido::getInitPacketData):
3014         (fido::getContinuationPacketData):
3015         * Modules/webauthn/fido/FidoParsingUtils.h: Added.
3016         * Sources.txt:
3017         * WebCore.xcodeproj/project.pbxproj:
3018
3019 2018-10-09  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
3020
3021         [CoordGraphics] Remove the 'previous backing store' logic
3022         https://bugs.webkit.org/show_bug.cgi?id=188838
3023
3024         Reviewed by Žan Doberšek.
3025
3026         Remove previousBackingStore from LayerState, since it's not needed anymore.
3027         When there is scale adjustment, we now simply discard mainBackingStore and
3028         recreate a new one.
3029
3030         No new tests required.
3031
3032         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h:
3033         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3034         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3035         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3036         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
3037
3038 2018-10-09  Antti Koivisto  <antti@apple.com>
3039
3040         [PSON] Prewarm system UI font
3041         https://bugs.webkit.org/show_bug.cgi?id=190397
3042
3043         Reviewed by Geoffrey Garen.
3044
3045         Cache system UI font fallbacks. Almost every web process needs these.
3046
3047         * page/ProcessWarming.cpp:
3048         (WebCore::ProcessWarming::prewarmGlobally):
3049
3050 2018-10-09  Chris Dumez  <cdumez@apple.com>
3051
3052         REGRESSION (Safari 12): Download of Blob URL fails
3053         https://bugs.webkit.org/show_bug.cgi?id=190351
3054         <rdar://problem/45091181>
3055
3056         Reviewed by Geoffrey Garen.
3057
3058         When using both the download attribute and target="_blank" on an anchor element, we would
3059         mistakenly drop the download attribute after the "new window" policy decision has been made.
3060         As a result, we would try to load the blob instead of downloading it.
3061
3062         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html
3063
3064         * loader/FrameLoader.cpp:
3065         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
3066
3067 2018-10-09  Alicia Boya García  <aboya@igalia.com>
3068
3069         [MSE][GStreamer] r236735 has some dead ASSERTs that need to be moved
3070         https://bugs.webkit.org/show_bug.cgi?id=190394
3071
3072         Reviewed by Xabier Rodriguez-Calvar.
3073
3074         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3075         (WebCore::createOptionalParserForFormat):
3076
3077 2018-10-09  Chris Dumez  <cdumez@apple.com>
3078
3079         Have DOMWindow get its frame from its document
3080         https://bugs.webkit.org/show_bug.cgi?id=190389
3081
3082         Reviewed by Geoff Garen.
3083
3084         Have DOMWindow get its frame from its document instead of having its own m_frame which can potentially
3085         be out-of-sync.
3086
3087         * dom/Document.cpp:
3088         (WebCore::Document::frameDestroyed):
3089         (WebCore::Document::willDetachPage):
3090         (WebCore::Document::attachToCachedFrame):
3091         * dom/Document.h:
3092         * page/DOMWindow.cpp:
3093         (WebCore::DOMWindow::allowPopUp):
3094         (WebCore::ContextDestructionObserver):
3095         (WebCore::DOMWindow::didSecureTransitionTo):
3096         (WebCore::DOMWindow::frameDestroyed):
3097         (WebCore::DOMWindow::willDetachDocumentFromFrame):
3098         (WebCore::DOMWindow::reconnectDOMWindowProperties):
3099         (WebCore::DOMWindow::isCurrentlyDisplayedInFrame const):
3100         (WebCore::DOMWindow::collectMatchingElementsInFlatTree):
3101         (WebCore::DOMWindow::matchingElementInFlatTree):
3102         (WebCore::DOMWindow::orientation const):
3103         (WebCore::DOMWindow::console const):
3104         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
3105         (WebCore::DOMWindow::webkitNamespace):
3106         (WebCore::DOMWindow::postMessage):
3107         (WebCore::DOMWindow::postMessageTimerFired):
3108         (WebCore::DOMWindow::frameElement const):
3109         (WebCore::DOMWindow::focus):
3110         (WebCore::DOMWindow::blur):
3111         (WebCore::DOMWindow::close):
3112         (WebCore::DOMWindow::print):
3113         (WebCore::DOMWindow::stop):
3114         (WebCore::DOMWindow::alert):
3115         (WebCore::DOMWindow::confirm):
3116         (WebCore::DOMWindow::prompt):
3117         (WebCore::DOMWindow::find const):
3118         (WebCore::DOMWindow::outerHeight const):
3119         (WebCore::DOMWindow::outerWidth const):
3120         (WebCore::DOMWindow::innerHeight const):
3121         (WebCore::DOMWindow::innerWidth const):
3122         (WebCore::DOMWindow::screenX const):
3123         (WebCore::DOMWindow::screenY const):
3124         (WebCore::DOMWindow::scrollX const):
3125         (WebCore::DOMWindow::scrollY const):
3126         (WebCore::DOMWindow::closed const):
3127         (WebCore::DOMWindow::length const):
3128         (WebCore::DOMWindow::name const):
3129         (WebCore::DOMWindow::setName):
3130         (WebCore::DOMWindow::setStatus):
3131         (WebCore::DOMWindow::setDefaultStatus):
3132         (WebCore::DOMWindow::self const):
3133         (WebCore::DOMWindow::opener const):
3134         (WebCore::DOMWindow::disownOpener):
3135         (WebCore::DOMWindow::parent const):
3136         (WebCore::DOMWindow::top const):
3137         (WebCore::DOMWindow::getMatchedCSSRules const):
3138         (WebCore::DOMWindow::devicePixelRatio const):
3139         (WebCore::DOMWindow::scrollBy const):
3140         (WebCore::DOMWindow::scrollTo const):
3141         (WebCore::DOMWindow::allowedToChangeWindowGeometry const):
3142         (WebCore::DOMWindow::moveBy const):
3143         (WebCore::DOMWindow::moveTo const):
3144         (WebCore::DOMWindow::resizeBy const):
3145         (WebCore::DOMWindow::resizeTo const):
3146         (WebCore::DOMWindow::clearTimeout):
3147         (WebCore::DOMWindow::isSameSecurityOriginAsMainFrame const):
3148         (WebCore::DOMWindow::finishedLoading):
3149         (WebCore::DOMWindow::setLocation):
3150         (WebCore::DOMWindow::open):
3151         (WebCore::DOMWindow::showModalDialog):
3152         (WebCore::DOMWindow::frame const):
3153         (WebCore::FrameDestructionObserver): Deleted.
3154         (WebCore::DOMWindow::willDetachPage): Deleted.
3155         (WebCore::DOMWindow::detachFromFrame): Deleted.
3156         (WebCore::DOMWindow::attachToFrame): Deleted.
3157         * page/DOMWindow.h:
3158
3159 2018-10-09  Jer Noble  <jer.noble@apple.com>
3160
3161         ISOTrackEncryptionBox returns incorrect defaultKeyID
3162         https://bugs.webkit.org/show_bug.cgi?id=190368
3163
3164         Reviewed by Eric Carlson.
3165
3166         Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
3167
3168         ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
3169
3170         Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
3171
3172         * WebCore.xcodeproj/project.pbxproj:
3173         * platform/graphics/iso/ISOBox.h:
3174         * platform/graphics/iso/ISOOriginalFormatBox.h:
3175         * platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
3176         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
3177         * platform/graphics/iso/ISOSchemeInformationBox.h:
3178         * platform/graphics/iso/ISOSchemeTypeBox.h:
3179         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
3180         (WebCore::ISOTrackEncryptionBox::parse):
3181         * platform/graphics/iso/ISOTrackEncryptionBox.h:
3182
3183 2018-10-09  Youenn Fablet  <youenn@apple.com>
3184
3185         Add support for IceCandidate stats
3186         https://bugs.webkit.org/show_bug.cgi?id=190329
3187
3188         Reviewed by Eric Carlson.
3189
3190         Convert IceCandidate stats gathered by libwebrtc.
3191         Since networkType might be sensitive information, we currently do not expose it.
3192         We do not expose address either if it is a host or prflx candidate.
3193
3194         Test: webrtc/candidate-stats.html
3195
3196         * Modules/mediastream/RTCStatsReport.h:
3197         * Modules/mediastream/RTCStatsReport.idl:
3198         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
3199         (WebCore::iceCandidateState):
3200         (WebCore::fillRTCIceCandidateStats):
3201         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
3202
3203 2018-10-09  Philippe Normand  <pnormand@igalia.com>
3204
3205         [GStreamer] Stealing cross-origin video pixel with HLS
3206         https://bugs.webkit.org/show_bug.cgi?id=190003
3207
3208         Reviewed by Xabier Rodriguez-Calvar.
3209
3210         Report the SecurityOrigin of downloaded adaptivedemux (HLS, DASH,
3211         SmoothStreaming) fragments as tainted if their origin differs from
3212         the manifest SecurityOrigin. SecurityOrigins are stored in the
3213         CachedResourceStreamingClient implemented in the internal
3214         GStreamer HTTP(S) source element.
3215
3216         The implementation is not ideal yet because the fragments download
3217         is performed by the WebProcess, until bug 189967 is fixed. When
3218         this bug is fixed, the m_hasTaintedOrigin member variable should
3219         be removed and all checks be done unconditionally to the
3220         webkithttpsrc element which will manage the download of the
3221         manifests and fragments.
3222
3223         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3224         (WebCore::MediaPlayerPrivateGStreamer::loadFull): Reset the m_hasTaintedOrigin value.
3225         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Get the
3226         fragment URL from the adaptivedemux stats message and check if its
3227         origin is tainted.
3228         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
3229         Initial implementation by checking the m_hasTaintedOrigin member
3230         variable value.
3231         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3232         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3233         (CachedResourceStreamingClient::responseReceived): Store the
3234         resource origin internally so it can be checked later on by
3235         webKitSrtcWouldTaintOrigin().
3236         (webKitSrcWouldTaintOrigin): Check given origin against cached
3237         origins. This implementation is similar to Cocoa's
3238         WebCoreNSURLSession implementation.
3239         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
3240
3241 2018-10-09  Antti Koivisto  <antti@apple.com>
3242
3243         Prewarm FontDatabase on process swap
3244         https://bugs.webkit.org/show_bug.cgi?id=190312
3245
3246         Reviewed by Chris Dumez.
3247
3248         Implement basic prewarming of FontDatabase. When the domain of the first page load on
3249         a new process is known we pass the list of font families previous used by that domain to the
3250         process. This is used to prewarm CoreText font database. Initialization (which involves lots of
3251         blocking IPC) happens outside the main thread so the fonts are ready to use when needed.
3252
3253         * WebCore.xcodeproj/project.pbxproj:
3254         * page/PrewarmInformation.h: Added.
3255         (WebCore::PrewarmInformation::encode const):
3256         (WebCore::PrewarmInformation::decode):
3257
3258         Add data structure for prewarm information with encode/decode support.
3259
3260         * page/ProcessWarming.cpp:
3261         (WebCore::ProcessWarming::collectPrewarmInformation):
3262         (WebCore::ProcessWarming::prewarmWithInformation):
3263
3264         Prewarming interface to be used from WebKit.
3265
3266         * page/ProcessWarming.h:
3267         * platform/graphics/FontCache.cpp:
3268         (WebCore::FontCache::collectPrewarmInformation const):
3269         (WebCore::FontCache::prewarm):
3270         * platform/graphics/FontCache.h:
3271         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3272         (WebCore::FontDatabase::collectionForFamily):
3273         (WebCore::FontDatabase::fontForPostScriptName):
3274         (WebCore::FontDatabase::clear):
3275
3276         Add mutex for thread safe access.
3277
3278         (WebCore::FontCache::createFontPlatformData):
3279         (WebCore::FontCache::collectPrewarmInformation const):
3280
3281         Collect font families seen by this process.
3282
3283         (WebCore::FontCache::prewarm):
3284
3285         Prewarm FontDatabase in a dispatch queue.
3286
3287 2018-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3288
3289         [Cocoa] [WK2] Add support for text alignment and text lists in font attributes
3290         https://bugs.webkit.org/show_bug.cgi?id=190342
3291         <rdar://problem/44767118>
3292
3293         Reviewed by Tim Horton.
3294
3295         Adds support for computing and encoding information about text alignment and enclosing list elements in the font
3296         attributes dictionary, exposed to the UI delegate on Cocoa platforms. This is exposed through NSParagraphStyle,
3297         which contains properties for both `NSTextAlignment` and an array of enclosing `NSTextList` objects.
3298
3299         Test:   FontAttributes.NestedTextListsWithHorizontalAlignment
3300                 FontAttributes.FontAttributesAfterChangingSelection
3301
3302         * editing/Editor.cpp:
3303         (WebCore::editableTextListsAtPositionInDescendingOrder):
3304
3305         Add a helper function to ascend the DOM, starting at the given position, in search of enclosing list elements.
3306         For each enclosing list element we find within the scope of the editable root, we create a `TextList`
3307         representing the list element.
3308
3309         (WebCore::Editor::fontAttributesAtSelectionStart const):
3310
3311         Compute and set enclosing text lists and text alignment. For text alignment, we convert the initial text-align
3312         value, `start`, to NSTextAlignmentNatural (the default text alignment type on Cocoa platforms); other values
3313         then map to Left, Right, Center, and Justified as expected (taking direction into account).
3314
3315         * editing/FontAttributes.h:
3316         (WebCore::TextList::encode const):
3317         (WebCore::TextList::decode):
3318
3319         Introduce TextList, a platform-agnostic representation of an unordered or ordered list. On Cocoa, this can be
3320         used to construct a corresponding NSTextList.
3321
3322         * editing/cocoa/FontAttributesCocoa.mm:
3323         (WebCore::cocoaTextListMarkerName):
3324
3325         Attempt to map a WebCore list style type to a `NSTextListMarker*` constant. While most of the Cocoa marker
3326         formats have a corresponding web-exposed list style type, many web-exposed types have no Cocoa equivalent; as
3327         such, fall back to default marker formats: "{disc}" for unordered lists and "{decimal}" for ordered lists.
3328
3329         (WebCore::TextList::createTextList const):
3330         (WebCore::FontAttributes::createDictionary const):
3331
3332         Include an NSParagraphStyle in the dictionary of font attributes that includes information about text alignment
3333         and enclosing text lists (per Cocoa convention, in order from outermost list to innermost list).
3334
3335 2018-10-08  Justin Fan  <justin_fan@apple.com>
3336
3337         WebGPU: Rename old WebGPU prototype to WebMetal
3338         https://bugs.webkit.org/show_bug.cgi?id=190325
3339         <rdar://problem/44990443>
3340
3341         Reviewed by Dean Jackson.
3342
3343         Existing WebGPU tests also renamed to reflect WebGPU -> WebMetal change.
3344
3345         Rename WebGPU prototype files to WebMetal in preparation for implementing the new (Oct 2018) WebGPU interface.
3346
3347         * CMakeLists.txt:
3348         * Configurations/FeatureDefines.xcconfig:
3349         * DerivedSources.make:
3350         * Sources.txt:
3351         * SourcesCocoa.txt:
3352         * WebCore.xcodeproj/project.pbxproj:
3353         * bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp.
3354         (WebCore::toJSNewlyCreated):
3355         (WebCore::toJS):
3356         * bindings/js/JSWebMetalRenderingContextCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderingContextCustom.cpp.
3357         (WebCore::JSWebMetalRenderingContext::visitAdditionalChildren):
3358         * bindings/js/WebCoreBuiltinNames.h:
3359         * dom/Document.cpp:
3360         (WebCore::Document::getCSSCanvasContext):
3361         * dom/Document.h:
3362         * dom/Document.idl:
3363         * html/HTMLCanvasElement.cpp:
3364         (WebCore::HTMLCanvasElement::getContext):
3365         (WebCore::HTMLCanvasElement::isWebMetalType):
3366         (WebCore::HTMLCanvasElement::createContextWebMetal):
3367         (WebCore::HTMLCanvasElement::getContextWebMetal):
3368         (WebCore::HTMLCanvasElement::isWebGPUType): Deleted.
3369         (WebCore::HTMLCanvasElement::createContextWebGPU): Deleted.
3370         (WebCore::HTMLCanvasElement::getContextWebGPU): Deleted.
3371         * html/HTMLCanvasElement.h:
3372         * html/HTMLCanvasElement.idl:
3373         * html/canvas/CanvasRenderingContext.h:
3374         (WebCore::CanvasRenderingContext::isWebMetal const):
3375         (WebCore::CanvasRenderingContext::isWebGPU const): Deleted.
3376         * html/canvas/WebGPURenderingContext.cpp: Removed.
3377         * html/canvas/WebMetalBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.cpp.
3378         (WebCore::WebMetalBuffer::create):
3379         (WebCore::WebMetalBuffer::WebMetalBuffer):
3380         * html/canvas/WebMetalBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.h.
3381         * html/canvas/WebMetalBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.idl.
3382         * html/canvas/WebMetalCommandBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.cpp.
3383         (WebCore::WebMetalCommandBuffer::create):
3384         (WebCore::WebMetalCommandBuffer::WebMetalCommandBuffer):
3385         (WebCore::WebMetalCommandBuffer::~WebMetalCommandBuffer):
3386         (WebCore::WebMetalCommandBuffer::commit):
3387         (WebCore::WebMetalCommandBuffer::presentDrawable):
3388         (WebCore::WebMetalCommandBuffer::createRenderCommandEncoderWithDescriptor):
3389         (WebCore::WebMetalCommandBuffer::createComputeCommandEncoder):
3390         (WebCore::WebMetalCommandBuffer::completed):
3391         * html/canvas/WebMetalCommandBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
3392         * html/canvas/WebMetalCommandBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
3393         * html/canvas/WebMetalCommandQueue.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.cpp.
3394         (WebCore::WebMetalCommandQueue::create):
3395         (WebCore::WebMetalCommandQueue::WebMetalCommandQueue):
3396         (WebCore::WebMetalCommandQueue::createCommandBuffer):
3397         * html/canvas/WebMetalCommandQueue.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.h.
3398         * html/canvas/WebMetalCommandQueue.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.idl.
3399         * html/canvas/WebMetalComputeCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.cpp.
3400         (WebCore::GPUSizeMake):
3401         (WebCore::WebMetalComputeCommandEncoder::create):
3402         (WebCore::WebMetalComputeCommandEncoder::WebMetalComputeCommandEncoder):
3403         (WebCore::WebMetalComputeCommandEncoder::setComputePipelineState):
3404         (WebCore::WebMetalComputeCommandEncoder::setBuffer):
3405         (WebCore::WebMetalComputeCommandEncoder::dispatch):
3406         (WebCore::WebMetalComputeCommandEncoder::endEncoding):
3407         * html/canvas/WebMetalComputeCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.h.
3408         * html/canvas/WebMetalComputeCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.idl.
3409         * html/canvas/WebMetalComputePipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.cpp.
3410         (WebCore::WebMetalComputePipelineState::create):
3411         (WebCore::WebMetalComputePipelineState::WebMetalComputePipelineState):
3412         * html/canvas/WebMetalComputePipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.h.
3413         * html/canvas/WebMetalComputePipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.idl.
3414         * html/canvas/WebMetalDepthStencilDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.cpp.
3415         (WebCore::WebMetalDepthStencilDescriptor::create):
3416         (WebCore::WebMetalDepthStencilDescriptor::depthWriteEnabled const):
3417         (WebCore::WebMetalDepthStencilDescriptor::setDepthWriteEnabled):
3418         (WebCore::WebMetalDepthStencilDescriptor::depthCompareFunction const):
3419         (WebCore::WebMetalDepthStencilDescriptor::setDepthCompareFunction):
3420         * html/canvas/WebMetalDepthStencilDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.h.
3421         * html/canvas/WebMetalDepthStencilDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.idl.
3422         * html/canvas/WebMetalDepthStencilState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.cpp.
3423         (WebCore::WebMetalDepthStencilState::create):
3424         (WebCore::WebMetalDepthStencilState::WebMetalDepthStencilState):
3425         (WebCore::WebMetalDepthStencilState::label const):
3426         (WebCore::WebMetalDepthStencilState::setLabel):
3427         * html/canvas/WebMetalDepthStencilState.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.h.
3428         * html/canvas/WebMetalDepthStencilState.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.idl.
3429         * html/canvas/WebMetalDrawable.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.cpp.
3430         (WebCore::WebMetalDrawable::create):
3431         (WebCore::WebMetalDrawable::WebMetalDrawable):
3432         * html/canvas/WebMetalDrawable.h: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.h.
3433         (WebCore::WebMetalDrawable::texture):
3434         * html/canvas/WebMetalDrawable.idl: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.idl.
3435         * html/canvas/WebMetalEnums.cpp: Renamed from Source/WebCore/html/canvas/WebGPUEnums.cpp.
3436         (WebCore::toWebMetalCompareFunction):
3437         (WebCore::web3DCompareFunctionName):
3438         (WebCore::toGPUCompareFunction):
3439         * html/canvas/WebMetalEnums.h: Renamed from Source/WebCore/html/canvas/WebGPUEnums.h.
3440         * html/canvas/WebMetalEnums.idl: Renamed from Source/WebCore/html/canvas/WebGPUEnums.idl.
3441         * html/canvas/WebMetalFunction.cpp: Renamed from Source/WebCore/html/canvas/WebGPUFunction.cpp.
3442         (WebCore::WebMetalFunction::create):
3443         (WebCore::WebMetalFunction::WebMetalFunction):
3444         * html/canvas/WebMetalFunction.h: Renamed from Source/WebCore/html/canvas/WebGPUFunction.h.
3445         * html/canvas/WebMetalFunction.idl: Renamed from Source/WebCore/html/canvas/WebGPUFunction.idl.
3446         * html/canvas/WebMetalLibrary.cpp: Renamed from Source/WebCore/html/canvas/WebGPULibrary.cpp.