Storing blobs in IDB on iOS: "Error preparing blob/file"
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-16  Sihui Liu  <sihui_liu@apple.com>
2
3         Storing blobs in IDB on iOS: "Error preparing blob/file"
4         https://bugs.webkit.org/show_bug.cgi?id=188438
5         <rdar://problem/43097279>
6
7         Reviewed by Alex Christensen.
8
9         Grant sandbox extension of temp folder to network process, because we suggested network process had access to 
10         the folder on iOS device but it didn't. 
11
12         This makes some existing tests about IDB blob pass on iOS device.
13
14         * Modules/indexeddb/server/IDBBackingStore.h:
15         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
16         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
17         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
18         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
19         * Modules/indexeddb/shared/InProcessIDBServer.h:
20
21 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
22
23         Add USE(LIBWPE) to WebCore
24         https://bugs.webkit.org/show_bug.cgi?id=191401
25
26         Reviewed by Michael Catanzaro.
27
28         No new tests. No change in behavior.
29
30         Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to
31         USE(LIBWPE) instead.
32
33         Renames classes and files to use the suffix LibWPE.
34
35         * PlatformWPE.cmake:
36         * SourcesWPE.txt:
37         * platform/Pasteboard.h:
38         * platform/PasteboardStrategy.h:
39         * platform/PlatformKeyboardEvent.h:
40         * platform/PlatformPasteboard.h:
41         * platform/graphics/PlatformDisplay.cpp:
42         (WebCore::PlatformDisplay::createPlatformDisplay):
43         * platform/graphics/PlatformDisplay.h:
44         * platform/graphics/egl/GLContextEGL.h:
45         * platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp.
46         (WebCore::GLContextEGL::createWPEContext):
47         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
48         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
49         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp.
50         (WebCore::PlatformDisplayLibWPE::create):
51         (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
52         (WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE):
53         (WebCore::PlatformDisplayLibWPE::initialize):
54         * platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h.
55         * platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp.
56         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp.
57         * platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp.
58
59 2018-11-16  Zalan Bujtas  <zalan@apple.com>
60
61         [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
62         https://bugs.webkit.org/show_bug.cgi?id=191712
63         <rdar://problem/45612900>
64
65         Reviewed by Simon Fraser.
66
67         In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
68         In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
69         and no need to dispatch a click event.
70         The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
71         only for tooltip-like reasons and it's ok to proceed with the click event.
72
73         Test: fast/events/touch/ios/click-instead-of-hover-simple.html
74
75         * rendering/updating/RenderTreeUpdater.cpp:
76         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
77
78 2018-11-16  Zalan Bujtas  <zalan@apple.com>
79
80         [LFC][IFC] Add support for out-of-flow positioned boxes
81         https://bugs.webkit.org/show_bug.cgi?id=191726
82
83         Reviewed by Antti Koivisto.
84
85         While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure
86         that their out-of-flow descendants get laid out as well.
87
88         Test: fast/inline/simple-inline-with-out-of-flow-descendant.html
89
90         * layout/inlineformatting/InlineFormattingContext.cpp:
91         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
92         * layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root.
93         (WebCore::Layout::TreeBuilder::createSubTree):
94
95 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
96
97         [GStreamer][WebRTC] Add API to enable/disable device mocks
98         https://bugs.webkit.org/show_bug.cgi?id=191699
99
100         This basically us to test MediaStream/WebRTC support without
101         requiring cameras or microphones and is quite useful.
102
103         Also fix the GStreamerAudioMock by:
104           - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
105             this was usefull when we were trying to bring the MediaStream
106             sources inside the main pipeline, it is not the case anymore
107             (and not doable with latest version of LibWebRTC).
108           - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
109             stream is similar to what Apple port does.
110
111         Reviewed by Xabier Rodriguez-Calvar.
112
113         The mocks are already tested and the API is really simple.
114
115         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
116         (WebCore::GStreamerAudioCapturer::createSource):
117         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
118         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
119         (WebCore::GStreamerCapturer::addSink):
120         * platform/mediastream/gstreamer/GStreamerCapturer.h:
121
122 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
123
124         [GStreamer][MediaStream] Handle track addition and removal
125         https://bugs.webkit.org/show_bug.cgi?id=191599
126
127         Reviewed by Xabier Rodriguez-Calvar.
128
129         Test: fast/mediastream/MediaStream-video-element-remove-track.html
130
131         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
132         (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
133         (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
134         (WebCore::webkitMediaStreamSrcFinalize):
135         (WebCore::webkitMediaStreamSrcChangeState):
136         (WebCore::webkit_media_stream_src_init):
137         (WebCore::webkitMediaStreamSrcSetupSrc):
138         (WebCore::webkitMediaStreamSrcAddTrack):
139         (WebCore::webkitMediaStreamSrcRemoveTrackByType):
140         (WebCore::webkitMediaStreamSrcSetStream):
141
142 2018-11-16  Zan Dobersek  <zdobersek@igalia.com>
143
144         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
145         https://bugs.webkit.org/show_bug.cgi?id=191354
146
147         Reviewed by Michael Catanzaro.
148
149         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
150         index validity and, if the index is valid, check for completeness of the
151         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
152         also only retrieve duration for already-complete frames.
153
154         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
155         as that method goes on and decodes image data to determine specific
156         information. The ImageSource class that's querying this information
157         doesn't anticipate this, and doesn't handle the increased memory
158         consumption of the decoded data, leaving MemoryCache in the blind about
159         the image resource's actual amount of consumed memory. ImageSource can
160         instead gracefully handle any incomplete frame by marking the decoding
161         status for this frame as only partial.
162
163         * platform/image-decoders/ScalableImageDecoder.cpp:
164         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
165         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
166         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
167
168 2018-11-16  Antoine Quint  <graouts@apple.com>
169
170         PointerEvents should not require touch event listeners to be registered
171         https://bugs.webkit.org/show_bug.cgi?id=191333
172         <rdar://problem/45857523>
173
174         Reviewed by Dean Jackson.
175
176         Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
177                pointerevents/ios/pointer-events-prevent-default.html
178
179         * dom/EventNames.h:
180         (WebCore::EventNames::isTouchEventType const):
181         (WebCore::EventNames::touchAndPointerEventNames const):
182         (WebCore::EventNames::touchEventNames const): Deleted.
183         * dom/Node.cpp:
184         (WebCore::Node::moveNodeToNewDocument):
185
186 2018-11-15  Zalan Bujtas  <zalan@apple.com>
187
188         [iOS] Do not get stuck in indeterminate content observation state.
189         https://bugs.webkit.org/show_bug.cgi?id=191719
190
191         Reviewed by Simon Fraser.
192
193         Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in
194         the "can't decide yet if it's a hover or click" state.
195         This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch.
196
197         Test: fast/events/touch/ios/stuck-with-hover-state.html
198
199         * platform/ios/wak/WKContentObservation.cpp:
200         (WebThreadRemoveObservedContentModifier):
201
202 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
203
204         REGRESSION (r238090) Composited iframes that resize from zero don't show
205         https://bugs.webkit.org/show_bug.cgi?id=191733
206         rdar://problem/46107764
207
208         Reviewed by Zalan Bujtas.
209         
210         A zero-sized iframe whose contents are composited should not trigger compositing in the
211         parent document (see code in requiresCompositingForFrame()), but when the <iframe> element
212         was resized without a style change (e.g. because it's width: 100%, height: 100% and the
213         parent resizes), there was no code that triggered a compositing update.
214
215         Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes,
216         for a RenderWidget whose contents are composited.
217
218         Test: compositing/iframes/resize-from-zero-size.html
219
220         * rendering/RenderLayer.cpp:
221         (WebCore::RenderLayer::updateLayerPosition):
222
223 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
224
225         Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
226         https://bugs.webkit.org/show_bug.cgi?id=158342
227         rdar://problem/26652811
228
229         Reviewed by Zalan Bujtas.
230         
231         Patch partly by Frédéric Wang.
232
233         This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
234         overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
235         created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
236         assertion in debug mode and prevents the user from scrolling the overflow node in release
237         mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
238         the remaining issues by forcing a configuration update after layout in order to ensure that
239         RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
240         composited, trigger a post-layout update that is necessary to check if we need to make it
241         composited when it gains scrollable overflow.
242
243         Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
244                fast/scrolling/ios/change-scrollability-on-content-resize.html
245
246         * rendering/RenderLayer.cpp:
247         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
248         RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
249         RenderLayerBacking::m_scrollingLayer.
250
251 2018-11-15  Fujii Hironori  <Hironori.Fujii@sony.com>
252
253         [curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
254         https://bugs.webkit.org/show_bug.cgi?id=191582
255
256         Reviewed by Alex Christensen.
257
258         No new tests because there's no behaviour change.
259
260         * platform/network/curl/CurlDownload.h: Marked CurlDownload final.
261
262 2018-11-15  Truitt Savell  <tsavell@apple.com>
263
264         Unreviewed, rolling out r238244.
265
266         Caused High Sierra test runs to fail early with 50 crashes and
267         casued 25 API failures.
268
269         Reverted changeset:
270
271         "[css-logical] Implement flow-relative margin, padding and
272         border shorthands"
273         https://bugs.webkit.org/show_bug.cgi?id=188697
274         https://trac.webkit.org/changeset/238244
275
276 2018-11-15  Jer Noble  <jer.noble@apple.com>
277
278         AVKit will set videoGravity to a nil string when building against iosmac
279         https://bugs.webkit.org/show_bug.cgi?id=191573
280
281         Reviewed by Dean Jackson.
282
283         Workaround AVKit behavior by treating nil videoGravity as the default,
284         which is AVLayerVideoGravityResizeAspect.
285
286         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
287         (-[WebAVPlayerLayer setVideoGravity:]):
288
289 2018-11-15  Brent Fulgham  <bfulgham@apple.com>
290
291         [Win] Reduce the use of WKSI library calls: Font Handling
292         https://bugs.webkit.org/show_bug.cgi?id=191701
293         <rdar://problem/46104809>
294
295         Reviewed by Myles C. Maxfield.
296
297         Move the old Windows font handling code out of WKSI to our regular
298         repository. We now handle SPI differently, and don't need to keep
299         these implementations in a separate library. This should also help
300         avoid the somewhat frequent build failures caused when WKSI is not
301         updated in sync with WebKit.
302
303         Tested by existing Windows test cases.
304
305         * platform/graphics/FontCascade.h:
306         * platform/graphics/win/FontCGWin.cpp:
307         (WebCore::FontCascade::drawGlyphs):
308         (WebCore::FontCascade::setFontSmoothingLevel):
309         (WebCore::setCGFontSmoothingStyle):
310         (WebCore::FontCascade::setFontSmoothingStyle):
311         (WebCore::FontCascade::setFontSmoothingContrast):
312         (WebCore::clearTypeContrast):
313         (WebCore::FontCascade::systemFontSmoothingChanged):
314         (WebCore::FontCascade::setCGContextFontRenderingStyle):
315         (WebCore::renderingStyleForFont):
316         (WebCore::FontCascade::getGlyphAdvances):
317         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
318         (WebCore::GlyphPage::fill):
319         * platform/graphics/win/GraphicsContextCGWin.cpp:
320         (WebCore::GraphicsContext::drawFocusRing):
321         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
322         * platform/graphics/win/SimpleFontDataCGWin.cpp:
323         (WebCore::Font::platformWidthForGlyph const):
324         * rendering/RenderMediaControls.cpp:
325         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
326
327 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
328
329         [WebAuthN] Use a real nonce for CTAPHID_INIT
330         https://bugs.webkit.org/show_bug.cgi?id=191533
331         <rdar://problem/46103502>
332
333         Reviewed by Brent Fulgham.
334
335         New tests are added into existing test files.
336
337         * Modules/webauthn/fido/FidoConstants.h:
338
339 2018-11-15  Justin Fan  <justin_fan@apple.com>
340
341         [WebGPU] WebGPUCommandBuffer prototype
342         https://bugs.webkit.org/show_bug.cgi?id=191663
343
344         Reviewed by Dean Jackson.
345
346         Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
347
348         Test: webgpu/command-buffers.html
349
350         * CMakeLists.txt:
351         * DerivedSources.make:
352         * Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
353         * Modules/webgpu/GPUDevice.cpp:
354         (WebCore::GPUDevice::createCommandBuffer): Added.
355         (WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
356         * Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
357         (WebCore::GPUDevice::platformDevice const):
358         * Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
359         (WebCore::GPUQueue::platformQueue const):
360         * Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
361         (WebCore::GPURenderPipeline::platformRenderPipeline const):
362         * Modules/webgpu/GPUShaderModule.h:
363         (WebCore::GPUShaderModule::platformShaderModule const):
364         * Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
365         (WebCore::GPUSwapChain::platformLayer const):
366         * Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
367         (WebCore::WebGPUCommandBuffer::create):
368         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
369         * Modules/webgpu/WebGPUCommandBuffer.h: Added.
370         * Modules/webgpu/WebGPUCommandBuffer.idl: Added.
371         * Modules/webgpu/WebGPUDevice.cpp:
372         (WebCore::WebGPUDevice::createCommandBuffer const): Added.
373         * Modules/webgpu/WebGPUDevice.h:
374         * Modules/webgpu/WebGPUDevice.idl:
375         * Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
376         (WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
377         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
378         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
379         (WebCore::GPUDevice::GPUDevice):
380         * Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
381         (WebCore::GPUQueue::create):
382         (WebCore::GPUQueue::GPUQueue):
383         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
384         (WebCore::GPURenderPipeline::GPURenderPipeline):
385         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
386         (WebCore::GPUShaderModule::create):
387         (WebCore::GPUShaderModule::GPUShaderModule):
388         * Sources.txt:
389         * SourcesCocoa.txt:
390         * WebCore.xcodeproj/project.pbxproj:
391         * bindings/js/WebCoreBuiltinNames.h:
392
393 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
394
395         [css-logical] Implement flow-relative margin, padding and border shorthands
396         https://bugs.webkit.org/show_bug.cgi?id=188697
397
398         Reviewed by Simon Fraser and Antti Koivisto.
399
400         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
401                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
402                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
403                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
404                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
405                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
406                webexposed/css-properties-as-js-properties.html
407                webexposed/css-properties-behind-flags.html
408                webexposed/css-property-listing.html
409
410         * css/CSSComputedStyleDeclaration.cpp:
411         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
412         Allow the new properties to serialize their computed value.
413
414         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
415         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
416         * css/CSSComputedStyleDeclaration.h:
417         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
418         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
419         shorthands.
420
421         * css/CSSProperties.json:
422         Add the new properties behind the CSSLogicalEnabled runtime flag.
423
424         * css/CSSStyleDeclaration.cpp:
425         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
426         Prevent CSS properties disabled behind a runtime flag from being exposed in
427         style declarations.
428
429         * css/StyleProperties.cpp:
430         (WebCore::StyleProperties::getPropertyValue const):
431         Allow the new properties to serialize their specified value.
432
433         (WebCore::StyleProperties::get2Values const):
434         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
435
436         (WebCore::StyleProperties::borderPropertyValue const):
437         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
438         corresponding to width, style and color.
439
440         (WebCore::MutableStyleProperties::setProperty):
441         Prevent CSS properties disabled behind a runtime flag from being set a value.
442
443         (WebCore::StyleProperties::asText const):
444         Allow the new properties to be serialized in cssText.
445         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
446         and serialize the longhands instead. Note that there could be another shorthand
447         available which is enabled, but a proper solution would require bug 190496.
448
449         * css/StyleProperties.h:
450         Update declarations of borderPropertyValue and get2Values.
451
452         * css/makeprop.pl:
453         (addProperty):
454         Add isEnabledCSSProperty function for checking that a CSS property is not
455         disabled behind a runtime flag.
456
457         * css/parser/CSSPropertyParser.cpp:
458         (WebCore::cssPropertyID):
459         Prevent CSS properties disabled behind a runtime flag from being exposed in
460         computed styles.
461
462         (WebCore::CSSPropertyParser::addProperty):
463         Prevent CSS properties disabled behind a runtime flag from being set a value.
464
465         (WebCore::CSSPropertyParser::consumeBorder):
466         Change consumeBorder to provide the caller with the parsed values instead of
467         setting properties. Then the caller can decide to which properties the values
468         should be set, and whether border-image should be reset or not.
469
470         (WebCore::CSSPropertyParser::consume2ValueShorthand):
471         (WebCore::CSSPropertyParser::consume4ValueShorthand):
472         Rename consume4Values to consume4ValueShorthand, and add analogous
473         consume2ValueShorthand for parsing shorthands with two longhands.
474
475         (WebCore::CSSPropertyParser::parseShorthand):
476         Allow the new properties to be parsed.
477
478         * css/parser/CSSPropertyParser.h:
479         Update declarations of consumeBorder, consume2ValueShorthand and
480         consume4ValueShorthand.
481
482         * inspector/agents/InspectorCSSAgent.cpp:
483         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
484         Prevent CSS properties disabled behind a runtime flag from being exposed in
485         the CSS inspector tool.
486
487         * page/RuntimeEnabledFeatures.h:
488         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
489         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
490         Add the CSSLogicalEnabled runtime flag.
491
492 2018-11-15  Truitt Savell  <tsavell@apple.com>
493
494         Unreviewed, rolling out r238220.
495
496         Introduced failing tests to iOS and is slowing down EWS
497
498         Reverted changeset:
499
500         "[css-grid] Consider scrollbars in
501         populateGridPositionsForDirection()"
502         https://bugs.webkit.org/show_bug.cgi?id=191656
503         https://trac.webkit.org/changeset/238220
504
505 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
506
507         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
508         https://bugs.webkit.org/show_bug.cgi?id=191522
509
510         Reviewed by Brent Fulgham.
511
512         Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
513         https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
514
515         Covered by existing tests.
516
517         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
518         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
519
520 2018-11-15  Ross Kirsling  <ross.kirsling@sony.com>
521
522         DragImage should have a complete default implementation
523         https://bugs.webkit.org/show_bug.cgi?id=191666
524
525         Reviewed by Dean Jackson.
526
527         Move WPE's stub implementation down into the base implementation file.
528
529         * SourcesWPE.txt:
530         * platform/DragImage.cpp:
531         (WebCore::dragImageSize):
532         (WebCore::deleteDragImage):
533         (WebCore::scaleDragImage):
534         (WebCore::dissolveDragImageToFraction):
535         (WebCore::createDragImageFromImage):
536         (WebCore::createDragImageIconForCachedImageFilename):
537         (WebCore::createDragImageForLink):
538         * platform/wpe/DragImageWPE.cpp: Removed.
539
540 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
541
542         [WebAuthN] UserHandle can be null
543         https://bugs.webkit.org/show_bug.cgi?id=191521
544
545         Reviewed by Alex Christensen.
546
547         According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
548         UserHandle can now be null.
549
550         Covered by existing tests.
551
552         * Modules/webauthn/AuthenticatorAssertionResponse.h:
553         (WebCore::AuthenticatorAssertionResponse::create):
554         (WebCore::AuthenticatorAssertionResponse::userHandle const):
555         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
556         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
557         * Modules/webauthn/PublicKeyCredential.cpp:
558         (WebCore::PublicKeyCredential::tryCreate):
559         * Modules/webauthn/PublicKeyCredentialData.h:
560         (WebCore::PublicKeyCredentialData::encode const):
561         (WebCore::PublicKeyCredentialData::decode):
562         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
563         (fido::readCTAPGetAssertionResponse):
564
565 2018-11-15  Youenn Fablet  <youenn@apple.com>
566
567         Modernize RTCPeerConnection handling of pendingActivity
568         https://bugs.webkit.org/show_bug.cgi?id=191661
569
570         Reviewed by Eric Carlson.
571
572         makePendingActivity is the modern way to handle set/unset of pending activity.
573         No change of behavior.
574
575         * Modules/mediastream/RTCPeerConnection.cpp:
576         (WebCore::RTCPeerConnection::create):
577         (WebCore::RTCPeerConnection::doStop):
578         * Modules/mediastream/RTCPeerConnection.h:
579
580 2018-11-15  Keith Rollin  <krollin@apple.com>
581
582         Delete old .xcfilelist files
583         https://bugs.webkit.org/show_bug.cgi?id=191669
584         <rdar://problem/46081994>
585
586         Reviewed by Chris Dumez.
587
588         .xcfilelist files were created and added to the Xcode project files in
589         https://trac.webkit.org/changeset/238008/webkit. However, they caused
590         build issues and they were removed from the Xcode projects in
591         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
592         the files from the repository altogether. They'll ultimately be
593         replaced with new files with names that indicate whether the
594         associated files are inputs to the Run Script phase or are files
595         created by the Run Script phase.
596
597         No new tests -- no changed functionality.
598
599         * DerivedSources.xcfilelist: Removed.
600         * UnifiedSources.xcfilelist: Removed.
601
602 2018-11-15  Youenn Fablet  <youenn@apple.com>
603
604         Update RTCPeerConnection JS built-ins to be closer to specWe
605         https://bugs.webkit.org/show_bug.cgi?id=191665
606
607         Reviewed by Eric Carlson.
608
609         Simplify JS built-ins since we no longer need to support callback versions of the API.
610         Make sure to have the right number of parameters in the JS built-in functions.
611         Make some simplification to the code.
612         Covered by existing tests and rebased test.
613
614         * Modules/mediastream/RTCPeerConnection.js:
615         (createOffer):
616         (createAnswer):
617         (setLocalDescription):
618         (setRemoteDescription):
619         (addIceCandidate):
620         * Modules/mediastream/RTCPeerConnectionInternals.js:
621         (enqueueOperation):
622         (callbacksAndDictionaryOverload): Deleted.
623
624 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
625
626         REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
627         https://bugs.webkit.org/show_bug.cgi?id=191673
628         rdar://problem/46083440
629
630         Reviewed by Antti Koivisto.
631
632         Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
633         tree for every Frame. They get re-attached on tab show, and for subframes this involves
634         the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
635         
636         The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
637         fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
638         layer configuration update that gets iframe layers parented.
639         
640         This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
641         patch will optimize this, and add a layout test.
642
643         * rendering/RenderLayerCompositor.cpp:
644         (WebCore::RenderLayerCompositor::layerStyleChanged):
645
646 2018-11-15  Zalan Bujtas  <zalan@apple.com>
647
648         [LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
649         https://bugs.webkit.org/show_bug.cgi?id=191690
650
651         Reviewed by Antti Koivisto.
652
653         Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
654
655         * layout/Verification.cpp:
656         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
657         * layout/inlineformatting/InlineFormattingContext.cpp:
658         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
659
660 2018-11-15  Zalan Bujtas  <zalan@apple.com>
661
662         [LFC] FormattingContext base class should not declare computeStaticPosition.
663         https://bugs.webkit.org/show_bug.cgi?id=191683
664
665         Reviewed by Antti Koivisto.
666
667         Apparently only BlockFormattingContext uses it.
668
669         * layout/FormattingContext.h:
670         * layout/blockformatting/BlockFormattingContext.h:
671         * layout/inlineformatting/InlineFormattingContext.cpp:
672         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
673         * layout/inlineformatting/InlineFormattingContext.h:
674
675 2018-11-14  Zalan Bujtas  <zalan@apple.com>
676
677         [LFC][IFC] Add support for in-flow positioned inline boxes.
678         https://bugs.webkit.org/show_bug.cgi?id=191672
679
680         Reviewed by Antti Koivisto.
681
682         We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
683
684         Test: fast/inline/simple-inline-inflow-positioned.html
685
686         * layout/Verification.cpp:
687         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
688         * layout/inlineformatting/InlineFormattingContext.cpp:
689         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
690         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
691         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
692         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
693         * layout/inlineformatting/InlineFormattingContext.h:
694         * layout/inlineformatting/InlineRun.h:
695         (WebCore::Layout::InlineRun::moveVertically):
696         * layout/layouttree/LayoutTreeBuilder.cpp:
697         (WebCore::Layout::outputInlineRuns):
698
699 2018-11-15  Thibault Saunier  <tsaunier@igalia.com>
700
701         [GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
702         https://bugs.webkit.org/show_bug.cgi?id=191631
703
704         Reviewed by Xabier Rodriguez-Calvar.
705
706         This will be tested once webkit.org/b/186933 is implemented.
707
708         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
709         (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
710         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
711         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
712
713 2018-11-15  Antti Koivisto  <antti@apple.com>
714
715         REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
716         https://bugs.webkit.org/show_bug.cgi?id=191642
717
718         Reviewed by Zalan Bujtas.
719
720         Invalidate access key map even when thorttling style recalcs.
721
722         * dom/Document.cpp:
723         (WebCore::Document::scheduleStyleRecalc):
724
725 2018-11-15  Antti Koivisto  <antti@apple.com>
726
727         Remove fonts from CSSFontFaceSet safely
728         https://bugs.webkit.org/show_bug.cgi?id=191676
729
730         Reviewed by Zalan Bujtas.
731
732         Test: fast/text/font-face-set-remove-safely.html
733
734         * css/CSSFontFaceSet.cpp:
735         (WebCore::CSSFontFaceSet::remove):
736
737 2018-11-15  Manuel Rego Casasnovas  <rego@igalia.com>
738
739         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
740         https://bugs.webkit.org/show_bug.cgi?id=191656
741
742         Reviewed by Javier Fernandez.
743
744         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
745         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
746         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
747
748         The patch modifies the method so it takes into account scrollbar size
749         in order to compute the position of the columns/rows depending on the direction and the writing mode.
750
751         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
752                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
753                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
754
755         * rendering/RenderGrid.cpp:
756         (WebCore::RenderGrid::populateGridPositionsForDirection):
757
758 2018-11-14  Keith Rollin  <krollin@apple.com>
759
760         Move scripts for Derived and Unified Sources to external files
761         https://bugs.webkit.org/show_bug.cgi?id=191670
762         <rdar://problem/46082278>
763
764         Reviewed by Keith Miller.
765
766         Move the scripts in the Generate Derived Sources and Generate Unified
767         Sources Run Script phases from the Xcode projects to external shell
768         script files. Then invoke those scripts from the Run Script phases.
769         This refactoring is being performed to support later work that will
770         invoke these scripts in other contexts.
771
772         The scripts were maintained as-is when making the move. I did a little
773         reformatting and added 'set -e' to the top of each file, but that's
774         it.
775
776         No new tests -- no changed functionality.
777
778         * Scripts/generate-derived-sources.sh: Added.
779         * Scripts/generate-unified-sources.sh: Added.
780         * WebCore.xcodeproj/project.pbxproj:
781
782 2018-11-14  Keith Rollin  <krollin@apple.com>
783
784         Fix #end vs. #endif typo.
785         https://bugs.webkit.org/show_bug.cgi?id=191668
786         <rdar://problem/46081704>
787
788         Reviewed by Alexey Proskuryakov.
789
790         Source/WebCore/SourcesCocoa.txt had a #end that should have been a
791         #endif. Fix this, an add a check to generate-unified-source-bundles.rb
792         to detect similar typos.
793
794         No new tests -- no changed functionality.
795
796         * SourcesCocoa.txt:
797
798 2018-11-14  Keith Rollin  <krollin@apple.com>
799
800         Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
801         https://bugs.webkit.org/show_bug.cgi?id=191667
802         <rdar://problem/46081286>
803
804         Reviewed by Eric Carlson.
805
806         VideoFullscreenLayerManager.mm no longer exists.
807
808         No new tests -- No changed functionality.
809
810         * SourcesCocoa.txt:
811
812 2018-11-14  Timothy Hatcher  <timothy@apple.com>
813
814         Enabled dark mode CSS support by default.
815         https://bugs.webkit.org/show_bug.cgi?id=191609
816         rdar://problem/46046861
817
818         Reviewed by Megan Gardner.
819
820         * page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
821
822 2018-11-14  Timothy Hatcher  <timothy@apple.com>
823
824         Default the view background color and text color to different values when in dark mode.
825         https://bugs.webkit.org/show_bug.cgi?id=191607
826         rdar://problem/46045854
827
828         Reviewed by Dean Jackson.
829
830         Test: css-dark-mode/default-colors.html
831
832         * css/html.css:
833         (html): Set color: text on macOS.
834         * dom/Document.cpp:
835         (WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
836         * editing/EditingStyle.cpp:
837         (WebCore::caretColorFromStyle): Added.
838         (WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
839         caret-color directly since removeEquivalentProperties fails with semantic colors.
840         (WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
841         directly since removeEquivalentProperties fails with semantic colors.
842         * page/Frame.cpp:
843         (WebCore::Frame::createView): Drop backgroundColor.
844         * page/Frame.h:
845         * page/FrameView.cpp:
846         (WebCore::FrameView::recalculateBaseBackgroundColor): Added.
847         (WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
848         Calculate the backgroundColor based on the transparent argument only.
849         * page/FrameView.h:
850         * platform/graphics/Color.h:
851         (WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
852         * rendering/RenderBox.cpp:
853         (WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
854         * rendering/RenderLayerBacking.cpp:
855         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
856         since it ignores the semantic color flag.
857         * testing/Internals.cpp:
858         (WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
859         (WebCore::Internals::viewBaseBackgroundColor): Added.
860         * testing/Internals.h:
861         * testing/Internals.idl: Added viewBaseBackgroundColor.
862
863 2018-11-14  Justin Fan  <justin_fan@apple.com>
864
865         [WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
866         https://bugs.webkit.org/show_bug.cgi?id=191383
867
868         Reviewed by Dean Jackson.
869
870         Covered by existing WebGPU tests introduced in original patch.
871
872         * Modules/webgpu/GPUDevice.h:
873         * Modules/webgpu/GPUPipelineStageDescriptor.h:
874         * Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
875         (): Refactored into enum class.
876         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
877         (WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
878         * Modules/webgpu/GPUShaderModule.h:
879         * Modules/webgpu/WebGPUDevice.cpp:
880         (WebCore::WebGPUDevice::createRenderPipeline const):
881         * Modules/webgpu/WebGPUShaderModule.h:
882         (WebCore::WebGPUShaderModule::module const):
883         * Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
884         * Modules/webgpu/cocoa/GPURenderPipeline.h:
885         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
886         (WebCore::setFunctionsForPipelineDescriptor):
887         (WebCore::GPURenderPipeline::create):
888         * Modules/webgpu/cocoa/GPUSwapChain.h:
889         * WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
890
891 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
892
893         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
894         https://bugs.webkit.org/show_bug.cgi?id=191612
895
896         Reviewed by Matt Baker.
897
898         * inspector/InspectorController.cpp:
899         (WebCore::InspectorController::connectFrontend):
900         (WebCore::InspectorController::disconnectFrontend):
901         (WebCore::InspectorController::show):
902         * inspector/InspectorController.h:
903         * inspector/WorkerInspectorController.cpp:
904         (WebCore::WorkerInspectorController::connectFrontend):
905         (WebCore::WorkerInspectorController::disconnectFrontend):
906         * page/PageDebuggable.cpp:
907         (WebCore::PageDebuggable::connect):
908         (WebCore::PageDebuggable::disconnect):
909         * page/PageDebuggable.h:
910         * testing/Internals.cpp:
911         (WebCore::InspectorStubFrontend::InspectorStubFrontend):
912         (WebCore::InspectorStubFrontend::closeWindow):
913         * workers/service/context/ServiceWorkerDebuggable.cpp:
914         (WebCore::ServiceWorkerDebuggable::connect):
915         (WebCore::ServiceWorkerDebuggable::disconnect):
916         * workers/service/context/ServiceWorkerDebuggable.h:
917         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
918         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
919         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
920         * workers/service/context/ServiceWorkerInspectorProxy.h:
921
922 2018-11-14  Timothy Hatcher  <timothy@apple.com>
923
924         Update prefers-color-scheme media query matching based on GitHub issue #3278.
925         https://bugs.webkit.org/show_bug.cgi?id=191654
926         rdar://problem/46074307
927
928         Reviewed by Simon Fraser.
929
930         Test: css-dark-mode/prefers-color-scheme.html
931
932         * css/MediaQueryEvaluator.cpp:
933         (WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
934         for `no-preference` since there is no macOS option for no user preference.
935         * css/MediaQueryExpression.cpp:
936         (WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
937
938 2018-11-14  Devin Rousso  <drousso@apple.com>
939
940         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
941         https://bugs.webkit.org/show_bug.cgi?id=191628
942
943         Reviewed by Dean Jackson.
944
945         Updated existing test: inspector/model/recording.html
946
947         * inspector/InspectorCanvas.h:
948         * inspector/InspectorCanvas.cpp:
949         (WebCore::InspectorCanvas::indexForData):
950         (WebCore::InspectorCanvas::buildInitialState):
951         (WebCore::InspectorCanvas::buildAction):
952         Drive-by: prevent de-duplicated objects from being destroyed while recording.
953
954 2018-11-14  Stephan Szabo  <stephan.szabo@sony.com>
955
956         [Win] Compile Service Worker support
957         https://bugs.webkit.org/show_bug.cgi?id=191409
958
959         Reviewed by Youenn Fablet.
960
961         Fix compilation errors when ENABLE(SERVICE_WORKER)
962         on Windows with clang-cl. Clang on dllexport
963         platforms does not support specifying the
964         dllexport on both a class and members of the class
965         and unistd.h isn't provided but also appeared to
966         not be used.
967
968         No new tests, should be covered by existing tests.
969
970         * workers/service/ServiceWorkerProvider.h:
971         * workers/service/context/SWContextManager.cpp:
972
973 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
974
975         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
976         https://bugs.webkit.org/show_bug.cgi?id=191494
977         <rdar://problem/45469854>
978
979         Reviewed by Devin Rousso.
980
981         * inspector/InspectorClient.h:
982         (WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
983         Provide a hook so that a client may wish to allow direct remote inspection of the Page.
984         This is used by WebKitLegacy only.
985
986         * page/Page.cpp:
987         (Page::Page):
988         Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
989         This is used by WebKitLegacy only.
990
991         * inspector/InspectorController.cpp:
992         (WebCore::InspectorController::connectFrontend):
993         * inspector/InspectorController.h:
994         * page/PageDebuggable.cpp:
995         (WebCore::PageDebuggable::connect):
996         (WebCore::PageDebuggable::disconnect):
997         * page/PageDebuggable.h:
998         When a frontend connects, always enable the developer extras for the Page.
999         This is pretty much only for the remote path, which allows inspection if developer
1000         extras were not already enabled (iOS). This simplifies the logic, and toggling
1001         developer extras after it was already enabled is not really important.
1002
1003 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
1004
1005         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
1006         https://bugs.webkit.org/show_bug.cgi?id=190884
1007
1008         Reviewed by Dean Jackson.
1009
1010         Only notify display refresh monitors with matching display ID.
1011
1012         Test: fast/animation/request-animation-frame-in-two-pages.html
1013
1014         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1015         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1016         * platform/graphics/DisplayRefreshMonitorManager.h:
1017
1018 2018-11-14  Youenn Fablet  <youenn@apple.com>
1019
1020         Convert libwebrtc error types to DOM exceptions
1021         https://bugs.webkit.org/show_bug.cgi?id=191590
1022
1023         Reviewed by Alex Christensen.
1024
1025         Make use of overloaded callback method that provides an error type.
1026         This type is then used to create a DOM exception with the correct type.
1027         Covered by existing tests.
1028
1029         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1030         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
1031         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
1032         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
1033         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
1034         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1035         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
1036         (WebCore::toExceptionCode):
1037
1038 2018-11-14  Youenn Fablet  <youenn@apple.com>
1039
1040         Allow to remove MediaStreamPrivate observers when iterating over observers
1041         https://bugs.webkit.org/show_bug.cgi?id=187256
1042
1043         Reviewed by Eric Carlson.
1044
1045         Migrate the observer list from a Vector to a HashSet.
1046         This is more robust to multiple observing and keeping of order of observers is not required.
1047         Copy the set of observers to a vector before iterating over it.
1048         This allows to remove an observer while iterating, which is now used in UserMediaRequest.
1049
1050         Covered by existing tests.
1051
1052         * Modules/mediastream/UserMediaRequest.cpp:
1053         (WebCore::UserMediaRequest::mediaStreamIsReady):
1054         * platform/mediastream/MediaStreamPrivate.cpp:
1055         (WebCore::MediaStreamPrivate::addObserver):
1056         (WebCore::MediaStreamPrivate::removeObserver):
1057         (WebCore::MediaStreamPrivate::forEachObserver const):
1058         (WebCore::MediaStreamPrivate::updateActiveState):
1059         (WebCore::MediaStreamPrivate::addTrack):
1060         (WebCore::MediaStreamPrivate::removeTrack):
1061         (WebCore::MediaStreamPrivate::characteristicsChanged):
1062         * platform/mediastream/MediaStreamPrivate.h:
1063
1064 2018-11-14  Youenn Fablet  <youenn@apple.com>
1065
1066         Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
1067         https://bugs.webkit.org/show_bug.cgi?id=191603
1068
1069         Reviewed by Chris Dumez.
1070
1071         Make sure to check that the sender peer connection backend is matching.
1072         Covered by rebased WPT test.
1073
1074         * Modules/mediastream/RTCPeerConnection.cpp:
1075         (WebCore::RTCPeerConnection::removeTrack):
1076         * Modules/mediastream/RTCRtpSender.cpp:
1077         (WebCore::RTCRtpSender::isCreatedBy const):
1078         * Modules/mediastream/RTCRtpSender.h:
1079
1080 2018-11-14  Fujii Hironori  <Hironori.Fujii@sony.com>
1081
1082         [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
1083         https://bugs.webkit.org/show_bug.cgi?id=191620
1084
1085         Reviewed by Alex Christensen.
1086
1087         Remove a abstract class CookieJarCurl which is not needed anymore.
1088         And, rename CookieJarCurlDatabase to CookieJarCurl.
1089
1090         No new tests because there's no behaviour change in WebCore.
1091
1092         * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
1093         * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
1094         * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
1095         * platform/network/curl/CookieJarCurlDatabase.h: Removed.
1096         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1097         (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
1098
1099 2018-11-14  Christopher Reid  <chris.reid@sony.com>
1100
1101         [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
1102         https://bugs.webkit.org/show_bug.cgi?id=191606
1103
1104         Reviewed by Michael Catanzaro.
1105
1106         No behavior change.
1107
1108         Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
1109
1110         * platform/wpe/PlatformKeyboardEventWPE.cpp:
1111         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
1112         (WebCore::PlatformKeyboardEvent::singleCharacterString):
1113
1114 2018-11-13  Zalan Bujtas  <zalan@apple.com>
1115
1116         [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
1117         https://bugs.webkit.org/show_bug.cgi?id=191623
1118
1119         Reviewed by Antti Koivisto.
1120
1121         This patch expands the breaking behaviour to support separate start/end breaks.
1122
1123         <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
1124
1125         input to line breaking -> <parent start middle end parent>
1126         output of line breaking (considering infinite constraint) -> <parent start middle end parent>
1127         due to padding, final runs -> <parent><start middle end><parent>
1128
1129         "parent" -> n/a
1130         "start" -> BreakAtStart
1131         " middle " -> n/a
1132         "end" -> BreakAtEnd
1133         "parent" -> n/a
1134
1135         Another example:
1136         <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
1137
1138         line breaking -> <parent start middle end parent>
1139         due to padding-right, final runs -> <parent start middle end><parent>
1140
1141         "parent" -> n/a
1142         "start" -> n/a
1143         " middle " -> n/a
1144         "end" -> BreakAtEnd
1145         "parent" -> n/a
1146
1147         * layout/inlineformatting/InlineFormattingContext.cpp:
1148         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1149         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
1150         (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
1151         * layout/inlineformatting/InlineFormattingContext.h:
1152         * layout/inlineformatting/InlineFormattingState.cpp:
1153         (WebCore::Layout::InlineFormattingState::detachingRules const):
1154         * layout/inlineformatting/InlineFormattingState.h:
1155         (WebCore::Layout::InlineFormattingState::lastInlineItem const):
1156         (WebCore::Layout::InlineFormattingState::addDetachingRule):
1157
1158 2018-11-14  Youenn Fablet  <youenn@apple.com>
1159
1160         Add support for RTCRtpCodecParameters.sdpFmtpLine
1161         https://bugs.webkit.org/show_bug.cgi?id=191591
1162
1163         Reviewed by Eric Carlson.
1164
1165         Covered by rebased test.
1166
1167         * Modules/mediastream/RTCRtpCodecParameters.h:
1168         * Modules/mediastream/RTCRtpCodecParameters.idl:
1169         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1170         (WebCore::toRTCCodecParameters):
1171
1172 2018-11-14  Youenn Fablet  <youenn@apple.com>
1173
1174         Add support for transport and peerConnection stats
1175         https://bugs.webkit.org/show_bug.cgi?id=191592
1176
1177         Reviewed by Alex Christensen.
1178
1179         Covered by rebased tests.
1180
1181         * Modules/mediastream/RTCStatsReport.h:
1182         (WebCore::RTCStatsReport::TransportStats::TransportStats):
1183         (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
1184         * Modules/mediastream/RTCStatsReport.idl:
1185         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
1186         (WebCore::fillRTCTransportStats):
1187         (WebCore::fillRTCPeerConnectionStats):
1188         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
1189
1190 2018-11-14  Ali Juma  <ajuma@chromium.org>
1191
1192         Transform of composited layer not updated when layer also needs repaint
1193         https://bugs.webkit.org/show_bug.cgi?id=191598
1194
1195         Reviewed by Simon Fraser.
1196
1197         Trigger a compositing geometry update whenever a RenderLayer's transform changes,
1198         even when other parts of its style have changed in a way that produces a
1199         StyleDifference greater than RecompositeLayer.
1200
1201         Test: compositing/geometry/transform-and-repaint-updates-geometry.html
1202
1203         * rendering/RenderLayerCompositor.cpp:
1204         (WebCore::RenderLayerCompositor::layerStyleChanged):
1205
1206 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
1207
1208         [WebAuthN] Support CTAP HID authenticators on macOS
1209         https://bugs.webkit.org/show_bug.cgi?id=188623
1210         <rdar://problem/43353777>
1211
1212         Reviewed by Brent Fulgham and Chris Dumez.
1213
1214         This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
1215         any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
1216         dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
1217
1218         Tests: http/wpt/webauthn/ctap-hid-failure.https.html
1219                http/wpt/webauthn/ctap-hid-success.https.html
1220                http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
1221                http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
1222                http/wpt/webauthn/public-key-credential-create-success-hid.https.html
1223                http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
1224                http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
1225                http/wpt/webauthn/public-key-credential-get-success-hid.https.html
1226
1227         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
1228         (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
1229         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
1230         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1231         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1232         (fido::readCTAPGetAssertionResponse):
1233         * Modules/webauthn/fido/FidoConstants.h:
1234
1235 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1236
1237         [WebRTC] Provide default implementation of LibWebRTCProvider
1238         https://bugs.webkit.org/show_bug.cgi?id=191611
1239
1240         Reviewed by Michael Catanzaro.
1241
1242         Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
1243
1244         * PlatformWin.cmake:
1245         * platform/GStreamer.cmake:
1246         * platform/SourcesGLib.txt:
1247         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1248         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1249         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
1250         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
1251         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
1252
1253 2018-11-13  Timothy Hatcher  <timothy@apple.com>
1254
1255         Use a light scrollbar for transparent web views in dark mode.
1256         https://bugs.webkit.org/show_bug.cgi?id=191559
1257         rdar://problem/46000489
1258
1259         Reviewed by Dean Jackson.
1260
1261         Test: css-dark-mode/supported-color-schemes-scrollbar.html
1262
1263         * css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
1264         * css/StyleBuilderCustom.h:
1265         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
1266         * editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
1267         (WebCore::createFragment):
1268         * inspector/InspectorOverlay.cpp:
1269         (WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
1270         * page/FrameView.cpp:
1271         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
1272         transparent web views in dark mode.
1273         (WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
1274         Return the body for document element renderer.
1275         (WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
1276         (WebCore::FrameView::styleColorOptions const): Added. Ditto.
1277         * page/FrameView.h:
1278         * rendering/style/RenderStyle.cpp:
1279         (WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
1280         * rendering/style/RenderStyle.h:
1281         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
1282         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
1283         (WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
1284         * svg/graphics/SVGImage.cpp:
1285         (WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
1286         * testing/Internals.cpp:
1287         (WebCore::Internals::setViewIsTransparent): Added.
1288         (WebCore::Internals::scrollbarOverlayStyle const): Added.
1289         * testing/Internals.h:
1290         * testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
1291
1292 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1293
1294         [AppleWin] Unreviewed build fix after r238108.
1295
1296         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1297         (printLayer):
1298         (PlatformCALayerWin::embeddedViewID const):
1299         * platform/graphics/ca/win/PlatformCALayerWin.h:
1300
1301 2018-11-13  Youenn Fablet  <youenn@apple.com>
1302
1303         RTCPeerConnection.getTransceivers is not always exposing all transceivers
1304         https://bugs.webkit.org/show_bug.cgi?id=191589
1305
1306         Reviewed by Eric Carlson.
1307
1308         Implement the collect transceiver algorithm using libwebrtc backend.
1309         Call this algorithm everytime transceivers are retrieved from JS.
1310         For Plan B, make this a no-op as this is not supported.
1311         Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
1312
1313         Covered by existing and rebased tests.
1314
1315         * Modules/mediastream/PeerConnectionBackend.h:
1316         (WebCore::PeerConnectionBackend::collectTransceivers):
1317         * Modules/mediastream/RTCPeerConnection.cpp:
1318         (WebCore::RTCPeerConnection::getSenders const):
1319         (WebCore::RTCPeerConnection::getReceivers const):
1320         (WebCore::RTCPeerConnection::getTransceivers const):
1321         * Modules/mediastream/RTCPeerConnection.h:
1322         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1323         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
1324         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1325         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1326         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1327         (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
1328         (WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
1329         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
1330         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
1331         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1332
1333 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1334
1335         [iOS] Do not show selection UI for editable elements with opacity near zero
1336         https://bugs.webkit.org/show_bug.cgi?id=191442
1337         <rdar://problem/45958625>
1338
1339         Reviewed by Simon Fraser.
1340
1341         Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
1342                editing/selection/ios/hide-selection-after-hiding-contenteditable.html
1343                editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
1344                editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
1345                editing/selection/ios/hide-selection-in-hidden-contenteditable.html
1346
1347         * rendering/RenderObject.cpp:
1348         (WebCore::RenderObject::isTransparentRespectingParentFrames const):
1349
1350         Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
1351         frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
1352         Opacity on ancestor elements is applied multiplicatively.
1353
1354         * rendering/RenderObject.h:
1355
1356 2018-11-13  Eric Carlson  <eric.carlson@apple.com>
1357
1358         [MediaStream] Observer AVCaptureDevice "suspended" property
1359         https://bugs.webkit.org/show_bug.cgi?id=191587
1360         <rdar://problem/46030598>
1361
1362         Reviewed by Youenn Fablet.
1363
1364         No new tests, AVCapture can only be tested manually.
1365
1366         * platform/mediastream/mac/AVCaptureDeviceManager.h:
1367         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1368         (WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
1369         the first time the device list is scanned.
1370         (WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
1371         change device availability.
1372         (WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all 
1373         devices and add them to the cached list.
1374         (WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
1375         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
1376         devices.
1377         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
1378         (WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
1379         (-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
1380         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
1381         (-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
1382         (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
1383         (WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
1384         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
1385         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
1386         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
1387
1388         * platform/mediastream/mac/AVVideoCaptureSource.h:
1389         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1390         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
1391         and "suspended".
1392         (WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
1393         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
1394         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
1395
1396 2018-11-13  Devin Rousso  <drousso@apple.com>
1397
1398         Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
1399         https://bugs.webkit.org/show_bug.cgi?id=191597
1400
1401         Reviewed by Joseph Pecoraro.
1402
1403         When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
1404         meaning that we may try to fetch in situations previously unexpected.
1405
1406         * platform/network/cocoa/ResourceResponseCocoa.mm:
1407         (WebCore::ResourceResponse::platformCertificateInfo const):
1408
1409 2018-11-13  Timothy Hatcher  <timothy@apple.com>
1410
1411         Treat supported-color-schemes as the second highest priority property.
1412         https://bugs.webkit.org/show_bug.cgi?id=191556
1413         rdar://problem/46000076
1414
1415         Reviewed by Dean Jackson.
1416
1417         Test: css-dark-mode/supported-color-schemes-priority.html
1418
1419         * css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
1420         * css/StyleResolver.cpp:
1421         (WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
1422         after -webkit-ruby-position, before other properties, so it can affect resolved colors.
1423
1424 2018-11-13  Charlie Turner  <cturner@igalia.com>
1425
1426         [EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
1427         https://bugs.webkit.org/show_bug.cgi?id=191316
1428
1429         Reviewed by Xabier Rodriguez-Calvar.
1430
1431         Another preparation in patch getting ready to move the decryption
1432         logic behind the CDMInstance and out of the GStreamer decryptors
1433         themselves. The first step taken here is to arrange for the
1434         instances to always be available in the decryptors when they need
1435         to decrypt content.
1436
1437         In doing so, there were a number of hairy bits of code that could
1438         use some abstraction, so the opportunity was taken to do that as
1439         well.
1440
1441         Covered by tests in media/encrypted-media and
1442         imported/w3c/web-platform-tests/encrypted-media.
1443
1444         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1445         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
1446         drm-key-needed since it was not being used anywhere.
1447         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1448         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1449         Factor out the parsing of decryption system information from
1450         GStreamer, since it was not clear what that code was doing unless
1451         you squinted pretty hard. Also remove the duplicated
1452         initialization-data-encountered posting.
1453         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1454         Refactored to make it a more general method and usable in more
1455         situations. It now has an optional to stop it from eliding init
1456         datas for a different key system. This is required the first time
1457         we post them, since if a CDM instance has already been set, and if
1458         the stream init datas are for different systems, we ended up never
1459         posting an encrypted event.
1460         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
1461         Actually send a CDMInstance now when in regular playback mode.
1462         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
1463         Remove m_needToSendCredentials, it was not being used.
1464         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
1465         Refactored to use the new initializationDataEncountered.
1466         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
1467         Log the waiting state, since it was currently not clear what that
1468         logging message was even telling you!
1469         (WebCore::extractEventsAndSystemsFromMessage): Deleted.
1470         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1471         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
1472         (WebCore::InitData::InitData): New class that encapsulates both
1473         single instantiation and streaming instantiation.
1474         (WebCore::InitData::append): Used for the streaming mode, when you
1475         are concatenating init datas together.
1476         (WebCore::InitData::payload const):
1477         (WebCore::InitData::systemId const):
1478         (WebCore::InitData::payloadContainerType const):
1479         (WebCore::InitData::isFromDifferentContainer):
1480         (WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
1481         (WebCore::ProtectionSystemEvents::events const):
1482         (WebCore::ProtectionSystemEvents::availableSystems const):
1483         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1484         (webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
1485         waiting-for-key after requesting a CDM instance, it will flap back
1486         to not waiting for a key almost immediately, didn't make sense
1487         positing after requesting an instance. Also post key-received when
1488         we receive the key.
1489         (webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
1490         been arranged that a CDMInstance will always be present in an OOB
1491         message, so parse it out here.
1492         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1493         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
1494         As above, make sure when posting the OOB that a CDMInstance is present.
1495
1496 2018-11-13  Charlie Turner  <cturner@igalia.com>
1497
1498         Various compiler warnings/errors fixes.
1499         https://bugs.webkit.org/show_bug.cgi?id=191583
1500
1501         Reviewed by Frédéric Wang.
1502
1503         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1504         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
1505         ASSERT is only compiled in DEBUG mode, so guarding with
1506         !LOG_DISABLED is wrong.
1507         * rendering/RenderLayerCompositor.cpp:
1508         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1509         showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
1510         mode, so guarding with !LOG_DISABLED was wrong.
1511         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1512         Ditto, this time with member .depth.
1513         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
1514         * rendering/svg/SVGRenderSupport.cpp:
1515         (WebCore::SVGRenderSupport::styleChanged): Add another unused
1516         parameter.
1517
1518 2018-11-12  Antoine Quint  <graouts@apple.com>
1519
1520         [Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
1521         https://bugs.webkit.org/show_bug.cgi?id=191542
1522         <rdar://problem/45356027>
1523
1524         Reviewed by Simon Fraser.
1525
1526         Test: animations/no-style-recalc-during-accelerated-animation.html
1527
1528         In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
1529         animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
1530         when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
1531         animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
1532         for that time when we'll schedule animation resolution.
1533
1534         By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
1535         we also update animations in-flight to dispatch "animationiteration" events.
1536
1537         * animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
1538         * animation/DocumentTimeline.cpp:
1539         (WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
1540         (WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
1541         (WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
1542         (WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
1543         cache the current time in suspendAnimations() without also automatically clearing the current time.
1544         (WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
1545         factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
1546         by virtue of using cacheCurrentTime(). This fixes some flakiness.
1547         (WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime(). 
1548         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
1549         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
1550         scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
1551         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
1552         (WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
1553         and call scheduleNextTick().
1554         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
1555         (WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
1556         Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
1557         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
1558         * animation/DocumentTimeline.h:
1559         * animation/WebAnimation.cpp:
1560         (WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
1561         function to get that information directly through the WebAnimation object without bothering about its effect.
1562         (WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
1563         change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
1564         (WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
1565         * animation/WebAnimation.h:
1566
1567 2018-11-13  Miguel Gomez  <magomez@igalia.com>
1568
1569         [GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
1570         https://bugs.webkit.org/show_bug.cgi?id=191545
1571
1572         Reviewed by Žan Doberšek.
1573
1574         Keep track of layer size changes even if they happen when the layer is not in the visible
1575         area, so we can update edge tiles when the layer gets visible.
1576
1577         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1578         (WebCore::TiledBackingStore::createTiles):
1579         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1580
1581 2018-11-12  Rob Buis  <rbuis@igalia.com>
1582
1583         Content-Type parameter values should allow empty quoted strings
1584         https://bugs.webkit.org/show_bug.cgi?id=191388
1585
1586         Reviewed by Dean Jackson.
1587
1588         According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
1589         quoted strings are acceptable for Content-Type parameter values. They
1590         are accepted by Firefox and Chrome implementations as well.
1591
1592         Test: web-platform-tests/xhr/overridemimetype-blob.html
1593
1594         * platform/network/ParsedContentType.cpp:
1595         (WebCore::parseToken):
1596         (WebCore::parseQuotedString):
1597         (WebCore::parseContentType):
1598         * platform/network/ParsedContentType.h:
1599
1600 2018-11-12  Christopher Reid  <chris.reid@sony.com>
1601
1602         [Curl] Reject entire cookie if the domain fails a tailmatch.
1603         https://bugs.webkit.org/show_bug.cgi?id=191406
1604
1605         Reviewed by Youenn Fablet.
1606
1607         Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
1608         and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
1609         Also cleanup Cookie database implementation to make them testable better.
1610
1611         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
1612
1613         * platform/network/curl/CookieJarDB.cpp:
1614         (WebCore::CookieJarDB::canAcceptCookie): Added.
1615         (WebCore::CookieJarDB::setCookie):
1616         * platform/network/curl/CookieUtil.cpp:
1617         (WebCore::CookieUtil::parseCookieAttributes):
1618         (WebCore::CookieUtil::parseCookieHeader):
1619         * platform/network/curl/CookieUtil.h:
1620
1621 2018-11-12  Devin Rousso  <drousso@apple.com>
1622
1623         Web Inspector: Network: show secure certificate details per-request
1624         https://bugs.webkit.org/show_bug.cgi?id=191447
1625         <rdar://problem/30019476>
1626
1627         Reviewed by Joseph Pecoraro.
1628
1629         Test: http/tests/inspector/network/resource-response-security.html
1630
1631         * loader/ResourceLoader.h:
1632         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
1633         * loader/ResourceLoader.cpp:
1634         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
1635         Always save certificate information when WebInspector is open.
1636
1637         * platform/network/CertificateInfoBase.h: Added.
1638         (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
1639         (WebCore::CertificateInfoBase::summaryInfo const):
1640         (WebCore::CertificateInfoBase::isEmpty const):
1641         * platform/network/cf/CertificateInfo.h:
1642         (WebCore::CertificateInfo::summaryInfo const): Added.
1643         * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
1644         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
1645         (WebCore::CertificateInfo::summaryInfo const): Added.
1646         * platform/network/curl/CertificateInfo.h:
1647         (WebCore::CertificateInfo::summaryInfo const): Added.
1648         (WebCore::CertificateInfo::isEmpty const): Added.
1649         * platform/network/soup/CertificateInfo.h:
1650         (WebCore::CertificateInfo::summaryInfo const): Added.
1651         (WebCore::CertificateInfo::isEmpty const): Added.
1652         Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
1653         platform-specific code in its implementation.
1654
1655         * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
1656         * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
1657         * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
1658
1659         * inspector/NetworkResourcesData.h:
1660         (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
1661         (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
1662         * inspector/NetworkResourcesData.cpp:
1663         (WebCore::NetworkResourcesData::responseReceived):
1664
1665         * inspector/agents/InspectorNetworkAgent.cpp:
1666         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
1667
1668         * PlatformAppleWin.cmake:
1669         * PlatformMac.cmake:
1670         * SourcesCocoa.txt:
1671         * WebCore.xcodeproj/project.pbxproj:
1672         * platform/Curl.cmake:
1673         * platform/SourcesSoup.txt:
1674
1675 2018-11-12  Zalan Bujtas  <zalan@apple.com>
1676
1677         Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer.
1678         https://bugs.webkit.org/show_bug.cgi?id=191554
1679         <rdar://problem/45825265>
1680
1681         Reviewed by Antti Koivisto.
1682
1683         While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block.
1684         Moving a renderer is a 2 step process:
1685         1. Detach the renderer from its current parent
1686         2. Attach it to its new parent.
1687         During step #1, we check if there is a chance to collapse anonymous blocks. In this case the soon-to-be-parent is a sibling anonymous block which, after detaching the marker sibling
1688         is not needed anymore (except we use it as the new parent).
1689
1690         Test: fast/inline/marker-list-item-move-should-not-crash.html
1691
1692         * rendering/updating/RenderTreeBuilder.cpp:
1693         (WebCore::RenderTreeBuilder::detach):
1694         * rendering/updating/RenderTreeBuilder.h:
1695         * rendering/updating/RenderTreeBuilderBlock.cpp:
1696         (WebCore::RenderTreeBuilder::Block::detach):
1697         * rendering/updating/RenderTreeBuilderBlock.h:
1698         * rendering/updating/RenderTreeBuilderList.cpp:
1699         (WebCore::RenderTreeBuilder::List::updateItemMarker):
1700
1701 2018-11-12  Javier Fernandez  <jfernandez@igalia.com>
1702
1703         [css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic
1704         https://bugs.webkit.org/show_bug.cgi?id=191358
1705
1706         Reviewed by Manuel Rego Casasnovas.
1707
1708         These changes are just a refactoring to ease the integration of the new Baseline Alignment
1709         logic in a follow up patch.
1710
1711         We need to properly estimate the grid area size of orthogonal items so that we can perform
1712         an accurate pre-layout. This is important because orthogonal items will synthesize their baseline
1713         if they participate in any baseline alignment context.
1714
1715         No new tests, since no behavior change has been introduced in this patch.
1716
1717         * rendering/Grid.cpp:
1718         (WebCore::Grid::setNeedsItemsPlacement):
1719         * rendering/Grid.h:
1720         * rendering/GridTrackSizingAlgorithm.cpp:
1721         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
1722         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
1723         (WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const):
1724         (WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const):
1725         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
1726         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
1727         (WebCore::GridTrackSizingAlgorithm::run):
1728         (WebCore::GridTrackSizingAlgorithm::reset):
1729         * rendering/GridTrackSizingAlgorithm.h:
1730         (WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const):
1731         * rendering/RenderGrid.cpp:
1732         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
1733         (WebCore::RenderGrid::layoutBlock):
1734         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
1735         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
1736         (WebCore::RenderGrid::placeItemsOnGrid const):
1737         (WebCore::RenderGrid::performGridItemsPreLayout const):
1738         (WebCore::overrideSizeChanged):
1739         (WebCore::hasRelativeBlockAxisSize):
1740         (WebCore::RenderGrid::updateGridAreaLogicalSize const):
1741         (WebCore::RenderGrid::layoutGridItems):
1742         * rendering/RenderGrid.h:
1743
1744 2018-11-12  Sihui Liu  <sihui_liu@apple.com>
1745
1746         imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
1747         https://bugs.webkit.org/show_bug.cgi?id=191500
1748
1749         Reviewed by Dean Jackson.
1750
1751         When double value is bigger than maximum unsigned int, converting double to unsigned int has
1752         different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
1753         maximum unsigned int.
1754
1755         Covered by existing test.
1756
1757         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1758         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
1759         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
1760
1761 2018-11-12  Basuke Suzuki  <basuke.suzuki@sony.com>
1762
1763         [Curl] Add API Test for Curl cookie backend.
1764         https://bugs.webkit.org/show_bug.cgi?id=191493
1765
1766         Reviewed by Youenn Fablet.
1767
1768         Refactoring for cookie backend interface.
1769
1770         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
1771
1772         * platform/FileSystem.h:
1773         * platform/network/curl/CookieJarCurlDatabase.cpp:
1774         (WebCore::cookiesForSession):
1775         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
1776         (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
1777         (WebCore::CookieJarCurlDatabase::getRawCookies const):
1778         * platform/network/curl/CookieJarDB.cpp:
1779         (WebCore::CookieJarDB::openDatabase):
1780         (WebCore::CookieJarDB::checkSQLiteReturnCode):
1781         (WebCore::CookieJarDB::isEnabled const):
1782         (WebCore::CookieJarDB::searchCookies):
1783         (WebCore::CookieJarDB::setCookie):
1784         (WebCore::CookieJarDB::deleteCookie):
1785         (WebCore::CookieJarDB::deleteCookieInternal):
1786         (WebCore::CookieJarDB::deleteCookies):
1787         (WebCore::CookieJarDB::deleteAllCookies):
1788         (WebCore::CookieJarDB::executeSimpleSql):
1789         (WebCore::CookieJarDB::isEnabled): Deleted.
1790         * platform/network/curl/CookieJarDB.h:
1791         * platform/network/curl/CookieUtil.cpp:
1792         (WebCore::CookieUtil::parseCookieHeader):
1793         * platform/network/curl/CookieUtil.h:
1794         * platform/win/FileSystemWin.cpp:
1795         (WebCore::FileSystem::generateTemporaryPath):
1796         (WebCore::FileSystem::openTemporaryFile):
1797         (WebCore::FileSystem::createTemporaryDirectory):
1798         (WebCore::FileSystem::deleteNonEmptyDirectory):
1799
1800 2018-11-12  Tim Horton  <timothy_horton@apple.com>
1801
1802         Make it possible to edit images inline
1803         https://bugs.webkit.org/show_bug.cgi?id=191352
1804         <rdar://problem/30107985>
1805
1806         Reviewed by Dean Jackson.
1807
1808         Tests: editing/images/basic-editable-image.html
1809                editing/images/reparent-editable-image-maintains-strokes.html
1810
1811         Add the beginnings of a mechanism to replace images with a special attribute
1812         with a native drawing view in the UI process.
1813
1814         * page/Settings.yaml:
1815         Add a setting to control whether images become natively editable when they
1816         have the x-apple-editable-image attribute.
1817
1818         * html/HTMLImageElement.cpp:
1819         (WebCore::HTMLImageElement::editableImageViewID const):
1820         Lazily generate an EmbeddedViewID and persist it on the <img> element.
1821
1822         * html/HTMLImageElement.h:
1823         Rearrange the service controls methods to sit before the members.
1824         Add m_editableImageViewID and editableImageViewID().
1825
1826         * platform/graphics/GraphicsLayer.cpp:
1827         (WebCore::GraphicsLayer::nextEmbeddedViewID):
1828         * platform/graphics/GraphicsLayer.h:
1829         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
1830         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
1831         on Cocoa platforms and when using RemoteLayerTree.
1832         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
1833         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
1834         and an EmbeddedViewID to uniquely identify and communicate about the
1835         embedded view (which may move between layers, since it is tied to an element).
1836
1837         * platform/graphics/ca/GraphicsLayerCA.cpp:
1838         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
1839         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
1840         When setting GraphicsLayer's contents to an embedded view, we use
1841         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
1842         GraphicsLayerCARemote will override this and make a correctly-initialized
1843         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
1844
1845         * platform/graphics/ca/GraphicsLayerCA.h:
1846         * platform/graphics/ca/PlatformCALayer.cpp:
1847         (WebCore::operator<<):
1848         * platform/graphics/ca/PlatformCALayer.h:
1849         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1850         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1851         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1852         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
1853         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
1854         These will be overridden by PlatformCALayerRemote to do more interesting things.
1855
1856         * rendering/RenderImage.cpp:
1857         (WebCore::RenderImage::isEditableImage const):
1858         Add a getter that return true if the setting is enabled and
1859         x-apple-editable-image is empty or true.
1860
1861         (WebCore::RenderImage::requiresLayer const):
1862         RenderImage requires a layer either if RenderReplaced does, or we are an
1863         editable image.
1864
1865         * rendering/RenderImage.h:
1866         * rendering/RenderLayer.cpp:
1867         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
1868         (WebCore::RenderLayer::calculateClipRects const):
1869         * rendering/RenderLayerBacking.cpp:
1870         (WebCore::RenderLayerBacking::updateConfiguration):
1871         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
1872
1873         * rendering/RenderLayerCompositor.cpp:
1874         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
1875         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1876         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1877         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
1878         * rendering/RenderLayerCompositor.h:
1879         Make editable images require compositing implicitly.
1880
1881 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
1882
1883         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
1884         https://bugs.webkit.org/show_bug.cgi?id=189230
1885         <rdar://problem/44050379>
1886
1887         Reviewed by Joseph Pecoraro.
1888
1889         Runs all png images through zopflipng. This results in a smaller file
1890         size and takes care of this issue as a byproduct.
1891
1892         * Modules/modern-media-controls/images/iOS/airplay-placard@1x.png:
1893         * Modules/modern-media-controls/images/iOS/airplay-placard@2x.png:
1894         * Modules/modern-media-controls/images/iOS/airplay-placard@3x.png:
1895         * Modules/modern-media-controls/images/iOS/invalid-placard@1x.png:
1896         * Modules/modern-media-controls/images/iOS/invalid-placard@2x.png:
1897         * Modules/modern-media-controls/images/iOS/invalid-placard@3x.png:
1898         * Modules/modern-media-controls/images/iOS/pip-placard@1x.png:
1899         * Modules/modern-media-controls/images/iOS/pip-placard@2x.png:
1900         * Modules/modern-media-controls/images/iOS/pip-placard@3x.png:
1901         * Modules/modern-media-controls/images/macOS/airplay-placard@1x.png:
1902         * Modules/modern-media-controls/images/macOS/airplay-placard@2x.png:
1903         * Modules/modern-media-controls/images/macOS/invalid-placard@1x.png:
1904         * Modules/modern-media-controls/images/macOS/invalid-placard@2x.png:
1905         * Modules/modern-media-controls/images/macOS/pip-placard@1x.png:
1906         * Modules/modern-media-controls/images/macOS/pip-placard@2x.png:
1907         * Resources/AttachmentPlaceholder.png:
1908         * Resources/AttachmentPlaceholder@2x.png:
1909         * Resources/ListButtonArrow.png:
1910         * Resources/ListButtonArrow@2x.png:
1911         * Resources/missingImage.png:
1912         * Resources/missingImage@2x.png:
1913         * Resources/missingImage@3x.png:
1914         * Resources/moveCursor.png:
1915         * Resources/northEastSouthWestResizeCursor.png:
1916         * Resources/northSouthResizeCursor.png:
1917         * Resources/northWestSouthEastResizeCursor.png:
1918         * Resources/nullPlugin.png:
1919         * Resources/nullPlugin@2x.png:
1920         * Resources/panIcon.png:
1921         * Resources/textAreaResizeCorner.png:
1922         * Resources/textAreaResizeCorner@2x.png:
1923         * Resources/urlIcon.png:
1924
1925 2018-11-12  Youenn Fablet  <youenn@apple.com>
1926
1927         RealtimeOutgoing A/V sources should observe their sources only if having a sink
1928         https://bugs.webkit.org/show_bug.cgi?id=191490
1929
1930         Reviewed by Eric Carlson.
1931
1932         Observe the source that generates media based on the sinks:
1933         - Do not observe at creation time
1934         - For first sink, start observing
1935         - When no more sink, stop observing
1936         Apply this principle for both outgoing audio and video sources.
1937         Add locks for the sinks to ensure thread-safety.
1938         Make sinks HashSet which is more robust.
1939
1940         Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations.
1941
1942         Covered by existing tests and updated webrtc/remove-track.html.
1943
1944         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1945         (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
1946         (WebCore::RealtimeOutgoingAudioSource::stop):
1947         (WebCore::RealtimeOutgoingAudioSource::AddSink):
1948         (WebCore::RealtimeOutgoingAudioSource::RemoveSink):
1949         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
1950         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1951         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1952         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
1953         (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
1954         (WebCore::RealtimeOutgoingVideoSource::observeSource):
1955         (WebCore::RealtimeOutgoingVideoSource::setSource):
1956         (WebCore::RealtimeOutgoingVideoSource::stop):
1957         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
1958         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
1959         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1960         (WebCore::RealtimeOutgoingVideoSource::isSilenced const):
1961         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
1962         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
1963         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1964         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
1965         (WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
1966         (WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
1967         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
1968         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1969         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
1970
1971 2018-11-12  Youenn Fablet  <youenn@apple.com>
1972
1973         Support setting stream ids when adding a transceiver
1974         https://bugs.webkit.org/show_bug.cgi?id=191307
1975
1976         Reviewed by Eric Carlson.
1977
1978         Add support for streams in RTCTransceiverInit.
1979         Add plumbing down to libwebrtc.
1980         Covered by rebased tests.
1981
1982         * Modules/mediastream/RTCPeerConnection.h:
1983         * Modules/mediastream/RTCPeerConnection.idl:
1984         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1985         (WebCore::fromRtpTransceiverInit):
1986
1987 2018-11-12  Antti Koivisto  <antti@apple.com>
1988
1989         Support dynamic pseudo-classes on elements with display: contents
1990         https://bugs.webkit.org/show_bug.cgi?id=181640
1991         <rdar://problem/36605415>
1992
1993         Reviewed by Dean Jackson.
1994
1995         The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation.
1996
1997         This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but
1998         includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited
1999         text properties).
2000
2001         Test: fast/css/display-contents-hover-active.html
2002
2003         * dom/Document.cpp:
2004         (WebCore::Document::updateHoverActiveState):
2005
2006             Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree
2007             but also includes display:content elements. This also allows removing the special display:none case.
2008
2009         * dom/Element.cpp:
2010         (WebCore::Element::setActive):
2011         (WebCore::Element::setHovered):
2012
2013             Also look into display:contents style for invalidation checks.
2014
2015         (WebCore::Element::renderOrDisplayContentsStyle const):
2016
2017             Make this helper an Element member.
2018
2019         * dom/Element.h:
2020         * dom/Node.cpp:
2021         (WebCore::Node::parentElementInComposedTree const):
2022
2023             Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator.
2024
2025         * rendering/updating/RenderTreePosition.cpp:
2026         (WebCore::RenderTreePosition::nextSiblingRenderer const):
2027         * style/StyleTreeResolver.cpp:
2028         (WebCore::Style::TreeResolver::resolveElement):
2029         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2030         (WebCore::Style::shouldResolveElement):
2031         (WebCore::Style::TreeResolver::resolveComposedTree):
2032         (WebCore::Style::renderOrDisplayContentsStyle): Deleted.
2033
2034             Use the Element::renderOrDisplayContentsStyle() instead.
2035
2036 2018-11-12  Antoine Quint  <graouts@apple.com>
2037
2038         [Web Animations] Turn Web Animations experimental
2039         https://bugs.webkit.org/show_bug.cgi?id=191543
2040
2041         Reviewed by Dean Jackson.
2042
2043         * page/RuntimeEnabledFeatures.h:
2044
2045 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
2046
2047         feFlood with alpha color doesn't work correctly
2048         https://bugs.webkit.org/show_bug.cgi?id=163666
2049
2050         Reviewed by Zalan Bujtas.
2051         
2052         FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha()
2053         rather than multiplying the flood color with the flood opacity as other browsers do.
2054
2055         Test: svg/filters/feFlood-with-alpha-color.html
2056
2057         * platform/graphics/Color.cpp:
2058         (WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere,
2059         and it triggered a behavior change, so add a comment.
2060         * platform/graphics/filters/FEFlood.cpp:
2061         (WebCore::FEFlood::platformApplySoftware):
2062         * svg/SVGStopElement.cpp:
2063         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
2064
2065 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
2066
2067         Require <iframe allow="display"> for an iframe to use getDisplayMedia
2068         https://bugs.webkit.org/show_bug.cgi?id=191505
2069         <rdar://problem/45968811>
2070
2071         Reviewed by Jer Noble.
2072
2073         Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
2074
2075         * Modules/mediastream/MediaDevicesRequest.cpp:
2076         (WebCore::MediaDevicesRequest::start):
2077         * Modules/mediastream/UserMediaController.cpp:
2078         (WebCore::isAllowedToUse):
2079         (WebCore::UserMediaController::canCallGetUserMedia):
2080         (WebCore::UserMediaController::logGetUserMediaDenial):
2081         * Modules/mediastream/UserMediaController.h:
2082         * Modules/mediastream/UserMediaRequest.cpp:
2083         (WebCore::UserMediaRequest::start):
2084
2085 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
2086
2087         Make compositing updates incremental
2088         https://bugs.webkit.org/show_bug.cgi?id=90342
2089
2090         Reviewed by Antti Koivisto.
2091
2092         Previously, updating compositing layers required two full RenderLayer tree traversals,
2093         and all the work was done for every RenderLayer on each composting update. This could be expensive
2094         on pages with lots of RenderLayers.
2095
2096         These changes make compositing updates more incremental. Compositing updates still require
2097         two tree traversals. The first determines which RenderLayers need to be composited (of those which
2098         weren't already made composited at style-change time), because of reasons that can only be determined
2099         post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry
2100         and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make
2101         it hard to fold these two traversals together.
2102
2103         In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers,
2104         and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first
2105         "compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal.
2106         When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need
2107         to be visited.
2108
2109         Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have
2110         to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize
2111         work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can
2112         be skipped if no change has triggered the need for that traversal.
2113         
2114         These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
2115         more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
2116         triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
2117         excluding composited filters from the composited bounds (but still taking them into account for overlap).
2118
2119         Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html).
2120
2121         Code to set the dirty bits is added in various places that change properties that compositing depends on.
2122         
2123         These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the
2124         style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy"
2125         traversal, which is always a pre-order traversal.
2126
2127         Tests: compositing/geometry/stacking-context-change-layer-reparent.html
2128                compositing/layer-creation/change-to-overlap.html
2129                compositing/updates/no-updates-in-non-composited-iframe.html
2130
2131         * html/canvas/WebGLRenderingContextBase.cpp:
2132         (WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited
2133         for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value.
2134         * page/FrameView.cpp:
2135         (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
2136         * page/Page.cpp:
2137         (WebCore::Page::setPageScaleFactor):
2138         * platform/graphics/ca/GraphicsLayerCA.cpp:
2139         (WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers.
2140         * rendering/RenderBox.cpp:
2141         (WebCore::RenderBox::styleWillChange):
2142         * rendering/RenderLayer.cpp:
2143         (WebCore::RenderLayer::RenderLayer):
2144         (WebCore::RenderLayer::~RenderLayer):
2145         (WebCore::RenderLayer::addChild):
2146         (WebCore::RenderLayer::removeChild):
2147         (WebCore::RenderLayer::shouldBeStackingContext const):
2148         (WebCore::RenderLayer::stackingContext const):
2149         (WebCore::RenderLayer::dirtyZOrderLists):
2150         (WebCore::RenderLayer::dirtyNormalFlowList):
2151         (WebCore::RenderLayer::updateNormalFlowList):
2152         (WebCore::RenderLayer::rebuildZOrderLists):
2153         (WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag):
2154         (WebCore::RenderLayer::contentChanged):
2155         (WebCore::RenderLayer::updateLayerPositions):
2156         (WebCore::RenderLayer::updateTransform):
2157         (WebCore::RenderLayer::updateLayerPosition):
2158         (WebCore::RenderLayer::enclosingCompositingLayer const):
2159         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
2160         (WebCore::RenderLayer::clippingRootForPainting const):
2161         (WebCore::RenderLayer::scrollTo):
2162         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
2163         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2164         (WebCore::RenderLayer::paintLayerContents):
2165         (WebCore::RenderLayer::hitTest):
2166         (WebCore::RenderLayer::hitTestLayer):
2167         (WebCore::RenderLayer::calculateClipRects const):
2168         (WebCore::outputPaintOrderTreeLegend):
2169         (WebCore::outputPaintOrderTreeRecursive):
2170         (WebCore::compositingContainer): Deleted.
2171         * rendering/RenderLayer.h:
2172         (WebCore::RenderLayer::clearZOrderLists):
2173         (WebCore::RenderLayer::paintOrderParent const):
2174         * rendering/RenderLayerBacking.cpp:
2175         (WebCore::RenderLayerBacking::updateCompositedBounds):
2176         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
2177         (WebCore::RenderLayerBacking::updateAfterLayout):
2178         (WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
2179         (WebCore::RenderLayerBacking::updateConfiguration):
2180         (WebCore::RenderLayerBacking::updateGeometry):
2181         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
2182         (WebCore::RenderLayerBacking::updateMaskingLayer):
2183         (WebCore::RenderLayerBacking::paintsContent const):
2184         (WebCore::RenderLayerBacking::contentChanged):
2185         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
2186         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2187         (WebCore::RenderLayerBacking::startAnimation):
2188         (WebCore::RenderLayerBacking::animationFinished):
2189         (WebCore::RenderLayerBacking::startTransition):
2190         (WebCore::RenderLayerBacking::transitionFinished):
2191         (WebCore::RenderLayerBacking::setCompositedBounds):
2192         * rendering/RenderLayerBacking.h:
2193         * rendering/RenderLayerCompositor.cpp:
2194         (WebCore::RenderLayerCompositor::CompositingState::CompositingState):
2195         (WebCore::RenderLayerCompositor::enableCompositingMode):
2196         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
2197         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):
2198         (WebCore::RenderLayerCompositor::willRecalcStyle):
2199         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2200         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2201         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2202         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2203         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2204         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
2205         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
2206         (WebCore::RenderLayerCompositor::logLayerInfo):
2207         (WebCore::clippingChanged):
2208         (WebCore::styleAffectsLayerGeometry):
2209         (WebCore::RenderLayerCompositor::layerStyleChanged):
2210         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
2211         (WebCore::RenderLayerCompositor::updateBacking):
2212         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
2213         (WebCore::RenderLayerCompositor::layerWasAdded):
2214         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
2215         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
2216         (WebCore::RenderLayerCompositor::computeExtent const):
2217         (WebCore::RenderLayerCompositor::addToOverlapMap):
2218         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2219         (WebCore::RenderLayerCompositor::rootLayerConfigurationChanged):
2220         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2221         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
2222         (WebCore::RenderLayerCompositor::needsToBeComposited const):
2223         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2224         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2225         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2226         (WebCore::RenderLayerCompositor::clippedByAncestor const):
2227         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
2228         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
2229         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
2230         (WebCore::RenderLayerCompositor::requiresCompositingForFilters const):
2231         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
2232         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
2233         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
2234         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
2235         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2236         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
2237         (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
2238         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
2239         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2240         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
2241         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
2242         (WebCore::operator<<):
2243         (WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted.
2244         (WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted.
2245         (WebCore::isScrollableOverflow): Deleted.
2246         (WebCore::styleHasTouchScrolling): Deleted.
2247         (WebCore::styleChangeRequiresLayerRebuild): Deleted.
2248         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted.
2249         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted.
2250         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted.
2251         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted.
2252         * rendering/RenderLayerCompositor.h:
2253         * rendering/RenderTreeAsText.cpp:
2254         (WebCore::writeLayers):
2255
2256 2018-11-12  Rob Buis  <rbuis@igalia.com>
2257
2258         CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com
2259         https://bugs.webkit.org/show_bug.cgi?id=190839
2260
2261         Reviewed by Frédéric Wang.
2262
2263         The CSSCalcOperation ctor that takes a leftSide and rightSide parameter
2264         wastes memory since it will always have size 2 but claims the
2265         default Vector size. So make sure to reserve an initial capacity of 2.
2266
2267         * css/CSSCalculationValue.cpp:
2268
2269 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2270
2271         WTFMove(xxx) is used in arguments while other arguments touch xxx
2272         https://bugs.webkit.org/show_bug.cgi?id=191544
2273
2274         Reviewed by Alex Christensen.
2275
2276         The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx),
2277         xxx should not be touched in the other arguments. This patch fixes such uses in
2278         IDB code.
2279
2280         * Modules/indexeddb/IDBObjectStore.cpp:
2281         (WebCore::IDBObjectStore::deleteIndex):
2282         * Modules/indexeddb/IDBTransaction.cpp:
2283         (WebCore::IDBTransaction::scheduleOperation):
2284         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2285         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
2286         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2287         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
2288
2289 2018-11-12  Zalan Bujtas  <zalan@apple.com>
2290
2291         [LFC][IFC] Construct dedicated runs when the inline element requires it.
2292         https://bugs.webkit.org/show_bug.cgi?id=191509
2293
2294         Reviewed by Antti Koivisto.
2295
2296         In certain cases, a run can overlap multiple inline elements like this:
2297
2298         <span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span>
2299
2300         The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking.
2301         However, since the middle run is positioned, it needs to be moved independently from the rest of the content, hence it needs a dedicated inline run.
2302
2303         * layout/inlineformatting/InlineFormattingContext.cpp:
2304         (WebCore::Layout::InlineFormattingContext::layout const):
2305         (WebCore::Layout::contentRequiresSeparateRun):
2306         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2307         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2308         (WebCore::Layout::InlineFormattingContext::closeLine const):
2309         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2310         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2311         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2312         * layout/inlineformatting/InlineFormattingContext.h:
2313         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const):
2314         * layout/inlineformatting/InlineLineBreaker.cpp:
2315         (WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet.
2316         * layout/inlineformatting/InlineRun.h:
2317         (WebCore::Layout::InlineRun::overlapsMultipleInlineItems const):
2318         * layout/inlineformatting/InlineRunProvider.cpp:
2319         (WebCore::Layout::InlineRunProvider::processInlineTextItem):
2320         * layout/inlineformatting/InlineRunProvider.h:
2321         (WebCore::Layout::InlineRunProvider::Run::TextContext::expand):
2322         (WebCore::Layout::InlineRunProvider::Run::textContext):
2323         (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted.
2324         (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted.
2325
2326 2018-11-12  Jer Noble  <jer.noble@apple.com>
2327
2328         [MSE] Frame re-ordering can cause iframes to never be enqueued
2329         https://bugs.webkit.org/show_bug.cgi?id=191485
2330
2331         Reviewed by Eric Carlson.
2332
2333         Test: media/media-source/media-source-dropped-iframe.html
2334
2335         Some frame re-ordering techniques result in files where the first frame has a
2336         decode timestamp < 0, but a presentation timestamp >= 0. When appending these
2337         samples to existing content, we can fail to enqueue the first frame because its
2338         DTS overlaps an existing sample, but the presentation timestamp does not.
2339         Rather than try to only enqueue samples whose decode timestamps are > than the
2340         greatest decode end timestamp (minus some fudge factor), allow all frames to be
2341         added to the decode queue if they are strictly ordered greater than the last
2342         enqueued frame.
2343
2344         * Modules/mediasource/SourceBuffer.cpp:
2345         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
2346         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2347         (WebCore::SourceBuffer::provideMediaData):
2348         (WebCore::SourceBuffer::reenqueueMediaForTime):
2349
2350 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2351
2352         IDBTransaction does not use "RefPtr<IDBTransaction> self"
2353         https://bugs.webkit.org/show_bug.cgi?id=190436
2354
2355         Reviewed by Alex Christensen.
2356
2357         It seems that `RefPtr<IDBTransaction> self;` is not effective since it does not capture anything.
2358         Use `protectedThis = makeRef(*this)` instead.
2359
2360         No behavior change.
2361
2362         * Modules/indexeddb/IDBTransaction.cpp:
2363         (WebCore::IDBTransaction::IDBTransaction):
2364
2365 2018-11-12  Alicia Boya García  <aboya@igalia.com>
2366
2367         [MSE][GStreamer] Introduce AbortableTaskQueue
2368         https://bugs.webkit.org/show_bug.cgi?id=190902
2369
2370         Reviewed by Xabier Rodriguez-Calvar.
2371
2372         A new synchronization primitive is introduced: AbortableTaskQueue,
2373         which allows to send work to the main thread from a background thread
2374         with the option to perform two-phase cancellation (startAborting() and
2375         finishAborting()).
2376
2377         This new primitive has been used to overhaul GstBus messaging in
2378         AppendPipeline. A lot of code made redundant has been deleted in the
2379         process and lots of internal functions were now able to be made
2380         private. As part of the refactor all glib signals in AppendPipeline
2381         now use lambdas. All usages of WTF::isMainThread() in AppendPipeline
2382         have been replaced by isMainThread() for consistency with the rest of
2383         WebKit.
2384
2385         Two-phase cancellation is still not used in AppendPipeline as of this
2386         patch, but it will be used in a future patch that makes use of
2387         GStreamer flushes to implement correct MSE abort semantics. There are
2388         unit tests to ensure it works correctly, even if it's still not used.
2389
2390         * WebCore.xcodeproj/project.pbxproj:
2391         * platform/AbortableTaskQueue.h: Added.
2392         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2393         (WebCore::AppendPipeline::dumpAppendState):
2394         (WebCore::AppendPipeline::AppendPipeline):
2395         (WebCore::AppendPipeline::~AppendPipeline):
2396         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
2397         (WebCore::AppendPipeline::handleAppsinkNewSampleFromAnyThread):
2398         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2399         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2400         (WebCore::AppendPipeline::sourceBufferPrivate):
2401         (WebCore::AppendPipeline::appsinkCaps):
2402         (WebCore::AppendPipeline::track):
2403         (WebCore::AppendPipeline::demuxerSrcPadCaps):
2404         (WebCore::AppendPipeline::playerPrivate):
2405
2406 2018-11-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2407
2408         [GStreamer][EME] waitingforkey event should consider decryptors' waiting status
2409         https://bugs.webkit.org/show_bug.cgi?id=191459
2410
2411         Reviewed by Carlos Garcia Campos.
2412
2413         The new cross platform architecture to report waitingforkey and
2414         recover from it requires a more accurate knowledge of what is
2415         going on with the decryptors because events are reported only once
2416         (per key exchange run) and crossplatform only continues if we are
2417         actually ready to continue, meaning that no decryptors are
2418         waiting.
2419
2420         * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added
2421         GstIterator deleter.
2422         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2423         (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail
2424         out if we are requested to not wait anymore but there are still
2425         waiting decryptors.
2426         (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
2427         Query the pipeline, just a query after pipeline is built and
2428         manual inspection during build. The query is optimal but sometimes
2429         we can get this request when the pipeline is under construction so
2430         queries do not arrive at the decryptors and we have to deliver it
2431         by ourselves.
2432         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
2433         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2434         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
2435         Deleted because it is now inlined.
2436         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2437         (webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning.
2438         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2439         (webkit_media_common_encryption_decrypt_class_init): Override
2440         query method.
2441         (webkitMediaCommonEncryptionDecryptTransformInPlace): When the
2442         decryptor is going to block to wait, report before. When the
2443         decryptor receives the key, report it got it.
2444         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not
2445         handle waitingforkey here.
2446         (webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the
2447         decryptor is waiting.
2448
2449 2018-11-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2450
2451         [GTK] Silence ATK_XY_PARENT warnings
2452         https://bugs.webkit.org/show_bug.cgi?id=191504
2453
2454         Reviewed by Carlos Garcia Campos.
2455
2456         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
2457         (atkToContents):
2458         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2459         (textExtents):
2460         * accessibility/atk/WebKitAccessibleUtil.cpp:
2461         (contentsRelativeToAtkCoordinateType):
2462
2463 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2464
2465         Implement a new edit command to change the enclosing list type
2466         https://bugs.webkit.org/show_bug.cgi?id=191487
2467         <rdar://problem/45955922>
2468
2469         Reviewed by Ryosuke Niwa.
2470
2471         Add support for a new edit command that changes the type of the enclosing list element around the selection from
2472         unordered to ordered list and vice versa. This new edit command is exposed only to internal WebKit2 clients, via
2473         SPI on WKWebView (`-_changeListType:`).
2474
2475         This is currently intended for use in Mail compose, but may also be adopted by legacy Notes in the future. As
2476         such, the behavior of this editing command mostly matches shipping behavior in Mail compose (which is currently
2477         implemented entirely by Mail). See below for more details.
2478
2479         Test:   editing/execCommand/change-list-type.html
2480                 WKWebViewEditActions.ChangeListType
2481
2482         * Sources.txt:
2483         * WebCore.xcodeproj/project.pbxproj:
2484         * editing/ChangeListTypeCommand.cpp: Added.
2485         (WebCore::listConversionTypeForSelection):
2486         (WebCore::ChangeListTypeCommand::listConversionType):
2487
2488         Helper that returns a potential list conversion command that may be executed at the given document's selection,
2489         if any exists. We also use existing logic from Mail here to determine which list to change, by walking up the
2490         DOM from the lowest common ancestor container of the current selection until we hit the first list element.
2491
2492         (WebCore::ChangeListTypeCommand::createNewList):
2493
2494         Helper method to create a new list element to replace the given list, and then clone element data from the given
2495         list to the new list. This addresses an existing bug in Mail, wherein changing list type for an enclosing list
2496         which contains inline style properties drops the inline styles, because existing logic in Mail that implements
2497         this editing command only copies the `class` attribute of the old list to the new list.
2498
2499         (WebCore::ChangeListTypeCommand::doApply):
2500
2501         Apply the edit command by running the following steps:
2502         -   Find the enclosing list element, if any (see above).
2503         -   Create a new list element of the opposite type as the enclosing list, and clone over element data from the
2504             list element being replaced.
2505         -   Insert the new list next to the original list.
2506         -   Move all children of the original list to the new list.
2507         -   Remove the original list.
2508         -   Set the selection to the end of the new list.
2509
2510         * editing/ChangeListTypeCommand.h: Added.
2511         * editing/EditAction.h:
2512
2513         Add a pair of new edit actions for conversion from unordered list to ordered list and vice versa.
2514
2515         * editing/Editor.cpp:
2516         (WebCore::Editor::changeSelectionListType):
2517
2518         Implement this by creating and applying a new ChangeListTypeCommand.
2519
2520         (WebCore::Editor::canChangeSelectionListType): Deleted.
2521
2522         Remove this for now, since there's no need for it until full support for edit command validation is implemented.
2523
2524         * editing/Editor.h:
2525         * testing/Internals.cpp:
2526         (WebCore::Internals::changeSelectionListType):
2527         * testing/Internals.h:
2528         * testing/Internals.idl:
2529
2530         Add internal hooks to change list type from layout tests.
2531
2532 2018-11-11  Daniel Bates  <dabates@apple.com>
2533
2534         [iOS] Draw caps lock indicator in password fields
2535         https://bugs.webkit.org/show_bug.cgi?id=190565
2536         <rdar://problem/45262343>
2537
2538         Reviewed by Dean Jackson.
2539
2540         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
2541         fields on iOS more closely match the behavior of password fields on Mac.
2542
2543         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
2544         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
2545         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
2546         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
2547         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
2548         web views listen for keyboard availability changes so as to update the the caps lock state when
2549         a hardware keyboard is detached or attached.
2550
2551         * WebCore.xcodeproj/project.pbxproj:
2552         * page/EventHandler.cpp:
2553         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
2554         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
2555         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
2556         * page/EventHandler.h:
2557         * platform/cocoa/KeyEventCocoa.mm:
2558         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
2559         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
2560         * platform/ios/KeyEventIOS.mm:
2561         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
2562         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
2563         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
2564         * platform/ios/WebEvent.h:
2565         * platform/ios/WebEvent.mm:
2566         (+[WebEvent modifierFlags]): Added.
2567         * platform/mac/KeyEventMac.mm:
2568         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
2569         by both Mac and iOS.
2570         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
2571         by both Mac and iOS.
2572         * rendering/RenderThemeCocoa.h:
2573         * rendering/RenderThemeCocoa.mm:
2574         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
2575         * rendering/RenderThemeIOS.h:
2576         * rendering/RenderThemeIOS.mm:
2577         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
2578         * rendering/RenderThemeMac.h:
2579         * rendering/RenderThemeMac.mm:
2580         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
2581         shared by both Mac and iOS.
2582
2583 2018-11-11  Zalan Bujtas  <zalan@apple.com>
2584
2585         [LFC][BFC] In-flow positioned logic is really formatting context dependent.
2586         https://bugs.webkit.org/show_bug.cgi?id=191512
2587
2588         Reviewed by Simon Fraser.
2589
2590         Move block formatting context specific code from FormattingContext to BlockFormattingContext.
2591
2592         * layout/FormattingContext.cpp:
2593         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): Deleted.
2594         * layout/FormattingContext.h:
2595         * layout/FormattingContextGeometry.cpp:
2596         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
2597         * layout/blockformatting/BlockFormattingContext.cpp:
2598         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
2599         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): Deleted.
2600         * layout/blockformatting/BlockFormattingContext.h:
2601         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2602         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): Deleted.
2603         * layout/inlineformatting/InlineFormattingContext.cpp:
2604         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): Deleted.
2605         * layout/inlineformatting/InlineFormattingContext.h:
2606
2607 2018-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2608
2609         Address post-review comments after r237955
2610         https://bugs.webkit.org/show_bug.cgi?id=191496
2611
2612         Reviewed by Darin Adler.
2613
2614         * rendering/TextDecorationPainter.cpp:
2615         (WebCore::TextDecorationPainter::paintTextDecoration):
2616         * style/InlineTextBoxStyle.cpp:
2617         (WebCore::computeUnderlineOffset):
2618         * style/InlineTextBoxStyle.h:
2619
2620 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
2621
2622         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
2623         https://bugs.webkit.org/show_bug.cgi?id=191492
2624
2625         Reviewed by Alex Christensen.
2626
2627         Rename file.
2628
2629         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2630         * page/mac/EventHandlerMac.mm:
2631         * platform/mac/URLMac.mm:
2632         * platform/mac/WebCoreNSURLExtras.mm:
2633         * platform/mac/WebCoreObjCExtras.mm:
2634         * rendering/RenderThemeMac.mm:
2635
2636 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
2637
2638         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
2639         https://bugs.webkit.org/show_bug.cgi?id=191492
2640
2641         Reviewed by Alex Christensen.
2642
2643         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2644         * page/mac/EventHandlerMac.mm:
2645         * platform/mac/URLMac.mm:
2646         * platform/mac/WebCoreNSURLExtras.mm:
2647         * platform/mac/WebCoreObjCExtras.mm:
2648         * rendering/RenderThemeMac.mm:
2649         (WebCore::RenderThemeMac::systemColor const):
2650
2651 2018-11-10  Megan Gardner  <megan_gardner@apple.com>
2652
2653         Fix build for 32bit Mac
2654         https://bugs.webkit.org/show_bug.cgi?id=191511
2655
2656         Unreviewed Build Fix.
2657
2658         Build fix, not tests needed.
2659
2660         Make the apporiate delecrations for 32-bit mac support.
2661
2662         * editing/mac/DictionaryLookup.mm:
2663
2664 2018-11-10  Simon Fraser  <simon.fraser@apple.com>
2665
2666         Remove support for -webkit-svg-shadow
2667         https://bugs.webkit.org/show_bug.cgi?id=187429
2668         <rdar://problem/41920735>
2669
2670         Reviewed by Dean Jackson.
2671         
2672         -webkit-svg-shadow was a non-standard hack for online iWork, and they no longer use it,
2673         so remove it. No other browser supports it, and chromestatus say it's used on less than
2674         0.000001% of pages.
2675
2676         * css/CSSComputedStyleDeclaration.cpp:
2677         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2678         * css/CSSProperties.json:
2679         * css/SVGCSSComputedStyleDeclaration.cpp:
2680         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2681         * css/StyleBuilderCustom.h:
2682         (WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow): Deleted.
2683         (WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow): Deleted.
2684         (WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow): Deleted.
2685         * css/parser/CSSPropertyParser.cpp:
2686         (WebCore::CSSPropertyParser::parseSingleValue):
2687         * rendering/RenderElement.cpp:
2688         (WebCore::RenderElement::didAttachChild):
2689         * rendering/svg/RenderSVGImage.cpp:
2690         (WebCore::RenderSVGImage::layout):
2691         * rendering/svg/RenderSVGImage.h:
2692         * rendering/svg/RenderSVGModelObject.cpp:
2693         (WebCore::RenderSVGModelObject::RenderSVGModelObject):
2694         * rendering/svg/RenderSVGModelObject.h:
2695         (WebCore::RenderSVGModelObject::repaintRectInLocalCoordinatesExcludingSVGShadow const): Deleted.
2696         (WebCore::RenderSVGModelObject::hasSVGShadow const): Deleted.
2697         (WebCore::RenderSVGModelObject::setHasSVGShadow): Deleted.
2698         * rendering/svg/RenderSVGRoot.cpp:
2699         (WebCore::RenderSVGRoot::RenderSVGRoot):
2700         (WebCore::RenderSVGRoot::updateCachedBoundaries):
2701         * rendering/svg/RenderSVGRoot.h:
2702         * rendering/svg/RenderSVGShape.cpp:
2703         (WebCore::RenderSVGShape::updateRepaintBoundingBox):
2704         * rendering/svg/RenderSVGShape.h:
2705         * rendering/svg/SVGRenderSupport.cpp:
2706         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
2707         (WebCore::SVGRenderSupport::layoutChildren):
2708         (WebCore::SVGRenderSupport::styleChanged):
2709         (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow): Deleted.
2710         (WebCore::SVGRenderSupport::rendererHasSVGShadow): Deleted.
2711         (WebCore::SVGRenderSupport::setRendererHasSVGShadow): Deleted.
2712         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows): Deleted.
2713         (WebCore::SVGRenderSupport::childAdded): Deleted.
2714         * rendering/svg/SVGRenderSupport.h:
2715
2716 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
2717
2718         Unreviewed, rolling out r238065.
2719
2720         Breaks internal builds.
2721
2722         Reverted changeset:
2723
2724         "Make it possible to edit images inline"
2725         https://bugs.webkit.org/show_bug.cgi?id=191352
2726         https://trac.webkit.org/changeset/238065
2727
2728 2018-11-10  Tim Horton  <timothy_horton@apple.com>
2729
2730         Make it possible to edit images inline
2731         https://bugs.webkit.org/show_bug.cgi?id=191352
2732         <rdar://problem/30107985>
2733
2734         Reviewed by Dean Jackson.
2735
2736         Tests: editing/images/basic-editable-image.html
2737                editing/images/reparent-editable-image-maintains-strokes.html
2738
2739         Add the beginnings of a mechanism to replace images with a special attribute
2740         with a native drawing view in the UI process.
2741
2742         * page/Settings.yaml:
2743         Add a setting to control whether images become natively editable when they
2744         have the x-apple-editable-image attribute.
2745
2746         * html/HTMLImageElement.cpp:
2747         (WebCore::HTMLImageElement::editableImageViewID const):
2748         Lazily generate an EmbeddedViewID and persist it on the <img> element.
2749
2750         * html/HTMLImageElement.h:
2751         Rearrange the service controls methods to sit before the members.
2752         Add m_editableImageViewID and editableImageViewID().
2753
2754         * platform/graphics/GraphicsLayer.cpp:
2755         (WebCore::GraphicsLayer::nextEmbeddedViewID):
2756         * platform/graphics/GraphicsLayer.h:
2757         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
2758         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
2759         on Cocoa platforms and when using RemoteLayerTree.
2760         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
2761         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
2762         and an EmbeddedViewID to uniquely identify and communicate about the
2763         embedded view (which may move between layers, since it is tied to an element).
2764
2765         * platform/graphics/ca/GraphicsLayerCA.cpp:
2766         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
2767         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
2768         When setting GraphicsLayer's contents to an embedded view, we use
2769         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
2770         GraphicsLayerCARemote will override this and make a correctly-initialized
2771         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
2772
2773         * platform/graphics/ca/GraphicsLayerCA.h:
2774         * platform/graphics/ca/PlatformCALayer.cpp:
2775         (WebCore::operator<<):
2776         * platform/graphics/ca/PlatformCALayer.h:
2777         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2778         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2779         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2780         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
2781         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
2782         These will be overridden by PlatformCALayerRemote to do more interesting things.
2783
2784         * rendering/RenderImage.cpp:
2785         (WebCore::RenderImage::isEditableImage const):
2786         Add a getter that return true if the setting is enabled and
2787         x-apple-editable-image is empty or true.
2788
2789         (WebCore::RenderImage::requiresLayer const):
2790         RenderImage requires a layer either if RenderReplaced does, or we are an
2791         editable image.
2792
2793         * rendering/RenderImage.h:
2794         * rendering/RenderLayer.cpp:
2795         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
2796         (WebCore::RenderLayer::calculateClipRects const):
2797         * rendering/RenderLayerBacking.cpp:
2798         (WebCore::RenderLayerBacking::updateConfiguration):
2799         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
2800
2801         * rendering/RenderLayerCompositor.cpp:
2802         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2803         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2804         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2805         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
2806         * rendering/RenderLayerCompositor.h:
2807         Make editable images require compositing implicitly.
2808
2809 2018-11-09  Zalan Bujtas  <zalan@apple.com>
2810
2811         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
2812         https://bugs.webkit.org/show_bug.cgi?id=191078
2813         <rdar://problem/45736178>
2814
2815         Reviewed by Antti Koivisto.
2816
2817         1. Improve visuallyNonEmpty milestone confidence level.
2818             Ignore whitespace and non visible text content.
2819             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
2820             Check if the html/body is actually visible.
2821
2822         2. Issue initial paint soon after the milestone fires.
2823             Use a 0ms timer to flush the initial paint.
2824             Throttle additional flushes for 500ms and 1.5s (original behaviour).
2825
2826         3. Suspend optional style recalcs and layouts while painting is being throttled.
2827            When parsing yields we initiate a 0ms style recalc/layout timer.
2828            These optional layouts produce content that we have no intention to paint. 
2829
2830         * dom/Document.cpp:
2831         (WebCore::Document::scheduleStyleRecalc):
2832         (WebCore::Document::shouldScheduleLayout):
2833         * page/ChromeClient.h:
2834         * page/FrameView.cpp:
2835         (WebCore::FrameView::resetLayoutMilestones):
2836         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
2837         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
2838         (WebCore::FrameView::updateIsVisuallyNonEmpty):
2839         * page/FrameView.h:
2840         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
2841         * platform/graphics/FontCascade.h:
2842         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
2843         (WebCore::RenderText::RenderText):
2844
2845 2018-11-09  John Wilander  <wilander@apple.com>
2846
2847         Add ability to configure document.cookie lifetime cap through user defaults
2848         https://bugs.webkit.org/show_bug.cgi?id=191480
2849         <rdar://problem/45240871>
2850
2851         Reviewed by Chris Dumez.
2852
2853         No new tests. Existing test makes sure we don't regress.
2854
2855         This change makes the capped lifetime in seconds configurable through
2856         user defaults.
2857
2858         * platform/network/NetworkStorageSession.h:
2859         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2860         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
2861         (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted.
2862             Renamed setAgeCapForClientSideCookies().
2863         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2864         (WebCore::filterCookies):
2865         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2866
2867 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
2868
2869         Unreviewed, rolling out r238047.
2870
2871         Introduced layout test failures on iOS simulator.
2872
2873         Reverted changeset:
2874
2875         "[iOS] Draw caps lock indicator in password fields"
2876         https://bugs.webkit.org/show_bug.cgi?id=190565
2877         https://trac.webkit.org/changeset/238047
2878
2879 2018-11-09  Tim Horton  <timothy_horton@apple.com>
2880
2881         Normal-flow-only flex items don't correctly respect z-index
2882         https://bugs.webkit.org/show_bug.cgi?id=191486
2883
2884         Reviewed by Simon Fraser.
2885
2886         Test: css3/flexbox/z-index-with-normal-flow-only.html
2887
2888         * rendering/RenderLayer.cpp:
2889         (WebCore::canCreateStackingContext):
2890         r125693 did not ensure that flex items which would otherwise be
2891         normal-flow-only would be put into the z-order tree when necessary.
2892         Fix by respecting the same trigger we use to make layers for flex items;
2893         namely, not having auto z-index.
2894
2895 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2896
2897         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
2898         https://bugs.webkit.org/show_bug.cgi?id=191471
2899         <rdar://problem/45952472>
2900
2901         Reviewed by Tim Horton.
2902
2903         Add new method stubs for changing the list type for the current selection (to be implemented in a future patch).
2904
2905         * editing/Editor.cpp:
2906         (WebCore::Editor::canChangeSelectionListType):
2907         (WebCore::Editor::changeSelectionListType):
2908         * editing/Editor.h:
2909
2910 2018-11-09  Keith Rollin  <krollin@apple.com>
2911
2912         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
2913
2914         Remove the use of .xcfilelists until their side-effects are better
2915         understood.
2916
2917         * WebCore.xcodeproj/project.pbxproj:
2918
2919 2018-11-09  Jer Noble  <jer.noble@apple.com>
2920
2921         SourceBuffer throws an error when appending a second init segment after changeType().
2922         https://bugs.webkit.org/show_bug.cgi?id=191474
2923
2924         Reviewed by Eric Carlson.
2925
2926         Test: media/media-source/media-source-changetype-second-init.html
2927
2928         When encountering an initialization segment after changeType(), add the parsed codec types
2929         to the list of allowed codecs.
2930
2931         * Modules/mediasource/SourceBuffer.cpp:
2932         (WebCore::SourceBuffer::validateInitializationSegment):
2933         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2934         (WebCore::MockMediaPlayerMediaSource::supportsType):
2935         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2936         (WebCore::MockSourceBufferPrivate::canSwitchToType):
2937         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2938
2939 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
2940
2941         [MediaStream] AVVideoCaptureSource reports incorrect size when frames are scaled
2942         https://bugs.webkit.org/show_bug.cgi?id=191479
2943         <rdar://problem/45952201>
2944
2945         Reviewed by Jer Noble.
2946
2947         No new tests, tested manually.
2948
2949         * platform/mediastream/RealtimeVideoSource.cpp:
2950         (WebCore::RealtimeVideoSource::standardVideoSizes): Drive-by fix: add a few more standard
2951         video frame sizes, correct a typo.
2952         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): Drive-by fix: don't consider
2953         rescaled sized when we already have an exact or aspect ratio match because it won't be used.
2954
2955         * platform/mediastream/mac/AVVideoCaptureSource.h:
2956         (WebCore::AVVideoCaptureSource::width const): Deleted.
2957         (WebCore::AVVideoCaptureSource::height const): Deleted.
2958         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2959         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): Delete m_requestedSize.
2960         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete m_width and m_height.
2961         (WebCore::AVVideoCaptureSource::processNewFrame): Don't call setSize with captured size,
2962         the frame may be resized before deliver.
2963
2964 2018-11-09  Ross Kirsling  <ross.kirsling@sony.com>
2965
2966         Unreviewed MSVC build fix after r238039 (and r238046).
2967
2968         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2969         * bindings/js/JSWorkerGlobalScopeBase.h:
2970
2971 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
2972
2973         [Curl][WebKit] Implement Proxy configuration API.
2974         https://bugs.webkit.org/show_bug.cgi?id=189053
2975
2976         Reviewed by Youenn Fablet.
2977
2978         Added API to set proxy from the app.
2979
2980         No new tests because there's no behaviour change in WebCore.
2981
2982         * platform/network/NetworkStorageSession.h:
2983         * platform/network/curl/CurlContext.h:
2984         (WebCore::CurlContext::setProxySettings):
2985         * platform/network/curl/CurlProxySettings.h:
2986         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2987         (WebCore::NetworkStorageSession::setProxySettings const):
2988
2989 2018-11-09  Antti Koivisto  <antti@apple.com>
2990
2991         Use OptionSet for layout milestones
2992         https://bugs.webkit.org/show_bug.cgi?id=191470
2993
2994         Reviewed by Dean Jackson.
2995
2996         * WebCore.xcodeproj/project.pbxproj:
2997         * loader/EmptyFrameLoaderClient.h:
2998         * loader/FrameLoader.cpp:
2999         (WebCore::FrameLoader::didReachLayoutMilestone):
3000         * loader/FrameLoader.h:
3001         * loader/FrameLoaderClient.h:
3002         * page/FrameView.cpp:
3003         (WebCore::FrameView::FrameView):
3004         (WebCore::FrameView::addPaintPendingMilestones):
3005         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
3006         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
3007         * page/FrameView.h:
3008         * page/LayoutMilestone.h: Copied from Source/WebCore/page/LayoutMilestones.h.
3009
3010         Renamed to appease WK2 IPC code generation.
3011
3012         * page/LayoutMilestones.h: Removed.
3013         * page/Page.cpp:
3014         (WebCore::Page::addLayoutMilestones):
3015         (WebCore::Page::removeLayoutMilestones):
3016         (WebCore::Page::isCountingRelevantRepaintedObjects const):
3017         * page/Page.h:
3018         (WebCore::Page::requestedLayoutMilestones const):
3019
3020 2018-11-09  Daniel Bates  <dabates@apple.com>
3021
3022         [iOS] Draw caps lock indicator in password fields
3023         https://bugs.webkit.org/show_bug.cgi?id=190565
3024         <rdar://problem/45262343>
3025
3026         Reviewed by Dean Jackson.
3027
3028         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
3029         fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
3030         indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
3031         keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).
3032
3033         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
3034         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
3035         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
3036         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
3037         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
3038         web views listen for keyboard availability changes so as to update the the caps lock state when
3039         a hardware keyboard is detached or attached.
3040
3041         * WebCore.xcodeproj/project.pbxproj:
3042         * page/EventHandler.cpp:
3043         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
3044         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
3045         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
3046         * page/EventHandler.h:
3047         * platform/cocoa/KeyEventCocoa.mm:
3048         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
3049         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
3050         * platform/ios/KeyEventIOS.mm:
3051         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
3052         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
3053         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
3054         * platform/ios/WebEvent.h:
3055         * platform/ios/WebEvent.mm:
3056         (+[WebEvent modifierFlags]): Added.
3057         * platform/mac/KeyEventMac.mm:
3058         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
3059         by both Mac and iOS.
3060         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
3061         by both Mac and iOS.
3062         * rendering/RenderThemeCocoa.h:
3063         * rendering/RenderThemeCocoa.mm:
3064         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
3065         * rendering/RenderThemeIOS.h:
3066         * rendering/RenderThemeIOS.mm:
3067         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
3068         * rendering/RenderThemeMac.h:
3069         * rendering/RenderThemeMac.mm:
3070         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
3071         shared by both Mac and iOS.
3072
3073 2018-11-09  Chris Dumez  <cdumez@apple.com>
3074
3075         Unreviewed attempt to fix WinCairo build after r238039.
3076
3077         * bindings/js/JSWorkerGlobalScopeBase.h:
3078
3079 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
3080
3081         Extensions3DOpenGLES.h:  warning: 'blitFramebuffer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
3082         https://bugs.webkit.org/show_bug.cgi?id=191451
3083
3084         Reviewed by Dean Jackson.
3085
3086         No new tests because there is no behavior change.
3087
3088         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
3089         (WebCore::Extensions3DOpenGLES::setEXTContextLostCallback): Deleted unused method.
3090         * platform/graphics/opengl/Extensions3DOpenGLES.h: Marked 'override'.
3091
3092 2018-11-09  Andy Estes  <aestes@apple.com>
3093
3094         [Payment Request] canMakePayment() should not consider serialized payment method data
3095         https://bugs.webkit.org/show_bug.cgi?id=191432
3096
3097         Reviewed by Dean Jackson.
3098
3099         In https://github.com/w3c/payment-request/pull/806, we're changing the specification of
3100         canMakePayment() to not consider serialized payment method data when deciding if a payment
3101         method is supported. For Apple Pay, this means we resolve to true for
3102         "https://apple.com/apple-pay", even if an ApplePayRequest is omitted or is missing required
3103         fields.
3104
3105         Added test cases to
3106         http/tests/paymentrequest/payment-request-canmakepayment-method.https.html and
3107         http/tests/paymentrequest/payment-request-show-method.https.html.
3108
3109         * Modules/paymentrequest/PaymentRequest.cpp:
3110         (WebCore::PaymentRequest::canMakePayment):
3111
3112 2018-11-09  Andy Estes  <aestes@apple.com>
3113
3114         [Payment Request] PaymentResponse.details should be updated when the user accepts a retried payment
3115         https://bugs.webkit.org/show_bug.cgi?id=191440
3116
3117         Reviewed by Dean Jackson.
3118
3119         PaymentResponse.details was being initialized in the PaymentResponse constructor and never
3120         updated when the user accepts a retried payment. We need to update it.
3121
3122         Added a test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
3123
3124         * Modules/paymentrequest/PaymentRequest.cpp:
3125         (WebCore::PaymentRequest::accept):
3126         * Modules/paymentrequest/PaymentResponse.cpp:
3127         (WebCore::PaymentResponse::PaymentResponse):
3128         (WebCore::PaymentResponse::setDetailsFunction):
3129         * Modules/paymentrequest/PaymentResponse.h:
3130
3131 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
3132
3133         MediaPlayerPrivateMediaFoundation.h: warning: 'GetService' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
3134         https://bugs.webkit.org/show_bug.cgi?id=191453
3135
3136         Reviewed by Per Arne Vollan.
3137
3138         No new tests because there is no behavior change.
3139
3140         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Marked with 'override' and removed 'virtual'.
3141
3142 2018-11-09  Chris Dumez  <cdumez@apple.com>
3143
3144         Unreviewed attempt to fix internal build on macOS.
3145
3146         'Export' is defined in several headers.
3147
3148         * bindings/js/JSDOMGlobalObject.cpp:
3149         * bindings/js/JSDOMGlobalObject.h:
3150         * bridge/jsc/BridgeJSC.cpp:
3151         * bridge/jsc/BridgeJSC.h:
3152
3153 2018-11-09  Chris Dumez  <cdumez@apple.com>
3154
3155         HTML form validation bubble disappears
3156         https://bugs.webkit.org/show_bug.cgi?id=191418
3157
3158         Reviewed by Simon Fraser.
3159
3160         If we validate a form and find an invalid form control, we'll scroll it into view and show
3161         the validation bubble. However, scrolling the element into view may be an asynchronous
3162         operation, in which case it would discard the validation bubble prematurely because scrolling
3163         hides the validation bubble. To address the issue, we now show the validation message
3164         asynchronously after focusing the element (and potentially scrolling it into view).
3165
3166         Test: fast/forms/scroll-into-view-and-show-validation-message.html
3167
3168         * html/HTMLFormControlElement.cpp:
3169         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
3170
3171 2018-11-09  Brent Fulgham  <bfulgham@apple.com>
3172
3173         [Windows][DirectX] Be more rigors about BeginFigure/EndFigure and Close operations. 
3174         https://bugs.webkit.org/show_bug.cgi?id=191452
3175         <rdar://problem/45933964>
3176
3177         Reviewed by Zalan Bujtas.
3178
3179         Do a better job of balancing the BeginFigure/EndFigure calls in
3180         the PathDirect2D implementation. Failure to do so puts the Geometry sink
3181         into an error state that prevents it from producing drawing output.
3182       
3183
3184         * platform/graphics/Path.h:
3185         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3186         (WebCore::GraphicsContext::drawPath): Flush is needed here.
3187         (WebCore::GraphicsContext::fillPath): Ditto.
3188         (WebCore::GraphicsContext::strokePath): Ditto.
3189         * platform/graphics/win/PathDirect2D.cpp:
3190         (WebCore::Path::drawDidComplete):
3191         (WebCore::Path::closeAnyOpenGeometries):
3192         (WebCore::Path::transform):
3193         (WebCore::Path::openFigureAtCurrentPointIfNecessary):
3194         (WebCore::Path::moveTo):
3195         (WebCore::Path::closeSubpath):
3196
3197 2018-11-09  Jer Noble  <jer.noble@apple.com>
3198
3199         [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
3200         https://bugs.webkit.org/show_bug.cgi?id=191396
3201
3202         Reviewed by Eric Carlson.
3203
3204         When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
3205         from "same codec" requirements.
3206
3207         * Modules/mediasource/SourceBuffer.cpp:
3208         (WebCore::SourceBuffer::validateInitializationSegment):
3209
3210 2018-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3211
3212         REGRESSION(r236365): [GTK] Many form-related tests are failing
3213         https://bugs.webkit.org/show_bug.cgi?id=189993
3214
3215         Reviewed by Michael Catanzaro.
3216
3217         Only the first form data element is added to the message body due to a return added by mistake in r236365.
3218
3219         * platform/network/soup/ResourceRequestSoup.cpp:
3220         (WebCore::ResourceRequest::updateSoupMessageBody const): Remove return.
3221
3222 2018-11-09  Zalan Bujtas  <zalan@apple.com>
3223
3224         [LFC][IFC] Move some code from InlineFormattingContext::Line to InlineFormattingContext/Geometry
3225         https://bugs.webkit.org/show_bug.cgi?id=191445
3226
3227         Reviewed by Antti Koivisto.
3228
3229         The idea here is that Line should not have to deal with all the post processig tasks like the runs final aligments.
3230         (The line class would eventually turn into a collection of random things).
3231
3232         * layout/inlineformatting/InlineFormattingContext.cpp:
3233         (WebCore::Layout::InlineFormattingContext::closeLine const):
3234         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
3235         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3236         * layout/inlineformatting/InlineFormattingContext.h:
3237         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
3238         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const):
3239         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3240         (WebCore::Layout::InlineFormattingContext::Geometry::adjustedLineLogicalLeft):
3241         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
3242         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
3243         * layout/inlineformatting/Line.cpp:
3244         (WebCore::Layout::InlineFormattingContext::Line::Line):
3245         (WebCore::Layout::InlineFormattingContext::Line::init):
3246         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
3247         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3248         (WebCore::Layout::InlineFormattingContext::Line::close):
3249         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
3250         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): Deleted.
3251         (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): Deleted.
3252         (WebCore::Layout::InlineFormattingContext::Line::justifyRuns): Deleted.
3253
3254 2018-11-09  Philippe Normand  <pnormand@igalia.com>
3255
3256         Unreviewed, GStreamer build warning fix
3257
3258         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3259         (WebCore::GStreamerVideoEncoder::newSampleCallback): Timesamp()
3260         returns a uint32_t, fix format string accordingly.
3261
3262 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3263
3264         Add an SPI to allow WebView clients to add additional supported image formats
3265         https://bugs.webkit.org/show_bug.cgi?id=190454
3266
3267         Reviewed by Simon Fraser.
3268
3269         Add an SPI to allow additional supported image formats in WebView. These
3270         additional formats can be set in the WKWebViewConfiguration as an NSArray
3271         of NStrings. Each string represents an image source type aka UTI.
3272
3273         The ImageSourceType in the functions' names will be replaced by ImageType.
3274         ImageType in this context is the image UTI (Uniform Type Identifier).
3275
3276         * platform/MIMETypeRegistry.cpp:
3277         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
3278         (WebCore::MIMETypeRegistry::additionalSupportedImageMIMETypes):
3279         (WebCore::supportedImageMIMETypesForEncoding):
3280         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
3281         * platform/MIMETypeRegistry.h:
3282         * platform/graphics/cg/ImageDecoderCG.cpp:
3283         (WebCore::ImageDecoderCG::filenameExtension const):
3284         (WebCore::ImageDecoderCG::encodedDataStatus const):
3285         * platform/graphics/cg/ImageSourceCG.h:
3286         * platform/graphics/cg/ImageSourceCGMac.mm:
3287         (WebCore::MIMETypeForImageType):
3288         (WebCore::preferredExtensionForImageType):
3289         (WebCore::MIMETypeForImageSourceType): Deleted.
3290         (WebCore::preferredExtensionForImageSourceType): Deleted.
3291         * platform/graphics/cg/ImageSourceCGWin.cpp:
3292         (WebCore::MIMETypeForImageType):
3293         (WebCore::preferredExtensionForImageType):
3294         (WebCore::MIMETypeForImageSourceType): Deleted.
3295         (WebCore::preferredExtensionForImageSourceType): Deleted.
3296         * platform/graphics/cg/UTIRegistry.cpp:
3297         (WebCore::defaultSupportedImageTypes):
3298         (WebCore::additionalSupportedImageTypes):
3299         (WebCore::setAdditionalSupportedImageTypes):
3300         (WebCore::isSupportedImageType):
3301         (WebCore::supportedDefaultImageSourceTypes): Deleted.
3302         (WebCore::isSupportImageSourceType): Deleted.
3303         * platform/graphics/cg/UTIRegistry.h:
3304
3305 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
3306
3307         Adopt Reveal Framework to replace Lookup
3308         https://bugs.webkit.org/show_bug.cgi?id=191097
3309
3310         Reviewed by Tim Horton.
3311
3312         Reveal is not currently testable.
3313
3314         The Reveal framework does the same job as Lookup and DataDectors.
3315         In this patch we switch from using Lookup to determine what text
3316         to select and define to using Reveal and RVItems. Since this
3317         code needs to work on older systems, and Reveal is newer, we also need
3318         to keep around the old code for old systems so that they can also
3319         continue to work. Eventually we will remove this code and also likly switch
3320         to passing RVItems across from the web process rather than making them
3321         on each side.
3322
3323         * SourcesCocoa.txt:
3324         * WebCore.xcodeproj/project.pbxproj:
3325         * editing/mac/DictionaryLookup.h:
3326         * editing/mac/DictionaryLookup.mm:
3327
3328         Create a delegate to respond to Reveal and help draw the string or highlight.
3329
3330         (-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]):
3331         (-[WebRevealHighlight setClearTextIndicator:]):
3332         (-[WebRevealHighlight revealContext:rectsForItem:]):
3333         (-[WebRevealHighlight revealContext:drawRectsForItem:]):
3334         (-[WebRevealHighlight revealContext:shouldUseDefaultHighlightForItem:]):
3335         (-[WebRevealHighlight revealContext:stopHighlightingItem:]):
3336         (WebCore::showPopupOrCreateAnimationController):
3337
3338         Unify the code paths and utalize the Reveal framework to create and/or display the popovers.
3339
3340         (WebCore::DictionaryLookup::showPopup):
3341         (WebCore::DictionaryLookup::animationControllerForPopup):
3342
3343         Pipe the new callback through.
3344
3345         (WebCore::tokenRange): Deleted.
3346
3347         Only used with Lookup
3348
3349         (WebCore::selectionContainsPosition): Deleted.
3350
3351         Only used with Lookup.
3352
3353         * editing/mac/DictionaryLookupLegacy.mm: Copied from Source/WebCore/editing/mac/DictionaryLookup.mm.
3354
3355         Keep a copy of the previous implementation of DictionaryLookup, because Reveal not available on older
3356         system.
3357
3358         (WebCore::tokenRange):
3359         (WebCore::selectionContainsPosition):
3360         (WebCore::expandSelectionByCharacters):
3361         (WebCore::showPopupOrCreateAnimationController):
3362         (WebCore::DictionaryLookup::showPopup):
3363         (WebCore::DictionaryLookup::hidePopup):
3364         (WebCore::DictionaryLookup::animationControllerForPopup):
3365
3366 2018-11-08  Keith Rollin  <krollin@apple.com>
3367
3368         Create .xcfilelist files
3369         https://bugs.webkit.org/show_bug.cgi?id=191324
3370         <rdar://problem/45852819>
3371
3372         Reviewed by Alex Christensen.
3373
3374         As part of preparing for enabling XCBuild, create and use .xcfilelist
3375         files. These files are using during Run Script build phases in an
3376         Xcode project. If a Run Script build phase produces new files that are
3377         used later as inputs to subsequent build phases, XCBuild needs to know
3378         about these files. These files can be either specified in an "output
3379         files" section of the Run Script phase editor, or in .xcfilelist files
3380         that are associated with the Run Script build phase.
3381
3382         This patch takes the second approach. It consists of three sets of changes:
3383
3384         - Modify the DerivedSources.make files to have a
3385           'print_all_generated_files" target that produces a list of the files
3386           they create.
3387
3388         - Create a shell script that produces .xcfilelist files from the
3389           output of the previous step, as well as for the files created in the
3390           Generate Unified Sources build steps.
3391
3392         - Add the new .xcfilelist files to the associated projects.
3393
3394         Note that, with these changes, the Xcode workspace and projects can no
3395         longer be fully loaded into Xcode 9. Xcode will attempt to load the
3396         projects that have .xcfilelist files associated with them, but will
3397         fail and display a placeholder for those projects instead. It's
3398         expected that all developers are using Xcode 10 by now and that not
3399         being able to load into Xcode 9 is not a practical issue. Keep in mind
3400         that this is strictly an IDE issue, and that the projects can still be
3401         built with `xcodebuild`.
3402
3403         Also note that the shell script that creates the .xcfilelist files can
3404         also be used to verify that the set of files that's currently checked
3405         in is up-to-date. This checking can be used as part of a check-in hook
3406         or part of check-webkit-style to sooner catch cases where the
3407         .xcfilelist files need to be regenerated.
3408
3409         No new tests -- no changed functionality.
3410
3411         * DerivedSources.make:
3412         * DerivedSources.xcfilelist: Added.
3413         * UnifiedSources.xcfilelist: Added.
3414         * WebCore.xcodeproj/project.pbxproj:
3415
3416 2018-11-08  Don Olmstead  <don.olmstead@sony.com>
3417
3418         Provide generic implementation of SSLKeyGenerator functions
3419         https://bugs.webkit.org/show_bug.cgi?id=191428
3420
3421         Reviewed by Michael Catanzaro.
3422
3423         No new tests. No change in behavior.
3424
3425         Both SSLKeyGeneratorGLib and SSLKeyGeneratorIOS were stub
3426         implementations. Since <keygen> is deprecated it looks unlikely that
3427         an implementation is actually needed, however an implementation is
3428         needed until support is reomved.
3429
3430         * Sources.txt:
3431         * SourcesCocoa.txt:
3432         * WebCore.xcodeproj/project.pbxproj:
3433         * platform/SSLKeyGenerator.cpp: Added.
3434         (WebCore::getSupportedKeySizes):
3435         (WebCore::signedPublicKeyAndChallengeString):
3436         * platform/SourcesGLib.txt:
3437         * platform/glib/SSLKeyGeneratorGLib.cpp: Removed.
3438         * platform/ios/SSLKeyGeneratorIOS.cpp: Removed.
3439
3440 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
3441
3442         Unprefix text-decoration CSS3 properties
3443         https://bugs.webkit.org/show_bug.cgi?id=127193
3444
3445         Reviewed by Dean Jackson.
3446
3447         The properties are stable, and there is interop.
3448
3449         Test: fast/css3-text/css3-text-decoration/unprefix.html
3450
3451         * css/CSSComputedStyleDeclaration.cpp:
3452         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3453         * css/CSSProperties.json:
3454         * css/StyleResolver.cpp:
3455         (WebCore::shouldApplyPropertyInParseOrder):
3456         (WebCore::isValidVisitedLinkProperty):
3457         * css/parser/CSSParserFastPaths.cpp:
3458         (WebCore::isColorPropertyID):
3459         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3460         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3461         * css/parser/CSSPropertyParser.cpp:
3462         (WebCore::CSSPropertyParser::parseSingleValue):
3463         * editing/cocoa/DataDetection.mm:
3464         (WebCore::DataDetection::detectContentInRange):
3465         * rendering/TextDecorationPainter.cpp:
3466         (WebCore::decorationColor):
3467         * rendering/style/RenderStyle.cpp:
3468         (WebCore::RenderStyle::colorIncludingFallback const):
3469         (WebCore::RenderStyle::visitedDependentColor const):
3470
3471 2018-11-08  Timothy Hatcher  <timothy@apple.com>
3472
3473         Add experimental support for a `supported-color-schemes` CSS property.
3474         https://bugs.webkit.org/show_bug.cgi?id=191319
3475         rdar://problem/45852261
3476
3477         Reviewed by Dean Jackson.
3478
3479         Tests: css-dark-mode/parse-supported-color-schemes.html
3480                css-dark-mode/supported-color-schemes-css.html
3481
3482         * WebCore.xcodeproj/project.pbxproj:
3483         * css/CSSComputedStyleDeclaration.cpp:
3484         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3485         * css/CSSProperties.json:
3486         * css/CSSValueKeywords.in:
3487         * css/StyleBuilderConverter.h:
3488         (WebCore::StyleBuilderConverter::updateSupportedColorSchemes):
3489         (WebCore::StyleBuilderConverter::convertSupportedColorSchemes):
3490         * css/StyleResolver.cpp:
3491         (WebCore::StyleResolver::colorFromPrimitiveValue const):
3492         * css/parser/CSSPropertyParser.cpp:
3493         (WebCore::consumeSupportedColorSchemes):
3494         (WebCore::CSSPropertyParser::parseSingleValue):
3495         * dom/Document.cpp:
3496         (WebCore::Document::resetLinkColor):
3497         (WebCore::Document::resetVisitedLinkColor):
3498         (WebCore::Document::resetActiveLinkColor):
3499         (WebCore::Document::processSupportedColorSchemes):
3500         (WebCore::Document::useDarkAppearance const):
3501         (WebCore::Document::styleColorOptions const):
3502         * dom/Document.h:
3503         * editing/cocoa/WebContentReaderCocoa.mm:
3504         (WebCore::createFragment):
3505         * html/canvas/CanvasRenderingContext2D.cpp:
3506         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
3507         * inspector/InspectorOverlay.cpp:
3508         (WebCore::InspectorOverlay::paint):
3509         * page/FrameView.cpp:
3510         (WebCore::FrameView::useDarkAppearance const):
3511         (WebCore::FrameView::paintScrollCorner):
3512         * platform/mac/DragImageMac.mm:
3513         (WebCore::createDragImageForLink):
3514         * rendering/InlineFlowBox.cpp:
3515         (WebCore::InlineFlowBox::paintBoxDecorations):
3516         * rendering/InlineTextBox.cpp:
3517         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
3518         * rendering/RenderBox.cpp:
3519         (WebCore::RenderBox::paintRootBoxFillLayers):
3520         (WebCore::RenderBox::paintBackground):
3521         * rendering/RenderElement.cpp:
3522         (WebCore::RenderElement::selectionColor const):
3523         (WebCore::RenderElement::selectionBackgroundColor const):
3524         (WebCore::RenderElement::paintFocusRing):
3525         * rendering/RenderImage.cpp:
3526         (WebCore::RenderImage::paintAreaElementFocusRing):
3527         * rendering/RenderLayerBacking.cpp:
3528         (WebCore::RenderLayerBacking::paintContents):
3529         * rendering/RenderLayerCompositor.cpp:
3530         (WebCore::RenderLayerCompositor::paintContents):
3531         * rendering/RenderListBox.cpp:
3532         (WebCore::RenderListBox::paintItemForeground):
3533         (WebCore::RenderListBox::paintItemBackground):
3534         * rendering/RenderObject.cpp:
3535         (WebCore::RenderObject::useDarkAppearance const):
3536         (WebCore::RenderObject::styleColorOptions const):
3537         * rendering/RenderObject.h:
3538         * rendering/RenderTableCell.cpp:
3539         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
3540         * rendering/RenderTheme.cpp:
3541         (WebCore::RenderTheme::paint):
3542         * rendering/RenderTheme.h:
3543         (WebCore::RenderTheme::usingDarkAppearance const): Deleted.
3544         * rendering/RenderThemeMac.h:
3545         * rendering/RenderThemeMac.mm:
3546         (WebCore::RenderThemeMac::documentViewFor const):
3547         (WebCore::RenderThemeMac::adjustMenuListStyle const):
3548         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
3549         (WebCore::RenderThemeMac::paintSliderThumb):
3550         (WebCore::RenderThemeMac::usingDarkAppearance const): Deleted.
3551         * rendering/style/RenderStyle.h:
3552         (WebCore::RenderStyle::supportedColorSchemes const):
3553         (WebCore::RenderStyle::setSupportedColorSchemes):
3554         (WebCore::RenderStyle::initialSupportedColorSchemes):
3555         * rendering/style/RenderStyleConstants.h:
3556         * rendering/style/StyleRareInheritedData.cpp:
3557         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3558         (WebCore::StyleRareInheritedData::operator== const):
3559         * rendering/style/StyleRareInheritedData.h:
3560         * rendering/style/StyleSupportedColorSchemes.h: Added.
3561         (WebCore::StyleSupportedColorSchemes::StyleSupportedColorSchemes):
3562         (WebCore::StyleSupportedColorSchemes::operator== const):
3563         (WebCore::StyleSupportedColorSchemes::operator!= const):
3564         (WebCore::StyleSupportedColorSchemes::isAuto const):
3565         (WebCore::StyleSupportedColorSchemes::isOnly const):
3566         (WebCore::StyleSupportedColorSchemes::colorSchemes const):
3567         (WebCore::StyleSupportedColorSchemes::add):
3568         (WebCore::StyleSupportedColorSchemes::contains const):
3569         (WebCore::StyleSupportedColorSchemes::setAllowsTransformations):
3570         (WebCore::StyleSupportedColorSchemes::allowsTransformations const):
3571         * svg/graphics/SVGImage.cpp:
3572         (WebCore::SVGImage::draw):
3573
3574 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
3575
3576         Web Inspector: Restrict domains at the target level instead of only at the window level
3577         https://bugs.webkit.org/show_bug.cgi?id=191344
3578
3579         Reviewed by Devin Rousso.
3580
3581         * inspector/WorkerInspectorController.cpp:
3582         (WebCore::WorkerInspectorController::WorkerInspectorController):
3583         Remove Inspector domain from workers. It was unused anyways.
3584
3585 2018-11-08  Dean Jackson  <dino@apple.com>
3586
3587         Add a String literal that returns a String
3588         https://bugs.webkit.org/show_bug.cgi?id=191425
3589         <rdar://problem/45914556>
3590
3591         Reviewed by Sam Weinig.
3592
3593         Use _str where possible.
3594
3595         API Test in WPT.
3596
3597         * Modules/fetch/FetchRequest.cpp:
3598         (WebCore::computeReferrer):
3599         * Modules/indexeddb/IDBKeyPath.cpp:
3600         (WebCore::loggingString):
3601         * Modules/webdatabase/OriginLock.cpp:
3602         (WebCore::OriginLock::lockFileNameForPath):
3603         * css/CSSBasicShapes.cpp:
3604         (WebCore::updateCornerRadiusWidthAndHeight):
3605         * html/canvas/WebGL2RenderingContext.cpp:
3606         (WebCore::WebGL2RenderingContext::getParameter):
3607         * html/canvas/WebGLRenderingContext.cpp:
3608         (WebCore::WebGLRenderingContext::getParameter):
3609         * loader/LinkHeader.cpp:
3610         (WebCore::parseParameterValue):
3611         * loader/LinkLoader.cpp:
3612         (WebCore::LinkLoader::preloadIfNeeded):
3613         * page/NavigatorBase.cpp:
3614         (WebCore::NavigatorBase::platform):
3615         * platform/DateComponents.cpp:
3616         (WebCore::DateComponents::toString const):
3617         * platform/mac/PlatformEventFactoryMac.mm:
3618         (WebCore::keyIdentifierForKeyEvent):
3619         * rendering/RenderListMarker.cpp:
3620         (WebCore::RenderListMarker::suffix const):
3621         * rendering/RenderMenuList.cpp:
3622         (RenderMenuList::setText):
3623         * testing/InternalSettings.cpp:
3624         (WebCore::InternalSettings::userInterfaceDirectionPolicy):
3625         (WebCore::InternalSettings::systemLayoutDirection):
3626         * testing/Internals.cpp:
3627         (WebCore::Internals::shadowRootType const):
3628         (WebCore::Internals::getCurrentCursorInfo):
3629
3630 2018-11-08  Jonathan Hammer  <jonathan@e3software.com>
3631
3632         Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
3633         https://bugs.webkit.org/show_bug.cgi?id=191228
3634         <rdar://problem/45786830>
3635
3636         Reviewed by Wenson Hsieh.
3637
3638         DragController::beginDrag should not call cleanupAfterSystemDrag because
3639         the drag is still in progress even after the call to m_client.beginDrag()
3640         returns. This is in contrast to DragController::doSystemDrag, where the
3641         call to cleanupAfterSystemDrag is appropriate because the drag has
3642         concluded by the time m_client.startDrag() returns.
3643
3644         Test: fast/events/drag-and-drop-move-not-copy.html
3645
3646         * page/DragController.cpp:
3647         (WebCore::DragController::beginDrag):
3648
3649 2018-11-08  Zalan Bujtas  <zalan@apple.com>
3650
3651         [BFC][IFC] InlineFormattingContext::Line::alignRuns() should take care of all the alignments.
3652         https://bugs.webkit.org/show_bug.cgi?id=191414
3653
3654         Reviewed by Antti Koivisto.
3655
3656         * layout/inlineformatting/Line.cpp:
3657         (WebCore::Layout::InlineFormattingContext::Line::close):
3658
3659 2018-11-08  Jiewen Tan  <jiewen_tan@apple.com>
3660
3661         [WebAuthN] Import CTAP device request/response converters from Chromium
3662         https://bugs.webkit.org/show_bug.cgi?id=190784
3663         <rdar://problem/45460333>
3664
3665         Reviewed by Brent Fulgham.
3666
3667         This patch imports Chromium's CTAP device request/response converters:
3668         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-encoding
3669         1. It directly imports the following files and suit them to WebKit's coding style:
3670         https://cs.chromium.org/chromium/src/device/fido/device_response_converter.cc?l=20&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3671         https://cs.chromium.org/chromium/src/device/fido/device_response_converter.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3672         https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3673         https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3674         https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3675         https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3676         https://cs.chromium.org/chromium/src/device/fido/ctap_request_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3677         https://cs.chromium.org/chromium/src/device/fido/ctap_response_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3678         https://cs.chromium.org/chromium/src/device/fido/fido_test_data.h?l=1&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3679         2. It gathers the following methods into DeviceRequestConverter:
3680         CtapGetAssertionRequest::EncodeAsCBOR()
3681         CtapMakeCredentialRequest::EncodeAsCBOR()
3682         PublicKeyCredentialDescriptor::ConvertToCBOR()
3683         PublicKeyCredentialParams::ConvertToCBOR()
3684         PublicKeyCredentialRpEntity::ConvertToCBOR()
3685         PublicKeyCredentialUserEntity::ConvertToCBOR()
3686         3. It also apply a patch from Chromium to CBORValue:
3687         https://chromium.googlesource.com/chromium/src/+/7b6fbff35cd8e4d508f08e1cd93b4aa0a0dc402c%5E%21/
3688
3689         Besides importing things from Chromium, it also implements UserVerificationRequirement for both
3690         PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions such that both options
3691         can specify more dimensions of a desired authenticator.
3692
3693         Covered by API tests.
3694
3695         * CMakeLists.txt:
3696         * DerivedSources.make:
3697         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3698         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode const):
3699         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
3700         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
3701         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
3702         (WebCore::PublicKeyCredentialRequestOptions::encode const):
3703         (WebCore::PublicKeyCredentialRequestOptions::decode):
3704         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
3705         * Modules/webauthn/UserVerificationRequirement.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
3706         * Modules/webauthn/UserVerificationRequirement.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
3707         * Modules/webauthn/cbor/CBORValue.cpp:
3708         (cbor::CBORValue::CBORValue):
3709         (cbor::CBORValue::getBool const):
3710         * Modules/webauthn/cbor/CBORValue.h:
3711         * Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp: Added.
3712         (fido::toArrayValue):
3713         (fido::AuthenticatorGetInfoResponse::AuthenticatorGetInfoResponse):
3714         (fido::AuthenticatorGetInfoResponse::setMaxMsgSize):
3715         (fido::AuthenticatorGetInfoResponse::setPinProtocols):
3716         (fido::AuthenticatorGetInfoResponse::setExtensions):
3717         (fido::AuthenticatorGetInfoResponse::setOptions):
3718         (fido::encodeAsCBOR):
3719         * Modules/webauthn/fido/AuthenticatorGetInfoResponse.h: Added.
3720         * Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp: Added.
3721         (fido::AuthenticatorSupportedOptions::setSupportsResidentKey):
3722         (fido::AuthenticatorSupportedOptions::setUserVerificationAvailability):
3723         (fido::AuthenticatorSupportedOptions::setUserPresenceRequired):
3724         (fido::AuthenticatorSupportedOptions::setClientPinAvailability):
3725         (fido::AuthenticatorSupportedOptions::setIsPlatformDevice):
3726         (fido::convertToCBOR):
3727         * Modules/webauthn/fido/AuthenticatorSupportedOptions.h: Added.
3728         * Modules/webauthn/fido/DeviceRequestConverter.cpp: Added.
3729         (fido::convertRpEntityToCBOR):
3730         (fido::convertUserEntityToCBOR):
3731         (fido::convertParametersToCBOR):
3732         (fido::convertDescriptorToCBOR):
3733         (fido::encodeMakeCredenitalRequestAsCBOR):
3734         (fido::encodeGetAssertionRequestAsCBOR):
3735         (fido::encodeEmptyAuthenticatorRequest):
3736         * Modules/webauthn/fido/DeviceRequestConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.h.
3737         * Modules/webauthn/fido/DeviceResponseConverter.cpp: Added.
3738         (fido::convertStringToProtocolVersion):
3739         (fido::getResponseCode):
3740         (fido::getCredentialId):
3741         (fido::readCTAPMakeCredentialResponse):
3742         (fido::readCTAPGetAssertionResponse):
3743         (fido::readCTAPGetInfoResponse):
3744         * Modules/webauthn/fido/DeviceResponseConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp.
3745         * Modules/webauthn/fido/FidoConstants.cpp:
3746         (fido::isCtapDeviceResponseCode):
3747         (fido::publicKeyCredentialTypeToString):
3748         * Modules/webauthn/fido/FidoConstants.h:
3749         * Sources.txt:
3750         * WebCore.xcodeproj/project.pbxproj:
3751
3752 2018-11-07  Justin Michaud  <justin_michaud@apple.com>
3753
3754         CSS Painting API should pass size, arguments and input properties to paint callback
3755         https://bugs.webkit.org/show_bug.cgi?id=191309
3756
3757         Reviewed by Chris Dumez.
3758
3759         Call paint() callback with input properties and arguments. This patch adds a stub for 
3760         the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without 
3761         any syntax checking to the paint callback.
3762
3763         Test: fast/css-custom-paint/properties.html
3764
3765         * CMakeLists.txt:
3766         * DerivedSources.make:
3767         * Sources.txt:
3768         * WebCore.xcodeproj/project.pbxproj:
3769         * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
3770         (WebCore::toJSNewlyCreated):
3771         (WebCore::toJS):
3772         * bindings/js/WebCoreBuiltinNames.h:
3773         * css/CSSPaintCallback.h:
3774         * css/CSSPaintCallback.idl:
3775         * css/CSSPaintImageValue.cpp:
3776         (WebCore::CSSPaintImageValue::image):
3777         * css/CSSPaintImageValue.h:
3778         * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
3779         (WebCore::CSSPaintSize::create):
3780         (WebCore::CSSPaintSize::width const):
3781         (WebCore::CSSPaintSize::height const):
3782         (WebCore::CSSPaintSize::CSSPaintSize):
3783         * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
3784         * css/parser/CSSPropertyParserHelpers.cpp:
3785         (WebCore::CSSPropertyParserHelpers::consumeCustomPaint):
3786         * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
3787         * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
3788         * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
3789         (WebCore::CSSStyleValue::isUnitValue):
3790         (WebCore::CSSStyleValue::isUnparsedValue):
3791         * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
3792         * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
3793         * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
3794         * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
3795         * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
3796         * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
3797         (WebCore::StylePropertyMapReadOnly::create):
3798         (WebCore::StylePropertyMapReadOnly::get):
3799         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
3800         * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
3801         * platform/graphics/CustomPaintImage.cpp:
3802         (WebCore::CustomPaintImage::CustomPaintImage):
3803         (WebCore::CustomPaintImage::doCustomPaint):
3804         * platform/graphics/CustomPaintImage.h:
3805
3806 2018-11-07  Brent Fulgham  <bfulgham@apple.com>
3807
3808         Provide better Font fallbacks for DirectX backend
3809         https://bugs.webkit.org/show_bug.cgi?id=191412
3810         <rdar://problem/45899207>
3811
3812         Reviewed by Zalan Bujtas.
3813
3814         Registration of custom fonts through GDI are not always visible
3815         through the DirectWrite/GDI bridging layer. If a font is not located,
3816         locate the closest matching avialable font rather than failing.
3817
3818         * platform/graphics/FontPlatformData.h:
3819         * platform/graphics/win/FontCustomPlatformData.cpp:
3820         (WebCore::FontCustomPlatformData::fontPlatformData): Use new font
3821         fallback logic.
3822         * platform/graphics/win/FontPlatformDataDirect2D.cpp:
3823         (WebCore::FontPlatformData::platformDataInit):
3824         (WebCore::FontPlatformData::platformIsEqual const):
3825         (WebCore::FontPlatformData::createFallbackFont): Added.
3826
3827 2018-11-07  Zalan Bujtas  <zalan@apple.com>
3828
3829         Click and touch event listeners on the body don't work
3830         https://bugs.webkit.org/show_bug.cgi?id=191392
3831         <rdar://problem/5844416>
3832
3833         Reviewed by Simon Fraser.
3834
3835         Remove the old quirk of ignoring onclick handlers on the body and beyond.
3836
3837         Test: fast/events/click-handler-on-body-simple.html
3838
3839         * page/ios/FrameIOS.mm:
3840         (WebCore::Frame::nodeRespondingToClickEvents):
3841
3842 2018-11-07  Brent Fulgham  <bfulgham@apple.com>
3843
3844         [Windows][DirectX] Update canvas code to pass more tests
3845         https://bugs.webkit.org/show_bug.cgi?id=191337
3846         <rdar://problem/45878801>
3847
3848         Reviewed by Dean Jackson.
3849
3850         Update the Direct2D code paths to comply with our canvas tests, improving the
3851         the test results scores to 579/770.
3852
3853         PathDirect2D was updated with an implementation of 'addArcTo' based on work by
3854         Dirk Schulze <vbs85@gmx.de> (see https://hg.mozilla.org/mozilla-central/rev/b116b49459f8).
3855
3856         Tests: canvas/philip/tests
3857
3858         * platform/graphics/ImageBuffer.cpp:
3859         (WebCore::ImageBuffer::createCompatibleBuffer): Direct2D needs access to the graphics
3860         context to create the buffer.
3861         * platform/graphics/ImageBuffer.h:
3862         * platform/graphics/Path.h:
3863         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3864         (WebCore::GraphicsContext::drawPattern): Flush needed.
3865         (WebCore::GraphicsContext::drawRect): Ditto.
3866         (WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Correct for Direct2D definition of miter limit.
3867         (WebCore::GraphicsContextPlatformPrivate::strokeStyleProperties const): Added helper function.
3868         (WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Update for new helper.
3869         (WebCore::GraphicsContext::drawLine): Ditto.
3870         (WebCore::drawWithShadowHelper): Ditto.
3871         (WebCore::GraphicsContext::fillRect): Add flush.
3872         (WebCore::GraphicsContext::platformFillRoundedRect): Update for helper.
3873         (WebCore::GraphicsContext::clipPath): Add flush.
3874         (WebCore::GraphicsContext::strokeRect): Ditto.
3875         (WebCore::GraphicsContext::drawLineForText): Update for upstream changes.
3876         (WebCore::GraphicsContext::drawLinesForText): Ditto.
3877         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
3878         * platform/graphics/win/ImageBufferDirect2D.cpp:
3879         (WebCore::createCroppedImageIfNecessary): Add missing implementations.
3880         (WebCore::createBitmapImageAfterScalingIfNeeded): Ditto.
3881         (WebCore::ImageBuffer::copyImage const): Ditto.
3882         (WebCore::ImageBuffer::sinkIntoImage): Ditto.
3883         (WebCore::ImageBuffer::fastCopyImageMode): Ditto.
3884         (WebCore::ImageBuffer::sinkIntoNativeImage): Ditto.
3885         (WebCore::ImageBuffer::copyNativeImage const): Ditto.
3886         * platform/graphics/win/PathDirect2D.cpp:
3887         (WebCore::Path::operator=):
3888         (WebCore::Path::drawDidComplete): This should never have been const.
3889         It manipulates the path!
3890         (WebCore::Path::transform): Properly transform existing geometries.
3891         (WebCore::Path::openFigureAtCurrentPointIfNecessary): Added.
3892         (WebCore::Path::moveTo):
3893         (WebCore::Path::addLineTo): Make sure figure starts at a valid point.
3894         (WebCore::Path::addQuadCurveTo): Ditto.
3895         (WebCore::Path::addBezierCurveTo): Ditto.
3896         (WebCore::Path::addArcTo): Add implementation.
3897         (WebCore::Path::closeSubpath):
3898         (WebCore::drawArcSection):
3899         (WebCore::Path::addArc): Update to build large arcs out of small arc segments. If the
3900         arc is effectively a complete circle, use the ellipse drawing routines.
3901         (WebCore::Path::addRect): Make sure we start at a valid starting point.
3902         (WebCore::Path::addEllipse): Correct for definition of D2D ellipse.
3903         (WebCore::Path::drawDidComplete const): Deleted.
3904         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
3905         (WebCore::Font::platformWidthForGlyph const):
3906         * rendering/svg/RenderSVGResourceClipper.cpp:
3907         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
3908         * rendering/svg/RenderSVGResourceFilter.cpp:
3909         (WebCore::RenderSVGResourceFilter::applyResource):
3910         * rendering/svg/RenderSVGResourceMasker.cpp:
3911         (WebCore::RenderSVGResourceMasker::applyResource):
3912         * rendering/svg/SVGRenderingContext.cpp:
3913         (WebCore::SVGRenderingContext::createImageBuffer):
3914         * rendering/svg/SVGRenderingContext.h:
3915
3916 2018-11-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3917
3918         Add an editing command for creating and inserting child lists
3919         https://bugs.webkit.org/show_bug.cgi?id=191335
3920         <rdar://problem/45814050>
3921
3922         Reviewed by Ryosuke Niwa.
3923
3924         Currently, insertOrderedList and insertUnorderedList only toggle or change list state (i.e. if the selection is
3925         in an ordered or unordered list, reinserting the same list type removes the current list, and inserting a
3926         different list type changes the enclosing list).
3927
3928         However, for certain internal clients (e.g. Mail), if the start of the selection is enclosed by a list item, we
3929         instead create a new list item and insert it after the enclosing list item, and then create a new list within
3930         that list item. Currently, this logic is implemented in Mail for legacy-WebKit-based Mail compose. This patch
3931         brings this logic into WebKit in the form of a new editing command.
3932
3933         Tests: editing/execCommand/insert-nested-lists-in-table.html
3934                editing/execCommand/insert-nested-lists-with-pre.html
3935                editing/execCommand/insert-nested-lists.html
3936
3937         * Sources.txt:
3938         * WebCore.xcodeproj/project.pbxproj:
3939         * editing/Editor.cpp:
3940         (WebCore::Editor::insertOrderedList):
3941         (WebCore::Editor::insertUnorderedList):
3942         * editing/EditorCommand.cpp:
3943         (WebCore::executeInsertOrderedList):
<