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