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