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