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