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