7fded12ca0bd8b4ca0a76ab3bbec6a2e0da045d0
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         Remove currentTime() / currentTimeMS()
4         https://bugs.webkit.org/show_bug.cgi?id=183052
5
6         Reviewed by Mark Lam.
7
8         * Modules/geolocation/Geolocation.cpp:
9         (WebCore::Geolocation::haveSuitableCachedPosition):
10         * dom/DOMTimeStamp.h:
11         (WebCore::convertSecondsToDOMTimeStamp):
12         * fileapi/File.cpp:
13         (WebCore::File::File):
14         (WebCore::File::lastModified const):
15         * history/HistoryItem.cpp:
16         (WebCore::generateSequenceNumber):
17         * html/BaseDateAndTimeInputType.cpp:
18         (WebCore::BaseDateAndTimeInputType::defaultValueForStepUp const):
19         * html/DateTimeInputType.cpp:
20         (WebCore::DateTimeInputType::defaultValueForStepUp const):
21         * html/MonthInputType.cpp:
22         (WebCore::MonthInputType::defaultValueForStepUp const):
23         * html/TimeInputType.cpp:
24         (WebCore::TimeInputType::defaultValueForStepUp const):
25         * inspector/agents/InspectorNetworkAgent.cpp:
26         (WebCore::InspectorNetworkAgent::willSendRequest):
27         (WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest):
28         * loader/EmptyFrameLoaderClient.h:
29         * loader/FormSubmission.cpp:
30         (WebCore::generateFormDataIdentifier):
31         * loader/FrameLoader.cpp:
32         (WebCore::FrameLoader::clientRedirected):
33         * loader/FrameLoader.h:
34         * loader/FrameLoaderClient.h:
35         * loader/NavigationScheduler.cpp:
36         * page/History.cpp:
37         (WebCore::History::stateObjectAdded):
38         * page/History.h:
39         * page/PageOverlay.cpp:
40         (WebCore::PageOverlay::startFadeAnimation):
41         (WebCore::PageOverlay::fadeAnimationTimerFired):
42         * page/PageOverlay.h:
43         * platform/graphics/cg/GraphicsContextCG.cpp:
44         (WebCore::GraphicsContext::drawNativeImage):
45         * platform/ios/LegacyTileLayerPool.h:
46         * platform/ios/LegacyTileLayerPool.mm:
47         (WebCore::LegacyTileLayerPool::LegacyTileLayerPool):
48         (WebCore::LegacyTileLayerPool::addLayer):
49         (WebCore::LegacyTileLayerPool::decayedCapacity const):
50         (WebCore::LegacyTileLayerPool::prune):
51         * platform/ios/SystemMemoryIOS.cpp:
52         (WebCore::systemMemoryLevel):
53         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
54         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
55
56 2018-02-22  Per Arne Vollan  <pvollan@apple.com>
57
58         The WebContent process should not use NSScreen in the screenDepth implementation.
59         https://bugs.webkit.org/show_bug.cgi?id=183048
60
61         Reviewed by Brent Fulgham.
62
63         NSScreen method calls should be done in the UIProcess, since these calls will communicate with
64         the WindowServer. The screen depth property can be retrieved in the UIProcess, and sent to the
65         WebContent process, where it is cached. Whenever screen properties change, the UIProcess will
66         send the new screen properties to the WebProcess.
67
68         No new tests, covered by existing tests.
69
70         * platform/ScreenProperties.h:
71         (WebCore::ScreenProperties::encode const):
72         (WebCore::ScreenProperties::decode):
73         * platform/mac/PlatformScreenMac.mm:
74         (WebCore::getScreenProperties):
75         (WebCore::screenDepth):
76         (WebCore::screenDepthPerComponent):
77         (WebCore::screenRect):
78         (WebCore::screenAvailableRect):
79
80 2018-02-22  Zalan Bujtas  <zalan@apple.com>
81
82         [RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and removeAndDestroy() -> destroy()
83         https://bugs.webkit.org/show_bug.cgi?id=183061
84         <rdar://problem/37800269>
85
86         Reviewed by Ryosuke Niwa.
87
88         ...and moveChildTo() -> move() (moveChildrenTo() -> moveChildren()),
89         removeFromParentAndDestroyCleaningUpAnonymousWrappers() -> destroyAndCleanUpAnonymousWrappers()
90
91         No change in functionality.
92
93         * dom/Document.cpp:
94         (WebCore::Document::destroyRenderTree):
95         (WebCore::Document::setFullScreenRenderer):
96         * rendering/RenderBlockFlow.cpp:
97         (WebCore::RenderBlockFlow::styleDidChange):
98         * rendering/RenderButton.cpp:
99         (WebCore::RenderButton::setText):
100         * rendering/RenderElement.cpp:
101         (WebCore::RenderElement::didAttachChild):
102         (WebCore::RenderElement::didInsertChild): Deleted.
103         * rendering/RenderElement.h:
104         * rendering/RenderFullScreen.cpp:
105         (WebCore::RenderFullScreen::wrapNewRenderer):
106         (WebCore::RenderFullScreen::wrapExistingRenderer):
107         (WebCore::RenderFullScreen::unwrapRenderer):
108         (WebCore::RenderFullScreen::createPlaceholder):
109         * rendering/RenderMenuList.cpp:
110         (RenderMenuList::didAttachChild):
111         (RenderMenuList::setText):
112         (RenderMenuList::didInsertChild): Deleted.
113         * rendering/RenderMenuList.h:
114         * rendering/RenderQuote.cpp:
115         (WebCore::RenderQuote::updateTextRenderer):
116         * rendering/RenderTextFragment.cpp:
117         (WebCore::RenderTextFragment::setText):
118         * rendering/updating/RenderTreeBuilder.cpp:
119         (WebCore::RenderTreeBuilder::destroy):
120         (WebCore::RenderTreeBuilder::attach):
121         (WebCore::RenderTreeBuilder::attachIgnoringContinuation):
122         (WebCore::RenderTreeBuilder::detach):
123         (WebCore::RenderTreeBuilder::attachToRenderElement):
124         (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
125         (WebCore::RenderTreeBuilder::move):
126         (WebCore::RenderTreeBuilder::moveAllChildren):
127         (WebCore::RenderTreeBuilder::moveChildren):
128         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloats):
129         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
130         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
131         (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
132         (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
133         (WebCore::RenderTreeBuilder::detachFromRenderGrid):
134         (WebCore::RenderTreeBuilder::detachFromRenderElement):
135         (WebCore::RenderTreeBuilder::attachToRenderGrid):
136         (WebCore::RenderTreeBuilder::removeAndDestroy): Deleted.
137         (WebCore::RenderTreeBuilder::insertChild): Deleted.
138         (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): Deleted.
139         (WebCore::RenderTreeBuilder::takeChild): Deleted.
140         (WebCore::RenderTreeBuilder::insertChildToRenderElement): Deleted.
141         (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): Deleted.
142         (WebCore::RenderTreeBuilder::moveChildTo): Deleted.
143         (WebCore::RenderTreeBuilder::moveAllChildrenTo): Deleted.
144         (WebCore::RenderTreeBuilder::moveChildrenTo): Deleted.
145         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): Deleted.
146         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
147         (WebCore::RenderTreeBuilder::takeChildFromRenderGrid): Deleted.
148         (WebCore::RenderTreeBuilder::takeChildFromRenderElement): Deleted.
149         (WebCore::RenderTreeBuilder::insertChildToRenderGrid): Deleted.
150         * rendering/updating/RenderTreeBuilder.h:
151         * rendering/updating/RenderTreeBuilderBlock.cpp:
152         (WebCore::RenderTreeBuilder::Block::attach):
153         (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
154         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
155         (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
156         (WebCore::RenderTreeBuilder::Block::detach):
157         (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
158         (WebCore::RenderTreeBuilder::Block::insertChild): Deleted.
159         (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): Deleted.
160         (WebCore::RenderTreeBuilder::Block::takeChild): Deleted.
161         * rendering/updating/RenderTreeBuilderBlock.h:
162         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
163         (WebCore::RenderTreeBuilder::BlockFlow::attach):
164         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats):
165         (WebCore::RenderTreeBuilder::BlockFlow::insertChild): Deleted.
166         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
167         * rendering/updating/RenderTreeBuilderBlockFlow.h:
168         * rendering/updating/RenderTreeBuilderContinuation.cpp:
169         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
170         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
171         (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):
172         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
173         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
174         * rendering/updating/RenderTreeBuilderFormControls.cpp:
175         (WebCore::RenderTreeBuilder::FormControls::attach):
176         (WebCore::RenderTreeBuilder::FormControls::detach):
177         (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
178         (WebCore::RenderTreeBuilder::FormControls::insertChild): Deleted.
179         (WebCore::RenderTreeBuilder::FormControls::takeChild): Deleted.
180         * rendering/updating/RenderTreeBuilderFormControls.h:
181         * rendering/updating/RenderTreeBuilderFullScreen.cpp:
182         (WebCore::RenderTreeBuilder::FullScreen::cleanupOnDestroy):
183         * rendering/updating/RenderTreeBuilderInline.cpp:
184         (WebCore::RenderTreeBuilder::Inline::attach):
185         (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
186         (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
187         (WebCore::RenderTreeBuilder::Inline::splitFlow):
188         (WebCore::RenderTreeBuilder::Inline::splitInlines):
189         (WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
190         (WebCore::RenderTreeBuilder::Inline::insertChild): Deleted.
191         (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): Deleted.
192         * rendering/updating/RenderTreeBuilderInline.h:
193         * rendering/updating/RenderTreeBuilderList.cpp:
194         (WebCore::RenderTreeBuilder::List::updateItemMarker):
195         * rendering/updating/RenderTreeBuilderMathML.cpp:
196         (WebCore::RenderTreeBuilder::MathML::makeFences):
197         (WebCore::RenderTreeBuilder::MathML::attach):
198         (WebCore::RenderTreeBuilder::MathML::insertChild): Deleted.
199         * rendering/updating/RenderTreeBuilderMathML.h:
200         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
201         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
202         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
203         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
204         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
205         * rendering/updating/RenderTreeBuilderRuby.cpp:
206         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
207         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
208         (WebCore::RenderTreeBuilder::Ruby::attach):
209         (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
210         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
211         (WebCore::RenderTreeBuilder::Ruby::detach):
212         (WebCore::RenderTreeBuilder::Ruby::insertChild): Deleted.
213         (WebCore::RenderTreeBuilder::Ruby::takeChild): Deleted.
214         * rendering/updating/RenderTreeBuilderRuby.h:
215         * rendering/updating/RenderTreeBuilderSVG.cpp:
216         (WebCore::RenderTreeBuilder::SVG::attach):
217         (WebCore::RenderTreeBuilder::SVG::detach):
218         (WebCore::RenderTreeBuilder::SVG::insertChild): Deleted.
219         (WebCore::RenderTreeBuilder::SVG::takeChild): Deleted.
220         * rendering/updating/RenderTreeBuilderSVG.h:
221         * rendering/updating/RenderTreeBuilderTable.cpp:
222         (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
223         (WebCore::RenderTreeBuilder::Table::attach):
224         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
225         (WebCore::RenderTreeBuilder::Table::insertChild): Deleted.
226         * rendering/updating/RenderTreeBuilderTable.h:
227         * rendering/updating/RenderTreeUpdater.cpp:
228         (WebCore::RenderTreeUpdater::createRenderer):
229         (WebCore::RenderTreeUpdater::createTextRenderer):
230         (WebCore::RenderTreeUpdater::tearDownRenderers):
231         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
232         (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
233         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
234         (WebCore::createContentRenderers):
235
236 2018-02-22  Chris Dumez  <cdumez@apple.com>
237
238         ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition
239         https://bugs.webkit.org/show_bug.cgi?id=183059
240         <rdar://problem/37800202>
241
242         Reviewed by Youenn Fablet.
243
244         Update ResourceRequestBase::setAsIsolatedCopy() to call isolatedCopy() on the cachePartition as well,
245         given that it is a String and it would not be safe to send it to another thread otherwise.
246
247         * platform/network/ResourceRequestBase.cpp:
248         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
249
250 2018-02-22  Chris Dumez  <cdumez@apple.com>
251
252         ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread
253         https://bugs.webkit.org/show_bug.cgi?id=183050
254         <rdar://problem/37796881>
255
256         Reviewed by Youenn Fablet.
257
258         Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's
259         startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript().
260
261         * workers/service/ServiceWorkerContainer.cpp:
262         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
263         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
264         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
265
266 2018-02-22  Chris Dumez  <cdumez@apple.com>
267
268         ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread
269         https://bugs.webkit.org/show_bug.cgi?id=183046
270         <rdar://problem/37793395>
271
272         Reviewed by Youenn Fablet.
273
274         Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob().
275         The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads.
276
277         * workers/service/ServiceWorkerContainer.cpp:
278         (WebCore::ServiceWorkerContainer::scheduleJob):
279
280 2018-02-22  Basuke Suzuki  <Basuke.Suzuki@sony.com>
281
282         [Curl] Fix warning on clang.
283         https://bugs.webkit.org/show_bug.cgi?id=182986
284
285         Reviewed by Konstantin Tokarev.
286
287         No new tests because there's no behaviro changes.
288
289         * platform/network/curl/CurlResourceHandleDelegate.cpp:
290         (WebCore::CurlResourceHandleDelegate::curlDidSendData):
291         (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
292         (WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
293         * platform/network/curl/CurlResourceHandleDelegate.h:
294
295 2018-02-22  Youenn Fablet  <youenn@apple.com>
296
297         WorkerCacheStorageConnection::doRemove can assert in case two frames try to delete the same cache at the same time
298         https://bugs.webkit.org/show_bug.cgi?id=183041
299
300         Reviewed by Chris Dumez.
301
302         * Modules/cache/WorkerCacheStorageConnection.cpp:
303         (WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the
304         case of an already deleted cache, i.e. returned identifer is 0.
305
306 2018-02-22  Alejandro G. Castro  <alex@igalia.com>
307
308         Remove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource classes
309         https://bugs.webkit.org/show_bug.cgi?id=183031
310
311         Reviewed by Youenn Fablet.
312
313         This include and namespace are not required in the file.
314
315         Just removing unused code, no tests required.
316
317         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
318
319 2018-02-22  Chris Dumez  <cdumez@apple.com>
320
321         Document.open() cancels existing provisional load but not navigation policy check
322         https://bugs.webkit.org/show_bug.cgi?id=183012
323         <rdar://problem/37755831>
324
325         Reviewed by Alex Christensen.
326
327         Test: fast/dom/Document/open-with-pending-load-async-policy.html
328
329         * dom/Document.cpp:
330         (WebCore::Document::open):
331         The existing code was calling FrameLoader::stopAllLoaders() when the loader's state
332         is FrameStateProvisional. The issue is that the FrameLoader's state only gets set
333         to FrameStateProvisional after the policy decision for the navigation is made.
334         This means that we fail to cancel a pending load if is still in the policy decision
335         stage, which can happen when the policy decision is made asynchronously. We now
336         also cancel such pending navigation policy checks as well.
337
338         * loader/PolicyChecker.cpp:
339         (WebCore::PolicyChecker::checkNavigationPolicy):
340         Make sure the m_delegateIsDecidingNavigationPolicy flag gets reset inside the
341         lambda. Otherwise, it gets reset too early when the policy decision is made
342         asynchronously.
343
344 2018-02-22  Youenn Fablet  <youenn@apple.com>
345
346         Add release asserts for service worker fetch and postMessage events
347         https://bugs.webkit.org/show_bug.cgi?id=183025
348         rdar://problem/37765052
349
350         Reviewed by Daniel Bates.
351
352         Add release assertion so that a service worker will only dispatch a message event
353         for clients and service workers with the same origin.
354         No change of behavior.
355
356         * platform/network/ResourceRequestBase.h:
357         * workers/service/context/ServiceWorkerThread.cpp:
358         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
359         * workers/service/context/ServiceWorkerThreadProxy.h:
360
361 2018-02-22  Miguel Gomez  <magomez@igalia.com>
362
363         including both gl3.h and gl2.h when USE_OPENGL_ES is enabled
364         https://bugs.webkit.org/show_bug.cgi?id=183008
365
366         Reviewed by Michael Catanzaro.
367
368         Don't include GLES3 headers as we stick to GLES2 API resources.
369
370         No new tests, no behavior change.
371
372         * platform/graphics/GLContext.cpp:
373
374 2018-02-22  Ms2ger  <Ms2ger@igalia.com>
375
376         [GTK][WPE] Fix some build errors in service workers code
377         https://bugs.webkit.org/show_bug.cgi?id=182966
378
379         Reviewed by Žan Doberšek.
380
381         No new tests: no change in behavior.
382
383         * workers/service/ServiceWorkerProvider.h: add missing forward declaration.
384
385 2018-02-21  Zalan Bujtas  <zalan@apple.com>
386
387         [RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder
388         https://bugs.webkit.org/show_bug.cgi?id=183022
389         <rdar://problem/37764326>
390
391         Reviewed by Antti Koivisto.
392
393         No change in functionality.
394
395         * rendering/RenderObject.cpp:
396         (WebCore::RenderObject::insertedIntoTree):
397         * rendering/updating/RenderTreeBuilder.cpp:
398         (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal):
399         (WebCore::RenderTreeBuilder::moveChildrenTo):
400         (WebCore::RenderTreeBuilder::multiColumnDescendantInserted): Deleted.
401         * rendering/updating/RenderTreeBuilder.h:
402
403 2018-02-21  Tim Horton  <timothy_horton@apple.com>
404
405         Include all Cocoa sources in all Cocoa platform builds
406         https://bugs.webkit.org/show_bug.cgi?id=183026
407         <rdar://problem/37513101>
408
409         Reviewed by Dan Bernstein.
410
411         Similar to r228571, don't have separate Sources files for iOS and Mac.
412         All sources now have #ifdefs that ensure that only the right ones
413         build on the right platforms. This makes it much easier to reason
414         about what builds where by just looking at the sources.
415
416         * SourcesCocoa.txt:
417         * SourcesIOS.txt: Removed.
418         * SourcesMac.txt: Removed.
419         * WebCore.xcodeproj/project.pbxproj:
420         * editing/WebContentReader.h:
421         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
422
423 2018-02-21  Youenn Fablet  <youenn@apple.com>
424
425         Make SubstituteResource take a ResourceResponse r-value
426         https://bugs.webkit.org/show_bug.cgi?id=183020
427
428         Reviewed by Alex Christensen.
429
430         No change of behavior.
431         Make SubstituteResource take a ResourceResponse r-value.
432         Update ArchiveResource accordingly.
433         Take benefit of that in ApplicationCacheResource to set the response source to ApplicationCache
434         before passing it to SubstituteResource constructor.
435
436         * loader/SubstituteResource.h:
437         (WebCore::SubstituteResource::SubstituteResource):
438         (WebCore::SubstituteResource::resourceResponse): Deleted.
439         * loader/appcache/ApplicationCacheResource.cpp:
440         (WebCore::ApplicationCacheResource::create):
441         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
442         * loader/appcache/ApplicationCacheResource.h:
443         (WebCore::ApplicationCacheResource::create): Deleted.
444         * loader/archive/ArchiveResource.cpp:
445         (WebCore::ArchiveResource::ArchiveResource):
446
447 2018-02-21  Zalan Bujtas  <zalan@apple.com>
448
449         [RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore.
450         https://bugs.webkit.org/show_bug.cgi?id=183019
451         <rdar://problem/37761421>
452
453         Reviewed by Antti Koivisto.
454
455         All the willBeDestroyed() mutations have been moved over to RenderTreeBuilder. 
456
457         No change in functionality.
458
459         * rendering/RenderBlock.cpp:
460         (WebCore::RenderBlock::willBeDestroyed):
461         * rendering/RenderBlock.h:
462         * rendering/RenderBlockFlow.cpp:
463         (WebCore::RenderBlockFlow::willBeDestroyed):
464         * rendering/RenderBlockFlow.h:
465         * rendering/RenderBox.cpp:
466         (WebCore::RenderBox::willBeDestroyed):
467         * rendering/RenderBox.h:
468         * rendering/RenderBoxModelObject.cpp:
469         (WebCore::RenderBoxModelObject::willBeDestroyed):
470         * rendering/RenderBoxModelObject.h:
471         * rendering/RenderCounter.cpp:
472         (WebCore::RenderCounter::willBeDestroyed):
473         * rendering/RenderCounter.h:
474         * rendering/RenderElement.cpp:
475         (WebCore::RenderElement::willBeDestroyed):
476         * rendering/RenderElement.h:
477         * rendering/RenderEmbeddedObject.cpp:
478         (WebCore::RenderEmbeddedObject::willBeDestroyed):
479         * rendering/RenderEmbeddedObject.h:
480         * rendering/RenderFragmentedFlow.cpp:
481         (WebCore::RenderFragmentedFlow::willBeDestroyed):
482         * rendering/RenderFragmentedFlow.h:
483         * rendering/RenderImage.cpp:
484         (WebCore::RenderImage::willBeDestroyed):
485         * rendering/RenderImage.h:
486         * rendering/RenderInline.cpp:
487         (WebCore::RenderInline::willBeDestroyed):
488         * rendering/RenderInline.h:
489         * rendering/RenderLayerModelObject.cpp:
490         (WebCore::RenderLayerModelObject::willBeDestroyed):
491         * rendering/RenderLayerModelObject.h:
492         * rendering/RenderListBox.cpp:
493         (WebCore::RenderListBox::willBeDestroyed):
494         * rendering/RenderListBox.h:
495         * rendering/RenderListMarker.cpp:
496         (WebCore::RenderListMarker::willBeDestroyed):
497         * rendering/RenderListMarker.h:
498         * rendering/RenderMenuList.cpp:
499         (WebCore::RenderMenuList::willBeDestroyed):
500         * rendering/RenderMenuList.h:
501         * rendering/RenderObject.cpp:
502         (WebCore::RenderObject::willBeDestroyed):
503         (WebCore::RenderObject::destroy):
504         * rendering/RenderObject.h:
505         * rendering/RenderReplaced.cpp:
506         (WebCore::RenderReplaced::willBeDestroyed):
507         * rendering/RenderReplaced.h:
508         * rendering/RenderSearchField.cpp:
509         (WebCore::RenderSearchField::willBeDestroyed):
510         * rendering/RenderSearchField.h:
511         * rendering/RenderSnapshottedPlugIn.cpp:
512         (WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
513         * rendering/RenderSnapshottedPlugIn.h:
514         * rendering/RenderText.cpp:
515         (WebCore::RenderText::willBeDestroyed):
516         * rendering/RenderText.h:
517         * rendering/RenderTextControlMultiLine.cpp:
518         (WebCore::RenderTextControlMultiLine::willBeDestroyed):
519         * rendering/RenderTextControlMultiLine.h:
520         * rendering/RenderVideo.cpp:
521         (WebCore::RenderVideo::willBeDestroyed):
522         * rendering/RenderVideo.h:
523         * rendering/RenderWidget.cpp:
524         (WebCore::RenderWidget::willBeDestroyed):
525         * rendering/RenderWidget.h:
526         * rendering/svg/RenderSVGBlock.cpp:
527         (WebCore::RenderSVGBlock::willBeDestroyed):
528         * rendering/svg/RenderSVGBlock.h:
529         * rendering/svg/RenderSVGImage.cpp:
530         (WebCore::RenderSVGImage::willBeDestroyed):
531         * rendering/svg/RenderSVGImage.h:
532         * rendering/svg/RenderSVGInline.cpp:
533         (WebCore::RenderSVGInline::willBeDestroyed):
534         * rendering/svg/RenderSVGInline.h:
535         * rendering/svg/RenderSVGModelObject.cpp:
536         (WebCore::RenderSVGModelObject::willBeDestroyed):
537         * rendering/svg/RenderSVGModelObject.h:
538         * rendering/svg/RenderSVGResourceContainer.cpp:
539         (WebCore::RenderSVGResourceContainer::willBeDestroyed):
540         * rendering/svg/RenderSVGResourceContainer.h:
541         * rendering/svg/RenderSVGRoot.cpp:
542         (WebCore::RenderSVGRoot::willBeDestroyed):
543         * rendering/svg/RenderSVGRoot.h:
544         * rendering/svg/RenderSVGText.cpp:
545         (WebCore::RenderSVGText::willBeDestroyed):
546         * rendering/svg/RenderSVGText.h:
547
548 2018-02-21  Per Arne Vollan  <pvollan@apple.com>
549
550         The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
551         https://bugs.webkit.org/show_bug.cgi?id=182855
552
553         Reviewed by Brent Fulgham.
554
555         On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
556         with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
557         screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
558         process whenever there is a change in the display properties, and have the WebContent process cache these
559         display properties. This message should also be sent to a newly started WebContent process.
560
561         No new tests, covered by existing tests.
562
563         * WebCore.xcodeproj/project.pbxproj:
564         * platform/PlatformScreen.h:
565         * platform/mac/PlatformScreenMac.mm:
566         (WebCore::getScreenProperties):
567         (WebCore::screenProperties):
568         (WebCore::setScreenProperties):
569         (WebCore::screenRect):
570         (WebCore::screenAvailableRect):
571         * platform/ScreenProperties.h: Added.
572         (WebCore::ScreenProperties::encode const):
573         (WebCore::ScreenProperties::decode):
574
575 2018-02-21  Christopher Reid  <chris.reid@sony.com>
576
577         [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
578         https://bugs.webkit.org/show_bug.cgi?id=182751
579
580         Reviewed by Youenn Fablet.
581
582         No change in behavior.
583
584         Adding support to set a custom CookieJar Database.
585         Took CookieJarDB::open() out of its constructor because both the Network and Web process
586         were trying to open the journal files but one process was failing due to a lack of permission.
587         Now the database file is lazily opened and only the Network process will try to open the database.
588         Some cleanup was done to CookieJarDB too.
589
590         * platform/network/NetworkStorageSession.h:
591         * platform/network/curl/CookieJarDB.cpp:
592         * platform/network/curl/CookieJarDB.h:
593         * platform/network/curl/NetworkStorageSessionCurl.cpp:
594
595 2018-02-21  Chris Dumez  <cdumez@apple.com>
596
597         Regression(r228708): Crash under WebCore::MediaResource::responseReceived(WebCore::CachedResource&, WebCore::ResourceResponse const&)
598         https://bugs.webkit.org/show_bug.cgi?id=183018
599         <rdar://problem/37754154>
600
601         Reviewed by Eric Carlson.
602
603         The fix at r228708 was trying to address the fact that avplayer sometimes
604         deallocates WebCoreNSURLSessionDataTask objects on a non-main thread, which
605         was not safe because its _resource data member needs to be deallocated on
606         the main thread.
607
608         The issue is that r228708 caused _resource to outlive its WebCoreNSURLSessionDataTask.
609         This is an issue because _resource has a client data member (of type WebCoreNSURLSessionDataTaskClient)
610         which has a raw pointer to the WebCoreNSURLSessionDataTask. This means that the main thread could
611         call methods like responseReceived() on the resource, which would call responseReceived() on the
612         client, which would try to call [WebCoreNSURLSessionDataTask receivedResponse:] with an invalid
613         m_task pointer.
614
615         To address the issue, I introduced a clearTask() method on WebCoreNSURLSessionDataTaskClient, which
616         gets called from a non-main thread to clear the client's m_task pointer when the task is destroyed
617         on a non-main thread. So that this is safe, every time the client tries to use m_task, we now
618         acquire a lock for thread-safety and do a null-check on m_task.
619
620         No new tests, no known reproduction case.
621
622         * platform/graphics/PlatformMediaResourceLoader.h:
623         (WebCore::PlatformMediaResource::client):
624         * platform/network/cocoa/WebCoreNSURLSession.mm:
625         (WebCore::WebCoreNSURLSessionDataTaskClient::clearTask):
626         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
627         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
628         (WebCore::WebCoreNSURLSessionDataTaskClient::shouldCacheResponse):
629         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
630         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
631         (WebCore::WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed):
632         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFailed):
633         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished):
634         (-[WebCoreNSURLSessionDataTask dealloc]):
635
636 2018-02-21  Youenn Fablet  <youenn@apple.com>
637
638         Move AppCache loading to the NetworkProcess
639         https://bugs.webkit.org/show_bug.cgi?id=178540
640         <rdar://problem/37119346>
641
642         Reviewed by Alex Christensen.
643
644         Covered by existing tests.
645
646         Use ApplicationResourceLoader for cache entry loading.
647         Remove all ResourceHandle use from ApplicationCacheGroup.
648         Renamed m_loader in m_manifestLoader and added a new m_entryLoader to load cache entries.
649
650         Updated ApplicationCacheResourceLoader to handle different types of CachedResource.
651         This allows in particular to handle redirections based on the resource type and create the ApplicationCacheResource with the right type.
652         Use Include as credentials mode as per specification.
653
654         Add a new ApplicationCache ResourceResonse::Source.
655         This allows fixing an assertion and should allow better inspector support if needs be.
656
657         * inspector/agents/InspectorNetworkAgent.cpp:
658         (WebCore::responseSource):
659         * loader/ResourceLoader.cpp:
660         (WebCore::logResourceResponseSource):
661         * loader/SubstituteResource.h:
662         (WebCore::SubstituteResource::resourceResponse):
663         * loader/appcache/ApplicationCacheGroup.cpp:
664         (WebCore::ApplicationCacheGroup::stopLoading):
665         (WebCore::ApplicationCacheGroup::update):
666         (WebCore::ApplicationCacheGroup::didFinishLoading):
667         (WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
668         (WebCore::ApplicationCacheGroup::didFail):
669         (WebCore::ApplicationCacheGroup::didFailLoadingEntry):
670         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
671         (WebCore::ApplicationCacheGroup::startLoadingEntry):
672         * loader/appcache/ApplicationCacheGroup.h:
673         * loader/appcache/ApplicationCacheResource.cpp:
674         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
675         * loader/appcache/ApplicationCacheResourceLoader.cpp:
676         (WebCore::ApplicationCacheResourceLoader::create):
677         (WebCore::ApplicationCacheResourceLoader::ApplicationCacheResourceLoader):
678         (WebCore::ApplicationCacheResourceLoader::responseReceived):
679         (WebCore::ApplicationCacheResourceLoader::redirectReceived):
680         * loader/appcache/ApplicationCacheResourceLoader.h:
681         * platform/network/ResourceResponseBase.h:
682         * platform/network/cocoa/ResourceResponseCocoa.mm:
683         (WebCore::ResourceResponse::platformCertificateInfo const):
684         * testing/Internals.cpp:
685         (WebCore::responseSourceToString):
686
687 2018-02-21  Zalan Bujtas  <zalan@apple.com>
688
689         [RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to RenderTreeBuilder
690         https://bugs.webkit.org/show_bug.cgi?id=183014
691         <rdar://problem/37757428>
692
693         Reviewed by Antti Koivisto.
694
695         No change in functionality.
696
697         * Sources.txt:
698         * WebCore.xcodeproj/project.pbxproj:
699         * rendering/RenderBoxModelObject.cpp:
700         (WebCore::RenderBoxModelObject::~RenderBoxModelObject):
701         (WebCore::RenderBoxModelObject::willBeDestroyed):
702         (WebCore::RenderBoxModelObject::continuationChainNode const):
703         (): Deleted.
704         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): Deleted.
705         * rendering/RenderBoxModelObject.h:
706         * rendering/updating/RenderTreeBuilder.cpp:
707         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
708         (WebCore::RenderTreeBuilder::removeAndDestroy):
709         * rendering/updating/RenderTreeBuilder.h:
710         (WebCore::RenderTreeBuilder::continuationBuilder):
711         * rendering/updating/RenderTreeBuilderContinuation.cpp: Added.
712         (WebCore::RenderTreeBuilder::Continuation::Continuation):
713         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
714         * rendering/updating/RenderTreeBuilderContinuation.h: Added.
715
716 2018-02-21  Youenn Fablet  <youenn@apple.com>
717
718         ServiceWorkerJob::m_lastResponse is unneeded
719         https://bugs.webkit.org/show_bug.cgi?id=183013
720
721         Reviewed by Chris Dumez.
722
723         Remove this field since not used anywhere.
724
725         * workers/service/ServiceWorkerJob.cpp:
726         (WebCore::ServiceWorkerJob::didReceiveResponse):
727         * workers/service/ServiceWorkerJob.h:
728
729 2018-02-21  Youenn Fablet  <youenn@apple.com>
730
731         Use ResourceLoader to load appcache manifest
732         https://bugs.webkit.org/show_bug.cgi?id=182861
733
734         Reviewed by Alex Christensen.
735
736         Covered by updated tests.
737
738         Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
739         Make use of it to load the app cache manifest.
740         Future work should load entries using the same loader.
741
742         Remove manifest handle.
743         Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
744         is handled by its ApplicationCacheGroup.
745
746         Add a ResourceLoader option to bypass the application cache.
747         Use it for manifest loading.
748
749         * Sources.txt:
750         * WebCore.xcodeproj/project.pbxproj:
751         * loader/DocumentLoader.cpp:
752         (WebCore::DocumentLoader::addSubresourceLoader):
753         * loader/ResourceLoaderOptions.h:
754         * loader/appcache/ApplicationCacheGroup.cpp:
755         (WebCore::ApplicationCacheGroup::stopLoading):
756         (WebCore::ApplicationCacheGroup::update):
757         (WebCore::ApplicationCacheGroup::createRequest):
758         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
759         (WebCore::ApplicationCacheGroup::didReceiveData):
760         (WebCore::ApplicationCacheGroup::didFinishLoading):
761         (WebCore::ApplicationCacheGroup::didFail):
762         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
763         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
764         * loader/appcache/ApplicationCacheGroup.h:
765         * loader/appcache/ApplicationCacheHost.cpp:
766         (WebCore::ApplicationCacheHost::maybeLoadResource):
767         (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
768         (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
769         (WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
770         * loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
771         * loader/appcache/ApplicationCacheResourceLoader.h: Added.
772
773 2018-02-21  Don Olmstead  <don.olmstead@sony.com>
774
775         [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
776         https://bugs.webkit.org/show_bug.cgi?id=182883
777
778         Reviewed by Per Arne Vollan.
779
780         No new tests. No change in behavior.
781
782         * WebCorePrefix.h:
783         * config.h:
784         * testing/js/WebCoreTestSupportPrefix.h:
785
786 2018-02-21  Zalan Bujtas  <zalan@apple.com>
787
788         [RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder
789         https://bugs.webkit.org/show_bug.cgi?id=183009
790
791         Reviewed by Antti Koivisto.
792
793         No change in functionality.
794
795         * dom/Document.cpp:
796         (WebCore::Document::destroyRenderTree):
797         * rendering/RenderView.cpp:
798         (WebCore::RenderView::~RenderView):
799         (WebCore::RenderView::willBeDestroyed): Deleted.
800         * rendering/RenderView.h:
801
802 2018-02-21  Michael Catanzaro  <mcatanzaro@igalia.com>
803
804         [GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower
805         https://bugs.webkit.org/show_bug.cgi?id=181825
806
807         Reviewed by Carlos Garcia Campos.
808
809         We could fix this crash, but that would not be good enough, because upower-glib is a
810         synchronous API that wraps D-Bus calls. That's not acceptable for use in the web process.
811         Rewrite LowPowerModeNotifierGLib to use upower's D-Bus API directly, instead.
812
813         Note that this also enables LowPowerModeNotifier for WPE, since the USE(UPOWER) build
814         flag is no longer needed.
815
816         * platform/LowPowerModeNotifier.cpp:
817         * platform/LowPowerModeNotifier.h:
818         * platform/glib/LowPowerModeNotifierGLib.cpp:
819         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
820         (WebCore::LowPowerModeNotifier::updateWarningLevel):
821         (WebCore::LowPowerModeNotifier::warningLevelChanged):
822         (WebCore::LowPowerModeNotifier::gPropertiesChangedCallback):
823         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
824         (WebCore::LowPowerModeNotifier::updateState): Deleted.
825         (WebCore::LowPowerModeNotifier::warningLevelCallback): Deleted.
826
827 2018-02-21  Chris Dumez  <cdumez@apple.com>
828
829         VTTCue constructor should use 'double' type for startTime / endTime
830         https://bugs.webkit.org/show_bug.cgi?id=182988
831
832         Reviewed by Eric Carlson.
833
834         VTTCue constructor should use 'double' type for startTime / endTime, not
835         'unrestricted double':
836         - https://w3c.github.io/webvtt/#the-vttcue-interface
837
838         Otherwise, we end up potentially returning NaN for TextTrackCue.startTime / endTime,
839         even though those correctly use type 'double':
840         - https://html.spec.whatwg.org/multipage/media.html#texttrackcue
841
842         The new behavior is consistent with Firefox and Chrome.
843
844         No new tests, updated existing test.
845
846         * bindings/js/JSDOMConvertNumbers.h:
847         (WebCore::JSConverter<IDLDouble>::convert):
848         Add assertion to make sure our implementation never tries to return NaN
849         for an IDL attribute of type 'double'. This would be invalid as per Web
850         IDL spec and would crash if the NaN being returned was impure as JSValue
851         could not store it as a double.
852
853         * html/track/VTTCue.idl:
854         Update constructor parameters to use 'double' type instead of 'unrestricted
855         double', as per:
856         - https://w3c.github.io/webvtt/#the-vttcue-interface
857
858 2018-02-21  Zalan Bujtas  <zalan@apple.com>
859
860         [RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to RenderTreeBuilder
861         https://bugs.webkit.org/show_bug.cgi?id=182946
862         <rdar://problem/37690039>
863
864         Reviewed by Antti Koivisto.
865
866         No change in functionality.
867
868         * rendering/RenderTextFragment.cpp:
869         (WebCore::RenderTextFragment::willBeDestroyed):
870         * rendering/updating/RenderTreeBuilder.cpp:
871         (WebCore::RenderTreeBuilder::takeChild):
872         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
873         (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnRemoval):
874         * rendering/updating/RenderTreeBuilderFirstLetter.h:
875
876 2018-02-21  Ms2ger  <Ms2ger@igalia.com>
877
878         [GCrypt] Remove unsound assertion from CryptoKeyRSA::exportData().
879         https://bugs.webkit.org/show_bug.cgi?id=183001
880
881         Reviewed by Philippe Normand.
882
883         This function is called from structured cloning, in particular when storing
884         a key in IndexedDB. This would trip the assertion if the key in question is
885         non-exportable.
886
887         The assertion was copied from the macOS implementation in r172389; it was
888         subsequently removed there in r172898 to handle this case.
889
890         Test: crypto/subtle/rsa-indexeddb-non-exportable.html
891
892         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
893         (WebCore::CryptoKeyRSA::exportData const): remove assertion.
894
895 2018-02-21  Myles C. Maxfield  <mmaxfield@apple.com>
896
897         [Cocoa] Make system-ui obey the user-installed-font policy
898         https://bugs.webkit.org/show_bug.cgi?id=182860
899         <rdar://problem/36158249>
900
901         Reviewed by Antti Koivisto.
902
903         We have a completely different codepath for system-ui which makes it follow the system's
904         font cascade list. This codepath (along with all the other relevant places which create
905         system fonts) needs to obey the AllowUserInstalledFonts enum. This patch is fairly
906         mechanical; we simply are hooking up the flag across SystemFontDatabase.
907
908         There are a few places which creates system fonts which this patch doesn't touch. This is
909         not a problem because all the remaining places either:
910         1) Simply pull out some attributes of the font (name, weight, size, etc.) and then throw
911         away the font object itself, or
912         2) Use the font in an environment where script cannot access the characters rendered (such
913         as DragImages or the fullscreen placeholder view or the inside of the attachment element).
914
915         Test: fast/text/user-installed-fonts/system-ui.html
916
917         * platform/graphics/cocoa/FontCacheCoreText.cpp:
918         (WebCore::FontDatabase::collectionForFamily):
919         (WebCore::FontDatabase::fontForPostScriptName):
920         (WebCore::fontWithFamily):
921         (WebCore::installedFontMandatoryAttributes):
922         (WebCore::createSpecificFontForInstalledFonts):
923         * platform/graphics/cocoa/FontCacheCoreText.h:
924         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
925         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const):
926         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const):
927         (WebCore::SystemFontDatabase::systemFontCascadeList):
928         (WebCore::SystemFontDatabase::removeCascadeList):
929         (WebCore::SystemFontDatabase::computeCascadeList):
930         (WebCore::systemFontParameters):
931         (WebCore::systemFontCascadeList):
932         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
933         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
934         * platform/graphics/ios/FontCacheIOS.mm:
935         (WebCore::platformFontWithFamilySpecialCase):
936         * platform/graphics/mac/FontCacheMac.mm:
937         (WebCore::platformFontWithFamilySpecialCase):
938
939 2018-02-21  Chris Dumez  <cdumez@apple.com>
940
941         Unreviewed attempt to fix build after r228867.
942
943         * Modules/webvr/VRStageParameters.cpp:
944
945 2018-02-21  Philippe Normand  <pnormand@igalia.com>
946
947         [GStreamer] Rewrite purgeInvalid*Tracks methods
948         https://bugs.webkit.org/show_bug.cgi?id=183004
949
950         Reviewed by Carlos Garcia Campos.
951
952         Removing items from a hashmap while iterating is bad.
953
954         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
955         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks):
956         Safely remove items from the hashmap using removeIf().
957         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
958         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
959
960 2018-02-21  Chris Dumez  <cdumez@apple.com>
961
962         Unreviewed attempt to fix build after r228867.
963
964         * Modules/webvr/VRStageParameters.cpp:
965
966 2018-02-21  Philippe Normand  <pnormand@igalia.com>
967
968         [GStreamer] Crash in Debug build when purging invalid tracks
969         https://bugs.webkit.org/show_bug.cgi?id=182997
970
971         Reviewed by Xabier Rodriguez-Calvar.
972
973         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
974         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Clear the hashmap when there is no valid track left.
975         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
976         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
977         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
978         (WebCore::TrackPrivateBaseGStreamer::getLanguageCode): Demote debugging, this appears too much at least with playbin2.
979         (WebCore::TrackPrivateBaseGStreamer::getTag): Ditto.
980
981 2018-02-21  Philippe Normand  <pnormand@igalia.com>
982
983         [GStreamer] We need to adopt GstGlDisplays after GStreamer 1.13.1
984         https://bugs.webkit.org/show_bug.cgi?id=182996
985
986         Reviewed by Xabier Rodriguez-Calvar.
987
988         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
989         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
990         Adopt references when running with GStreamer 1.13.1 to avoid
991         memory leaks.
992
993 2018-02-20  Philippe Normand  <pnormand@igalia.com>
994
995         [GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html failing since r228617
996         https://bugs.webkit.org/show_bug.cgi?id=160131
997         <rdar://problem/35873985>
998
999         Reviewed by Michael Catanzaro.
1000
1001         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1002         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): We
1003         can't assume the pad has a sticky event here like implemented in
1004         InbandTextTrackPrivateGStreamer because it might be emitted after
1005         the track was created. So fallback to a dummy stream ID like in
1006         the Audio and Video tracks.
1007
1008 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
1009
1010         [WebVR][OpenVR] Retrieve stage parameters
1011         https://bugs.webkit.org/show_bug.cgi?id=182976
1012
1013         Reviewed by Žan Doberšek.
1014
1015         Use OpenVR to retrieve stage parameters, i.e., play area size and
1016         the transformation from sitting to standing position. It includes
1017         the same fallback used by Firefox to provide sensible values in case
1018         we cannot get the required information from the VR SDK (it's quite
1019         common not to have defined a play area).
1020
1021         * Modules/webvr/VRDisplay.cpp:
1022         (WebCore::VRDisplay::stageParameters const):
1023         * Modules/webvr/VRDisplay.h:
1024         * Modules/webvr/VRStageParameters.cpp:
1025         (WebCore::VRStageParameters::VRStageParameters):
1026         (WebCore::VRStageParameters::sittingToStandingTransform const):
1027         (WebCore::VRStageParameters::sizeX const):
1028         (WebCore::VRStageParameters::sizeZ const):
1029         * Modules/webvr/VRStageParameters.h:
1030         (WebCore::VRStageParameters::create):
1031         * platform/vr/VRPlatformDisplay.h:
1032         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
1033         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
1034         (WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
1035         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
1036
1037 2018-02-21  Philippe Normand  <pnormand@igalia.com>
1038
1039         [GStreamer] Create a Wayland GL display instead of EGL
1040         https://bugs.webkit.org/show_bug.cgi?id=182968
1041
1042         Reviewed by Xabier Rodriguez-Calvar.
1043
1044         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1045         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1046         Add logging and instantiate a GstDisplayWayland display instead of
1047         an EGL display when running under a Wayland compositor.
1048
1049 2018-02-21  Zalan Bujtas  <zalan@apple.com>
1050
1051         [RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder
1052         https://bugs.webkit.org/show_bug.cgi?id=182947
1053         <rdar://problem/37690848>
1054
1055         Reviewed by Antti Koivisto.
1056
1057         No change in functionality.
1058
1059         * Sources.txt:
1060         * WebCore.xcodeproj/project.pbxproj:
1061         * rendering/RenderFullScreen.cpp:
1062         (WebCore::RenderFullScreen::willBeDestroyed):
1063         * rendering/updating/RenderTreeBuilder.cpp:
1064         (WebCore::RenderTreeBuilder::takeChild):
1065         * rendering/updating/RenderTreeBuilder.h:
1066         (WebCore::RenderTreeBuilder::fullScreenBuilder):
1067         * rendering/updating/RenderTreeBuilderFullScreen.cpp: Added.
1068         (WebCore::RenderTreeBuilder::FullScreen::FullScreen):
1069         (WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval):
1070         * rendering/updating/RenderTreeBuilderFullScreen.h: Added.
1071         * rendering/updating/RenderTreeBuilderMathML.cpp:
1072
1073 2018-02-20  Zalan Bujtas  <zalan@apple.com>
1074
1075         [RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder
1076         https://bugs.webkit.org/show_bug.cgi?id=182943
1077         <rdar://problem/37689029>
1078
1079         Reviewed by Antti Koivisto.
1080
1081         We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted
1082         in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is
1083         the RenderListItem's descendent). 
1084
1085         Covered by existing tests.
1086
1087         * rendering/RenderListItem.cpp:
1088         (WebCore::RenderListItem::~RenderListItem):
1089         (WebCore::RenderListItem::willBeDestroyed): Deleted.
1090         * rendering/RenderListItem.h:
1091
1092 2018-02-20  Nan Wang  <n_wang@apple.com>
1093
1094         AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
1095         https://bugs.webkit.org/show_bug.cgi?id=182752
1096         <rdar://problem/37518233>
1097
1098         Reviewed by Ryosuke Niwa.
1099
1100         Call the assistive technology specific method for becoming first responder.
1101
1102         Test: accessibility/mac/accessibility-make-first-responder.html
1103
1104         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1105         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1106         * page/ChromeClient.h:
1107
1108 2018-02-20  Tim Horton  <timothy_horton@apple.com>
1109
1110         Introduce HAVE(IOSURFACE_ACCELERATOR)
1111         https://bugs.webkit.org/show_bug.cgi?id=182955
1112         <rdar://problem/37699510>
1113
1114         Reviewed by Sam Weinig.
1115
1116         No new tests, no change in behavior.
1117
1118         Introduce HAVE(IOSURFACE_ACCELERATOR) and guard all uses of
1119         IOSurfaceAccelerator behind it.
1120
1121         Rename USE(IOSURFACE) to HAVE(IOSURFACE) for accuracy.
1122
1123         * page/cocoa/MemoryReleaseCocoa.mm:
1124         * platform/graphics/ca/TileController.cpp:
1125         * platform/graphics/cg/IOSurfacePool.cpp:
1126         * platform/graphics/cg/IOSurfacePool.h:
1127         * platform/graphics/cg/ImageBufferCG.cpp:
1128         * platform/graphics/cocoa/IOSurface.h:
1129         * platform/graphics/cocoa/IOSurface.mm:
1130         * platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
1131         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1132         * platform/graphics/cv/VideoTextureCopierCV.h:
1133
1134 2018-02-20  Chris Dumez  <cdumez@apple.com>
1135
1136         Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
1137         https://bugs.webkit.org/show_bug.cgi?id=182720
1138         <rdar://problem/37515204>
1139
1140         Reviewed by Alex Christensen.
1141
1142         Wait for the policy response from the client after receiving a resource response,
1143         before sending the NetworkResourceLoader::ContinueDidReceiveResponse IPC back to
1144         the NetworkProcess. Otherwise, the network process may start sending us data and
1145         we may end up committing the provisional load before receiving the policy decision
1146         fron the client.
1147
1148         Change is covered by new API test.
1149
1150         * loader/DocumentLoader.cpp:
1151         (WebCore::DocumentLoader::responseReceived):
1152         * loader/NetscapePlugInStreamLoader.cpp:
1153         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
1154         * loader/NetscapePlugInStreamLoader.h:
1155         * loader/ResourceLoader.cpp:
1156         (WebCore::ResourceLoader::deliverResponseAndData):
1157         (WebCore::ResourceLoader::loadDataURL):
1158         (WebCore::ResourceLoader::didReceiveResponse):
1159         (WebCore::ResourceLoader::didReceiveResponseAsync):
1160         * loader/ResourceLoader.h:
1161         * loader/SubresourceLoader.cpp:
1162         (WebCore::SubresourceLoader::didReceiveResponse):
1163         (WebCore::SubresourceLoader::didReceiveResponsePolicy):
1164         (WebCore::SubresourceLoader::willCancel):
1165         * loader/SubresourceLoader.h:
1166         * loader/ios/PreviewLoader.mm:
1167         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
1168
1169 2018-02-20  Chris Dumez  <cdumez@apple.com>
1170
1171         Crash under JSC::JSCell::toNumber(JSC::ExecState*)
1172         https://bugs.webkit.org/show_bug.cgi?id=182984
1173         <rdar://problem/37694346>
1174
1175         Reviewed by Mark Lam.
1176
1177         The issue was caused by DOMMatrix attributes potentially returning "impure"
1178         NaN values. We would call JSC::jsNumber(double) to construct the JSValue
1179         but this is only safe for pure NaN values. Make sure we purify the double
1180         returned by the implementation for IDL attributes of type 'unrestricted double'
1181         before calling JSC::jsNumber(double).
1182
1183         No new tests, extended existing test.
1184
1185         * bindings/js/JSDOMConvertNumbers.h:
1186         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
1187         * testing/TypeConversions.h:
1188         (WebCore::TypeConversions::testImpureNaNUnrestrictedDouble const):
1189         (WebCore::TypeConversions::testImpureNaN2UnrestrictedDouble const):
1190         (WebCore::TypeConversions::testQuietNaNUnrestrictedDouble const):
1191         * testing/TypeConversions.idl:
1192
1193 2018-02-20  Tim Horton  <timothy_horton@apple.com>
1194
1195         Make more use of USE(OPENGL_ES) where it makes sense
1196         https://bugs.webkit.org/show_bug.cgi?id=182957
1197         <rdar://problem/37699443>
1198
1199         Reviewed by Dan Bernstein.
1200
1201         No new tests, no behavior change.
1202
1203         Make use of USE(OPENGL_ES) for CoreVideo functions that differ based
1204         on GL availability. Also adjust GraphicsContext3D in the same way.
1205
1206         * platform/cocoa/CoreVideoSoftLink.cpp:
1207         * platform/cocoa/CoreVideoSoftLink.h:
1208         * platform/graphics/GraphicsContext3D.h:
1209         * platform/graphics/cv/TextureCacheCV.mm:
1210         (WebCore::TextureCacheCV::create):
1211         (WebCore::TextureCacheCV::textureFromImage):
1212         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1213         (WebCore::enumToStringMap):
1214         (WebCore::VideoTextureCopierCV::initializeContextObjects):
1215         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
1216         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
1217         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
1218
1219 2018-02-20  Nan Wang  <n_wang@apple.com>
1220
1221         AX: AOM: Dispatch accessibleclick event
1222         https://bugs.webkit.org/show_bug.cgi?id=180898
1223         <rdar://problem/36086710>
1224
1225         Reviewed by Ryosuke Niwa.
1226
1227         Accessibility events.
1228         Spec: https://wicg.github.io/aom/spec/phase2.html
1229
1230         This patch allows developers to register event handlers on Elements
1231         for custom accessibility events.
1232
1233         Accessibility events go through a capturing and bubbling phase just
1234         like DOM events, but in the accessibility tree.
1235
1236         Implemented "accessibleclick" event.
1237
1238         Test: accessibility/mac/AOM-events.html
1239
1240         * accessibility/AccessibilityObject.cpp:
1241         (WebCore::AccessibilityObject::press):
1242         (WebCore::AccessibilityObject::dispatchAccessibilityEvent):
1243         * accessibility/AccessibilityObject.h:
1244         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1245         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
1246         * dom/Element.idl:
1247         * dom/EventDispatcher.cpp:
1248         (WebCore::dispatchEventWithType):
1249         (WebCore::EventDispatcher::dispatchEvent):
1250         * dom/EventDispatcher.h:
1251         * dom/EventNames.h:
1252         * dom/EventPath.cpp:
1253         (WebCore::EventPath::EventPath):
1254         * dom/EventPath.h:
1255
1256 2018-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1257
1258         [iOS 11.3 Beta] Can't copy a URL from Safari and paste it into the Gmail app
1259         https://bugs.webkit.org/show_bug.cgi?id=182952
1260         <rdar://problem/37636190>
1261
1262         Reviewed by Tim Horton.
1263
1264         After r220865 refactored the iOS copy codepaths to use NSItemProviders, we stopped writing the URL as plain text
1265         to the pasteboard. However, this means clients that only check for "text/plain" (or one of its aliases) on the
1266         pasteboard won't read any data on paste.
1267
1268         To fix this, we restore the pre-iOS 11.3 behavior of writing both the URL and plain text to the pasteboard.
1269         Since we're using item providers, we also ensure that the NSURL is at a higher fidelity than the string to make
1270         it clear that the data should be consumed as a URL.
1271
1272         This patch also rebaselines an existing drag and drop test to cover this change, and adds a new API test,
1273         ActionSheetTests.CopyLinkWritesURLAndPlainText, which simulates copying a link using the share sheet and pasting
1274         into a DataTransfer-dumping test harness.
1275
1276         * platform/ios/PlatformPasteboardIOS.mm:
1277         (WebCore::PlatformPasteboard::write):
1278
1279 2018-02-20  Eric Carlson  <eric.carlson@apple.com>
1280
1281         [iOS] Returning from Auto-PiP causes Safari to be unresponsive
1282         https://bugs.webkit.org/show_bug.cgi?id=182977
1283         <rdar://problem/37685981>
1284
1285         Reviewed by Jer Noble.
1286
1287         Remove the error handling added in r228115, it breaks auto-pip.
1288
1289         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1290         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
1291         (VideoFullscreenInterfaceAVKit::enterFullscreenStandard):
1292         (VideoFullscreenInterfaceAVKit::exitFullscreen):
1293         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
1294         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1295         (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
1296         (VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
1297         (VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
1298
1299 2018-02-20  Jer Noble  <jer.noble@apple.com>
1300
1301         [EME] Adopt new AVContentKeySession success delegate callback
1302         https://bugs.webkit.org/show_bug.cgi?id=182974
1303         <rdar://problem/36079035>
1304
1305         Reviewed by Eric Carlson.
1306
1307         Store the updateLicenseCallback if the new protocol method is present and supported.
1308
1309         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1310         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1311         (-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequestDidSucceed:]):
1312         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
1313         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
1314         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
1315
1316 2018-02-19  Dean Jackson  <dino@apple.com>
1317
1318         Handle all writing-modes in downcast
1319         https://bugs.webkit.org/show_bug.cgi?id=182949
1320         <rdar://problem/37710687>
1321
1322         Reviewed by Myles Maxfield.
1323
1324         It appears we forgot to handle the deprecated "lr"
1325         writing-mode value.
1326
1327         Test: fast/writing-mode/svg-writing-modes.html
1328
1329         * css/CSSPrimitiveValueMappings.h:
1330         (WebCore::CSSPrimitiveValue::operator WritingMode const):
1331
1332 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
1333
1334         [Cairo] Drop target GraphicsContext usage in Cairo operations
1335         https://bugs.webkit.org/show_bug.cgi?id=182964
1336
1337         Reviewed by Carlos Garcia Campos.
1338
1339         The GraphicsContext parameters in various Cairo operations are not used
1340         anymore, so they can be removed. Callsites are updated to reflect this.
1341
1342         * platform/graphics/cairo/CairoOperations.cpp:
1343         (WebCore::Cairo::drawShadowLayerBuffer):
1344         (WebCore::Cairo::fillShadowBuffer):
1345         (WebCore::Cairo::drawPathShadow):
1346         (WebCore::Cairo::drawGlyphsShadow):
1347         (WebCore::Cairo::fillRect):
1348         (WebCore::Cairo::fillRoundedRect):
1349         (WebCore::Cairo::fillRectWithRoundedHole):
1350         (WebCore::Cairo::fillPath):
1351         (WebCore::Cairo::strokeRect):
1352         (WebCore::Cairo::strokePath):
1353         (WebCore::Cairo::drawGlyphs):
1354         (WebCore::Cairo::drawNativeImage):
1355         (WebCore::Cairo::drawSurface):
1356         * platform/graphics/cairo/CairoOperations.h:
1357         * platform/graphics/cairo/FontCairo.cpp:
1358         (WebCore::FontCascade::drawGlyphs):
1359         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1360         (WebCore::GraphicsContext::drawNativeImage):
1361         (WebCore::GraphicsContext::fillPath):
1362         (WebCore::GraphicsContext::strokePath):
1363         (WebCore::GraphicsContext::fillRect):
1364         (WebCore::GraphicsContext::strokeRect):
1365         (WebCore::GraphicsContext::platformFillRoundedRect):
1366         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1367         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
1368         (WebCore::GraphicsContextImplCairo::fillRect):
1369         (WebCore::GraphicsContextImplCairo::fillRoundedRect):
1370         (WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
1371         (WebCore::GraphicsContextImplCairo::fillPath):
1372         (WebCore::GraphicsContextImplCairo::strokeRect):
1373         (WebCore::GraphicsContextImplCairo::strokePath):
1374         (WebCore::GraphicsContextImplCairo::drawGlyphs):
1375         (WebCore::GraphicsContextImplCairo::drawNativeImage):
1376         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1377         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
1378
1379 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
1380
1381         [WebVR][OpenVR] Retrieve eye parameters and field of view
1382         https://bugs.webkit.org/show_bug.cgi?id=182962
1383
1384         Reviewed by Žan Doberšek.
1385
1386         Get the required data from OpenVR to fill in the VREyeParameters and
1387         the VRFieldOfView objects.
1388
1389         * Modules/webvr/VRDisplay.cpp: Create some attributes in the
1390         body of the constructor instead in the member initialization list to
1391         avoid calling getDisplayInfo() multiple times.
1392         (WebCore::VRDisplay::VRDisplay):
1393         (WebCore::VRDisplay::capabilities const):
1394         (WebCore::VRDisplay::getEyeParameters const):
1395         * Modules/webvr/VRDisplay.h:
1396         * Modules/webvr/VREyeParameters.cpp:
1397         (WebCore::VREyeParameters::VREyeParameters): Added new attributes to
1398         the constructor.
1399         (WebCore::VREyeParameters::offset const): Return a Ref instead of
1400         a raw pointer.
1401         (WebCore::VREyeParameters::renderWidth const):
1402         (WebCore::VREyeParameters::renderHeight const):
1403         * Modules/webvr/VREyeParameters.h:
1404         (WebCore::VREyeParameters::create):
1405         * Modules/webvr/VRFieldOfView.cpp: Removed. All the impletementation
1406         fits perfectly in the header file.
1407         * Modules/webvr/VRFieldOfView.h:
1408         (WebCore::VRFieldOfView::create):
1409         (WebCore::VRFieldOfView::upDegrees const):
1410         (WebCore::VRFieldOfView::rightDegrees const):
1411         (WebCore::VRFieldOfView::downDegrees const):
1412         (WebCore::VRFieldOfView::leftDegrees const):
1413         (WebCore::VRFieldOfView::VRFieldOfView):
1414         * Sources.txt:
1415         * platform/vr/VRPlatformDisplay.h: Added some more data to the
1416         VRPlatformDisplayInfo struct.
1417         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
1418         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
1419         (WebCore::VRPlatformDisplayOpenVR::computeFieldOfView): Computes the
1420         up/down/left/right FOV angles in degrees from the raw project
1421         values returned by OpenVR.
1422         (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters): Fills in
1423         the eye parameter info.
1424         (WebCore::VRPlatformDisplayOpenVR::~VRPlatformDisplayOpenVR):
1425         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
1426
1427 2018-02-20  Philippe Normand  <pnormand@igalia.com>
1428
1429         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
1430         https://bugs.webkit.org/show_bug.cgi?id=173655
1431
1432         Reviewed by Xabier Rodriguez-Calvar.
1433
1434         The FIXME in GStreamerUtilities.cpp asks to pass the command line
1435         parameters to the GStreamer initialization function.
1436
1437         Based on initial patch by: Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
1438
1439         * Modules/webaudio/AudioContext.cpp:
1440         (WebCore::AudioContext::constructCommon): Removes the call to the method
1441         that GStreamer initializes. It is no longer necessary.
1442         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1443         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Ditto
1444         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1445         (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Ditto
1446         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1447         (WebCore::initializeGStreamer): Receive the GStreamer options and initialize GStreamer.
1448         * platform/graphics/gstreamer/GStreamerUtilities.h: Add vector which contains
1449         GStreamer options as the input parameter of the initializeGStreamer() method.
1450
1451 2018-02-20  Miguel Gomez  <magomez@igalia.com>
1452
1453         [GTK] whatsapp web blurry in some parts, sharp on others
1454         https://bugs.webkit.org/show_bug.cgi?id=182673
1455
1456         Reviewed by Carlos Garcia Campos.
1457
1458         CoordinatedGraphicsLayer::createBackingStore() uses the scale factor returned by effectiveContentsScale(),
1459         which is always 1 if selfOrAncestorHaveNonAffineTransforms() returns true. But this fuction always returns
1460         true if the layer has an AnimatedPropertyTransform animation, which means that layers with those animations
1461         won't use the appropriate scale factor, causing blurry renderings.
1462
1463         This patch removes the animations check, so animated layers properly use the required scale factor.
1464
1465         No new tests, no behavior change.
1466
1467         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1468         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
1469
1470 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
1471
1472         [Cairo] Leverage ShadowBlur without using scratch buffer, target GraphicsContext
1473         https://bugs.webkit.org/show_bug.cgi?id=182958
1474
1475         Reviewed by Carlos Garcia Campos.
1476
1477         To allow ShadowBlur usage in different threads, avoid the ShadowBlur
1478         class using the scratch buffer internally. The current implementation of
1479         that scratch buffer is not thread-safe and its usage in such conditions
1480         can lead to crashes.
1481
1482         Instead, the new methods use a temporary ImageBuffer object for drawing.
1483         This does negate the efficiency of possibly reusing the scratch buffer,
1484         but at this point that is not yet the priority. This only affects ports
1485         using Cairo for drawing.
1486
1487         The added methods don't require a target GraphicsContext object to be
1488         passed in, instead they accept buffer draw callbacks that are invoked
1489         with the temporary ImageBuffer object containing the rasterized shadow,
1490         as well as position and size parameters. The CTM and clip bounds values
1491         also have to be passed in manually. In CairoOperations.cpp, the provided
1492         callbacks invoke commands that are equivalent in effect to those that
1493         would otherwise be invoked on the target GraphicsContext object in the
1494         ShadowBlur class.
1495
1496         For now, this approach has to avoid the tiling-based drawing of the
1497         rectangular shadows in drawRectShadow() and inset shadows in
1498         drawInsetShadow(), and instead stick to the non-tiling fallback. While
1499         only affecting Cairo-using ports, with some refactoring it should be
1500         possible to again leverage the tiling-based approach as well.
1501
1502         The beginShadowLayer() and endShadowLayer() functions, which are only
1503         used in CairoOperations.cpp, are replaced with the drawShadowLayer()
1504         method. This one accepts an additional callback that allows the caller
1505         to explicitly draw the shadow shape using the provided shadowing
1506         GraphicsContext object. As with the other two new methods, a temporary
1507         ImageBuffer object is used, and the buffer draw callback is invoked to
1508         allow caller to properly handle the shadowing output.
1509
1510         In CairoOperations.cpp, the new ShadowBlur methods are exercised, with
1511         direct Cairo operation invocation replacing the GraphicsContext calls
1512         otherwise done through ShadowBlur. ShadowState object now also has to
1513         track the global alpha and the global composite operator values so that
1514         it can properly rasterize the resulting shadow into the final image.
1515
1516         No new tests -- no change in behavior.
1517
1518         * platform/graphics/ShadowBlur.cpp:
1519         (WebCore::ShadowBlur::adjustBlurRadius):
1520         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1521         (WebCore::ShadowBlur::drawRectShadow):
1522         (WebCore::ShadowBlur::drawInsetShadow):
1523         (WebCore::ShadowBlur::drawShadowLayer):
1524         (WebCore::ShadowBlur::beginShadowLayer): Deleted.
1525         (WebCore::ShadowBlur::endShadowLayer): Deleted.
1526         * platform/graphics/ShadowBlur.h:
1527         * platform/graphics/cairo/CairoOperations.cpp:
1528         (WebCore::Cairo::drawShadowLayerBuffer):
1529         (WebCore::Cairo::fillShadowBuffer):
1530         (WebCore::Cairo::drawPathShadow):
1531         (WebCore::Cairo::drawGlyphsShadow):
1532         (WebCore::Cairo::ShadowState::ShadowState):
1533         (WebCore::Cairo::fillRect):
1534         (WebCore::Cairo::fillRoundedRect):
1535         (WebCore::Cairo::fillRectWithRoundedHole):
1536         (WebCore::Cairo::drawSurface):
1537         * platform/graphics/cairo/CairoOperations.h:
1538         Default-initialize FillSource::fillRule to RULE_NONZERO.
1539         * platform/graphics/cairo/PlatformContextCairo.h:
1540         Drop the ShadowBlur.h include, it's moved to CairoOperations.cpp.
1541         * rendering/RenderThemeGtk.cpp:
1542         Explicitly include the FloatRoundedRect.h header now that it's not
1543         included through the ShadowBlur.h header via PlatformContextCairo.h.
1544
1545 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
1546
1547         [WebVR] Use RuntimeEnabledFeatures to enable/disable WebVR
1548         https://bugs.webkit.org/show_bug.cgi?id=182961
1549
1550         Reviewed by Xabier Rodriguez-Calvar.
1551
1552         The shared feature was properly added to RuntimeEnabledFeatures some
1553         time ago but the code was instead using a private method in
1554         NavigatorWebVR to temporarily disable it. WebVR is enabled in
1555         WebPreferences.yaml for GTK+ & WPE as default experimental feature.
1556
1557         * Modules/webvr/NavigatorWebVR.cpp:
1558         (WebCore::NavigatorWebVR::getVRDisplays):
1559         (WebCore::NavigatorWebVR::vrEnabled): Deleted.
1560
1561 2018-02-19  Antti Koivisto  <antti@apple.com>
1562
1563         Use selector filter when invalidating descendants
1564         https://bugs.webkit.org/show_bug.cgi?id=182839
1565         <rdar://problem/37581072>
1566
1567         Reviewed by Zalan Bujtas.
1568
1569         We can make descendant invalidation faster by enabling filtering.
1570
1571         * css/SelectorFilter.cpp:
1572         (WebCore::SelectorFilter::initializeParentStack):
1573
1574             Traverse and reverse the ancestor chain, and push it.
1575
1576         (WebCore::SelectorFilter::pushParent):
1577         (WebCore::SelectorFilter::pushParentInitializingIfNeeded):
1578
1579             Add a version of pushParent that can initialize the stack.
1580
1581         (WebCore::SelectorFilter::popParent):
1582         (WebCore::SelectorFilter::popParentsUntil):
1583
1584             Pop until a given parent element.
1585
1586         (WebCore::SelectorFilter::pushParentStackFrame): Deleted.
1587         (WebCore::SelectorFilter::popParentStackFrame): Deleted.
1588
1589             These were the same as push/popParent.
1590
1591         * css/SelectorFilter.h:
1592         (WebCore::SelectorFilter::popParent): Deleted.
1593         * style/StyleInvalidator.cpp:
1594         (WebCore::Style::Invalidator::invalidateStyleForDescendants):
1595
1596             Use pushParentInitializingIfNeeded.
1597
1598         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
1599
1600             Use selector filter when doing descendant tree invalidation.
1601             Make sure to pop it until the parent when reusing.
1602
1603 2018-02-19  Fujii Hironori  <Hironori.Fujii@sony.com>
1604
1605         null m_lastNodeInserted dereference at ReplaceSelectionCommand::InsertedNodes::lastLeafInserted
1606         https://bugs.webkit.org/show_bug.cgi?id=161947
1607
1608         Reviewed by Ryosuke Niwa.
1609
1610         InsertedNodes happened to be empty if the inserted nodes were
1611         removed. Add more checks if InsertedNodes is empty.
1612
1613         No new tests (Covered by existing tests).
1614
1615         * editing/ReplaceSelectionCommand.cpp:
1616         (WebCore::ReplaceSelectionCommand::doApply): Return early if InsertedNodes becomes empty.
1617         * editing/ReplaceSelectionCommand.h:
1618         (WebCore::ReplaceSelectionCommand::InsertedNodes::isEmpty): New method.
1619         (WebCore::ReplaceSelectionCommand::InsertedNodes::lastLeafInserted const):
1620         Assert m_lastNodeInserted is not null.
1621         (WebCore::ReplaceSelectionCommand::InsertedNodes::pastLastLeaf const): Ditto.
1622
1623 2018-02-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
1624
1625         Add SVGPropertyTraits::fromString() to all the SVG animated types
1626         https://bugs.webkit.org/show_bug.cgi?id=182901
1627
1628         Reviewed by Dean Jackson.
1629
1630         This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
1631         goal is is to templatize the SVGAnimatedType class and to use SVGPropertyTraits
1632         methods inside the template functions.
1633
1634         * WebCore.xcodeproj/project.pbxproj: Move the enum and the SVGPropertyTraits
1635         from SVGMarkerElement.h to SVGMarkerTypes.h.
1636         * svg/SVGAngle.h:
1637         (WebCore::SVGAngle::SVGAngle): Delete unused constructor and create() method.
1638         * svg/SVGAngleValue.h:
1639         * svg/SVGAnimateMotionElement.cpp:
1640         (WebCore::parsePoint): Deleted. Move this function to SVGParserUtilities.cpp
1641         * svg/SVGAnimatedAngle.cpp:
1642         (WebCore::SVGAnimatedAngleAnimator::constructFromString): Use SVGPropertyTraits::fromString().
1643         * svg/SVGAnimatedBoolean.cpp:
1644         (WebCore::SVGAnimatedBooleanAnimator::constructFromString): Ditto.
1645         * svg/SVGAnimatedColor.cpp:
1646         (WebCore::SVGAnimatedColorAnimator::constructFromString): Ditto.
1647         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes): Use const.
1648         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue): Ditto.
1649         * svg/SVGAnimatedEnumeration.cpp:
1650         (WebCore::SVGAnimatedEnumerationAnimator::constructFromString): Ditto.
1651         * svg/SVGAnimatedInteger.cpp:
1652         (WebCore::SVGAnimatedIntegerAnimator::constructFromString): Ditto.
1653         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
1654         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString): Ditto.
1655         * svg/SVGAnimatedLength.cpp:
1656         * svg/SVGAnimatedLengthList.cpp:
1657         (WebCore::SVGAnimatedLengthListAnimator::constructFromString): Ditto.
1658         * svg/SVGAnimatedNumber.cpp:
1659         (WebCore::SVGAnimatedNumberAnimator::constructFromString): Ditto
1660         (WebCore::parseNumberFromString):
1661         * svg/SVGAnimatedNumberList.cpp:
1662         (WebCore::SVGAnimatedNumberListAnimator::constructFromString): Ditto.
1663         * svg/SVGAnimatedNumberOptionalNumber.cpp:
1664         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString): Ditto.
1665         * svg/SVGAnimatedPath.cpp:
1666         (WebCore::SVGAnimatedPathAnimator::constructFromString): Ditto.
1667         * svg/SVGAnimatedPointList.cpp:
1668         (WebCore::SVGAnimatedPointListAnimator::constructFromString): Ditto.
1669         * svg/SVGAnimatedPreserveAspectRatio.cpp:
1670         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString): Ditto.
1671         * svg/SVGAnimatedRect.cpp:
1672         (WebCore::SVGAnimatedRectAnimator::constructFromString): Ditto.
1673         * svg/SVGAnimatedString.cpp:
1674         (WebCore::SVGAnimatedStringAnimator::constructFromString): Ditto.
1675         * svg/SVGAnimatedTransformList.cpp:
1676         (WebCore::SVGAnimatedTransformListAnimator::constructFromString): Ditto.
1677         * svg/SVGLength.h:
1678         (WebCore::SVGLength::SVGLength): Delete unused constructor and create() method.
1679         * svg/SVGLengthListValues.h:
1680         (WebCore::SVGPropertyTraits<SVGLengthListValues>::fromString): New SVGPropertyTraits method.
1681         (WebCore::SVGPropertyTraits<SVGLengthListValues>::parse): Ditto.
1682         * svg/SVGMarkerElement.h:
1683         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue): Deleted.
1684         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString): Deleted.
1685         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString): Deleted.
1686         (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue): Deleted.
1687         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue): Deleted.
1688         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): Deleted.
1689         * svg/SVGMarkerTypes.h: Added.
1690         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue):
1691         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
1692         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString):
1693         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue):
1694         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
1695         (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue):
1696         * svg/SVGMatrix.h: Delete unused constructor and create method.
1697         * svg/SVGNumber.h:
1698         (WebCore::SVGNumber::SVGNumber): Ditto.
1699         * svg/SVGNumberListValues.h:
1700         (WebCore::SVGPropertyTraits<SVGNumberListValues>::fromString): New SVGPropertyTraits method.
1701         * svg/SVGParserUtilities.cpp:
1702         (WebCore::parsePoint): This is moved from SVGAnimateMotionElement.cpp
1703         * svg/SVGParserUtilities.h:
1704         * svg/SVGPathByteStream.h:
1705         (WebCore::SVGPathByteStream::SVGPathByteStream):
1706         (WebCore::SVGPathByteStream::operator=): Add copy and move assignment operators.
1707         (WebCore::SVGPathByteStream::copy const): Use the copy assignment.
1708         (WebCore::SVGPathByteStream::isEmpty const): Use Data.isEmpty().
1709         (WebCore::SVGPropertyTraits<SVGPathByteStream>::initialValue): New SVGPropertyTraits method.
1710         (WebCore::SVGPropertyTraits<SVGPathByteStream>::fromString): Ditto.
1711         * svg/SVGPathUtilities.cpp:
1712         (WebCore::addToSVGPathByteStream): Answer Simon's questions which were added in r190844.
1713         * svg/SVGPoint.h:
1714         (WebCore::SVGPoint::SVGPoint): Delete unused constructor and create method.
1715         * svg/SVGPointListValues.h:
1716         (WebCore::SVGPropertyTraits<SVGPointListValues>::fromString): New SVGPropertyTraits method.
1717         * svg/SVGPolyElement.cpp:
1718         (WebCore::SVGPolyElement::parseAttribute): Use the move assignment operator.
1719         * svg/SVGPreserveAspectRatio.h:
1720         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Delete unused constructor and create method.
1721         * svg/SVGPreserveAspectRatioValue.cpp:
1722         (WebCore::SVGPreserveAspectRatioValue::SVGPreserveAspectRatioValue): Add new constructor.
1723         * svg/SVGPreserveAspectRatioValue.h:
1724         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString): New SVGPropertyTraits method.
1725         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString): Ditto.
1726         * svg/SVGRect.h:
1727         (WebCore::SVGRect::SVGRect): Delete unused constructor and create method.
1728         * svg/SVGRectTraits.h: Removed.
1729         * svg/SVGTransform.h:
1730         (WebCore::SVGTransform::SVGTransform): Delete unused constructor and create method.
1731         * svg/SVGTransformListValues.h:
1732         (WebCore::SVGPropertyTraits<SVGTransformListValues>::fromString): New SVGPropertyTraits method.
1733         * svg/properties/SVGPropertyTearOff.h: Delete unused create method.
1734         * svg/properties/SVGPropertyTraits.h: New SVGPropertyTraits methods.
1735         (WebCore::SVGPropertyTraits<bool>::fromString): 
1736         (WebCore::SVGPropertyTraits<Color>::initialValue):
1737         (WebCore::SVGPropertyTraits<Color>::fromString):
1738         (WebCore::SVGPropertyTraits<Color>::parse):
1739         (WebCore::SVGPropertyTraits<Color>::toString):
1740         (WebCore::SVGPropertyTraits<int>::fromString):
1741         (WebCore::SVGPropertyTraits<float>::fromString):
1742         (WebCore::SVGPropertyTraits<float>::parse):
1743         (WebCore::SVGPropertyTraits<FloatPoint>::initialValue):
1744         (WebCore::SVGPropertyTraits<FloatPoint>::fromString):
1745         (WebCore::SVGPropertyTraits<FloatPoint>::parse):
1746         (WebCore::SVGPropertyTraits<FloatPoint>::toString):
1747         (WebCore::SVGPropertyTraits<FloatRect>::initialValue):
1748         (WebCore::SVGPropertyTraits<FloatRect>::fromString):
1749         (WebCore::SVGPropertyTraits<FloatRect>::parse):
1750         (WebCore::SVGPropertyTraits<FloatRect>::toString):
1751         (WebCore::SVGPropertyTraits<String>::fromString):
1752         (WebCore::SVGPropertyTraits<String>::parse):
1753         (WebCore::SVGPropertyTraits<String>::toString):
1754
1755 2018-02-19  Antoine Quint  <graouts@apple.com>
1756
1757         [Modern Media Controls] Implement a compact set of media controls
1758         https://bugs.webkit.org/show_bug.cgi?id=182937
1759         <rdar://problem/37682257>
1760
1761         Reviewed by Eric Carlson.
1762
1763         We add a new type of media controls used when we need stripped down and compact controls. The new
1764         CompactMediaControls only show a play/pause button and an invalid placard and disregard all media
1765         events that are not relevant to the display of these controls.
1766
1767         To distinguish cases where we need to show compact media controls, we expose a new property on
1768         MediaControlsHost called "compactMode".
1769
1770         Tests: media/modern-media-controls/compact-media-controls/compact-media-controls-constructor.html
1771                media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html
1772
1773         * Modules/mediacontrols/MediaControlsHost.cpp:
1774         (WebCore::MediaControlsHost::base64StringForIconNameAndType const):
1775         (WebCore::MediaControlsHost::compactMode const):
1776         * Modules/mediacontrols/MediaControlsHost.h:
1777         (WebCore::MediaControlsHost::setSimulateCompactMode):
1778         * Modules/mediacontrols/MediaControlsHost.idl:
1779         * Modules/modern-media-controls/controls/compact-media-controls.js: Added.
1780         (CompactMediaControls.prototype.get scaleFactor):
1781         (CompactMediaControls.prototype.set scaleFactor):
1782         (CompactMediaControls.prototype.get shouldCenterControlsVertically):
1783         (CompactMediaControls.prototype.set shouldCenterControlsVertically):
1784         (CompactMediaControls.prototype.get placard):
1785         (CompactMediaControls.prototype.set placard):
1786         (CompactMediaControls.prototype.layout):
1787         (CompactMediaControls.prototype.commitProperty):
1788         * Modules/modern-media-controls/controls/icon-service.js:
1789         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits):
1790         (const.iconService.new.IconService):
1791         * Modules/modern-media-controls/controls/inline-media-controls.js:
1792         * Modules/modern-media-controls/controls/layout-item.js:
1793         * Modules/modern-media-controls/js-files:
1794         * Modules/modern-media-controls/main.js:
1795         * Modules/modern-media-controls/media/media-controller.js:
1796         (MediaController.prototype.get layoutTraits):
1797         (MediaController.prototype._supportingObjectClasses): Compute the set of MediaControllerSupport classes based
1798         on the layout traits such that in compact mode we only return PlacardSupport and PlaybackSupport.
1799         (MediaController.prototype._updateControlsIfNeeded):
1800         (MediaController.prototype._controlsClassForLayoutTraits):
1801         (MediaController.prototype._shouldControlsBeAvailable):
1802         * Modules/modern-media-controls/media/placard-support.js:
1803         (PlacardSupport.prototype.get mediaEvents): Only track the "error" event in compact mode since this is the only
1804         relevant placard.
1805         * Modules/modern-media-controls/media/playback-support.js:
1806         (PlaybackSupport.prototype.syncControl): Only show or hide the play/pause button based on the playback state
1807         when in compact mode.
1808         (PlaybackSupport):
1809         * WebCore.xcodeproj/project.pbxproj:
1810
1811 2018-02-19  Antoine Quint  <graouts@apple.com>
1812
1813         [Web Animations] Make KeyframeEffect target nullable and read-write
1814         https://bugs.webkit.org/show_bug.cgi?id=182741
1815
1816         Reviewed by Dean Jackson.
1817
1818         We used to completely disregard null targets, for instance not parsing keyframes, but targets
1819         can be null and are also supposed to be read-write for KeyframeEffect. We now update the IDL
1820         for KeyframeEffect to mark the target property as read-write and update the implementation
1821         to correctly handle null targets.
1822
1823         This revealed a few issues in our implementation by allowing more WPT tests to run. So we also
1824         ensure that:
1825         
1826         - we don't crash when parsing font-related properties by calling update() on the generated
1827         RenderStyle's FontCascade when parsing keyframes.
1828
1829         - CSS properties are provided as camel-case and not as hyphenated form
1830
1831         - values provided in keyframes dictionaries are only read for valid properties
1832
1833         - styles for effect targets are invalidated as soon as the timing model for that animation
1834         is changed
1835
1836         * animation/KeyframeEffect.idl:
1837         * animation/KeyframeEffectReadOnly.cpp:
1838         (WebCore::invalidateElement): Add a new utility method to invalidate a given element since
1839         we may want to invalidate not only the current target (m_target) but also a previous target.
1840         (WebCore::IDLAttributeNameToAnimationPropertyName): Move this function below CSSPropertyIDToIDLAttributeName
1841         so that it can call that function. We also check that we reject CSS properties that are not provided in
1842         camel-case form (eg. "font-size" vs. "fontSize").
1843         (WebCore::processIterableKeyframes): Only read the JS values if we know that the provided JS property name
1844         maps to a valid CSS property.
1845         (WebCore::KeyframeEffectReadOnly::processKeyframes): Allow keyframes to be processed even if the effect's
1846         target is null.
1847         (WebCore::KeyframeEffectReadOnly::setTarget): Notify the animation that the effect target has changed and
1848         invalidate the style of the new target and the old targets, if any. We also update the blending keyframes
1849         since this task may not have been completed in a previous call to processKeyframes() due to the target being
1850         null at that time.
1851         (WebCore::KeyframeEffectReadOnly::invalidate): Use the invalidateElement() utility.
1852         * animation/KeyframeEffectReadOnly.h:
1853         * animation/WebAnimation.cpp:
1854         (WebCore::WebAnimation::effectTargetDidChange): This method is called in KeyframeEffectReadOnly::setTarget()
1855         to inform the animation of the previous effect target and the new one upon a target change. This allows us to
1856         forward this information onto the timeline so that we correctly add or remove the targets from the list of
1857         animated elements.
1858         * animation/WebAnimation.h:
1859
1860 2018-02-19  Chris Dumez  <cdumez@apple.com>
1861
1862         Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType()
1863         https://bugs.webkit.org/show_bug.cgi?id=182927
1864         <rdar://problem/37675748>
1865
1866         Reviewed by Antti Koivisto.
1867
1868         Make it safe to call MIMETypeRegistry::isSupportedJavaScriptMIMEType() from the non-main thread.
1869         It is currently being called from a background thread in the following places:
1870         - ServiceWorkerJob::didReceiveResponse()
1871         - WorkerGlobalScope::importScripts()
1872
1873         These call sites on non-main threads were added recently with the support for service workers.
1874
1875         No new tests, already covered by existing tests that flakily experience service worker
1876         process crashes.
1877
1878         * platform/MIMETypeRegistry.cpp:
1879         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
1880
1881 2018-02-19  Dean Jackson  <dino@apple.com>
1882
1883         SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm<int> const + 45
1884         https://bugs.webkit.org/show_bug.cgi?id=182944
1885         <rdar://problem/35369984>
1886
1887         Reviewed by Myles Maxfield.
1888
1889         Avoid a divide-by-zero.
1890
1891         Test: svg/text/font-bad-unitsperem.html
1892
1893         * svg/SVGFontFaceElement.cpp:
1894         (WebCore::SVGFontFaceElement::unitsPerEm const):
1895
1896 2018-02-19  Tim Horton  <timothy_horton@apple.com>
1897
1898         REGRESSION (r219342): Touch event coordinates and elementFromPoint coordinates differ
1899         https://bugs.webkit.org/show_bug.cgi?id=182910
1900         <rdar://problem/37533950>
1901
1902         Reviewed by Simon Fraser.
1903
1904         We reverted other changes to the definition of client coordinates
1905         in r219829 due to compatibility concerns. However, we failed to revert
1906         r219342 on trunk, leaving elementFromPoint() using coordinates relative
1907         to the layout viewport.
1908
1909         Add a currently off-by-default setting to switch on layout-viewport-relative
1910         client coordinates and guard the elementFromPoint changes behind it.
1911         A future patch should roll r219829 back in also behind this setting, so
1912         that everything remains consistent regardless of which coordinate space we choose.
1913
1914         * dom/TreeScope.cpp:
1915         (WebCore::absolutePointIfNotClipped):
1916         * page/Settings.yaml:
1917         * rendering/RenderLayer.cpp:
1918         (WebCore::RenderLayer::hitTest):
1919
1920 2018-02-19  Eric Carlson  <eric.carlson@apple.com>
1921
1922         [Extra zoom mode] Don't allow PiP media playback
1923         https://bugs.webkit.org/show_bug.cgi?id=182930
1924         <rdar://problem/37676259>
1925
1926         Reviewed by Andy Estes.
1927
1928         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1929         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Don't call setPIPModeEnabled:
1930         if it isn't implemented.
1931         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
1932
1933 2018-02-19  Antoine Quint  <graouts@apple.com>
1934
1935         [Web Animations] Decouple parsing JS keyframes and computing blending keyframes
1936         https://bugs.webkit.org/show_bug.cgi?id=182939
1937         <rdar://problem/37678364>
1938
1939         Reviewed by Dean Jackson.
1940
1941         Move all the code used to create the KeyframeList into a dedicated updateBlendingKeyframes() method.
1942
1943         No new tests since this code change has no user-visible impact.
1944
1945         * animation/KeyframeEffectReadOnly.cpp:
1946         (WebCore::KeyframeEffectReadOnly::processKeyframes):
1947         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
1948         * animation/KeyframeEffectReadOnly.h:
1949
1950 2018-02-19  Jer Noble  <jer.noble@apple.com>
1951
1952         [EME] Add mechanism for MediaKeySession to react to HDCP changes
1953         https://bugs.webkit.org/show_bug.cgi?id=182935
1954
1955         Reviewed by Eric Carlson.
1956
1957         Add a client callback interface to CDMInterface to allow subclasses to communicate up to
1958         MediaKeySEssion. Add a virtual method to CDMInterface to allow it to be notified of HDCP
1959         status changes. Override this method in CDMInstanceFairPlayStreamingAVFObjC. Hook up the
1960         outputObscuredDueToInsufficientExternalProtectionChanged() methods in both
1961         MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC to this new
1962         CDMInstance method. Add an Internals method to simulate an HDCP error for testing purposes.
1963
1964         * Modules/encryptedmedia/MediaKeySession.cpp:
1965         (WebCore::MediaKeySession::MediaKeySession):
1966         (WebCore::MediaKeySession::~MediaKeySession):
1967         (WebCore::MediaKeySession::updateKeyStatuses):
1968         * Modules/encryptedmedia/MediaKeySession.h:
1969         * platform/encryptedmedia/CDMInstance.h:
1970         (WebCore::CDMInstance::setHDCPStatus):
1971         (WebCore::CDMInstance::setClient):
1972         (WebCore::CDMInstance::clearClient):
1973         * platform/graphics/MediaPlayer.cpp:
1974         (WebCore::MediaPlayer::beginSimulatedHDCPError):
1975         (WebCore::MediaPlayer::endSimulatedHDCPError):
1976         * platform/graphics/MediaPlayer.h:
1977         * platform/graphics/MediaPlayerPrivate.h:
1978         (WebCore::MediaPlayerPrivateInterface::beginSimulatedHDCPError):
1979         (WebCore::MediaPlayerPrivateInterface::endSimulatedHDCPError):
1980         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1981         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1982         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient):
1983         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient):
1984         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged):
1985         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1986         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1987         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1988         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1989         (WebCore::playerKVOProperties):
1990         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1991         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1992         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1993         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1994         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1995         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1996         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1997         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1998         * testing/Internals.cpp:
1999         (WebCore::Internals::beginSimulatedHDCPError):
2000         (WebCore::Internals::endSimulatedHDCPError):
2001         * testing/Internals.h:
2002         * testing/Internals.idl:
2003
2004 2018-02-19  Chris Dumez  <cdumez@apple.com>
2005
2006         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::TimerBase::~TimerBase
2007         https://bugs.webkit.org/show_bug.cgi?id=182931
2008         <rdar://problem/37602962>
2009
2010         Reviewed by Antti Koivisto.
2011
2012         Make sure PlatformMediaResource is ThreadSafeRefCounted since it is being
2013         used from several threads in WebCoreNSURLSession. Also make sure it is
2014         always destroyed on the main thread since it ends up destroying a
2015         CachedRawResource object.
2016
2017         No new tests, no known reproduction case.
2018
2019         * platform/graphics/PlatformMediaResourceLoader.h:
2020         * platform/network/cocoa/WebCoreNSURLSession.mm:
2021         (-[WebCoreNSURLSessionDataTask dealloc]):
2022
2023 2018-02-19  Zalan Bujtas  <zalan@apple.com>
2024
2025         [RenderTreeBuilder] Rename RenderTreeBuilder::removeAndDestroyChild() -> removeAndDestroy()
2026         https://bugs.webkit.org/show_bug.cgi?id=182934
2027         <rdar://problem/37678241>
2028
2029         Reviewed by Antti Koivisto.
2030
2031         No change in functionality.
2032
2033         * dom/Document.cpp:
2034         (WebCore::Document::setFullScreenRenderer):
2035         * rendering/RenderBoxModelObject.cpp:
2036         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
2037         * rendering/RenderButton.cpp:
2038         (WebCore::RenderButton::setText):
2039         * rendering/RenderFullScreen.cpp:
2040         (WebCore::RenderFullScreen::willBeDestroyed):
2041         (WebCore::RenderFullScreen::unwrapRenderer):
2042         * rendering/RenderListItem.cpp:
2043         (WebCore::RenderListItem::willBeDestroyed):
2044         * rendering/RenderTextFragment.cpp:
2045         (WebCore::RenderTextFragment::willBeDestroyed):
2046         (WebCore::RenderTextFragment::setText):
2047         * rendering/RenderView.cpp:
2048         (WebCore::RenderView::willBeDestroyed):
2049         * rendering/updating/RenderTreeBuilder.cpp:
2050         (WebCore::RenderTreeBuilder::removeAndDestroy):
2051         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2052         (WebCore::RenderTreeBuilder::removeAndDestroyChild): Deleted.
2053         * rendering/updating/RenderTreeBuilder.h:
2054         * rendering/updating/RenderTreeBuilderBlock.cpp:
2055         (WebCore::RenderTreeBuilder::Block::takeChild):
2056         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2057         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
2058         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2059         * rendering/updating/RenderTreeBuilderList.cpp:
2060         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2061         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2062         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
2063         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
2064         * rendering/updating/RenderTreeBuilderRuby.cpp:
2065         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2066         (WebCore::RenderTreeBuilder::Ruby::takeChild):
2067
2068 2018-02-19  Daniel Bates  <dabates@apple.com>
2069
2070         Do not block authentication challenge to navigated resources
2071         https://bugs.webkit.org/show_bug.cgi?id=182807
2072         <rdar://problem/37481619>
2073
2074         Reviewed by Brent Fulgham.
2075
2076         Blocking the main resource from asking for credentials depending on how it was
2077         navigated to could be confusing to a person and breaks web compatibility. Restore
2078         the behavior before r224134.
2079
2080         * loader/FrameLoader.cpp:
2081         (WebCore::FrameLoader::receivedFirstData):
2082         * loader/ResourceLoader.cpp:
2083         (WebCore::ResourceLoader::init):
2084         (WebCore::ResourceLoader::willSendRequestInternal):
2085         (WebCore::ResourceLoader::didBlockAuthenticationChallenge):
2086         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const):
2087         (WebCore::ResourceLoader::isMixedContent const): Deleted.
2088         * loader/ResourceLoader.h:
2089         (WebCore::ResourceLoader::wasAuthenticationChallengeBlocked const):
2090         (WebCore::ResourceLoader::wasInsecureRequestSeen const): Deleted.
2091
2092 2018-02-17  Antoine Quint  <graouts@apple.com>
2093
2094         [Web Animations] Store all parsed keyframe input information in a single structure
2095         https://bugs.webkit.org/show_bug.cgi?id=182903
2096
2097         Reviewed by Dean Jackson.
2098
2099         When parsing keyframe input provided through the JS API, we used to create several data structures.
2100         During parsing we would create a Vector<ProcessedKeyframe> where we would store the validated values
2101         for "offset", "easing" and "composite" as well as CSS properties and CSS values as strings. 
2102
2103         Then we would create a KeyframeList, a class that pre-dates the work on Web Animations and is used
2104         for hardware animations, with RenderStyle objects that are used for CSS property blending at runtime.
2105         Once the KeyframeList was created, the Vector<ProcessedKeyframe> was discarded.
2106
2107         Since KeyframeList did not know about nullable offsets, timing functions and composite operations, and
2108         because we do not with to modify a legacy class that we will eventually remove once all the Web Animations
2109         work is complete, we also stored the parsed offsets as m_offsets, the timing functions as m_timingFunctions
2110         and the composite operations as m_compositeOperations.
2111
2112         In this patch we rename the ProcessedKeyframe structure used temporarily during parsing to ParsedKeyframe and
2113         store both the input and processed data related to a given keyframe in that single structure which we keep
2114         around as m_parsedKeyframes when we finished processing the keyframes input. This update ParsedKeyframe structure
2115         allows to keep around the original nullable offsets, the original CSS properties and CSS values as strings as
2116         a HashMap<CSSPropertyID, String>, as well as the CSS properties and CSS values as CSSValue objects using a
2117         MutableStyleProperties object. 
2118
2119         This has the benefit of reducing the number of members, but also pave the way for supporting read-write targets
2120         where we will be able to decouple parsing keyframes and creating a KeyframeList, which requires a valid target
2121         to create RenderStyle objects used for blending, since the original parsing-time information is now stored.
2122
2123         Finally, this allowed getKeyframes() to be more compliant by returning the CSS values as originally provided in
2124         the keyframe input with shorthand properties when provided, rather than the long-hands we used to read back
2125         through RenderStyle objects.
2126
2127         The generated KeyframeList is now stored as m_blendingKeyframes and is only used for the purpose of interfacing
2128         with hardware animations and CSS property blending.
2129
2130         While ProcessedKeyframe was copyable due to holding only simple types, ParsedKeyframe is not since it uses a Ref
2131         to hold the MutableStyleProperties. This uncovered some cases where we copied ProcessedKeyframe objects, we now
2132         ensure that the ParsedKeyframe objects are moved instead, which was the correct thing to do all along.
2133
2134         * animation/KeyframeEffectReadOnly.cpp:
2135         (WebCore::computeMissingKeyframeOffsets): While we used to store std::optional<double> for the computed offset,
2136         we now store a simple double, which makes more sense since the computed offset is eventually a fully resolved
2137         value after calling computeMissingKeyframeOffsets(). So we now compute the final computed offset without resorting
2138         to intermediate nullable computed offsets.
2139         (WebCore::processIterableKeyframes):
2140         (WebCore::processPropertyIndexedKeyframes):
2141         (WebCore::KeyframeEffectReadOnly::KeyframeEffectReadOnly):
2142         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
2143         (WebCore::KeyframeEffectReadOnly::getKeyframes):
2144         (WebCore::KeyframeEffectReadOnly::processKeyframes):
2145         (WebCore::KeyframeEffectReadOnly::computeStackingContextImpact):
2146         (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated):
2147         (WebCore::KeyframeEffectReadOnly::getAnimatedStyle):
2148         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
2149         (WebCore::KeyframeEffectReadOnly::startOrStopAccelerated):
2150         * animation/KeyframeEffectReadOnly.h:
2151         (WebCore::KeyframeEffectReadOnly::ParsedKeyframe::ParsedKeyframe):
2152
2153 2018-02-19  Zalan Bujtas  <zalan@apple.com>
2154
2155         [RenderTreeBuilder] Remove redundant RenderObject::removeFromParentAndDestroy
2156         https://bugs.webkit.org/show_bug.cgi?id=182926
2157         <rdar://problem/37674997>
2158
2159         Reviewed by Antti Koivisto.
2160
2161         Call RenderTreeBuilder::removeAndDestroyChild() directly instead. 
2162
2163         No change in functionality.
2164
2165         * dom/Document.cpp:
2166         (WebCore::Document::setFullScreenRenderer):
2167         * rendering/RenderBoxModelObject.cpp:
2168         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
2169         * rendering/RenderButton.cpp:
2170         (WebCore::RenderButton::setText):
2171         * rendering/RenderFullScreen.cpp:
2172         (WebCore::RenderFullScreen::willBeDestroyed):
2173         (WebCore::RenderFullScreen::unwrapRenderer):
2174         * rendering/RenderListItem.cpp:
2175         (WebCore::RenderListItem::willBeDestroyed):
2176         * rendering/RenderObject.cpp:
2177         (WebCore::RenderObject::removeFromParentAndDestroy): Deleted.
2178         * rendering/RenderObject.h:
2179         * rendering/RenderTextFragment.cpp:
2180         (WebCore::RenderTextFragment::willBeDestroyed):
2181         (WebCore::RenderTextFragment::setText):
2182         * rendering/updating/RenderTreeBuilder.cpp:
2183         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2184         * rendering/updating/RenderTreeBuilderBlock.cpp:
2185         (WebCore::RenderTreeBuilder::Block::takeChild):
2186         * rendering/updating/RenderTreeBuilderList.cpp:
2187         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2188         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2189         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
2190         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
2191         * rendering/updating/RenderTreeBuilderRuby.cpp:
2192         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2193         (WebCore::RenderTreeBuilder::Ruby::takeChild):
2194
2195 2018-02-19  Tim Horton  <timothy_horton@apple.com>
2196
2197         Increase text autosizing constants for extra zoom mode
2198         https://bugs.webkit.org/show_bug.cgi?id=182919
2199         <rdar://problem/37671259>
2200
2201         Reviewed by Wenson Hsieh.
2202
2203         * page/Settings.yaml:
2204         * page/SettingsBase.cpp:
2205         (WebCore::SettingsBase::defaultMinimumZoomFontSize):
2206         (WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient):
2207         (WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient):
2208         (WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease):
2209         * page/SettingsBase.h:
2210         * rendering/RenderBlockFlow.cpp:
2211         (WebCore::oneLineTextMultiplier):
2212         (WebCore::textMultiplier):
2213         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2214         * rendering/TextAutoSizing.cpp:
2215         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2216         Make autosizing constants settings, and change their default values.
2217
2218 2018-02-17  Antoine Quint  <graouts@apple.com>
2219
2220         [Web Animations] Accept null composite modes in keyframes
2221         https://bugs.webkit.org/show_bug.cgi?id=182902
2222
2223         Reviewed by Dean Jackson.
2224
2225         The Web Animations spec used to specify that that composite modes should be non-null and instead not be
2226         provided when specifying keyframes, but now null values are accepted. We update the IDL input types used
2227         when parsing keyframes to allow for null values.
2228
2229         We had already updated the getKeyframes() output in webkit.org/b/182600.
2230
2231         * animation/KeyframeEffectReadOnly.cpp:
2232         (WebCore::processIterableKeyframes):
2233         (WebCore::processKeyframeLikeObject):
2234         (WebCore::processPropertyIndexedKeyframes):
2235         * animation/KeyframeEffectReadOnly.h:
2236         * animation/KeyframeEffectReadOnly.idl:
2237
2238 2018-02-19  Ms2ger  <Ms2ger@igalia.com>
2239
2240         Explicitly qualify some method calls on this in lamdas in Service Worker code.
2241         https://bugs.webkit.org/show_bug.cgi?id=182875
2242
2243         Reviewed by Chris Dumez.
2244
2245         This is necessary for the code to build with GCC 5. Other code already
2246         appears to have been adapted similarly.
2247
2248         No change in functionality.
2249
2250         * loader/DocumentLoader.cpp:
2251         (WebCore::DocumentLoader::redirectReceived):
2252         (WebCore::DocumentLoader::startLoadingMainResource):
2253         * workers/service/ServiceWorkerContainer.cpp:
2254         (WebCore::ServiceWorkerContainer::ready):
2255         (WebCore::ServiceWorkerContainer::getRegistration):
2256         (WebCore::ServiceWorkerContainer::getRegistrations):
2257         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
2258         * workers/service/ServiceWorkerGlobalScope.cpp:
2259         (WebCore::ServiceWorkerGlobalScope::updateExtendedEventsSet):
2260         * workers/service/server/SWServer.cpp:
2261         (WebCore::SWServer::claim):
2262         (WebCore::SWServer::Connection::resolveRegistrationReadyRequests):
2263         * workers/service/server/SWServerRegistration.cpp:
2264         (WebCore::SWServerRegistration::updateRegistrationState):
2265         (WebCore::SWServerRegistration::setUpdateViaCache):
2266         (WebCore::SWServerRegistration::setLastUpdateTime):
2267         (WebCore::SWServerRegistration::fireUpdateFoundEvent):
2268         * workers/service/server/SWServerWorker.cpp:
2269         (WebCore::SWServerWorker::setState):
2270
2271 2018-02-19  Zalan Bujtas  <zalan@apple.com>
2272
2273         [RenderTreeBuilder] Move RenderElement::removeAndDestroyChild() to RenderTreeBuilder
2274         https://bugs.webkit.org/show_bug.cgi?id=182915
2275         <rdar://problem/37658123>
2276
2277         Reviewed by Antti Koivisto.
2278
2279         No change in functionality.
2280
2281         * rendering/RenderElement.cpp:
2282         (WebCore::RenderElement::removeAndDestroyChild): Deleted.
2283         * rendering/RenderElement.h:
2284         (WebCore::RenderElement::isChildAllowed const):
2285         * rendering/RenderObject.cpp:
2286         (WebCore::RenderObject::removeFromParentAndDestroy):
2287         * rendering/RenderView.cpp:
2288         (WebCore::RenderView::willBeDestroyed):
2289         * rendering/updating/RenderTreeBuilder.cpp:
2290         (WebCore::RenderTreeBuilder::removeAndDestroyChild):
2291         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2292         * rendering/updating/RenderTreeBuilder.h:
2293         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2294         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
2295         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2296
2297 2018-02-12  Sergio Villar Senin  <svillar@igalia.com>
2298
2299         [WebVR][OpenVR] Implement getVRDisplays()
2300         https://bugs.webkit.org/show_bug.cgi?id=182692
2301
2302         Reviewed by Žan Doberšek.
2303
2304         This provides an implementation of Navigator's getVRDisplays()
2305         method using OpenVR as backend. It queues several promises in
2306         a queue and resolves them all just once. The information retrieved
2307         is very minimal for the time being, but this change lays the ground
2308         for all the changes that are about to land.
2309
2310         The VR code uses a VRManager which is the interface with the
2311         platform code and the responsible for instantiating the right
2312         platform code. This platform code is currently being implemented
2313         using OpenVR but could we also ported in the future to OpenXR or any
2314         other VR SDK.
2315
2316         * CMakeLists.txt:
2317         * Modules/webvr/NavigatorWebVR.cpp:
2318         (WebCore::NavigatorWebVR::getVRDisplays):
2319         (WebCore::NavigatorWebVR::vrEnabled):
2320         * Modules/webvr/NavigatorWebVR.h:
2321         * Modules/webvr/VRDisplay.cpp:
2322         (WebCore::VRDisplay::create):
2323         (WebCore::VRDisplay::VRDisplay):
2324         (WebCore::VRDisplay::isConnected const):
2325         (WebCore::VRDisplay::displayName const):
2326         * Modules/webvr/VRDisplay.h:
2327         * Modules/webvr/VRDisplayCapabilities.cpp:
2328         (WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
2329         (WebCore::VRDisplayCapabilities::hasPosition const):
2330         (WebCore::VRDisplayCapabilities::hasOrientation const):
2331         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
2332         (WebCore::VRDisplayCapabilities::canPresent const):
2333         (WebCore::VRDisplayCapabilities::maxLayer const):
2334         * Modules/webvr/VRDisplayCapabilities.h:
2335         (WebCore::VRDisplayCapabilities::create):
2336         * Sources.txt:
2337         * platform/vr/VRManager.cpp: Added. This is the main interface used by bindings code to
2338         access VR devices data provided by platform code.
2339         (WebCore::VRManager::singleton):
2340         (WebCore::VRManager::VRManager):
2341         (WebCore::VRManager::~VRManager):
2342         (WebCore::VRManager::refreshVRDevices):
2343         * platform/vr/VRManager.h: Added.
2344         * platform/vr/VRPlatformDisplay.h: Added. Abstraction of a VR display system. To be
2345         implemented by backends like OpenVR, OpenXR...
2346         * platform/vr/VRPlatformManager.h: Added. Abstraction of the platform specific class which
2347         retrieves data from VR devices. To be implemented by backends like OpenVR, OpenXR...
2348         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: Added.
2349         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2350         * platform/vr/openvr/VRPlatformDisplayOpenVR.h: Added.
2351         * platform/vr/openvr/VRPlatformManagerOpenVR.cpp: Added.
2352         (WebCore::VRPlatformManagerOpenVR::create):
2353         (WebCore::VRPlatformManagerOpenVR::VRPlatformManagerOpenVR):
2354         (WebCore::VRPlatformManagerOpenVR::~VRPlatformManagerOpenVR):
2355         (WebCore::VRPlatformManagerOpenVR::initOpenVR):
2356         * platform/vr/openvr/VRPlatformManagerOpenVR.h: Added.
2357         * WebCore.xcodeproj/project.pbxproj:
2358
2359 2018-02-19  Manuel Rego Casasnovas  <rego@igalia.com>
2360
2361         [css-grid] Apply automatic minimum size clamping to spanning items too
2362         https://bugs.webkit.org/show_bug.cgi?id=182684
2363
2364         Reviewed by Javier Fernandez.
2365
2366         In r225776 we added the conditions from the spec to apply
2367         the automatic minimum size clamping when required
2368         but only to non-spanning items.
2369         See: https://drafts.csswg.org/css-grid/#min-size-auto
2370
2371         This patch moves the code from GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem()
2372         to GridTrackSizingAlgorithmStrategy::minSizeForChild()
2373         that way the clamping is applied for both spanning and non-spanning items.
2374
2375         This somehow reverts r225776, as it was adding some duplicated code.
2376         All the checks to know if we should use that part of the spec
2377         were already present in GridTrackSizingAlgorithmStrategy::minSizeForChild().
2378
2379         Apart from using the previous code, there's a new loop to verify
2380         that the max track sizing function is fixed for all the tracks of the item.
2381
2382         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html
2383                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html
2384
2385         * rendering/GridTrackSizingAlgorithm.cpp:
2386         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
2387         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2388
2389 2018-02-19  Philippe Normand  <pnormand@igalia.com>
2390
2391         [GTK][GStreamer] Replaying a webm video twice causes the video to stop getting rendered
2392         https://bugs.webkit.org/show_bug.cgi?id=176789
2393
2394         Reviewed by Xabier Rodriguez-Calvar.
2395
2396         Ensure the wrapped GstGLContext is set when the pipeline goes from
2397         READY to PAUSED state. This is a workaround for
2398         https://bugzilla.gnome.org/show_bug.cgi?id=757933.
2399
2400         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2401         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Add debug statement.
2402         (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired): Ditto.
2403         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
2404         Ensure the wrapped GstGLContext is set when the pipeline goes from
2405         READY to PAUSED state.
2406         (WebCore::MediaPlayerPrivateGStreamer::didEnd): Add debug statement.
2407         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2408         Change the requestGLContext to be a method instead of a static
2409         function. Being a static function was a requirement for the now-removed OpenWebRTC player.
2410         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): Add
2411         debug statement, fix requestGLContext usage.
2412         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext): Refactor as method.
2413         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): Fix requestGLContext usage.
2414         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Remove fixed FIXME.
2415         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGLVideoSinkContext):
2416         Set display and app wrapped contexts on the video sink.
2417         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2418
2419 2018-02-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2420
2421         [GStreamer] Crash in WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete
2422         https://bugs.webkit.org/show_bug.cgi?id=166733
2423
2424         Reviewed by Philippe Normand.
2425
2426         There are a couple of issues to tackle here.
2427
2428         First is handling getting more than one missing plugin
2429         installation request at the same time. For this we add the request
2430         to a Vector and handle them there.
2431
2432         Second is that if the player is dead and we still get the result,
2433         bad things happen. For that we "weaked" the pointer capture by the
2434         lambda.
2435
2436         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2437         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2438         Handle Vector of callbacks.
2439         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Weak
2440         private player pointer and put the callback in the Vector.
2441         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2442         Callback becomes Vector.
2443         * platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h:
2444         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create):
2445         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete):
2446         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback):
2447         Callback function is refactored into a "using" type and added self
2448         as parameter to the function.
2449
2450 2018-02-19  Philippe Normand  <pnormand@igalia.com>
2451
2452         [GStreamer] Playbin3 support
2453         https://bugs.webkit.org/show_bug.cgi?id=182530
2454
2455         Reviewed by Xabier Rodriguez-Calvar.
2456
2457         This patch introduces opt-in support for the playbin3 GStreamer
2458         element. This new playback element is still considered
2459         experimental but it can still be very useful for media assets
2460         containing multiple tracks of the same type. In such scenario
2461         audio/video decoders would be created only for the selected tracks
2462         whereas playbin2 creates decoder for each track.
2463
2464         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: Take
2465         a weak pointer of the media player instead of playbin and call the
2466         player when enabling tracks. Also use the GstStream API instead of
2467         inspecting the pad when playbin3 is used.
2468         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
2469         (WebCore::AudioTrackPrivateGStreamer::disconnect):
2470         (WebCore::AudioTrackPrivateGStreamer::markAsActive):
2471         (WebCore::AudioTrackPrivateGStreamer::setEnabled):
2472         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
2473         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: GstStream and
2474         GstStreamCollection smart pointer support.
2475         (WTF::adoptGRef):
2476         (WTF::refGPtr<GstStream>):
2477         (WTF::derefGPtr<GstStream>):
2478         (WTF::refGPtr<GstStreamCollection>):
2479         (WTF::derefGPtr<GstStreamCollection>):
2480         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
2481         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2482         Use the GstStream API instead of inspecting the pad when playbin3
2483         is used.
2484         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
2485         (WebCore::InbandTextTrackPrivateGStreamer::disconnect):
2486         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
2487         (WebCore::InbandTextTrackPrivateGStreamer::create):
2488         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2489         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2490         m_{audio,video,text}Tracks are now hashmaps, which is a bit more
2491         convenient to use than Vectors.
2492         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Update our
2493         tracks implementations depending on the streams stored in the
2494         collection.
2495         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Activate the
2496         given track. This method is called by the TrackPrivate
2497         implementations.
2498         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2499         Refactored legacy (playbin2) support for track hashmap storage.
2500         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
2501         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto.
2502         (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Use track hashmap storage.
2503         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): React on
2504         playbin3 GstStream messages, store the collection provided and
2505         activate the given selected streams accordingly.
2506         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Invalidate tracks no longer needed.
2507         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
2508         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
2509         (WebCore::MediaPlayerPrivateGStreamer::sourceSetupCallback):
2510         Refactoring, use source-setup signal instead of the source
2511         property which is not supported in playbin3.
2512         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
2513         Promoted logging messages, GST_TRACE should be used for very
2514         frequent and less interesting messages.
2515         (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback): Ditto.
2516         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Called by the source-setup signal handler.
2517         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Debugging message added.
2518         (WebCore::MediaPlayerPrivateGStreamer::setPreload): Ditto.
2519         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Create a
2520         playbin3 element if USE(GSTREAMER_PLAYBIN3) was enabled and
2521         connect to playbin2 signals otherwise.
2522         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2523         (WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Promoted to public.
2524         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2525         New StreamCollectionChanged notification type, used the sub-class.
2526         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2527         (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Support for GstStream API.
2528         (WebCore::TrackPrivateBaseGStreamer::disconnect): Clear GstStream too.
2529         (WebCore::TrackPrivateBaseGStreamer::tagsChanged): Get tags from GstStream.
2530         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged): No need to check m_pad twice.
2531         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): Ditto.
2532         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2533         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: Take
2534         a weak pointer of the media player instead of playbin and call the
2535         player when enabling tracks. Also use the GstStream API instead of
2536         inspecting the pad when playbin3 is used.
2537         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
2538         (WebCore::VideoTrackPrivateGStreamer::disconnect):
2539         (WebCore::VideoTrackPrivateGStreamer::markAsActive):
2540         (WebCore::VideoTrackPrivateGStreamer::setSelected):
2541         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2542         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Pass player pointer to track constructor.
2543         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
2544         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Source-setup signal handler.
2545         (WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup):
2546         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2547
2548 2018-02-19  Fujii Hironori  <Hironori.Fujii@sony.com>
2549
2550         REGRESSION(r219298): RELEASE_ASSERT(!m_owningPointerForClose) fails in WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose
2551         https://bugs.webkit.org/show_bug.cgi?id=174354
2552         <rdar://problem/33294987>
2553
2554         Reviewed by Michael Catanzaro.
2555
2556         UniqueIDBDatabase::invokeOperationAndTransactionTimer was called
2557         even after m_owningPointerForClose was set in
2558         UniqueIDBDatabase::didDeleteBackingStore.
2559
2560         No new tests (Covered by existing tests).
2561
2562         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2563         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2564         Do not start deleting the UniqueIDBDatabase. Just call invokeOperationAndTransactionTimer.
2565         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
2566         Assert m_owningPointerForClose is null.
2567
2568 2018-02-18  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2569
2570         Fix build error after r228417 without ACCESSIBILITY
2571         https://bugs.webkit.org/show_bug.cgi?id=182914
2572
2573         Reviewed by Chris Fleizach.
2574
2575         An inline empty version of AXObjectCache::deferFocusdUIElementChangeIfNeeded()
2576         needs to be defined if not HAVE(ACCESSIBILITY). 
2577
2578         * accessibility/AXObjectCache.h:
2579         (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
2580
2581 2018-02-18  Zalan Bujtas  <zalan@apple.com>
2582
2583         [RenderTreeBuilder] REGRESSION(r228238) Detach renderer before destroying its subtree.
2584         https://bugs.webkit.org/show_bug.cgi?id=182908
2585         <rdar://problem/37619394>
2586
2587         Reviewed by Antti Koivisto.
2588
2589         Prior to r228238 we first detached the to-be-destroyed renderer and then
2590         started nuking its descendants. r228238 changed the order and now the descendants are
2591         destroyed while they are still attached to the tree. Apparently some of the takeChild()
2592         normalization logic gets triggered now that the renderers still have access to their previous/next
2593         siblings. This is unexpected and it shouldn't matter whether the subtree is still attached.
2594         Let's revert it to the original order for now (see webkit.org/b/182909).
2595
2596         Test: fast/block/crash-when-subtree-is-still-attached.html
2597
2598         * rendering/RenderElement.cpp:
2599         (WebCore::RenderElement::removeAndDestroyChild):
2600
2601 2018-02-18  Charlie Turner  <cturner@igalia.com>
2602
2603         [GStreamer] Push smaller buffers from HTTP source
2604         https://bugs.webkit.org/show_bug.cgi?id=182829
2605
2606         Reviewed by Philippe Normand.
2607
2608         Split the received buffer into smaller buffers of a size consistent
2609         with the basesrc (4KiB). It is important not to push large buffers
2610         into the appsrc (where large is relative to the appsrc's configured
2611         byte size). If large buffers are pushed, then when they are internally
2612         dequeued by the appsrc, the buffering percentage can dramatically
2613         plummet due to a large amount of bytes being removed after a push. This
2614         can in turn trick the media player into thinking it needs to buffer,
2615         and then issuing a spurious set of playing->paused then
2616         paused->playing transitions, which by the time the buffering logic
2617         completes, data are already available.
2618
2619         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2620         (CachedResourceStreamingClient::dataReceived):
2621
2622 2018-02-17  Darin Adler  <darin@apple.com>
2623
2624         Web Inspector: get rid of remaining uses of OptOutput<T>
2625         https://bugs.webkit.org/show_bug.cgi?id=180607
2626
2627         Reviewed by Brian Burg.
2628
2629         * inspector/InspectorStyleSheet.cpp:
2630         (WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*.
2631         (WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead
2632         of lineEndings().get().
2633         (WebCore::InspectorStyle::styleWithProperties const): Ditto.
2634         (WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto.
2635         (WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of
2636         a std::unique_ptr<Vector>.
2637         (WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto.
2638         * inspector/InspectorStyleSheet.h: Updated for the above.
2639
2640         * inspector/agents/InspectorCSSAgent.h: Removed some bogus const.
2641         * inspector/agents/InspectorCanvasAgent.cpp: Ditto.
2642         * inspector/agents/InspectorCanvasAgent.h: Ditto.
2643
2644         * inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings
2645         so we don't waste space with a pointer to the string.
2646         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed
2647         explicit creation of String, which was wasteful and unnecessary.
2648         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto.
2649         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto.
2650         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto.
2651         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const.
2652
2653         * inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use
2654         final instead of override.
2655         * inspector/agents/InspectorPageAgent.cpp: Ditto.
2656         * inspector/agents/InspectorPageAgent.h: Ditto.
2657
2658 2018-02-16  Zalan Bujtas  <zalan@apple.com>
2659
2660         [RenderTreeBuilder] Cleanup RenderTreeBuilder
2661         https://bugs.webkit.org/show_bug.cgi?id=182899
2662         <rdar://problem/37627888>
2663
2664         Reviewed by Antti Koivisto.
2665
2666         No change in functionality.
2667
2668         * rendering/RenderBlockFlow.cpp:
2669         (WebCore::RenderBlockFlow::styleDidChange):
2670         * rendering/updating/RenderTreeBuilder.cpp:
2671         (WebCore::RenderTreeBuilder::takeChild):
2672         (WebCore::RenderTreeBuilder::moveChildTo):
2673         (WebCore::RenderTreeBuilder::moveAllChildrenTo):
2674         (WebCore::RenderTreeBuilder::moveChildrenTo):
2675         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo):
2676         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
2677         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
2678         (WebCore::RenderTreeBuilder::takeChildFromRenderMenuList): Deleted.
2679         (WebCore::RenderTreeBuilder::takeChildFromRenderButton): Deleted.
2680         * rendering/updating/RenderTreeBuilder.h:
2681         (WebCore::RenderTreeBuilder::current):
2682         * rendering/updating/RenderTreeBuilderBlock.cpp:
2683         (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
2684         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
2685         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo):
2686         * rendering/updating/RenderTreeBuilderFormControls.cpp:
2687         (WebCore::RenderTreeBuilder::FormControls::takeChild):
2688         * rendering/updating/RenderTreeBuilderFormControls.h:
2689         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2690         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2691         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
2692         * rendering/updating/RenderTreeBuilderRuby.cpp:
2693         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
2694         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2695         (WebCore::RenderTreeBuilder::Ruby::takeChild):
2696         * rendering/updating/RenderTreeBuilderTable.cpp:
2697         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
2698
2699 2018-02-16  Daniel Bates  <dabates@apple.com>
2700
2701         Remove UTF-32 BOM parsing code
2702         https://bugs.webkit.org/show_bug.cgi?id=182900
2703         <rdar://problem/37238717>
2704
2705         Reviewed by Alexey Proskuryakov.
2706
2707         The UTF-32 encodings were removed from the text codec registry in r224747. So,
2708         we no longer need code to parse UTF-32{BE, LE} BOM or encode and decode these
2709         variants.
2710
2711         * dom/TextDecoder.cpp:
2712         (WebCore::codeUnitByteSize):
2713         * loader/TextResourceDecoder.cpp:
2714         (WebCore::TextResourceDecoder::checkForBOM):
2715         (WebCore::TextResourceDecoder::checkForHeadCharset):
2716         * platform/text/TextEncoding.cpp:
2717         (WebCore::TextEncoding::isNonByteBasedEncoding const):
2718         (WebCore::UTF32BigEndianEncoding): Deleted.
2719         (WebCore::UTF32LittleEndianEncoding): Deleted.
2720         * platform/text/TextEncoding.h:
2721
2722 2018-02-16  Zalan Bujtas  <zalan@apple.com>
2723
2724         [RenderTreeBuilder] Move RenderBoxModelObject::moveChild*() to RenderTreeBuilder
2725         https://bugs.webkit.org/show_bug.cgi?id=182896
2726         <rdar://problem/37623051>
2727
2728         Reviewed by Antti Koivisto.
2729
2730         No change in functionality.
2731
2732         * rendering/RenderBlock.h:
2733         (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo): Deleted.
2734         * rendering/RenderBlockFlow.cpp:
2735         (WebCore::RenderBlockFlow::styleDidChange):
2736         (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
2737         * rendering/RenderBlockFlow.h:
2738         * rendering/RenderBoxModelObject.cpp:
2739         (WebCore::RenderBoxModelObject::moveChildTo): Deleted.
2740         (WebCore::RenderBoxModelObject::moveChildrenTo): Deleted.
2741         (WebCore::RenderBoxModelObject::moveAllChildrenToInternal): Deleted.
2742         * rendering/RenderBoxModelObject.h:
2743         (WebCore::RenderBoxModelObject::moveChildTo): Deleted.
2744         (WebCore::RenderBoxModelObject::moveAllChildrenTo): Deleted.
2745         (WebCore::RenderBoxModelObject::moveChildrenTo): Deleted.
2746         * rendering/updating/RenderTreeBuilder.cpp:
2747         (WebCore::RenderTreeBuilder::moveChildTo):
2748         (WebCore::RenderTreeBuilder::moveAllChildrenTo):
2749         (WebCore::RenderTreeBuilder::moveChildrenTo):
2750         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo):
2751         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
2752         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
2753         * rendering/updating/RenderTreeBuilder.h:
2754         * rendering/updating/RenderTreeBuilderBlock.cpp:
2755         (WebCore::moveAllChildrenToInternal):
2756         (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
2757         (WebCore::RenderTreeBuilder::Block::takeChild):
2758         (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
2759         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
2760         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo):
2761         * rendering/updating/RenderTreeBuilderBlockFlow.h:
2762         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2763         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2764         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
2765         * rendering/updating/RenderTreeBuilderRuby.cpp:
2766         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
2767         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2768         (WebCore::RenderTreeBuilder::Ruby::takeChild):
2769         * rendering/updating/RenderTreeBuilderTable.cpp:
2770         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
2771
2772 2018-02-16  Andy Estes  <aestes@apple.com>
2773
2774         [Cocoa] Stop using non-prefixed vDSP functions in 32-bit builds
2775         https://bugs.webkit.org/show_bug.cgi?id=182898
2776         <rdar://problem/37195079>
2777
2778         Reviewed by Tim Horton.
2779
2780         There's no need to use non-prefixed vDSP function aliases on 32-bit builds.
2781         The vDSP-prefixed versions are available on all Cocoa platforms we currently support.
2782
2783         * platform/audio/DirectConvolver.cpp:
2784         (WebCore::DirectConvolver::process):
2785         * platform/audio/VectorMath.cpp:
2786         (WebCore::VectorMath::vsmul):
2787         (WebCore::VectorMath::vadd):
2788         (WebCore::VectorMath::vmul):
2789         (WebCore::VectorMath::zvmul):
2790
2791 2018-02-16  Ryan Haddad  <ryanhaddad@apple.com>
2792
2793         Unreviewed, rolling out r228575.
2794
2795         Introduced LayoutTest crashes under GuardMalloc.
2796
2797         Reverted changeset:
2798
2799         "Use ResourceLoader to load appcache manifest"
2800         https://bugs.webkit.org/show_bug.cgi?id=182861
2801         https://trac.webkit.org/changeset/228575
2802
2803 2018-02-16  Dean Jackson  <dino@apple.com>
2804
2805         Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
2806         https://bugs.webkit.org/show_bug.cgi?id=182894
2807
2808         Reviewed by Tim Horton.
2809
2810         Adjust the places where we check for PLATFORM(MAC) or
2811         PLATFORM(IOS) related to WebGL, and instead rely
2812         on USE(OPENGL) USE(OPENGL_ES).
2813
2814         * CMakeLists.txt:
2815         * PlatformGTK.cmake:
2816         * platform/graphics/GLContext.cpp:
2817         (WebCore::initializeOpenGLShimsIfNeeded):
2818         * platform/graphics/GraphicsContext3DPrivate.cpp:
2819         * platform/graphics/OpenGLESShims.h:
2820         * platform/graphics/cairo/ImageBufferCairo.cpp:
2821         * platform/graphics/egl/GLContextEGL.cpp:
2822         (WebCore::GLContextEGL::getEGLConfig):
2823         (WebCore::GLContextEGL::createContext):
2824         (WebCore::GLContextEGL::createSharingContext):
2825         * platform/graphics/egl/GLContextEGLWPE.cpp:
2826         (WebCore::GLContextEGL::createWPEContext):
2827         * platform/graphics/egl/GLContextEGLWayland.cpp:
2828         (WebCore::GLContextEGL::createWaylandContext):
2829         * platform/graphics/egl/GLContextEGLX11.cpp:
2830         (WebCore::GLContextEGL::createPixmapContext):
2831         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2832         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2833         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2834         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2835         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
2836         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2837         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
2838         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2839         * platform/graphics/opengl/Extensions3DOpenGLES.h:
2840         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2841         (WebCore::GraphicsContext3D::create):
2842         (WebCore::GraphicsContext3D::GraphicsContext3D):
2843         (WebCore::GraphicsContext3D::isGLES2Compliant const):
2844         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
2845         (WebCore::GraphicsContext3D::create):
2846         (WebCore::GraphicsContext3D::GraphicsContext3D):
2847         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2848         (WebCore::GraphicsContext3D::isGLES2Compliant const):
2849         (WebCore::GraphicsContext3D::getExtensions):
2850         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
2851         (WebCore::TextureMapperContextAttributes::initialize):
2852         * platform/graphics/texmap/TextureMapperGL.cpp:
2853         (WebCore::TextureMapperGLData::~TextureMapperGLData):
2854         (WebCore::TextureMapperGLData::getVAO):
2855         (WebCore::TextureMapperGL::beginPainting):
2856         (WebCore::TextureMapperGL::endPainting):
2857         * platform/graphics/texmap/TextureMapperGLHeaders.h:
2858         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2859         (WebCore::TextureMapperShaderProgram::create):
2860
2861 2018-02-16  Zalan Bujtas  <zalan@apple.com>
2862
2863         [RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder
2864         https://bugs.webkit.org/show_bug.cgi?id=182885
2865         <rdar://problem/37617371>
2866
2867         Reviewed by Antti Koivisto.
2868
2869         No change in functionality.
2870
2871         * rendering/RenderElement.cpp:
2872         (WebCore::RenderElement::insertChildInternal): Deleted.
2873         * rendering/RenderObject.h:
2874         * rendering/updating/RenderTreeBuilder.cpp:
2875         (WebCore::RenderTreeBuilder::insertChildToRenderElement):
2876
2877 2018-02-16  Youenn Fablet  <youenn@apple.com>
2878
2879         Allow specifying which plug-ins are supported
2880         https://bugs.webkit.org/show_bug.cgi?id=182748
2881
2882         Reviewed by Chris Dumez.
2883
2884         Tests: http/tests/plugins/nounsupported-plugin.html
2885                http/tests/plugins/supported-plugin-all-origin-visibility.html
2886                http/tests/plugins/supported-plugin-on-specific-origin.html
2887                http/tests/plugins/supported-plugin-origin-specific-visibility.html
2888                http/tests/plugins/unsupported-plugin-on-specific-origin.html
2889                plugins/unsupported-plugin.html
2890
2891         Added support for computing plugin web visibility with the added knowledge of supported plugins.
2892         In case of a plugin failing to be created due to being unsupported, update the UI
2893         to use mark the plugin as "Unexpected plug in".
2894
2895         Added internal API to retrieve the plug-in error description message.
2896
2897         * English.lproj/Localizable.strings:
2898         * WebCore.xcodeproj/project.pbxproj:
2899         * html/HTMLPlugInElement.cpp:
2900         (WebCore::HTMLPlugInElement::setReplacement):
2901         * html/HTMLPlugInElement.h:
2902         * loader/EmptyClients.cpp:
2903         * platform/LocalizedStrings.cpp:
2904         (WebCore::unsupportedPluginText):
2905         * platform/LocalizedStrings.h:
2906         * plugins/PluginData.cpp:
2907         (WebCore::PluginData::initPlugins):
2908         * plugins/PluginData.h:
2909         (WebCore::decodePluginNames):
2910         (WebCore::encodePluginNames):
2911         (WebCore::SupportedPluginNames::decode):
2912         (WebCore::SupportedPluginNames::encode const):
2913         * plugins/PluginInfoProvider.h:
2914         * rendering/RenderEmbeddedObject.cpp:
2915         (WebCore::unavailablePluginReplacementText):
2916         * rendering/RenderEmbeddedObject.h:
2917         (WebCore::RenderEmbeddedObject::pluginReplacementTextIfUnavailable const):
2918         * testing/Internals.cpp:
2919         (WebCore::Internals::unavailablePluginReplacementText):
2920         * testing/Internals.h:
2921         * testing/Internals.idl:
2922
2923 2018-02-16  Chris Dumez  <cdumez@apple.com>
2924
2925         http/tests/security/http-0.9/xhr-blocked.html is flaky
2926         https://bugs.webkit.org/show_bug.cgi?id=182857
2927         <rdar://problem/37616958>
2928
2929         Reviewed by Antti Koivisto.
2930
2931         WebCoreResourceHandleAsOperationQueueDelegate does not own the messageQueue and
2932         the detachHandle function was failing to nullout m_messageQueue when the resourceHandle
2933         gets destroyed. This means that callFunctionOnMainThread would sometimes try to append
2934         to a dead messageQueue.
2935
2936         No new tests, already covered by:
2937         http/tests/security/http-0.9/xhr-blocked.html is flaky
2938
2939         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2940         (-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]):
2941
2942 2018-02-16  Antti Koivisto  <antti@apple.com>
2943
2944         Assert in mixed blend animation
2945         https://bugs.webkit.org/show_bug.cgi?id=182887
2946         <rdar://problem/37598140>
2947
2948         Reviewed by Zalan Bujtas.
2949
2950         Test: fast/css/calc-mixed-blend-crash.html
2951
2952         * platform/CalculationValue.cpp:
2953         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
2954
2955         Fix mismatch between the type test and the value used.
2956
2957 2018-02-16  Zalan Bujtas  <zalan@apple.com>
2958
2959         [RenderTreeBuilder] Move RenderBlock/RenderInline::addChildIgnoringContinuation() to RenderTreeBuilder
2960         https://bugs.webkit.org/show_bug.cgi?id=182876
2961         <rdar://problem/37607604>
2962
2963         Reviewed by Antti Koivisto.
2964
2965         No change in functionality.
2966
2967         * rendering/RenderBlock.cpp:
2968         (WebCore::RenderBlock::addChildIgnoringContinuation): Deleted.
2969         * rendering/RenderBlock.h:
2970         * rendering/RenderElement.cpp:
2971         (WebCore::RenderElement::addChildIgnoringContinuation): Deleted.
2972         * rendering/RenderElement.h:
2973         * rendering/RenderInline.cpp:
2974         (WebCore::RenderInline::addChildIgnoringContinuation): Deleted.
2975         * rendering/RenderInline.h:
2976         * rendering/updating/RenderTreeBuilder.cpp:
2977         (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation):
2978         (WebCore::RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation): Deleted.
2979         (WebCore::RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation): Deleted.
2980         * rendering/updating/RenderTreeBuilder.h:
2981         * rendering/updating/RenderTreeBuilderBlock.cpp:
2982         (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
2983         * rendering/updating/RenderTreeBuilderInline.cpp:
2984         (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
2985         (WebCore::RenderTreeBuilder::Inline::splitInlines):
2986
2987 2018-02-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2988
2989         [Curl] Unify logic of ResourceHandleCurlDelegate into ResourceHandle
2990         https://bugs.webkit.org/show_bug.cgi?id=182578
2991
2992         Reconstruct the classes to match Curl port network layer more similar
2993         structure with other ports. Move CurlRequest handling into ResourceHandle
2994         and makes CurlResourceHandleDelegate simple life cycle. Also its duty is
2995         for most of incoming data and event handling from CurRequest.
2996
2997         Reviewed by Alex Christensen.
2998
2999         No new tests because there's no new behavior.
3000
3001         * platform/Curl.cmake:
3002         * platform/network/ResourceHandle.h:
3003         * platform/network/ResourceHandleInternal.h:
3004         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3005         * platform/network/curl/CurlCacheManager.cpp:
3006         (WebCore::CurlCacheManager::didReceiveResponse):
3007         * platform/network/curl/CurlDownload.cpp:
3008         (WebCore::CurlDownload::~CurlDownload):
3009         (WebCore::CurlDownload::createCurlRequest):
3010         (WebCore::CurlDownload::curlDidReceiveResponse):
3011         (WebCore::CurlDownload::curlDidReceiveBuffer):
3012         (WebCore::CurlDownload::curlDidComplete):
3013         (WebCore::CurlDownload::curlDidFailWithError):
3014         (WebCore::CurlDownload::willSendRequest):
3015         * platform/network/curl/CurlDownload.h:
3016         * platform/network/curl/CurlRequest.cpp:
3017         (WebCore::CurlRequest::CurlRequest):
3018         (WebCore::CurlRequest::cancel):
3019         (WebCore::CurlRequest::callClient):
3020         (WebCore::CurlRequest::willSendData):
3021         (WebCore::CurlRequest::didReceiveData):
3022         (WebCore::CurlRequest::didReceiveDataFromMultipart):
3023         (WebCore::CurlRequest::didCompleteTransfer):
3024         (WebCore::CurlRequest::invokeDidReceiveResponse):
3025         * platform/network/curl/CurlRequest.h:
3026         (WebCore::CurlRequest::create):
3027         (WebCore::CurlRequest::invalidateClient):
3028         (WebCore::CurlRequest::setClient): Deleted.
3029         * platform/network/curl/CurlRequestClient.h:
3030         * platform/network/curl/CurlResourceHandleDelegate.cpp: Added.
3031         (WebCore::CurlResourceHandleDelegate::CurlResourceHandleDelegate):
3032         (WebCore::CurlResourceHandleDelegate::ref):
3033         (WebCore::CurlResourceHandleDelegate::deref):
3034         (WebCore::CurlResourceHandleDelegate::cancelledOrClientless):
3035         (WebCore::CurlResourceHandleDelegate::client const):
3036         (WebCore::CurlResourceHandleDelegate::d):
3037         (WebCore::CurlResourceHandleDelegate::curlDidSendData):
3038         (WebCore::handleCookieHeaders):
3039         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
3040         (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
3041         (WebCore::CurlResourceHandleDelegate::curlDidComplete):
3042         (WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
3043         * platform/network/curl/CurlResourceHandleDelegate.h: Added.
3044         (WebCore::CurlResourceHandleDelegate::response const):
3045         * platform/network/curl/ResourceHandleCurl.cpp:
3046         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
3047         (WebCore::ResourceHandle::start):
3048         (WebCore::ResourceHandle::cancel):
3049         (WebCore::ResourceHandle::cancelledOrClientless):
3050         (WebCore::ResourceHandle::createCurlRequest):
3051         (WebCore::ResourceHandle::delegate):
3052         (WebCore::ResourceHandle::platformSetDefersLoading):
3053         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3054         (WebCore::ResourceHandle::receivedCredential):
3055         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3056         (WebCore::ResourceHandle::getCredential):
3057         (WebCore::ResourceHandle::restartRequestWithCredential):
3058         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
3059         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
3060         (WebCore::ResourceHandle::continueAfterDidReceiveResponse):
3061         (WebCore::ResourceHandle::shouldRedirectAsGET):
3062         (WebCore::ResourceHandle::willSendRequest):
3063         (WebCore::ResourceHandle::continueAfterWillSendRequest):
3064         (WebCore::ResourceHandle::handleDataURL):
3065         * platform/network/curl/ResourceHandleCurlDelegate.cpp: Removed.
3066         * platform/network/curl/ResourceHandleCurlDelegate.h: Removed.
3067
3068 2018-02-16  Youenn Fablet  <youenn@apple.com>
3069
3070         Use ResourceLoader to load appcache manifest
3071         https://bugs.webkit.org/show_bug.cgi?id=182861
3072
3073         Reviewed by Alex Christensen.
3074
3075         Covered by updated tests.
3076
3077         Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
3078         Make use of it to load the app cache manifest.
3079         Future work should load entries using the same loader.
3080
3081         Remove manifest handle.
3082         Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
3083         is handled by its ApplicationCacheGroup.
3084
3085         Add a ResourceLoader option to bypass the application cache.
3086         Use it for manifest loading.
3087
3088         * Sources.txt:
3089         * WebCore.xcodeproj/project.pbxproj:
3090         * loader/DocumentLoader.cpp:
3091         (WebCore::DocumentLoader::addSubresourceLoader):
3092         * loader/ResourceLoaderOptions.h:
3093         * loader/appcache/ApplicationCacheGroup.cpp:
3094         (WebCore::ApplicationCacheGroup::stopLoading):
3095         (WebCore::ApplicationCacheGroup::update):
3096         (WebCore::ApplicationCacheGroup::createRequest):
3097         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
3098         (WebCore::ApplicationCacheGroup::didReceiveData):
3099         (WebCore::ApplicationCacheGroup::didFinishLoading):
3100         (WebCore::ApplicationCacheGroup::didFail):
3101         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
3102         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
3103         * loader/appcache/ApplicationCacheGroup.h:
3104         * loader/appcache/ApplicationCacheHost.cpp:
3105         (WebCore::ApplicationCacheHost::maybeLoadResource):
3106         (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
3107         (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
3108         (WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
3109         * loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
3110         * loader/appcache/ApplicationCacheResourceLoader.h: Added.
3111
3112 2018-02-16  Chris Dumez  <cdumez@apple.com>
3113
3114         Crash under WebCore::EventTarget::fireEventListeners
3115         https://bugs.webkit.org/show_bug.cgi?id=182880
3116         <rdar://problem/20788804>
3117
3118         Reviewed by Youenn Fablet.
3119
3120         Make sure the 'ended' event does not get dispatched on a
3121         AudioScheduledSourceNode after ActiveDOMObjects have been stopped.
3122
3123         Test: webaudio/audiobuffersource-ended-detached-frame.html
3124
3125         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3126         (WebCore::AudioScheduledSourceNode::finish):
3127
3128 2018-02-16  Jiewen Tan  <jiewen_tan@apple.com>
3129
3130         [WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
3131         https://bugs.webkit.org/show_bug.cgi?id=182771
3132         <rdar://problem/36459988>
3133
3134         Reviewed by Brent Fulgham.
3135
3136         This patch implements PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
3137         per https://www.w3.org/TR/webauthn/#isUserVerifyingPlatformAuthenticatorAvailable with some
3138         limitations.
3139
3140         In addition, it changes DeferredPromise to DOMPromiseDeferred<> for all CredentialsManagement
3141         and WebAuthN API.
3142
3143         Test: http/wpt/webauthn/public-key-is-user-verifying-platform-authenticator-available.html
3144
3145         * Modules/credentialmanagement/CredentialsContainer.cpp:
3146         (WebCore::CredentialsContainer::get):
3147         (WebCore::CredentialsContainer::store):
3148         (WebCore::CredentialsContainer::isCreate):
3149         (WebCore::CredentialsContainer::preventSilentAccess const):
3150         * Modules/credentialmanagement/CredentialsContainer.h:
3151         * Modules/credentialmanagement/CredentialsMessenger.cpp:
3152         (WebCore::CredentialsMessenger::addCreationCompletionHandler):
3153         Remove a redundant assertion.
3154         (WebCore::CredentialsMessenger::addRequestCompletionHandler):
3155         Remove a redundant assertion.
3156         (WebCore::CredentialsMessenger::addQueryCompletionHandler):
3157         (WebCore::CredentialsMessenger::takeQueryCompletionHandler):
3158         * Modules/credentialmanagement/CredentialsMessenger.h:
3159         * Modules/webauthn/AuthenticatorManager.cpp:
3160         (WebCore::AuthenticatorManagerInternal::initTimeoutTimer):
3161         (WebCore::AuthenticatorManager::create const):
3162         (WebCore::AuthenticatorManager::discoverFromExternalSource const):
3163         (WebCore::AuthenticatorManager::isUserVerifyingPlatformAuthenticatorAvailable const):
3164         * Modules/webauthn/AuthenticatorManager.h:
3165         * Modules/webauthn/PublicKeyCredential.cpp:
3166         (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
3167         * Modules/webauthn/PublicKeyCredential.h:
3168         * testing/MockCredentialsMessenger.cpp:
3169         (WebCore::MockCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
3170         (WebCore::MockCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
3171         * testing/MockCredentialsMessenger.h:
3172         * testing/MockCredentialsMessenger.idl:
3173
3174 2018-02-16  Tim Horton  <timothy_horton@apple.com>
3175
3176         Stop using EXCLUDED_SOURCE_FILE_NAMES for touch and gesture files in WebCore
3177         https://bugs.webkit.org/show_bug.cgi?id=182866
3178
3179         Reviewed by Daniel Bates.
3180
3181         * Configurations/WebCore.xcconfig:
3182         These generated files already have ENABLE() flags around them,
3183         so there's no reason to exclude them explicitly.
3184
3185 2018-02-16  Chris Dumez  <cdumez@apple.com>
3186
3187         Unreviewed, fix iOS build after r228562.
3188
3189         * workers/service/server/RegistrationDatabase.cpp:
3190         (WebCore::RegistrationDatabase::openSQLiteDatabase):
3191
3192 2018-02-16  Zalan Bujtas  <zalan@apple.com>
3193
3194         [RenderTreeBuilder] Move RenderElement::addChild() to RenderTreeBuilder
3195         https://bugs.webkit.org/show_bug.cgi?id=182878
3196         <rdar://problem/37608349>
3197
3198         Reviewed by Antti Koivisto.
3199
3200         This patch removes the last addChild() related mutation logic from the renderers.
3201
3202         No change in functionality.
3203
3204         * rendering/RenderElement.cpp:
3205         (WebCore::RenderElement::didInsertChild):
3206         (WebCore::RenderElement::addChild): Deleted.
3207         * rendering/RenderElement.h:
3208         (WebCore::RenderElement::isChildAllowed const):
3209         * rendering/updating/RenderTreeBuilder.cpp:
3210         (WebCore::RenderTreeBuilder::insertChild):
3211         (WebCore::RenderTreeBuilder::insertChildToRenderElement):
3212         * rendering/updating/RenderTreeBuilder.h:
3213         * rendering/updating/RenderTreeBuilderBlock.cpp:
3214         (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
3215         * rendering/updating/RenderTreeBuilderInline.cpp:
3216         (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
3217         * rendering/updating/RenderTreeBuilderSVG.cpp:
3218         (WebCore::RenderTreeBuilder::SVG::insertChild):
3219         * rendering/updating/RenderTreeBuilderTable.cpp:
3220         (WebCore::RenderTreeBuilder::Table::insertChild):
3221
3222 2018-02-16  Matt Lewis  <jlewis3@apple.com>
3223
3224         Unreviewed, rolling out r228546.
3225
3226         This caused a consistent crash on all macOS WK2 platforms.
3227
3228         Reverted changeset:
3229
3230         "Web Inspector: get rid of remaining uses of OptOutput<T>"
3231         https://bugs.webkit.org/show_bug.cgi?id=180607
3232         https://trac.webkit.org/changeset/228546
3233
3234 2018-02-16  Youenn Fablet  <youenn@apple.com>
3235
3236         Log the error message when failing to open the database
3237         https://bugs.webkit.org/show_bug.cgi?id=182795
3238         <rdar://problem/37592399>
3239
3240         Unreviewed.
3241         Fixing iOS simulator debug build.
3242
3243         * workers/service/server/RegistrationDatabase.cpp:
3244         (WebCore::RegistrationDatabase::openSQLiteDatabase):
3245
3246 2018-02-16  Fujii Hironori  <Hironori.Fujii@sony.com>
3247
3248         IndexedDB: Several test crash in when destroying a IDBKeyData
3249         https://bugs.webkit.org/show_bug.cgi?id=167576
3250
3251         Reviewed by Michael Catanzaro.
3252
3253         IDBKeyDataHashTraits::constructDeletedValue is using operator= to
3254         assign deletedValue. But, the value is destructed just before
3255         calling constructDeletedValue. You can't use operator= for a
3256         destructed value.
3257
3258         No new tests (Covered by existing tests).
3259
3260         * Modules/indexeddb/IDBKeyData.h:
3261         (WebCore::IDBKeyDataHashTraits::constructDeletedValue):
3262         Construct null value before assigning deletedValue.
3263
3264 2018-02-16  Zalan Bujtas  <zalan@apple.com>
3265
3266         [RenderTreeBuilder] Move RenderBlock/RenderBlockFlow::addChild() to RenderTreeBuilder
3267         https://bugs.webkit.org/show_bug.cgi?id=182862
3268         <rdar://problem/37595464>
3269
3270         Reviewed by Antti Koivisto.
3271
3272         No change in functionality.
3273
3274         * rendering/RenderBlock.cpp:
3275         (WebCore::RenderBlock::addChild): Deleted.
3276         * rendering/RenderBlock.h:
3277         * rendering/RenderBlockFlow.cpp:
3278         (WebCore::RenderBlockFlow::addChild): Deleted.
3279         * rendering/RenderBlockFlow.h:
3280         * rendering/updating/RenderTreeBuilder.cpp:
3281         (WebCore::RenderTreeBuilder::insertChild):
3282         (WebCore::RenderTreeBuilder::insertChildToRenderBlock): Deleted.
3283         (WebCore::RenderTreeBuilder::insertChildToRenderBlockFlow): Deleted.
3284         * rendering/updating/RenderTreeBuilder.h:
3285         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
3286         (WebCore::RenderTreeBuilder::BlockFlow::insertChild):
3287         * rendering/updating/RenderTreeBuilderFormControls.cpp:
3288         (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
3289         * rendering/updating/RenderTreeBuilderMathML.cpp:
3290         (WebCore::RenderTreeBuilder::MathML::makeFences):
3291         (WebCore::RenderTreeBuilder::MathML::insertChild):
3292         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3293         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
3294         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
3295         * rendering/updating/RenderTreeBuilderRuby.cpp:
3296         (WebCore::RenderTreeBuilder::Ruby::insertChild):
3297         (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
3298         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
3299         * rendering/updating/RenderTreeBuilderSVG.cpp:
3300         (WebCore::RenderTreeBuilder::SVG::insertChild):
3301
3302 2018-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3303
3304         [Extra zoom mode] Add basic support for <input type='date'> using date picker UI
3305         https://bugs.webkit.org/show_bug.cgi?id=182847
3306         <rdar://problem/35143111>
3307
3308         Reviewed by Tim Horton.
3309
3310         Add new localized strings for "month", "day" and "year" as they appear in the date picker.
3311
3312         * English.lproj/Localizable.strings:
3313         * platform/LocalizedStrings.cpp:
3314         (WebCore::textInputModeWriteButtonTitle):
3315         (WebCore::textInputModeSpeechButtonTitle):
3316         (WebCore::datePickerDayLabelTitle):
3317         (WebCore::datePickerMonthLabelTitle):
3318         (WebCore::datePickerYearLabelTitle):
3319         (WebCore::textInputModeWriteButton): Deleted.
3320         (WebCore::textInputModeSpeechButton): Deleted.
3321         * platform/LocalizedStrings.h:
3322
3323 2018-02-16  Zan Dobersek  <zdobersek@igalia.com>
3324
3325         HarfBuzzFace should operate with a FontPlatformData reference
3326         https://bugs.webkit.org/show_bug.cgi?id=182863
3327
3328         Reviewed by Carlos Garcia Campos.
3329
3330         Instead of keeping a never-null pointer to FontPlatformData,
3331         HarfBuzzFace should operate with a FontPlatformData reference.
3332
3333         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3334         (WebCore::FontPlatformData::harfBuzzFace const):
3335         * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
3336         (WebCore::HarfBuzzFace::HarfBuzzFace):
3337         * platform/graphics/harfbuzz/HarfBuzzFace.h:
3338         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
3339         (WebCore::HarfBuzzFace::createFace):
3340         (WebCore::HarfBuzzFace::createFont):
3341
3342 2018-02-15  Zalan Bujtas  <zalan@apple.com>
3343
3344         [RenderTreeBuilder] parent.Render*::addChild() cleanup
3345         https://bugs.webkit.org/show_bug.cgi?id=182842
3346         <rdar://problem/37585524>
3347
3348         Reviewed by Antti Koivisto.
3349
3350         No change in functionality.
3351
3352         * rendering/updating/RenderTreeBuilderBlock.cpp:
3353         (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
3354         * rendering/updating/RenderTreeBuilderFormControls.cpp:
3355         (WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded):
3356         * rendering/updating/RenderTreeBuilderInline.cpp:
3357         (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
3358         * rendering/updating/RenderTreeBuilderMathML.cpp:
3359         (WebCore::RenderTreeBuilder::MathML::makeFences):
3360         (WebCore::RenderTreeBuilder::MathML::insertChild):
3361         * rendering/updating/RenderTreeBuilderSVG.cpp:
3362         (WebCore::RenderTreeBuilder::SVG::insertChild):
3363         * rendering/updating/RenderTreeBuilderTable.cpp:
3364         (WebCore::RenderTreeBuilder::Table::insertChild):
3365
3366 2018-02-15  Megan Gardner  <megan_gardner@apple.com>
3367
3368         Support scrolling for non-editable web-selection and start autoscroll when near screen edges
3369         https://bugs.webkit.org/show_bug.cgi?id=182815
3370
3371         Reviewed by Tim Horton.
3372
3373         Adjust the position we are autoscrolling to so that when we are close to an edge, we will start autoscrolling
3374         while we are still inside the view. Autoscrolling still happens when you drag past the edge of a view.
3375
3376         No new tests (This is difficult to test in this state, but when we switch assistants, test will also be added).
3377
3378         * page/EventHandler.h:
3379         * page/ios/EventHandlerIOS.mm:
3380         (WebCore::EventHandler::startSelectionAutoscroll):
3381         (WebCore::EventHandler::cancelSelectionAutoscroll):
3382         (WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
3383         (WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const):
3384         (WebCore::EventHandler::startTextAutoscroll): Deleted.
3385         (WebCore::EventHandler::cancelTextAutoscroll): Deleted.
3386
3387 2018-02-15  Youenn Fablet  <youenn@apple.com>
3388
3389         Log the error message when failing to open the database
3390         https://bugs.webkit.org/show_bug.cgi?id=182795
3391
3392         Reviewed by Chris Dumez.
3393
3394         No change of behavior.
3395         Print the error message as it does not contain any user private information.
3396
3397         * workers/service/server/RegistrationDatabase.cpp:
3398         (WebCore::RegistrationDatabase::openSQLiteDatabase):
3399
3400 2018-02-15  Zalan Bujtas  <zalan@apple.com>
3401
3402         [RenderTreeBuilder] Move RenderMenuList::addChild() to RenderTreeBuilder
3403         https://bugs.webkit.org/show_bug.cgi?id=182840
3404         <rdar://problem/37583638>
3405
3406         Reviewed by Antti Koivisto.
3407
3408         No change in functionality.
3409
3410         * rendering/RenderMenuList.cpp:
3411         (RenderMenuList::didInsertChild):
3412         (RenderMenuList::addChild): Deleted.
3413         * rendering/RenderMenuList.h:
3414         * rendering/updating/RenderTreeBuilder.cpp:
3415         (WebCore::RenderTreeBuilder::insertChild):
3416         * rendering/updating/RenderTreeBuilderFormControls.cpp:
3417         (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
3418         (WebCore::RenderTreeBuilder::FormControls::insertChild):
3419         (WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded): Deleted.
3420         * rendering/updating/RenderTreeBuilderFormControls.h:
3421
3422 2018-02-15  Darin Adler  <darin@apple.com>
3423
3424         Web Inspector: get rid of remaining uses of OptOutput<T>
3425         https://bugs.webkit.org/show_bug.cgi?id=180607
3426
3427         Reviewed by Brian Burg.
3428
3429         * inspector/InspectorStyleSheet.cpp:
3430         (WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*.
3431         (WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead
3432         of lineEndings().get().
3433         (WebCore::InspectorStyle::styleWithProperties const): Ditto.
3434         (WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto.
3435         (WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of
3436         a std::unique_ptr<Vector>.
3437         (WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto.
3438         * inspector/InspectorStyleSheet.h: Updated for the above.
3439
3440         * inspector/agents/InspectorCSSAgent.h: Removed some bogus const.
3441         * inspector/agents/InspectorCanvasAgent.cpp: Ditto.
3442         * inspector/agents/InspectorCanvasAgent.h: Ditto.
3443
3444         * inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings
3445         so we don't waste space with a pointer to the string.
3446         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed
3447         explicit creation of String, which was wasteful and unnecessary.
3448         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto.
3449         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto.
3450         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto.
3451         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const.
3452
3453         * inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use
3454         final instead of override.
3455         * inspector/agents/InspectorPageAgent.cpp: Ditto.
3456         * inspector/agents/InspectorPageAgent.h: Ditto.
3457
3458 2018-02-15  Chris Dumez  <cdumez@apple.com>
3459
3460         Flaky Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker.html
3461         https://bugs.webkit.org/show_bug.cgi?id=182270
3462         <rdar://problem/36904314>
3463
3464         Reviewed by Antti Koivisto.
3465
3466         No new tests, already covered by existing tests that crash flakily on the bots.
3467
3468         * loader/ThreadableLoaderClientWrapper.h:
3469         (WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper):
3470         isolate copy the initiator string as this object can be destroyed on a different thread. This was
3471         causing the test to flakily crash as well when destroying ThreadLocalData.
3472
3473         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
3474         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3475         (scheduledWithCustomRunLoopMode):
3476         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
3477         Fix thread safety issue in callFunctionOnMainThread. This function is called from a background thread
3478         to get to the main thread. However, it relied on m_handle which would get nullified on the main thread
3479         by detachHandle when the ResourceHandle is destroyed. Fix the issue by not relying on m_handle anymore.
3480
3481         (-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]):
3482         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
3483         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
3484         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3485         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
3486         - Go back to using autorelease() instead of get() for the returned objects to match the code pre-r224522.
3487         - Dispatch the protectedSelf variables that were added in r227073 to the main thread to make sure we do
3488           not get destroyed on the background thread when protectedSelf is the last strong reference to self.
3489           Destroying the WebCoreResourceHandleAsOperationQueueDelegate on the background safe is unsafe due to
3490           its m_messageQueue data member which contains lambdas that may capture anything.
3491         - Add a Lock to protect against detachHandle getting called on the main thread and nulling out
3492           m_handle / m_requestResult / m_cachedResponseResult while the background thread may be accessing
3493           them.
3494
3495 2018-02-15  Zalan Bujtas  <zalan@apple.com>
3496
3497         [RenderTreeBuilder] Move RenderTableRow::addChild() to RenderTreeBuilder
3498         https://bugs.webkit.org/show_bug.cgi?id=182838
3499         <rdar://problem/37580762>
3500
3501         Reviewed by Antti Koivisto.
3502
3503         No change in functionality.
3504
3505         * rendering/RenderTableRow.cpp:
3506         (WebCore::RenderTableRow::didInsertTableCell):
3507         (WebCore::RenderTableRow::addChild): Deleted.
3508         * rendering/RenderTableRow.h:
3509         * rendering/updating/RenderTreeBuilder.cpp:
3510         (WebCore::RenderTreeBuilder::insertChild):
3511         (WebCore::RenderTreeBuilder::insertChildToRenderTableRow): Deleted.
3512         * rendering/updating/RenderTreeBuilder.h:
3513         * rendering/updating/RenderTreeBuilderTable.cpp:
3514         (WebCore::RenderTreeBuilder::Table::insertChild):
3515
3516 2018-02-15  Antoine Quint  <graouts@apple.com>
3517
3518         [Web Animations] Ensure that changing the timing model updates styles synchronously
3519         https://bugs.webkit.org/show_bug.cgi?id=182836
3520
3521         Reviewed by Dean Jackson.
3522
3523         We did not invalidate the timing model when properties of an effect's timing object changed
3524         and even when we did invalidate the timing model, we did not update styles on effect targets
3525         synchronously, only scheduling such updates for the next animation frame.
3526
3527         In this patch we expose the effect on the timing object such that changing timing properties
3528         can notify the effect of a change in the timing model, which can then be forwarded to the
3529         animation (which already informs its timeline, if any).
3530
3531         Additionally, when an animation's timing model has changed, we now invalidate the effect, which
3532         will update styles synchronously.
3533
3534         This produces a number of progressions in WPT tests.
3535
3536         * animation/AnimationEffectReadOnly.cpp:
3537         (WebCore::AnimationEffectReadOnly::AnimationEffectReadOnly): Set the timing object's effect upon
3538         effect construction.
3539         (WebCore::AnimationEffectReadOnly::~AnimationEffectReadOnly): Set the timing object's effect to
3540         null upon effect destruction.
3541         (WebCore::AnimationEffectReadOnly::timingDidChange): Notify the animation (if any) that its timing
3542         model changed following a change in the timing properties.
3543         * animation/AnimationEffectReadOnly.h: Add a new virtual invalidate() method that subclasses can
3544         override to implement invalidation behavior when the animation finds out its timing model changed.
3545         * animation/AnimationEffectTimingReadOnly.cpp: Notify the effect when a property changes such
3546         that it may notify its animation of a timing model change.
3547         (WebCore::AnimationEffectTimingReadOnly::propertyDidChange):
3548         (WebCore::AnimationEffectTimingReadOnly::setIterationStart):
3549         (WebCore::AnimationEffectTimingReadOnly::setIterations):
3550         (WebCore::AnimationEffectTimingReadOnly::setBindingsDuration):
3551         (WebCore::AnimationEffectTimingReadOnly::setEasing):
3552         (WebCore::AnimationEffectTimingReadOnly::setDelay):
3553         (WebCore::AnimationEffectTimingReadOnly::setEndDelay):
3554         (WebCore::AnimationEffectTimingReadOnly::setFill):
3555         (WebCore::AnimationEffectTimingReadOnly::setIterationDuration):
3556         (WebCore::AnimationEffectTimingReadOnly::setDirection):
3557         * animation/AnimationEffectTimingReadOnly.h:
3558         (WebCore::AnimationEffectTimingReadOnly::setEffect):
3559         (WebCore::AnimationEffectTimingReadOnly::setBindingsDelay):
3560         (WebCore::AnimationEffectTimingReadOnly::setBindingsEndDelay):
3561         (WebCore::AnimationEffectTimingReadOnly::setDelay): Deleted.
3562         (WebCore::AnimationEffectTimingReadOnly::setEndDelay): Deleted.
3563         (WebCore::AnimationEffectTimingReadOnly::setFill): Deleted.
3564         (WebCore::AnimationEffectTimingReadOnly::setIterationDuration): Deleted.
3565         (WebCore::AnimationEffectTimingReadOnly::setDirection): Deleted.
3566         * animation/AnimationTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange()
3567         to align it with the new WebAnimation::timingModelDidChange() method.
3568         (WebCore::AnimationTimeline::addAnimation):
3569         (WebCore::AnimationTimeline::removeAnimation):
3570         (WebCore::AnimationTimeline::setCurrentTime):
3571         * animation/AnimationTimeline.h:
3572         (WebCore::AnimationTimeline::timingModelDidChange):
3573         (WebCore::AnimationTimeline::animationTimingModelDidChange): Deleted.
3574         * animation/DocumentTimeline.cpp:
3575         (WebCore::DocumentTimeline::timingModelDidChange):
3576         (WebCore::DocumentTimeline::updateAnimations):
3577         (WebCore::DocumentTimeline::animationTimingModelDidChange): Deleted.
3578         * animation/DocumentTimeline.h:
3579         * animation/KeyframeEffectReadOnly.cpp:
3580         (WebCore::KeyframeEffectReadOnly::invalidate): Override the invalidate() method to perform a synchronous
3581         style update in order to ensure that timing properties are accounted for right as they change.
3582         * animation/KeyframeEffectReadOnly.h:
3583         * animation/WebAnimation.cpp:
3584         (WebCore::WebAnimation::timingModelDidChange): Invalidate the effect and notify the timeline of a timing
3585         model change when an animation is notified that its timing model has changed.
3586         (WebCore::WebAnimation::setStartTime):
3587         * animation/WebAnimation.h:
3588
3589 2018-02-15  Timothy Horton  <timothy_horton@apple.com>
3590
3591         Fix the build.
3592
3593         * platform/ios/KeyEventCodesIOS.h:
3594
3595 2018-02-15  John Wilander  <wilander@apple.com>
3596
3597         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
3598         https://bugs.webkit.org/show_bug.cgi?id=182812
3599         <rdar://problem/37511406>
3600
3601         Reviewed by Brent Fulgham.
3602
3603         No new tests. Tested manually between versions of Safari.
3604
3605         * loader/ResourceLoadStatistics.cpp:
3606         (WebCore::ResourceLoadStatistics::decode):
3607             Now only expects these fields for model version 11 or higher:
3608             - topFrameUniqueRedirectsTo
3609             - topFrameUniqueRedirectsFrom
3610             - subresourceUniqueRedirectsFrom
3611             - timesAccessedAsFirstPartyDueToUserInteraction
3612             - timesAccessedAsFirstPartyDueToStorageAccessAPI
3613         * loader/ResourceLoadStatistics.h:
3614
3615 2018-02-15  Tim Horton  <timothy_horton@apple.com>
3616
3617         Stop using EXCLUDED_SOURCE_FILE_NAMES for actual source files in WebCore
3618         https://bugs.webkit.org/show_bug.cgi?id=182822
3619
3620         Reviewed by Dan Bernstein.
3621
3622         It's much easier to reason about things if xcconfigs don't apply extra
3623         constraints to which source files actually build on a per-platform basis.
3624         We should use #ifs instead like we usually do.
3625
3626         * Configurations/WebCore.xcconfig:
3627         * Modules/geolocation/ios/GeolocationPositionIOS.mm:
3628         * accessibility/ios/AccessibilityObjectIOS.mm:
3629         * accessibility/mac/AXObjectCacheMac.mm:
3630         * accessibility/mac/AccessibilityObjectMac.mm:
3631         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
3632         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3633         * dom/DataTransferMac.mm:
3634         * editing/ios/DictationCommandIOS.cpp:
3635         * editing/ios/DictationCommandIOS.h:
3636         * editing/ios/EditorIOS.mm:
3637         * editing/ios/WebContentReaderIOS.mm:
3638         * editing/mac/EditorMac.mm:
3639         * editing/mac/WebContentReaderMac.mm:
3640         * page/ios/EventHandlerIOS.mm:
3641         * page/ios/FrameIOS.mm:
3642         * page/mac/EventHandlerMac.mm:
3643         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
3644         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
3645         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
3646         * platform/ThreadCheck.h:
3647         * platform/audio/ios/AudioDestinationIOS.h:
3648         * platform/audio/ios/AudioFileReaderIOS.h:
3649         * platform/audio/ios/MediaSessionManagerIOS.h:
3650         * platform/graphics/ios/DisplayRefreshMonitorIOS.h:
3651         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
3652         * platform/graphics/ios/FontCacheIOS.mm:
3653         * platform/graphics/ios/GraphicsContext3DIOS.h:
3654         * platform/graphics/ios/IconIOS.mm:
3655         * platform/graphics/mac/ColorMac.h:
3656         * platform/graphics/mac/ColorMac.mm:
3657         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
3658         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
3659         * platform/graphics/mac/IconMac.mm:
3660         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
3661         * platform/ios/CursorIOS.cpp:
3662         * platform/ios/DeviceMotionClientIOS.h:
3663         * platform/ios/DeviceOrientationClientIOS.h:
3664         * platform/ios/EventLoopIOS.mm:
3665         * platform/ios/KeyEventCodesIOS.h:
3666         * platform/ios/LowPowerModeNotifierIOS.mm:
3667         * platform/ios/PasteboardIOS.mm:
3668         * platform/ios/PlatformEventFactoryIOS.h:
3669         * platform/ios/PlatformEventFactoryIOS.mm:
3670         * platform/ios/PlatformPasteboardIOS.mm:
3671         * platform/ios/PlatformScreenIOS.mm:
3672         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
3673         * platform/ios/RemoteCommandListenerIOS.h:
3674         * platform/ios/RemoteCommandListenerIOS.mm:
3675         * platform/ios/SSLKeyGeneratorIOS.cpp:
3676         * platform/ios/ScrollAnimatorIOS.h:
3677         * platform/ios/ScrollAnimatorIOS.mm:
3678         * platform/ios/ScrollViewIOS.mm:
3679         * platform/ios/ScrollbarThemeIOS.h:
3680         * platform/ios/ScrollbarThemeIOS.mm:
3681         * platform/ios/SystemMemoryIOS.cpp:
3682         * platform/ios/ThemeIOS.h:
3683         * platform/ios/ThemeIOS.mm:
3684         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
3685         * platform/ios/TileControllerMemoryHandlerIOS.h:
3686         * platform/ios/UserAgentIOS.mm:
3687         * platform/ios/ValidationBubbleIOS.mm:
3688         * platform/ios/WidgetIOS.mm:
3689         * platform/mac/CursorMac.mm:
3690         * platform/mac/EventLoopMac.mm:
3691         * platform/mac/LocalCurrentGraphicsContext.h:
3692         * platform/mac/LocalCurrentGraphicsContext.mm:
3693         * platform/mac/NSScrollerImpDetails.h:
3694         * platform/mac/NSScrollerImpDetails.mm:
3695         * platform/mac/PasteboardMac.mm:
3696         * platform/mac/PlatformEventFactoryMac.h:
3697         * platform/mac/PlatformEventFactoryMac.mm:
3698         * platform/mac/PlatformPasteboardMac.mm:
3699         * platform/mac/PlatformScreenMac.mm:
3700         * platform/mac/PlatformSpeechSynthesizerMac.mm:
3701         * platform/mac/SSLKeyGeneratorMac.mm:
3702         * platform/mac/ScrollViewMac.mm:
3703         * platform/mac/ScrollbarThemeMac.h:
3704         * platform/mac/ScrollbarThemeMac.mm:
3705         * platform/mac/ThemeMac.h:
3706         * platform/mac/ThemeMac.mm:
3707         * platform/mac/ThreadCheck.mm:
3708         * platform/mac/UserAgentMac.mm:
3709         * platform/mac/WebCoreView.h:
3710         * platform/mac/WebCoreView.m:
3711         * platform/mac/WidgetMac.mm:
3712         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
3713         * platform/network/ios/NetworkStateNotifierIOS.mm:
3714         * platform/network/ios/WebCoreURLResponseIOS.h:
3715         * platform/network/ios/WebCoreURLResponseIOS.mm:
3716         * platform/network/mac/NetworkStateNotifierMac.cpp:
3717
3718 2018-02-15  Zalan Bujtas  <zalan@apple.com>
3719
3720         [RenderTreeBuilder] Move RenderTableSection::addChild() to RenderTreeBuilder
3721         https://bugs.webkit.org/show_bug.cgi?id=182835
3722         <rdar://problem/37579191>
3723
3724         Reviewed by Antti Koivisto.
3725
3726         No change in functionality.
3727
3728         * rendering/RenderTableSection.cpp:
3729         (WebCore::RenderTableSection::willInsertTableRow):
3730         (WebCore::RenderTableSection::addChild): Deleted.
3731         * rendering/RenderTableSection.h:
3732         * rendering/updating/RenderTreeBuilder.cpp:
3733         (WebCore::RenderTreeBuilder::insertChild): Leftover from r228529.
3734         (WebCore::RenderTreeBuilder::insertChildToRenderTable): Deleted. Leftover from r228529.
3735         (WebCore::RenderTreeBuilder::insertChildToRenderTableSection): Deleted.
3736         * rendering/updating/RenderTreeBuilder.h:
3737         * rendering/updating/RenderTreeBuilderTable.cpp:
3738         (WebCore::RenderTreeBuilder::Table::insertChild):
3739
3740 2018-02-15  Zalan Bujtas  <zalan@apple.com>
3741
3742         [RenderTreeBuilder] Move RenderTable::addChild() to RenderTreeBuilder
3743         https://bugs.webkit.org/show_bug.cgi?id=182832
3744         <rdar://problem/37576362>
3745
3746         Reviewed by Antti Koivisto.
3747
3748         No change in functionality.
3749
3750         * rendering/RenderTable.cpp:
3751         (WebCore::RenderTable::willInsertTableColumn):
3752         (WebCore::RenderTable::willInsertTableSection):
3753         (WebCore::RenderTable::addChild): Deleted.
3754         * rendering/RenderTable.h:
3755         * rendering/updating/RenderTreeBuilder.cpp:
3756         (WebCore::RenderTreeBuilder::insertChild):
3757         * rendering/updating/RenderTreeBuilderTable.cpp:
3758         (WebCore::RenderTreeBuilder::Table::insertChild):
3759
3760 2018-02-14  Darin Adler  <darin@apple.com>
3761
3762         Use std::make_unique instead of explicit calls to new and instead of writing create functions
3763         https://bugs.webkit.org/show_bug.cgi?id=182821
3764
3765         Reviewed by Anders Carlsson.
3766
3767         * loader/LinkLoader.cpp:
3768         (WebCore::createLinkPreloadResourceClient): Use std::make_unique insteadof create functions.
3769
3770         * loader/LinkPreloadResourceClients.h: Make constructors public, get rid of create functions,
3771         make overrides be private and final, get rid of unnecessary public default virtual destructors
3772         that the compiler will generate correctly without anything explicit.
3773
3774         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3775         (WebCore::CDMFactoryClearKey::createCDM): Use std::make_unique instead of std::unique_ptr/new.
3776
3777         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3778         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use
3779         std::make_unique instead of calling a create function.
3780         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3781         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Ditto.
3782         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3783         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
3784
3785         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: Made the constructor
3786         public and got rid of the create function.
3787         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
3788         (WebCore::VideoFullscreenLayerManager::create): Deleted.
3789
3790         * rendering/GridTrackSizingAlgorithm.cpp:
3791         (WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize const):
3792         Use std::make_unique instead of std::unique_ptr/new.
3793
3794 2018-02-15  Andy Estes  <aestes@apple.com>
3795
3796         Finish unifying Apple Pay and Payment Request sources
3797         https://bugs.webkit.org/show_bug.cgi?id=182831
3798
3799         Reviewed by Keith Miller.
3800
3801         * Sources.txt:
3802         * SourcesCocoa.txt:
3803         * WebCore.xcodeproj/project.pbxproj:
3804
3805 2018-02-15  Zan Dobersek  <zdobersek@igalia.com>
3806
3807         HarfBuzzFace: rework cache entry reference holding
3808         https://bugs.webkit.org/show_bug.cgi?id=182828
3809
3810         Reviewed by Michael Catanzaro.
3811
3812         Move the FaceCacheEntry and HarfBuzzFaceCache types into the
3813         HarfBuzzFace class as CacheEntry and Cache, respectively. The Cache
3814         singleton is also moved there.
3815
3816         In the HarfBuzzFace constructor, we now don't increase the CacheEntry
3817         reference, but instead just keep a reference to that object through
3818         a RefPtr<CacheEntry> object. We don't need to retrieve the hb_face_t
3819         object and the glyph cache HashMap in the constructor anymore, we just
3820         retrieve them when necessary through that CacheEntry reference.
3821
3822         In the destructor, that RefPtr<CacheEntry> object is nulled out before
3823         the object in Cache is removed if that's where the final reference is
3824         kept.
3825
3826         * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
3827         (WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
3828         (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
3829         (WebCore::HarfBuzzFace::cache):
3830         (WebCore::HarfBuzzFace::HarfBuzzFace):
3831         (WebCore::HarfBuzzFace::~HarfBuzzFace):
3832         (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
3833         (WebCore::FaceCacheEntry::create): Deleted.
3834         (WebCore::FaceCacheEntry::~FaceCacheEntry): Deleted.
3835         (WebCore::FaceCacheEntry::face): Deleted.
3836         (WebCore::FaceCacheEntry::glyphCache): Deleted.
3837         (WebCore::FaceCacheEntry::FaceCacheEntry): Deleted.
3838         (WebCore::harfBuzzFaceCache): Deleted.
3839         * platform/graphics/harfbuzz/HarfBuzzFace.h:
3840         (WebCore::HarfBuzzFace::CacheEntry::create):
3841         (WebCore::HarfBuzzFace::CacheEntry::face):
3842         (WebCore::HarfBuzzFace::CacheEntry::glyphCache):
3843         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
3844         (WebCore::harfBuzzGetGlyph):
3845         (WebCore::HarfBuzzFace::createFont):
3846
3847 2018-02-15  Zan Dobersek  <zdobersek@igalia.com>
3848
3849         FontPlatformData::harfBuzzFace() should return a reference
3850         https://bugs.webkit.org/show_bug.cgi?id=182825
3851
3852         Reviewed by Carlos Garcia Campos.
3853
3854         Have FontPlatformData::harfBuzzFace() return a reference instead of a
3855         pointer, given that the returned HarfBuzzFace object cannot be null.
3856
3857         Call-sites of FontPlatformData::harfBuzzFace() are adjusted.
3858         OpenTypeMathData constructors are also changed to not rely on
3859         preprocessor to correctly position the closing brace.
3860
3861         * platform/graphics/FontPlatformData.h:
3862         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3863         (WebCore::FontPlatformData::harfBuzzFace const):
3864         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
3865         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3866         * platform/graphics/opentype/OpenTypeMathData.cpp:
3867         (WebCore::OpenTypeMathData::OpenTypeMathData):
3868
3869 2018-02-15  Jiewen Tan  <jiewen_tan@apple.com>
3870
3871         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
3872         https://bugs.webkit.org/show_bug.cgi?id=181946
3873         <rdar://problem/37258262>
3874
3875         Reviewed by Chris Dumez.
3876
3877         This patch changes the original async model from a work queue to IPC between WebProcess
3878         and UIProcess. Since all authenticator operations must be handled in the UIProcess due
3879         to sandboxing, this message passing IPC async model then surpasses the original multi
3880         threading model. To cooperate that, a CredentialsMessenger class is then created and
3881         all task dispatching code is moved thre.
3882
3883         As an improvement over existing code, static functions from PublicKeyCredential are
3884         moved to AuthenticatorManager. AuthenticatorManager is made as a singleton such that
3885         when static functions are called, they could reach the CredentialsMessenger to interact
3886         with UIProccess. CredentialsMessenger and AuthenticatorManager are separated so later
3887         on when other Credential types are created, they can reuse the same IPC messenger.
3888
3889         What's more, a mock CredentialsMessenger is then created to mock behaviors of UIProcess
3890         for testing purpose.
3891
3892         Covered by existing tests.
3893
3894         * DerivedSources.make:
3895         * Modules/credentialmanagement/BasicCredential.h:
3896         * Modules/credentialmanagement/CredentialsContainer.cpp:
3897         (WebCore::CredentialsContainer::CredentialsContainer):
3898         (WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
3899         (WebCore::CredentialsContainer::get):
3900         (WebCore::CredentialsContainer::isCreate):
3901         (WebCore::CredentialsContainer::PendingPromise::PendingPromise): Deleted.
3902         (WebCore::CredentialsContainer::dispatchTask): Deleted.
3903         * Modules/credentialmanagement/CredentialsContainer.h:
3904         (WebCore::CredentialsContainer::PendingPromise::create): Deleted.
3905         * Modules/credentialmanagement/CredentialsMessenger.cpp: Added.
3906         (WebCore::CredentialsMessenger::exceptionReply):
3907         (WebCore::CredentialsMessenger::addCreationCompletionHandler):
3908         (WebCore::CredentialsMessenger::takeCreationCompletionHandler):
3909         (WebCore::CredentialsMessenger::addRequestCompletionHandler):
3910         (WebCore::CredentialsMessenger::takeRequestCompletionHandler):
3911         (WebCore::CredentialsMessenger::addQueryCompletionHandler):
3912         (WebCore::CredentialsMessenger::takeQueryCompletionHandler):
3913         (WebCore::getIdFromAttestationObject):
3914         * Modules/credentialmanagement/CredentialsMessenger.h: Added.
3915         (WebCore::CreationReturnBundle::CreationReturnBundle):
3916         (WebCore::AssertionReturnBundle::AssertionReturnBundle):
3917         (WebCore::CredentialsMessenger::weakPtrFactory const):
3918         * Modules/webauthn/Authenticator.cpp: Removed.
3919         * Modules/webauthn/Authenticator.h: Removed.
3920         * Modules/webauthn/AuthenticatorManager.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
3921         (WebCore::AuthenticatorManagerInternal::produceClientDataJson):
3922         (WebCore::AuthenticatorManagerInternal::produceClientDataJsonHash):
3923         (WebCore::AuthenticatorManagerInternal::initTimer):
3924         (WebCore::AuthenticatorManagerInternal::didTimerFire):
3925         (WebCore::AuthenticatorManager::singleton):
3926         (WebCore::AuthenticatorManager::setMessenger):
3927         (WebCore::AuthenticatorManager::create const):
3928         (WebCore::AuthenticatorManager::discoverFromExternalSource const):
3929         * Modules/webauthn/AuthenticatorManager.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3930         * Modules/webauthn/AuthenticatorResponse.h:
3931         * Modules/webauthn/PublicKeyCredential.cpp:
3932         (WebCore::PublicKeyCredentialInternal::produceClientDataJson): Deleted.
3933         (WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash): Deleted.
3934         (WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject): Deleted.
3935         (WebCore::PublicKeyCredential::collectFromCredentialStore): Deleted.
3936         (WebCore::PublicKeyCredential::discoverFromExternalSource): Deleted.
3937         (WebCore::PublicKeyCredential::store): Deleted.
3938         (WebCore::PublicKeyCredential::create): Deleted.
3939         (WebCore::PublicKeyCredential::rawId const): Deleted.
3940         (WebCore::PublicKeyCredential::response const): Deleted.
3941         * Modules/webauthn/PublicKeyCredential.h:
3942         * Sources.txt:
3943         * WebCore.xcodeproj/project.pbxproj:
3944         * testing/Internals.cpp:
3945         (WebCore::Internals::Internals):
3946         (WebCore::Internals::mockCredentialsMessenger const):
3947         * testing/Internals.h:
3948         * testing/Internals.idl:
3949         * testing/MockCredentialsMessenger.cpp: Added.
3950         (WebCore::MockCredentialsMessenger::MockCredentialsMessenger):
3951         (WebCore::MockCredentialsMessenger::~MockCredentialsMessenger):
3952         (WebCore::MockCredentialsMessenger::setAttestationObject):
3953         (WebCore::MockCredentialsMessenger::setAssertionReturnBundle):
3954         (WebCore::MockCredentialsMessenger::makeCredential):
3955         (WebCore::MockCredentialsMessenger::getAssertion):
3956         (WebCore::MockCredentialsMessenger::makeCredentialReply):
3957         (WebCore::MockCredentialsMessenger::getAssertionReply):
3958         * testing/MockCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3959         * testing/MockCredentialsMessenger.idl: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3960
3961 2018-02-15  Zalan Bujtas  <zalan@apple.com>
3962
3963         [RenderTreeBuilder] Move RenderInline/RenderGrid::addChild() to RenderTreeBuilder
3964         https://bugs.webkit.org/show_bug.cgi?id=182819
3965         <rdar://problem/37558187>
3966
3967         Reviewed by Antti Koivisto.
3968
3969         No change in functionality.
3970
3971         * rendering/RenderGrid.cpp:
3972         (WebCore::RenderGrid::addChild): Deleted.
3973         * rendering/RenderGrid.h: