Convert libwebrtc error types to DOM exceptions
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-14  Youenn Fablet  <youenn@apple.com>
2
3         Convert libwebrtc error types to DOM exceptions
4         https://bugs.webkit.org/show_bug.cgi?id=191590
5
6         Reviewed by Alex Christensen.
7
8         Make use of overloaded callback method that provides an error type.
9         This type is then used to create a DOM exception with the correct type.
10         Covered by existing tests.
11
12         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
13         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
14         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
15         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
16         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
17         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
18         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
19         (WebCore::toExceptionCode):
20
21 2018-11-14  Youenn Fablet  <youenn@apple.com>
22
23         Allow to remove MediaStreamPrivate observers when iterating over observers
24         https://bugs.webkit.org/show_bug.cgi?id=187256
25
26         Reviewed by Eric Carlson.
27
28         Migrate the observer list from a Vector to a HashSet.
29         This is more robust to multiple observing and keeping of order of observers is not required.
30         Copy the set of observers to a vector before iterating over it.
31         This allows to remove an observer while iterating, which is now used in UserMediaRequest.
32
33         Covered by existing tests.
34
35         * Modules/mediastream/UserMediaRequest.cpp:
36         (WebCore::UserMediaRequest::mediaStreamIsReady):
37         * platform/mediastream/MediaStreamPrivate.cpp:
38         (WebCore::MediaStreamPrivate::addObserver):
39         (WebCore::MediaStreamPrivate::removeObserver):
40         (WebCore::MediaStreamPrivate::forEachObserver const):
41         (WebCore::MediaStreamPrivate::updateActiveState):
42         (WebCore::MediaStreamPrivate::addTrack):
43         (WebCore::MediaStreamPrivate::removeTrack):
44         (WebCore::MediaStreamPrivate::characteristicsChanged):
45         * platform/mediastream/MediaStreamPrivate.h:
46
47 2018-11-14  Youenn Fablet  <youenn@apple.com>
48
49         Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
50         https://bugs.webkit.org/show_bug.cgi?id=191603
51
52         Reviewed by Chris Dumez.
53
54         Make sure to check that the sender peer connection backend is matching.
55         Covered by rebased WPT test.
56
57         * Modules/mediastream/RTCPeerConnection.cpp:
58         (WebCore::RTCPeerConnection::removeTrack):
59         * Modules/mediastream/RTCRtpSender.cpp:
60         (WebCore::RTCRtpSender::isCreatedBy const):
61         * Modules/mediastream/RTCRtpSender.h:
62
63 2018-11-14  Fujii Hironori  <Hironori.Fujii@sony.com>
64
65         [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
66         https://bugs.webkit.org/show_bug.cgi?id=191620
67
68         Reviewed by Alex Christensen.
69
70         Remove a abstract class CookieJarCurl which is not needed anymore.
71         And, rename CookieJarCurlDatabase to CookieJarCurl.
72
73         No new tests because there's no behaviour change in WebCore.
74
75         * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
76         * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
77         * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
78         * platform/network/curl/CookieJarCurlDatabase.h: Removed.
79         * platform/network/curl/NetworkStorageSessionCurl.cpp:
80         (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
81
82 2018-11-14  Christopher Reid  <chris.reid@sony.com>
83
84         [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
85         https://bugs.webkit.org/show_bug.cgi?id=191606
86
87         Reviewed by Michael Catanzaro.
88
89         No behavior change.
90
91         Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
92
93         * platform/wpe/PlatformKeyboardEventWPE.cpp:
94         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
95         (WebCore::PlatformKeyboardEvent::singleCharacterString):
96
97 2018-11-13  Zalan Bujtas  <zalan@apple.com>
98
99         [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
100         https://bugs.webkit.org/show_bug.cgi?id=191623
101
102         Reviewed by Antti Koivisto.
103
104         This patch expands the breaking behaviour to support separate start/end breaks.
105
106         <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
107
108         input to line breaking -> <parent start middle end parent>
109         output of line breaking (considering infinite constraint) -> <parent start middle end parent>
110         due to padding, final runs -> <parent><start middle end><parent>
111
112         "parent" -> n/a
113         "start" -> BreakAtStart
114         " middle " -> n/a
115         "end" -> BreakAtEnd
116         "parent" -> n/a
117
118         Another example:
119         <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
120
121         line breaking -> <parent start middle end parent>
122         due to padding-right, final runs -> <parent start middle end><parent>
123
124         "parent" -> n/a
125         "start" -> n/a
126         " middle " -> n/a
127         "end" -> BreakAtEnd
128         "parent" -> n/a
129
130         * layout/inlineformatting/InlineFormattingContext.cpp:
131         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
132         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
133         (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
134         * layout/inlineformatting/InlineFormattingContext.h:
135         * layout/inlineformatting/InlineFormattingState.cpp:
136         (WebCore::Layout::InlineFormattingState::detachingRules const):
137         * layout/inlineformatting/InlineFormattingState.h:
138         (WebCore::Layout::InlineFormattingState::lastInlineItem const):
139         (WebCore::Layout::InlineFormattingState::addDetachingRule):
140
141 2018-11-14  Youenn Fablet  <youenn@apple.com>
142
143         Add support for RTCRtpCodecParameters.sdpFmtpLine
144         https://bugs.webkit.org/show_bug.cgi?id=191591
145
146         Reviewed by Eric Carlson.
147
148         Covered by rebased test.
149
150         * Modules/mediastream/RTCRtpCodecParameters.h:
151         * Modules/mediastream/RTCRtpCodecParameters.idl:
152         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
153         (WebCore::toRTCCodecParameters):
154
155 2018-11-14  Youenn Fablet  <youenn@apple.com>
156
157         Add support for transport and peerConnection stats
158         https://bugs.webkit.org/show_bug.cgi?id=191592
159
160         Reviewed by Alex Christensen.
161
162         Covered by rebased tests.
163
164         * Modules/mediastream/RTCStatsReport.h:
165         (WebCore::RTCStatsReport::TransportStats::TransportStats):
166         (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
167         * Modules/mediastream/RTCStatsReport.idl:
168         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
169         (WebCore::fillRTCTransportStats):
170         (WebCore::fillRTCPeerConnectionStats):
171         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
172
173 2018-11-14  Ali Juma  <ajuma@chromium.org>
174
175         Transform of composited layer not updated when layer also needs repaint
176         https://bugs.webkit.org/show_bug.cgi?id=191598
177
178         Reviewed by Simon Fraser.
179
180         Trigger a compositing geometry update whenever a RenderLayer's transform changes,
181         even when other parts of its style have changed in a way that produces a
182         StyleDifference greater than RecompositeLayer.
183
184         Test: compositing/geometry/transform-and-repaint-updates-geometry.html
185
186         * rendering/RenderLayerCompositor.cpp:
187         (WebCore::RenderLayerCompositor::layerStyleChanged):
188
189 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
190
191         [WebAuthN] Support CTAP HID authenticators on macOS
192         https://bugs.webkit.org/show_bug.cgi?id=188623
193         <rdar://problem/43353777>
194
195         Reviewed by Brent Fulgham and Chris Dumez.
196
197         This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
198         any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
199         dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
200
201         Tests: http/wpt/webauthn/ctap-hid-failure.https.html
202                http/wpt/webauthn/ctap-hid-success.https.html
203                http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
204                http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
205                http/wpt/webauthn/public-key-credential-create-success-hid.https.html
206                http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
207                http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
208                http/wpt/webauthn/public-key-credential-get-success-hid.https.html
209
210         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
211         (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
212         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
213         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
214         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
215         (fido::readCTAPGetAssertionResponse):
216         * Modules/webauthn/fido/FidoConstants.h:
217
218 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
219
220         [WebRTC] Provide default implementation of LibWebRTCProvider
221         https://bugs.webkit.org/show_bug.cgi?id=191611
222
223         Reviewed by Michael Catanzaro.
224
225         Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
226
227         * PlatformWin.cmake:
228         * platform/GStreamer.cmake:
229         * platform/SourcesGLib.txt:
230         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
231         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
232         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
233         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
234         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
235
236 2018-11-13  Timothy Hatcher  <timothy@apple.com>
237
238         Use a light scrollbar for transparent web views in dark mode.
239         https://bugs.webkit.org/show_bug.cgi?id=191559
240         rdar://problem/46000489
241
242         Reviewed by Dean Jackson.
243
244         Test: css-dark-mode/supported-color-schemes-scrollbar.html
245
246         * css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
247         * css/StyleBuilderCustom.h:
248         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
249         * editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
250         (WebCore::createFragment):
251         * inspector/InspectorOverlay.cpp:
252         (WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
253         * page/FrameView.cpp:
254         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
255         transparent web views in dark mode.
256         (WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
257         Return the body for document element renderer.
258         (WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
259         (WebCore::FrameView::styleColorOptions const): Added. Ditto.
260         * page/FrameView.h:
261         * rendering/style/RenderStyle.cpp:
262         (WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
263         * rendering/style/RenderStyle.h:
264         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
265         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
266         (WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
267         * svg/graphics/SVGImage.cpp:
268         (WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
269         * testing/Internals.cpp:
270         (WebCore::Internals::setViewIsTransparent): Added.
271         (WebCore::Internals::scrollbarOverlayStyle const): Added.
272         * testing/Internals.h:
273         * testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
274
275 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
276
277         [AppleWin] Unreviewed build fix after r238108.
278
279         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
280         (printLayer):
281         (PlatformCALayerWin::embeddedViewID const):
282         * platform/graphics/ca/win/PlatformCALayerWin.h:
283
284 2018-11-13  Youenn Fablet  <youenn@apple.com>
285
286         RTCPeerConnection.getTransceivers is not always exposing all transceivers
287         https://bugs.webkit.org/show_bug.cgi?id=191589
288
289         Reviewed by Eric Carlson.
290
291         Implement the collect transceiver algorithm using libwebrtc backend.
292         Call this algorithm everytime transceivers are retrieved from JS.
293         For Plan B, make this a no-op as this is not supported.
294         Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
295
296         Covered by existing and rebased tests.
297
298         * Modules/mediastream/PeerConnectionBackend.h:
299         (WebCore::PeerConnectionBackend::collectTransceivers):
300         * Modules/mediastream/RTCPeerConnection.cpp:
301         (WebCore::RTCPeerConnection::getSenders const):
302         (WebCore::RTCPeerConnection::getReceivers const):
303         (WebCore::RTCPeerConnection::getTransceivers const):
304         * Modules/mediastream/RTCPeerConnection.h:
305         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
306         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
307         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
308         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
309         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
310         (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
311         (WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
312         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
313         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
314         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
315
316 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
317
318         [iOS] Do not show selection UI for editable elements with opacity near zero
319         https://bugs.webkit.org/show_bug.cgi?id=191442
320         <rdar://problem/45958625>
321
322         Reviewed by Simon Fraser.
323
324         Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
325                editing/selection/ios/hide-selection-after-hiding-contenteditable.html
326                editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
327                editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
328                editing/selection/ios/hide-selection-in-hidden-contenteditable.html
329
330         * rendering/RenderObject.cpp:
331         (WebCore::RenderObject::isTransparentRespectingParentFrames const):
332
333         Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
334         frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
335         Opacity on ancestor elements is applied multiplicatively.
336
337         * rendering/RenderObject.h:
338
339 2018-11-13  Eric Carlson  <eric.carlson@apple.com>
340
341         [MediaStream] Observer AVCaptureDevice "suspended" property
342         https://bugs.webkit.org/show_bug.cgi?id=191587
343         <rdar://problem/46030598>
344
345         Reviewed by Youenn Fablet.
346
347         No new tests, AVCapture can only be tested manually.
348
349         * platform/mediastream/mac/AVCaptureDeviceManager.h:
350         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
351         (WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
352         the first time the device list is scanned.
353         (WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
354         change device availability.
355         (WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all 
356         devices and add them to the cached list.
357         (WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
358         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
359         devices.
360         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
361         (WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
362         (-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
363         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
364         (-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
365         (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
366         (WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
367         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
368         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
369         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
370
371         * platform/mediastream/mac/AVVideoCaptureSource.h:
372         * platform/mediastream/mac/AVVideoCaptureSource.mm:
373         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
374         and "suspended".
375         (WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
376         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
377         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
378
379 2018-11-13  Devin Rousso  <drousso@apple.com>
380
381         Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
382         https://bugs.webkit.org/show_bug.cgi?id=191597
383
384         Reviewed by Joseph Pecoraro.
385
386         When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
387         meaning that we may try to fetch in situations previously unexpected.
388
389         * platform/network/cocoa/ResourceResponseCocoa.mm:
390         (WebCore::ResourceResponse::platformCertificateInfo const):
391
392 2018-11-13  Timothy Hatcher  <timothy@apple.com>
393
394         Treat supported-color-schemes as the second highest priority property.
395         https://bugs.webkit.org/show_bug.cgi?id=191556
396         rdar://problem/46000076
397
398         Reviewed by Dean Jackson.
399
400         Test: css-dark-mode/supported-color-schemes-priority.html
401
402         * css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
403         * css/StyleResolver.cpp:
404         (WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
405         after -webkit-ruby-position, before other properties, so it can affect resolved colors.
406
407 2018-11-13  Charlie Turner  <cturner@igalia.com>
408
409         [EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
410         https://bugs.webkit.org/show_bug.cgi?id=191316
411
412         Reviewed by Xabier Rodriguez-Calvar.
413
414         Another preparation in patch getting ready to move the decryption
415         logic behind the CDMInstance and out of the GStreamer decryptors
416         themselves. The first step taken here is to arrange for the
417         instances to always be available in the decryptors when they need
418         to decrypt content.
419
420         In doing so, there were a number of hairy bits of code that could
421         use some abstraction, so the opportunity was taken to do that as
422         well.
423
424         Covered by tests in media/encrypted-media and
425         imported/w3c/web-platform-tests/encrypted-media.
426
427         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
428         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
429         drm-key-needed since it was not being used anywhere.
430         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
431         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
432         Factor out the parsing of decryption system information from
433         GStreamer, since it was not clear what that code was doing unless
434         you squinted pretty hard. Also remove the duplicated
435         initialization-data-encountered posting.
436         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
437         Refactored to make it a more general method and usable in more
438         situations. It now has an optional to stop it from eliding init
439         datas for a different key system. This is required the first time
440         we post them, since if a CDM instance has already been set, and if
441         the stream init datas are for different systems, we ended up never
442         posting an encrypted event.
443         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
444         Actually send a CDMInstance now when in regular playback mode.
445         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
446         Remove m_needToSendCredentials, it was not being used.
447         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
448         Refactored to use the new initializationDataEncountered.
449         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
450         Log the waiting state, since it was currently not clear what that
451         logging message was even telling you!
452         (WebCore::extractEventsAndSystemsFromMessage): Deleted.
453         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
454         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
455         (WebCore::InitData::InitData): New class that encapsulates both
456         single instantiation and streaming instantiation.
457         (WebCore::InitData::append): Used for the streaming mode, when you
458         are concatenating init datas together.
459         (WebCore::InitData::payload const):
460         (WebCore::InitData::systemId const):
461         (WebCore::InitData::payloadContainerType const):
462         (WebCore::InitData::isFromDifferentContainer):
463         (WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
464         (WebCore::ProtectionSystemEvents::events const):
465         (WebCore::ProtectionSystemEvents::availableSystems const):
466         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
467         (webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
468         waiting-for-key after requesting a CDM instance, it will flap back
469         to not waiting for a key almost immediately, didn't make sense
470         positing after requesting an instance. Also post key-received when
471         we receive the key.
472         (webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
473         been arranged that a CDMInstance will always be present in an OOB
474         message, so parse it out here.
475         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
476         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
477         As above, make sure when posting the OOB that a CDMInstance is present.
478
479 2018-11-13  Charlie Turner  <cturner@igalia.com>
480
481         Various compiler warnings/errors fixes.
482         https://bugs.webkit.org/show_bug.cgi?id=191583
483
484         Reviewed by Frédéric Wang.
485
486         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
487         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
488         ASSERT is only compiled in DEBUG mode, so guarding with
489         !LOG_DISABLED is wrong.
490         * rendering/RenderLayerCompositor.cpp:
491         (WebCore::RenderLayerCompositor::updateCompositingLayers):
492         showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
493         mode, so guarding with !LOG_DISABLED was wrong.
494         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
495         Ditto, this time with member .depth.
496         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
497         * rendering/svg/SVGRenderSupport.cpp:
498         (WebCore::SVGRenderSupport::styleChanged): Add another unused
499         parameter.
500
501 2018-11-12  Antoine Quint  <graouts@apple.com>
502
503         [Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
504         https://bugs.webkit.org/show_bug.cgi?id=191542
505         <rdar://problem/45356027>
506
507         Reviewed by Simon Fraser.
508
509         Test: animations/no-style-recalc-during-accelerated-animation.html
510
511         In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
512         animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
513         when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
514         animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
515         for that time when we'll schedule animation resolution.
516
517         By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
518         we also update animations in-flight to dispatch "animationiteration" events.
519
520         * animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
521         * animation/DocumentTimeline.cpp:
522         (WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
523         (WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
524         (WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
525         (WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
526         cache the current time in suspendAnimations() without also automatically clearing the current time.
527         (WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
528         factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
529         by virtue of using cacheCurrentTime(). This fixes some flakiness.
530         (WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime(). 
531         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
532         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
533         scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
534         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
535         (WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
536         and call scheduleNextTick().
537         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
538         (WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
539         Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
540         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
541         * animation/DocumentTimeline.h:
542         * animation/WebAnimation.cpp:
543         (WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
544         function to get that information directly through the WebAnimation object without bothering about its effect.
545         (WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
546         change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
547         (WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
548         * animation/WebAnimation.h:
549
550 2018-11-13  Miguel Gomez  <magomez@igalia.com>
551
552         [GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
553         https://bugs.webkit.org/show_bug.cgi?id=191545
554
555         Reviewed by Žan Doberšek.
556
557         Keep track of layer size changes even if they happen when the layer is not in the visible
558         area, so we can update edge tiles when the layer gets visible.
559
560         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
561         (WebCore::TiledBackingStore::createTiles):
562         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
563
564 2018-11-12  Rob Buis  <rbuis@igalia.com>
565
566         Content-Type parameter values should allow empty quoted strings
567         https://bugs.webkit.org/show_bug.cgi?id=191388
568
569         Reviewed by Dean Jackson.
570
571         According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
572         quoted strings are acceptable for Content-Type parameter values. They
573         are accepted by Firefox and Chrome implementations as well.
574
575         Test: web-platform-tests/xhr/overridemimetype-blob.html
576
577         * platform/network/ParsedContentType.cpp:
578         (WebCore::parseToken):
579         (WebCore::parseQuotedString):
580         (WebCore::parseContentType):
581         * platform/network/ParsedContentType.h:
582
583 2018-11-12  Christopher Reid  <chris.reid@sony.com>
584
585         [Curl] Reject entire cookie if the domain fails a tailmatch.
586         https://bugs.webkit.org/show_bug.cgi?id=191406
587
588         Reviewed by Youenn Fablet.
589
590         Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
591         and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
592         Also cleanup Cookie database implementation to make them testable better.
593
594         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
595
596         * platform/network/curl/CookieJarDB.cpp:
597         (WebCore::CookieJarDB::canAcceptCookie): Added.
598         (WebCore::CookieJarDB::setCookie):
599         * platform/network/curl/CookieUtil.cpp:
600         (WebCore::CookieUtil::parseCookieAttributes):
601         (WebCore::CookieUtil::parseCookieHeader):
602         * platform/network/curl/CookieUtil.h:
603
604 2018-11-12  Devin Rousso  <drousso@apple.com>
605
606         Web Inspector: Network: show secure certificate details per-request
607         https://bugs.webkit.org/show_bug.cgi?id=191447
608         <rdar://problem/30019476>
609
610         Reviewed by Joseph Pecoraro.
611
612         Test: http/tests/inspector/network/resource-response-security.html
613
614         * loader/ResourceLoader.h:
615         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
616         * loader/ResourceLoader.cpp:
617         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
618         Always save certificate information when WebInspector is open.
619
620         * platform/network/CertificateInfoBase.h: Added.
621         (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
622         (WebCore::CertificateInfoBase::summaryInfo const):
623         (WebCore::CertificateInfoBase::isEmpty const):
624         * platform/network/cf/CertificateInfo.h:
625         (WebCore::CertificateInfo::summaryInfo const): Added.
626         * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
627         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
628         (WebCore::CertificateInfo::summaryInfo const): Added.
629         * platform/network/curl/CertificateInfo.h:
630         (WebCore::CertificateInfo::summaryInfo const): Added.
631         (WebCore::CertificateInfo::isEmpty const): Added.
632         * platform/network/soup/CertificateInfo.h:
633         (WebCore::CertificateInfo::summaryInfo const): Added.
634         (WebCore::CertificateInfo::isEmpty const): Added.
635         Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
636         platform-specific code in its implementation.
637
638         * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
639         * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
640         * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
641
642         * inspector/NetworkResourcesData.h:
643         (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
644         (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
645         * inspector/NetworkResourcesData.cpp:
646         (WebCore::NetworkResourcesData::responseReceived):
647
648         * inspector/agents/InspectorNetworkAgent.cpp:
649         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
650
651         * PlatformAppleWin.cmake:
652         * PlatformMac.cmake:
653         * SourcesCocoa.txt:
654         * WebCore.xcodeproj/project.pbxproj:
655         * platform/Curl.cmake:
656         * platform/SourcesSoup.txt:
657
658 2018-11-12  Zalan Bujtas  <zalan@apple.com>
659
660         Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer.
661         https://bugs.webkit.org/show_bug.cgi?id=191554
662         <rdar://problem/45825265>
663
664         Reviewed by Antti Koivisto.
665
666         While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block.
667         Moving a renderer is a 2 step process:
668         1. Detach the renderer from its current parent
669         2. Attach it to its new parent.
670         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
671         is not needed anymore (except we use it as the new parent).
672
673         Test: fast/inline/marker-list-item-move-should-not-crash.html
674
675         * rendering/updating/RenderTreeBuilder.cpp:
676         (WebCore::RenderTreeBuilder::detach):
677         * rendering/updating/RenderTreeBuilder.h:
678         * rendering/updating/RenderTreeBuilderBlock.cpp:
679         (WebCore::RenderTreeBuilder::Block::detach):
680         * rendering/updating/RenderTreeBuilderBlock.h:
681         * rendering/updating/RenderTreeBuilderList.cpp:
682         (WebCore::RenderTreeBuilder::List::updateItemMarker):
683
684 2018-11-12  Javier Fernandez  <jfernandez@igalia.com>
685
686         [css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic
687         https://bugs.webkit.org/show_bug.cgi?id=191358
688
689         Reviewed by Manuel Rego Casasnovas.
690
691         These changes are just a refactoring to ease the integration of the new Baseline Alignment
692         logic in a follow up patch.
693
694         We need to properly estimate the grid area size of orthogonal items so that we can perform
695         an accurate pre-layout. This is important because orthogonal items will synthesize their baseline
696         if they participate in any baseline alignment context.
697
698         No new tests, since no behavior change has been introduced in this patch.
699
700         * rendering/Grid.cpp:
701         (WebCore::Grid::setNeedsItemsPlacement):
702         * rendering/Grid.h:
703         * rendering/GridTrackSizingAlgorithm.cpp:
704         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
705         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
706         (WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const):
707         (WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const):
708         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
709         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
710         (WebCore::GridTrackSizingAlgorithm::run):
711         (WebCore::GridTrackSizingAlgorithm::reset):
712         * rendering/GridTrackSizingAlgorithm.h:
713         (WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const):
714         * rendering/RenderGrid.cpp:
715         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
716         (WebCore::RenderGrid::layoutBlock):
717         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
718         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
719         (WebCore::RenderGrid::placeItemsOnGrid const):
720         (WebCore::RenderGrid::performGridItemsPreLayout const):
721         (WebCore::overrideSizeChanged):
722         (WebCore::hasRelativeBlockAxisSize):
723         (WebCore::RenderGrid::updateGridAreaLogicalSize const):
724         (WebCore::RenderGrid::layoutGridItems):
725         * rendering/RenderGrid.h:
726
727 2018-11-12  Sihui Liu  <sihui_liu@apple.com>
728
729         imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
730         https://bugs.webkit.org/show_bug.cgi?id=191500
731
732         Reviewed by Dean Jackson.
733
734         When double value is bigger than maximum unsigned int, converting double to unsigned int has
735         different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
736         maximum unsigned int.
737
738         Covered by existing test.
739
740         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
741         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
742         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
743
744 2018-11-12  Basuke Suzuki  <basuke.suzuki@sony.com>
745
746         [Curl] Add API Test for Curl cookie backend.
747         https://bugs.webkit.org/show_bug.cgi?id=191493
748
749         Reviewed by Youenn Fablet.
750
751         Refactoring for cookie backend interface.
752
753         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
754
755         * platform/FileSystem.h:
756         * platform/network/curl/CookieJarCurlDatabase.cpp:
757         (WebCore::cookiesForSession):
758         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
759         (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
760         (WebCore::CookieJarCurlDatabase::getRawCookies const):
761         * platform/network/curl/CookieJarDB.cpp:
762         (WebCore::CookieJarDB::openDatabase):
763         (WebCore::CookieJarDB::checkSQLiteReturnCode):
764         (WebCore::CookieJarDB::isEnabled const):
765         (WebCore::CookieJarDB::searchCookies):
766         (WebCore::CookieJarDB::setCookie):
767         (WebCore::CookieJarDB::deleteCookie):
768         (WebCore::CookieJarDB::deleteCookieInternal):
769         (WebCore::CookieJarDB::deleteCookies):
770         (WebCore::CookieJarDB::deleteAllCookies):
771         (WebCore::CookieJarDB::executeSimpleSql):
772         (WebCore::CookieJarDB::isEnabled): Deleted.
773         * platform/network/curl/CookieJarDB.h:
774         * platform/network/curl/CookieUtil.cpp:
775         (WebCore::CookieUtil::parseCookieHeader):
776         * platform/network/curl/CookieUtil.h:
777         * platform/win/FileSystemWin.cpp:
778         (WebCore::FileSystem::generateTemporaryPath):
779         (WebCore::FileSystem::openTemporaryFile):
780         (WebCore::FileSystem::createTemporaryDirectory):
781         (WebCore::FileSystem::deleteNonEmptyDirectory):
782
783 2018-11-12  Tim Horton  <timothy_horton@apple.com>
784
785         Make it possible to edit images inline
786         https://bugs.webkit.org/show_bug.cgi?id=191352
787         <rdar://problem/30107985>
788
789         Reviewed by Dean Jackson.
790
791         Tests: editing/images/basic-editable-image.html
792                editing/images/reparent-editable-image-maintains-strokes.html
793
794         Add the beginnings of a mechanism to replace images with a special attribute
795         with a native drawing view in the UI process.
796
797         * page/Settings.yaml:
798         Add a setting to control whether images become natively editable when they
799         have the x-apple-editable-image attribute.
800
801         * html/HTMLImageElement.cpp:
802         (WebCore::HTMLImageElement::editableImageViewID const):
803         Lazily generate an EmbeddedViewID and persist it on the <img> element.
804
805         * html/HTMLImageElement.h:
806         Rearrange the service controls methods to sit before the members.
807         Add m_editableImageViewID and editableImageViewID().
808
809         * platform/graphics/GraphicsLayer.cpp:
810         (WebCore::GraphicsLayer::nextEmbeddedViewID):
811         * platform/graphics/GraphicsLayer.h:
812         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
813         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
814         on Cocoa platforms and when using RemoteLayerTree.
815         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
816         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
817         and an EmbeddedViewID to uniquely identify and communicate about the
818         embedded view (which may move between layers, since it is tied to an element).
819
820         * platform/graphics/ca/GraphicsLayerCA.cpp:
821         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
822         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
823         When setting GraphicsLayer's contents to an embedded view, we use
824         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
825         GraphicsLayerCARemote will override this and make a correctly-initialized
826         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
827
828         * platform/graphics/ca/GraphicsLayerCA.h:
829         * platform/graphics/ca/PlatformCALayer.cpp:
830         (WebCore::operator<<):
831         * platform/graphics/ca/PlatformCALayer.h:
832         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
833         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
834         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
835         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
836         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
837         These will be overridden by PlatformCALayerRemote to do more interesting things.
838
839         * rendering/RenderImage.cpp:
840         (WebCore::RenderImage::isEditableImage const):
841         Add a getter that return true if the setting is enabled and
842         x-apple-editable-image is empty or true.
843
844         (WebCore::RenderImage::requiresLayer const):
845         RenderImage requires a layer either if RenderReplaced does, or we are an
846         editable image.
847
848         * rendering/RenderImage.h:
849         * rendering/RenderLayer.cpp:
850         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
851         (WebCore::RenderLayer::calculateClipRects const):
852         * rendering/RenderLayerBacking.cpp:
853         (WebCore::RenderLayerBacking::updateConfiguration):
854         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
855
856         * rendering/RenderLayerCompositor.cpp:
857         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
858         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
859         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
860         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
861         * rendering/RenderLayerCompositor.h:
862         Make editable images require compositing implicitly.
863
864 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
865
866         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
867         https://bugs.webkit.org/show_bug.cgi?id=189230
868         <rdar://problem/44050379>
869
870         Reviewed by Joseph Pecoraro.
871
872         Runs all png images through zopflipng. This results in a smaller file
873         size and takes care of this issue as a byproduct.
874
875         * Modules/modern-media-controls/images/iOS/airplay-placard@1x.png:
876         * Modules/modern-media-controls/images/iOS/airplay-placard@2x.png:
877         * Modules/modern-media-controls/images/iOS/airplay-placard@3x.png:
878         * Modules/modern-media-controls/images/iOS/invalid-placard@1x.png:
879         * Modules/modern-media-controls/images/iOS/invalid-placard@2x.png:
880         * Modules/modern-media-controls/images/iOS/invalid-placard@3x.png:
881         * Modules/modern-media-controls/images/iOS/pip-placard@1x.png:
882         * Modules/modern-media-controls/images/iOS/pip-placard@2x.png:
883         * Modules/modern-media-controls/images/iOS/pip-placard@3x.png:
884         * Modules/modern-media-controls/images/macOS/airplay-placard@1x.png:
885         * Modules/modern-media-controls/images/macOS/airplay-placard@2x.png:
886         * Modules/modern-media-controls/images/macOS/invalid-placard@1x.png:
887         * Modules/modern-media-controls/images/macOS/invalid-placard@2x.png:
888         * Modules/modern-media-controls/images/macOS/pip-placard@1x.png:
889         * Modules/modern-media-controls/images/macOS/pip-placard@2x.png:
890         * Resources/AttachmentPlaceholder.png:
891         * Resources/AttachmentPlaceholder@2x.png:
892         * Resources/ListButtonArrow.png:
893         * Resources/ListButtonArrow@2x.png:
894         * Resources/missingImage.png:
895         * Resources/missingImage@2x.png:
896         * Resources/missingImage@3x.png:
897         * Resources/moveCursor.png:
898         * Resources/northEastSouthWestResizeCursor.png:
899         * Resources/northSouthResizeCursor.png:
900         * Resources/northWestSouthEastResizeCursor.png:
901         * Resources/nullPlugin.png:
902         * Resources/nullPlugin@2x.png:
903         * Resources/panIcon.png:
904         * Resources/textAreaResizeCorner.png:
905         * Resources/textAreaResizeCorner@2x.png:
906         * Resources/urlIcon.png:
907
908 2018-11-12  Youenn Fablet  <youenn@apple.com>
909
910         RealtimeOutgoing A/V sources should observe their sources only if having a sink
911         https://bugs.webkit.org/show_bug.cgi?id=191490
912
913         Reviewed by Eric Carlson.
914
915         Observe the source that generates media based on the sinks:
916         - Do not observe at creation time
917         - For first sink, start observing
918         - When no more sink, stop observing
919         Apply this principle for both outgoing audio and video sources.
920         Add locks for the sinks to ensure thread-safety.
921         Make sinks HashSet which is more robust.
922
923         Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations.
924
925         Covered by existing tests and updated webrtc/remove-track.html.
926
927         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
928         (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
929         (WebCore::RealtimeOutgoingAudioSource::stop):
930         (WebCore::RealtimeOutgoingAudioSource::AddSink):
931         (WebCore::RealtimeOutgoingAudioSource::RemoveSink):
932         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
933         * platform/mediastream/RealtimeOutgoingAudioSource.h:
934         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
935         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
936         (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
937         (WebCore::RealtimeOutgoingVideoSource::observeSource):
938         (WebCore::RealtimeOutgoingVideoSource::setSource):
939         (WebCore::RealtimeOutgoingVideoSource::stop):
940         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
941         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
942         * platform/mediastream/RealtimeOutgoingVideoSource.h:
943         (WebCore::RealtimeOutgoingVideoSource::isSilenced const):
944         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
945         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
946         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
947         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
948         (WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
949         (WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
950         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
951         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
952         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
953
954 2018-11-12  Youenn Fablet  <youenn@apple.com>
955
956         Support setting stream ids when adding a transceiver
957         https://bugs.webkit.org/show_bug.cgi?id=191307
958
959         Reviewed by Eric Carlson.
960
961         Add support for streams in RTCTransceiverInit.
962         Add plumbing down to libwebrtc.
963         Covered by rebased tests.
964
965         * Modules/mediastream/RTCPeerConnection.h:
966         * Modules/mediastream/RTCPeerConnection.idl:
967         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
968         (WebCore::fromRtpTransceiverInit):
969
970 2018-11-12  Antti Koivisto  <antti@apple.com>
971
972         Support dynamic pseudo-classes on elements with display: contents
973         https://bugs.webkit.org/show_bug.cgi?id=181640
974         <rdar://problem/36605415>
975
976         Reviewed by Dean Jackson.
977
978         The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation.
979
980         This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but
981         includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited
982         text properties).
983
984         Test: fast/css/display-contents-hover-active.html
985
986         * dom/Document.cpp:
987         (WebCore::Document::updateHoverActiveState):
988
989             Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree
990             but also includes display:content elements. This also allows removing the special display:none case.
991
992         * dom/Element.cpp:
993         (WebCore::Element::setActive):
994         (WebCore::Element::setHovered):
995
996             Also look into display:contents style for invalidation checks.
997
998         (WebCore::Element::renderOrDisplayContentsStyle const):
999
1000             Make this helper an Element member.
1001
1002         * dom/Element.h:
1003         * dom/Node.cpp:
1004         (WebCore::Node::parentElementInComposedTree const):
1005
1006             Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator.
1007
1008         * rendering/updating/RenderTreePosition.cpp:
1009         (WebCore::RenderTreePosition::nextSiblingRenderer const):
1010         * style/StyleTreeResolver.cpp:
1011         (WebCore::Style::TreeResolver::resolveElement):
1012         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1013         (WebCore::Style::shouldResolveElement):
1014         (WebCore::Style::TreeResolver::resolveComposedTree):
1015         (WebCore::Style::renderOrDisplayContentsStyle): Deleted.
1016
1017             Use the Element::renderOrDisplayContentsStyle() instead.
1018
1019 2018-11-12  Antoine Quint  <graouts@apple.com>
1020
1021         [Web Animations] Turn Web Animations experimental
1022         https://bugs.webkit.org/show_bug.cgi?id=191543
1023
1024         Reviewed by Dean Jackson.
1025
1026         * page/RuntimeEnabledFeatures.h:
1027
1028 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
1029
1030         feFlood with alpha color doesn't work correctly
1031         https://bugs.webkit.org/show_bug.cgi?id=163666
1032
1033         Reviewed by Zalan Bujtas.
1034         
1035         FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha()
1036         rather than multiplying the flood color with the flood opacity as other browsers do.
1037
1038         Test: svg/filters/feFlood-with-alpha-color.html
1039
1040         * platform/graphics/Color.cpp:
1041         (WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere,
1042         and it triggered a behavior change, so add a comment.
1043         * platform/graphics/filters/FEFlood.cpp:
1044         (WebCore::FEFlood::platformApplySoftware):
1045         * svg/SVGStopElement.cpp:
1046         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
1047
1048 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
1049
1050         Require <iframe allow="display"> for an iframe to use getDisplayMedia
1051         https://bugs.webkit.org/show_bug.cgi?id=191505
1052         <rdar://problem/45968811>
1053
1054         Reviewed by Jer Noble.
1055
1056         Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
1057
1058         * Modules/mediastream/MediaDevicesRequest.cpp:
1059         (WebCore::MediaDevicesRequest::start):
1060         * Modules/mediastream/UserMediaController.cpp:
1061         (WebCore::isAllowedToUse):
1062         (WebCore::UserMediaController::canCallGetUserMedia):
1063         (WebCore::UserMediaController::logGetUserMediaDenial):
1064         * Modules/mediastream/UserMediaController.h:
1065         * Modules/mediastream/UserMediaRequest.cpp:
1066         (WebCore::UserMediaRequest::start):
1067
1068 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
1069
1070         Make compositing updates incremental
1071         https://bugs.webkit.org/show_bug.cgi?id=90342
1072
1073         Reviewed by Antti Koivisto.
1074
1075         Previously, updating compositing layers required two full RenderLayer tree traversals,
1076         and all the work was done for every RenderLayer on each composting update. This could be expensive
1077         on pages with lots of RenderLayers.
1078
1079         These changes make compositing updates more incremental. Compositing updates still require
1080         two tree traversals. The first determines which RenderLayers need to be composited (of those which
1081         weren't already made composited at style-change time), because of reasons that can only be determined
1082         post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry
1083         and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make
1084         it hard to fold these two traversals together.
1085
1086         In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers,
1087         and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first
1088         "compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal.
1089         When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need
1090         to be visited.
1091
1092         Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have
1093         to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize
1094         work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can
1095         be skipped if no change has triggered the need for that traversal.
1096         
1097         These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
1098         more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
1099         triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
1100         excluding composited filters from the composited bounds (but still taking them into account for overlap).
1101
1102         Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html).
1103
1104         Code to set the dirty bits is added in various places that change properties that compositing depends on.
1105         
1106         These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the
1107         style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy"
1108         traversal, which is always a pre-order traversal.
1109
1110         Tests: compositing/geometry/stacking-context-change-layer-reparent.html
1111                compositing/layer-creation/change-to-overlap.html
1112                compositing/updates/no-updates-in-non-composited-iframe.html
1113
1114         * html/canvas/WebGLRenderingContextBase.cpp:
1115         (WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited
1116         for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value.
1117         * page/FrameView.cpp:
1118         (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
1119         * page/Page.cpp:
1120         (WebCore::Page::setPageScaleFactor):
1121         * platform/graphics/ca/GraphicsLayerCA.cpp:
1122         (WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers.
1123         * rendering/RenderBox.cpp:
1124         (WebCore::RenderBox::styleWillChange):
1125         * rendering/RenderLayer.cpp:
1126         (WebCore::RenderLayer::RenderLayer):
1127         (WebCore::RenderLayer::~RenderLayer):
1128         (WebCore::RenderLayer::addChild):
1129         (WebCore::RenderLayer::removeChild):
1130         (WebCore::RenderLayer::shouldBeStackingContext const):
1131         (WebCore::RenderLayer::stackingContext const):
1132         (WebCore::RenderLayer::dirtyZOrderLists):
1133         (WebCore::RenderLayer::dirtyNormalFlowList):
1134         (WebCore::RenderLayer::updateNormalFlowList):
1135         (WebCore::RenderLayer::rebuildZOrderLists):
1136         (WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag):
1137         (WebCore::RenderLayer::contentChanged):
1138         (WebCore::RenderLayer::updateLayerPositions):
1139         (WebCore::RenderLayer::updateTransform):
1140         (WebCore::RenderLayer::updateLayerPosition):
1141         (WebCore::RenderLayer::enclosingCompositingLayer const):
1142         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
1143         (WebCore::RenderLayer::clippingRootForPainting const):
1144         (WebCore::RenderLayer::scrollTo):
1145         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
1146         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1147         (WebCore::RenderLayer::paintLayerContents):
1148         (WebCore::RenderLayer::hitTest):
1149         (WebCore::RenderLayer::hitTestLayer):
1150         (WebCore::RenderLayer::calculateClipRects const):
1151         (WebCore::outputPaintOrderTreeLegend):
1152         (WebCore::outputPaintOrderTreeRecursive):
1153         (WebCore::compositingContainer): Deleted.
1154         * rendering/RenderLayer.h:
1155         (WebCore::RenderLayer::clearZOrderLists):
1156         (WebCore::RenderLayer::paintOrderParent const):
1157         * rendering/RenderLayerBacking.cpp:
1158         (WebCore::RenderLayerBacking::updateCompositedBounds):
1159         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
1160         (WebCore::RenderLayerBacking::updateAfterLayout):
1161         (WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
1162         (WebCore::RenderLayerBacking::updateConfiguration):
1163         (WebCore::RenderLayerBacking::updateGeometry):
1164         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
1165         (WebCore::RenderLayerBacking::updateMaskingLayer):
1166         (WebCore::RenderLayerBacking::paintsContent const):
1167         (WebCore::RenderLayerBacking::contentChanged):
1168         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
1169         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1170         (WebCore::RenderLayerBacking::startAnimation):
1171         (WebCore::RenderLayerBacking::animationFinished):
1172         (WebCore::RenderLayerBacking::startTransition):
1173         (WebCore::RenderLayerBacking::transitionFinished):
1174         (WebCore::RenderLayerBacking::setCompositedBounds):
1175         * rendering/RenderLayerBacking.h:
1176         * rendering/RenderLayerCompositor.cpp:
1177         (WebCore::RenderLayerCompositor::CompositingState::CompositingState):
1178         (WebCore::RenderLayerCompositor::enableCompositingMode):
1179         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
1180         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):
1181         (WebCore::RenderLayerCompositor::willRecalcStyle):
1182         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
1183         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1184         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1185         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1186         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1187         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1188         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
1189         (WebCore::RenderLayerCompositor::logLayerInfo):
1190         (WebCore::clippingChanged):
1191         (WebCore::styleAffectsLayerGeometry):
1192         (WebCore::RenderLayerCompositor::layerStyleChanged):
1193         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
1194         (WebCore::RenderLayerCompositor::updateBacking):
1195         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
1196         (WebCore::RenderLayerCompositor::layerWasAdded):
1197         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
1198         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
1199         (WebCore::RenderLayerCompositor::computeExtent const):
1200         (WebCore::RenderLayerCompositor::addToOverlapMap):
1201         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
1202         (WebCore::RenderLayerCompositor::rootLayerConfigurationChanged):
1203         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1204         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1205         (WebCore::RenderLayerCompositor::needsToBeComposited const):
1206         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
1207         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1208         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1209         (WebCore::RenderLayerCompositor::clippedByAncestor const):
1210         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1211         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
1212         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
1213         (WebCore::RenderLayerCompositor::requiresCompositingForFilters const):
1214         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
1215         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
1216         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
1217         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
1218         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
1219         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
1220         (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
1221         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
1222         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
1223         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
1224         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
1225         (WebCore::operator<<):
1226         (WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted.
1227         (WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted.
1228         (WebCore::isScrollableOverflow): Deleted.
1229         (WebCore::styleHasTouchScrolling): Deleted.
1230         (WebCore::styleChangeRequiresLayerRebuild): Deleted.
1231         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted.
1232         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted.
1233         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted.
1234         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted.
1235         * rendering/RenderLayerCompositor.h:
1236         * rendering/RenderTreeAsText.cpp:
1237         (WebCore::writeLayers):
1238
1239 2018-11-12  Rob Buis  <rbuis@igalia.com>
1240
1241         CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com
1242         https://bugs.webkit.org/show_bug.cgi?id=190839
1243
1244         Reviewed by Frédéric Wang.
1245
1246         The CSSCalcOperation ctor that takes a leftSide and rightSide parameter
1247         wastes memory since it will always have size 2 but claims the
1248         default Vector size. So make sure to reserve an initial capacity of 2.
1249
1250         * css/CSSCalculationValue.cpp:
1251
1252 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1253
1254         WTFMove(xxx) is used in arguments while other arguments touch xxx
1255         https://bugs.webkit.org/show_bug.cgi?id=191544
1256
1257         Reviewed by Alex Christensen.
1258
1259         The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx),
1260         xxx should not be touched in the other arguments. This patch fixes such uses in
1261         IDB code.
1262
1263         * Modules/indexeddb/IDBObjectStore.cpp:
1264         (WebCore::IDBObjectStore::deleteIndex):
1265         * Modules/indexeddb/IDBTransaction.cpp:
1266         (WebCore::IDBTransaction::scheduleOperation):
1267         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1268         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
1269         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1270         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
1271
1272 2018-11-12  Zalan Bujtas  <zalan@apple.com>
1273
1274         [LFC][IFC] Construct dedicated runs when the inline element requires it.
1275         https://bugs.webkit.org/show_bug.cgi?id=191509
1276
1277         Reviewed by Antti Koivisto.
1278
1279         In certain cases, a run can overlap multiple inline elements like this:
1280
1281         <span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span>
1282
1283         The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking.
1284         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.
1285
1286         * layout/inlineformatting/InlineFormattingContext.cpp:
1287         (WebCore::Layout::InlineFormattingContext::layout const):
1288         (WebCore::Layout::contentRequiresSeparateRun):
1289         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1290         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
1291         (WebCore::Layout::InlineFormattingContext::closeLine const):
1292         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
1293         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1294         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1295         * layout/inlineformatting/InlineFormattingContext.h:
1296         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const):
1297         * layout/inlineformatting/InlineLineBreaker.cpp:
1298         (WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet.
1299         * layout/inlineformatting/InlineRun.h:
1300         (WebCore::Layout::InlineRun::overlapsMultipleInlineItems const):
1301         * layout/inlineformatting/InlineRunProvider.cpp:
1302         (WebCore::Layout::InlineRunProvider::processInlineTextItem):
1303         * layout/inlineformatting/InlineRunProvider.h:
1304         (WebCore::Layout::InlineRunProvider::Run::TextContext::expand):
1305         (WebCore::Layout::InlineRunProvider::Run::textContext):
1306         (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted.
1307         (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted.
1308
1309 2018-11-12  Jer Noble  <jer.noble@apple.com>
1310
1311         [MSE] Frame re-ordering can cause iframes to never be enqueued
1312         https://bugs.webkit.org/show_bug.cgi?id=191485
1313
1314         Reviewed by Eric Carlson.
1315
1316         Test: media/media-source/media-source-dropped-iframe.html
1317
1318         Some frame re-ordering techniques result in files where the first frame has a
1319         decode timestamp < 0, but a presentation timestamp >= 0. When appending these
1320         samples to existing content, we can fail to enqueue the first frame because its
1321         DTS overlaps an existing sample, but the presentation timestamp does not.
1322         Rather than try to only enqueue samples whose decode timestamps are > than the
1323         greatest decode end timestamp (minus some fudge factor), allow all frames to be
1324         added to the decode queue if they are strictly ordered greater than the last
1325         enqueued frame.
1326
1327         * Modules/mediasource/SourceBuffer.cpp:
1328         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
1329         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1330         (WebCore::SourceBuffer::provideMediaData):
1331         (WebCore::SourceBuffer::reenqueueMediaForTime):
1332
1333 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1334
1335         IDBTransaction does not use "RefPtr<IDBTransaction> self"
1336         https://bugs.webkit.org/show_bug.cgi?id=190436
1337
1338         Reviewed by Alex Christensen.
1339
1340         It seems that `RefPtr<IDBTransaction> self;` is not effective since it does not capture anything.
1341         Use `protectedThis = makeRef(*this)` instead.
1342
1343         No behavior change.
1344
1345         * Modules/indexeddb/IDBTransaction.cpp:
1346         (WebCore::IDBTransaction::IDBTransaction):
1347
1348 2018-11-12  Alicia Boya García  <aboya@igalia.com>
1349
1350         [MSE][GStreamer] Introduce AbortableTaskQueue
1351         https://bugs.webkit.org/show_bug.cgi?id=190902
1352
1353         Reviewed by Xabier Rodriguez-Calvar.
1354
1355         A new synchronization primitive is introduced: AbortableTaskQueue,
1356         which allows to send work to the main thread from a background thread
1357         with the option to perform two-phase cancellation (startAborting() and
1358         finishAborting()).
1359
1360         This new primitive has been used to overhaul GstBus messaging in
1361         AppendPipeline. A lot of code made redundant has been deleted in the
1362         process and lots of internal functions were now able to be made
1363         private. As part of the refactor all glib signals in AppendPipeline
1364         now use lambdas. All usages of WTF::isMainThread() in AppendPipeline
1365         have been replaced by isMainThread() for consistency with the rest of
1366         WebKit.
1367
1368         Two-phase cancellation is still not used in AppendPipeline as of this
1369         patch, but it will be used in a future patch that makes use of
1370         GStreamer flushes to implement correct MSE abort semantics. There are
1371         unit tests to ensure it works correctly, even if it's still not used.
1372
1373         * WebCore.xcodeproj/project.pbxproj:
1374         * platform/AbortableTaskQueue.h: Added.
1375         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1376         (WebCore::AppendPipeline::dumpAppendState):
1377         (WebCore::AppendPipeline::AppendPipeline):
1378         (WebCore::AppendPipeline::~AppendPipeline):
1379         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
1380         (WebCore::AppendPipeline::handleAppsinkNewSampleFromAnyThread):
1381         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1382         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1383         (WebCore::AppendPipeline::sourceBufferPrivate):
1384         (WebCore::AppendPipeline::appsinkCaps):
1385         (WebCore::AppendPipeline::track):
1386         (WebCore::AppendPipeline::demuxerSrcPadCaps):
1387         (WebCore::AppendPipeline::playerPrivate):
1388
1389 2018-11-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1390
1391         [GStreamer][EME] waitingforkey event should consider decryptors' waiting status
1392         https://bugs.webkit.org/show_bug.cgi?id=191459
1393
1394         Reviewed by Carlos Garcia Campos.
1395
1396         The new cross platform architecture to report waitingforkey and
1397         recover from it requires a more accurate knowledge of what is
1398         going on with the decryptors because events are reported only once
1399         (per key exchange run) and crossplatform only continues if we are
1400         actually ready to continue, meaning that no decryptors are
1401         waiting.
1402
1403         * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added
1404         GstIterator deleter.
1405         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1406         (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail
1407         out if we are requested to not wait anymore but there are still
1408         waiting decryptors.
1409         (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
1410         Query the pipeline, just a query after pipeline is built and
1411         manual inspection during build. The query is optimal but sometimes
1412         we can get this request when the pipeline is under construction so
1413         queries do not arrive at the decryptors and we have to deliver it
1414         by ourselves.
1415         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
1416         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1417         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
1418         Deleted because it is now inlined.
1419         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1420         (webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning.
1421         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1422         (webkit_media_common_encryption_decrypt_class_init): Override
1423         query method.
1424         (webkitMediaCommonEncryptionDecryptTransformInPlace): When the
1425         decryptor is going to block to wait, report before. When the
1426         decryptor receives the key, report it got it.
1427         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not
1428         handle waitingforkey here.
1429         (webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the
1430         decryptor is waiting.
1431
1432 2018-11-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1433
1434         [GTK] Silence ATK_XY_PARENT warnings
1435         https://bugs.webkit.org/show_bug.cgi?id=191504
1436
1437         Reviewed by Carlos Garcia Campos.
1438
1439         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
1440         (atkToContents):
1441         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1442         (textExtents):
1443         * accessibility/atk/WebKitAccessibleUtil.cpp:
1444         (contentsRelativeToAtkCoordinateType):
1445
1446 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1447
1448         Implement a new edit command to change the enclosing list type
1449         https://bugs.webkit.org/show_bug.cgi?id=191487
1450         <rdar://problem/45955922>
1451
1452         Reviewed by Ryosuke Niwa.
1453
1454         Add support for a new edit command that changes the type of the enclosing list element around the selection from
1455         unordered to ordered list and vice versa. This new edit command is exposed only to internal WebKit2 clients, via
1456         SPI on WKWebView (`-_changeListType:`).
1457
1458         This is currently intended for use in Mail compose, but may also be adopted by legacy Notes in the future. As
1459         such, the behavior of this editing command mostly matches shipping behavior in Mail compose (which is currently
1460         implemented entirely by Mail). See below for more details.
1461
1462         Test:   editing/execCommand/change-list-type.html
1463                 WKWebViewEditActions.ChangeListType
1464
1465         * Sources.txt:
1466         * WebCore.xcodeproj/project.pbxproj:
1467         * editing/ChangeListTypeCommand.cpp: Added.
1468         (WebCore::listConversionTypeForSelection):
1469         (WebCore::ChangeListTypeCommand::listConversionType):
1470
1471         Helper that returns a potential list conversion command that may be executed at the given document's selection,
1472         if any exists. We also use existing logic from Mail here to determine which list to change, by walking up the
1473         DOM from the lowest common ancestor container of the current selection until we hit the first list element.
1474
1475         (WebCore::ChangeListTypeCommand::createNewList):
1476
1477         Helper method to create a new list element to replace the given list, and then clone element data from the given
1478         list to the new list. This addresses an existing bug in Mail, wherein changing list type for an enclosing list
1479         which contains inline style properties drops the inline styles, because existing logic in Mail that implements
1480         this editing command only copies the `class` attribute of the old list to the new list.
1481
1482         (WebCore::ChangeListTypeCommand::doApply):
1483
1484         Apply the edit command by running the following steps:
1485         -   Find the enclosing list element, if any (see above).
1486         -   Create a new list element of the opposite type as the enclosing list, and clone over element data from the
1487             list element being replaced.
1488         -   Insert the new list next to the original list.
1489         -   Move all children of the original list to the new list.
1490         -   Remove the original list.
1491         -   Set the selection to the end of the new list.
1492
1493         * editing/ChangeListTypeCommand.h: Added.
1494         * editing/EditAction.h:
1495
1496         Add a pair of new edit actions for conversion from unordered list to ordered list and vice versa.
1497
1498         * editing/Editor.cpp:
1499         (WebCore::Editor::changeSelectionListType):
1500
1501         Implement this by creating and applying a new ChangeListTypeCommand.
1502
1503         (WebCore::Editor::canChangeSelectionListType): Deleted.
1504
1505         Remove this for now, since there's no need for it until full support for edit command validation is implemented.
1506
1507         * editing/Editor.h:
1508         * testing/Internals.cpp:
1509         (WebCore::Internals::changeSelectionListType):
1510         * testing/Internals.h:
1511         * testing/Internals.idl:
1512
1513         Add internal hooks to change list type from layout tests.
1514
1515 2018-11-11  Daniel Bates  <dabates@apple.com>
1516
1517         [iOS] Draw caps lock indicator in password fields
1518         https://bugs.webkit.org/show_bug.cgi?id=190565
1519         <rdar://problem/45262343>
1520
1521         Reviewed by Dean Jackson.
1522
1523         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
1524         fields on iOS more closely match the behavior of password fields on Mac.
1525
1526         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
1527         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
1528         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
1529         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
1530         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
1531         web views listen for keyboard availability changes so as to update the the caps lock state when
1532         a hardware keyboard is detached or attached.
1533
1534         * WebCore.xcodeproj/project.pbxproj:
1535         * page/EventHandler.cpp:
1536         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
1537         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
1538         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
1539         * page/EventHandler.h:
1540         * platform/cocoa/KeyEventCocoa.mm:
1541         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
1542         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
1543         * platform/ios/KeyEventIOS.mm:
1544         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
1545         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
1546         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
1547         * platform/ios/WebEvent.h:
1548         * platform/ios/WebEvent.mm:
1549         (+[WebEvent modifierFlags]): Added.
1550         * platform/mac/KeyEventMac.mm:
1551         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
1552         by both Mac and iOS.
1553         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
1554         by both Mac and iOS.
1555         * rendering/RenderThemeCocoa.h:
1556         * rendering/RenderThemeCocoa.mm:
1557         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
1558         * rendering/RenderThemeIOS.h:
1559         * rendering/RenderThemeIOS.mm:
1560         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
1561         * rendering/RenderThemeMac.h:
1562         * rendering/RenderThemeMac.mm:
1563         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
1564         shared by both Mac and iOS.
1565
1566 2018-11-11  Zalan Bujtas  <zalan@apple.com>
1567
1568         [LFC][BFC] In-flow positioned logic is really formatting context dependent.
1569         https://bugs.webkit.org/show_bug.cgi?id=191512
1570
1571         Reviewed by Simon Fraser.
1572
1573         Move block formatting context specific code from FormattingContext to BlockFormattingContext.
1574
1575         * layout/FormattingContext.cpp:
1576         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): Deleted.
1577         * layout/FormattingContext.h:
1578         * layout/FormattingContextGeometry.cpp:
1579         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
1580         * layout/blockformatting/BlockFormattingContext.cpp:
1581         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
1582         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): Deleted.
1583         * layout/blockformatting/BlockFormattingContext.h:
1584         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1585         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): Deleted.
1586         * layout/inlineformatting/InlineFormattingContext.cpp:
1587         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): Deleted.
1588         * layout/inlineformatting/InlineFormattingContext.h:
1589
1590 2018-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
1591
1592         Address post-review comments after r237955
1593         https://bugs.webkit.org/show_bug.cgi?id=191496
1594
1595         Reviewed by Darin Adler.
1596
1597         * rendering/TextDecorationPainter.cpp:
1598         (WebCore::TextDecorationPainter::paintTextDecoration):
1599         * style/InlineTextBoxStyle.cpp:
1600         (WebCore::computeUnderlineOffset):
1601         * style/InlineTextBoxStyle.h:
1602
1603 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
1604
1605         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
1606         https://bugs.webkit.org/show_bug.cgi?id=191492
1607
1608         Reviewed by Alex Christensen.
1609
1610         Rename file.
1611
1612         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1613         * page/mac/EventHandlerMac.mm:
1614         * platform/mac/URLMac.mm:
1615         * platform/mac/WebCoreNSURLExtras.mm:
1616         * platform/mac/WebCoreObjCExtras.mm:
1617         * rendering/RenderThemeMac.mm:
1618
1619 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
1620
1621         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
1622         https://bugs.webkit.org/show_bug.cgi?id=191492
1623
1624         Reviewed by Alex Christensen.
1625
1626         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1627         * page/mac/EventHandlerMac.mm:
1628         * platform/mac/URLMac.mm:
1629         * platform/mac/WebCoreNSURLExtras.mm:
1630         * platform/mac/WebCoreObjCExtras.mm:
1631         * rendering/RenderThemeMac.mm:
1632         (WebCore::RenderThemeMac::systemColor const):
1633
1634 2018-11-10  Megan Gardner  <megan_gardner@apple.com>
1635
1636         Fix build for 32bit Mac
1637         https://bugs.webkit.org/show_bug.cgi?id=191511
1638
1639         Unreviewed Build Fix.
1640
1641         Build fix, not tests needed.
1642
1643         Make the apporiate delecrations for 32-bit mac support.
1644
1645         * editing/mac/DictionaryLookup.mm:
1646
1647 2018-11-10  Simon Fraser  <simon.fraser@apple.com>
1648
1649         Remove support for -webkit-svg-shadow
1650         https://bugs.webkit.org/show_bug.cgi?id=187429
1651         <rdar://problem/41920735>
1652
1653         Reviewed by Dean Jackson.
1654         
1655         -webkit-svg-shadow was a non-standard hack for online iWork, and they no longer use it,
1656         so remove it. No other browser supports it, and chromestatus say it's used on less than
1657         0.000001% of pages.
1658
1659         * css/CSSComputedStyleDeclaration.cpp:
1660         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1661         * css/CSSProperties.json:
1662         * css/SVGCSSComputedStyleDeclaration.cpp:
1663         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1664         * css/StyleBuilderCustom.h:
1665         (WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow): Deleted.
1666         (WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow): Deleted.
1667         (WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow): Deleted.
1668         * css/parser/CSSPropertyParser.cpp:
1669         (WebCore::CSSPropertyParser::parseSingleValue):
1670         * rendering/RenderElement.cpp:
1671         (WebCore::RenderElement::didAttachChild):
1672         * rendering/svg/RenderSVGImage.cpp:
1673         (WebCore::RenderSVGImage::layout):
1674         * rendering/svg/RenderSVGImage.h:
1675         * rendering/svg/RenderSVGModelObject.cpp:
1676         (WebCore::RenderSVGModelObject::RenderSVGModelObject):
1677         * rendering/svg/RenderSVGModelObject.h:
1678         (WebCore::RenderSVGModelObject::repaintRectInLocalCoordinatesExcludingSVGShadow const): Deleted.
1679         (WebCore::RenderSVGModelObject::hasSVGShadow const): Deleted.
1680         (WebCore::RenderSVGModelObject::setHasSVGShadow): Deleted.
1681         * rendering/svg/RenderSVGRoot.cpp:
1682         (WebCore::RenderSVGRoot::RenderSVGRoot):
1683         (WebCore::RenderSVGRoot::updateCachedBoundaries):
1684         * rendering/svg/RenderSVGRoot.h:
1685         * rendering/svg/RenderSVGShape.cpp:
1686         (WebCore::RenderSVGShape::updateRepaintBoundingBox):
1687         * rendering/svg/RenderSVGShape.h:
1688         * rendering/svg/SVGRenderSupport.cpp:
1689         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
1690         (WebCore::SVGRenderSupport::layoutChildren):
1691         (WebCore::SVGRenderSupport::styleChanged):
1692         (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow): Deleted.
1693         (WebCore::SVGRenderSupport::rendererHasSVGShadow): Deleted.
1694         (WebCore::SVGRenderSupport::setRendererHasSVGShadow): Deleted.
1695         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows): Deleted.
1696         (WebCore::SVGRenderSupport::childAdded): Deleted.
1697         * rendering/svg/SVGRenderSupport.h:
1698
1699 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
1700
1701         Unreviewed, rolling out r238065.
1702
1703         Breaks internal builds.
1704
1705         Reverted changeset:
1706
1707         "Make it possible to edit images inline"
1708         https://bugs.webkit.org/show_bug.cgi?id=191352
1709         https://trac.webkit.org/changeset/238065
1710
1711 2018-11-10  Tim Horton  <timothy_horton@apple.com>
1712
1713         Make it possible to edit images inline
1714         https://bugs.webkit.org/show_bug.cgi?id=191352
1715         <rdar://problem/30107985>
1716
1717         Reviewed by Dean Jackson.
1718
1719         Tests: editing/images/basic-editable-image.html
1720                editing/images/reparent-editable-image-maintains-strokes.html
1721
1722         Add the beginnings of a mechanism to replace images with a special attribute
1723         with a native drawing view in the UI process.
1724
1725         * page/Settings.yaml:
1726         Add a setting to control whether images become natively editable when they
1727         have the x-apple-editable-image attribute.
1728
1729         * html/HTMLImageElement.cpp:
1730         (WebCore::HTMLImageElement::editableImageViewID const):
1731         Lazily generate an EmbeddedViewID and persist it on the <img> element.
1732
1733         * html/HTMLImageElement.h:
1734         Rearrange the service controls methods to sit before the members.
1735         Add m_editableImageViewID and editableImageViewID().
1736
1737         * platform/graphics/GraphicsLayer.cpp:
1738         (WebCore::GraphicsLayer::nextEmbeddedViewID):
1739         * platform/graphics/GraphicsLayer.h:
1740         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
1741         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
1742         on Cocoa platforms and when using RemoteLayerTree.
1743         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
1744         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
1745         and an EmbeddedViewID to uniquely identify and communicate about the
1746         embedded view (which may move between layers, since it is tied to an element).
1747
1748         * platform/graphics/ca/GraphicsLayerCA.cpp:
1749         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
1750         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
1751         When setting GraphicsLayer's contents to an embedded view, we use
1752         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
1753         GraphicsLayerCARemote will override this and make a correctly-initialized
1754         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
1755
1756         * platform/graphics/ca/GraphicsLayerCA.h:
1757         * platform/graphics/ca/PlatformCALayer.cpp:
1758         (WebCore::operator<<):
1759         * platform/graphics/ca/PlatformCALayer.h:
1760         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1761         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1762         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1763         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
1764         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
1765         These will be overridden by PlatformCALayerRemote to do more interesting things.
1766
1767         * rendering/RenderImage.cpp:
1768         (WebCore::RenderImage::isEditableImage const):
1769         Add a getter that return true if the setting is enabled and
1770         x-apple-editable-image is empty or true.
1771
1772         (WebCore::RenderImage::requiresLayer const):
1773         RenderImage requires a layer either if RenderReplaced does, or we are an
1774         editable image.
1775
1776         * rendering/RenderImage.h:
1777         * rendering/RenderLayer.cpp:
1778         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
1779         (WebCore::RenderLayer::calculateClipRects const):
1780         * rendering/RenderLayerBacking.cpp:
1781         (WebCore::RenderLayerBacking::updateConfiguration):
1782         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
1783
1784         * rendering/RenderLayerCompositor.cpp:
1785         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
1786         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1787         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1788         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
1789         * rendering/RenderLayerCompositor.h:
1790         Make editable images require compositing implicitly.
1791
1792 2018-11-09  Zalan Bujtas  <zalan@apple.com>
1793
1794         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
1795         https://bugs.webkit.org/show_bug.cgi?id=191078
1796         <rdar://problem/45736178>
1797
1798         Reviewed by Antti Koivisto.
1799
1800         1. Improve visuallyNonEmpty milestone confidence level.
1801             Ignore whitespace and non visible text content.
1802             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
1803             Check if the html/body is actually visible.
1804
1805         2. Issue initial paint soon after the milestone fires.
1806             Use a 0ms timer to flush the initial paint.
1807             Throttle additional flushes for 500ms and 1.5s (original behaviour).
1808
1809         3. Suspend optional style recalcs and layouts while painting is being throttled.
1810            When parsing yields we initiate a 0ms style recalc/layout timer.
1811            These optional layouts produce content that we have no intention to paint. 
1812
1813         * dom/Document.cpp:
1814         (WebCore::Document::scheduleStyleRecalc):
1815         (WebCore::Document::shouldScheduleLayout):
1816         * page/ChromeClient.h:
1817         * page/FrameView.cpp:
1818         (WebCore::FrameView::resetLayoutMilestones):
1819         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
1820         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
1821         (WebCore::FrameView::updateIsVisuallyNonEmpty):
1822         * page/FrameView.h:
1823         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
1824         * platform/graphics/FontCascade.h:
1825         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
1826         (WebCore::RenderText::RenderText):
1827
1828 2018-11-09  John Wilander  <wilander@apple.com>
1829
1830         Add ability to configure document.cookie lifetime cap through user defaults
1831         https://bugs.webkit.org/show_bug.cgi?id=191480
1832         <rdar://problem/45240871>
1833
1834         Reviewed by Chris Dumez.
1835
1836         No new tests. Existing test makes sure we don't regress.
1837
1838         This change makes the capped lifetime in seconds configurable through
1839         user defaults.
1840
1841         * platform/network/NetworkStorageSession.h:
1842         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1843         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
1844         (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted.
1845             Renamed setAgeCapForClientSideCookies().
1846         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1847         (WebCore::filterCookies):
1848         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1849
1850 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
1851
1852         Unreviewed, rolling out r238047.
1853
1854         Introduced layout test failures on iOS simulator.
1855
1856         Reverted changeset:
1857
1858         "[iOS] Draw caps lock indicator in password fields"
1859         https://bugs.webkit.org/show_bug.cgi?id=190565
1860         https://trac.webkit.org/changeset/238047
1861
1862 2018-11-09  Tim Horton  <timothy_horton@apple.com>
1863
1864         Normal-flow-only flex items don't correctly respect z-index
1865         https://bugs.webkit.org/show_bug.cgi?id=191486
1866
1867         Reviewed by Simon Fraser.
1868
1869         Test: css3/flexbox/z-index-with-normal-flow-only.html
1870
1871         * rendering/RenderLayer.cpp:
1872         (WebCore::canCreateStackingContext):
1873         r125693 did not ensure that flex items which would otherwise be
1874         normal-flow-only would be put into the z-order tree when necessary.
1875         Fix by respecting the same trigger we use to make layers for flex items;
1876         namely, not having auto z-index.
1877
1878 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1879
1880         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
1881         https://bugs.webkit.org/show_bug.cgi?id=191471
1882         <rdar://problem/45952472>
1883
1884         Reviewed by Tim Horton.
1885
1886         Add new method stubs for changing the list type for the current selection (to be implemented in a future patch).
1887
1888         * editing/Editor.cpp:
1889         (WebCore::Editor::canChangeSelectionListType):
1890         (WebCore::Editor::changeSelectionListType):
1891         * editing/Editor.h:
1892
1893 2018-11-09  Keith Rollin  <krollin@apple.com>
1894
1895         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
1896
1897         Remove the use of .xcfilelists until their side-effects are better
1898         understood.
1899
1900         * WebCore.xcodeproj/project.pbxproj:
1901
1902 2018-11-09  Jer Noble  <jer.noble@apple.com>
1903
1904         SourceBuffer throws an error when appending a second init segment after changeType().
1905         https://bugs.webkit.org/show_bug.cgi?id=191474
1906
1907         Reviewed by Eric Carlson.
1908
1909         Test: media/media-source/media-source-changetype-second-init.html
1910
1911         When encountering an initialization segment after changeType(), add the parsed codec types
1912         to the list of allowed codecs.
1913
1914         * Modules/mediasource/SourceBuffer.cpp:
1915         (WebCore::SourceBuffer::validateInitializationSegment):
1916         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
1917         (WebCore::MockMediaPlayerMediaSource::supportsType):
1918         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1919         (WebCore::MockSourceBufferPrivate::canSwitchToType):
1920         * platform/mock/mediasource/MockSourceBufferPrivate.h:
1921
1922 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
1923
1924         [MediaStream] AVVideoCaptureSource reports incorrect size when frames are scaled
1925         https://bugs.webkit.org/show_bug.cgi?id=191479
1926         <rdar://problem/45952201>
1927
1928         Reviewed by Jer Noble.
1929
1930         No new tests, tested manually.
1931
1932         * platform/mediastream/RealtimeVideoSource.cpp:
1933         (WebCore::RealtimeVideoSource::standardVideoSizes): Drive-by fix: add a few more standard
1934         video frame sizes, correct a typo.
1935         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): Drive-by fix: don't consider
1936         rescaled sized when we already have an exact or aspect ratio match because it won't be used.
1937
1938         * platform/mediastream/mac/AVVideoCaptureSource.h:
1939         (WebCore::AVVideoCaptureSource::width const): Deleted.
1940         (WebCore::AVVideoCaptureSource::height const): Deleted.
1941         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1942         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): Delete m_requestedSize.
1943         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete m_width and m_height.
1944         (WebCore::AVVideoCaptureSource::processNewFrame): Don't call setSize with captured size,
1945         the frame may be resized before deliver.
1946
1947 2018-11-09  Ross Kirsling  <ross.kirsling@sony.com>
1948
1949         Unreviewed MSVC build fix after r238039 (and r238046).
1950
1951         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1952         * bindings/js/JSWorkerGlobalScopeBase.h:
1953
1954 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
1955
1956         [Curl][WebKit] Implement Proxy configuration API.
1957         https://bugs.webkit.org/show_bug.cgi?id=189053
1958
1959         Reviewed by Youenn Fablet.
1960
1961         Added API to set proxy from the app.
1962
1963         No new tests because there's no behaviour change in WebCore.
1964
1965         * platform/network/NetworkStorageSession.h:
1966         * platform/network/curl/CurlContext.h:
1967         (WebCore::CurlContext::setProxySettings):
1968         * platform/network/curl/CurlProxySettings.h:
1969         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1970         (WebCore::NetworkStorageSession::setProxySettings const):
1971
1972 2018-11-09  Antti Koivisto  <antti@apple.com>
1973
1974         Use OptionSet for layout milestones
1975         https://bugs.webkit.org/show_bug.cgi?id=191470
1976
1977         Reviewed by Dean Jackson.
1978
1979         * WebCore.xcodeproj/project.pbxproj:
1980         * loader/EmptyFrameLoaderClient.h:
1981         * loader/FrameLoader.cpp:
1982         (WebCore::FrameLoader::didReachLayoutMilestone):
1983         * loader/FrameLoader.h:
1984         * loader/FrameLoaderClient.h:
1985         * page/FrameView.cpp:
1986         (WebCore::FrameView::FrameView):
1987         (WebCore::FrameView::addPaintPendingMilestones):
1988         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
1989         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
1990         * page/FrameView.h:
1991         * page/LayoutMilestone.h: Copied from Source/WebCore/page/LayoutMilestones.h.
1992
1993         Renamed to appease WK2 IPC code generation.
1994
1995         * page/LayoutMilestones.h: Removed.
1996         * page/Page.cpp:
1997         (WebCore::Page::addLayoutMilestones):
1998         (WebCore::Page::removeLayoutMilestones):
1999         (WebCore::Page::isCountingRelevantRepaintedObjects const):
2000         * page/Page.h:
2001         (WebCore::Page::requestedLayoutMilestones const):
2002
2003 2018-11-09  Daniel Bates  <dabates@apple.com>
2004
2005         [iOS] Draw caps lock indicator in password fields
2006         https://bugs.webkit.org/show_bug.cgi?id=190565
2007         <rdar://problem/45262343>
2008
2009         Reviewed by Dean Jackson.
2010
2011         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
2012         fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
2013         indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
2014         keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).
2015
2016         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
2017         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
2018         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
2019         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
2020         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
2021         web views listen for keyboard availability changes so as to update the the caps lock state when
2022         a hardware keyboard is detached or attached.
2023
2024         * WebCore.xcodeproj/project.pbxproj:
2025         * page/EventHandler.cpp:
2026         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
2027         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
2028         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
2029         * page/EventHandler.h:
2030         * platform/cocoa/KeyEventCocoa.mm:
2031         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
2032         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
2033         * platform/ios/KeyEventIOS.mm:
2034         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
2035         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
2036         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
2037         * platform/ios/WebEvent.h:
2038         * platform/ios/WebEvent.mm:
2039         (+[WebEvent modifierFlags]): Added.
2040         * platform/mac/KeyEventMac.mm:
2041         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
2042         by both Mac and iOS.
2043         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
2044         by both Mac and iOS.
2045         * rendering/RenderThemeCocoa.h:
2046         * rendering/RenderThemeCocoa.mm:
2047         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
2048         * rendering/RenderThemeIOS.h:
2049         * rendering/RenderThemeIOS.mm:
2050         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
2051         * rendering/RenderThemeMac.h:
2052         * rendering/RenderThemeMac.mm:
2053         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
2054         shared by both Mac and iOS.
2055
2056 2018-11-09  Chris Dumez  <cdumez@apple.com>
2057
2058         Unreviewed attempt to fix WinCairo build after r238039.
2059
2060         * bindings/js/JSWorkerGlobalScopeBase.h:
2061
2062 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
2063
2064         Extensions3DOpenGLES.h:  warning: 'blitFramebuffer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
2065         https://bugs.webkit.org/show_bug.cgi?id=191451
2066
2067         Reviewed by Dean Jackson.
2068
2069         No new tests because there is no behavior change.
2070
2071         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2072         (WebCore::Extensions3DOpenGLES::setEXTContextLostCallback): Deleted unused method.
2073         * platform/graphics/opengl/Extensions3DOpenGLES.h: Marked 'override'.
2074
2075 2018-11-09  Andy Estes  <aestes@apple.com>
2076
2077         [Payment Request] canMakePayment() should not consider serialized payment method data
2078         https://bugs.webkit.org/show_bug.cgi?id=191432
2079
2080         Reviewed by Dean Jackson.
2081
2082         In https://github.com/w3c/payment-request/pull/806, we're changing the specification of
2083         canMakePayment() to not consider serialized payment method data when deciding if a payment
2084         method is supported. For Apple Pay, this means we resolve to true for
2085         "https://apple.com/apple-pay", even if an ApplePayRequest is omitted or is missing required
2086         fields.
2087
2088         Added test cases to
2089         http/tests/paymentrequest/payment-request-canmakepayment-method.https.html and
2090         http/tests/paymentrequest/payment-request-show-method.https.html.
2091
2092         * Modules/paymentrequest/PaymentRequest.cpp:
2093         (WebCore::PaymentRequest::canMakePayment):
2094
2095 2018-11-09  Andy Estes  <aestes@apple.com>
2096
2097         [Payment Request] PaymentResponse.details should be updated when the user accepts a retried payment
2098         https://bugs.webkit.org/show_bug.cgi?id=191440
2099
2100         Reviewed by Dean Jackson.
2101
2102         PaymentResponse.details was being initialized in the PaymentResponse constructor and never
2103         updated when the user accepts a retried payment. We need to update it.
2104
2105         Added a test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
2106
2107         * Modules/paymentrequest/PaymentRequest.cpp:
2108         (WebCore::PaymentRequest::accept):
2109         * Modules/paymentrequest/PaymentResponse.cpp:
2110         (WebCore::PaymentResponse::PaymentResponse):
2111         (WebCore::PaymentResponse::setDetailsFunction):
2112         * Modules/paymentrequest/PaymentResponse.h:
2113
2114 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
2115
2116         MediaPlayerPrivateMediaFoundation.h: warning: 'GetService' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
2117         https://bugs.webkit.org/show_bug.cgi?id=191453
2118
2119         Reviewed by Per Arne Vollan.
2120
2121         No new tests because there is no behavior change.
2122
2123         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Marked with 'override' and removed 'virtual'.
2124
2125 2018-11-09  Chris Dumez  <cdumez@apple.com>
2126
2127         Unreviewed attempt to fix internal build on macOS.
2128
2129         'Export' is defined in several headers.
2130
2131         * bindings/js/JSDOMGlobalObject.cpp:
2132         * bindings/js/JSDOMGlobalObject.h:
2133         * bridge/jsc/BridgeJSC.cpp:
2134         * bridge/jsc/BridgeJSC.h:
2135
2136 2018-11-09  Chris Dumez  <cdumez@apple.com>
2137
2138         HTML form validation bubble disappears
2139         https://bugs.webkit.org/show_bug.cgi?id=191418
2140
2141         Reviewed by Simon Fraser.
2142
2143         If we validate a form and find an invalid form control, we'll scroll it into view and show
2144         the validation bubble. However, scrolling the element into view may be an asynchronous
2145         operation, in which case it would discard the validation bubble prematurely because scrolling
2146         hides the validation bubble. To address the issue, we now show the validation message
2147         asynchronously after focusing the element (and potentially scrolling it into view).
2148
2149         Test: fast/forms/scroll-into-view-and-show-validation-message.html
2150
2151         * html/HTMLFormControlElement.cpp:
2152         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
2153
2154 2018-11-09  Brent Fulgham  <bfulgham@apple.com>
2155
2156         [Windows][DirectX] Be more rigors about BeginFigure/EndFigure and Close operations. 
2157         https://bugs.webkit.org/show_bug.cgi?id=191452
2158         <rdar://problem/45933964>
2159
2160         Reviewed by Zalan Bujtas.
2161
2162         Do a better job of balancing the BeginFigure/EndFigure calls in
2163         the PathDirect2D implementation. Failure to do so puts the Geometry sink
2164         into an error state that prevents it from producing drawing output.
2165       
2166
2167         * platform/graphics/Path.h:
2168         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2169         (WebCore::GraphicsContext::drawPath): Flush is needed here.
2170         (WebCore::GraphicsContext::fillPath): Ditto.
2171         (WebCore::GraphicsContext::strokePath): Ditto.
2172         * platform/graphics/win/PathDirect2D.cpp:
2173         (WebCore::Path::drawDidComplete):
2174         (WebCore::Path::closeAnyOpenGeometries):
2175         (WebCore::Path::transform):
2176         (WebCore::Path::openFigureAtCurrentPointIfNecessary):
2177         (WebCore::Path::moveTo):
2178         (WebCore::Path::closeSubpath):
2179
2180 2018-11-09  Jer Noble  <jer.noble@apple.com>
2181
2182         [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
2183         https://bugs.webkit.org/show_bug.cgi?id=191396
2184
2185         Reviewed by Eric Carlson.
2186
2187         When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
2188         from "same codec" requirements.
2189
2190         * Modules/mediasource/SourceBuffer.cpp:
2191         (WebCore::SourceBuffer::validateInitializationSegment):
2192
2193 2018-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2194
2195         REGRESSION(r236365): [GTK] Many form-related tests are failing
2196         https://bugs.webkit.org/show_bug.cgi?id=189993
2197
2198         Reviewed by Michael Catanzaro.
2199
2200         Only the first form data element is added to the message body due to a return added by mistake in r236365.
2201
2202         * platform/network/soup/ResourceRequestSoup.cpp:
2203         (WebCore::ResourceRequest::updateSoupMessageBody const): Remove return.
2204
2205 2018-11-09  Zalan Bujtas  <zalan@apple.com>
2206
2207         [LFC][IFC] Move some code from InlineFormattingContext::Line to InlineFormattingContext/Geometry
2208         https://bugs.webkit.org/show_bug.cgi?id=191445
2209
2210         Reviewed by Antti Koivisto.
2211
2212         The idea here is that Line should not have to deal with all the post processig tasks like the runs final aligments.
2213         (The line class would eventually turn into a collection of random things).
2214
2215         * layout/inlineformatting/InlineFormattingContext.cpp:
2216         (WebCore::Layout::InlineFormattingContext::closeLine const):
2217         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2218         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2219         * layout/inlineformatting/InlineFormattingContext.h:
2220         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
2221         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const):
2222         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2223         (WebCore::Layout::InlineFormattingContext::Geometry::adjustedLineLogicalLeft):
2224         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
2225         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
2226         * layout/inlineformatting/Line.cpp:
2227         (WebCore::Layout::InlineFormattingContext::Line::Line):
2228         (WebCore::Layout::InlineFormattingContext::Line::init):
2229         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
2230         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2231         (WebCore::Layout::InlineFormattingContext::Line::close):
2232         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
2233         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): Deleted.
2234         (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): Deleted.
2235         (WebCore::Layout::InlineFormattingContext::Line::justifyRuns): Deleted.
2236
2237 2018-11-09  Philippe Normand  <pnormand@igalia.com>
2238
2239         Unreviewed, GStreamer build warning fix
2240
2241         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2242         (WebCore::GStreamerVideoEncoder::newSampleCallback): Timesamp()
2243         returns a uint32_t, fix format string accordingly.
2244
2245 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2246
2247         Add an SPI to allow WebView clients to add additional supported image formats
2248         https://bugs.webkit.org/show_bug.cgi?id=190454
2249
2250         Reviewed by Simon Fraser.
2251
2252         Add an SPI to allow additional supported image formats in WebView. These
2253         additional formats can be set in the WKWebViewConfiguration as an NSArray
2254         of NStrings. Each string represents an image source type aka UTI.
2255
2256         The ImageSourceType in the functions' names will be replaced by ImageType.
2257         ImageType in this context is the image UTI (Uniform Type Identifier).
2258
2259         * platform/MIMETypeRegistry.cpp:
2260         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
2261         (WebCore::MIMETypeRegistry::additionalSupportedImageMIMETypes):
2262         (WebCore::supportedImageMIMETypesForEncoding):
2263         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
2264         * platform/MIMETypeRegistry.h:
2265         * platform/graphics/cg/ImageDecoderCG.cpp:
2266         (WebCore::ImageDecoderCG::filenameExtension const):
2267         (WebCore::ImageDecoderCG::encodedDataStatus const):
2268         * platform/graphics/cg/ImageSourceCG.h:
2269         * platform/graphics/cg/ImageSourceCGMac.mm:
2270         (WebCore::MIMETypeForImageType):
2271         (WebCore::preferredExtensionForImageType):
2272         (WebCore::MIMETypeForImageSourceType): Deleted.
2273         (WebCore::preferredExtensionForImageSourceType): Deleted.
2274         * platform/graphics/cg/ImageSourceCGWin.cpp:
2275         (WebCore::MIMETypeForImageType):
2276         (WebCore::preferredExtensionForImageType):
2277         (WebCore::MIMETypeForImageSourceType): Deleted.
2278         (WebCore::preferredExtensionForImageSourceType): Deleted.
2279         * platform/graphics/cg/UTIRegistry.cpp:
2280         (WebCore::defaultSupportedImageTypes):
2281         (WebCore::additionalSupportedImageTypes):
2282         (WebCore::setAdditionalSupportedImageTypes):
2283         (WebCore::isSupportedImageType):
2284         (WebCore::supportedDefaultImageSourceTypes): Deleted.
2285         (WebCore::isSupportImageSourceType): Deleted.
2286         * platform/graphics/cg/UTIRegistry.h:
2287
2288 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
2289
2290         Adopt Reveal Framework to replace Lookup
2291         https://bugs.webkit.org/show_bug.cgi?id=191097
2292
2293         Reviewed by Tim Horton.
2294
2295         Reveal is not currently testable.
2296
2297         The Reveal framework does the same job as Lookup and DataDectors.
2298         In this patch we switch from using Lookup to determine what text
2299         to select and define to using Reveal and RVItems. Since this
2300         code needs to work on older systems, and Reveal is newer, we also need
2301         to keep around the old code for old systems so that they can also
2302         continue to work. Eventually we will remove this code and also likly switch
2303         to passing RVItems across from the web process rather than making them
2304         on each side.
2305
2306         * SourcesCocoa.txt:
2307         * WebCore.xcodeproj/project.pbxproj:
2308         * editing/mac/DictionaryLookup.h:
2309         * editing/mac/DictionaryLookup.mm:
2310
2311         Create a delegate to respond to Reveal and help draw the string or highlight.
2312
2313         (-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]):
2314         (-[WebRevealHighlight setClearTextIndicator:]):
2315         (-[WebRevealHighlight revealContext:rectsForItem:]):
2316         (-[WebRevealHighlight revealContext:drawRectsForItem:]):
2317         (-[WebRevealHighlight revealContext:shouldUseDefaultHighlightForItem:]):
2318         (-[WebRevealHighlight revealContext:stopHighlightingItem:]):
2319         (WebCore::showPopupOrCreateAnimationController):
2320
2321         Unify the code paths and utalize the Reveal framework to create and/or display the popovers.
2322
2323         (WebCore::DictionaryLookup::showPopup):
2324         (WebCore::DictionaryLookup::animationControllerForPopup):
2325
2326         Pipe the new callback through.
2327
2328         (WebCore::tokenRange): Deleted.
2329
2330         Only used with Lookup
2331
2332         (WebCore::selectionContainsPosition): Deleted.
2333
2334         Only used with Lookup.
2335
2336         * editing/mac/DictionaryLookupLegacy.mm: Copied from Source/WebCore/editing/mac/DictionaryLookup.mm.
2337
2338         Keep a copy of the previous implementation of DictionaryLookup, because Reveal not available on older
2339         system.
2340
2341         (WebCore::tokenRange):
2342         (WebCore::selectionContainsPosition):
2343         (WebCore::expandSelectionByCharacters):
2344         (WebCore::showPopupOrCreateAnimationController):
2345         (WebCore::DictionaryLookup::showPopup):
2346         (WebCore::DictionaryLookup::hidePopup):
2347         (WebCore::DictionaryLookup::animationControllerForPopup):
2348
2349 2018-11-08  Keith Rollin  <krollin@apple.com>
2350
2351         Create .xcfilelist files
2352         https://bugs.webkit.org/show_bug.cgi?id=191324
2353         <rdar://problem/45852819>
2354
2355         Reviewed by Alex Christensen.
2356
2357         As part of preparing for enabling XCBuild, create and use .xcfilelist
2358         files. These files are using during Run Script build phases in an
2359         Xcode project. If a Run Script build phase produces new files that are
2360         used later as inputs to subsequent build phases, XCBuild needs to know
2361         about these files. These files can be either specified in an "output
2362         files" section of the Run Script phase editor, or in .xcfilelist files
2363         that are associated with the Run Script build phase.
2364
2365         This patch takes the second approach. It consists of three sets of changes:
2366
2367         - Modify the DerivedSources.make files to have a
2368           'print_all_generated_files" target that produces a list of the files
2369           they create.
2370
2371         - Create a shell script that produces .xcfilelist files from the
2372           output of the previous step, as well as for the files created in the
2373           Generate Unified Sources build steps.
2374
2375         - Add the new .xcfilelist files to the associated projects.
2376
2377         Note that, with these changes, the Xcode workspace and projects can no
2378         longer be fully loaded into Xcode 9. Xcode will attempt to load the
2379         projects that have .xcfilelist files associated with them, but will
2380         fail and display a placeholder for those projects instead. It's
2381         expected that all developers are using Xcode 10 by now and that not
2382         being able to load into Xcode 9 is not a practical issue. Keep in mind
2383         that this is strictly an IDE issue, and that the projects can still be
2384         built with `xcodebuild`.
2385
2386         Also note that the shell script that creates the .xcfilelist files can
2387         also be used to verify that the set of files that's currently checked
2388         in is up-to-date. This checking can be used as part of a check-in hook
2389         or part of check-webkit-style to sooner catch cases where the
2390         .xcfilelist files need to be regenerated.
2391
2392         No new tests -- no changed functionality.
2393
2394         * DerivedSources.make:
2395         * DerivedSources.xcfilelist: Added.
2396         * UnifiedSources.xcfilelist: Added.
2397         * WebCore.xcodeproj/project.pbxproj:
2398
2399 2018-11-08  Don Olmstead  <don.olmstead@sony.com>
2400
2401         Provide generic implementation of SSLKeyGenerator functions
2402         https://bugs.webkit.org/show_bug.cgi?id=191428
2403
2404         Reviewed by Michael Catanzaro.
2405
2406         No new tests. No change in behavior.
2407
2408         Both SSLKeyGeneratorGLib and SSLKeyGeneratorIOS were stub
2409         implementations. Since <keygen> is deprecated it looks unlikely that
2410         an implementation is actually needed, however an implementation is
2411         needed until support is reomved.
2412
2413         * Sources.txt:
2414         * SourcesCocoa.txt:
2415         * WebCore.xcodeproj/project.pbxproj:
2416         * platform/SSLKeyGenerator.cpp: Added.
2417         (WebCore::getSupportedKeySizes):
2418         (WebCore::signedPublicKeyAndChallengeString):
2419         * platform/SourcesGLib.txt:
2420         * platform/glib/SSLKeyGeneratorGLib.cpp: Removed.
2421         * platform/ios/SSLKeyGeneratorIOS.cpp: Removed.
2422
2423 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
2424
2425         Unprefix text-decoration CSS3 properties
2426         https://bugs.webkit.org/show_bug.cgi?id=127193
2427
2428         Reviewed by Dean Jackson.
2429
2430         The properties are stable, and there is interop.
2431
2432         Test: fast/css3-text/css3-text-decoration/unprefix.html
2433
2434         * css/CSSComputedStyleDeclaration.cpp:
2435         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2436         * css/CSSProperties.json:
2437         * css/StyleResolver.cpp:
2438         (WebCore::shouldApplyPropertyInParseOrder):
2439         (WebCore::isValidVisitedLinkProperty):
2440         * css/parser/CSSParserFastPaths.cpp:
2441         (WebCore::isColorPropertyID):
2442         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2443         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2444         * css/parser/CSSPropertyParser.cpp:
2445         (WebCore::CSSPropertyParser::parseSingleValue):
2446         * editing/cocoa/DataDetection.mm:
2447         (WebCore::DataDetection::detectContentInRange):
2448         * rendering/TextDecorationPainter.cpp:
2449         (WebCore::decorationColor):
2450         * rendering/style/RenderStyle.cpp:
2451         (WebCore::RenderStyle::colorIncludingFallback const):
2452         (WebCore::RenderStyle::visitedDependentColor const):
2453
2454 2018-11-08  Timothy Hatcher  <timothy@apple.com>
2455
2456         Add experimental support for a `supported-color-schemes` CSS property.
2457         https://bugs.webkit.org/show_bug.cgi?id=191319
2458         rdar://problem/45852261
2459
2460         Reviewed by Dean Jackson.
2461
2462         Tests: css-dark-mode/parse-supported-color-schemes.html
2463                css-dark-mode/supported-color-schemes-css.html
2464
2465         * WebCore.xcodeproj/project.pbxproj:
2466         * css/CSSComputedStyleDeclaration.cpp:
2467         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2468         * css/CSSProperties.json:
2469         * css/CSSValueKeywords.in:
2470         * css/StyleBuilderConverter.h:
2471         (WebCore::StyleBuilderConverter::updateSupportedColorSchemes):
2472         (WebCore::StyleBuilderConverter::convertSupportedColorSchemes):
2473         * css/StyleResolver.cpp:
2474         (WebCore::StyleResolver::colorFromPrimitiveValue const):
2475         * css/parser/CSSPropertyParser.cpp:
2476         (WebCore::consumeSupportedColorSchemes):
2477         (WebCore::CSSPropertyParser::parseSingleValue):
2478         * dom/Document.cpp:
2479         (WebCore::Document::resetLinkColor):
2480         (WebCore::Document::resetVisitedLinkColor):
2481         (WebCore::Document::resetActiveLinkColor):
2482         (WebCore::Document::processSupportedColorSchemes):
2483         (WebCore::Document::useDarkAppearance const):
2484         (WebCore::Document::styleColorOptions const):
2485         * dom/Document.h:
2486         * editing/cocoa/WebContentReaderCocoa.mm:
2487         (WebCore::createFragment):
2488         * html/canvas/CanvasRenderingContext2D.cpp:
2489         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
2490         * inspector/InspectorOverlay.cpp:
2491         (WebCore::InspectorOverlay::paint):
2492         * page/FrameView.cpp:
2493         (WebCore::FrameView::useDarkAppearance const):
2494         (WebCore::FrameView::paintScrollCorner):
2495         * platform/mac/DragImageMac.mm:
2496         (WebCore::createDragImageForLink):
2497         * rendering/InlineFlowBox.cpp:
2498         (WebCore::InlineFlowBox::paintBoxDecorations):
2499         * rendering/InlineTextBox.cpp:
2500         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
2501         * rendering/RenderBox.cpp:
2502         (WebCore::RenderBox::paintRootBoxFillLayers):
2503         (WebCore::RenderBox::paintBackground):
2504         * rendering/RenderElement.cpp:
2505         (WebCore::RenderElement::selectionColor const):
2506         (WebCore::RenderElement::selectionBackgroundColor const):
2507         (WebCore::RenderElement::paintFocusRing):
2508         * rendering/RenderImage.cpp:
2509         (WebCore::RenderImage::paintAreaElementFocusRing):
2510         * rendering/RenderLayerBacking.cpp:
2511         (WebCore::RenderLayerBacking::paintContents):
2512         * rendering/RenderLayerCompositor.cpp:
2513         (WebCore::RenderLayerCompositor::paintContents):
2514         * rendering/RenderListBox.cpp:
2515         (WebCore::RenderListBox::paintItemForeground):
2516         (WebCore::RenderListBox::paintItemBackground):
2517         * rendering/RenderObject.cpp:
2518         (WebCore::RenderObject::useDarkAppearance const):
2519         (WebCore::RenderObject::styleColorOptions const):
2520         * rendering/RenderObject.h:
2521         * rendering/RenderTableCell.cpp:
2522         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
2523         * rendering/RenderTheme.cpp:
2524         (WebCore::RenderTheme::paint):
2525         * rendering/RenderTheme.h:
2526         (WebCore::RenderTheme::usingDarkAppearance const): Deleted.
2527         * rendering/RenderThemeMac.h:
2528         * rendering/RenderThemeMac.mm:
2529         (WebCore::RenderThemeMac::documentViewFor const):
2530         (WebCore::RenderThemeMac::adjustMenuListStyle const):
2531         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
2532         (WebCore::RenderThemeMac::paintSliderThumb):
2533         (WebCore::RenderThemeMac::usingDarkAppearance const): Deleted.
2534         * rendering/style/RenderStyle.h:
2535         (WebCore::RenderStyle::supportedColorSchemes const):
2536         (WebCore::RenderStyle::setSupportedColorSchemes):
2537         (WebCore::RenderStyle::initialSupportedColorSchemes):
2538         * rendering/style/RenderStyleConstants.h:
2539         * rendering/style/StyleRareInheritedData.cpp:
2540         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2541         (WebCore::StyleRareInheritedData::operator== const):
2542         * rendering/style/StyleRareInheritedData.h:
2543         * rendering/style/StyleSupportedColorSchemes.h: Added.
2544         (WebCore::StyleSupportedColorSchemes::StyleSupportedColorSchemes):
2545         (WebCore::StyleSupportedColorSchemes::operator== const):
2546         (WebCore::StyleSupportedColorSchemes::operator!= const):
2547         (WebCore::StyleSupportedColorSchemes::isAuto const):
2548         (WebCore::StyleSupportedColorSchemes::isOnly const):
2549         (WebCore::StyleSupportedColorSchemes::colorSchemes const):
2550         (WebCore::StyleSupportedColorSchemes::add):
2551         (WebCore::StyleSupportedColorSchemes::contains const):
2552         (WebCore::StyleSupportedColorSchemes::setAllowsTransformations):
2553         (WebCore::StyleSupportedColorSchemes::allowsTransformations const):
2554         * svg/graphics/SVGImage.cpp:
2555         (WebCore::SVGImage::draw):
2556
2557 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
2558
2559         Web Inspector: Restrict domains at the target level instead of only at the window level
2560         https://bugs.webkit.org/show_bug.cgi?id=191344
2561
2562         Reviewed by Devin Rousso.
2563
2564         * inspector/WorkerInspectorController.cpp:
2565         (WebCore::WorkerInspectorController::WorkerInspectorController):
2566         Remove Inspector domain from workers. It was unused anyways.
2567
2568 2018-11-08  Dean Jackson  <dino@apple.com>
2569
2570         Add a String literal that returns a String
2571         https://bugs.webkit.org/show_bug.cgi?id=191425
2572         <rdar://problem/45914556>
2573
2574         Reviewed by Sam Weinig.
2575
2576         Use _str where possible.
2577
2578         API Test in WPT.
2579
2580         * Modules/fetch/FetchRequest.cpp:
2581         (WebCore::computeReferrer):
2582         * Modules/indexeddb/IDBKeyPath.cpp:
2583         (WebCore::loggingString):
2584         * Modules/webdatabase/OriginLock.cpp:
2585         (WebCore::OriginLock::lockFileNameForPath):
2586         * css/CSSBasicShapes.cpp:
2587         (WebCore::updateCornerRadiusWidthAndHeight):
2588         * html/canvas/WebGL2RenderingContext.cpp:
2589         (WebCore::WebGL2RenderingContext::getParameter):
2590         * html/canvas/WebGLRenderingContext.cpp:
2591         (WebCore::WebGLRenderingContext::getParameter):
2592         * loader/LinkHeader.cpp:
2593         (WebCore::parseParameterValue):
2594         * loader/LinkLoader.cpp:
2595         (WebCore::LinkLoader::preloadIfNeeded):
2596         * page/NavigatorBase.cpp:
2597         (WebCore::NavigatorBase::platform):
2598         * platform/DateComponents.cpp:
2599         (WebCore::DateComponents::toString const):
2600         * platform/mac/PlatformEventFactoryMac.mm:
2601         (WebCore::keyIdentifierForKeyEvent):
2602         * rendering/RenderListMarker.cpp:
2603         (WebCore::RenderListMarker::suffix const):
2604         * rendering/RenderMenuList.cpp:
2605         (RenderMenuList::setText):
2606         * testing/InternalSettings.cpp:
2607         (WebCore::InternalSettings::userInterfaceDirectionPolicy):
2608         (WebCore::InternalSettings::systemLayoutDirection):
2609         * testing/Internals.cpp:
2610         (WebCore::Internals::shadowRootType const):
2611         (WebCore::Internals::getCurrentCursorInfo):
2612
2613 2018-11-08  Jonathan Hammer  <jonathan@e3software.com>
2614
2615         Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
2616         https://bugs.webkit.org/show_bug.cgi?id=191228
2617         <rdar://problem/45786830>
2618
2619         Reviewed by Wenson Hsieh.
2620
2621         DragController::beginDrag should not call cleanupAfterSystemDrag because
2622         the drag is still in progress even after the call to m_client.beginDrag()
2623         returns. This is in contrast to DragController::doSystemDrag, where the
2624         call to cleanupAfterSystemDrag is appropriate because the drag has
2625         concluded by the time m_client.startDrag() returns.
2626
2627         Test: fast/events/drag-and-drop-move-not-copy.html
2628
2629         * page/DragController.cpp:
2630         (WebCore::DragController::beginDrag):
2631
2632 2018-11-08  Zalan Bujtas  <zalan@apple.com>
2633
2634         [BFC][IFC] InlineFormattingContext::Line::alignRuns() should take care of all the alignments.
2635         https://bugs.webkit.org/show_bug.cgi?id=191414
2636
2637         Reviewed by Antti Koivisto.
2638
2639         * layout/inlineformatting/Line.cpp:
2640         (WebCore::Layout::InlineFormattingContext::Line::close):
2641
2642 2018-11-08  Jiewen Tan  <jiewen_tan@apple.com>
2643
2644         [WebAuthN] Import CTAP device request/response converters from Chromium
2645         https://bugs.webkit.org/show_bug.cgi?id=190784
2646         <rdar://problem/45460333>
2647
2648         Reviewed by Brent Fulgham.
2649
2650         This patch imports Chromium's CTAP device request/response converters:
2651         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-encoding
2652         1. It directly imports the following files and suit them to WebKit's coding style:
2653         https://cs.chromium.org/chromium/src/device/fido/device_response_converter.cc?l=20&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2654         https://cs.chromium.org/chromium/src/device/fido/device_response_converter.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2655         https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2656         https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2657         https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2658         https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2659         https://cs.chromium.org/chromium/src/device/fido/ctap_request_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2660         https://cs.chromium.org/chromium/src/device/fido/ctap_response_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2661         https://cs.chromium.org/chromium/src/device/fido/fido_test_data.h?l=1&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2662         2. It gathers the following methods into DeviceRequestConverter:
2663         CtapGetAssertionRequest::EncodeAsCBOR()
2664         CtapMakeCredentialRequest::EncodeAsCBOR()
2665         PublicKeyCredentialDescriptor::ConvertToCBOR()
2666         PublicKeyCredentialParams::ConvertToCBOR()
2667         PublicKeyCredentialRpEntity::ConvertToCBOR()
2668         PublicKeyCredentialUserEntity::ConvertToCBOR()
2669         3. It also apply a patch from Chromium to CBORValue:
2670         https://chromium.googlesource.com/chromium/src/+/7b6fbff35cd8e4d508f08e1cd93b4aa0a0dc402c%5E%21/
2671
2672         Besides importing things from Chromium, it also implements UserVerificationRequirement for both
2673         PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions such that both options
2674         can specify more dimensions of a desired authenticator.
2675
2676         Covered by API tests.
2677
2678         * CMakeLists.txt:
2679         * DerivedSources.make:
2680         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2681         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode const):
2682         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
2683         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
2684         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
2685         (WebCore::PublicKeyCredentialRequestOptions::encode const):
2686         (WebCore::PublicKeyCredentialRequestOptions::decode):
2687         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
2688         * Modules/webauthn/UserVerificationRequirement.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
2689         * Modules/webauthn/UserVerificationRequirement.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
2690         * Modules/webauthn/cbor/CBORValue.cpp:
2691         (cbor::CBORValue::CBORValue):
2692         (cbor::CBORValue::getBool const):
2693         * Modules/webauthn/cbor/CBORValue.h:
2694         * Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp: Added.
2695         (fido::toArrayValue):
2696         (fido::AuthenticatorGetInfoResponse::AuthenticatorGetInfoResponse):
2697         (fido::AuthenticatorGetInfoResponse::setMaxMsgSize):
2698         (fido::AuthenticatorGetInfoResponse::setPinProtocols):
2699         (fido::AuthenticatorGetInfoResponse::setExtensions):
2700         (fido::AuthenticatorGetInfoResponse::setOptions):
2701         (fido::encodeAsCBOR):
2702         * Modules/webauthn/fido/AuthenticatorGetInfoResponse.h: Added.
2703         * Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp: Added.
2704         (fido::AuthenticatorSupportedOptions::setSupportsResidentKey):
2705         (fido::AuthenticatorSupportedOptions::setUserVerificationAvailability):
2706         (fido::AuthenticatorSupportedOptions::setUserPresenceRequired):
2707         (fido::AuthenticatorSupportedOptions::setClientPinAvailability):
2708         (fido::AuthenticatorSupportedOptions::setIsPlatformDevice):
2709         (fido::convertToCBOR):
2710         * Modules/webauthn/fido/AuthenticatorSupportedOptions.h: Added.
2711         * Modules/webauthn/fido/DeviceRequestConverter.cpp: Added.
2712         (fido::convertRpEntityToCBOR):
2713         (fido::convertUserEntityToCBOR):
2714         (fido::convertParametersToCBOR):
2715         (fido::convertDescriptorToCBOR):
2716         (fido::encodeMakeCredenitalRequestAsCBOR):
2717         (fido::encodeGetAssertionRequestAsCBOR):
2718         (fido::encodeEmptyAuthenticatorRequest):
2719         * Modules/webauthn/fido/DeviceRequestConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.h.
2720         * Modules/webauthn/fido/DeviceResponseConverter.cpp: Added.
2721         (fido::convertStringToProtocolVersion):
2722         (fido::getResponseCode):
2723         (fido::getCredentialId):
2724         (fido::readCTAPMakeCredentialResponse):
2725         (fido::readCTAPGetAssertionResponse):
2726         (fido::readCTAPGetInfoResponse):
2727         * Modules/webauthn/fido/DeviceResponseConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp.
2728         * Modules/webauthn/fido/FidoConstants.cpp:
2729         (fido::isCtapDeviceResponseCode):
2730         (fido::publicKeyCredentialTypeToString):
2731         * Modules/webauthn/fido/FidoConstants.h:
2732         * Sources.txt:
2733         * WebCore.xcodeproj/project.pbxproj:
2734
2735 2018-11-07  Justin Michaud  <justin_michaud@apple.com>
2736
2737         CSS Painting API should pass size, arguments and input properties to paint callback
2738         https://bugs.webkit.org/show_bug.cgi?id=191309
2739
2740         Reviewed by Chris Dumez.
2741
2742         Call paint() callback with input properties and arguments. This patch adds a stub for 
2743         the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without 
2744         any syntax checking to the paint callback.
2745
2746         Test: fast/css-custom-paint/properties.html
2747
2748         * CMakeLists.txt:
2749         * DerivedSources.make:
2750         * Sources.txt:
2751         * WebCore.xcodeproj/project.pbxproj:
2752         * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
2753         (WebCore::toJSNewlyCreated):
2754         (WebCore::toJS):
2755         * bindings/js/WebCoreBuiltinNames.h:
2756         * css/CSSPaintCallback.h:
2757         * css/CSSPaintCallback.idl:
2758         * css/CSSPaintImageValue.cpp:
2759         (WebCore::CSSPaintImageValue::image):
2760         * css/CSSPaintImageValue.h:
2761         * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
2762         (WebCore::CSSPaintSize::create):
2763         (WebCore::CSSPaintSize::width const):
2764         (WebCore::CSSPaintSize::height const):
2765         (WebCore::CSSPaintSize::CSSPaintSize):
2766         * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
2767         * css/parser/CSSPropertyParserHelpers.cpp:
2768         (WebCore::CSSPropertyParserHelpers::consumeCustomPaint):
2769         * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
2770         * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
2771         * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
2772         (WebCore::CSSStyleValue::isUnitValue):
2773         (WebCore::CSSStyleValue::isUnparsedValue):
2774         * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
2775         * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
2776         * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
2777         * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
2778         * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
2779         * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
2780         (WebCore::StylePropertyMapReadOnly::create):
2781         (WebCore::StylePropertyMapReadOnly::get):
2782         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
2783         * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
2784         * platform/graphics/CustomPaintImage.cpp:
2785         (WebCore::CustomPaintImage::CustomPaintImage):
2786         (WebCore::CustomPaintImage::doCustomPaint):
2787         * platform/graphics/CustomPaintImage.h:
2788
2789 2018-11-07  Brent Fulgham  <bfulgham@apple.com>
2790
2791         Provide better Font fallbacks for DirectX backend
2792         https://bugs.webkit.org/show_bug.cgi?id=191412
2793         <rdar://problem/45899207>
2794
2795         Reviewed by Zalan Bujtas.
2796
2797         Registration of custom fonts through GDI are not always visible
2798         through the DirectWrite/GDI bridging layer. If a font is not located,
2799         locate the closest matching avialable font rather than failing.
2800
2801         * platform/graphics/FontPlatformData.h:
2802         * platform/graphics/win/FontCustomPlatformData.cpp:
2803         (WebCore::FontCustomPlatformData::fontPlatformData): Use new font
2804         fallback logic.
2805         * platform/graphics/win/FontPlatformDataDirect2D.cpp:
2806         (WebCore::FontPlatformData::platformDataInit):
2807         (WebCore::FontPlatformData::platformIsEqual const):
2808         (WebCore::FontPlatformData::createFallbackFont): Added.
2809
2810 2018-11-07  Zalan Bujtas  <zalan@apple.com>
2811
2812         Click and touch event listeners on the body don't work
2813         https://bugs.webkit.org/show_bug.cgi?id=191392
2814         <rdar://problem/5844416>
2815
2816         Reviewed by Simon Fraser.
2817
2818         Remove the old quirk of ignoring onclick handlers on the body and beyond.
2819
2820         Test: fast/events/click-handler-on-body-simple.html
2821
2822         * page/ios/FrameIOS.mm:
2823         (WebCore::Frame::nodeRespondingToClickEvents):
2824
2825 2018-11-07  Brent Fulgham  <bfulgham@apple.com>
2826
2827         [Windows][DirectX] Update canvas code to pass more tests
2828         https://bugs.webkit.org/show_bug.cgi?id=191337
2829         <rdar://problem/45878801>
2830
2831         Reviewed by Dean Jackson.
2832
2833         Update the Direct2D code paths to comply with our canvas tests, improving the
2834         the test results scores to 579/770.
2835
2836         PathDirect2D was updated with an implementation of 'addArcTo' based on work by
2837         Dirk Schulze <vbs85@gmx.de> (see https://hg.mozilla.org/mozilla-central/rev/b116b49459f8).
2838
2839         Tests: canvas/philip/tests
2840
2841         * platform/graphics/ImageBuffer.cpp:
2842         (WebCore::ImageBuffer::createCompatibleBuffer): Direct2D needs access to the graphics
2843         context to create the buffer.
2844         * platform/graphics/ImageBuffer.h:
2845         * platform/graphics/Path.h:
2846         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2847         (WebCore::GraphicsContext::drawPattern): Flush needed.
2848         (WebCore::GraphicsContext::drawRect): Ditto.
2849         (WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Correct for Direct2D definition of miter limit.
2850         (WebCore::GraphicsContextPlatformPrivate::strokeStyleProperties const): Added helper function.
2851         (WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Update for new helper.
2852         (WebCore::GraphicsContext::drawLine): Ditto.
2853         (WebCore::drawWithShadowHelper): Ditto.
2854         (WebCore::GraphicsContext::fillRect): Add flush.
2855         (WebCore::GraphicsContext::platformFillRoundedRect): Update for helper.
2856         (WebCore::GraphicsContext::clipPath): Add flush.
2857         (WebCore::GraphicsContext::strokeRect): Ditto.
2858         (WebCore::GraphicsContext::drawLineForText): Update for upstream changes.
2859         (WebCore::GraphicsContext::drawLinesForText): Ditto.
2860         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
2861         * platform/graphics/win/ImageBufferDirect2D.cpp:
2862         (WebCore::createCroppedImageIfNecessary): Add missing implementations.
2863         (WebCore::createBitmapImageAfterScalingIfNeeded): Ditto.
2864         (WebCore::ImageBuffer::copyImage const): Ditto.
2865         (WebCore::ImageBuffer::sinkIntoImage): Ditto.
2866         (WebCore::ImageBuffer::fastCopyImageMode): Ditto.
2867         (WebCore::ImageBuffer::sinkIntoNativeImage): Ditto.
2868         (WebCore::ImageBuffer::copyNativeImage const): Ditto.
2869         * platform/graphics/win/PathDirect2D.cpp:
2870         (WebCore::Path::operator=):
2871         (WebCore::Path::drawDidComplete): This should never have been const.
2872         It manipulates the path!
2873         (WebCore::Path::transform): Properly transform existing geometries.
2874         (WebCore::Path::openFigureAtCurrentPointIfNecessary): Added.
2875         (WebCore::Path::moveTo):
2876         (WebCore::Path::addLineTo): Make sure figure starts at a valid point.
2877         (WebCore::Path::addQuadCurveTo): Ditto.
2878         (WebCore::Path::addBezierCurveTo): Ditto.
2879         (WebCore::Path::addArcTo): Add implementation.
2880         (WebCore::Path::closeSubpath):
2881         (WebCore::drawArcSection):
2882         (WebCore::Path::addArc): Update to build large arcs out of small arc segments. If the
2883         arc is effectively a complete circle, use the ellipse drawing routines.
2884         (WebCore::Path::addRect): Make sure we start at a valid starting point.
2885         (WebCore::Path::addEllipse): Correct for definition of D2D ellipse.
2886         (WebCore::Path::drawDidComplete const): Deleted.
2887         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
2888         (WebCore::Font::platformWidthForGlyph const):
2889         * rendering/svg/RenderSVGResourceClipper.cpp:
2890         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
2891         * rendering/svg/RenderSVGResourceFilter.cpp:
2892         (WebCore::RenderSVGResourceFilter::applyResource):
2893         * rendering/svg/RenderSVGResourceMasker.cpp:
2894         (WebCore::RenderSVGResourceMasker::applyResource):
2895         * rendering/svg/SVGRenderingContext.cpp:
2896         (WebCore::SVGRenderingContext::createImageBuffer):
2897         * rendering/svg/SVGRenderingContext.h:
2898
2899 2018-11-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2900
2901         Add an editing command for creating and inserting child lists
2902         https://bugs.webkit.org/show_bug.cgi?id=191335
2903         <rdar://problem/45814050>
2904
2905         Reviewed by Ryosuke Niwa.
2906
2907         Currently, insertOrderedList and insertUnorderedList only toggle or change list state (i.e. if the selection is
2908         in an ordered or unordered list, reinserting the same list type removes the current list, and inserting a
2909         different list type changes the enclosing list).
2910
2911         However, for certain internal clients (e.g. Mail), if the start of the selection is enclosed by a list item, we
2912         instead create a new list item and insert it after the enclosing list item, and then create a new list within
2913         that list item. Currently, this logic is implemented in Mail for legacy-WebKit-based Mail compose. This patch
2914         brings this logic into WebKit in the form of a new editing command.
2915
2916         Tests: editing/execCommand/insert-nested-lists-in-table.html
2917                editing/execCommand/insert-nested-lists-with-pre.html
2918                editing/execCommand/insert-nested-lists.html
2919
2920         * Sources.txt:
2921         * WebCore.xcodeproj/project.pbxproj:
2922         * editing/Editor.cpp:
2923         (WebCore::Editor::insertOrderedList):
2924         (WebCore::Editor::insertUnorderedList):
2925         * editing/EditorCommand.cpp:
2926         (WebCore::executeInsertOrderedList):
2927         (WebCore::executeInsertUnorderedList):
2928         (WebCore::executeInsertNestedUnorderedList):
2929         (WebCore::executeInsertNestedOrderedList):
2930         (WebCore::createCommandMap):
2931         * editing/IndentOutdentCommand.cpp:
2932         (WebCore::IndentOutdentCommand::outdentParagraph):
2933         * editing/InsertListCommand.cpp:
2934         (WebCore::InsertListCommand::doApply):
2935         (WebCore::InsertListCommand::editingAction const):
2936         * editing/InsertListCommand.h:
2937
2938         Change a couple of `enum`s into `enum class`es.
2939
2940         * editing/InsertNestedListCommand.cpp: Added.
2941         (WebCore::InsertNestedListCommand::insertUnorderedList):
2942         (WebCore::InsertNestedListCommand::insertOrderedList):
2943         (WebCore::InsertNestedListCommand::doApply):
2944         * editing/InsertNestedListCommand.h: Added.
2945
2946         Add a new edit command to insert a new list (as a child of any containing list). If the start of the selection
2947         is in a list item, we create a new list item, move the selection into the list item, and increment its list
2948         level; otherwise, simply fall back to inserting a list.
2949
2950         * editing/ModifySelectionListLevel.cpp:
2951         (WebCore::IncreaseSelectionListLevelCommand::doApply):
2952         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
2953         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
2954         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
2955         * editing/ModifySelectionListLevel.h:
2956
2957         Expose this constructor, allowing other edit commands to change selection list level as a composite edit
2958         command. Also, change an `enum` into an `enum class`.
2959
2960         (WebCore::IncreaseSelectionListLevelCommand::create):
2961
2962 2018-11-07  Chris Dumez  <cdumez@apple.com>
2963
2964         ASSERT(renderer()) under HTMLTextAreaElement::updateValue()
2965         https://bugs.webkit.org/show_bug.cgi?id=191391
2966         <rdar://problem/34219633>
2967
2968         Reviewed by Geoffrey Garen.
2969
2970         Update HTMLTextFormControlElement::didEditInnerTextValue() to not call subtreeHasChanged()
2971         if the element has no renderer, similarly to what is already done in 
2972         HTMLTextFormControlElement::setRangeText() and HTMLInputElement::setEditingValue().
2973
2974         Test: editing/inserting/inset-html-textarea-without-renderer.html
2975
2976         * html/HTMLTextFormControlElement.cpp:
2977         (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
2978
2979 2018-11-07  Youenn Fablet  <youenn@apple.com>
2980
2981         Allow setting RTCRtpTransceiver.direction
2982         https://bugs.webkit.org/show_bug.cgi?id=191346
2983
2984         Reviewed by Eric Carlson.
2985
2986         Remove readonly from the direction attribute.
2987         Keep setDirection for now as it is in use, with an intent to remove it.
2988         Driven-by fix as in some cases, the rtc source track might be changed
2989         and current implementation is not expecting that.
2990         In such a case, stop observing the old track (which should no longer call us)
2991         before observing the new one.
2992
2993         Covered by rebased tests.
2994
2995         * Modules/mediastream/RTCRtpTransceiver.idl:
2996         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
2997         (WebCore::RealtimeIncomingAudioSource::setSourceTrack):
2998         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2999         (WebCore::RealtimeIncomingVideoSource::setSourceTrack):
3000
3001 2018-11-07  Sihui Liu  <sihui_liu@apple.com>
3002
3003         RELEASE_ASSERT(!m_hardClosedForUserDelete) fails in WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer
3004         https://bugs.webkit.org/show_bug.cgi?id=191326
3005         <rdar://problem/45769269>
3006
3007         Reviewed by Geoffrey Garen.
3008
3009         UniqueIDBDatabase should ignore incoming requests or operations when it is already marked as
3010         hardClosedForUserDelete.
3011
3012         Test: IndexedDB.IndexedDBUserDelete.
3013
3014         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3015         (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
3016         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3017         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3018         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
3019         (WebCore::IDBServer::UniqueIDBDatabaseConnection::deleteTransaction):
3020         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3021         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3022         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
3023
3024 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
3025
3026         Positioned text underline can look like a strike-through
3027         https://bugs.webkit.org/show_bug.cgi?id=191341
3028
3029         Reviewed by Simon Fraser.
3030
3031         We should just clamp the value so it can't go above the baseline.
3032
3033         We shouldn't do this at parse time because it's totally reasonable for text-underline-position: under to want
3034         a negative text-underline-offset. Instead, we just do it at used value time.
3035
3036         Test: fast/css3-text/css3-text-decoration/text-underline-negative.html
3037
3038         * style/InlineTextBoxStyle.cpp:
3039         (WebCore::computeUnderlineOffset):
3040
3041 2018-11-07  Chris Dumez  <cdumez@apple.com>
3042
3043         Unreviewed, fix iOS build with recent SDKs.
3044
3045         * platform/network/cocoa/ResourceResponseCocoa.mm:
3046         (WebCore::ResourceResponse::platformCertificateInfo const):
3047
3048 2018-11-07  Chris Dumez  <cdumez@apple.com>
3049
3050         Unreviewed, fix iOS build with recent SDKs.
3051
3052         * platform/network/cocoa/ResourceResponseCocoa.mm:
3053         (WebCore::ResourceResponse::platformCertificateInfo const):
3054
3055 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
3056
3057         Dotted underlines that skip descenders are invisible
3058         https://bugs.webkit.org/show_bug.cgi?id=191403
3059
3060         Reviewed by Simon Fraser.
3061
3062         Turns out our underline bounding boxes had negative width. When drawing the full
3063         underline that was fine because it was handled by the 2D graphics engine, but when
3064         we try to split up the box into dots, our "for" loop was taking 0 iterations (because
3065         the end was before the start).
3066
3067         Test: fast/css3-text/css3-text-decoration/text-underline-style.html
3068
3069         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3070         (WebCore::GraphicsContext::drawLineForText):
3071         * platform/graphics/cg/GraphicsContextCG.cpp:
3072         (WebCore::GraphicsContext::drawLineForText):
3073         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3074         (WebCore::GraphicsContext::drawLineForText):
3075
3076 2018-11-07  Andy Estes  <aestes@apple.com>
3077
3078         Crash in WebCore::PaymentRequest::canMakePayment when Apple Pay payment method data is missing
3079         https://bugs.webkit.org/show_bug.cgi?id=191331
3080
3081         Reviewed by Alexey Proskuryakov.
3082
3083         Apple Pay requires merchants specify an ApplePayRequest (which contains several required
3084         fields) as payment method data when constructing a new PaymentRequest. If the
3085         ApplePayRequest is missing required fields, or is missing entirely, canMakePayment() should
3086         resolve to false.
3087
3088         We would properly resolve to false when an ApplePayRequest was specified with missing
3089         required fields, but we would crash when the ApplePayRequest was missing entirely.
3090
3091         This patch fixes the crash by checking for an empty JSValue before trying to convert it to
3092         an ApplePayRequest struct. Because we stringify ApplePayRequests in the PaymentRequest
3093         constructor then parse them again in canMakePayments, an undefined or null payment method
3094         data stringifies to a null String, which then parses to an empty JSValue.
3095
3096         Added test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
3097
3098         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3099         (WebCore::ApplePayPaymentHandler::convertData):
3100         * Modules/paymentrequest/PaymentRequest.cpp:
3101         (WebCore::PaymentRequest::canMakePayment):
3102
3103 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
3104
3105         Revert 237849: it breaks MotionMark
3106         https://bugs.webkit.org/show_bug.cgi?id=191398
3107
3108         Reviewed by Simon Fraser.
3109
3110         This change broke painting while the test is running.
3111
3112         * rendering/RenderLayerCompositor.cpp:
3113         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
3114
3115 2018-11-07  Don Olmstead  <don.olmstead@sony.com>
3116
3117         Simplify macros in platform
3118         https://bugs.webkit.org/show_bug.cgi?id=191378
3119
3120         Reviewed by Michael Catanzaro.
3121
3122         No new tests. No change in behavior.
3123
3124         Modifies a few cases where a platform macro could be simplified.
3125
3126         * page/EventHandler.cpp:
3127         * platform/network/DNS.h:
3128         * platform/network/NetworkStateNotifier.h:
3129
3130 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
3131
3132         Some WK1 repaint tests are flakey
3133         https://bugs.webkit.org/show_bug.cgi?id=190627
3134
3135         Reviewed by Zalan Bujtas.
3136
3137         Repaint tracking in GraphicsLayerCA was sensitive to whether there were already dirty
3138         rects on the layer, since tracking happened after checks against existing dirty rects.
3139         This caused some WK1 repaint tests to be flakey, since there's no guarantee that
3140         no repaints happen between the last layer flush and a test calling startTrackingRepaints().
3141
3142         Fix by moving the repaint tracking to before the checks against existing dirty rects.
3143         This is more similar to how repaint tracking on FrameView works.
3144
3145         * platform/graphics/ca/GraphicsLayerCA.cpp:
3146         (WebCore::GraphicsLayerCA::setNeedsDisplayInRect):
3147
3148 2018-11-07  Dean Jackson  <dino@apple.com>
3149
3150         [iOS] WebGL leaks exact GPU type
3151         https://bugs.webkit.org/show_bug.cgi?id=191393
3152
3153         Reviewed by Tim Horton.
3154
3155         The fully exposed renderer info shouldn't be necessary
3156         on iOS, where the GPUs and drivers are consistent
3157         enough that people shouldn't need to write code specifically
3158         for them. Reduce the ability to fingerprint by simply
3159         returning "Apple GPU".
3160
3161         The other option would have been to disable the extension,
3162         but I think it might still be useful to know you're on
3163         an iOS device.
3164
3165         Test: fast/canvas/webgl/hide-some-renderer-info.html
3166
3167         * html/canvas/WebGL2RenderingContext.cpp: Return "Apple GPU"
3168         on iOS.
3169         (WebCore::WebGL2RenderingContext::getParameter):
3170         * html/canvas/WebGLRenderingContext.cpp: Ditto.
3171         (WebCore::WebGLRenderingContext::getParameter):
3172
3173 2018-11-07  Daniel Bates  <dabates@apple.com>
3174
3175         Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
3176         https://bugs.webkit.org/show_bug.cgi?id=190141
3177
3178         Reviewed by Darin Adler.
3179
3180         Remove the runtime application check for WebKitTestRunner as we no longer need this
3181         now that WebKitTestRunner and DumpRenderTree override +[UIKeyboard isInHardwareKeyboardMode].
3182
3183         * platform/RuntimeApplicationChecks.h:
3184         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3185         (WebCore::IOSApplication::isWebKitTestRunner): Deleted.
3186
3187 2018-11-07  Joseph Pecoraro  <pecoraro@apple.com>
3188
3189         Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects
3190         https://bugs.webkit.org/show_bug.cgi?id=191340
3191
3192         Reviewed by Devin Rousso.
3193
3194         * inspector/agents/InspectorMemoryAgent.cpp:
3195         (WebCore::InspectorMemoryAgent::collectSample):
3196         Use new enum name.
3197
3198 2018-11-07  Dan Bernstein  <mitz@apple.com>
3199
3200         Add a pseudoclass that matches img elements that are backed by an attachment
3201         https://bugs.webkit.org/show_bug.cgi?id=191286
3202         <rdar://problem/45823554>
3203
3204         Reviewed by Dean Jackson.
3205
3206         Test: fast/css/has-attachment.html
3207
3208         Added a :has-attachment pseudoclass, enabled only when the attachment element is enabled at
3209         runtime, that matches elements (currently only img elements qualify) that have an attachment
3210         element in their shadow DOM.
3211
3212         * css/CSSSelector.cpp:
3213         (WebCore::CSSSelector::selectorText const): Handle the new PseudoClassHasAttachment value.
3214         * css/CSSSelector.h: Added a new value to the PseudoClassType enum.
3215
3216         * css/SelectorChecker.cpp:
3217         (WebCore::SelectorChecker::checkOne const): Check the new PseudoClassHasAttachment value
3218           using the new hasAttachment test function.
3219
3220         * css/SelectorCheckerTestFunctions.h:
3221         (WebCore::hasAttachment): Added. Tests if the element is an img element that has an
3222           attachment.
3223
3224         * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added has-attachment.
3225
3226         * css/parser/CSSParserContext.cpp:
3227         (WebCore::CSSParserContext::CSSParserContext): Initialize new attachmentEnabled member based
3228           on RuntimeEnabledFeatures.
3229         (WebCore::operator==): Compare new attachmentEnabled member.
3230         * css/parser/CSSParserContext.h:
3231         (WebCore::CSSParserContextHash::hash): Include new attachmentEnabled member.
3232
3233         * css/parser/CSSSelectorParser.cpp:
3234         (WebCore::CSSSelectorParser::consumePseudo): Reject :has-attachment if the attachment
3235           element is not enabled.
3236
3237         * cssjit/SelectorCompiler.cpp:
3238         (WebCore::SelectorCompiler::addPseudoClassType): Handle PseudoClassHasAttachment.
3239
3240 2018-11-07  Don Olmstead  <don.olmstead@sony.com>
3241
3242         Make generic MainThreadSharedTimer implementation
3243         https://bugs.webkit.org/show_bug.cgi?id=191327
3244
3245         Reviewed by Michael Catanzaro.
3246
3247         No new tests. No change in behavior.
3248
3249         Moves generic implementation for MainThreadSharedTimerGlib.cpp into
3250         MainThreadSharedTimer.cpp.
3251
3252         * platform/MainThreadSharedTimer.cpp:
3253         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
3254         (WebCore::MainThreadSharedTimer::setFireInterval):
3255         (WebCore::MainThreadSharedTimer::stop):
3256         (WebCore::MainThreadSharedTimer::invalidate):
3257         * platform/MainThreadSharedTimer.h:
3258         * platform/SourcesGLib.txt:
3259         * platform/glib/MainThreadSharedTimerGLib.cpp: Removed.
3260
3261 2018-11-07  Ali Juma  <ajuma@chromium.org>
3262
3263         IntersectionObserverEntry doesn't keep JS wrappers of rects alive
3264         https://bugs.webkit.org/show_bug.cgi?id=191330
3265
3266         Reviewed by Chris Dumez.
3267
3268         Retain wrappers of each rect in an IntersectionObserverEntry as long as the entry's wrapper
3269         is alive, by adding these wrappers as opaque roots.
3270
3271         Test: intersection-observer/intersection-observer-entry-keeps-js-wrappers-of-rects-alive.html
3272
3273         * bindings/js/JSIntersectionObserverEntryCustom.cpp:
3274         (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren):
3275         * dom/DOMRectReadOnly.idl:
3276         * page/IntersectionObserverEntry.h:
3277         (WebCore::IntersectionObserverEntry::rootBounds const): Make this return a raw pointer instead of a RefPtr so that it
3278         can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which can be called from non-main threads.
3279         (WebCore::IntersectionObserverEntry::boundingClientRect const): Ditto.
3280         (WebCore::IntersectionObserverEntry::intersectionRect const): Ditto.
3281
3282 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
3283
3284         TileController::tileSize() should not have side effects
3285         https://bugs.webkit.org/show_bug.cgi?id=191349
3286
3287         Reviewed by Zalan Bujtas.
3288
3289         Calling TileController::tileSize() would recompute a new tile size and set m_tileSizeLocked,
3290         which caused test failures if logging was enabled when running tests.
3291
3292         * platform/graphics/ca/TileController.cpp:
3293         (WebCore::TileController::tileSize const):
3294         (WebCore::TileController::computeTileSize):
3295         * platform/graphics/ca/TileController.h:
3296         * platform/graphics/ca/TileGrid.cpp:
3297         (WebCore::TileGrid::revalidateTiles):
3298
3299 2018-11-07  Charlie Turner  <cturner@igalia.com>
3300
3301         [EME][GStreamer] Ensure key id buffers are present and simplify lifetime management of ClearKey class.
3302         https://bugs.webkit.org/show_bug.cgi?id=191157
3303
3304         Reviewed by Xabier Rodriguez-Calvar.
3305
3306         This is in preparation for moving the clearkey decryptor behind a
3307         new decrypt API in CDMInstance, which will be sent into the
3308         pipeline to handle key management and decryption. This is for a
3309         later patch.
3310
3311         Covered by existing clear key tests in media/encrypted-media.
3312
3313         * platform/graphics/gstreamer/GStreamerCommon.h:
3314         (WebCore::GstMappedBuffer::data const): Add a const data accessor,
3315         since we are now providing operator=='s on const objects of this
3316         class that need const access to the data pointer.
3317         (WebCore::GstMappedBuffer::operator==): Add a swap of the new
3318         equality operator so you don't have to remember to have the
3319         GstBuffer on the RHS of the equality all the time.
3320         (WebCore::operator==): Define an equality operator between Gst
3321         buffers and WebCore's mapped buffers. Gst creates a ref and a
3322         separate read view under the covers in the memcmp call, so we do
3323         not need to map the buffer ourselves.
3324         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3325         (webkit_media_clear_key_decrypt_class_init): Remove setup/release
3326         bindings.
3327         (webkit_media_clear_key_decrypt_init): Initialize gcrypt cipher
3328         here once instead of for every buffer to be decrypted.
3329         (webKitMediaClearKeyDecryptorFinalize): And destroy the cipher
3330         context when the decryptor is destroyed.
3331         (webKitMediaClearKeyDecryptorFindAndSetKey): Factor out the key
3332         retrieval and context setting in this method, call it for each
3333         sample.
3334         (webKitMediaClearKeyDecryptorDecrypt): Base key id buffer into
3335         this function, and remove cipher creation / destroy methods.
3336         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3337         (webkit_media_common_encryption_decrypt_class_init): Remove
3338         setup/release bindings.
3339         (webkitMediaCommonEncryptionDecryptTransformInPlace): Ensure a key
3340         id is present and pass it to the decrypt class method.
3341         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher): Deleted.
3342         (webKitMediaCommonEncryptionDecryptDefaultReleaseCipher): Deleted.
3343         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
3344
3345 2018-11-07  Frederic Wang  <fwang@igalia.com>
3346
3347         [Cairo] Move state change operations from GraphicsContextCairo to CairoOperations
3348         https://bugs.webkit.org/show_bug.cgi?id=179610
3349
3350         Unreviewed build fix.
3351
3352         * platform/graphics/cairo/GraphicsContextCairo.cpp: Add missing include.
3353
3354 2018-11-06  Joseph Pecoraro  <pecoraro@apple.com>
3355
3356         ServiceWorker Inspector: Uncaught Exception: null is not an object (evaluating 'resource.target.addResource')
3357         https://bugs.webkit.org/show_bug.cgi?id=191339
3358
3359         Reviewed by Matt Baker.
3360
3361         * workers/service/ServiceWorkerJob.cpp:
3362         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
3363         Use the Service Worker's identifier, not this static but otherwise unknown identifier.
3364
3365 2018-11-06  Youenn Fablet  <youenn@apple.com>
3366
3367         sender.replaceTrack() fails with InvalidStateError if the transceiver.direction is "inactive"
3368         https://bugs.webkit.org/show_bug.cgi?id=191202
3369
3370         Reviewed by Eric Carlson.
3371
3372         Covered by updated test.
3373
3374         * Modules/mediastream/RTCPeerConnection.cpp:
3375         (WebCore::RTCPeerConnection::removeTrack):
3376         Update as per spec, in particular make sure to not stop the sender when removing the track.
3377
3378 2018-11-06  Justin Fan  <justin_fan@apple.com>
3379
3380         [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
3381         https://bugs.webkit.org/show_bug.cgi?id=191291
3382
3383         Reviewed by Myles Maxfield.
3384