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