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