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