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