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