Make !ENABLE(DATA_DETECTION) iOS build actually succeed
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-04  Tim Horton  <timothy_horton@apple.com>
2
3         Make !ENABLE(DATA_DETECTION) iOS build actually succeed
4         https://bugs.webkit.org/show_bug.cgi?id=183283
5         <rdar://problem/38062148>
6
7         Reviewed by Sam Weinig.
8
9         * Configurations/FeatureDefines.xcconfig:
10
11 2018-03-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
12
13         Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
14         https://bugs.webkit.org/show_bug.cgi?id=183165
15
16         Reviewed by Darin Adler.
17
18         Some of the calls in SVGToOTFFontConversion.cpp were directed to the function
19         in MathExtras.h while the rest were directed to this local static function.
20         There should not be two versions with the same name while they are supposed
21         to do the same thing. Besides, the local version does not work correctly
22         if the type of the argument's max limit is less the max limit of the returned
23         type, e.g. char -> uint16_t.
24
25         * svg/SVGToOTFFontConversion.cpp:
26         (WebCore::clampTo): Deleted.
27
28 2018-03-03  Zalan Bujtas  <zalan@apple.com>
29
30         [RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater
31         https://bugs.webkit.org/show_bug.cgi?id=183273
32         <rdar://problem/38054892>
33
34         Reviewed by Antti Koivisto.
35
36         Covered by existing tests.
37
38         * rendering/RenderBlockFlow.cpp:
39         (WebCore::RenderBlockFlow::styleDidChange):
40         * rendering/RenderElement.cpp:
41         (WebCore::RenderElement::styleDidChange):
42         (WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
43         * rendering/RenderElement.h:
44         * rendering/updating/RenderTreeUpdater.cpp:
45         (WebCore::RenderTreeUpdater::updateElementRenderer):
46
47 2018-03-03  Yoav Weiss  <yoav@yoav.ws>
48
49         Link headers for subresources are not being processes
50         https://bugs.webkit.org/show_bug.cgi?id=181789
51
52         Reviewed by Youenn Fablet.
53
54         Triggers Link header processing when the Link headers arrive on a subresource.
55
56         Test: http/tests/preload/link-header-on-subresource.html
57
58         * loader/LinkLoader.cpp:
59         (WebCore::LinkLoader::loadLinksFromHeader): Change the media check conditions.
60         * loader/LinkLoader.h: Add a third state for media checks.
61         * loader/SubresourceLoader.cpp:
62         (WebCore::SubresourceLoader::didReceiveResponse): Preload links from headers for subresources.
63
64 2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
65
66         [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
67         https://bugs.webkit.org/show_bug.cgi?id=183293
68
69         Reviewed by Alex Christensen.
70
71         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
72         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
73
74 2018-03-02  Dean Jackson  <dino@apple.com>
75
76         Remove NP_GLContext since it is unsupported
77         https://bugs.webkit.org/show_bug.cgi?id=183305
78         <rdar://problem/36875555>
79
80         Reviewed by Simon Fraser.
81
82         * plugins/npapi.h: Remove NP_GLContext and mention that
83         it is not supported.
84
85 2018-03-02  Chris Dumez  <cdumez@apple.com>
86
87         imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html crashes with async policy delegates
88         https://bugs.webkit.org/show_bug.cgi?id=183294
89         <rdar://problem/38073596>
90
91         Reviewed by Youenn Fablet.
92
93         Drop code that was added to SubresourceLoader::willCancel() in r228852. The purpose of this code
94         was to make sure that SubresourceLoader::m_policyForResponseCompletionHandler always gets called,
95         even when the load is cancelled. However, this code is not needed (since m_policyForResponseCompletionHandler
96         is a CompletionHandler, an assertion will be hit if we fail to call it and we'll know). Calling
97         the completionHandler inside SubresourceLoader::willCancel() is too early and leads to crashes.
98
99         The completionHandler currently gets called DocumentLoader::responseReceived() via a call to
100         mainResourceLoader->didReceiveResponsePolicy(). Note that in r229177, we made sure that the
101         call to didReceiveResponsePolicy() happens *after* the call to continueAfterContentPolicy()
102         to maintain our non-async policy delegate behavior. However, continueAfterContentPolicy()
103         would end up calling willCancel() and call the completionHandler when shouldContinue was
104         false.
105
106         Test: http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html
107
108         * loader/SubresourceLoader.cpp:
109         (WebCore::SubresourceLoader::willCancel):
110
111 2018-03-02  Tim Horton  <timothy_horton@apple.com>
112
113         Fix the build after r229185 and r229184
114
115         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
116         (WebCore::exernalDeviceDisplayNameForPlayer):
117         * platform/ios/DeviceOrientationClientIOS.h:
118         * platform/ios/DeviceOrientationClientIOS.mm:
119
120 2018-03-02  Tim Horton  <timothy_horton@apple.com>
121
122         Make the !ENABLE(DEVICE_ORIENTATION) iOS build succeed
123         https://bugs.webkit.org/show_bug.cgi?id=183296
124
125         Reviewed by Dan Bernstein.
126
127         * platform/ios/DeviceMotionClientIOS.h:
128         * platform/ios/DeviceMotionClientIOS.mm:
129         * platform/ios/WebCoreMotionManager.h:
130         * platform/ios/WebCoreMotionManager.mm:
131
132 2018-03-02  Tim Horton  <timothy_horton@apple.com>
133
134         Make it possible to build for iOS without Celestial
135         https://bugs.webkit.org/show_bug.cgi?id=183295
136         <rdar://problem/38074468>
137
138         Reviewed by Dan Bernstein.
139
140         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
141         (WebCore::exernalDeviceDisplayNameForPlayer):
142
143 2018-03-02  Youenn Fablet  <youenn@apple.com>
144
145         Clients should register to StorageProcess with their service worker registration identifier
146         https://bugs.webkit.org/show_bug.cgi?id=182313
147         <rdar://problem/38044403>
148
149         Reviewed by Chris Dumez.
150
151         Relanding with fixing matchAll for uncontrolled clients.
152
153         No observable change of behavior in regular conditions.
154         When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
155         and we will not be able to retrieve the registration from these identifiers.
156         The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
157         Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
158
159         * dom/Document.cpp:
160         (WebCore::Document::setServiceWorkerConnection):
161         * workers/service/SWClientConnection.h:
162         * workers/service/server/SWServer.cpp:
163         (WebCore::SWServer::matchAll):
164         (WebCore::SWServer::claim):
165         (WebCore::SWServer::registerServiceWorkerClient):
166         (WebCore::SWServer::unregisterServiceWorkerClient):
167         (WebCore::SWServer::setClientActiveWorker): Deleted.
168         * workers/service/server/SWServer.h:
169         * workers/service/server/SWServerRegistration.cpp:
170         (WebCore::SWServerRegistration::activate):
171
172 2018-03-02  Youenn Fablet  <youenn@apple.com>
173
174         Loads for a Document controlled by a Service Worker should not use AppCache
175         https://bugs.webkit.org/show_bug.cgi?id=183148
176
177         Reviewed by Chris Dumez.
178
179         Covered by updated test.
180
181         Postponing document loading through app cache after matching service worker registration.
182         Trying to load through app cache only if there is no service worker registration.
183
184         Disabling app cache for any load that has a service worker registration identifier.
185
186         * loader/DocumentLoader.cpp:
187         (WebCore::DocumentLoader::redirectReceived):
188         (WebCore::DocumentLoader::willSendRequest):
189         (WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
190         (WebCore::DocumentLoader::tryLoadingRedirectRequestFromApplicationCache):
191         (WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
192         (WebCore::DocumentLoader::scheduleSubstituteResourceLoad):
193         (WebCore::DocumentLoader::startLoadingMainResource):
194         * loader/DocumentLoader.h:
195         * loader/appcache/ApplicationCacheHost.cpp:
196         (WebCore::ApplicationCacheHost::maybeLoadMainResource):
197         (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
198         (WebCore::ApplicationCacheHost::maybeLoadResource):
199         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
200         * loader/appcache/ApplicationCacheHost.h:
201
202 2018-03-02  Chris Dumez  <cdumez@apple.com>
203
204         fast/events/before-unload-remove-itself.html crashes with async policy delegates
205         https://bugs.webkit.org/show_bug.cgi?id=183290
206         <rdar://problem/38069045>
207
208         Reviewed by Alex Christensen.
209
210         When the navigation policy happens asynchronously, it is now possible for the
211         Frame / FrameLoader to get destroyed between the point that policyChecker().checkNavigationPolicy()
212         is called and when continueLoadAfterNavigationPolicy() is called.
213
214         To address the issue, we now protect the Frame and capture it in the lambda passed
215         to policyChecker().checkNavigationPolicy().
216
217         Test: fast/events/before-unload-remove-itself-async-delegate.html
218
219         * loader/FrameLoader.cpp:
220         (WebCore::FrameLoader::loadURL):
221         (WebCore::FrameLoader::loadWithDocumentLoader):
222
223 2018-03-02  Chris Dumez  <cdumez@apple.com>
224
225         Converting a load to a download does not work with async policy delegates
226         https://bugs.webkit.org/show_bug.cgi?id=183254
227         <rdar://problem/38035334>
228
229         Reviewed by Youenn Fablet.
230
231         Update DocumentLoader::responseReceived() to call didReceiveResponsePolicy()
232         on the mainResourceLoader *after* calling continueAfterContentPolicy(),
233         not *before*. This makes sure that the WebResourceLoader sends the
234         NetworkResourceLoader::ContinueDidReceiveResponse IPC back to the Network
235         Process *after* the policy decision has been processed, which restores the
236         pre-r228852 order.
237
238         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html
239
240         * loader/DocumentLoader.cpp:
241         (WebCore::DocumentLoader::responseReceived):
242
243 2018-03-02  Youenn Fablet  <youenn@apple.com>
244
245         Some RealtimeMediaSource methods do not need to be marked as virtual
246         https://bugs.webkit.org/show_bug.cgi?id=183272
247
248         Reviewed by Eric Carlson.
249
250         No change of behavior.
251
252         * platform/mediastream/RealtimeMediaSource.h:
253
254 2018-03-01  Yusuke Suzuki  <utatane.tea@gmail.com>
255
256         Remove monotonicallyIncreasingTime
257         https://bugs.webkit.org/show_bug.cgi?id=182911
258
259         Reviewed by Michael Catanzaro.
260
261         While generic code uses MonotonicTime, CAAnimation uses media time (CFTimeInterval).
262         At this boundary, we convert MonotonicTime to media time, this is the same logic to
263         the code before this patch.
264
265         * Modules/gamepad/Gamepad.h:
266         * Modules/mediasource/SourceBuffer.cpp:
267         (WebCore::SourceBuffer::SourceBuffer):
268         (WebCore::SourceBuffer::monitorBufferingRate):
269         * Modules/mediasource/SourceBuffer.h:
270         * Modules/speech/SpeechSynthesis.cpp:
271         (WebCore::SpeechSynthesis::startSpeakingImmediately):
272         (WebCore::SpeechSynthesis::fireEvent):
273         * Modules/speech/SpeechSynthesisUtterance.h:
274         * contentextensions/ContentExtensionCompiler.cpp:
275         (WebCore::ContentExtensions::compileRuleList):
276         * contentextensions/ContentExtensionParser.cpp:
277         (WebCore::ContentExtensions::parseRuleList):
278         * contentextensions/ContentExtensionsBackend.cpp:
279         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
280         * dom/Element.cpp:
281         (WebCore::Element::setActive):
282         * history/CachedPage.cpp:
283         (WebCore::CachedPage::CachedPage):
284         (WebCore::CachedPage::hasExpired const):
285         * history/CachedPage.h:
286         * html/HTMLMediaElement.cpp:
287         (WebCore::HTMLMediaElement::startProgressEventTimer):
288         (WebCore::HTMLMediaElement::progressEventTimerFired):
289         (WebCore::HTMLMediaElement::refreshCachedTime const):
290         (WebCore::HTMLMediaElement::invalidateCachedTime const):
291         (WebCore::HTMLMediaElement::currentMediaTime const):
292         (WebCore::HTMLMediaElement::startPlaybackProgressTimer):
293         * html/HTMLMediaElement.h:
294         * html/MediaElementSession.cpp:
295         (WebCore::MediaElementSession::removeBehaviorRestriction):
296         (WebCore::MediaElementSession::mostRecentUserInteractionTime const):
297         (WebCore::MediaElementSession::resetPlaybackSessionState):
298         * html/MediaElementSession.h:
299         * html/parser/HTMLParserScheduler.cpp:
300         (WebCore::PumpSession::PumpSession):
301         (WebCore::HTMLParserScheduler::HTMLParserScheduler):
302         * html/parser/HTMLParserScheduler.h:
303         (WebCore::HTMLParserScheduler::checkForYield):
304         * inspector/InspectorCanvas.cpp:
305         (WebCore::InspectorCanvas::recordAction):
306         (WebCore::InspectorCanvas::finalizeFrame):
307         * inspector/InspectorCanvas.h:
308         * inspector/agents/InspectorMemoryAgent.cpp:
309         (WebCore::InspectorMemoryAgent::startTracking):
310         (WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
311         (WebCore::InspectorMemoryAgent::collectSample):
312         * inspector/agents/InspectorNetworkAgent.cpp:
313         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
314         (WebCore::InspectorNetworkAgent::timestamp):
315         (WebCore::InspectorNetworkAgent::didFinishLoading):
316         * inspector/agents/InspectorPageAgent.cpp:
317         (WebCore::InspectorPageAgent::timestamp):
318         * inspector/agents/InspectorTimelineAgent.cpp:
319         (WebCore::InspectorTimelineAgent::timestamp):
320         * inspector/agents/WebHeapAgent.cpp:
321         (WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
322         * inspector/agents/WebHeapAgent.h:
323         * loader/cache/CachedCSSStyleSheet.cpp:
324         (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
325         * loader/cache/CachedImage.cpp:
326         (WebCore::CachedImage::didDraw):
327         * loader/cache/CachedResource.cpp:
328         (WebCore::CachedResource::didAccessDecodedData):
329         * loader/cache/CachedResource.h:
330         * loader/cache/MemoryCache.cpp:
331         (WebCore::MemoryCache::pruneLiveResourcesToSize):
332         * page/EventHandler.cpp:
333         (WebCore::MaximumDurationTracker::MaximumDurationTracker):
334         (WebCore::MaximumDurationTracker::~MaximumDurationTracker):
335         * page/FocusController.cpp:
336         (WebCore::FocusController::setFocusedElement):
337         (WebCore::FocusController::timeSinceFocusWasSet const):
338         * page/FocusController.h:
339         * page/FrameView.cpp:
340         (WebCore::FrameView::reset):
341         (WebCore::FrameView::willPaintContents):
342         (WebCore::FrameView::didPaintContents):
343         * page/FrameView.h:
344         * page/animation/AnimationBase.cpp:
345         (WebCore::AnimationBase::freezeAtTime):
346         (WebCore::AnimationBase::beginAnimationUpdateTime const):
347         * page/animation/AnimationBase.h:
348         (WebCore::AnimationBase::onAnimationStartResponse):
349         * page/animation/CSSAnimationController.cpp:
350         (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
351         (WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
352         (WebCore::CSSAnimationControllerPrivate::startTimeResponse):
353         (WebCore::CSSAnimationController::notifyAnimationStarted):
354         * page/animation/CSSAnimationController.h:
355         * page/animation/CSSAnimationControllerPrivate.h:
356         * page/mac/WheelEventDeltaFilterMac.h:
357         * page/mac/WheelEventDeltaFilterMac.mm:
358         (WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
359         (WebCore::WheelEventDeltaFilterMac::updateFromDelta):
360         (WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
361         * platform/ControlStates.h:
362         (WebCore::ControlStates::timeSinceControlWasFocused const):
363         (WebCore::ControlStates::setTimeSinceControlWasFocused):
364         * platform/PlatformSpeechSynthesisUtterance.h:
365         (WebCore::PlatformSpeechSynthesisUtterance::startTime const):
366         (WebCore::PlatformSpeechSynthesisUtterance::setStartTime):
367         * platform/gamepad/PlatformGamepad.h:
368         (WebCore::PlatformGamepad::lastUpdateTime const):
369         (WebCore::PlatformGamepad::connectTime const):
370         (WebCore::PlatformGamepad::PlatformGamepad):
371         * platform/gamepad/cocoa/GameControllerGamepad.mm:
372         (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
373         (WebCore::GameControllerGamepad::setupAsGamepad):
374         * platform/gamepad/mac/HIDGamepad.cpp:
375         (WebCore::HIDGamepad::HIDGamepad):
376         (WebCore::HIDGamepad::valueChanged):
377         * platform/graphics/GraphicsLayer.cpp:
378         (WebCore::GraphicsLayer::suspendAnimations):
379         * platform/graphics/GraphicsLayer.h:
380         * platform/graphics/GraphicsLayerClient.h:
381         (WebCore::GraphicsLayerClient::notifyAnimationStarted):
382         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
383         (WebCore::LayerClient::platformCALayerAnimationStarted):
384         (WebCore::AVFWrapper::createImageForTimeInRect):
385         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
386         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
387         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
388         * platform/graphics/ca/GraphicsLayerCA.cpp:
389         (WebCore::GraphicsLayerCA::addAnimation):
390         (WebCore::GraphicsLayerCA::pauseAnimation):
391         (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
392         (WebCore::GraphicsLayerCA::setAnimationOnLayer):
393         (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
394         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
395         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
396         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
397         * platform/graphics/ca/GraphicsLayerCA.h:
398         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
399         (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
400         * platform/graphics/ca/LayerPool.cpp:
401         (WebCore::LayerPool::LayerPool):
402         (WebCore::LayerPool::addLayer):
403         (WebCore::LayerPool::decayedCapacity const):
404         (WebCore::LayerPool::pruneTimerFired):
405         * platform/graphics/ca/LayerPool.h:
406         * platform/graphics/ca/PlatformCAAnimation.h:
407         * platform/graphics/ca/PlatformCALayer.h:
408         * platform/graphics/ca/PlatformCALayerClient.h:
409         (WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
410         * platform/graphics/ca/TileGrid.cpp:
411         (WebCore::TileGrid::revalidateTiles):
412         (WebCore::TileGrid::startedNewCohort):
413         (WebCore::TileGrid::TileCohortInfo::timeUntilExpiration):
414         (WebCore::TileGrid::cohortRemovalTimerFired):
415         * platform/graphics/ca/TileGrid.h:
416         (WebCore::TileGrid::TileCohortInfo::TileCohortInfo):
417         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
418         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
419         (mediaTimeToCurrentTime):
420         (-[WebAnimationDelegate animationDidStart:]):
421         (PlatformCALayerCocoa::animationStarted):
422         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
423         (WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
424         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
425         (PlatformCALayerWin::animationStarted):
426         (PlatformCALayerWin::layerTreeAsString const):
427         * platform/graphics/ca/win/PlatformCALayerWin.h:
428         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
429         (WebCore::WebCoreDecompressionSession::decodeSample):
430         * platform/graphics/texmap/BitmapTexturePool.cpp:
431         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
432         * platform/graphics/texmap/BitmapTexturePool.h:
433         (WebCore::BitmapTexturePool::Entry::markIsInUse):
434         (WebCore::BitmapTexturePool::Entry::canBeReleased const):
435         (): Deleted.
436         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
437         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
438         (WebCore::GraphicsLayerTextureMapper::addAnimation):
439         (WebCore::GraphicsLayerTextureMapper::pauseAnimation):
440         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
441         * platform/graphics/texmap/TextureMapperAnimation.cpp:
442         (WebCore::TextureMapperAnimation::TextureMapperAnimation):
443         (WebCore::TextureMapperAnimation::apply):
444         (WebCore::TextureMapperAnimation::pause):
445         (WebCore::TextureMapperAnimation::resume):
446         (WebCore::TextureMapperAnimation::computeTotalRunningTime):
447         (WebCore::TextureMapperAnimations::pause):
448         (WebCore::TextureMapperAnimations::suspend):
449         * platform/graphics/texmap/TextureMapperAnimation.h:
450         (WebCore::TextureMapperAnimation::startTime const):
451         (WebCore::TextureMapperAnimation::pauseTime const):
452         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
453         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
454         (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
455         * platform/graphics/texmap/TextureMapperFPSCounter.h:
456         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
457         (WebCore::TextureMapperPlatformLayerBuffer::markUsed):
458         (WebCore::TextureMapperPlatformLayerBuffer::lastUsedTime const):
459         (): Deleted.
460         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
461         (WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
462         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
463         (WebCore::CoordinatedGraphicsLayer::addAnimation):
464         (WebCore::CoordinatedGraphicsLayer::pauseAnimation):
465         (WebCore::CoordinatedGraphicsLayer::suspendAnimations):
466         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
467         * platform/mediastream/RealtimeMediaSource.h:
468         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
469         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
470         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
471         (WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
472         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
473         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
474         (WebCore::DisplayCaptureSourceCocoa::stopProducingData):
475         (WebCore::DisplayCaptureSourceCocoa::elapsedTime):
476         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
477         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
478         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
479         (WebCore::MockRealtimeAudioSourceMac::render):
480         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
481         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
482         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
483         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
484         (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
485         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
486         * platform/mock/MockRealtimeAudioSource.cpp:
487         (WebCore::MockRealtimeAudioSource::startProducingData):
488         (WebCore::MockRealtimeAudioSource::stopProducingData):
489         (WebCore::MockRealtimeAudioSource::elapsedTime):
490         (WebCore::MockRealtimeAudioSource::tick):
491         (WebCore::MockRealtimeAudioSource::delaySamples):
492         * platform/mock/MockRealtimeAudioSource.h:
493         (WebCore::MockRealtimeAudioSource::render):
494         * platform/mock/MockRealtimeVideoSource.cpp:
495         (WebCore::MockRealtimeVideoSource::startProducingData):
496         (WebCore::MockRealtimeVideoSource::stopProducingData):
497         (WebCore::MockRealtimeVideoSource::elapsedTime):
498         (WebCore::MockRealtimeVideoSource::drawText):
499         (WebCore::MockRealtimeVideoSource::delaySamples):
500         (WebCore::MockRealtimeVideoSource::generateFrame):
501         * platform/mock/MockRealtimeVideoSource.h:
502         * platform/network/DNSResolveQueue.cpp:
503         (WebCore::DNSResolveQueue::DNSResolveQueue):
504         (WebCore::DNSResolveQueue::isUsingProxy):
505         * platform/network/DNSResolveQueue.h:
506         * rendering/RenderBoxModelObject.cpp:
507         (WebCore::RenderBoxModelObject::suspendAnimations):
508         * rendering/RenderBoxModelObject.h:
509         * rendering/RenderElement.cpp:
510         (WebCore::RenderElement::paintFocusRing):
511         * rendering/RenderImage.cpp:
512         (WebCore::RenderImage::paintAreaElementFocusRing):
513         * rendering/RenderLayerBacking.cpp:
514         (WebCore::RenderLayerBacking::notifyAnimationStarted):
515         (WebCore::RenderLayerBacking::suspendAnimations):
516         * rendering/RenderLayerBacking.h:
517         * rendering/RenderLayerCompositor.cpp:
518         (WebCore::RenderLayerCompositor::didPaintBacking):
519         * rendering/RenderProgress.cpp:
520         (WebCore::RenderProgress::RenderProgress):
521         (WebCore::RenderProgress::animationProgress const):
522         (WebCore::RenderProgress::updateAnimationState):
523         * rendering/RenderProgress.h:
524         * rendering/RenderTheme.cpp:
525         (WebCore::RenderTheme::animationDurationForProgressBar const):
526         * rendering/RenderTheme.h:
527         * rendering/RenderThemeGtk.cpp:
528         (WebCore::RenderThemeGtk::animationDurationForProgressBar const):
529         * rendering/RenderThemeGtk.h:
530         * rendering/RenderThemeIOS.h:
531         * rendering/RenderThemeIOS.mm:
532         (WebCore::RenderThemeIOS::animationDurationForProgressBar const):
533         * rendering/RenderThemeMac.h:
534         * rendering/RenderThemeMac.mm:
535         (WebCore::RenderThemeMac::animationDurationForProgressBar const):
536         * svg/animation/SMILTimeContainer.cpp:
537         (WebCore::SMILTimeContainer::SMILTimeContainer):
538         (WebCore::SMILTimeContainer::elapsed const):
539         (WebCore::SMILTimeContainer::isActive const):
540         (WebCore::SMILTimeContainer::isPaused const):
541         (WebCore::SMILTimeContainer::isStarted const):
542         (WebCore::SMILTimeContainer::begin):
543         (WebCore::SMILTimeContainer::pause):
544         (WebCore::SMILTimeContainer::resume):
545         (WebCore::SMILTimeContainer::setElapsed):
546         (WebCore::SMILTimeContainer::timerFired):
547         * svg/animation/SMILTimeContainer.h:
548         * testing/Internals.cpp:
549         (WebCore::Internals::delayMediaStreamTrackSamples):
550         * testing/MockGamepad.cpp:
551         (WebCore::MockGamepad::MockGamepad):
552         (WebCore::MockGamepad::updateDetails):
553         (WebCore::MockGamepad::setAxisValue):
554         (WebCore::MockGamepad::setButtonValue):
555
556 2018-03-02  Alejandro G. Castro  <alex@igalia.com>
557
558         Make LibWebRTCProvider port agnostic again after r215424
559         https://bugs.webkit.org/show_bug.cgi?id=183080
560
561         Reviewed by Youenn Fablet.
562
563         In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
564         we have moved that code to the cocoa class and created a glib implementation that will be used in the future
565         to implement the LibWebRTCProviderGlib class.
566
567         No new tests, this is a refactor.
568
569         * Sources.txt: Add the compilation of the new file.
570         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
571         (WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
572         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
573         (WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
574         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
575         (WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
576         linking libwebrtc for the moment in these situations.
577
578 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
579
580         REGRESSION(r222843): [HarfBuzz] Combining enclosed keycap not correctly handled
581         https://bugs.webkit.org/show_bug.cgi?id=183246
582
583         Reviewed by Michael Catanzaro.
584
585         We are not correctly handling the combining enclosed keycap since we switched to use
586         ComplexTextController. This is because fontForCombiningCharacterSequence() always returns the font of the first
587         character, without checking if that font can render the whole sequence or not. Before 222843, the shaper did
588         that check when creating the text runs. In this case the sequence was split and a different font was used for the
589         text and the mark. This patch makes fontForCombiningCharacterSequence() try to find a suitable font for the
590         whole sequence, first looking at the CSS fallbacks and finally at system ones. The result is much better than
591         the old one, because we use the same font for both the text and the mark. If there isn't any font to render the
592         mark, then we fallback to use the first character font, since we will end up rendering the missing glyph
593         character, it's better to use the same font than the first character one.
594
595         Test: fast/text/combining-enclosing-keycap.html
596
597         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
598         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check if the first charatcer font can render
599         the whole sequence, trying with fallbacks otherwise.
600         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
601         (WebCore::Font::canRenderCombiningCharacterSequence const): Check if the font face has glyphs for the whole
602         sequence not just the first character.
603
604 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
605
606         [FreeType] Remove FontPlatformData fallbacks
607         https://bugs.webkit.org/show_bug.cgi?id=183210
608
609         Reviewed by Michael Catanzaro.
610
611         They are only used by FontCache::systemFallbackForCharacters() where a direct FcFontMatch provides the same
612         or better results.
613
614         * platform/graphics/FontPlatformData.h: Remove fallbacks.
615         * platform/graphics/freetype/FontCacheFreeType.cpp:
616         (WebCore::FontCache::systemFallbackForCharacters): Use FcFontMatch() only.
617         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
618         (WebCore::FontPlatformData::fallbacks): Removed.
619
620 2018-03-01  Commit Queue  <commit-queue@webkit.org>
621
622         Unreviewed, rolling out r229153.
623         https://bugs.webkit.org/show_bug.cgi?id=183274
624
625         it is breaking imported/w3c/web-platform-tests/service-workers
626         /service-worker/clients-matchall-exact-controller.https.html
627         (Requested by youenn on #webkit).
628
629         Reverted changeset:
630
631         "Clients should register to StorageProcess with their service
632         worker registration identifier"
633         https://bugs.webkit.org/show_bug.cgi?id=182313
634         https://trac.webkit.org/changeset/229153
635
636 2018-03-01  Youenn Fablet  <youenn@apple.com>
637
638         Clients should register to StorageProcess with their service worker registration identifier
639         https://bugs.webkit.org/show_bug.cgi?id=182313
640
641         Reviewed by Chris Dumez.
642
643         No observable change of behavior in regular conditions.
644         When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
645         and we will not be able to retrieve the registration from these identifiers.
646         The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
647         Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
648
649         * dom/Document.cpp:
650         (WebCore::Document::setServiceWorkerConnection):
651         * workers/service/SWClientConnection.h:
652         * workers/service/server/SWServer.cpp:
653         (WebCore::SWServer::registerServiceWorkerClient):
654         * workers/service/server/SWServer.h:
655
656 2018-03-01  Youenn Fablet  <youenn@apple.com>
657
658         Add API test to validate setting of service worker and cache storage directories
659         https://bugs.webkit.org/show_bug.cgi?id=182543
660
661         Reviewed by Chris Dumez.
662
663         Covered by API tests.
664
665         Add getters to service worker registration directory.
666
667         * testing/Internals.cpp:
668         (WebCore::Internals::serviceWorkerRegistrationDirectory):
669         * testing/Internals.h:
670         * testing/Internals.idl:
671         * workers/service/SWClientConnection.h:
672         * workers/service/server/RegistrationDatabase.h:
673         (WebCore::RegistrationDatabase::serviceWorkerRegistrationDirectory const):
674         * workers/service/server/RegistrationStore.h:
675         (WebCore::RegistrationStore::serviceWorkerRegistrationDirectory const):
676         * workers/service/server/SWServer.h:
677         (WebCore::SWServer::serviceWorkerRegistrationDirectory const):
678
679 2018-03-01  Youenn Fablet  <youenn@apple.com>
680
681         SWServer::removeClientServiceWorkerRegistration should not log an error if there is no registration
682         https://bugs.webkit.org/show_bug.cgi?id=183248
683
684         Reviewed by Chris Dumez.
685
686         No change of behavior.
687         Removed the error logging.
688         As can be seen from running api and layout tests, a web process can ask a registration to be unregistered
689         and by the time it goes to the StorageProcess, the registration is already cleared.
690
691         * workers/service/server/SWServer.cpp:
692         (WebCore::SWServer::removeClientServiceWorkerRegistration):
693
694 2018-03-01  Daniel Bates  <dabates@apple.com>
695
696         CSS ::selection stroke-color and stroke-width are not applied to selected text in text fields
697         and ::selection:window-inactive stroke-color and stroke-width are never applied
698         https://bugs.webkit.org/show_bug.cgi?id=183178
699
700         Reviewed by David Hyatt.
701
702         This change fixes the following two issues:
703             1. Properties stroke-color and stroke-width are not applied to the ::selection pseudo-
704                element of text fields.
705             2. Properties stroke-color and stroke-width are never applied to ::selection:window-inactive
706                pseudo elements.
707
708         Currently when computing the paint styles for selected text we query the cached styles for
709         the ::selection pseudo element on the renderer. Text fields are implemented using a User Agent
710         shadow DOM. With regards to issue (1) the renderer queried was the inner most renderer for
711         the text in the text field. But it should have been the shadow host renderer (i.e. the renderer
712         for the <input>). With regards to issue (2) we cannot retrieve cached styles for the
713         ::selection pseudo element because it can be effected by a pseudo class, :window-inactive,
714         which matches when the page is deactivated (i.e. the window is in the background as the user
715         made another window the frontmost window). Both of these issues are fixed by making use
716         of RenderElement::selectionPseudoStyle().
717
718         Tests: fast/selectors/selection-window-inactive-stroke-color.html
719                fast/selectors/selection-window-inactive-text-shadow.html
720                fast/selectors/text-field-selection-stroke-color.html
721                fast/selectors/text-field-selection-text-shadow.html
722                fast/selectors/text-field-selection-window-inactive-stroke-color.html
723                fast/selectors/text-field-selection-window-inactive-text-shadow.html
724
725         * rendering/RenderText.h:
726         (WebCore::RenderText::selectionPseudoStyle const): Add a convenience function that turns
727         around and calls the function of the same name on its parent.
728         * rendering/TextPaintStyle.cpp:
729         (WebCore::computeTextSelectionPaintStyle): Modified to use RenderText::selectionPseudoStyle()
730         instead of directly querying for the cached styles for the ::selection pseudo element.
731
732 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
733
734         Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
735         https://bugs.webkit.org/show_bug.cgi?id=183231
736         <rdar://problem/37793457>
737
738         Reviewed by Brent Fulgham.
739
740         When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
741         The notification about scrollbar preferences is never received by the WebContent process when there is no
742         WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
743         notifying the WebProcess about this by sending it a message. This message should also contain the preferred
744         scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
745         there is no WindowServer access.
746
747         No new tests, covered by existing tests.
748
749         * WebCore.xcodeproj/project.pbxproj:
750         * platform/mac/NSScrollerImpDetails.h:
751         * platform/mac/NSScrollerImpDetails.mm:
752         (WebCore::ScrollerStyle::recommendedScrollerStyle):
753         (WebCore::ScrollerStyle::setUseOverlayScrollbars):
754         (WebCore::recommendedScrollerStyle): Deleted.
755         * platform/mac/ScrollAnimatorMac.mm:
756         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
757         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar const):
758         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar const):
759         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
760         * platform/mac/ScrollbarThemeMac.mm:
761         (WebCore::ScrollbarThemeMac::registerScrollbar):
762         (WebCore::ScrollbarThemeMac::scrollbarThickness):
763         (WebCore::ScrollbarThemeMac::usesOverlayScrollbarsChanged):
764
765 2018-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
766
767         Temporarily enable user-installed-fonts everywhere until we can stop crashing on launch
768         https://bugs.webkit.org/show_bug.cgi?id=183255
769
770         Unreviewed.
771
772         Tests are already disabled.
773
774         * platform/graphics/cocoa/FontCacheCoreText.cpp:
775
776 2018-03-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
777
778         [Curl] Split DNS cache expiration and connection timeout setting.
779         https://bugs.webkit.org/show_bug.cgi?id=182979
780
781         It was mis-implemented and was named ambiguous name 'enableTimeout'.
782         Implement each feature correctly.
783
784         Reviewed by Per Arne Vollan.
785
786         * platform/network/curl/CurlContext.cpp:
787         (WebCore::EnvironmentVariableReader::read):
788         (WebCore::EnvironmentVariableReader::defined):
789         (WebCore::EnvironmentVariableReader::readAs):
790         (WebCore::EnvironmentVariableReader::sscanTemplate):
791         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>):
792         (WebCore::CurlContext::CurlContext):
793         (WebCore::safeTimeValue):
794         (WebCore::CurlHandle::setDnsCacheTimeout):
795         (WebCore::CurlHandle::setConnectTimeout):
796         (WebCore::CurlHandle::setTimeout):
797         (WebCore::CurlHandle::enableTimeout): Deleted.
798         * platform/network/curl/CurlContext.h:
799         (WebCore::CurlContext::dnsCacheTimeout const):
800         (WebCore::CurlContext::connectTimeout const):
801         * platform/network/curl/CurlRequest.cpp:
802         (WebCore::CurlRequest::setupTransfer):
803
804 2018-03-01  Zalan Bujtas  <zalan@apple.com>
805
806         Remove RenderElement::s_noLongerAffectsParentBlock
807         https://bugs.webkit.org/show_bug.cgi?id=183196
808         <rdar://problem/38030797>
809
810         Reviewed by Antti Koivisto.
811
812         Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
813
814         Covered by existing tests.
815
816         * rendering/RenderBlockFlow.cpp:
817         (WebCore::RenderBlockFlow::styleDidChange):
818         * rendering/RenderElement.cpp:
819         (WebCore::RenderElement::styleWillChange):
820         (WebCore::RenderElement::noLongerAffectsParentBlock const):
821         (WebCore::RenderElement::styleDidChange):
822         * rendering/RenderElement.h:
823         (WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
824
825 2018-03-01  Chris Dumez  <cdumez@apple.com>
826
827         imported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails with async policy delegates
828         https://bugs.webkit.org/show_bug.cgi?id=183225
829         <rdar://problem/38003828>
830
831         Reviewed by Alex Christensen.
832
833         Bypass navigation policy check when loading about:blank. This does not seem necessary and it would not
834         be Web-compatible for such policy check to happen synchronously. This is because an iframe without src
835         or src="about:blank" should load synchronously as per HTML specification.
836
837         Test: http/wpt/html/browsers/windows/browsing-context.html
838
839         * loader/PolicyChecker.cpp:
840         (WebCore::PolicyChecker::checkNavigationPolicy):
841
842 2018-03-01  Christopher Reid  <chris.reid@sony.com>
843
844         [Curl] Linker errors in some curl files due to missing exports
845         https://bugs.webkit.org/show_bug.cgi?id=183238
846
847         Reviewed by Alex Christensen.
848
849         No new tests, no change in behavior.
850
851         Adding WEBCORE_EXPORT to functions now used in WebKit.
852
853         * platform/network/NetworkStorageSession.h:
854         * platform/network/curl/CookieJarDB.h:
855         * platform/network/curl/CurlContext.h:
856
857 2018-03-01  Commit Queue  <commit-queue@webkit.org>
858
859         Unreviewed, rolling out r229130.
860         https://bugs.webkit.org/show_bug.cgi?id=183244
861
862         It breaks AppleWin compilation (Requested by alexg__ on
863         #webkit).
864
865         Reverted changeset:
866
867         "Make LibWebRTCProvider port agnostic again after r215424"
868         https://bugs.webkit.org/show_bug.cgi?id=183080
869         https://trac.webkit.org/changeset/229130
870
871 2018-03-01  Alejandro G. Castro  <alex@igalia.com>
872
873         Make LibWebRTCProvider port agnostic again after r215424
874         https://bugs.webkit.org/show_bug.cgi?id=183080
875
876         Reviewed by Youenn Fablet.
877
878         In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
879         we have moved that code to the cocoa class and created a glib implementation that will be used in the future
880         to implement the LibWebRTCProviderGlib class.
881
882         No new tests, this is a refactor.
883
884         * Sources.txt: Add the compilation of the new file.
885         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
886         (WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
887         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
888         (WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
889         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
890         (WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
891         linking libwebrtc for the moment in these situations.
892
893 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
894
895         [FreeType] Color emojis in WebKitGTK+ for great justice
896         https://bugs.webkit.org/show_bug.cgi?id=183155
897
898         Reviewed by Michael Catanzaro.
899
900         Emojis are actually rendered if there's an emoji font installed in the system, but the size is so tiny that we
901         don't see them. This is because for some reason the matrix we are getting from fontconfig contains a scale,
902         which we don't expect. We only get the fontconfig matrix to apply rotations in case of oblique fonts, and then we
903         always apply the scale for the computed pixel font size. Ignoring the fontconfig matrix scale fixes the issue.
904
905         * platform/graphics/freetype/FontCacheFreeType.cpp:
906         (WebCore::fontWeightToFontconfigWeight): Moved here since it's now used by configurePatternForFontDescription().
907         (WebCore::configurePatternForFontDescription): Helper function to apply the same options for fallback pattern.
908         (WebCore::createFontConfigPatternForCharacters): Use configurePatternForFontDescription().
909         (WebCore::findBestFontGivenFallbacks): Adopt the returned reference.
910         (WebCore::FontCache::systemFallbackForCharacters): Clean it up.
911         (WebCore::FontCache::createFontPlatformData): Use configurePatternForFontDescription().
912         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
913         (WebCore::FontPlatformData::buildScaledFont): Ignore the scale returned by fontconfig matrix.
914
915 2018-02-28  Philippe Normand  <pnormand@igalia.com>
916
917         [GStreamer] text samples no longer processed
918         https://bugs.webkit.org/show_bug.cgi?id=183212
919
920         Reviewed by Xabier Rodriguez-Calvar.
921
922         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
923         (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Refer to
924         track stream ID instead of (potentially) manually generated track
925         ID stored as hashmap keys.
926
927 2018-02-28  Tim Horton  <timothy_horton@apple.com>
928
929         Push WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it inside
930         https://bugs.webkit.org/show_bug.cgi?id=183193
931
932         Reviewed by Andy Estes.
933
934         * DerivedSources.make:
935         * bindings/scripts/preprocessor.pm:
936         (applyPreprocessor):
937         Instead of trying to discern WTF_PLATFORM_IOS inside preprocessor.pm,
938         push it down from DerivedSources.make. Also clean up DerivedSources.make
939         a tiny bit by adding a variable, FEATURE_AND_PLATFORM_DEFINES, which
940         contains both FEATURE_DEFINES and WTF_PLATFORM macros if needed.
941
942 2018-02-28  Nan Wang  <n_wang@apple.com>
943
944         AX: AOM: Dispatch accessiblesetvalue event
945         https://bugs.webkit.org/show_bug.cgi?id=183021
946         <rdar://problem/37764242>
947
948         Reviewed by Chris Fleizach.
949
950         Accessibility events.
951         Spec: https://wicg.github.io/aom/spec/phase2.html
952
953         Added a new event type AccessibleSetValueEvent. 
954
955         Test: accessibility/mac/AOM-event-accessiblesetvalue.html
956
957         * CMakeLists.txt:
958         * DerivedSources.make:
959         * Sources.txt:
960         * WebCore.xcodeproj/project.pbxproj:
961         * accessibility/AccessibilityAllInOne.cpp:
962         * accessibility/AccessibilityNodeObject.cpp:
963         (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
964         * accessibility/AccessibilityObject.cpp:
965         (WebCore::AccessibilityObject::press):
966         (WebCore::AccessibilityObject::dispatchAccessibilityEvent):
967         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent):
968         * accessibility/AccessibilityObject.h:
969         * accessibility/AccessibilityRenderObject.cpp:
970         (WebCore::AccessibilityRenderObject::setValue):
971         * accessibility/AccessibilityScrollbar.cpp:
972         (WebCore::AccessibilityScrollbar::setValue):
973         * accessibility/AccessibilitySlider.cpp:
974         (WebCore::AccessibilitySlider::setValue):
975         * accessibility/AccessibleSetValueEvent.cpp: Added.
976         (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
977         * accessibility/AccessibleSetValueEvent.h: Added.
978         (WebCore::AccessibleSetValueEvent::create):
979         (WebCore::AccessibleSetValueEvent::value const):
980         * accessibility/AccessibleSetValueEvent.idl: Added.
981         * dom/Element.idl:
982         * dom/EventNames.h:
983         * dom/EventNames.in:
984
985 2018-02-28  Chris Dumez  <cdumez@apple.com>
986
987         html/browsers/browsing-the-web/navigating-across-documents/006.html fails with async policy delegates
988         https://bugs.webkit.org/show_bug.cgi?id=183168
989         <rdar://problem/37951341>
990
991         Reviewed by Alex Christensen.
992
993         The test has an anchor element with both a 'click' event handler which submits a form
994         and an href attribute. When clicking the link, as per specification, things happen in
995         this order:
996         1. We fire the click event at the anchor, which will execute the event handler and submit the form.
997            Submitting the form *schedules* a navigation to 'click.html'.
998         2. We execute the anchor activation code which *navigates* to 'href.html'. The navigation to
999            'href' is supposed to cancel the pending navigation to 'click.html' and we should navigate
1000            to 'href.html', which is what the test asserts.
1001
1002         The issue for us is that we do not cancel pending navigations until after the navigation
1003         policy decision is made, when the provisional loads actually starts, in FrameLoader::provisionalLoadStarted().
1004         Because the policy decision for the navigation can now be made asynchronously, the NavigationScheduler
1005         timer can now fire while the decision is made and we'll submit the form, thus navigating to
1006         'click.html'.
1007
1008         To address the issue, we now cancel any pending navigations in FrameLoader::loadWithDocumentLoader(),
1009         *before* doing the policy check for the navigation.
1010
1011         Test: http/wpt/html/browsers/browsing-the-web/navigating-across-documents/006.html
1012
1013         * loader/FrameLoader.cpp:
1014         (WebCore::FrameLoader::loadWithDocumentLoader):
1015
1016 2018-02-28  John Wilander  <wilander@apple.com>
1017
1018         Add a second tier of prevalence to facilitate telemetry on very prevalent domains
1019         https://bugs.webkit.org/show_bug.cgi?id=183218
1020         <rdar://problem/37992388>
1021
1022         Reviewed by Brent Fulgham.
1023
1024         Test: http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html
1025
1026         * loader/ResourceLoadStatistics.cpp:
1027         (WebCore::ResourceLoadStatistics::encode const):
1028         (WebCore::ResourceLoadStatistics::decode):
1029         (WebCore::ResourceLoadStatistics::toString const):
1030         (WebCore::ResourceLoadStatistics::merge):
1031             Handling of the new boolean field isVeryPrevalentResource.
1032         * loader/ResourceLoadStatistics.h:
1033             Added the new boolean field isVeryPrevalentResource.
1034
1035 2018-02-28  Alex Christensen  <achristensen@webkit.org>
1036
1037         Reduce use of NetworkingContext in WebKit
1038         https://bugs.webkit.org/show_bug.cgi?id=183213
1039
1040         Reviewed by Brady Eidson.
1041
1042         NetworkingContext is intended to be used only with ResourceHandle, which is now only used in WebKitLegacy.
1043         Now that we don't use ResourceHandle in the WebProcess, everything that was done through the NetworkingContext
1044         can now be done a cleaner way with no change in behavior.
1045
1046         * loader/FrameLoader.cpp:
1047         (WebCore::FrameLoader::loadResourceSynchronously):
1048         * loader/LinkLoader.cpp:
1049         (WebCore::LinkLoader::loadLink):
1050         * loader/LoaderStrategy.h:
1051         * platform/network/ProxyServer.h:
1052         * platform/network/cf/ProxyServerCFNet.cpp:
1053         (WebCore::proxyServersForURL):
1054         * platform/network/curl/ProxyServerCurl.cpp:
1055         (WebCore::proxyServersForURL):
1056         * platform/network/soup/ProxyServerSoup.cpp:
1057         (WebCore::proxyServersForURL):
1058
1059 2018-02-28  Zalan Bujtas  <zalan@apple.com>
1060
1061         Remove RenderElement::s_affectsParentBlock
1062         https://bugs.webkit.org/show_bug.cgi?id=183187
1063         <rdar://problem/37961079>
1064
1065         Reviewed by Antti Koivisto.
1066
1067         Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
1068
1069         Covered by existing tests.
1070
1071         * rendering/RenderElement.cpp:
1072         (WebCore::RenderElement::styleWillChange):
1073         (WebCore::RenderElement::styleDidChange):
1074         * rendering/RenderElement.h:
1075
1076 2018-02-28  Antti Koivisto  <antti@apple.com>
1077
1078         Filter attribute selectors with selector filter
1079         https://bugs.webkit.org/show_bug.cgi?id=183200
1080
1081         Reviewed by Zalan Bujtas.
1082
1083         Currently selector filtering is done based on tags, classes and ids. We should include attributes too.
1084
1085         This patch adds filtering based on attribute name (but not content).
1086
1087         * css/SelectorFilter.cpp:
1088         (WebCore::isExcludedAttribute):
1089
1090             Ignore id, class and style attributes. First two are already handled and the last is common but is rarely
1091             used in selectors.
1092
1093         (WebCore::collectElementIdentifierHashes):
1094
1095             Collect attributes.
1096             Remove the unnecessary StyledElement casting.
1097
1098         (WebCore::collectSimpleSelectorHash):
1099
1100             Collect attribute selectors.
1101
1102         (WebCore::chooseSelectorHashesForFilter):
1103
1104             Pick attributes with high priority for the filter as it is likely a good signal.
1105
1106 2018-02-27  Sergio Villar Senin  <svillar@igalia.com>
1107
1108         [WebVR] Convert VRPlatformDisplayInfo into a class
1109         https://bugs.webkit.org/show_bug.cgi?id=183162
1110
1111         Reviewed by Žan Doberšek.
1112
1113         In preparation for further changes we're transforming the
1114         VRPlatformDisplayInfo into a class. All the members are now private
1115         and the class provides the needed getters/setters.
1116
1117         Apart from that VRDisplayCapabilityFlags is now just an unsigned and
1118         the different flags are defined in VRDisplayCapabilityFlag enum.
1119         Another cleanup was the removal of VRDisplayCapabilities.cpp as
1120         everything can be implemented in the header.
1121
1122         * Modules/webvr/VRDisplay.cpp:
1123         (WebCore::VRDisplay::VRDisplay):
1124         (WebCore::VRDisplay::isConnected const):
1125         (WebCore::VRDisplay::stageParameters const):
1126         * Modules/webvr/VRDisplayCapabilities.cpp: Removed.
1127         * Modules/webvr/VRDisplayCapabilities.h:
1128         (WebCore::VRDisplayCapabilities::hasPosition const):
1129         (WebCore::VRDisplayCapabilities::hasOrientation const):
1130         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
1131         (WebCore::VRDisplayCapabilities::canPresent const):
1132         (WebCore::VRDisplayCapabilities::maxLayer const):
1133         (WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
1134         * Sources.txt:
1135         * platform/vr/VRPlatformDisplay.h:
1136         (WebCore::VRPlatformDisplayInfo::displayName const):
1137         (WebCore::VRPlatformDisplayInfo::setDisplayName):
1138         (WebCore::VRPlatformDisplayInfo::isConnected const):
1139         (WebCore::VRPlatformDisplayInfo::setIsConnected):
1140         (WebCore::VRPlatformDisplayInfo::isMounted const):
1141         (WebCore::VRPlatformDisplayInfo::setIsMounted):
1142         (WebCore::VRPlatformDisplayInfo::capabilityFlags const):
1143         (WebCore::VRPlatformDisplayInfo::setCapabilityFlags):
1144         (WebCore::VRPlatformDisplayInfo::displayIdentifier const):
1145         (WebCore::VRPlatformDisplayInfo::setDisplayIdentifier):
1146         (WebCore::VRPlatformDisplayInfo::eyeTranslation const):
1147         (WebCore::VRPlatformDisplayInfo::setEyeTranslation):
1148         (WebCore::VRPlatformDisplayInfo::eyeFieldOfView const):
1149         (WebCore::VRPlatformDisplayInfo::setEyeFieldOfView):
1150         (WebCore::VRPlatformDisplayInfo::renderSize const):
1151         (WebCore::VRPlatformDisplayInfo::setRenderSize):
1152         (WebCore::VRPlatformDisplayInfo::setPlayAreaBounds):
1153         (WebCore::VRPlatformDisplayInfo::playAreaBounds const):
1154         (WebCore::VRPlatformDisplayInfo::setSittingToStandingTransform):
1155         (WebCore::VRPlatformDisplayInfo::sittingToStandingTransform const):
1156         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
1157         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
1158         (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters):
1159         (WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
1160
1161 2018-02-27  Commit Queue  <commit-queue@webkit.org>
1162
1163         Unreviewed, rolling out r229060.
1164         https://bugs.webkit.org/show_bug.cgi?id=183198
1165
1166         This patch causes crashes on two SVG tests (Requested by fredw
1167         on #webkit).
1168
1169         Reverted changeset:
1170
1171         "Relayout frames after AsyncFrameScrolling or FrameFlattening
1172         option is changed"
1173         https://bugs.webkit.org/show_bug.cgi?id=183081
1174         https://trac.webkit.org/changeset/229060
1175
1176 2018-02-27  Youenn Fablet  <youenn@apple.com>
1177
1178         Do not trigger a service worker match in case of document redirection if it will be already served by AppCache
1179         https://bugs.webkit.org/show_bug.cgi?id=183185
1180         <rdar://problem/37693796>
1181
1182         Reviewed by Chris Dumez.
1183
1184         Disabling service worker matching in case there is a substitute data.
1185         Otherwise there is a risk for a double load, substitute data first and the new load
1186         triggered if matching a new registration.
1187         A future fix should first do service worker registration matching and if there is no registration query appcache.
1188
1189         Test: http/tests/appcache/main-resource-redirect-with-sw.html
1190
1191         * loader/DocumentLoader.cpp:
1192         (WebCore::DocumentLoader::redirectReceived):
1193
1194 2018-02-27  Tim Horton  <timothy_horton@apple.com>
1195
1196         Ensure target triple is propagated correctly to DerivedSources.make
1197         https://bugs.webkit.org/show_bug.cgi?id=183189
1198         <rdar://problem/37959694>
1199
1200         Reviewed by Dan Bernstein.
1201
1202         If we don't propagate the target triple, we can sometimes build with
1203         the wrong options enabled.
1204
1205         * Configurations/Base.xcconfig:
1206         Mentioning LLVM_TARGET_TRIPLE_SUFFIX here is required to get it to be available to scripts.
1207
1208         * DerivedSources.make:
1209         Propagate the target triple into our compiler invocations.
1210
1211 2018-02-27  Doug Russell  <doug@getitdownonpaper.com>
1212
1213         AX: Spell check and style attributes should be optional when fetching attributed string
1214         https://bugs.webkit.org/show_bug.cgi?id=160744
1215
1216         Reviewed by Chris Fleizach.
1217
1218         The overhead of fetching a spell checked attributed string via AX API is substantial. 
1219         In some cases on the order of 7/8 of the total time spent fetching the string.
1220
1221         This change introduces the new attribute AXAttributedStringForTextMarkerRangeWithOptions which accepts an NSDictionary as it's parameter with keys "AXTextMarkerRange" (AXTextMarkerRangeRef) and "AXSpellCheck" (NSNumber(BOOL)).
1222
1223         AXAttributedStringForTextMarkerRange will remain unchanged.
1224
1225         Tests: accessibility/mac/attributed-string/attributed-string-for-range-with-options.html
1226                accessibility/mac/attributed-string/attributed-string-for-range.html
1227
1228         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1229         (AXAttributedStringAppendText):
1230         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
1231         (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
1232         (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
1233         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1234         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Deleted.
1235
1236 2018-02-27  Daniel Bates  <dabates@apple.com>
1237
1238         Standardize terminology for marked text
1239         https://bugs.webkit.org/show_bug.cgi?id=180999
1240
1241         Reviewed by Zalan Bujtas.
1242
1243         The name MarkerSubrange is a misnomer for a data structure that associates a text subrange with a type
1244         and optional document marker. In particular, a MarkerSubrange may not always correspond to a document
1245         marker. For instance, selected text is represented using a MarkerSubrange that does not have a
1246         corresponding document marker. Let's standardize on the phrase "marked text" as the canonical way to
1247         describe these tagged text subranges.
1248
1249         * Sources.txt:
1250         * WebCore.xcodeproj/project.pbxproj:
1251         * rendering/InlineTextBox.cpp:
1252         (WebCore::InlineTextBox::localSelectionRect const):
1253         (WebCore::InlineTextBox::MarkedTextStyle::areBackgroundMarkedTextStylesEqual):
1254         (WebCore::InlineTextBox::MarkedTextStyle::areForegroundMarkedTextStylesEqual):
1255         (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual):
1256         (WebCore::InlineTextBox::StyledMarkedText::StyledMarkedText):
1257         (WebCore::createMarkedTextFromSelectionInBox):
1258         (WebCore::InlineTextBox::paint):
1259         (WebCore::InlineTextBox::paintPlatformDocumentMarkers):
1260         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
1261         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const):
1262         (WebCore::InlineTextBox::resolveStyleForMarkedText):
1263         (WebCore::InlineTextBox::subdivideAndResolveStyle):
1264         (WebCore::InlineTextBox::coalesceAdjacentMarkedTexts):
1265         (WebCore::InlineTextBox::collectMarkedTextsForDraggedContent):
1266         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers):
1267         (WebCore::InlineTextBox::paintMarkedTexts):
1268         (WebCore::InlineTextBox::paintMarkedTextBackground):
1269         (WebCore::InlineTextBox::paintMarkedTextForeground):
1270         (WebCore::InlineTextBox::paintMarkedTextDecoration):
1271         (WebCore::InlineTextBox::paintCompositionBackground):
1272         (WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual): Deleted.
1273         (WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual): Deleted.
1274         (WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual): Deleted.
1275         (WebCore::InlineTextBox::StyledMarkerSubrange::StyledMarkerSubrange): Deleted.
1276         (WebCore::createMarkerSubrangeFromSelectionInBox): Deleted.
1277         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkerSubrange const): Deleted.
1278         (WebCore::InlineTextBox::resolveStyleForSubrange): Deleted.
1279         (WebCore::InlineTextBox::coalesceAdjacentSubranges): Deleted.
1280         (WebCore::InlineTextBox::collectSubrangesForDraggedContent): Deleted.
1281         (WebCore::InlineTextBox::collectSubrangesForDocumentMarkers): Deleted.
1282         (WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
1283         (WebCore::InlineTextBox::paintTextSubrangeBackground): Deleted.
1284         (WebCore::InlineTextBox::paintTextSubrangeForeground): Deleted.
1285         (WebCore::InlineTextBox::paintTextSubrangeDecoration): Deleted.
1286         * rendering/InlineTextBox.h:
1287         (WebCore::InlineTextBox::paintMarkedTexts):
1288         (WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
1289         * rendering/MarkedText.cpp: Renamed from Source/WebCore/rendering/MarkerSubrange.cpp.
1290         (WebCore::subdivide):
1291         * rendering/MarkedText.h: Renamed from Source/WebCore/rendering/MarkerSubrange.h.
1292         (WebCore::MarkedText::MarkedText):
1293         (WebCore::MarkedText::isEmpty const):
1294         (WebCore::MarkedText::operator!= const):
1295         (WebCore::MarkedText::operator== const):
1296
1297 2018-02-27  Chris Dumez  <cdumez@apple.com>
1298
1299         Unreviewed, roll out r228430.
1300
1301         Roll out r228430 now that it is no longer needed after r228852.
1302
1303         No new tests, initial fix is still covered by WebKit.RespondToPolicyForNavigationResponseAsynchronously
1304         API test.
1305
1306         * loader/FrameLoader.cpp:
1307         (WebCore::FrameLoader::stopLoading):
1308         * loader/NavigationScheduler.cpp:
1309         (WebCore::NavigationScheduler::schedule):
1310
1311 2018-02-27  Antoine Quint  <graouts@apple.com>
1312
1313         [Web Animations] Correct implementation of pending tasks and promises
1314         https://bugs.webkit.org/show_bug.cgi?id=183161
1315
1316         Reviewed by Dean Jackson.
1317
1318         We had an incorrect implementation of the spec due to two misinterpretations.
1319
1320         The first one is about pending tasks (play and pause) which the spec says should
1321         be performed by "scheduling a task". In WebCore, this means using postTask() on a
1322         ScriptExecutionContext, such as Document. One of the big practical changes is that
1323         calling play() on an animation correctly sets its startTime to null (unresolved)
1324         immediately after the call to play() returns before setting it to a resolved value
1325         when the task is performed asynchronously. As a result, the playState is now always
1326         accurate.
1327
1328         The second one is about promises where new promises need to be created in certain
1329         situations called out by the spec. We used to call clear() on them, but this merely
1330         resets the fulfillment or rejection state of the promise, while the spec requires
1331         a different object to be returned for the promise. We now create our promises using
1332         makeUniqueRef<> when new promise objects are expected to be created.
1333
1334         This patch also corrects a few smaller bugs and spec compliant issues, called out
1335         below, related to pending tasks and promises uncovered while looking at relevant
1336         WPT tests.
1337
1338         * animation/DocumentTimeline.h: Expose the Document used to create this timeline such
1339         that it may be used by WebAnimation objects registered for this timeline when scheduling
1340         a task is required via postTask().
1341         * animation/WebAnimation.cpp:
1342         (WebCore::WebAnimation::WebAnimation):
1343         (WebCore::WebAnimation::setBindingsStartTime):
1344         (WebCore::WebAnimation::setCurrentTime):
1345         (WebCore::WebAnimation::cancel): Ensure the finished promise has not already been fulfilled
1346         before rejecting it. While the spec does not specifically call this out, a promise may not
1347         be rejected after being fulfilled, and we would hit an ASSERT if we didn't also check that
1348         it was in the correct pending state before attemping to reject it.
1349         (WebCore::WebAnimation::resetPendingTasks):
1350         (WebCore::WebAnimation::finish):
1351         (WebCore::WebAnimation::updateFinishedState):
1352         (WebCore::WebAnimation::finishNotificationSteps):
1353         (WebCore::WebAnimation::play): We used to only check for a pending pause task before canceling
1354         that task, but the spec says to check for either a pending pause or play task (ie. pending())
1355         and to cancel whichever is scheduled.
1356         (WebCore::WebAnimation::runPendingPlayTask): We were missing an assertion called out by the
1357         spec when running a pending task.
1358         (WebCore::WebAnimation::pause):
1359         (WebCore::WebAnimation::runPendingPauseTask):
1360         (WebCore::WebAnimation::updatePendingTasks): We now use postTask() on the animation's associated
1361         timeline's document to schedule pending tasks for which the criteria to run are met, ie. there
1362         is an associated timeline.
1363         * animation/WebAnimation.h:
1364
1365 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1366
1367         [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
1368         https://bugs.webkit.org/show_bug.cgi?id=183100
1369         <rdar://problem/37840987>
1370
1371         Reviewed by Tim Horton.
1372
1373         Introduce new customization options to ViewportConfiguration. The first is m_forceHorizontalShrinkToFit, which
1374         (when set to true) forces the viewport to scale using shrink-to-fit heuristics, regardless of whether
1375         "shrink-to-fit=no" is specified via viewport parameters or if content width did not exceed minimum layout size.
1376         The second is m_viewSize, which reflects the true size of the viewport. See WebKit ChangeLog for more details.
1377
1378         Tests: ViewportSizingTests.ForceShrinkToFitViewportOverridesViewportParameters
1379                ViewportSizingTests.ShrinkToFitViewportWithMinimumAllowedLayoutWidth
1380
1381         * page/ViewportConfiguration.cpp:
1382         (WebCore::ViewportConfiguration::ViewportConfiguration):
1383         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
1384
1385         Plumb the real size of the view alongside the minimum layout size when updating the minimum layout size.
1386
1387         (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit):
1388         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
1389
1390         Bail early and return true if forceHorizontalShrinkToFit is set. This forces shrink-to-fit even in cases where
1391         "shrink-to-fit" is set to "no", or content dimensions don't exceed layout dimensions.
1392
1393         (WebCore::ViewportConfiguration::initialScaleFromSize const):
1394
1395         Use view dimensions rather than minimum layout dimensions when computing the initial scale. Minimum layout size
1396         is no longer always equal to the size of the view if the client has specified a minimum allowed layout width. As
1397         such, when computing the initial scale, to ensure that the content (which was laid out using the minimum layout
1398         size) fits within the real viewport, we need to divide real viewport dimensions by content dimensions.
1399
1400         (WebCore::ViewportConfiguration::minimumScale const):
1401
1402         Similarly, use view size instead of minimum layout size to compute minimum scale.
1403
1404         (WebCore::ViewportConfiguration::description const):
1405         * page/ViewportConfiguration.h:
1406
1407 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1408
1409         Unreviewed, fix the debug build after r228877.
1410
1411         In the case where CAN_DISALLOW_USER_INSTALLED_FONTS is enabled, this function doesn't return anything when
1412         allowUserInstalledFonts != AllowUserInstalledFonts::No. Fix the build by moving `return nullptr;` back out of
1413         the `#else`.
1414
1415         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1416         (WebCore::installedFontMandatoryAttributes):
1417
1418 2018-02-27  Milan Crha  <mcrha@redhat.com>
1419
1420         Potential privacy issue: DNS prefetching can be re-enabled
1421         https://bugs.webkit.org/show_bug.cgi?id=182924
1422
1423         Reviewed by Michael Catanzaro.
1424
1425         * dom/Document.cpp:
1426         (WebCore::Document::parseDNSPrefetchControlHeader):
1427
1428 2018-02-26  Antoine Quint  <graouts@apple.com>
1429
1430         [Web Animations] Implement the procedure to set the target effect of an animation
1431         https://bugs.webkit.org/show_bug.cgi?id=183146
1432
1433         Reviewed by Dean Jackson.
1434
1435         We only had a partial implementation of setEffect() and we now update it to cover the entire
1436         implementation as mandated by the spec. While this doesn't yield any WPT results changes, this
1437         patch will help getting a significant number of new PASS results when we get around to implement
1438         correct support for async procedures (pending pause/play tasks and promises) in the next patch.
1439
1440         * animation/WebAnimation.cpp:
1441         (WebCore::WebAnimation::setEffect):
1442
1443 2018-02-26  Antoine Quint  <graouts@apple.com>
1444
1445         [Web Animations] Update the playState implementation
1446         https://bugs.webkit.org/show_bug.cgi?id=183145
1447
1448         Reviewed by Dean Jackson.
1449
1450         The Web Animations spec has changed since we first implemented the playState property and the "pending"
1451         enum value has been dropped since then (there is a separate "pending" property which we also implement).
1452         We update our implementation to match the latest spec text. This does not change WPT test results a lot,
1453         but this patch will help getting a significant number of new PASS results when we get around to implementing
1454         correct support for async procedures (pending pause/play tasks and promises) in a couple of patches.
1455   
1456         * animation/WebAnimation.cpp:
1457         (WebCore::WebAnimation::playState const):
1458         * animation/WebAnimation.h:
1459         * animation/WebAnimation.idl:
1460
1461 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1462
1463         Address post-review comment after r229049.
1464         https://bugs.webkit.org/show_bug.cgi?id=183142
1465
1466         Reviewed by Tim Horton.
1467
1468         Wrap a newly added string literal with ASCIILiteral.
1469
1470         * rendering/RenderThemeIOS.mm:
1471         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
1472
1473 2018-02-26  Mark Lam  <mark.lam@apple.com>
1474
1475         Modernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments.
1476         https://bugs.webkit.org/show_bug.cgi?id=183159
1477         <rdar://problem/37930837>
1478
1479         Reviewed by Keith Miller.
1480
1481         No new tests needed because this is just a refactoring patch.
1482
1483         * cssjit/SelectorCompiler.cpp:
1484         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1485
1486 2018-02-26  Dan Bernstein  <mitz@apple.com>
1487
1488         Removed references to files that were removed in r228912.
1489
1490         * WebCore.xcodeproj/project.pbxproj: Removed references to SourcesIOS.txt and SourcesMac.txt.
1491
1492 2018-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1493
1494         [Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text
1495         https://bugs.webkit.org/show_bug.cgi?id=183142
1496         <rdar://problem/37912966>
1497
1498         Reviewed by Tim Horton.
1499
1500         Force text-size-adjust and hyphens to be always on in EXTRA_ZOOM_MODE. To accomplish this, we override the extra
1501         style sheet in RenderTheme to include these two style rules.
1502
1503         * rendering/RenderThemeIOS.h:
1504         * rendering/RenderThemeIOS.mm:
1505         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
1506
1507 2018-02-26  Don Olmstead  <don.olmstead@sony.com>
1508
1509         Fix WebCore includes within WebKitLegacy
1510         https://bugs.webkit.org/show_bug.cgi?id=183147
1511
1512         Reviewed by Tim Horton.
1513
1514         No new tests. No change in behavior.
1515
1516         * PlatformWin.cmake:
1517         * platform/win/GDIUtilities.h:
1518
1519 2018-02-26  Youenn Fablet  <youenn@apple.com>
1520
1521         Add some more release logging related to DocumentWriter::addData crash
1522         https://bugs.webkit.org/show_bug.cgi?id=183141
1523
1524         Reviewed by Chris Dumez.
1525
1526         No change of behavior.
1527         Add some additional release logging to verify whether DocumentWriter::begin was called and exited before updating its state.
1528
1529         * loader/DocumentLoader.cpp:
1530         (WebCore::DocumentLoader::commitData):
1531         * loader/DocumentWriter.cpp:
1532         (WebCore::DocumentWriter::begin):
1533         * loader/DocumentWriter.h:
1534
1535 2018-02-26  Antoine Quint  <graouts@apple.com>
1536
1537         [Web Animations] Implement the procedure to set the start time
1538         https://bugs.webkit.org/show_bug.cgi?id=183137
1539
1540         Reviewed by Dean Jackson.
1541
1542         Implement the procedure to set the start time as setBindingsStartTime() and use the setStartTime() method as
1543         an internal method to set the m_startTime instance variable and invalidate the timing model rather than run
1544         the entire procedure which should only be called when setting the "startTime" property through the JS API.
1545
1546         * animation/WebAnimation.cpp:
1547         (WebCore::WebAnimation::setTimeline):
1548         (WebCore::WebAnimation::setBindingsStartTime):
1549         (WebCore::WebAnimation::setStartTime):
1550         (WebCore::WebAnimation::silentlySetCurrentTime):
1551         (WebCore::WebAnimation::finish):
1552         (WebCore::WebAnimation::updateFinishedState):
1553         (WebCore::WebAnimation::runPendingPlayTask):
1554         (WebCore::WebAnimation::runPendingPauseTask):
1555
1556 2018-02-26  Christopher Reid  <chris.reid@sony.com>
1557
1558         [Curl] Cookies are not being added to the Cookie field in Request Headers
1559         https://bugs.webkit.org/show_bug.cgi?id=183095
1560
1561         Reviewed by Alex Christensen.
1562
1563         Populating the Cookie request header field now that cookies are no longer handled in libcurl.
1564
1565         * platform/network/curl/CookieJarCurlDatabase.cpp: Renaming the httpOnly variable as its actual use wasn't clear
1566         * platform/network/curl/ResourceHandleCurl.cpp:
1567
1568 2018-02-26  Antoine Quint  <graouts@apple.com>
1569
1570         [Web Animations] Ensure setting the hold time invalidates the timing model
1571         https://bugs.webkit.org/show_bug.cgi?id=183136
1572
1573         Reviewed by Dean Jackson.
1574
1575         We used to always set the m_holdTime member variable directly, but the computation of the currentTime
1576         depends on the value of m_holdTime, so setting the hold time should invalidate the timing model as well
1577         as setting the m_holdTime member variable. In this patch we add a new setHoldTime() private method that
1578         sets the member variable and invalidates the timing model.
1579
1580         * animation/WebAnimation.cpp:
1581         (WebCore::WebAnimation::setTimeline):
1582         (WebCore::WebAnimation::setHoldTime):
1583         (WebCore::WebAnimation::silentlySetCurrentTime):
1584         (WebCore::WebAnimation::setCurrentTime):
1585         (WebCore::WebAnimation::cancel):
1586         (WebCore::WebAnimation::finish):
1587         (WebCore::WebAnimation::updateFinishedState):
1588         (WebCore::WebAnimation::play):
1589         (WebCore::WebAnimation::runPendingPlayTask):
1590         (WebCore::WebAnimation::pause):
1591         (WebCore::WebAnimation::runPendingPauseTask):
1592         * animation/WebAnimation.h:
1593
1594 2018-02-26  Youenn Fablet  <youenn@apple.com>
1595
1596         MessagePort is not always destroyed in the right thread
1597         https://bugs.webkit.org/show_bug.cgi?id=183053
1598
1599         Reviewed by Chris Dumez.
1600
1601         Make existingMessagePortForIdentifier take a lambda so that we hold the lock until there
1602         is no longer a need to keep the MessagePort around.
1603         This is very time sensitive and does not happen a lot when running WPT tests.
1604
1605         Update existing call sites to pass a lambda.
1606
1607         * dom/MessagePort.cpp:
1608         (WebCore::MessagePort::existingMessagePortForIdentifier):
1609         * dom/MessagePort.h:
1610         * dom/messageports/MessagePortChannelProviderImpl.cpp:
1611         (WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
1612         (WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
1613
1614 2018-02-26  Commit Queue  <commit-queue@webkit.org>
1615
1616         Unreviewed, rolling out r226745.
1617         https://bugs.webkit.org/show_bug.cgi?id=183132
1618
1619         This is breaking some websites (Requested by youenn on
1620         #webkit).
1621
1622         Reverted changeset:
1623
1624         "Use no-cache fetch mode when loading main documents with
1625         location.reload()"
1626         https://bugs.webkit.org/show_bug.cgi?id=181285
1627         https://trac.webkit.org/changeset/226745
1628
1629 2018-02-26  Philippe Normand  <pnormand@igalia.com>
1630
1631         Unreviewed, USE_GSTREAMER_PLAYBIN3 build fix.
1632
1633         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1634         There is no such ENABLE_GSTREAMER_PLAYBIN3.
1635
1636 2018-02-26  Philippe Normand  <pnormand@igalia.com>
1637
1638         Unreviewed, manual rollout of r228866 causing EGL_BAD_CONTEXT errors
1639
1640         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1641         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1642         Create an EGL display, even in Wayland.
1643
1644 2018-02-21  Sergio Villar Senin  <svillar@igalia.com>
1645
1646         [WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
1647         https://bugs.webkit.org/show_bug.cgi?id=182999
1648
1649         Reviewed by Žan Doberšek.
1650
1651         Retrieve the z-depth of the eye view frustum and the HMD unique id.
1652         The unique identifier is generated by the VRPlatormManager whereas
1653         we use the default values from the spec for the z-depth (those can
1654         be changed by applications later via JavaScript).
1655
1656         Once this lands the only remaining data to be retrieved from VR
1657         backends for VRDisplay is the pose (getPose() call) and the frame
1658         data (getFrameData() call).
1659
1660         * Modules/webvr/VRDisplay.cpp:
1661         (WebCore::VRDisplay::VRDisplay):
1662         (WebCore::VRDisplay::displayId const): Deleted.
1663         (WebCore::VRDisplay::displayName const): Deleted.
1664         (WebCore::VRDisplay::depthNear const): Deleted.
1665         (WebCore::VRDisplay::setDepthNear): Deleted.
1666         (WebCore::VRDisplay::depthFar const): Deleted.
1667         (WebCore::VRDisplay::setDepthFar): Deleted.
1668         * Modules/webvr/VRDisplay.h:
1669         (WebCore::VRDisplay::displayId const): Moved implementation from
1670         source file.
1671         (WebCore::VRDisplay::displayName const): Ditto.
1672         (WebCore::VRDisplay::depthNear const):
1673         (WebCore::VRDisplay::setDepthNear):
1674         (WebCore::VRDisplay::depthFar const):
1675         (WebCore::VRDisplay::setDepthFar):
1676         * platform/vr/VRManager.cpp:
1677         (WebCore::VRManager::generateUniqueDisplayIdentifier):
1678         * platform/vr/VRManager.h:
1679         * platform/vr/VRPlatformDisplay.h:
1680         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
1681         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
1682
1683 2018-02-26  Charlie Turner  <cturner@igalia.com>
1684
1685         Fix build error with !LOG_DISABLED
1686         https://bugs.webkit.org/show_bug.cgi?id=183049
1687
1688         Reviewed by Philippe Normand.
1689
1690         The following error message was being reported when doing a
1691         release build with -DLOG_DISABLED=0:
1692
1693         ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function ‘void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier)’:
1694 ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp:85:111: error: ‘logString’ was not declared in this scope
1695      LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size());
1696
1697         Other uses of logString are guarded by !LOG_DISABLED rather than
1698         NDEBUG, which was the cause of this issue.
1699
1700         * dom/messageports/MessagePortChannel.h: Guard using !LOG_DISABLED
1701         rather than NDEBUG.
1702
1703 2018-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1704
1705         [GStreamer] User current executable name instead of g_get_prgname() for gst_init
1706         https://bugs.webkit.org/show_bug.cgi?id=183119
1707
1708         Reviewed by Philippe Normand.
1709
1710         g_get_prgname() is only set for programs using GOptionContext, calling gtk_init or explicitly calling
1711         g_set_prgname(). Use WTF::getCurrentExecutableName() instead.
1712
1713         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1714         (WebCore::initializeGStreamer):
1715
1716 2018-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1717
1718         [Extra zoom mode] Disable downloadable binary fonts by default
1719         https://bugs.webkit.org/show_bug.cgi?id=183102
1720         <rdar://problem/37860699>
1721
1722         Reviewed by Tim Horton.
1723
1724         Disable downloadable binary fonts by default in extra zoom mode by making the initial value of
1725         `downloadableBinaryFontsEnabled` conditional. Layout tests are not possible at this time; test to be added once
1726         layout test support is in place.
1727
1728         * page/Settings.yaml:
1729         * page/SettingsBase.cpp:
1730         (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
1731         * page/SettingsBase.h:
1732
1733 2018-02-25  Chris Dumez  <cdumez@apple.com>
1734
1735         Service workers do not work well inside Web.app
1736         https://bugs.webkit.org/show_bug.cgi?id=183105
1737         <rdar://problem/37864140>
1738
1739         Reviewed by Youenn Fablet.
1740
1741         SessionID::defaultSessionID() was hardcoded in the ServiceWorkerThread constructor
1742         instead of using the sessionID of the SWServer that created the service worker thread.
1743         As a result, when the Service Worker would establish a SWClientConnection to the
1744         server, it would use the wrong sessionID and would end up using a different SWServer
1745         (Since we have a different SWServer instance per sessionID). As a result,
1746         ServiceWorkerRegistration / ServiceWorker objects inside the service worker would not
1747         be kept in sync with the server (since they registered themselves with the wrong
1748         SWServer).
1749
1750         Covered by new API test.
1751
1752         * workers/service/ServiceWorkerContextData.cpp:
1753         (WebCore::ServiceWorkerContextData::isolatedCopy const):
1754         * workers/service/ServiceWorkerContextData.h:
1755         (WebCore::ServiceWorkerContextData::encode const):
1756         (WebCore::ServiceWorkerContextData::decode):
1757         * workers/service/context/ServiceWorkerThread.cpp:
1758         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1759         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1760         (WebCore::createPageForServiceWorker):
1761         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1762         * workers/service/server/RegistrationDatabase.cpp:
1763         (WebCore::RegistrationDatabase::importRecords):
1764         * workers/service/server/RegistrationStore.h:
1765         (WebCore::RegistrationStore::server):
1766         * workers/service/server/SWServer.cpp:
1767         (WebCore::SWServer::updateWorker):
1768         * workers/service/server/SWServerWorker.cpp:
1769         (WebCore::SWServerWorker::contextData const):
1770
1771 2018-02-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1772
1773         Null-dereference of the second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad
1774         https://bugs.webkit.org/show_bug.cgi?id=182920
1775
1776         Reviewed by Darin Adler.
1777
1778         A test case
1779         imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.html
1780         always crashes due to a null-dereference if compiled and optimized
1781         by GCC 7.2. The second argument `resource` of
1782         DocumentLoader::scheduleSubstituteResourceLoad can be null if the
1783         resource can't be found in cache. I guess GCC optimizes inline
1784         HashMap::add based on assuming the `resource` never becomes null
1785         because its type is SubstituteResource&.
1786
1787         This changes introduces a new method
1788         DocumentLoader::scheduleCannotShowURLError because it looks tricky
1789         to pass a nullptr to the second argument of
1790         scheduleSubstituteResourceLoad.
1791
1792         No new tests (Covered by existing tests).
1793
1794         * loader/DocumentLoader.cpp:
1795         (WebCore::DocumentLoader::scheduleCannotShowURLError): Added a new method.
1796         * loader/DocumentLoader.h:
1797         * loader/appcache/ApplicationCacheHost.cpp:
1798         (WebCore::ApplicationCacheHost::maybeLoadResource):
1799         Call scheduleCannotShowURLError if the resource not found in the appcache.
1800
1801 2018-02-17  Darin Adler  <darin@apple.com>
1802
1803         Prepare for ExtendedColor changes (first step)
1804         https://bugs.webkit.org/show_bug.cgi?id=182904
1805
1806         Reviewed by Sam Weinig.
1807
1808         * css/CSSValuePool.cpp:
1809         (WebCore::CSSValuePool::createColorValue): Use HashMap::ensure.
1810         (WebCore::CSSValuePool::createFontFamilyValue): Ditto.
1811         (WebCore::CSSValuePool::createFontFaceValue): Ditto.
1812
1813         * css/parser/CSSParserFastPaths.cpp:
1814         (WebCore::CSSParserFastPaths::maybeParseValue): Tightened up
1815         the logic a bit.
1816
1817         * html/canvas/CanvasRenderingContext2D.cpp: Removed many unneeded includes.
1818
1819         * inspector/InspectorCanvas.cpp:
1820         (WebCore::InspectorCanvas::recordAction): Updated for Ref instead of
1821         RefPtr and to use move semantics.
1822         (WebCore::buildArrayForAffineTransform): Return Ref instead of RefPtr.
1823         (WebCore::buildArrayForVector): Ditto.
1824         (WebCore::InspectorCanvas::buildInitialState): Ditto. Also use auto more.
1825         (WebCore::InspectorCanvas::buildAction): Ditto.
1826         (WebCore::InspectorCanvas::buildArrayForCanvasGradient): Ditto.
1827         (WebCore::InspectorCanvas::buildArrayForCanvasPattern): Ditto.
1828         (WebCore::InspectorCanvas::buildArrayForImageData): Ditto.
1829         * inspector/InspectorCanvas.h: Updated for the above. Also us "using" instead
1830         of typedef and removed unneeded ErrorString typedef and some includes.
1831
1832         * page/DragController.cpp:
1833         (WebCore::DragController::concludeEditDrag): Use auto and Ref.
1834
1835         * platform/DragData.h: Used pragma once and reorganized includes a bit.
1836
1837         * platform/graphics/ImageFrame.h:
1838         (WebCore::ImageFrame::frameBytes const): Use uint32_t instead of RGBA32 to
1839         prepare for removal of the RGBA32 type coming in a future patch.
1840         * platform/graphics/ImageSource.cpp:
1841         (WebCore::ImageSource::cacheNativeImageAtIndex): Ditto.
1842         (WebCore::ImageSource::canUseAsyncDecoding): Ditto.
1843
1844         * platform/graphics/cocoa/GraphicsContextCocoa.mm: Tweaked #if for Mac-only
1845         code to use PLATFORM(MAC) to be easier to read.
1846         (WebCore::GraphicsContext::focusRingColor): Use sRGBColorSpaceRef instead of
1847         calling CGColorSpaceCreateWithName each time.
1848
1849         * platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added include needed
1850         now that it was removed from some header.
1851
1852         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Use uint32_t
1853         instead of RGBA32 to prepare for removal of the RGBA32 type coming in a future patch.
1854         * platform/image-decoders/ScalableImageDecoder.cpp:
1855         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
1856         * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
1857         (WebCore::ImageBackingStore::image const): Ditto.
1858         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1859         (WebCore::GIFImageDecoder::haveDecodedRow): Ditto.
1860         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1861         (WebCore::setPixel): Ditto.
1862         (WebCore::JPEGImageDecoder::outputScanlines): Ditto.
1863         * platform/image-decoders/png/PNGImageDecoder.cpp:
1864         (WebCore::PNGImageDecoder::rowAvailable): Ditto.
1865         (WebCore::PNGImageDecoder::frameComplete): Ditto.
1866         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1867         (WebCore::WEBPImageDecoder::decodeFrame): Ditto.
1868         (WebCore::WEBPImageDecoder::applyPostProcessing): Ditto.
1869
1870         * platform/mac/PlatformPasteboardMac.mm:
1871         (WebCore::PlatformPasteboard::color): Added comments.
1872
1873         * rendering/EllipsisBox.cpp:
1874         (WebCore::EllipsisBox::paintSelection): Use Color::isVisible.
1875
1876 2018-02-23  Chris Dumez  <cdumez@apple.com>
1877
1878         Crash under SchemeRegistry::shouldTreatURLSchemeAsLocal(WTF::String const&)
1879         https://bugs.webkit.org/show_bug.cgi?id=183066
1880         <rdar://problem/37804111>
1881
1882         Reviewed by Ryosuke Niwa.
1883
1884         SecurityOrigin objects are constructed on various threads. However, someone added a
1885         shouldTreatAsPotentiallyTrustworthy() call to the SecurityOrigin constructor which
1886         was not thread safe. This is because this function relies on SchemeRegistry::shouldTreatURLSchemeAsSecure()
1887         and SchemeRegistry::shouldTreatURLSchemeAsLocal() which were relying on global static HashMaps without
1888         locks.
1889
1890         Update SecurityOrigin to initialize m_isPotentiallyTrustworthy lazily, to avoid paying
1891         initialization cost in the constructor. This is only queries by SecurityContext::isSecureContext().
1892
1893         Make SchemeRegistry::shouldTreatURLSchemeAsLocal() and SchemeRegistry::shouldTreatURLSchemeAsSecure()
1894         thread-safe, since they are needed to initialize SecurityOrigin::m_isPotentiallyTrustworthy from
1895         various threads.
1896
1897         SchemeRegistry::shouldTreatURLSchemeAsSecure() is only called from SecurityOrigin (which requires
1898         thread-safety), and getUserMedia() which is not hot code so the extra locking there should not
1899         be an issue.
1900
1901         SchemeRegistry::shouldTreatURLSchemeAsLocal() is called from SecurityOrigin (which requires thread-
1902         safety). It is also called from isQuickLookPreviewURL(), MHTMLArchive::create(), Page::userStyleSheetLocationChanged(),
1903         isRemoteWebArchive() and HTMLPlugInImageElement. All these are not hot code so I do not think
1904         we need a fast path.
1905
1906         * page/SecurityOrigin.cpp:
1907         (WebCore::isLoopbackIPAddress):
1908         (WebCore::shouldTreatAsPotentiallyTrustworthy):
1909         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
1910         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
1911         * page/SecurityOrigin.h:
1912         * platform/SchemeRegistry.cpp:
1913         (WebCore::localURLSchemesLock):
1914         (WebCore::localURLSchemes):
1915         (WebCore::secureSchemesLock):
1916         (WebCore::secureSchemes):
1917         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
1918         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
1919         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
1920         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
1921         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
1922         * platform/SchemeRegistry.h:
1923
1924 2018-02-23  Christopher Reid  <chris.reid@sony.com>
1925
1926         [Curl] Cookie Database files are wrongfully getting deleted when the database is opened
1927         https://bugs.webkit.org/show_bug.cgi?id=183051
1928
1929         Reviewed by Per Arne Vollan.
1930
1931         The file stat logic was backwards causing a wrongful detection of database corruption.
1932         Fixed the logic and abstracted these calls to use FileSystem.
1933
1934         * platform/network/curl/CookieJarDB.cpp:
1935
1936 2018-02-23  Zalan Bujtas  <zalan@apple.com>
1937
1938         [RenderTreeBuilder] Make RenderTreeBuilder::* classes WTF_MAKE_FAST_ALLOCATED
1939         https://bugs.webkit.org/show_bug.cgi?id=183084
1940         <rdar://problem/37828706>
1941
1942         Reviewed by Antti Koivisto.
1943
1944         * rendering/updating/RenderTreeBuilderBlock.h:
1945         * rendering/updating/RenderTreeBuilderBlockFlow.h:
1946         * rendering/updating/RenderTreeBuilderContinuation.h:
1947         * rendering/updating/RenderTreeBuilderFirstLetter.h:
1948         * rendering/updating/RenderTreeBuilderFormControls.h:
1949         * rendering/updating/RenderTreeBuilderFullScreen.h:
1950         * rendering/updating/RenderTreeBuilderInline.h:
1951         * rendering/updating/RenderTreeBuilderList.h:
1952         * rendering/updating/RenderTreeBuilderMathML.h:
1953         * rendering/updating/RenderTreeBuilderMultiColumn.h:
1954         * rendering/updating/RenderTreeBuilderRuby.h:
1955         * rendering/updating/RenderTreeBuilderSVG.h:
1956         * rendering/updating/RenderTreeBuilderTable.h:
1957         * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
1958
1959 2018-02-23  Zalan Bujtas  <zalan@apple.com>
1960
1961         [RenderTreeBuilder] Move RenderFullScreen::createPlaceholder to RenderTreeBuilder
1962         https://bugs.webkit.org/show_bug.cgi?id=183027
1963         <rdar://problem/37773058>
1964
1965         Reviewed by Antti Koivisto.
1966
1967         No change in functionality.
1968
1969         * dom/Document.cpp:
1970         (WebCore::Document::setFullScreenRenderer):
1971         * dom/Document.h:
1972         * rendering/RenderFullScreen.cpp:
1973         (WebCore::RenderFullScreenPlaceholder::RenderFullScreenPlaceholder):
1974         (WebCore::RenderFullScreenPlaceholder::isRenderFullScreenPlaceholder const):
1975         (WebCore::RenderFullScreen::wrapNewRenderer):
1976         (WebCore::RenderFullScreen::wrapExistingRenderer):
1977         (): Deleted.
1978         (WebCore::RenderFullScreen::createPlaceholder): Deleted.
1979         * rendering/RenderFullScreen.h:
1980         * rendering/updating/RenderTreeBuilder.cpp:
1981         (WebCore::RenderTreeBuilder::createPlaceholderForFullScreen):
1982         * rendering/updating/RenderTreeBuilder.h:
1983         * rendering/updating/RenderTreeBuilderFullScreen.cpp:
1984         (WebCore::RenderTreeBuilder::FullScreen::createPlaceholder):
1985         * rendering/updating/RenderTreeBuilderFullScreen.h:
1986
1987 2018-02-23  Zalan Bujtas  <zalan@apple.com>
1988
1989         [RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach()
1990         https://bugs.webkit.org/show_bug.cgi?id=183073
1991         <rdar://problem/37814585>
1992
1993         Reviewed by Antti Koivisto.
1994
1995         So that we don't destroy a renderer accidentally.
1996
1997         * rendering/updating/RenderTreeBuilderBlock.h:
1998         * rendering/updating/RenderTreeBuilderRuby.h:
1999         * rendering/updating/RenderTreeBuilderSVG.h:
2000
2001 2018-02-22  Antoine Quint  <graouts@apple.com>
2002
2003         REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS
2004         https://bugs.webkit.org/show_bug.cgi?id=183074
2005         <rdar://problem/37747028>
2006
2007         Reviewed by Eric Carlson.
2008
2009         Test: media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html
2010
2011         In the fix for webkit.org/b/182668, we made it so that when the "controls" attribute is absent from a media
2012         element we stop listening to the bulk of media events and prevent controls from updating any DOM properties
2013         so as to minimize the amount of CPU usage by the Web process.
2014
2015         An unfortunate side effect was that, if the media controls were disabled at the time the video starts playing,
2016         the StartSupport class would thus not catch the "play" event and would not be able to set the "hasPlayed"
2017         property to "true" on the MediaController, which would then prevent the _shouldShowStartButton() from returning
2018         "false". As a result, if the "controls" attribute was turned back on after the media started playing, they
2019         would default to showing the start button, which would be then in the play state, ie. showing the pause icon.
2020
2021         We now set the "hasPlayed" property in the "play" event handler on MediaController, which is always registered
2022         regardless of the "controls" attribute setting. We also ensure we invalidate the "showStartButton" property on
2023         the media controls when StartSupport is enabled, which is the case when the "controls" attribute is toggled back
2024         to "true" from a previous "false" value.
2025
2026         * Modules/modern-media-controls/media/media-controller.js:
2027         (MediaController.prototype.handleEvent):
2028         * Modules/modern-media-controls/media/start-support.js:
2029         (StartSupport):
2030         (StartSupport.prototype.enable):
2031         (StartSupport.prototype.handleEvent):
2032         (StartSupport.prototype._updateShowsStartButton):
2033
2034 2018-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2035
2036         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
2037         https://bugs.webkit.org/show_bug.cgi?id=173655
2038         <rdar://problem/37706341>
2039
2040         Reviewed by Philippe Normand.
2041
2042         Do not assume gst is only used in the WebProcess, the MIMETypeRegistry also uses gst to get the list of
2043         supported media types. Move the code to extract gst options from the process command line to a helper function
2044         and use it in the UI process to pass the options to the WebProcess, but also in the current process when gst is
2045         initialized without providing options.
2046
2047         Fixes several unit tests that use MIMETypeRegistry in the UI process.
2048
2049         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
2050         (WebCore::extractGStreamerOptionsFromCommandLine): Helper to get the gst options from the current process
2051         command line.
2052         (WebCore::initializeGStreamer): Ensure this is called once. Get the gst options from the given vector or extract
2053         it from the command line if not provided.
2054         * platform/graphics/gstreamer/GStreamerUtilities.h:
2055         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2056         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Bring back the gst
2057         initialization here.
2058
2059 2018-02-23  Philippe Normand  <pnormand@igalia.com>
2060
2061         [GStreamer] HTTP totalBytes query returns 0 after seeking (sometimes)
2062         https://bugs.webkit.org/show_bug.cgi?id=183002
2063
2064         Reviewed by Xabier Rodriguez-Calvar.
2065
2066         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2067         (webkit_web_src_init): Initialize member variables. Also no need
2068         to set the appsrc size at that point.
2069         (webKitWebSrcStop): There is no need to reset the size when
2070         seeking. Size should in most cases represent the Content-Length
2071         response attribute, even when seeking.
2072         (webKitWebSrcStart): No need to reset the size attribute.
2073         (webKitWebSrcQueryWithParent): Let appsrc handle DURATION queries.
2074         (CachedResourceStreamingClient::responseReceived): Emit duration notification one time only.
2075
2076 2018-02-23  Philippe Normand  <pnormand@igalia.com>
2077
2078         [GStreamer] media/video-src-blob-using-open-panel.html crashes in Debug
2079         https://bugs.webkit.org/show_bug.cgi?id=183005
2080
2081         Reviewed by Xabier Rodriguez-Calvar.
2082
2083         Test: media/video-src-blob-using-open-panel.html
2084
2085         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2086         (WebCore::convertToInternalProtocol): Also convert blob URIs
2087         because they're handled by our httpsrc element.
2088         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2089         (webKitWebSrcGetProtocols): Prefix blob URIs too, for consistency purpose.
2090
2091 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
2092
2093         Remove currentTime() / currentTimeMS()
2094         https://bugs.webkit.org/show_bug.cgi?id=183052
2095
2096         Reviewed by Mark Lam.
2097
2098         * Modules/geolocation/Geolocation.cpp:
2099         (WebCore::Geolocation::haveSuitableCachedPosition):
2100         * dom/DOMTimeStamp.h:
2101         (WebCore::convertSecondsToDOMTimeStamp):
2102         * fileapi/File.cpp:
2103         (WebCore::File::File):
2104         (WebCore::File::lastModified const):
2105         * history/HistoryItem.cpp:
2106         (WebCore::generateSequenceNumber):
2107         * html/BaseDateAndTimeInputType.cpp:
2108         (WebCore::BaseDateAndTimeInputType::defaultValueForStepUp const):
2109         * html/DateTimeInputType.cpp:
2110         (WebCore::DateTimeInputType::defaultValueForStepUp const):
2111         * html/MonthInputType.cpp:
2112         (WebCore::MonthInputType::defaultValueForStepUp const):
2113         * html/TimeInputType.cpp:
2114         (WebCore::TimeInputType::defaultValueForStepUp const):
2115         * inspector/agents/InspectorNetworkAgent.cpp:
2116         (WebCore::InspectorNetworkAgent::willSendRequest):
2117         (WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest):
2118         * loader/EmptyFrameLoaderClient.h:
2119         * loader/FormSubmission.cpp:
2120         (WebCore::generateFormDataIdentifier):
2121         * loader/FrameLoader.cpp:
2122         (WebCore::FrameLoader::clientRedirected):
2123         * loader/FrameLoader.h:
2124         * loader/FrameLoaderClient.h:
2125         * loader/NavigationScheduler.cpp:
2126         * page/History.cpp:
2127         (WebCore::History::stateObjectAdded):
2128         * page/History.h:
2129         * page/PageOverlay.cpp:
2130         (WebCore::PageOverlay::startFadeAnimation):
2131         (WebCore::PageOverlay::fadeAnimationTimerFired):
2132         * page/PageOverlay.h:
2133         * platform/graphics/cg/GraphicsContextCG.cpp:
2134         (WebCore::GraphicsContext::drawNativeImage):
2135         * platform/ios/LegacyTileLayerPool.h:
2136         * platform/ios/LegacyTileLayerPool.mm:
2137         (WebCore::LegacyTileLayerPool::LegacyTileLayerPool):
2138         (WebCore::LegacyTileLayerPool::addLayer):
2139         (WebCore::LegacyTileLayerPool::decayedCapacity const):
2140         (WebCore::LegacyTileLayerPool::prune):
2141         * platform/ios/SystemMemoryIOS.cpp:
2142         (WebCore::systemMemoryLevel):
2143         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2144         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2145
2146 2018-02-22  Per Arne Vollan  <pvollan@apple.com>
2147
2148         The WebContent process should not use NSScreen in the screenDepth implementation.
2149         https://bugs.webkit.org/show_bug.cgi?id=183048
2150
2151         Reviewed by Brent Fulgham.
2152
2153         NSScreen method calls should be done in the UIProcess, since these calls will communicate with
2154         the WindowServer. The screen depth property can be retrieved in the UIProcess, and sent to the
2155         WebContent process, where it is cached. Whenever screen properties change, the UIProcess will
2156         send the new screen properties to the WebProcess.
2157
2158         No new tests, covered by existing tests.
2159
2160         * platform/ScreenProperties.h:
2161         (WebCore::ScreenProperties::encode const):
2162         (WebCore::ScreenProperties::decode):
2163         * platform/mac/PlatformScreenMac.mm:
2164         (WebCore::getScreenProperties):
2165         (WebCore::screenDepth):
2166         (WebCore::screenDepthPerComponent):
2167         (WebCore::screenRect):
2168         (WebCore::screenAvailableRect):
2169
2170 2018-02-22  Zalan Bujtas  <zalan@apple.com>
2171
2172         [RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and removeAndDestroy() -> destroy()
2173         https://bugs.webkit.org/show_bug.cgi?id=183061
2174         <rdar://problem/37800269>
2175
2176         Reviewed by Ryosuke Niwa.
2177
2178         ...and moveChildTo() -> move() (moveChildrenTo() -> moveChildren()),
2179         removeFromParentAndDestroyCleaningUpAnonymousWrappers() -> destroyAndCleanUpAnonymousWrappers()
2180
2181         No change in functionality.
2182
2183         * dom/Document.cpp:
2184         (WebCore::Document::destroyRenderTree):
2185         (WebCore::Document::setFullScreenRenderer):
2186         * rendering/RenderBlockFlow.cpp:
2187         (WebCore::RenderBlockFlow::styleDidChange):
2188         * rendering/RenderButton.cpp:
2189         (WebCore::RenderButton::setText):
2190         * rendering/RenderElement.cpp:
2191         (WebCore::RenderElement::didAttachChild):
2192         (WebCore::RenderElement::didInsertChild): Deleted.
2193         * rendering/RenderElement.h:
2194         * rendering/RenderFullScreen.cpp:
2195         (WebCore::RenderFullScreen::wrapNewRenderer):
2196         (WebCore::RenderFullScreen::wrapExistingRenderer):
2197         (WebCore::RenderFullScreen::unwrapRenderer):
2198         (WebCore::RenderFullScreen::createPlaceholder):
2199         * rendering/RenderMenuList.cpp:
2200         (RenderMenuList::didAttachChild):
2201         (RenderMenuList::setText):
2202         (RenderMenuList::didInsertChild): Deleted.
2203         * rendering/RenderMenuList.h:
2204         * rendering/RenderQuote.cpp:
2205         (WebCore::RenderQuote::updateTextRenderer):
2206         * rendering/RenderTextFragment.cpp:
2207         (WebCore::RenderTextFragment::setText):
2208         * rendering/updating/RenderTreeBuilder.cpp:
2209         (WebCore::RenderTreeBuilder::destroy):
2210         (WebCore::RenderTreeBuilder::attach):
2211         (WebCore::RenderTreeBuilder::attachIgnoringContinuation):
2212         (WebCore::RenderTreeBuilder::detach):
2213         (WebCore::RenderTreeBuilder::attachToRenderElement):
2214         (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
2215         (WebCore::RenderTreeBuilder::move):
2216         (WebCore::RenderTreeBuilder::moveAllChildren):
2217         (WebCore::RenderTreeBuilder::moveChildren):
2218         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloats):
2219         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
2220         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
2221         (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
2222         (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
2223         (WebCore::RenderTreeBuilder::detachFromRenderGrid):
2224         (WebCore::RenderTreeBuilder::detachFromRenderElement):
2225         (WebCore::RenderTreeBuilder::attachToRenderGrid):
2226         (WebCore::RenderTreeBuilder::removeAndDestroy): Deleted.
2227         (WebCore::RenderTreeBuilder::insertChild): Deleted.
2228         (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): Deleted.
2229         (WebCore::RenderTreeBuilder::takeChild): Deleted.
2230         (WebCore::RenderTreeBuilder::insertChildToRenderElement): Deleted.
2231         (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): Deleted.
2232         (WebCore::RenderTreeBuilder::moveChildTo): Deleted.
2233         (WebCore::RenderTreeBuilder::moveAllChildrenTo): Deleted.
2234         (WebCore::RenderTreeBuilder::moveChildrenTo): Deleted.
2235         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): Deleted.
2236         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
2237         (WebCore::RenderTreeBuilder::takeChildFromRenderGrid): Deleted.
2238         (WebCore::RenderTreeBuilder::takeChildFromRenderElement): Deleted.
2239         (WebCore::RenderTreeBuilder::insertChildToRenderGrid): Deleted.
2240         * rendering/updating/RenderTreeBuilder.h:
2241         * rendering/updating/RenderTreeBuilderBlock.cpp:
2242         (WebCore::RenderTreeBuilder::Block::attach):
2243         (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
2244         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
2245         (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
2246         (WebCore::RenderTreeBuilder::Block::detach):
2247         (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
2248         (WebCore::RenderTreeBuilder::Block::insertChild): Deleted.
2249         (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): Deleted.
2250         (WebCore::RenderTreeBuilder::Block::takeChild): Deleted.
2251         * rendering/updating/RenderTreeBuilderBlock.h:
2252         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
2253         (WebCore::RenderTreeBuilder::BlockFlow::attach):
2254         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats):
2255         (WebCore::RenderTreeBuilder::BlockFlow::insertChild): Deleted.
2256         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
2257         * rendering/updating/RenderTreeBuilderBlockFlow.h:
2258         * rendering/updating/RenderTreeBuilderContinuation.cpp:
2259         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
2260         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2261         (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):
2262         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
2263         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2264         * rendering/updating/RenderTreeBuilderFormControls.cpp:
2265         (WebCore::RenderTreeBuilder::FormControls::attach):
2266         (WebCore::RenderTreeBuilder::FormControls::detach):
2267         (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
2268         (WebCore::RenderTreeBuilder::FormControls::insertChild): Deleted.
2269         (WebCore::RenderTreeBuilder::FormControls::takeChild): Deleted.
2270         * rendering/updating/RenderTreeBuilderFormControls.h:
2271         * rendering/updating/RenderTreeBuilderFullScreen.cpp:
2272         (WebCore::RenderTreeBuilder::FullScreen::cleanupOnDestroy):
2273         * rendering/updating/RenderTreeBuilderInline.cpp:
2274         (WebCore::RenderTreeBuilder::Inline::attach):
2275         (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
2276         (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
2277         (WebCore::RenderTreeBuilder::Inline::splitFlow):
2278         (WebCore::RenderTreeBuilder::Inline::splitInlines):
2279         (WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
2280         (WebCore::RenderTreeBuilder::Inline::insertChild): Deleted.
2281         (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): Deleted.
2282         * rendering/updating/RenderTreeBuilderInline.h:
2283         * rendering/updating/RenderTreeBuilderList.cpp:
2284         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2285         * rendering/updating/RenderTreeBuilderMathML.cpp:
2286         (WebCore::RenderTreeBuilder::MathML::makeFences):
2287         (WebCore::RenderTreeBuilder::MathML::attach):
2288         (WebCore::RenderTreeBuilder::MathML::insertChild): Deleted.
2289         * rendering/updating/RenderTreeBuilderMathML.h:
2290         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2291         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2292         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
2293         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
2294         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
2295         * rendering/updating/RenderTreeBuilderRuby.cpp:
2296         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
2297         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2298         (WebCore::RenderTreeBuilder::Ruby::attach):
2299         (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
2300         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
2301         (WebCore::RenderTreeBuilder::Ruby::detach):
2302         (WebCore::RenderTreeBuilder::Ruby::insertChild): Deleted.
2303         (WebCore::RenderTreeBuilder::Ruby::takeChild): Deleted.
2304         * rendering/updating/RenderTreeBuilderRuby.h:
2305         * rendering/updating/RenderTreeBuilderSVG.cpp:
2306         (WebCore::RenderTreeBuilder::SVG::attach):
2307         (WebCore::RenderTreeBuilder::SVG::detach):
2308         (WebCore::RenderTreeBuilder::SVG::insertChild): Deleted.
2309         (WebCore::RenderTreeBuilder::SVG::takeChild): Deleted.
2310         * rendering/updating/RenderTreeBuilderSVG.h:
2311         * rendering/updating/RenderTreeBuilderTable.cpp:
2312         (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
2313         (WebCore::RenderTreeBuilder::Table::attach):
2314         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
2315         (WebCore::RenderTreeBuilder::Table::insertChild): Deleted.
2316         * rendering/updating/RenderTreeBuilderTable.h:
2317         * rendering/updating/RenderTreeUpdater.cpp:
2318         (WebCore::RenderTreeUpdater::createRenderer):
2319         (WebCore::RenderTreeUpdater::createTextRenderer):
2320         (WebCore::RenderTreeUpdater::tearDownRenderers):
2321         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
2322         (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
2323         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
2324         (WebCore::createContentRenderers):
2325
2326 2018-02-22  Chris Dumez  <cdumez@apple.com>
2327
2328         ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition
2329         https://bugs.webkit.org/show_bug.cgi?id=183059
2330         <rdar://problem/37800202>
2331
2332         Reviewed by Youenn Fablet.
2333
2334         Update ResourceRequestBase::setAsIsolatedCopy() to call isolatedCopy() on the cachePartition as well,
2335         given that it is a String and it would not be safe to send it to another thread otherwise.
2336
2337         * platform/network/ResourceRequestBase.cpp:
2338         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
2339
2340 2018-02-22  Chris Dumez  <cdumez@apple.com>
2341
2342         ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread
2343         https://bugs.webkit.org/show_bug.cgi?id=183050
2344         <rdar://problem/37796881>
2345
2346         Reviewed by Youenn Fablet.
2347
2348         Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's
2349         startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript().
2350
2351         * workers/service/ServiceWorkerContainer.cpp:
2352         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2353         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2354         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2355
2356 2018-02-22  Chris Dumez  <cdumez@apple.com>
2357
2358         ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread
2359         https://bugs.webkit.org/show_bug.cgi?id=183046
2360         <rdar://problem/37793395>
2361
2362         Reviewed by Youenn Fablet.
2363
2364         Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob().
2365         The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads.
2366
2367         * workers/service/ServiceWorkerContainer.cpp:
2368         (WebCore::ServiceWorkerContainer::scheduleJob):
2369
2370 2018-02-22  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2371
2372         [Curl] Fix warning on clang.
2373         https://bugs.webkit.org/show_bug.cgi?id=182986
2374
2375         Reviewed by Konstantin Tokarev.
2376
2377         No new tests because there's no behaviro changes.
2378
2379         * platform/network/curl/CurlResourceHandleDelegate.cpp:
2380         (WebCore::CurlResourceHandleDelegate::curlDidSendData):
2381         (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
2382         (WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
2383         * platform/network/curl/CurlResourceHandleDelegate.h:
2384
2385 2018-02-22  Youenn Fablet  <youenn@apple.com>
2386
2387         WorkerCacheStorageConnection::doRemove can assert in case two frames try to delete the same cache at the same time
2388         https://bugs.webkit.org/show_bug.cgi?id=183041
2389
2390         Reviewed by Chris Dumez.
2391
2392         * Modules/cache/WorkerCacheStorageConnection.cpp:
2393         (WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the
2394         case of an already deleted cache, i.e. returned identifer is 0.
2395
2396 2018-02-22  Alejandro G. Castro  <alex@igalia.com>
2397
2398         Remove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource classes
2399         https://bugs.webkit.org/show_bug.cgi?id=183031
2400
2401         Reviewed by Youenn Fablet.
2402
2403         This include and namespace are not required in the file.
2404
2405         Just removing unused code, no tests required.
2406
2407         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2408
2409 2018-02-22  Chris Dumez  <cdumez@apple.com>
2410
2411         Document.open() cancels existing provisional load but not navigation policy check
2412         https://bugs.webkit.org/show_bug.cgi?id=183012
2413         <rdar://problem/37755831>
2414
2415         Reviewed by Alex Christensen.
2416
2417         Test: fast/dom/Document/open-with-pending-load-async-policy.html
2418
2419         * dom/Document.cpp:
2420         (WebCore::Document::open):
2421         The existing code was calling FrameLoader::stopAllLoaders() when the loader's state
2422         is FrameStateProvisional. The issue is that the FrameLoader's state only gets set
2423         to FrameStateProvisional after the policy decision for the navigation is made.
2424         This means that we fail to cancel a pending load if is still in the policy decision
2425         stage, which can happen when the policy decision is made asynchronously. We now
2426         also cancel such pending navigation policy checks as well.
2427
2428         * loader/PolicyChecker.cpp:
2429         (WebCore::PolicyChecker::checkNavigationPolicy):
2430         Make sure the m_delegateIsDecidingNavigationPolicy flag gets reset inside the
2431         lambda. Otherwise, it gets reset too early when the policy decision is made
2432         asynchronously.
2433
2434 2018-02-22  Youenn Fablet  <youenn@apple.com>
2435
2436         Add release asserts for service worker fetch and postMessage events
2437         https://bugs.webkit.org/show_bug.cgi?id=183025
2438         rdar://problem/37765052
2439
2440         Reviewed by Daniel Bates.
2441
2442         Add release assertion so that a service worker will only dispatch a message event
2443         for clients and service workers with the same origin.
2444         No change of behavior.
2445
2446         * platform/network/ResourceRequestBase.h:
2447         * workers/service/context/ServiceWorkerThread.cpp:
2448         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
2449         * workers/service/context/ServiceWorkerThreadProxy.h:
2450
2451 2018-02-22  Miguel Gomez  <magomez@igalia.com>
2452
2453         including both gl3.h and gl2.h when USE_OPENGL_ES is enabled
2454         https://bugs.webkit.org/show_bug.cgi?id=183008
2455
2456         Reviewed by Michael Catanzaro.
2457
2458         Don't include GLES3 headers as we stick to GLES2 API resources.
2459
2460         No new tests, no behavior change.
2461
2462         * platform/graphics/GLContext.cpp:
2463
2464 2018-02-22  Ms2ger  <Ms2ger@igalia.com>
2465
2466         [GTK][WPE] Fix some build errors in service workers code
2467         https://bugs.webkit.org/show_bug.cgi?id=182966
2468
2469         Reviewed by Žan Doberšek.
2470
2471         No new tests: no change in behavior.
2472
2473         * workers/service/ServiceWorkerProvider.h: add missing forward declaration.
2474
2475 2018-02-21  Zalan Bujtas  <zalan@apple.com>
2476
2477         [RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder
2478         https://bugs.webkit.org/show_bug.cgi?id=183022
2479         <rdar://problem/37764326>
2480
2481         Reviewed by Antti Koivisto.
2482
2483         No change in functionality.
2484
2485         * rendering/RenderObject.cpp:
2486         (WebCore::RenderObject::insertedIntoTree):
2487         * rendering/updating/RenderTreeBuilder.cpp:
2488         (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal):
2489         (WebCore::RenderTreeBuilder::moveChildrenTo):
2490         (WebCore::RenderTreeBuilder::multiColumnDescendantInserted): Deleted.
2491         * rendering/updating/RenderTreeBuilder.h:
2492
2493 2018-02-21  Tim Horton  <timothy_horton@apple.com>
2494
2495         Include all Cocoa sources in all Cocoa platform builds
2496         https://bugs.webkit.org/show_bug.cgi?id=183026
2497         <rdar://problem/37513101>
2498
2499         Reviewed by Dan Bernstein.
2500
2501         Similar to r228571, don't have separate Sources files for iOS and Mac.
2502         All sources now have #ifdefs that ensure that only the right ones
2503         build on the right platforms. This makes it much easier to reason
2504         about what builds where by just looking at the sources.
2505
2506         * SourcesCocoa.txt:
2507         * SourcesIOS.txt: Removed.
2508         * SourcesMac.txt: Removed.
2509         * WebCore.xcodeproj/project.pbxproj:
2510         * editing/WebContentReader.h:
2511         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2512
2513 2018-02-21  Youenn Fablet  <youenn@apple.com>
2514
2515         Make SubstituteResource take a ResourceResponse r-value
2516         https://bugs.webkit.org/show_bug.cgi?id=183020
2517
2518         Reviewed by Alex Christensen.
2519
2520         No change of behavior.
2521         Make SubstituteResource take a ResourceResponse r-value.
2522         Update ArchiveResource accordingly.
2523         Take benefit of that in ApplicationCacheResource to set the response source to ApplicationCache
2524         before passing it to SubstituteResource constructor.
2525
2526         * loader/SubstituteResource.h:
2527         (WebCore::SubstituteResource::SubstituteResource):
2528         (WebCore::SubstituteResource::resourceResponse): Deleted.
2529         * loader/appcache/ApplicationCacheResource.cpp:
2530         (WebCore::ApplicationCacheResource::create):
2531         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
2532         * loader/appcache/ApplicationCacheResource.h:
2533         (WebCore::ApplicationCacheResource::create): Deleted.
2534         * loader/archive/ArchiveResource.cpp:
2535         (WebCore::ArchiveResource::ArchiveResource):
2536
2537 2018-02-21  Zalan Bujtas  <zalan@apple.com>
2538
2539         [RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore.
2540         https://bugs.webkit.org/show_bug.cgi?id=183019
2541         <rdar://problem/37761421>
2542
2543         Reviewed by Antti Koivisto.
2544
2545         All the willBeDestroyed() mutations have been moved over to RenderTreeBuilder. 
2546
2547         No change in functionality.
2548
2549         * rendering/RenderBlock.cpp:
2550         (WebCore::RenderBlock::willBeDestroyed):
2551         * rendering/RenderBlock.h:
2552         * rendering/RenderBlockFlow.cpp:
2553         (WebCore::RenderBlockFlow::willBeDestroyed):
2554         * rendering/RenderBlockFlow.h:
2555         * rendering/RenderBox.cpp:
2556         (WebCore::RenderBox::willBeDestroyed):
2557         * rendering/RenderBox.h:
2558         * rendering/RenderBoxModelObject.cpp:
2559         (WebCore::RenderBoxModelObject::willBeDestroyed):
2560         * rendering/RenderBoxModelObject.h:
2561         * rendering/RenderCounter.cpp:
2562         (WebCore::RenderCounter::willBeDestroyed):
2563         * rendering/RenderCounter.h:
2564         * rendering/RenderElement.cpp:
2565         (WebCore::RenderElement::willBeDestroyed):
2566         * rendering/RenderElement.h:
2567         * rendering/RenderEmbeddedObject.cpp:
2568         (WebCore::RenderEmbeddedObject::willBeDestroyed):
2569         * rendering/RenderEmbeddedObject.h:
2570         * rendering/RenderFragmentedFlow.cpp:
2571         (WebCore::RenderFragmentedFlow::willBeDestroyed):
2572         * rendering/RenderFragmentedFlow.h:
2573         * rendering/RenderImage.cpp:
2574         (WebCore::RenderImage::willBeDestroyed):
2575         * rendering/RenderImage.h:
2576         * rendering/RenderInline.cpp:
2577         (WebCore::RenderInline::willBeDestroyed):
2578         * rendering/RenderInline.h:
2579         * rendering/RenderLayerModelObject.cpp:
2580         (WebCore::RenderLayerModelObject::willBeDestroyed):
2581         * rendering/RenderLayerModelObject.h:
2582         * rendering/RenderListBox.cpp:
2583         (WebCore::RenderListBox::willBeDestroyed):
2584         * rendering/RenderListBox.h:
2585         * rendering/RenderListMarker.cpp:
2586         (WebCore::RenderListMarker::willBeDestroyed):
2587         * rendering/RenderListMarker.h:
2588         * rendering/RenderMenuList.cpp:
2589         (WebCore::RenderMenuList::willBeDestroyed):
2590         * rendering/RenderMenuList.h:
2591         * rendering/RenderObject.cpp:
2592         (WebCore::RenderObject::willBeDestroyed):
2593         (WebCore::RenderObject::destroy):
2594         * rendering/RenderObject.h:
2595         * rendering/RenderReplaced.cpp:
2596         (WebCore::RenderReplaced::willBeDestroyed):
2597         * rendering/RenderReplaced.h:
2598         * rendering/RenderSearchField.cpp:
2599         (WebCore::RenderSearchField::willBeDestroyed):
2600         * rendering/RenderSearchField.h:
2601         * rendering/RenderSnapshottedPlugIn.cpp:
2602         (WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
2603         * rendering/RenderSnapshottedPlugIn.h:
2604         * rendering/RenderText.cpp:
2605         (WebCore::RenderText::willBeDestroyed):
2606         * rendering/RenderText.h:
2607         * rendering/RenderTextControlMultiLine.cpp:
2608         (WebCore::RenderTextControlMultiLine::willBeDestroyed):
2609         * rendering/RenderTextControlMultiLine.h:
2610         * rendering/RenderVideo.cpp:
2611         (WebCore::RenderVideo::willBeDestroyed):
2612         * rendering/RenderVideo.h:
2613         * rendering/RenderWidget.cpp:
2614         (WebCore::RenderWidget::willBeDestroyed):
2615         * rendering/RenderWidget.h:
2616         * rendering/svg/RenderSVGBlock.cpp:
2617         (WebCore::RenderSVGBlock::willBeDestroyed):
2618         * rendering/svg/RenderSVGBlock.h:
2619         * rendering/svg/RenderSVGImage.cpp:
2620         (WebCore::RenderSVGImage::willBeDestroyed):
2621         * rendering/svg/RenderSVGImage.h:
2622         * rendering/svg/RenderSVGInline.cpp:
2623         (WebCore::RenderSVGInline::willBeDestroyed):
2624         * rendering/svg/RenderSVGInline.h:
2625         * rendering/svg/RenderSVGModelObject.cpp:
2626         (WebCore::RenderSVGModelObject::willBeDestroyed):
2627         * rendering/svg/RenderSVGModelObject.h:
2628         * rendering/svg/RenderSVGResourceContainer.cpp:
2629         (WebCore::RenderSVGResourceContainer::willBeDestroyed):
2630         * rendering/svg/RenderSVGResourceContainer.h:
2631         * rendering/svg/RenderSVGRoot.cpp:
2632         (WebCore::RenderSVGRoot::willBeDestroyed):
2633         * rendering/svg/RenderSVGRoot.h:
2634         * rendering/svg/RenderSVGText.cpp:
2635         (WebCore::RenderSVGText::willBeDestroyed):
2636         * rendering/svg/RenderSVGText.h:
2637
2638 2018-02-21  Per Arne Vollan  <pvollan@apple.com>
2639
2640         The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
2641         https://bugs.webkit.org/show_bug.cgi?id=182855
2642
2643         Reviewed by Brent Fulgham.
2644
2645         On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
2646         with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
2647         screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
2648         process whenever there is a change in the display properties, and have the WebContent process cache these
2649         display properties. This message should also be sent to a newly started WebContent process.
2650
2651         No new tests, covered by existing tests.
2652
2653         * WebCore.xcodeproj/project.pbxproj:
2654         * platform/PlatformScreen.h:
2655         * platform/mac/PlatformScreenMac.mm:
2656         (WebCore::getScreenProperties):
2657         (WebCore::screenProperties):
2658         (WebCore::setScreenProperties):
2659         (WebCore::screenRect):
2660         (WebCore::screenAvailableRect):
2661         * platform/ScreenProperties.h: Added.
2662         (WebCore::ScreenProperties::encode const):
2663         (WebCore::ScreenProperties::decode):
2664
2665 2018-02-21  Christopher Reid  <chris.reid@sony.com>
2666
2667         [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
2668         https://bugs.webkit.org/show_bug.cgi?id=182751
2669
2670         Reviewed by Youenn Fablet.
2671
2672         No change in behavior.
2673
2674         Adding support to set a custom CookieJar Database.
2675         Took CookieJarDB::open() out of its constructor because both the Network and Web process
2676         were trying to open the journal files but one process was failing due to a lack of permission.
2677         Now the database file is lazily opened and only the Network process will try to open the database.
2678         Some cleanup was done to CookieJarDB too.
2679
2680         * platform/network/NetworkStorageSession.h:
2681         * platform/network/curl/CookieJarDB.cpp:
2682         * platform/network/curl/CookieJarDB.h:
2683         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2684
2685 2018-02-21  Chris Dumez  <cdumez@apple.com>
2686
2687         Regression(r228708): Crash under WebCore::MediaResource::responseReceived(WebCore::CachedResource&, WebCore::ResourceResponse const&)
2688         https://bugs.webkit.org/show_bug.cgi?id=183018
2689         <rdar://problem/37754154>
2690
2691         Reviewed by Eric Carlson.
2692
2693         The fix at r228708 was trying to address the fact that avplayer sometimes
2694         deallocates WebCoreNSURLSessionDataTask objects on a non-main thread, which
2695         was not safe because its _resource data member needs to be deallocated on
2696         the main thread.
2697
2698         The issue is that r228708 caused _resource to outlive its WebCoreNSURLSessionDataTask.
2699         This is an issue because _resource has a client data member (of type WebCoreNSURLSessionDataTaskClient)
2700         which has a raw pointer to the WebCoreNSURLSessionDataTask. This means that the main thread could
2701         call methods like responseReceived() on the resource, which would call responseReceived() on the
2702         client, which would try to call [WebCoreNSURLSessionDataTask receivedResponse:] with an invalid
2703         m_task pointer.
2704
2705         To address the issue, I introduced a clearTask() method on WebCoreNSURLSessionDataTaskClient, which
2706         gets called from a non-main thread to clear the client's m_task pointer when the task is destroyed
2707         on a non-main thread. So that this is safe, every time the client tries to use m_task, we now
2708         acquire a lock for thread-safety and do a null-check on m_task.
2709
2710         No new tests, no known reproduction case.
2711
2712         * platform/graphics/PlatformMediaResourceLoader.h:
2713         (WebCore::PlatformMediaResource::client):
2714         * platform/network/cocoa/WebCoreNSURLSession.mm:
2715         (WebCore::WebCoreNSURLSessionDataTaskClient::clearTask):
2716         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
2717         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
2718         (WebCore::WebCoreNSURLSessionDataTaskClient::shouldCacheResponse):
2719         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
2720         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
2721         (WebCore::WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed):
2722         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFailed):
2723         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished):
2724         (-[WebCoreNSURLSessionDataTask dealloc]):
2725
2726 2018-02-21  Youenn Fablet  <youenn@apple.com>
2727
2728         Move AppCache loading to the NetworkProcess
2729         https://bugs.webkit.org/show_bug.cgi?id=178540
2730         <rdar://problem/37119346>
2731
2732         Reviewed by Alex Christensen.
2733
2734         Covered by existing tests.
2735
2736         Use ApplicationResourceLoader for cache entry loading.
2737         Remove all ResourceHandle use from ApplicationCacheGroup.
2738         Renamed m_loader in m_manifestLoader and added a new m_entryLoader to load cache entries.
2739
2740         Updated ApplicationCacheResourceLoader to handle different types of CachedResource.
2741         This allows in particular to handle redirections based on the resource type and create the ApplicationCacheResource with the right type.
2742         Use Include as credentials mode as per specification.
2743
2744         Add a new ApplicationCache ResourceResonse::Source.
2745         This allows fixing an assertion and should allow better inspector support if needs be.
2746
2747         * inspector/agents/InspectorNetworkAgent.cpp:
2748         (WebCore::responseSource):
2749         * loader/ResourceLoader.cpp:
2750         (WebCore::logResourceResponseSource):
2751         * loader/SubstituteResource.h:
2752         (WebCore::SubstituteResource::resourceResponse):
2753         * loader/appcache/ApplicationCacheGroup.cpp:
2754         (WebCore::ApplicationCacheGroup::stopLoading):
2755         (WebCore::ApplicationCacheGroup::update):
2756         (WebCore::ApplicationCacheGroup::didFinishLoading):
2757         (WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
2758         (WebCore::ApplicationCacheGroup::didFail):
2759         (WebCore::ApplicationCacheGroup::didFailLoadingEntry):
2760         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
2761         (WebCore::ApplicationCacheGroup::startLoadingEntry):
2762         * loader/appcache/ApplicationCacheGroup.h:
2763         * loader/appcache/ApplicationCacheResource.cpp:
2764         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
2765         * loader/appcache/ApplicationCacheResourceLoader.cpp:
2766         (WebCore::ApplicationCacheResourceLoader::create):
2767         (WebCore::ApplicationCacheResourceLoader::ApplicationCacheResourceLoader):
2768         (WebCore::ApplicationCacheResourceLoader::responseReceived):
2769         (WebCore::ApplicationCacheResourceLoader::redirectReceived):
2770         * loader/appcache/ApplicationCacheResourceLoader.h:
2771         * platform/network/ResourceResponseBase.h:
2772         * platform/network/cocoa/ResourceResponseCocoa.mm:
2773         (WebCore::ResourceResponse::platformCertificateInfo const):
2774         * testing/Internals.cpp:
2775         (WebCore::responseSourceToString):
2776
2777 2018-02-21  Zalan Bujtas  <zalan@apple.com>
2778
2779         [RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to RenderTreeBuilder
2780         https://bugs.webkit.org/show_bug.cgi?id=183014
2781         <rdar://problem/37757428>
2782
2783         Reviewed by Antti Koivisto.
2784
2785         No change in functionality.
2786
2787         * Sources.txt:
2788         * WebCore.xcodeproj/project.pbxproj:
2789         * rendering/RenderBoxModelObject.cpp:
2790         (WebCore::RenderBoxModelObject::~RenderBoxModelObject):
2791         (WebCore::RenderBoxModelObject::willBeDestroyed):
2792         (WebCore::RenderBoxModelObject::continuationChainNode const):
2793         (): Deleted.
2794         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): Deleted.
2795         * rendering/RenderBoxModelObject.h:
2796         * rendering/updating/RenderTreeBuilder.cpp:
2797         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
2798         (WebCore::RenderTreeBuilder::removeAndDestroy):
2799         * rendering/updating/RenderTreeBuilder.h:
2800         (WebCore::RenderTreeBuilder::continuationBuilder):
2801         * rendering/updating/RenderTreeBuilderContinuation.cpp: Added.
2802         (WebCore::RenderTreeBuilder::Continuation::Continuation):
2803         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
2804         * rendering/updating/RenderTreeBuilderContinuation.h: Added.
2805
2806 2018-02-21  Youenn Fablet  <youenn@apple.com>
2807
2808         ServiceWorkerJob::m_lastResponse is unneeded
2809         https://bugs.webkit.org/show_bug.cgi?id=183013
2810
2811         Reviewed by Chris Dumez.
2812
2813         Remove this field since not used anywhere.
2814
2815         * workers/service/ServiceWorkerJob.cpp:
2816         (WebCore::ServiceWorkerJob::didReceiveResponse):
2817         * workers/service/ServiceWorkerJob.h:
2818
2819 2018-02-21  Youenn Fablet  <youenn@apple.com>
2820
2821         Use ResourceLoader to load appcache manifest
2822         https://bugs.webkit.org/show_bug.cgi?id=182861
2823
2824         Reviewed by Alex Christensen.
2825
2826         Covered by updated tests.
2827
2828         Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
2829         Make use of it to load the app cache manifest.
2830         Future work should load entries using the same loader.
2831
2832         Remove manifest handle.
2833         Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
2834         is handled by its ApplicationCacheGroup.
2835
2836         Add a ResourceLoader option to bypass the application cache.
2837         Use it for manifest loading.
2838
2839         * Sources.txt:
2840         * WebCore.xcodeproj/project.pbxproj:
2841         * loader/DocumentLoader.cpp:
2842         (WebCore::DocumentLoader::addSubresourceLoader):
2843         * loader/ResourceLoaderOptions.h:
2844         * loader/appcache/ApplicationCacheGroup.cpp:
2845         (WebCore::ApplicationCacheGroup::stopLoading):
2846         (WebCore::ApplicationCacheGroup::update):
2847         (WebCore::ApplicationCacheGroup::createRequest):
2848         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
2849         (WebCore::ApplicationCacheGroup::didReceiveData):
2850         (WebCore::ApplicationCacheGroup::didFinishLoading):
2851         (WebCore::ApplicationCacheGroup::didFail):
2852         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
2853         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
2854         * loader/appcache/ApplicationCacheGroup.h:
2855         * loader/appcache/ApplicationCacheHost.cpp:
2856         (WebCore::ApplicationCacheHost::maybeLoadResource):
2857         (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
2858         (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
2859         (WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
2860         * loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
2861         * loader/appcache/ApplicationCacheResourceLoader.h: Added.
2862
2863 2018-02-21  Don Olmstead  <don.olmstead@sony.com>
2864
2865         [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
2866         https://bugs.webkit.org/show_bug.cgi?id=182883
2867
2868         Reviewed by Per Arne Vollan.
2869
2870         No new tests. No change in behavior.
2871
2872         * WebCorePrefix.h:
2873         * config.h:
2874         * testing/js/WebCoreTestSupportPrefix.h:
2875
2876 2018-02-21  Zalan Bujtas  <zalan@apple.com>
2877
2878         [RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder
2879         https://bugs.webkit.org/show_bug.cgi?id=183009
2880
2881         Reviewed by Antti Koivisto.
2882
2883         No change in functionality.
2884
2885         * dom/Document.cpp:
2886         (WebCore::Document::destroyRenderTree):
2887         * rendering/RenderView.cpp:
2888         (WebCore::RenderView::~RenderView):
2889         (WebCore::RenderView::willBeDestroyed): Deleted.
2890         * rendering/RenderView.h:
2891
2892 2018-02-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2893
2894         [GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower
2895         https://bugs.webkit.org/show_bug.cgi?id=181825
2896
2897         Reviewed by Carlos Garcia Campos.
2898
2899         We could fix this crash, but that would not be good enough, because upower-glib is a
2900         synchronous API that wraps D-Bus calls. That's not acceptable for use in the web process.
2901         Rewrite LowPowerModeNotifierGLib to use upower's D-Bus API directly, instead.
2902
2903         Note that this also enables LowPowerModeNotifier for WPE, since the USE(UPOWER) build
2904         flag is no longer needed.
2905
2906         * platform/LowPowerModeNotifier.cpp:
2907         * platform/LowPowerModeNotifier.h:
2908         * platform/glib/LowPowerModeNotifierGLib.cpp:
2909         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
2910         (WebCore::LowPowerModeNotifier::updateWarningLevel):
2911         (WebCore::LowPowerModeNotifier::warningLevelChanged):
2912         (WebCore::LowPowerModeNotifier::gPropertiesChangedCallback):
2913         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
2914         (WebCore::LowPowerModeNotifier::updateState): Deleted.
2915         (WebCore::LowPowerModeNotifier::warningLevelCallback): Deleted.
2916
2917 2018-02-21  Chris Dumez  <cdumez@apple.com>
2918
2919         VTTCue constructor should use 'double' type for startTime / endTime
2920         https://bugs.webkit.org/show_bug.cgi?id=182988
2921
2922         Reviewed by Eric Carlson.
2923
2924         VTTCue constructor should use 'double' type for startTime / endTime, not
2925         'unrestricted double':
2926         - https://w3c.github.io/webvtt/#the-vttcue-interface
2927
2928         Otherwise, we end up potentially returning NaN for TextTrackCue.startTime / endTime,
2929         even though those correctly use type 'double':
2930         - https://html.spec.whatwg.org/multipage/media.html#texttrackcue
2931
2932         The new behavior is consistent with Firefox and Chrome.
2933
2934         No new tests, updated existing test.
2935
2936         * bindings/js/JSDOMConvertNumbers.h:
2937         (WebCore::JSConverter<IDLDouble>::convert):
2938         Add assertion to make sure our implementation never tries to return NaN
2939         for an IDL attribute of type 'double'. This would be invalid as per Web
2940         IDL spec and would crash if the NaN being returned was impure as JSValue
2941         could not store it as a double.
2942
2943         * html/track/VTTCue.idl:
2944         Update constructor parameters to use 'double' type instead of 'unrestricted
2945         double', as per:
2946         - https://w3c.github.io/webvtt/#the-vttcue-interface
2947
2948 2018-02-21  Zalan Bujtas  <zalan@apple.com>
2949
2950         [RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to RenderTreeBuilder
2951         https://bugs.webkit.org/show_bug.cgi?id=182946
2952         <rdar://problem/37690039>
2953
2954         Reviewed by Antti Koivisto.
2955
2956         No change in functionality.
2957
2958         * rendering/RenderTextFragment.cpp:
2959         (WebCore::RenderTextFragment::willBeDestroyed):
2960         * rendering/updating/RenderTreeBuilder.cpp:
2961         (WebCore::RenderTreeBuilder::takeChild):
2962         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2963         (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnRemoval):
2964         * rendering/updating/RenderTreeBuilderFirstLetter.h:
2965
2966 2018-02-21  Ms2ger  <Ms2ger@igalia.com>
2967
2968         [GCrypt] Remove unsound assertion from CryptoKeyRSA::exportData().
2969         https://bugs.webkit.org/show_bug.cgi?id=183001
2970
2971         Reviewed by Philippe Normand.
2972
2973         This function is called from structured cloning, in particular when storing
2974         a key in IndexedDB. This would trip the assertion if the key in question is
2975         non-exportable.
2976
2977         The assertion was copied from the macOS implementation in r172389; it was
2978         subsequently removed there in r172898 to handle this case.
2979
2980         Test: crypto/subtle/rsa-indexeddb-non-exportable.html
2981
2982         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2983         (WebCore::CryptoKeyRSA::exportData const): remove assertion.
2984
2985 2018-02-21  Myles C. Maxfield  <mmaxfield@apple.com>
2986
2987         [Cocoa] Make system-ui obey the user-installed-font policy
2988         https://bugs.webkit.org/show_bug.cgi?id=182860
2989         <rdar://problem/36158249>
2990
2991         Reviewed by Antti Koivisto.
2992
2993         We have a completely different codepath for system-ui which makes it follow the system's
2994         font cascade list. This codepath (along with all the other relevant places which create
2995         system fonts) needs to obey the AllowUserInstalledFonts enum. This patch is fairly
2996         mechanical; we simply are hooking up the flag across SystemFontDatabase.
2997
2998         There are a few places which creates system fonts which this patch doesn't touch. This is
2999         not a problem because all the remaining places either:
3000         1) Simply pull out some attributes of the font (name, weight, size, etc.) and then throw
3001         away the font object itself, or
3002         2) Use the font in an environment where script cannot access the characters rendered (such
3003         as DragImages or the fullscreen placeholder view or the inside of the attachment element).
3004
3005         Test: fast/text/user-installed-fonts/system-ui.html
3006
3007         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3008         (WebCore::FontDatabase::collectionForFamily):
3009         (WebCore::FontDatabase::fontForPostScriptName):
3010         (WebCore::fontWithFamily):
3011         (WebCore::installedFontMandatoryAttributes):
3012         (WebCore::createSpecificFontForInstalledFonts):
3013         * platform/graphics/cocoa/FontCacheCoreText.h:
3014         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3015         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const):
3016         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const):
3017         (WebCore::SystemFontDatabase::systemFontCascadeList):
3018         (WebCore::SystemFontDatabase::removeCascadeList):
3019         (WebCore::SystemFontDatabase::computeCascadeList):
3020         (WebCore::systemFontParameters):
3021         (WebCore::systemFontCascadeList):
3022         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
3023         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
3024         * platform/graphics/ios/FontCacheIOS.mm:
3025         (WebCore::platformFontWithFamilySpecialCase):
3026         * platform/graphics/mac/FontCacheMac.mm:
3027         (WebCore::platformFontWithFamilySpecialCase):
3028
3029 2018-02-21  Chris Dumez  <cdumez@apple.com>
3030
3031         Unreviewed attempt to fix build after r228867.
3032
3033         * Modules/webvr/VRStageParameters.cpp:
3034
3035 2018-02-21  Philippe Normand  <pnormand@igalia.com>
3036
3037         [GStreamer] Rewrite purgeInvalid*Tracks methods
3038         https://bugs.webkit.org/show_bug.cgi?id=183004
3039
3040         Reviewed by Carlos Garcia Campos.
3041
3042         Removing items from a hashmap while iterating is bad.
3043
3044         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3045         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks):
3046         Safely remove items from the hashmap using removeIf().
3047         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
3048         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
3049
3050 2018-02-21  Chris Dumez  <cdumez@apple.com>
3051
3052         Unreviewed attempt to fix build after r228867.
3053
3054         * Modules/webvr/VRStageParameters.cpp:
3055
3056 2018-02-21  Philippe Normand  <pnormand@igalia.com>
3057
3058         [GStreamer] Crash in Debug build when purging invalid tracks
3059         https://bugs.webkit.org/show_bug.cgi?id=182997
3060
3061         Reviewed by Xabier Rodriguez-Calvar.
3062
3063         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3064         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Clear the hashmap when there is no valid track left.
3065         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
3066         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
3067         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3068         (WebCore::TrackPrivateBaseGStreamer::getLanguageCode): Demote debugging, this appears too much at least with playbin2.
3069         (WebCore::TrackPrivateBaseGStreamer::getTag): Ditto.
3070
3071 2018-02-21  Philippe Normand  <pnormand@igalia.com>
3072
3073         [GStreamer] We need to adopt GstGlDisplays after GStreamer 1.13.1
3074         https://bugs.webkit.org/show_bug.cgi?id=182996
3075
3076         Reviewed by Xabier Rodriguez-Calvar.
3077
3078         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3079         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
3080         Adopt references when running with GStreamer 1.13.1 to avoid
3081         memory leaks.
3082
3083 2018-02-20  Philippe Normand  <pnormand@igalia.com>
3084
3085         [GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html failing since r228617
3086         https://bugs.webkit.org/show_bug.cgi?id=160131
3087         <rdar://problem/35873985>
3088
3089         Reviewed by Michael Catanzaro.
3090
3091         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3092         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): We
3093         can't assume the pad has a sticky event here like implemented in
3094         InbandTextTrackPrivateGStreamer because it might be emitted after
3095         the track was created. So fallback to a dummy stream ID like in
3096         the Audio and Video tracks.
3097
3098 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
3099
3100         [WebVR][OpenVR] Retrieve stage parameters
3101         https://bugs.webkit.org/show_bug.cgi?id=182976
3102
3103         Reviewed by Žan Doberšek.
3104
3105         Use OpenVR to retrieve stage parameters, i.e., play area size and
3106         the transformation from sitting to standing position. It includes
3107         the same fallback used by Firefox to provide sensible values in case
3108         we cannot get the required information from the VR SDK (it's quite
3109         common not to have defined a play area).
3110
3111         * Modules/webvr/VRDisplay.cpp:
3112         (WebCore::VRDisplay::stageParameters const):
3113         * Modules/webvr/VRDisplay.h:
3114         * Modules/webvr/VRStageParameters.cpp:
3115         (WebCore::VRStageParameters::VRStageParameters):
3116         (WebCore::VRStageParameters::sittingToStandingTransform const):
3117         (WebCore::VRStageParameters::sizeX const):
3118         (WebCore::VRStageParameters::sizeZ const):
3119         * Modules/webvr/VRStageParameters.h:
3120         (WebCore::VRStageParameters::create):
3121         * platform/vr/VRPlatformDisplay.h:
3122         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
3123         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
3124         (WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
3125         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
3126
3127 2018-02-21  Philippe Normand  <pnormand@igalia.com>
3128
3129         [GStreamer] Create a Wayland GL display instead of EGL
3130         https://bugs.webkit.org/show_bug.cgi?id=182968
3131
3132         Reviewed by Xabier Rodriguez-Calvar.
3133
3134         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3135         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
3136         Add logging and instantiate a GstDisplayWayland display instead of
3137         an EGL display when running under a Wayland compositor.
3138
3139 2018-02-21  Zalan Bujtas  <zalan@apple.com>
3140
3141         [RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder
3142         https://bugs.webkit.org/show_bug.cgi?id=182947
3143         <rdar://problem/37690848>
3144
3145         Reviewed by Antti Koivisto.
3146
3147         No change in functionality.
3148
3149         * Sources.txt:
3150         * WebCore.xcodeproj/project.pbxproj:
3151         * rendering/RenderFullScreen.cpp:
3152         (WebCore::RenderFullScreen::willBeDestroyed):
3153         * rendering/updating/RenderTreeBuilder.cpp:
3154         (WebCore::RenderTreeBuilder::takeChild):
3155         * rendering/updating/RenderTreeBuilder.h:
3156         (WebCore::RenderTreeBuilder::fullScreenBuilder):
3157         * rendering/updating/RenderTreeBuilderFullScreen.cpp: Added.
3158         (WebCore::RenderTreeBuilder::FullScreen::FullScreen):
3159         (WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval):
3160         * rendering/updating/RenderTreeBuilderFullScreen.h: Added.
3161         * rendering/updating/RenderTreeBuilderMathML.cpp:
3162
3163 2018-02-20  Zalan Bujtas  <zalan@apple.com>
3164
3165         [RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder
3166         https://bugs.webkit.org/show_bug.cgi?id=182943
3167         <rdar://problem/37689029>
3168
3169         Reviewed by Antti Koivisto.
3170
3171         We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted
3172         in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is
3173         the RenderListItem's descendent). 
3174
3175         Covered by existing tests.
3176
3177         * rendering/RenderListItem.cpp:
3178         (WebCore::RenderListItem::~RenderListItem):
3179         (WebCore::RenderListItem::willBeDestroyed): Deleted.
3180         * rendering/RenderListItem.h:
3181
3182 2018-02-20  Nan Wang  <n_wang@apple.com>
3183
3184         AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
3185         https://bugs.webkit.org/show_bug.cgi?id=182752
3186         <rdar://problem/37518233>
3187
3188         Reviewed by Ryosuke Niwa.
3189
3190         Call the assistive technology specific method for becoming first responder.
3191
3192         Test: accessibility/mac/accessibility-make-first-responder.html
3193
3194         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3195         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3196         * page/ChromeClient.h:
3197
3198 2018-02-20  Tim Horton  <timothy_horton@apple.com>
3199
3200         Introduce HAVE(IOSURFACE_ACCELERATOR)
3201         https://bugs.webkit.org/show_bug.cgi?id=182955
3202         <rdar://problem/37699510>
3203
3204         Reviewed by Sam Weinig.
3205
3206         No new tests, no change in behavior.
3207
3208         Introduce HAVE(IOSURFACE_ACCELERATOR) and guard all uses of
3209         IOSurfaceAccelerator behind it.
3210
3211         Rename USE(IOSURFACE) to HAVE(IOSURFACE) for accuracy.
3212
3213         * page/cocoa/MemoryReleaseCocoa.mm:
3214         * platform/graphics/ca/TileController.cpp:
3215         * platform/graphics/cg/IOSurfacePool.cpp:
3216         * platform/graphics/cg/IOSurfacePool.h:
3217         * platform/graphics/cg/ImageBufferCG.cpp:
3218         * platform/graphics/cocoa/IOSurface.h:
3219         * platform/graphics/cocoa/IOSurface.mm:
3220         * platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
3221         * platform/graphics/cv/VideoTextureCopierCV.cpp:
3222         * platform/graphics/cv/VideoTextureCopierCV.h:
3223
3224 2018-02-20  Chris Dumez  <cdumez@apple.com>
3225
3226         Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
3227         https://bugs.webkit.org/show_bug.cgi?id=182720
3228         <rdar://problem/37515204>
3229
3230         Reviewed by Alex Christensen.
3231
3232         Wait for the policy response from the client after receiving a resource response,
3233         before sending the NetworkResourceLoader::ContinueDidReceiveResponse IPC back to
3234         the NetworkProcess. Otherwise, the network process may start sending us data and
3235         we may end up committing the provisional load before receiving the policy decision
3236         fron the client.
3237
3238         Change is covered by new API test.
3239
3240         * loader/DocumentLoader.cpp:
3241         (WebCore::DocumentLoader::responseReceived):
3242         * loader/NetscapePlugInStreamLoader.cpp:
3243         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
3244         * loader/NetscapePlugInStreamLoader.h:
3245         * loader/ResourceLoader.cpp:
3246         (WebCore::ResourceLoader::deliverResponseAndData):
3247         (WebCore::ResourceLoader::loadDataURL):
3248         (WebCore::ResourceLoader::didReceiveResponse):
3249         (WebCore::ResourceLoader::didReceiveResponseAsync):
3250         * loader/ResourceLoader.h:
3251         * loader/SubresourceLoader.cpp:
3252         (WebCore::SubresourceLoader::didReceiveResponse):
3253         (WebCore::SubresourceLoader::didReceiveResponsePolicy):
3254         (WebCore::SubresourceLoader::willCancel):
3255         * loader/SubresourceLoader.h:
3256         * loader/ios/PreviewLoader.mm:
3257         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
3258
3259 2018-02-20  Chris Dumez  <cdumez@apple.com>
3260
3261         Crash under JSC::JSCell::toNumber(JSC::ExecState*)
3262         https://bugs.webkit.org/show_bug.cgi?id=182984
3263         <rdar://problem/37694346>
3264
3265         Reviewed by Mark Lam.
3266
3267         The issue was caused by DOMMatrix attributes potentially returning "impure"
3268         NaN values. We would call JSC::jsNumber(double) to construct the JSValue
3269         but this is only safe for pure NaN values. Make sure we purify the double
3270         returned by the implementation for IDL attributes of type 'unrestricted double'
3271         before calling JSC::jsNumber(double).
3272
3273         No new tests, extended existing test.
3274
3275         * bindings/js/JSDOMConvertNumbers.h:
3276         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
3277         * testing/TypeConversions.h:
3278         (WebCore::TypeConversions::testImpureNaNUnrestrictedDouble const):
3279         (WebCore::TypeConversions::testImpureNaN2UnrestrictedDouble const):
3280         (WebCore::TypeConversions::testQuietNaNUnrestrictedDouble const):
3281         * testing/TypeConversions.idl:
3282
3283 2018-02-20  Tim Horton  <timothy_horton@apple.com>
3284
3285         Make more use of USE(OPENGL_ES) where it makes sense
3286         https://bugs.webkit.org/show_bug.cgi?id=182957
3287         <rdar://problem/37699443>
3288
3289         Reviewed by Dan Bernstein.
3290
3291         No new tests, no behavior change.
3292
3293         Make use of USE(OPENGL_ES) for CoreVideo functions that differ based
3294         on GL availability. Also adjust GraphicsContext3D in the same way.
3295
3296         * platform/cocoa/CoreVideoSoftLink.cpp:
3297         * platform/cocoa/CoreVideoSoftLink.h:
3298         * platform/graphics/GraphicsContext3D.h:
3299         * platform/graphics/cv/TextureCacheCV.mm:
3300         (WebCore::TextureCacheCV::create):
3301         (WebCore::TextureCacheCV::textureFromImage):
3302         * platform/graphics/cv/VideoTextureCopierCV.cpp:
3303         (WebCore::enumToStringMap):
3304         (WebCore::VideoTextureCopierCV::initializeContextObjects):
3305         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
3306         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
3307         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
3308
3309 2018-02-20  Nan Wang  <n_wang@apple.com>
3310
3311         AX: AOM: Dispatch accessibleclick event
3312         https://bugs.webkit.org/show_bug.cgi?id=180898
3313         <rdar://problem/36086710>
3314
3315         Reviewed by Ryosuke Niwa.
3316
3317         Accessibility events.
3318         Spec: https://wicg.github.io/aom/spec/phase2.html
3319
3320         This patch allows developers to register event handlers on Elements
3321         for custom accessibility events.
3322
3323         Accessibility events go through a capturing and bubbling phase just
3324         like DOM events, but in the accessibility tree.
3325
3326         Implemented "accessibleclick" event.
3327
3328         Test: accessibility/mac/AOM-events.html
3329
3330         * accessibility/AccessibilityObject.cpp:
3331         (WebCore::AccessibilityObject::press):
3332         (WebCore::AccessibilityObject::dispatchAccessibilityEvent):
3333         * accessibility/AccessibilityObject.h:
3334         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3335         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
3336         * dom/Element.idl:
3337         * dom/EventDispatcher.cpp:
3338         (WebCore::dispatchEventWithType):
3339         (WebCore::EventDispatcher::dispatchEvent):
3340         * dom/EventDispatcher.h:
3341         * dom/EventNames.h:
3342         * dom/EventPath.cpp:
3343         (WebCore::EventPath::EventPath):
3344         * dom/EventPath.h:
3345
3346 2018-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3347
3348         [iOS 11.3 Beta] Can't copy a URL from Safari and paste it into the Gmail app
3349         https://bugs.webkit.org/show_bug.cgi?id=182952
3350         <rdar://problem/37636190>
3351
3352         Reviewed by Tim Horton.
3353
3354         After r220865 refactored the iOS copy codepaths to use NSItemProviders, we stopped writing the URL as plain text
3355         to the pasteboard. However, this means clients that only check for "text/plain" (or one of its aliases) on the
3356         pasteboard won't read any data on paste.
3357
3358         To fix this, we restore the pre-iOS 11.3 behavior of writing both the URL and plain text to the pasteboard.
3359         Since we're using item providers, we also ensure that the NSURL is at a higher fidelity than the string to make
3360         it clear that the data should be consumed as a URL.
3361
3362         This patch also rebaselines an existing drag and drop test to cover this change, and adds a new API test,
3363         ActionSheetTests.CopyLinkWritesURLAndPlainText, which simulates copying a link using the share sheet and pasting
3364         into a DataTransfer-dumping test harness.
3365
3366         * platform/ios/PlatformPasteboardIOS.mm:
3367         (WebCore::PlatformPasteboard::write):
3368
3369 2018-02-20  Eric Carlson  <eric.carlson@apple.com>
3370
3371         [iOS] Returning from Auto-PiP causes Safari to be unresponsive
3372         https://bugs.webkit.org/show_bug.cgi?id=182977
3373         <rdar://problem/37685981>
3374
3375         Reviewed by Jer Noble.
3376
3377         Remove the error handling added in r228115, it breaks auto-pip.
3378
3379         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3380         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
3381         (VideoFullscreenInterfaceAVKit::enterFullscreenStandard):
3382         (VideoFullscreenInterfaceAVKit::exitFullscreen):
3383         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
3384         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
3385         (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
3386         (VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
3387         (VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
3388
3389 2018-02-20  Jer Noble  <jer.noble@apple.com>
3390
3391         [EME] Adopt new AVContentKeySession success delegate callback
3392         https://bugs.webkit.org/show_bug.cgi?id=182974
3393         <rdar://problem/36079035>
3394
3395         Reviewed by Eric Carlson.
3396
3397         Store the updateLicenseCallback if the new protocol method is present and supported.
3398
3399         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
3400         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3401         (-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequestDidSucceed:]):
3402         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
3403         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
3404         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
3405
3406 2018-02-19  Dean Jackson  <dino@apple.com>
3407
3408         Handle all writing-modes in downcast
3409         https://bugs.webkit.org/show_bug.cgi?id=182949
3410         <rdar://problem/37710687>
3411
3412         Reviewed by Myles Maxfield.
3413
3414         It appears we forgot to handle the deprecated "lr"
3415         writing-mode value.
3416
3417         Test: fast/writing-mode/svg-writing-modes.html
3418
3419         * css/CSSPrimitiveValueMappings.h:
3420         (WebCore::CSSPrimitiveValue::operator WritingMode const):
3421
3422 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>