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