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