Storage Access API: Make document.hasStorageAccess() retrieve current status from...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-12-17  John Wilander  <wilander@apple.com>
2
3         Storage Access API: Make document.hasStorageAccess() retrieve current status from the network process
4         https://bugs.webkit.org/show_bug.cgi?id=180681
5         <rdar://problem/35982161>
6
7         Reviewed by Alex Christensen.
8
9         Tests: http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-non-recent-user-interaction.html
10                http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html
11
12         This change makes an asynchronous request to the network process
13         to see if storage access has been granted for this frame, on this
14         page, for this domain.
15
16         * dom/Document.cpp:
17         (WebCore::Document::hasStorageAccess):
18         * page/ChromeClient.h:
19
20 2017-12-17  Chris Dumez  <cdumez@apple.com>
21
22         Strip fragment identifier from ServiceWorker's scriptURL
23         https://bugs.webkit.org/show_bug.cgi?id=180887
24
25         Reviewed by Darin Adler.
26
27         Strip fragment identifier from ServiceWorker's scriptURL to match Firefox and Chrome.
28         This behavior does not appear to be specified so I filed:
29         - https://github.com/w3c/ServiceWorker/issues/1249
30
31         No new tests, rebaselined existing test.
32
33         * workers/service/server/SWServerWorker.cpp:
34         (WebCore::m_script):
35
36 2017-12-17  Antti Koivisto  <antti@apple.com>
37
38         Move render tree updating related files under rendering/updating/
39         https://bugs.webkit.org/show_bug.cgi?id=180918
40
41         Reviewed by Darin Adler.
42
43         * CMakeLists.txt:
44         * Sources.txt:
45         * WebCore.xcodeproj/project.pbxproj:
46         * rendering/RenderTreeBuilder.cpp: Removed.
47         * rendering/RenderTreeBuilder.h: Removed.
48         * rendering/updating: Added.
49         * rendering/updating/RenderTreeBuilder.cpp: Copied from Source/WebCore/rendering/RenderTreeBuilder.cpp.
50         * rendering/updating/RenderTreeBuilder.h: Copied from Source/WebCore/rendering/RenderTreeBuilder.h.
51         * rendering/updating/RenderTreePosition.cpp: Copied from Source/WebCore/style/RenderTreePosition.cpp.
52         * rendering/updating/RenderTreePosition.h: Copied from Source/WebCore/style/RenderTreePosition.h.
53         * rendering/updating/RenderTreeUpdater.cpp: Copied from Source/WebCore/style/RenderTreeUpdater.cpp.
54         * rendering/updating/RenderTreeUpdater.h: Copied from Source/WebCore/style/RenderTreeUpdater.h.
55         * rendering/updating/RenderTreeUpdaterFirstLetter.cpp: Copied from Source/WebCore/style/RenderTreeUpdaterFirstLetter.cpp.
56         * rendering/updating/RenderTreeUpdaterFirstLetter.h: Copied from Source/WebCore/style/RenderTreeUpdaterFirstLetter.h.
57         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: Copied from Source/WebCore/style/RenderTreeUpdaterGeneratedContent.cpp.
58         * rendering/updating/RenderTreeUpdaterGeneratedContent.h: Copied from Source/WebCore/style/RenderTreeUpdaterGeneratedContent.h.
59         * rendering/updating/RenderTreeUpdaterListItem.cpp: Copied from Source/WebCore/style/RenderTreeUpdaterListItem.cpp.
60         * rendering/updating/RenderTreeUpdaterListItem.h: Copied from Source/WebCore/style/RenderTreeUpdaterListItem.h.
61         * rendering/updating/RenderTreeUpdaterMultiColumn.cpp: Copied from Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp.
62         * rendering/updating/RenderTreeUpdaterMultiColumn.h: Copied from Source/WebCore/style/RenderTreeUpdaterMultiColumn.h.
63         * style/RenderTreePosition.cpp: Removed.
64         * style/RenderTreePosition.h: Removed.
65         * style/RenderTreeUpdater.cpp: Removed.
66         * style/RenderTreeUpdater.h: Removed.
67         * style/RenderTreeUpdaterFirstLetter.cpp: Removed.
68         * style/RenderTreeUpdaterFirstLetter.h: Removed.
69         * style/RenderTreeUpdaterGeneratedContent.cpp: Removed.
70         * style/RenderTreeUpdaterGeneratedContent.h: Removed.
71         * style/RenderTreeUpdaterListItem.cpp: Removed.
72         * style/RenderTreeUpdaterListItem.h: Removed.
73         * style/RenderTreeUpdaterMultiColumn.cpp: Removed.
74         * style/RenderTreeUpdaterMultiColumn.h: Removed.
75
76 2017-12-17  Yusuke Suzuki  <utatane.tea@gmail.com>
77
78         [JSC][WebCore][CSSJIT] Remove VM reference in CSSJIT
79         https://bugs.webkit.org/show_bug.cgi?id=180917
80
81         Reviewed by Sam Weinig.
82
83         Remove VM reference in CSSJIT. CSSJIT should not be
84         bound to a specific VM.
85
86         No behavior change.
87
88         * css/ElementRuleCollector.cpp:
89         (WebCore::ElementRuleCollector::ruleMatches):
90         * cssjit/SelectorCompiler.cpp:
91         (WebCore::SelectorCompiler::compileSelector):
92         * cssjit/SelectorCompiler.h:
93         * dom/SelectorQuery.cpp:
94         (WebCore::SelectorDataList::compileSelector):
95         (WebCore::SelectorDataList::execute const):
96         * dom/SelectorQuery.h:
97
98 2017-12-16  Dan Bernstein  <mitz@apple.com>
99
100         WKWebView has no equivalent of -[WebView setAlwaysShowVerticalScroller:]
101         https://bugs.webkit.org/show_bug.cgi?id=180613
102         <rdar://problem/35946124>
103
104         Reviewed by Geoff Garen.
105
106         Test: TestWebKitAPI/Tests/WebKitCocoa/WKWebViewAlwaysShowsScroller.mm
107
108         * platform/ScrollView.h: Exported setScrollbarModes.
109
110 2017-12-16  Antti Koivisto  <antti@apple.com>
111
112         Introduce RenderTreeBuilder
113         https://bugs.webkit.org/show_bug.cgi?id=180817
114
115         Reviewed by Zalan Bujtas.
116
117         RenderTreeBuilder is responsible of building the render tree, including construction of various anonymous
118         renderers. Renderer subtype specific render tree construction code will eventually move there.
119
120         This patch adds RenderTreeBuilder class and passes it as a parameter for all addChild implementations.
121         Future patches can then mechanically move the building code from renderers to RenderTreeBuilder.
122
123         It also moves one addChild implementation (RenderRuby::addChild -> RenderTreeBuilder::rubyRunInsertChild)
124         to RenderTreeBuilder as a test.
125
126         * WebCore.xcodeproj/project.pbxproj:
127         * rendering/RenderBlock.cpp:
128         (WebCore::RenderBlock::addChildToContinuation):
129         (WebCore::RenderBlock::addChild):
130         (WebCore::RenderBlock::addChildIgnoringContinuation):
131         * rendering/RenderBlock.h:
132         * rendering/RenderBlockFlow.cpp:
133         (WebCore::RenderBlockFlow::addChild):
134         * rendering/RenderBlockFlow.h:
135         * rendering/RenderBoxModelObject.cpp:
136         (WebCore::RenderBoxModelObject::moveChildTo):
137         * rendering/RenderButton.cpp:
138         (WebCore::RenderButton::addChild):
139         (WebCore::RenderButton::setText):
140         * rendering/RenderButton.h:
141         * rendering/RenderElement.cpp:
142         (WebCore::RenderElement::addChild):
143         * rendering/RenderElement.h:
144         (WebCore::RenderElement::addChildIgnoringContinuation):
145         * rendering/RenderFullScreen.cpp:
146         (WebCore::RenderFullScreen::wrapNewRenderer):
147         (WebCore::RenderFullScreen::wrapExistingRenderer):
148         (WebCore::RenderFullScreen::unwrapRenderer):
149         (WebCore::RenderFullScreen::createPlaceholder):
150         * rendering/RenderGrid.cpp:
151         (WebCore::RenderGrid::addChild):
152         * rendering/RenderGrid.h:
153         * rendering/RenderInline.cpp:
154         (WebCore::RenderInline::addChild):
155         (WebCore::RenderInline::addChildIgnoringContinuation):
156         (WebCore::RenderInline::splitInlines):
157         (WebCore::RenderInline::splitFlow):
158         (WebCore::RenderInline::addChildToContinuation):
159         (WebCore::RenderInline::childBecameNonInline):
160         * rendering/RenderInline.h:
161         * rendering/RenderMenuList.cpp:
162         (WebCore::RenderMenuList::createInnerBlock):
163         (RenderMenuList::addChild):
164         (RenderMenuList::setText):
165         * rendering/RenderMenuList.h:
166         * rendering/RenderMultiColumnFlow.cpp:
167         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
168         * rendering/RenderQuote.cpp:
169         (WebCore::RenderQuote::updateTextRenderer):
170         (WebCore::RenderQuote::updateRenderer):
171         * rendering/RenderQuote.h:
172         * rendering/RenderRuby.cpp:
173         (WebCore::RenderRubyAsInline::addChild):
174         (WebCore::RenderRubyAsBlock::addChild):
175         * rendering/RenderRuby.h:
176         * rendering/RenderRubyBase.h:
177         * rendering/RenderRubyRun.cpp:
178         (WebCore::RenderRubyRun::rubyBaseSafe):
179         (WebCore::RenderRubyRun::addChild): Deleted.
180         * rendering/RenderRubyRun.h:
181         * rendering/RenderTable.cpp:
182         (WebCore::RenderTable::addChild):
183         * rendering/RenderTable.h:
184         * rendering/RenderTableRow.cpp:
185         (WebCore::RenderTableRow::addChild):
186         * rendering/RenderTableRow.h:
187         * rendering/RenderTableSection.cpp:
188         (WebCore::RenderTableSection::addChild):
189         * rendering/RenderTableSection.h:
190         * rendering/RenderTreeBuilder.cpp: Added.
191         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
192         (WebCore::RenderTreeBuilder::~RenderTreeBuilder):
193         (WebCore::RenderTreeBuilder::insertChild):
194         (WebCore::RenderTreeBuilder::rubyRunInsertChild):
195         * rendering/RenderTreeBuilder.h: Added.
196         (WebCore::RenderTreeBuilder::current):
197         * rendering/TextAutoSizing.cpp:
198         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
199         * rendering/mathml/RenderMathMLFenced.cpp:
200         (WebCore::RenderMathMLFenced::updateFromElement):
201         (WebCore::RenderMathMLFenced::makeFences):
202         (WebCore::RenderMathMLFenced::addChild):
203         * rendering/mathml/RenderMathMLFenced.h:
204         * rendering/svg/RenderSVGContainer.cpp:
205         (WebCore::RenderSVGContainer::addChild):
206         * rendering/svg/RenderSVGContainer.h:
207         * rendering/svg/RenderSVGInline.cpp:
208         (WebCore::RenderSVGInline::addChild):
209         * rendering/svg/RenderSVGInline.h:
210         * rendering/svg/RenderSVGRoot.cpp:
211         (WebCore::RenderSVGRoot::addChild):
212         * rendering/svg/RenderSVGRoot.h:
213         * rendering/svg/RenderSVGText.cpp:
214         (WebCore::RenderSVGText::addChild):
215         * rendering/svg/RenderSVGText.h:
216         * style/RenderTreePosition.cpp:
217         (WebCore::RenderTreePosition::insert): Deleted.
218         * style/RenderTreePosition.h:
219         (WebCore::RenderTreePosition::RenderTreePosition):
220         (WebCore::RenderTreePosition::nextSibling const):
221         (WebCore::RenderTreePosition::canInsert const): Deleted.
222         * style/RenderTreeUpdater.cpp:
223         (WebCore::RenderTreeUpdater::updateAfterDescendants):
224         (WebCore::RenderTreeUpdater::createRenderer):
225         (WebCore::RenderTreeUpdater::createTextRenderer):
226         (WebCore::RenderTreeUpdater::updateTextRenderer):
227         (WebCore::createTextRenderer): Deleted.
228         * style/RenderTreeUpdater.h:
229         * style/RenderTreeUpdaterFirstLetter.cpp:
230         (WebCore::updateFirstLetterStyle):
231         (WebCore::createFirstLetterRenderer):
232         * style/RenderTreeUpdaterGeneratedContent.cpp:
233         (WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):
234         (WebCore::createContentRenderers):
235         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
236         * style/RenderTreeUpdaterListItem.cpp:
237         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
238         * style/RenderTreeUpdaterListItem.h:
239         * style/RenderTreeUpdaterMultiColumn.cpp:
240         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
241         (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):
242
243 2017-12-16  Romain Bellessort  <romain.bellessort@crf.canon.fr>
244
245         [Readable Streams API] Fix filling of descriptor from queue
246         https://bugs.webkit.org/show_bug.cgi?id=172717
247
248         Reviewed by Youenn Fablet.
249
250         Fixed the filling of descriptor from queue (step 10.d at [1]). When first implemented,
251         spec comprised a bug and code was not reachable. Spec has now been fixed and code can
252         now be reached.
253
254         [1] https://streams.spec.whatwg.org/#readable-byte-stream-controller-fill-pull-into-descriptor-from-queue
255
256         No new tests (covered by WPT tests, whose expectations have been updated).
257
258         * Modules/streams/ReadableByteStreamInternals.js:
259         (readableByteStreamControllerFillDescriptorFromQueue): Updated.
260
261 2017-12-16  Brady Eidson  <beidson@apple.com>
262
263         Implement getting ServiceWorker registrations for the WKWebsiteDataStore API
264         https://bugs.webkit.org/show_bug.cgi?id=180886
265
266         Reviewed by Chris Dumez.
267
268         No new tests (API test coming soon).
269
270         * workers/service/server/SWServer.cpp:
271         (WebCore::SWServer::registrationStoreImportComplete):
272         (WebCore::SWServer::SWServer):
273         (WebCore::SWServer::getOriginsWithRegistrations):
274         (WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
275         * workers/service/server/SWServer.h:
276
277 2017-12-16  Yusuke Suzuki  <utatane.tea@gmail.com>
278
279         Remove unnecessary boolean result of start() functions
280         https://bugs.webkit.org/show_bug.cgi?id=180856
281
282         Reviewed by Darin Adler.
283
284         No behavior change.
285
286         * Modules/webaudio/AsyncAudioDecoder.cpp:
287         (WebCore::AsyncAudioDecoder::~AsyncAudioDecoder):
288         * Modules/webdatabase/DatabaseContext.cpp:
289         (WebCore::DatabaseContext::databaseThread):
290         * Modules/webdatabase/DatabaseThread.cpp:
291         (WebCore::DatabaseThread::start):
292         Now `Thread::create` always succeeds (if it fails, WebKit crashes).
293         DatabaseThread::start() now always returns true. So, we do not need
294         to return bool.
295
296         * Modules/webdatabase/DatabaseThread.h:
297         * platform/network/curl/CurlDownload.cpp:
298         (WebCore::CurlDownload::start):
299         * platform/network/curl/CurlDownload.h:
300         * platform/network/curl/ResourceHandleCurl.cpp:
301         (WebCore::ResourceHandle::start):
302         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
303         (WebCore::ResourceHandleCurlDelegate::start):
304         * platform/network/curl/ResourceHandleCurlDelegate.h:
305
306 2017-12-16  Chris Dumez  <cdumez@apple.com>
307
308         Add optimization when updating a SW registration results in the exact same script
309         https://bugs.webkit.org/show_bug.cgi?id=180891
310
311         Reviewed by Geoffrey Garen.
312
313         Add optimization when updating a SW registration results in the exact same script:
314         - https://w3c.github.io/ServiceWorker/#update-algorithm (step 8)
315
316         No new tests, rebaselined existing test.
317
318         * workers/service/server/SWServerJobQueue.cpp:
319         (WebCore::SWServerJobQueue::scriptFetchFinished):
320
321 2017-12-16  Youenn Fablet  <youenn@apple.com>
322
323         Service worker script fetch request should set the Service-Worker header
324         https://bugs.webkit.org/show_bug.cgi?id=180889
325
326         Reviewed by Chris Dumez.
327
328         Test: http/wpt/service-workers/check-service-worker-header.https.html
329
330         Update WorkerScriptLoader to take a request instead of an URL.
331         Updates Worker implementation and use it in ServiceWorkerJob to set the missing request header.
332
333         * workers/Worker.cpp:
334         (WebCore::Worker::create):
335         * workers/WorkerScriptLoader.cpp:
336         (WebCore::WorkerScriptLoader::loadAsynchronously):
337         * workers/WorkerScriptLoader.h:
338         * workers/service/ServiceWorkerJob.cpp:
339         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
340
341 2017-12-15  Ryan Haddad  <ryanhaddad@apple.com>
342
343         Unreviewed, rolling out r225969.
344
345         This change introduced LayoutTest crashes.
346
347         Reverted changeset:
348
349         "Introduce RenderTreeBuilder"
350         https://bugs.webkit.org/show_bug.cgi?id=180817
351         https://trac.webkit.org/changeset/225969
352
353 2017-12-15  Chris Dumez  <cdumez@apple.com>
354
355         Support updating a service worker registration's updateViaCache flag
356         https://bugs.webkit.org/show_bug.cgi?id=180888
357
358         Reviewed by Brady Eidson.
359
360         Support updating a service worker registration's updateViaCache flag to match other browsers:
361         - https://github.com/w3c/ServiceWorker/issues/1189
362
363         No new tests, rebaselined existing test.
364
365         * workers/service/SWClientConnection.cpp:
366         (WebCore::SWClientConnection::setRegistrationUpdateViaCache):
367         * workers/service/SWClientConnection.h:
368         * workers/service/ServiceWorkerRegistration.cpp:
369         (WebCore::ServiceWorkerRegistration::setUpdateViaCache):
370         * workers/service/ServiceWorkerRegistration.h:
371         * workers/service/server/SWServer.h:
372         * workers/service/server/SWServerJobQueue.cpp:
373         (WebCore::SWServerJobQueue::runRegisterJob):
374         * workers/service/server/SWServerRegistration.cpp:
375         (WebCore::SWServerRegistration::setUpdateViaCache):
376         * workers/service/server/SWServerRegistration.h:
377
378 2017-12-15  Ryan Haddad  <ryanhaddad@apple.com>
379
380         Unreviewed, rolling out r225941.
381
382         This change introduced LayoutTest crashes and assertion
383         failures.
384
385         Reverted changeset:
386
387         "Web Inspector: replace HTMLCanvasElement with
388         CanvasRenderingContext for instrumentation logic"
389         https://bugs.webkit.org/show_bug.cgi?id=180770
390         https://trac.webkit.org/changeset/225941
391
392 2017-12-15  Ryosuke Niwa  <rniwa@webkit.org>
393
394         Add a release assert that Timer::m_wasDeleted is false in setNextFireTime
395         https://bugs.webkit.org/show_bug.cgi?id=180860
396         <rdar://problem/36066500>
397
398         Reviewed by David Kilzer.
399
400         Turn an exist debug-only assertion into a release assertion to help diagnose a crash
401         which appears to be caused by a freed timer getting scheduled back into the timer heap.
402
403         * platform/Timer.cpp:
404         (WebCore::TimerBase::~TimerBase):
405         (WebCore::TimerBase::setNextFireTime):
406         * platform/Timer.h:
407
408 2017-12-15  Simon Fraser  <simon.fraser@apple.com>
409
410         Elements animated on-screen are missing sometimes
411         https://bugs.webkit.org/show_bug.cgi?id=180773
412         rdar://problem/34923438
413
414         Reviewed by Zalan Bujtas.
415         
416         After r225310 it was still possible for elements to be missing backing store when brought
417         on-screen via an animation. This occurred if a child element was outside the bounds of the
418         element being animated.
419
420         Fix by making sure that GraphicsLayer's "animatedExtent" took composited child layers into account.
421
422         As for r225310, no test because this is timing sensitive and hard to reliably make a test for.
423
424         * rendering/RenderLayer.cpp:
425         (WebCore::RenderLayer::calculateClipRects const):
426         * rendering/RenderLayer.h:
427         * rendering/RenderLayerBacking.cpp:
428         (WebCore::RenderLayerBacking::updateGeometry):
429
430 2017-12-15  Chris Dumez  <cdumez@apple.com>
431
432         imported/w3c/web-platform-tests/service-workers/service-worker/update.https.html is sometimes crashing in Debug builds
433         https://bugs.webkit.org/show_bug.cgi?id=180867
434
435         Reviewed by Brady Eidson.
436
437         Fix assertion to make sure the worker is terminating if it is already in m_runningOrTerminatingWorkers.
438
439         * workers/service/server/SWServer.cpp:
440         (WebCore::SWServer::runServiceWorker):
441
442 2017-12-15  Chris Dumez  <cdumez@apple.com>
443
444         Service Worker Registration promise is sometimes not rejected when the script load fails
445         https://bugs.webkit.org/show_bug.cgi?id=180849
446
447         Reviewed by Brady Eidson.
448
449         Service Worker Registration promise is sometimes not rejected when the script load fails.
450         This was caused by the ServiceWorkerJob sometimes passing a null ResourceError to the
451         StorageProcess, even though the load failed.
452
453         No new tests, rebaselined exisiting tests.
454
455         * workers/WorkerScriptLoader.cpp:
456         (WebCore::WorkerScriptLoader::notifyError):
457         * workers/service/ServiceWorkerJob.cpp:
458         (WebCore::ServiceWorkerJob::notifyFinished):
459
460 2017-12-15  Youenn Fablet  <youenn@apple.com>
461
462         WebRTC Stats should not be console logged from a background thread
463         https://bugs.webkit.org/show_bug.cgi?id=180845
464
465         Reviewed by Eric Carlson.
466
467         Ensuring console log are done in the main thread.
468
469         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
470         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
471
472 2017-12-15  Antti Koivisto  <antti@apple.com>
473
474         Introduce RenderTreeBuilder
475         https://bugs.webkit.org/show_bug.cgi?id=180817
476
477         Reviewed by Zalan Bujtas.
478
479         RenderTreeBuilder is responsible of building the render tree, including construction of various anonymous
480         renderers. Renderer subtype specific render tree construction code will eventually move there.
481
482         This patch adds RenderTreeBuilder class and passes it as a parameter for all addChild implementations.
483         Future patches can then mechanically move the building code from renderers to RenderTreeBuilder.
484
485         It also moves one addChild implementation (RenderRuby::addChild -> RenderTreeBuilder::rubyRunInsertChild)
486         to RenderTreeBuilder as a test.
487
488         * WebCore.xcodeproj/project.pbxproj:
489         * rendering/RenderBlock.cpp:
490         (WebCore::RenderBlock::addChildToContinuation):
491         (WebCore::RenderBlock::addChild):
492         (WebCore::RenderBlock::addChildIgnoringContinuation):
493         * rendering/RenderBlock.h:
494         * rendering/RenderBlockFlow.cpp:
495         (WebCore::RenderBlockFlow::addChild):
496         * rendering/RenderBlockFlow.h:
497         * rendering/RenderBoxModelObject.cpp:
498         (WebCore::RenderBoxModelObject::moveChildTo):
499         * rendering/RenderButton.cpp:
500         (WebCore::RenderButton::addChild):
501         (WebCore::RenderButton::setText):
502         * rendering/RenderButton.h:
503         * rendering/RenderElement.cpp:
504         (WebCore::RenderElement::addChild):
505         * rendering/RenderElement.h:
506         (WebCore::RenderElement::addChildIgnoringContinuation):
507         * rendering/RenderFullScreen.cpp:
508         (WebCore::RenderFullScreen::wrapNewRenderer):
509         (WebCore::RenderFullScreen::wrapExistingRenderer):
510         (WebCore::RenderFullScreen::unwrapRenderer):
511         (WebCore::RenderFullScreen::createPlaceholder):
512         * rendering/RenderGrid.cpp:
513         (WebCore::RenderGrid::addChild):
514         * rendering/RenderGrid.h:
515         * rendering/RenderInline.cpp:
516         (WebCore::RenderInline::addChild):
517         (WebCore::RenderInline::addChildIgnoringContinuation):
518         (WebCore::RenderInline::splitInlines):
519         (WebCore::RenderInline::splitFlow):
520         (WebCore::RenderInline::addChildToContinuation):
521         (WebCore::RenderInline::childBecameNonInline):
522         * rendering/RenderInline.h:
523         * rendering/RenderMenuList.cpp:
524         (WebCore::RenderMenuList::createInnerBlock):
525         (RenderMenuList::addChild):
526         (RenderMenuList::setText):
527         * rendering/RenderMenuList.h:
528         * rendering/RenderMultiColumnFlow.cpp:
529         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
530         * rendering/RenderQuote.cpp:
531         (WebCore::RenderQuote::updateTextRenderer):
532         (WebCore::RenderQuote::updateRenderer):
533         * rendering/RenderQuote.h:
534         * rendering/RenderRuby.cpp:
535         (WebCore::RenderRubyAsInline::addChild):
536         (WebCore::RenderRubyAsBlock::addChild):
537         * rendering/RenderRuby.h:
538         * rendering/RenderRubyBase.h:
539         * rendering/RenderRubyRun.cpp:
540         (WebCore::RenderRubyRun::rubyBaseSafe):
541         (WebCore::RenderRubyRun::addChild): Deleted.
542         * rendering/RenderRubyRun.h:
543         * rendering/RenderTable.cpp:
544         (WebCore::RenderTable::addChild):
545         * rendering/RenderTable.h:
546         * rendering/RenderTableRow.cpp:
547         (WebCore::RenderTableRow::addChild):
548         * rendering/RenderTableRow.h:
549         * rendering/RenderTableSection.cpp:
550         (WebCore::RenderTableSection::addChild):
551         * rendering/RenderTableSection.h:
552         * rendering/RenderTreeBuilder.cpp: Added.
553         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
554         (WebCore::RenderTreeBuilder::~RenderTreeBuilder):
555         (WebCore::RenderTreeBuilder::insertChild):
556         (WebCore::RenderTreeBuilder::rubyRunInsertChild):
557         * rendering/RenderTreeBuilder.h: Added.
558         (WebCore::RenderTreeBuilder::current):
559         * rendering/TextAutoSizing.cpp:
560         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
561         * rendering/mathml/RenderMathMLFenced.cpp:
562         (WebCore::RenderMathMLFenced::updateFromElement):
563         (WebCore::RenderMathMLFenced::makeFences):
564         (WebCore::RenderMathMLFenced::addChild):
565         * rendering/mathml/RenderMathMLFenced.h:
566         * rendering/svg/RenderSVGContainer.cpp:
567         (WebCore::RenderSVGContainer::addChild):
568         * rendering/svg/RenderSVGContainer.h:
569         * rendering/svg/RenderSVGInline.cpp:
570         (WebCore::RenderSVGInline::addChild):
571         * rendering/svg/RenderSVGInline.h:
572         * rendering/svg/RenderSVGRoot.cpp:
573         (WebCore::RenderSVGRoot::addChild):
574         * rendering/svg/RenderSVGRoot.h:
575         * rendering/svg/RenderSVGText.cpp:
576         (WebCore::RenderSVGText::addChild):
577         * rendering/svg/RenderSVGText.h:
578         * style/RenderTreePosition.cpp:
579         (WebCore::RenderTreePosition::insert): Deleted.
580         * style/RenderTreePosition.h:
581         (WebCore::RenderTreePosition::RenderTreePosition):
582         (WebCore::RenderTreePosition::nextSibling const):
583         (WebCore::RenderTreePosition::canInsert const): Deleted.
584         * style/RenderTreeUpdater.cpp:
585         (WebCore::RenderTreeUpdater::updateAfterDescendants):
586         (WebCore::RenderTreeUpdater::createRenderer):
587         (WebCore::RenderTreeUpdater::createTextRenderer):
588         (WebCore::RenderTreeUpdater::updateTextRenderer):
589         (WebCore::createTextRenderer): Deleted.
590         * style/RenderTreeUpdater.h:
591         * style/RenderTreeUpdaterFirstLetter.cpp:
592         (WebCore::updateFirstLetterStyle):
593         (WebCore::createFirstLetterRenderer):
594         * style/RenderTreeUpdaterGeneratedContent.cpp:
595         (WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):
596         (WebCore::createContentRenderers):
597         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
598         * style/RenderTreeUpdaterListItem.cpp:
599         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
600         * style/RenderTreeUpdaterListItem.h:
601         * style/RenderTreeUpdaterMultiColumn.cpp:
602         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
603         (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):
604
605 2017-12-14  Youenn Fablet  <youenn@apple.com>
606
607         Implement <iframe allow="camera; microphone">
608         https://bugs.webkit.org/show_bug.cgi?id=167430
609
610         Reviewed by Eric Carlson.
611
612         Tests: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.sub.html
613
614         Adding allow attribute to HTMLIFrameElement as per https://wicg.github.io/feature-policy/#iframe-allow-attribute.
615         Cross-origin iframes will get access to camera/microphone based on this attribute value.
616         Same-origin iframes do not need any attribute.
617         In case getUserMedia requests both camera and microphone, and allow attribute is only one of these,
618         getUserMedia access is denied. This goes against the tests but is not very clear from the specification.
619
620         * Modules/mediastream/UserMediaRequest.cpp:
621         (WebCore::isSecure):
622         (WebCore::isAllowedToUse):
623         (WebCore::canCallGetUserMedia):
624         (WebCore::UserMediaRequest::start):
625         * html/HTMLAttributeNames.in:
626         * html/HTMLIFrameElement.cpp:
627         (WebCore::HTMLIFrameElement::parseAttribute):
628         * html/HTMLIFrameElement.h:
629         * html/HTMLIFrameElement.idl:
630
631 2017-12-14  Zalan Bujtas  <zalan@apple.com>
632
633         Inconsistent section grid could lead to CrashOnOverflow
634         https://bugs.webkit.org/show_bug.cgi?id=180850
635         <rdar://problem/34064811>
636
637         Reviewed by Simon Fraser.
638
639         Each RenderTableSection maintains a grid of rows and columns. The number of columns in this grid equals the
640         maximum number of columns in the entire table (taking spans and multiple sections into account).
641         Since the maximum number of columns might change while re-computing the sections, we need to
642         adjust them accordingly at the end (otherwise it could lead to inconsistent grids where rows have different number of columns).
643
644         Test: fast/table/table-row-oveflow-crash.html
645
646         * rendering/RenderTable.cpp:
647         (WebCore::RenderTable::recalcSections const):
648         * rendering/RenderTableSection.cpp:
649         (WebCore::RenderTableSection::removeRedundantColumns):
650         * rendering/RenderTableSection.h:
651
652 2017-12-14  David Kilzer  <ddkilzer@apple.com>
653
654         Enable -Wstrict-prototypes for WebKit
655         <https://webkit.org/b/180757>
656         <rdar://problem/36024132>
657
658         Rubber-stamped by Joseph Pecoraro.
659
660         * Configurations/Base.xcconfig:
661         (CLANG_WARN_STRICT_PROTOTYPES): Add. Set to YES.
662
663 2017-12-14  Youenn Fablet  <youenn@apple.com>
664
665         srflx and relay ICE candidates lack raddr (rel-addr) and rport (rel-port) attributes if getUserMedia access has not been granted
666         https://bugs.webkit.org/show_bug.cgi?id=180842
667
668         Reviewed by Jon Lee.
669
670         Manually tested since there is no way to gather reflexive or stun candidates in WebKit CI.
671
672         * Modules/mediastream/PeerConnectionBackend.cpp:
673         (WebCore::filterICECandidate):
674
675 2017-12-14  Commit Queue  <commit-queue@webkit.org>
676
677         Unreviewed, rolling out r225878.
678         https://bugs.webkit.org/show_bug.cgi?id=180855
679
680         Introduced a crash in HTMLPictureElement. We're taking a
681         different approach for webkit.org/b/180769 (Requested by rniwa
682         on #webkit).
683
684         Reverted changeset:
685
686         "Crash inside ImageLoader::updateFromElement()"
687         https://bugs.webkit.org/show_bug.cgi?id=180769
688         https://trac.webkit.org/changeset/225878
689
690 2017-12-14  Ryan Haddad  <ryanhaddad@apple.com>
691
692         Unreviewed, rolling out r225931.
693
694         Breaks internal builds.
695
696         Reverted changeset:
697
698         "Fix Mac CMake build"
699         https://bugs.webkit.org/show_bug.cgi?id=180835
700         https://trac.webkit.org/changeset/225931
701
702 2017-12-14  Simon Fraser  <simon.fraser@apple.com>
703
704         Another Windows build fix.
705
706         * platform/graphics/cg/GraphicsContextCG.cpp:
707         (WebCore::extendedSRGBColorSpaceRef):
708
709 2017-12-14  Simon Fraser  <simon.fraser@apple.com>
710
711         Fix Windows build after r225915.
712
713         Windows doens't have dispatch_once with blocks. Switch to use lambda functions instead.
714
715         * platform/graphics/cg/GraphicsContextCG.cpp:
716         (WebCore::sRGBColorSpaceRef):
717         (WebCore::linearRGBColorSpaceRef):
718         (WebCore::extendedSRGBColorSpaceRef):
719         (WebCore::displayP3ColorSpaceRef):
720
721 2017-12-14  Devin Rousso  <webkit@devinrousso.com>
722
723         Web Inspector: replace HTMLCanvasElement with CanvasRenderingContext for instrumentation logic
724         https://bugs.webkit.org/show_bug.cgi?id=180770
725
726         Reviewed by Joseph Pecoraro.
727
728         No change in functionality.
729
730         * html/canvas/CanvasRenderingContext.h:
731         * html/canvas/CanvasRenderingContext.cpp:
732         (WebCore::CanvasRenderingContext::~CanvasRenderingContext):
733         Instead of waiting on the HTMLCanvasElement to destruct to call willDestroyCanvasRenderingContext
734         we can call out in the destructor and know that the CanvasRenderingContext will be destroyed
735         immediately thereafter.
736
737         * html/canvas/CanvasRenderingContext2D.h:
738         * html/canvas/CanvasRenderingContext2D.cpp:
739         (WebCore::CanvasRenderingContext2D::create):
740         * html/canvas/ImageBitmapRenderingContext.h:
741         * html/canvas/ImageBitmapRenderingContext.cpp:
742         (WebCore::ImageBitmapRenderingContext::create):
743         * html/canvas/WebGL2RenderingContext.h:
744         * html/canvas/WebGL2RenderingContext.cpp:
745         (WebCore::WebGL2RenderingContext::create):
746         * html/canvas/WebGLRenderingContext.h:
747         * html/canvas/WebGLRenderingContext.cpp:
748         (WebCore::WebGLRenderingContext::create):
749         * html/canvas/WebGLRenderingContextBase.cpp:
750         (WebCore::WebGLRenderingContextBase::create):
751         * html/canvas/WebGPURenderingContext.cpp:
752         (WebCore::WebGPURenderingContext::create):
753         * html/HTMLCanvasElement.cpp:
754         (WebCore::HTMLCanvasElement::createContext2d):
755         (WebCore::HTMLCanvasElement::createContextWebGL):
756         (WebCore::HTMLCanvasElement::createContextWebGPU):
757         (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
758         (WebCore::HTMLCanvasElement::paint):
759         (WebCore::HTMLCanvasElement::setImageBuffer const):
760         Instead of adding didCreateCanvasRenderingContext calls at the construction sites of each
761         context, we can make the constructors private and force the usage of static `create` functions.
762         This way, we have access to the fully constructed object and have a guaranteed path for creation.
763
764         * inspector/InspectorCanvas.h:
765         * inspector/InspectorCanvas.cpp:
766         (WebCore::InspectorCanvas::create):
767         (WebCore::InspectorCanvas::InspectorCanvas):
768         (WebCore::InspectorCanvas::canvasElement):
769         (WebCore::InspectorCanvas::resetRecordingData):
770         (WebCore::InspectorCanvas::recordAction):
771         (WebCore::InspectorCanvas::buildObjectForCanvas):
772         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
773         (WebCore::InspectorCanvas::buildInitialState):
774         
775         * inspector/InspectorShaderProgram.h:
776         * inspector/InspectorShaderProgram.cpp:
777         (WebCore::InspectorShaderProgram::context const):
778
779         * inspector/agents/InspectorCanvasAgent.h:
780         * inspector/agents/InspectorCanvasAgent.cpp:
781         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
782         (WebCore::InspectorCanvasAgent::enable):
783         (WebCore::InspectorCanvasAgent::disable):
784         (WebCore::InspectorCanvasAgent::requestNode):
785         (WebCore::InspectorCanvasAgent::requestContent):
786         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
787         (WebCore::contextAsScriptValue):
788         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
789         (WebCore::InspectorCanvasAgent::startRecording):
790         (WebCore::InspectorCanvasAgent::stopRecording):
791         (WebCore::InspectorCanvasAgent::updateShader):
792         (WebCore::InspectorCanvasAgent::frameNavigated):
793         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
794         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
795         (WebCore::InspectorCanvasAgent::willDestroyCanvasRenderingContext):
796         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
797         (WebCore::InspectorCanvasAgent::recordCanvasAction):
798         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
799         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
800         (WebCore::InspectorCanvasAgent::didEnableExtension):
801         (WebCore::InspectorCanvasAgent::didCreateProgram):
802         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
803         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
804         (WebCore::InspectorCanvasAgent::clearCanvasData):
805         (WebCore::InspectorCanvasAgent::unbindCanvas):
806         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
807         (WebCore::InspectorCanvasAgent::unbindProgram):
808         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas): Deleted.
809         (WebCore::InspectorCanvasAgent::canvasDestroyed): Deleted.
810
811         * inspector/InspectorInstrumentation.h:
812         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
813         (WebCore::InspectorInstrumentation::willDestroyCanvasRenderingContext):
814         (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
815         (WebCore::InspectorInstrumentation::recordCanvasAction):
816         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
817         (WebCore::InspectorInstrumentation::didEnableExtension):
818         (WebCore::InspectorInstrumentation::didCreateProgram):
819         (WebCore::InspectorInstrumentation::willDeleteProgram):
820         (WebCore::InspectorInstrumentation::isShaderProgramDisabled):
821         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
822         (WebCore::InspectorInstrumentation::didCreateCSSCanvas): Deleted.
823         * inspector/InspectorInstrumentation.cpp:
824         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvasImpl):
825         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
826         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
827         (WebCore::InspectorInstrumentation::willDestroyCanvasRenderingContextImpl):
828         (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
829         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
830         (WebCore::InspectorInstrumentation::didEnableExtensionImpl):
831         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
832         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl): Deleted.
833
834         * page/PageConsoleClient.cpp:
835         (WebCore::PageConsoleClient::record):
836         (WebCore::PageConsoleClient::recordEnd):
837
838         * dom/Document.h:
839         * dom/Document.cpp:
840         (WebCore::Document::getCSSCanvasElement):
841         (WebCore::Document::nameForCSSCanvasElement const):
842         We have no reason to save the CSS canvas name for each InspectorCanvas object, so instead we
843         can just query for the name based on the CanvasRenderingContext's HTMLCanvasElement (assuming
844         it is not an OffscreenCanvas) when we need it.
845
846 2017-12-14  Chris Dumez  <cdumez@apple.com>
847
848         self.importScripts() should obey updateViaCache inside service workers
849         https://bugs.webkit.org/show_bug.cgi?id=180826
850
851         Reviewed by Youenn Fablet.
852
853         self.importScripts() should obey updateViaCache inside service workers, as per:
854         - https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts
855
856         Tests: http/tests/workers/service/registration-updateViaCache-all-importScripts.html
857                http/tests/workers/service/registration-updateViaCache-imports-importScripts.html
858                http/tests/workers/service/registration-updateViaCache-none-importScripts.html
859
860         * workers/WorkerGlobalScope.cpp:
861         (WebCore::WorkerGlobalScope::importScripts):
862         * workers/WorkerScriptLoader.cpp:
863         (WebCore::WorkerScriptLoader::loadSynchronously):
864         * workers/WorkerScriptLoader.h:
865         * workers/service/SWClientConnection.cpp:
866         (WebCore::SWClientConnection::setRegistrationLastUpdateTime):
867         * workers/service/SWClientConnection.h:
868         * workers/service/ServiceWorkerRegistration.cpp:
869         (WebCore::ServiceWorkerRegistration::lastUpdateTime const):
870         (WebCore::ServiceWorkerRegistration::setLastUpdateTime):
871         * workers/service/ServiceWorkerRegistration.h:
872         * workers/service/server/SWServer.h:
873         * workers/service/server/SWServerRegistration.cpp:
874         (WebCore::SWServerRegistration::setLastUpdateTime):
875         * workers/service/server/SWServerRegistration.h:
876
877 2017-12-14  Yusuke Suzuki  <utatane.tea@gmail.com>
878
879         Drop Thread::tryCreate
880         https://bugs.webkit.org/show_bug.cgi?id=180808
881
882         Reviewed by Darin Adler.
883
884         This change reveals that nobody cares the WorkerThread::start's failure.
885         We should use `Thread::create` to ensure thread is actually starting.
886
887         * workers/WorkerThread.cpp:
888         (WebCore::WorkerThread::start):
889         * workers/WorkerThread.h:
890
891 2017-12-14  Alicia Boya García  <aboya@igalia.com>
892
893         [MSE] Add isValid() check before using trackBuffer.lastEnqueuedPresentationTime
894         https://bugs.webkit.org/show_bug.cgi?id=180258
895
896         Reviewed by Jer Noble.
897
898         * Modules/mediasource/SourceBuffer.cpp:
899         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
900
901 2017-12-14  John Wilander  <wilander@apple.com>
902
903         Storage Access API: Implement frame-specific access in the document.cookie layer
904         https://bugs.webkit.org/show_bug.cgi?id=180682
905         <rdar://problem/35982257>
906
907         Reviewed by Alex Christensen.
908
909         No new tests. Changed expected result from existing test.
910
911         CookiesStrategy::cookiesForDOM(), CookiesStrategy::setCookiesFromDOM(),
912         CookiesStrategy::cookieRequestHeaderFieldValue(), and
913         CookiesStrategy::getRawCookies() now take optional parameters for
914         frameID and pageID to allow frame-specific scoping of cookies.
915
916         This change makes the return values of FrameLoaderClient::frameID()
917         and FrameLoaderClient::pageID() std::optional<uint64_t> so that
918         WebCore can call those getters and get the right return values in
919         WebKit and std:nullopt in WebKitLegacy.
920
921         * dom/Document.cpp:
922         (WebCore::Document::requestStorageAccess):
923         * loader/CookieJar.cpp:
924         (WebCore::cookies):
925         (WebCore::setCookies):
926         (WebCore::cookieRequestHeaderFieldValue):
927         (WebCore::getRawCookies):
928         * loader/EmptyFrameLoaderClient.h:
929         * loader/FrameLoaderClient.h:
930         * platform/CookiesStrategy.h:
931         * platform/network/CacheValidation.cpp:
932         (WebCore::headerValueForVary):
933         * platform/network/PlatformCookieJar.h:
934         * platform/network/cf/CookieJarCFNet.cpp:
935         (WebCore::setCookiesFromDOM):
936         (WebCore::cookiesForDOM):
937         (WebCore::cookieRequestHeaderFieldValue):
938         (WebCore::getRawCookies):
939         * platform/network/curl/CookieJarCurl.cpp:
940         (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM):
941         (WebCore::CookieJarCurlFileSystem::cookiesForDOM):
942         (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue):
943         (WebCore::CookieJarCurlFileSystem::getRawCookies):
944         (WebCore::cookiesForDOM):
945         (WebCore::setCookiesFromDOM):
946         (WebCore::cookieRequestHeaderFieldValue):
947         (WebCore::getRawCookies):
948         * platform/network/curl/CookieJarCurl.h:
949         * platform/network/mac/CookieJarMac.mm:
950         (WebCore::cookiesInPartitionForURL):
951         (WebCore::cookiesForURL):
952         (WebCore::cookiesForSession):
953         (WebCore::cookiesForDOM):
954         (WebCore::cookieRequestHeaderFieldValue):
955         (WebCore::setCookiesFromDOM):
956         (WebCore::getRawCookies):
957         * platform/network/soup/CookieJarSoup.cpp:
958         (WebCore::setCookiesFromDOM):
959         (WebCore::cookiesForDOM):
960         (WebCore::cookieRequestHeaderFieldValue):
961         (WebCore::getRawCookies):
962
963 2017-12-14  Alex Christensen  <achristensen@webkit.org>
964
965         Fix Mac CMake build
966         https://bugs.webkit.org/show_bug.cgi?id=180835
967
968         Reviewed by Andy Estes.
969
970         * PlatformMac.cmake:
971         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
972
973 2017-12-14  Antoine Quint  <graouts@apple.com>
974
975         [Web Animations] Use is<> when possible
976         https://bugs.webkit.org/show_bug.cgi?id=180832
977
978         Reviewed by Dean Jackson.
979
980         Adopt is<> when possible.
981
982         * animation/WebAnimation.cpp:
983         (WebCore::WebAnimation::setEffect):
984         (WebCore::WebAnimation::setTimeline):
985         (WebCore::WebAnimation::startOrStopAccelerated):
986
987 2017-12-14  Antoine Quint  <graouts@apple.com>
988
989         [Web Animations] Bring timeline and currentTime setters closer to compliance
990         https://bugs.webkit.org/show_bug.cgi?id=180834
991
992         Reviewed by Dean Jackson.
993
994         Now that we've added support for the concept of a hold time, pending tasks
995         and updating the finished state, adopt those in places we had already implemented
996         but weren't fully compliant.
997
998         Web Platform Tests cover these behaviors, but we're currently failing those tests
999         due to lacking an implementation for Element.animate().
1000
1001         * animation/WebAnimation.cpp:
1002         (WebCore::WebAnimation::setTimeline): Add some spec comments to clarify the code behavior
1003         and implement step 4 of the "setting the timeline" procedure where we reset the hold time
1004         to an unresolved value if the start time is resolved, as well as step 5 where we update the
1005         finished state. Finally, we also ensure we update the pending tasks as the ready state is
1006         dependent on a timeline being set.
1007         (WebCore::WebAnimation::bindingsStartTime const): Invert the way we test for an unresolved
1008         value to match prior review comments by Dean Jackson.
1009         (WebCore::WebAnimation::setBindingsStartTime): Use a boolean check rather than checking
1010         equality with std::nullopt.
1011         (WebCore::WebAnimation::setBindingsCurrentTime): Do not raise an exception when setting
1012         an unresolved time.
1013
1014 2017-12-14  Antoine Quint  <graouts@apple.com>
1015
1016         [Web Animations] Implement the cancel() method on Animation
1017         https://bugs.webkit.org/show_bug.cgi?id=180830
1018         <rdar://problem/36055816>
1019
1020         Reviewed by Dean Jackson.
1021
1022         We implement the cancel() method on the Animation interface with full spec text defining
1023         the normative behavior of those methods and code matching those steps. Implementing the
1024         cancel() method required implementing the notion of "resetting pending tasks",
1025         which the Web Animations spec defines as well.
1026
1027         * animation/WebAnimation.cpp:
1028         (WebCore::WebAnimation::setEffect):
1029         (WebCore::WebAnimation::cancel):
1030         (WebCore::WebAnimation::resetPendingTasks):
1031         * animation/WebAnimation.h:
1032         * animation/WebAnimation.idl:
1033
1034 2017-12-14  Jer Noble  <jer.noble@apple.com>
1035
1036         "Click to exit fullscreen" text not legible on High Sierra
1037         https://bugs.webkit.org/show_bug.cgi?id=180825
1038         <rdar://problem/32839983>
1039
1040         Reviewed by Eric Carlson.
1041
1042         Explicitly set the NSVisualAffectView's .appearance property.
1043
1044         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
1045         (-[WebCoreFullScreenPlaceholderView initWithFrame:]):
1046
1047 2017-12-14  Antoine Quint  <graouts@apple.com>
1048
1049         [Web Animations] Implement the finish() method on Animation
1050         https://bugs.webkit.org/show_bug.cgi?id=180822
1051         <rdar://problem/36053282>
1052
1053         Reviewed by Dean Jackson.
1054
1055         We implement the finish() method on the Animation interface with full spec text defining
1056         the normative behavior of those methods and code matching those steps. Implementing the
1057         finish() method required implementing the notion of "silently setting the current time",
1058         which the Web Animations spec defines as well.
1059
1060         * animation/WebAnimation.cpp:
1061         (WebCore::WebAnimation::silentlySetCurrentTime):
1062         (WebCore::WebAnimation::setCurrentTime):
1063         (WebCore::WebAnimation::finish):
1064         * animation/WebAnimation.h:
1065         * animation/WebAnimation.idl:
1066
1067 2017-12-14  Chris Dumez  <cdumez@apple.com>
1068
1069         Service worker script fetching currently always uses the network cache
1070         https://bugs.webkit.org/show_bug.cgi?id=180816
1071
1072         Reviewed by Alex Christensen.
1073
1074         Service worker script fetching currently always uses the network cache. This is incorrect as per:
1075         - https://w3c.github.io/ServiceWorker/#update-algorithm (step 7.2)
1076
1077         Tests: http/tests/workers/service/registration-updateViaCache-all.html
1078                http/tests/workers/service/registration-updateViaCache-none.html
1079
1080         * workers/Worker.cpp:
1081         (WebCore::Worker::create):
1082         * workers/WorkerScriptLoader.cpp:
1083         (WebCore::WorkerScriptLoader::loadAsynchronously):
1084         * workers/WorkerScriptLoader.h:
1085         * workers/service/SWClientConnection.cpp:
1086         (WebCore::SWClientConnection::startScriptFetchForServer):
1087         * workers/service/SWClientConnection.h:
1088         * workers/service/ServiceWorkerContainer.cpp:
1089         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
1090         * workers/service/ServiceWorkerContainer.h:
1091         * workers/service/ServiceWorkerJob.cpp:
1092         (WebCore::ServiceWorkerJob::startScriptFetch):
1093         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
1094         * workers/service/ServiceWorkerJob.h:
1095         * workers/service/ServiceWorkerJobClient.h:
1096         * workers/service/server/SWServer.cpp:
1097         (WebCore::SWServer::startScriptFetch):
1098         * workers/service/server/SWServer.h:
1099         * workers/service/server/SWServerJobQueue.cpp:
1100         (WebCore::SWServerJobQueue::runUpdateJob):
1101         * workers/service/server/SWServerRegistration.h:
1102         (WebCore::SWServerRegistration::lastUpdateTime const):
1103
1104 2017-12-14  Simon Fraser  <simon.fraser@apple.com>
1105
1106         Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace
1107         https://bugs.webkit.org/show_bug.cgi?id=180689
1108
1109         Reviewed by Darin Adler.
1110         
1111         Address issues noted by Darin in r225797:
1112         
1113         Existing and new code mistakenly allocated colorspaces on every call, because
1114         they didn't initialize the static variable on the first call. Avoid this mistake
1115         by using dispatch_once() in these functions.
1116
1117         Fix a case where the extendedSRGBColorSpaceRef() fallback was returning deviceRGB
1118         instead of sRGB.
1119
1120         * platform/graphics/cg/GraphicsContextCG.cpp:
1121         (WebCore::sRGBColorSpaceRef):
1122         (WebCore::linearRGBColorSpaceRef):
1123         (WebCore::extendedSRGBColorSpaceRef):
1124         (WebCore::displayP3ColorSpaceRef):
1125         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1126         (WebCore::linearRGBColorSpaceRef):
1127
1128 2017-12-13  Keith Miller  <keith_miller@apple.com>
1129
1130         JSObjects should have a mask for loading indexed properties
1131         https://bugs.webkit.org/show_bug.cgi?id=180768
1132
1133         Reviewed by Mark Lam.
1134
1135         * bindings/js/JSDOMConvertSequences.h:
1136         (WebCore::Detail::NumericSequenceConverter::convertArray):
1137         (WebCore::Detail::SequenceConverter::convertArray):
1138
1139 2017-12-13  Antoine Quint  <graouts@apple.com>
1140
1141         [Web Animations] Implement the play() and pause() methods on Animation
1142         https://bugs.webkit.org/show_bug.cgi?id=178932
1143         <rdar://problem/35271069>
1144
1145         Reviewed by Eric Carlson.
1146
1147         We implement the play() and pause() methods of the Animation interface with full spec text defining
1148         the normative behavior of those methods and code matching those steps. Playing and pausing animations
1149         incur running a play or pause task when conditions are met, specifically here when the timeline is ready.
1150         So we add the notion of pending tasks and provide a proper implementation of pending() which we had
1151         introduced in an earlier patch with a constant false return value.
1152
1153         Note that the play() method exposes an auto-rewinding flag which we always set to true, but other specs,
1154         namely CSS Animations, do not require the rewinding behavior, so we expose it for future use.
1155
1156         * animation/WebAnimation.cpp:
1157         (WebCore::WebAnimation::play):
1158         (WebCore::WebAnimation::setTimeToRunPendingPlayTask):
1159         (WebCore::WebAnimation::runPendingPlayTask):
1160         (WebCore::WebAnimation::pause):
1161         (WebCore::WebAnimation::setTimeToRunPendingPauseTask):
1162         (WebCore::WebAnimation::runPendingPauseTask):
1163         (WebCore::WebAnimation::updatePendingTasks):
1164         * animation/WebAnimation.h:
1165         * animation/WebAnimation.idl:
1166
1167 2017-12-14  Frederic Wang  <fwang@igalia.com>
1168
1169         Make GraphicsLayer::dumpProperties dump m_offsetFromRenderer
1170         https://bugs.webkit.org/show_bug.cgi?id=180473
1171
1172         Reviewed by Antonio Gomes.
1173
1174         No new tests, this is just a new debug info.
1175
1176         * platform/graphics/GraphicsLayer.cpp:
1177         (WebCore::GraphicsLayer::dumpProperties const): Dump the offset from renderer if nonzero.
1178
1179 2017-12-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1180
1181         REGRESSION(r225769): Build errors with constexpr std::tie on older gcc
1182         https://bugs.webkit.org/show_bug.cgi?id=180692
1183
1184         Reviewed by Carlos Garcia Campos.
1185
1186         * platform/graphics/FontSelectionAlgorithm.h:
1187         (WebCore::FontSelectionRange::operator== const):
1188         (WebCore::FontSelectionRequest::tied const):
1189         (WebCore::FontSelectionCapabilities::tied const):
1190         (WebCore::FontSelectionSpecifiedCapabilities:: const):
1191
1192 2017-12-13  Daniel Bates  <dabates@apple.com>
1193
1194         Fix the Windows build after <https://trac.webkit.org/changeset/225879>
1195         (https://bugs.webkit.org/show_bug.cgi?id=180651)
1196
1197         * html/TextFieldInputType.cpp:
1198         (WebCore::autoFillButtonTypeToAccessibilityLabel):
1199         (WebCore::autoFillButtonTypeToAutoFillButtonText):
1200         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
1201
1202 2017-12-13  Devin Rousso  <webkit@devinrousso.com>
1203
1204         Web Inspector: add instrumentation for ImageBitmapRenderingContext
1205         https://bugs.webkit.org/show_bug.cgi?id=180736
1206
1207         Reviewed by Joseph Pecoraro.
1208
1209         Tests: inspector/canvas/create-context-bitmaprenderer.html
1210                inspector/canvas/requestContent-bitmaprenderer.html
1211                inspector/canvas/resolveCanvasContext-bitmaprenderer.html
1212
1213         * CMakeLists.txt:
1214         * Sources.txt:
1215         * WebCore.xcodeproj/project.pbxproj:
1216
1217         * html/HTMLCanvasElement.cpp:
1218         (WebCore::HTMLCanvasElement::getContext):
1219         (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
1220         Support passing an optional settings dictionary when creating an ImageBitmapRenderingContext.
1221
1222         * inspector/agents/InspectorCanvasAgent.cpp:
1223         (WebCore::InspectorCanvasAgent::requestContent):
1224         (WebCore::contextAsScriptValue):
1225
1226         * bindings/js/CallTracerTypes.h:
1227
1228         * inspector/InspectorCanvas.h:
1229         * inspector/InspectorCanvas.cpp:
1230         (WebCore::InspectorCanvas::buildObjectForCanvas):
1231         (WebCore::InspectorCanvas::indexForData):
1232         (WebCore::InspectorCanvas::buildAction):
1233         (WebCore::InspectorCanvas::buildArrayForImageBitmap): Deleted.
1234
1235 2017-12-13  Daniel Bates  <dabates@apple.com>
1236
1237         Add more auto fill button types
1238         https://bugs.webkit.org/show_bug.cgi?id=180651
1239         <rdar://problem/35891125>
1240         And
1241         <rdar://problem/35977943>
1242
1243         Reviewed by Brent Fulgham.
1244
1245         Tests: fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html
1246                fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html
1247                fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
1248                fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
1249                fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html
1250                fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html
1251
1252         * English.lproj/Localizable.strings:
1253         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1254         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Add strings for new auto fill button types.
1255
1256         * css/CSSSelector.cpp:
1257         (WebCore::CSSSelector::selectorText const):
1258         * css/CSSSelector.h:
1259         * css/SelectorChecker.cpp:
1260         (WebCore::SelectorChecker::checkOne const):
1261         * css/SelectorCheckerTestFunctions.h:
1262         (WebCore::isAutofilledStrongPassword):
1263         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
1264         * css/html.css:
1265         (input::-webkit-strong-password-auto-fill-button):
1266         (input:-webkit-autofill-strong-password):
1267         (input:-webkit-autofill, input:-webkit-autofill-strong-password):
1268         (input:-webkit-autofill): Deleted.
1269         * cssjit/SelectorCompiler.cpp:
1270         (WebCore::SelectorCompiler::addPseudoClassType):
1271         Add new CSS pseudo class and CSS styles.
1272
1273         * html/HTMLInputElement.cpp:
1274         (WebCore::HTMLInputElement::reset): Hide the auto fill button when the form is reset. This is also called
1275         whenever we suspend the page to put it into the page cache.
1276         (WebCore::HTMLInputElement::setShowAutoFillButton): Modified to update the editability of the inner text element
1277         and invalidate styles for the subtree as the editability may have changed depending on the auto fill button type.
1278
1279         (WebCore::autoFillStrongPasswordMaskImage):
1280         (WebCore::HTMLInputElement::createInnerTextStyle):
1281         (WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
1282         Adjust the look of the inner text field. This function is not const because we may need to resolve style to
1283         generate a mask image.
1284
1285         * html/HTMLInputElement.h:
1286         (WebCore::HTMLInputElement::autoFillButtonType const): Fix style nit; use a C++ style cast while I am in
1287         this area.
1288         (WebCore::HTMLInputElement::hasAutoFillStrongPasswordButton const): Added.
1289
1290         * html/HTMLTextAreaElement.cpp:
1291         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
1292         (WebCore::HTMLTextAreaElement::createInnerTextStyle const): Deleted.
1293         Made this non-const because HTMLInputElement::createInnerTextStyle() needs to be non-const. See above.
1294
1295         * html/HTMLTextAreaElement.h:
1296         * html/HTMLTextFormControlElement.cpp:
1297         (WebCore::HTMLTextFormControlElement::isInnerTextElementEditable const):
1298         (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
1299         Extract out the query to determine if the inner text element is editable into a virtual function isInnerTextElementEditable()
1300         and have updateInnerTextElementEditability() make use of it. By default a field is considered editable if it is not disabled
1301         or read-only. We override updateInnerTextElementEditability() in HTMLInputElement to also consider the auto fill button type.
1302
1303         * html/HTMLTextFormControlElement.h:
1304         * html/TextFieldInputType.cpp:
1305         (WebCore::autoFillButtonTypeToAccessibilityLabel):
1306         (WebCore::autoFillButtonTypeToAutoFillButtonText):
1307         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
1308         (WebCore::isAutoFillButtonTypeChanged):
1309         (WebCore::TextFieldInputType::createAutoFillButton):
1310         (WebCore::TextFieldInputType::updateAutoFillButton):
1311         Support having text for the auto fill button.
1312
1313         * platform/LocalizedStrings.cpp:
1314         (WebCore::AXAutoFillStrongPasswordLabel):
1315         (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
1316         (WebCore::autoFillStrongPasswordLabel):
1317         * platform/LocalizedStrings.h:
1318         Add localized strings.
1319
1320         * rendering/RenderTextControlSingleLine.h: Disallow scrolling depending on the auto fill button type.
1321
1322         * testing/Internals.cpp:
1323         (WebCore::toAutoFillButtonType):
1324         * testing/Internals.h:
1325         * testing/Internals.idl:
1326         Add support for testing.
1327
1328 2017-12-13  Ryosuke Niwa  <rniwa@webkit.org>
1329
1330         Crash inside ImageLoader::updateFromElement()
1331         https://bugs.webkit.org/show_bug.cgi?id=180769
1332         <rdar://problem/35278782>
1333
1334         Reviewed by Antti Koivisto.
1335
1336         Fixed the crash by moving all call sites of ImageLoader::updateFromElement() to be post insertion callbacks
1337         where it's safe to execute arbitrary scripts.
1338
1339         No new test since existing tests cover this with a newly added release assert in ImageLoader.
1340
1341         * html/HTMLImageElement.cpp:
1342         (WebCore::HTMLImageElement::insertedIntoAncestor):
1343         (WebCore::HTMLImageElement::didFinishInsertingNode): Extracted from insertedIntoAncestor to call
1344         selectImageSource or updateFromElement.
1345         * html/HTMLImageElement.h: Made many member functions final.
1346         * html/HTMLInputElement.cpp:
1347         (WebCore::HTMLInputElement::didAttachRenderers): Delay the call to ImageLoader::updateFromElement() in
1348         ImageInputType using a post style resolution callback.
1349         * html/HTMLMetaElement.h:
1350         * html/HTMLPictureElement.cpp:
1351         (WebCore::HTMLPictureElement::sourcesChanged): Store the list of child image elements into a vector before
1352         calling selectImageSource since each call may execute arbitrary scripts.
1353         * html/HTMLSourceElement.cpp:
1354         (WebCore::HTMLSourceElement::insertedIntoAncestor): Delay the call to ImageLoader::updateFromElement()
1355         using a post style resolution callback.
1356         (WebCore::HTMLSourceElement::didFinishInsertingNode): Extracted from insertedIntoAncestor.
1357         * html/HTMLSourceElement.h:
1358         * html/HTMLVideoElement.cpp:
1359         (WebCore::HTMLVideoElement::didAttachRenderers):
1360         (WebCore::HTMLVideoElement::updateAfterStyleResolution): Extracted from didAttachRenderers.
1361         * html/HTMLVideoElement.h:
1362         * html/ImageInputType.cpp:
1363         (WebCore::ImageInputType::needsPostStyleResolutionCallback): Added. Returns true so that HTMLInputElement's
1364         didAttachRenderers would register a post style resolution callback.
1365         (WebCore::ImageInputType::updateAfterStyleResolution): Extracted from attach.
1366         (WebCore::ImageInputType::attach): Deleted.
1367         * html/ImageInputType.h:
1368         * html/InputType.cpp:
1369         (WebCore::InputType::needsPostStyleResolutionCallback): Added. All but ImageInputType returns false.
1370         (WebCore::InputType::updateAfterStyleResolution): Added.
1371         (WebCore::InputType::attach): Deleted.
1372         * html/InputType.h:
1373         * loader/ImageLoader.cpp:
1374         (WebCore::ImageLoader::updateFromElement): Added a release assertion. There is no direct security implication
1375         so there is no need to use RELEASE_ASSERT_WITH_SECURITY_IMPLICATION here.
1376         * svg/SVGImageElement.cpp:
1377         (WebCore::SVGImageElement::insertedIntoAncestor):
1378         (WebCore::SVGImageElement::didFinishInsertingNode):
1379         * svg/SVGImageElement.h:
1380
1381 2017-12-13  Zalan Bujtas  <zalan@apple.com>
1382
1383         RenderImage can be destroyed even before setting the style on it.
1384         https://bugs.webkit.org/show_bug.cgi?id=180767
1385         <rdar://problem/33965995>
1386
1387         Reviewed by Simon Fraser.
1388
1389         In certain cases, when the newly constructed renderer can't be inserted into the tree (parent can only have specific type of children etc),
1390         RenderTreeUpdater destroys it right away. While destroying a RenderImage, the associated image resource assumes
1391         that the image renderer has been initialized through RenderElement::initializeStyle(). This is an incorrect
1392         assumption.
1393         This patch also makes RenderImageResource's m_renderer a weak pointer.
1394            
1395         Test: fast/images/crash-when-image-renderer-is-destroyed-before-calling-initializeStyle.html
1396
1397         * rendering/RenderImageResource.cpp:
1398         (WebCore::RenderImageResource::initialize):
1399         (WebCore::RenderImageResource::setCachedImage):
1400         (WebCore::RenderImageResource::resetAnimation):
1401         (WebCore::RenderImageResource::image const):
1402         (WebCore::RenderImageResource::setContainerContext):
1403         (WebCore::RenderImageResource::imageSize const):
1404         * rendering/RenderImageResource.h:
1405         (WebCore::RenderImageResource::renderer const):
1406         * rendering/RenderImageResourceStyleImage.cpp:
1407         (WebCore::RenderImageResourceStyleImage::shutdown):
1408
1409 2017-12-13  Ryosuke Niwa  <rniwa@webkit.org>
1410
1411         Update the SVG use element's shadow trees explicitly before the style recall
1412         https://bugs.webkit.org/show_bug.cgi?id=180729
1413         <rdar://problem/36009806>
1414
1415         Reviewed by Antti Koivisto.
1416
1417         Update the SVG use element's shadow trees before start resolving styles. Document now has a hash set of all
1418         connected SVG use elements with invalidated shadow trees. SVGUseElement adds itself to this set when its
1419         shadow tree gets invalidated, or it gets newly connected to a document with the invalidated shadow tree.
1420         SVGUseElement removes itself from this set when it updates its shadow tree or it gets disconnected from
1421         a document with the invalidated shadow tree.
1422
1423         No new tests. Covered by existing tests.
1424
1425         * dom/Document.cpp:
1426         (WebCore::Document::~Document): Assert that m_svgUseElements has been cleared.
1427         (WebCore::Document::resolveStyle): Update the shadow trees of SVG use elements with invalidated shadow trees.
1428         (WebCore::Document::addSVGUseElement): Added.
1429         (WebCore::Document::removeSVGUseElement): Added.
1430         * dom/Document.h:
1431         (WebCore::Document::svgUseElements const): Added.
1432         * dom/Element.cpp:
1433         (WebCore::Element::cloneElementWithChildren): Removed EventAllowedScope since the SVG use element's shadow
1434         tree is no longer updated when there is a NoEventDispatchAssertion in the stack.
1435         (WebCore::Element::cloneElementWithoutChildren): Ditto.
1436         * style/StyleTreeResolver.cpp:
1437         (WebCore::Style::TreeResolver::resolveComposedTree): No longer drops the assertion now that SVG use element's
1438         shadow tree is updated before calling this function.
1439         * svg/SVGUseElement.cpp:
1440         (WebCore::SVGUseElement::insertedIntoAncestor): Add the element to the document's hash set if this use element's
1441         shadow tree needs to be updated (m_shadowTreeNeedsUpdate is set), and it got newly connected.
1442         (WebCore::SVGUseElement::removedFromAncestor): Ditto for removal. We have to check m_shadowTreeNeedsUpdate before
1443         calling SVGGraphicsElement::removedFromAncestor or updateExternalDocument since either function can invoke
1444         m_shadowTreeNeedsUpdate to true.
1445         (WebCore::SVGUseElement::willRecalcStyle): Deleted. We no longer call updateShadowTree during style recalc.
1446         (WebCore::SVGUseElement::updateShadowTree): Remove this element from the document's hah set. We can't clear all
1447         the entries in the map at once in Document::resolveStyle because updating the shadow trees of a SVG use element
1448         can result in a sync IPC in ImageLoader::updateFromElement, which end up executing arbitrary author scripts.
1449         (WebCore::SVGUseElement::cloneTarget const): Removed EventAllowedScope since the SVG use element's shadow tree
1450         is no longer updated when there is a NoEventDispatchAssertion in the stack.
1451         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
1452         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
1453         (WebCore::SVGUseElement::invalidateShadowTree): Add the element to the document's hash set if it's connected.
1454         * svg/SVGUseElement.h:
1455
1456 2017-12-13  Per Arne Vollan  <pvollan@apple.com>
1457
1458         REGRESSION(225597): Can't select a text box or web view on a page when VO is on.
1459         https://bugs.webkit.org/show_bug.cgi?id=180756
1460         <rdar://problem/35996158>
1461
1462         Reviewed by Brent Fulgham.
1463
1464         No new tests.
1465
1466         * platform/mac/EventLoopMac.mm:
1467         (WebCore::EventLoop::cycle):
1468
1469 2017-12-13  Antoine Quint  <graouts@apple.com>
1470
1471         [Web Animations] Implement the "updating the finished state" procedure
1472         https://bugs.webkit.org/show_bug.cgi?id=180743
1473         <rdar://problem/36017232>
1474
1475         Reviewed by Simon Fraser.
1476
1477         The Web Animations spec defines a procedure for "updating the finished state", which should run as the timeline time
1478         changes and is responsible for ultimately triggering finish events and fulfil the "finished" promise. The procedure
1479         allows for two flags to control its behavior: didSeek and synchronouslyNotify. When synchronouslyNotify is true, the
1480         "finish notification steps" procedure is ran right away, otherwise it's queued as a microtask.
1481
1482         In this patch we introduce the notion of "hold time", which is the time held while an animation is paused. It will be
1483         set by the pause() and play() method in future patches.
1484
1485         * animation/DocumentTimeline.cpp:
1486         (WebCore::DocumentTimeline::updateAnimations): Update the finished state as the timeline time changes with both flags
1487         set to false.
1488         * animation/WebAnimation.cpp:
1489         (WebCore::WebAnimation::currentTime const): Add a private currentTime(bool) variant which allows for the hold time to
1490         be ignored in case updateFinishedState() was called with the didSeek flag set to false.
1491         (WebCore::WebAnimation::updateFinishedState): Implement the procedure as specified with all spec-mandated steps inline.
1492         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Schedule a microtask to complete the "finish notification steps"
1493         if we haven't scheduled a microtask before.
1494         (WebCore::WebAnimation::performMicrotask): Perform the microtask if the "finish notification steps" procedure hasn't
1495         been canceled after it was originally scheduled, as tracked by the m_finishNotificationStepsMicrotaskPending flag, since
1496         microtasks are not presently cancelable.
1497         (WebCore::WebAnimation::finishNotificationSteps): Implement the procedure as specified with all spec-mandated steps inline,
1498         dispatching a "finish" events and fulfilling the "finished" promise.
1499         * animation/WebAnimation.h:
1500         * animation/WebAnimation.idl:
1501         * dom/EventNames.h:
1502
1503 2017-12-13  Simon Fraser  <simon.fraser@apple.com>
1504
1505         Fix crash under Document::visualUpdatesSuppressionTimerFired()
1506         https://bugs.webkit.org/show_bug.cgi?id=180758
1507         Document::visualUpdatesSuppressionTimerFired
1508
1509         Reviewed by Zalan Bujtas.
1510
1511         Speculative fix for crash under visualUpdatesSuppressionTimerFired() where view()
1512         can be null. Add null checks for the view() in all code called from this function.
1513
1514         * dom/Document.cpp:
1515         (WebCore::Document::setVisualUpdatesAllowed):
1516         (WebCore::Document::visualUpdatesSuppressionTimerFired):
1517
1518 2017-12-13  Zalan Bujtas  <zalan@apple.com>
1519
1520         ASSERT(LayoutDisallowedScope::isLayoutAllowed()) whenever hitting Enter in Web Inspector console
1521         https://bugs.webkit.org/show_bug.cgi?id=180690
1522
1523         Reviewed by Simon Fraser.
1524
1525         Defer text replacement notification until after layout is done to avoid unexpected forced layouts.
1526
1527         Covered by existing tests.
1528
1529         * accessibility/AXObjectCache.cpp:
1530         (WebCore::AXObjectCache::disableAccessibility):
1531         (WebCore::AXObjectCache::remove):
1532         (WebCore::filterMapForRemoval):
1533         (WebCore::filterListForRemoval):
1534         (WebCore::AXObjectCache::prepareForDocumentDestruction):
1535         (WebCore::AXObjectCache::performDeferredCacheUpdate):
1536         (WebCore::AXObjectCache::deferTextReplacementNotificationForTextControl):
1537         (WebCore::filterForRemoval): Deleted.
1538         * accessibility/AXObjectCache.h: Need to use the base (Element) class since
1539         we can't call is<HTMLTextFormControlElement> in Node d'tor.
1540         (WebCore::AXObjectCache::deferTextReplacementNotificationForTextControl):
1541         * html/HTMLTextFormControlElement.cpp:
1542         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
1543
1544 2017-12-13  Ryan Haddad  <ryanhaddad@apple.com>
1545
1546         Unreviewed, rolling out r225836.
1547
1548         Broke the Windows build.
1549
1550         Reverted changeset:
1551
1552         "Unify some WebGL sources"
1553         https://bugs.webkit.org/show_bug.cgi?id=180726
1554         https://trac.webkit.org/changeset/225836
1555
1556 2017-12-13  Andy Estes  <aestes@apple.com>
1557
1558         [Payment Request] Remove ApplePayPaymentMethodUpdateEvent and use PaymentDetailsModifiers instead
1559         https://bugs.webkit.org/show_bug.cgi?id=180737
1560         <rdar://problem/36013152>
1561
1562         Reviewed by Brady Eidson.
1563
1564         Instead of firing a non-standard "applepaypaymentmethodupdate" event when the payment method
1565         changes, use the PaymentDetailsModifier mechanism to allow the merchant to specify override
1566         totals and additional display items per payment method type.
1567
1568         Test: http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html
1569
1570         * DerivedSources.make:
1571         * Modules/applepay/ApplePayLineItem.idl:
1572         * Modules/applepay/ApplePayPaymentMethod.h:
1573         * Modules/applepay/ApplePayPaymentMethod.idl:
1574         * Modules/applepay/ApplePayPaymentMethodType.h: Added.
1575         * Modules/applepay/ApplePayPaymentMethodType.idl: Added.
1576         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
1577         * Modules/applepay/paymentrequest/ApplePayModifier.h: Added.
1578         * Modules/applepay/paymentrequest/ApplePayModifier.idl: Added.
1579         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1580         (WebCore::ApplePayPaymentHandler::show):
1581         (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems):
1582         (WebCore::ApplePayPaymentHandler::detailsUpdated):
1583         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
1584         (WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
1585         (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
1586         (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
1587         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1588         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Removed.
1589         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Removed.
1590         * Modules/paymentrequest/PaymentRequest.h:
1591         * Modules/paymentrequest/PaymentRequest.idl:
1592         * WebCore.xcodeproj/project.pbxproj:
1593         * dom/EventNames.h:
1594         * dom/EventNames.in:
1595         * testing/MockPaymentCoordinator.cpp:
1596         (WebCore::convert):
1597         (WebCore::MockPaymentCoordinator::updateTotalAndLineItems):
1598         (WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
1599         (WebCore::MockPaymentCoordinator::completeShippingContactSelection):
1600         (WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
1601         * testing/MockPaymentCoordinator.h:
1602         * testing/MockPaymentCoordinator.idl:
1603
1604 2017-12-12  Zalan Bujtas  <zalan@apple.com>
1605
1606         is<HTMLTextFormControlElement> reports the input type.
1607         https://bugs.webkit.org/show_bug.cgi?id=180721
1608         <rdar://problem/36005123>
1609
1610         Reviewed by Ryosuke Niwa.
1611
1612         This patch ensures that is<HTMLTextFormControlElement> consistently returns true even
1613         when the input type changes from text to non-text (checkbox etc).
1614
1615         * accessibility/AccessibilityObject.cpp:
1616         (WebCore::AccessibilityObject::selectText):
1617         * dom/Element.h:
1618         (WebCore::Element::isTextFormControlElement const):
1619         (WebCore::Element::isTextField const):
1620         (WebCore::Element::isTextFormControl const): Deleted.
1621         * editing/Editor.cpp:
1622         (WebCore::Editor::selectionForCommand):
1623         (WebCore::Editor::setBaseWritingDirection):
1624         (WebCore::findFirstMarkable):
1625         * editing/FrameSelection.cpp:
1626         (WebCore::FrameSelection::selectAll):
1627         * html/FormController.cpp:
1628         (WebCore::FormController::formElementsCharacterCount const):
1629         * html/HTMLElement.cpp:
1630         (WebCore::HTMLElement::directionality const):
1631         * html/HTMLInputElement.h:
1632         * html/HTMLTextAreaElement.h:
1633         * html/HTMLTextFormControlElement.cpp:
1634         (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
1635         (WebCore::HTMLTextFormControlElement::selectedText const):
1636         (WebCore::HTMLTextFormControlElement::setSelectionRange):
1637         (WebCore::HTMLTextFormControlElement::selectionStart const):
1638         (WebCore::HTMLTextFormControlElement::computeSelectionStart const):
1639         (WebCore::HTMLTextFormControlElement::selectionEnd const):
1640         (WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
1641         (WebCore::HTMLTextFormControlElement::selectionDirection const):
1642         (WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
1643         (WebCore::HTMLTextFormControlElement::selection const):
1644         (WebCore::HTMLTextFormControlElement::selectionChanged):
1645         (WebCore::HTMLTextFormControlElement::lastChangeWasUserEdit const):
1646         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
1647         (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
1648         (WebCore::enclosingTextFormControl):
1649         * html/HTMLTextFormControlElement.h:
1650         (isType):
1651         * rendering/HitTestResult.cpp:
1652         (WebCore::HitTestResult::isOverTextInsideFormControlElement const):
1653
1654 2017-12-12  Dean Jackson  <dino@apple.com>
1655
1656         Unify some WebGL sources
1657         https://bugs.webkit.org/show_bug.cgi?id=180726
1658
1659         Rubber-stamped by Keith, weeks ago.
1660
1661         * Sources.txt:
1662         * WebCore.xcodeproj/project.pbxproj:
1663         * html/canvas/WebGLRenderingContextBase.cpp:
1664
1665 2017-12-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1666
1667         Unreviewed, fix !ENABLE(MEDIA_STREAM) build after r225822
1668         https://bugs.webkit.org/show_bug.cgi?id=180666
1669         <rdar://problem/36008948>
1670
1671         * html/HTMLMediaElement.cpp:
1672
1673 2017-12-12  Alex Christensen  <achristensen@webkit.org>
1674
1675         Fix possible out-of-bounds read in protocolIsInHTTPFamily
1676         https://bugs.webkit.org/show_bug.cgi?id=180688
1677
1678         Reviewed by Daniel Bates.
1679
1680         It wouldn't read very far out of bounds, and it would just change a bool return value,
1681         but it's still out of bounds.  Covered by an API test that ASAN wouldn't like.
1682
1683         * platform/URL.cpp:
1684         (WebCore::protocolIsInHTTPFamily):
1685         Check bounds before reading a string.
1686
1687 2017-12-12  Youenn Fablet  <youenn@apple.com>
1688
1689         getUserMedia is resolving before the document knows it is capturing
1690         https://bugs.webkit.org/show_bug.cgi?id=180699
1691
1692         Reviewed by Eric Carlson.
1693
1694         Covered by updated test.
1695
1696         Ensure the document state is capturing when getUserMedia promise is resolved by doing the following:
1697         - Promise is resolved when MediaStream is producing data.
1698         - MediaStream asks Document to update its state when MediaStream state is updated.
1699
1700         Introduce PendingActivationMediaStream for waiting for the MediaStream to produce data.
1701
1702         * Modules/mediastream/MediaStream.cpp:
1703         (WebCore::MediaStream::statusDidChange):
1704         * Modules/mediastream/UserMediaRequest.cpp:
1705         (WebCore::UserMediaRequest::allow):
1706         (WebCore::UserMediaRequest::contextDestroyed):
1707         (WebCore::UserMediaRequest::PendingActivationMediaStream::PendingActivationMediaStream):
1708         (WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
1709         (WebCore::UserMediaRequest::PendingActivationMediaStream::characteristicsChanged):
1710         (WebCore::UserMediaRequest::mediaStreamIsReady):
1711         * Modules/mediastream/UserMediaRequest.h:
1712         (WebCore::UserMediaRequest::PendingActivationMediaStream::create):
1713         * platform/mediastream/RealtimeMediaSourceCenter.h:
1714         * WebCore/WebCore.xcodeproj/project.pbxproj:
1715
1716 2017-12-12  John Wilander  <wilander@apple.com>
1717
1718         Storage Access API: Implement frame-specific access in the network storage session layer
1719         https://bugs.webkit.org/show_bug.cgi?id=180679
1720         <rdar://problem/35982116>
1721
1722         Reviewed by Alex Christensen.
1723
1724         Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction-and-try-access-from-right-frame.html
1725                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction-but-try-access-from-wrong-frame.html
1726
1727         This changes adds frameID and pageID to what is communicated for
1728         storage access and also stored in the network process' table of
1729         partitioning exceptions.
1730
1731         * dom/Document.cpp:
1732         (WebCore::Document::hasStorageAccess):
1733             Now makes use of the new m_hasFrameSpecificStorageAccess to check
1734             if access has already been granted to this document's domain and
1735             frame.
1736         (WebCore::Document::requestStorageAccess):
1737             Now submits frameID and pageID in the request call and sets
1738             m_hasFrameSpecificStorageAccess upon granted access callback.
1739         * dom/Document.h:
1740         * page/ChromeClient.h:
1741         * platform/network/NetworkStorageSession.h:
1742         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1743         (WebCore::NetworkStorageSession::cookieStoragePartition const):
1744         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
1745         (WebCore::NetworkStorageSession::isStorageAccessGranted const):
1746         (WebCore::NetworkStorageSession::setStorageAccessGranted):
1747             Now makes use of frameID and pageID for partitioning exceptions.
1748         * platform/network/mac/CookieJarMac.mm:
1749         (WebCore::cookiesInPartitionForURL):
1750         (WebCore::setCookiesFromDOM):
1751             Submits std::nullopt for frameID and pageID.
1752             Follow-up work tracked in https://bugs.webkit.org/show_bug.cgi?id=180682. 
1753         * platform/network/mac/ResourceHandleMac.mm:
1754         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded):
1755             Submits std::nullopt for frameID and pageID.
1756             Follow-up work tracked in https://bugs.webkit.org/show_bug.cgi?id=180682. 
1757
1758 2017-12-12  Youenn Fablet  <youenn@apple.com>
1759
1760         Playing webrtc video tracks should prevent from display to got to sleep
1761         https://bugs.webkit.org/show_bug.cgi?id=180666
1762
1763         Reviewed by Darin Adler.
1764
1765         Done through manual testing by checking screen assertions taken on webrtc sites.
1766
1767         * html/HTMLMediaElement.cpp:
1768         (WebCore::HTMLMediaElement::shouldDisableSleep const):
1769
1770 2017-12-12  Dean Jackson  <dino@apple.com>
1771
1772         Add CanvasRenderingContext2DBase class and OffscreenCanvasRenderingContext2D
1773         https://bugs.webkit.org/show_bug.cgi?id=180718
1774         <rdar://problem/36004015>
1775
1776         Reviewed by Sam Weinig.
1777
1778         Add an OffscreenCanvasRenderingContext2D class, and in the process create a shared
1779         base class for it and CanvasRenderingContext2D, called CanvasRenderingContext2DBase.
1780         The base class has nearly all the functionality, with the exception of the text
1781         and focus rendering APIs, which are only exposed on CanvasRenderingContext2D.
1782
1783         At the moment CanvasRenderingContext2DBase's implementation still expects the attached
1784         canvas to be an HTMLCanvasElement, but that's ok since you can't yet create an
1785         OffscreenCanvasRenderingContext2D. A subsequent patch will do the right thing.
1786
1787         No change in functionality at the moment, so covered by the existing tests.
1788
1789         * DerivedSources.make: Add the new IDL file.
1790
1791         * Sources.txt: Add all the new files to compile.
1792         * WebCore.xcodeproj/project.pbxproj:
1793
1794         * bindings/js/JSCanvasRenderingContext2DCustom.cpp: Removed some unnecessary headers, and
1795         added JSC:: where appropriate.
1796         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
1797         (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
1798
1799         * bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp: Copied from Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp.
1800         (WebCore::root): New root function that just returns the address of the OffscreenCanvas.
1801         (WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
1802         (WebCore::JSOffscreenCanvasRenderingContext2D::visitAdditionalChildren):
1803
1804         * bindings/js/JSWorkerNavigatorCustom.cpp: Add JSC:: to fix a compilation error.
1805         (WebCore::JSWorkerNavigator::visitAdditionalChildren):
1806
1807         * bindings/js/WebCoreBuiltinNames.h: New IDL types.
1808
1809         * html/OffscreenCanvas.idl: Explicitly generates an IsReachable.
1810
1811         * html/canvas/CanvasRenderingContext.h:
1812         (WebCore::CanvasRenderingContext::isOffscreen2d const): Helper for is<> trait.
1813
1814         * html/canvas/CanvasRenderingContext2D.cpp: Nearly everything has been moved to the Base class.
1815         * html/canvas/CanvasRenderingContext2D.h:
1816         * html/canvas/CanvasRenderingContext2DBase.cpp: Copied from Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp.
1817         * html/canvas/CanvasRenderingContext2DBase.h: Copied from Source/WebCore/html/canvas/CanvasRenderingContext2D.h.
1818
1819         * html/canvas/OffscreenCanvasRenderingContext2D.cpp: Added. Basic implementation that
1820         just uses the Base class.
1821         (WebCore::OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D):
1822         * html/canvas/OffscreenCanvasRenderingContext2D.h: Added.
1823         * html/canvas/OffscreenCanvasRenderingContext2D.idl: Added.
1824
1825 2017-12-12  Jer Noble  <jer.noble@apple.com>
1826
1827         [EME] Support FPS-over-HLS in the Modern EME API
1828         https://bugs.webkit.org/show_bug.cgi?id=180707
1829
1830         Reviewed by Eric Carlson.
1831
1832         Add support for the "skd" initDataType, where the initData is the URI provided in the 
1833         EXT-X-KEY tag in a HLS manifest:
1834
1835         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
1836         (WebCore::CDMPrivateFairPlayStreaming::sinfName):
1837         (WebCore::CDMPrivateFairPlayStreaming::skdName):
1838         (WebCore::extractSinfData):
1839         (WebCore::CDMPrivateFairPlayStreaming::sanitizeSkd):
1840         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd):
1841         (WebCore::validInitDataTypes):
1842         (WebCore::CDMFactory::platformRegisterFactories):
1843         (WebCore::CDMPrivateFairPlayStreaming::supportsInitDataType const):
1844         (WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const):
1845         (WebCore::CDMPrivateFairPlayStreaming::supportsInitData const):
1846         (WebCore::sinfName): Deleted.
1847
1848         Add support for creating a AVContentKeyRequest from a skd key URI rather than from
1849         initialization data, and for extracting keyIDs from the AVContentKeyRequest identifier.
1850
1851         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
1852         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1853         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1854         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs):
1855         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense):
1856         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
1857         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
1858
1859         Add support for AVContentKeySession to MediaPlayerPrivateAVFoundationObjC, and for emitting
1860         initializationData messages when encountering a loading request for a "skd" URI.
1861
1862         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1863         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1864         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1865         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
1866         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
1867         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
1868
1869 2017-12-12  Antoine Quint  <graouts@apple.com>
1870
1871         [Web Animations] Expose promises on Animation interface
1872         https://bugs.webkit.org/show_bug.cgi?id=180710
1873         <rdar://problem/36000604>
1874
1875         Reviewed by Dean Jackson.
1876
1877         Expose the "ready" and "finished" promises on Animation. A future patch will fulfil or reject them.
1878
1879         * animation/WebAnimation.cpp:
1880         (WebCore::WebAnimation::WebAnimation):
1881         (WebCore::WebAnimation::readyPromiseResolve):
1882         (WebCore::WebAnimation::finishedPromiseResolve):
1883         * animation/WebAnimation.h:
1884         * animation/WebAnimation.idl:
1885
1886 2017-12-12  Youenn Fablet  <youenn@apple.com>
1887
1888         Fetch Event header filtering should apply in CORS mode only
1889         https://bugs.webkit.org/show_bug.cgi?id=180708
1890
1891         Reviewed by Alex Christensen.
1892
1893         Covered by no-longer failing test.
1894
1895         * workers/service/context/ServiceWorkerFetch.cpp: cleaning headers only in case of CORS mode.
1896
1897 2017-12-12  Myles C. Maxfield  <mmaxfield@apple.com>
1898
1899         REGRESSION (Safari 11): custom <font-face> tag crashes a page
1900         https://bugs.webkit.org/show_bug.cgi?id=177848
1901
1902         Reviewed by Darin Adler.
1903
1904         We currently use the CSS property parsers to parse SVG's <font-face> element attributes. Instead,
1905         we should be using the CSS descriptor parsers to parse these attributes. However, this is a
1906         fairly involved task, so until I can finish that, this patch fixes the crash. The crash is simple;
1907         the descriptors shouldn't accept the universal keywords ("initial", "inherit", etc.) and our
1908         font-face machinery assumes this. So the fix is just detect these keywords and explicitly disallow
1909         them.
1910
1911         Test: svg/text/font-style-keyword.html
1912
1913         * svg/SVGFontFaceElement.cpp:
1914         (WebCore::SVGFontFaceElement::parseAttribute):
1915
1916 2017-12-12  Antoine Quint  <graouts@apple.com>
1917
1918         [Web Animations] Implement the playState property on Animation
1919         https://bugs.webkit.org/show_bug.cgi?id=180711
1920         <rdar://problem/36000982>
1921
1922         Reviewed by Dean Jackson.
1923
1924         Expose the playState and pending properties. The playState property has a complete implementation but
1925         has some test failures due to Animation lacking correct behavior while running animations which will
1926         be fixed in a followup patch. The pending property is a placeholder until we implement pending play
1927         and pause tasks in followup patches.
1928
1929         * animation/WebAnimation.cpp:
1930         (WebCore::WebAnimation::playState const):
1931         (WebCore::WebAnimation::effectEndTime const):
1932         * animation/WebAnimation.h:
1933         * animation/WebAnimation.idl:
1934
1935 2017-12-12  Javier Fernandez  <jfernandez@igalia.com>
1936
1937         [css-grid] Implement alignment for absolute positioned grid items
1938         https://bugs.webkit.org/show_bug.cgi?id=180632
1939
1940         Reviewed by Manuel Rego Casasnovas.
1941
1942         We are changing how we compute the grid area's size of positioned
1943         items, trying to make the logic as independent as possible of the
1944         grid container's direction.
1945
1946         The new way of placing absolute positioned elements in their grid area
1947         is based on the previously computed area's size. This provide a
1948         mechanism to place an item in its area respecting the offsets derived
1949         from the Content Alignment CSS properties and, which is more important,
1950         ignoring the grid container's direction.
1951
1952         Additionally, we use the already implemented alignment logic that's
1953         used for regular grid items. This patch provides almost full alignment
1954         capabilities for positioned objects, with the exception of 'stretch'.
1955
1956         It's worth mentioning that some of the test cases using vertical-rl
1957         writing mode will fail because of the bug 180633.
1958
1959         Updated web-platform-tests results of the test cases that pass now.
1960
1961         * rendering/GridLayoutFunctions.cpp:
1962        (WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild):
1963         (WebCore::GridLayoutFunctions::overrideContainingBlockContentSizeForChild):
1964         * rendering/GridLayoutFunctions.h:
1965         * rendering/GridTrackSizingAlgorithm.cpp:
1966         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
1967         * rendering/RenderGrid.cpp:
1968         (WebCore::RenderGrid::layoutBlock):
1969         (WebCore::RenderGrid::gridItemOffset const):
1970         (WebCore::RenderGrid::hasStaticPositionForChild const):
1971         (WebCore::RenderGrid::layoutPositionedObject):
1972         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1973         (WebCore::RenderGrid::columnAxisPositionForChild const):
1974         (WebCore::RenderGrid::rowAxisPositionForChild const):
1975         (WebCore::RenderGrid::columnAxisOffsetForChild const):
1976         (WebCore::RenderGrid::rowAxisOffsetForChild const):
1977         (WebCore::RenderGrid::gridPositionIsAutoForOutOfFlow const):
1978         (WebCore::RenderGrid::resolveAutoStartGridPosition const):
1979         (WebCore::RenderGrid::resolveAutoEndGridPosition const):
1980         (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
1981         (WebCore::RenderGrid::logicalOffsetForChild const):
1982         (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
1983         (WebCore::RenderGrid::gridAreaPositionForInFlowChild const):
1984         (WebCore::RenderGrid::gridAreaPositionForChild const):
1985         (WebCore::RenderGrid::translateOutOfFlowRTLCoordinate const):
1986         (WebCore::RenderGrid::findChildLogicalPosition const):
1987         * rendering/RenderGrid.h:
1988         * rendering/style/GridPositionsResolver.cpp:
1989         (WebCore::adjustGridPositionsFromStyle):
1990         (WebCore::GridPositionsResolver::initialPositionSide):
1991         (WebCore::GridPositionsResolver::finalPositionSide):
1992         * rendering/style/GridPositionsResolver.h:
1993
1994 2017-12-12  Jer Noble  <jer.noble@apple.com>
1995
1996         [EME] Support reporting and restoring persistent usage data.
1997         https://bugs.webkit.org/show_bug.cgi?id=180684
1998
1999         Reviewed by Eric Carlson.
2000
2001         Add support for reading and acknowledging persistent usage data from the MediaKeys storage
2002         directory.
2003
2004         Add a mechanism for passing the storage location down to CDMPrivate and CDMInstance objects
2005         inside of the CDM class itself:
2006
2007         * Modules/encryptedmedia/CDM.cpp:
2008         (WebCore::CDM::createInstance):
2009         (WebCore::CDM::storageDirectory const):
2010         * Modules/encryptedmedia/CDM.h:
2011
2012         Support loading expired session data, acknowledging expired session data, closing sessions
2013         and removing usable key data.
2014
2015         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2016         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2017         (WebCore::isEqual):
2018         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
2019         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession):
2020         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession):
2021         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData):
2022
2023 2017-12-12  Christopher Reid  <chris.reid@sony.com>
2024
2025         WebGL TextureMapperShaderProgram shaders don't compile in MSVC
2026         https://bugs.webkit.org/show_bug.cgi?id=180709
2027
2028         Reviewed by Myles C. Maxfield.
2029
2030         No new tests, no change in behavior.
2031
2032         Vertex and Fragment shaders were not compiling because TextureMapperShaderProgram.cpp was
2033         stringifying "#if USE(OPENGL_ES_2) ... #endif" into the shaders rather than evaluating these
2034         preprocessor directives before the STRINGIFY expansion.
2035
2036         Moved these #if conditions outside of STRINGIFY to remove compiler ambiguity.
2037
2038         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2039
2040 2017-12-12  Zach Li  <zachli@apple.com>
2041         [WK2] Expose image via WKBundleHitTestResult API.
2042         https://bugs.webkit.org/show_bug.cgi?id=180552.
2043         rdar://problem/23951521
2044
2045         Reviewed by Simon Fraser.
2046
2047         * platform/graphics/ImageSource.h:
2048         This method will be used by clients outside WebCore, so
2049         add WEBCORE_EXPORT.
2050
2051 2017-12-12  Simon Fraser  <simon.fraser@apple.com>
2052
2053         Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace
2054         https://bugs.webkit.org/show_bug.cgi?id=180689
2055
2056         Reviewed by Tim Horton.
2057
2058         Remove the ColorSpaceDeviceRGB enum and users.
2059
2060         ImageBuffer now uses sRGB instead of deviceRGB in the few cases that used the latter.
2061
2062         Switch Windows CG code to use sRGBColorSpaceRef() instead of deviceRGBColorSpaceRef().
2063
2064         Have linearRGBColorSpaceRef() use kCGColorSpaceLinearSRGB, which is present in iOS 9 and 10.11 and later.
2065
2066         * page/win/FrameCGWin.cpp:
2067         (WebCore::imageFromRect):
2068         * platform/graphics/Color.cpp:
2069         (WebCore::operator<<):
2070         * platform/graphics/ColorSpace.h:
2071         * platform/graphics/ImageBuffer.cpp:
2072         (WebCore::ImageBuffer::transformColorSpace):
2073         * platform/graphics/cg/ColorCG.cpp:
2074         (WebCore::Color::Color):
2075         (WebCore::leakCGColor):
2076         (WebCore::createCGColorWithDeviceRGBA): Deleted.
2077         * platform/graphics/cg/GraphicsContextCG.cpp:
2078         (WebCore::sRGBColorSpaceRef):
2079         (WebCore::linearRGBColorSpaceRef):
2080         (WebCore::extendedSRGBColorSpaceRef):
2081         (WebCore::displayP3ColorSpaceRef):
2082         (WebCore::deviceRGBColorSpaceRef): Deleted.
2083         * platform/graphics/cg/GraphicsContextCG.h:
2084         (WebCore::cachedCGColorSpace):
2085         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2086         * platform/graphics/win/GraphicsContextCGWin.cpp:
2087         (WebCore::CGContextWithHDC):
2088         (WebCore::GraphicsContext::releaseWindowsContext):
2089         (WebCore::GraphicsContext::drawWindowsBitmap):
2090         * platform/graphics/win/ImageCGWin.cpp:
2091         (WebCore::BitmapImage::create):
2092         (WebCore::BitmapImage::getHBITMAPOfSize):
2093         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2094         (WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage const):
2095         * platform/win/DragImageCGWin.cpp:
2096         (WebCore::allocImage):
2097         (WebCore::createCgContextFromBitmap):
2098         * rendering/svg/RenderSVGResourceFilter.cpp:
2099         (WebCore::RenderSVGResourceFilter::postApplyResource):
2100         * rendering/svg/RenderSVGResourceMasker.cpp:
2101         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
2102
2103 2017-12-12  Youenn Fablet  <youenn@apple.com>
2104
2105         Navigation requests should use navigate fetch mode
2106         https://bugs.webkit.org/show_bug.cgi?id=179808
2107
2108         Reviewed by Chris Dumez.
2109
2110         Covered by existing tests.
2111
2112         * Modules/fetch/FetchRequest.cpp:
2113         (WebCore::buildOptions): Update to throw only if init.mode is Navigate.
2114         * Modules/fetch/FetchRequestInit.h:
2115         (WebCore::FetchRequestInit::hasMembers const): If init is present, set default values as per spec.
2116         * loader/DocumentLoader.cpp:
2117         (WebCore::DocumentLoader::loadMainResource): Set fetch mode to navigate.
2118         * loader/DocumentThreadableLoader.cpp:
2119         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Bypass preflight in case fetch mode is navigate.
2120
2121 2017-12-12  Simon Fraser  <simon.fraser@apple.com>
2122
2123         HTML-page with <object type="image/svg+xml" data="foo.svg"> often is blank
2124         https://bugs.webkit.org/show_bug.cgi?id=180524
2125         <rdar://problem/35920554>
2126
2127         Reviewed by Antti Koivisto.
2128
2129         The test case has script that conditionalizes behavior on whether window.innerWidth/Height
2130         are zero during the load event. We didn't force layout in innerWidth/Height, so whether
2131         they would zero depended on whether the parent frame had laid out, which was timing-sensitive.
2132
2133         Fix by triggering enough layout in the parent document so that the FrameView is resized before
2134         fetching its dimensions in innerWidth/Height. This causes our behavior to match Chrome and Firefox.
2135
2136         Test: fast/dom/iframe-innerWidth.html
2137
2138         * dom/EventDispatcher.cpp:
2139         (WebCore::EventDispatcher::dispatchEvent): Add some logging that helped me diagnose this.
2140         * page/DOMWindow.cpp:
2141         (WebCore::DOMWindow::innerHeight const):
2142         (WebCore::DOMWindow::innerWidth const):
2143
2144 2017-12-11  Antoine Quint  <graouts@apple.com>
2145
2146         [Web Animations] Enqueue and dispatch animation events
2147         https://bugs.webkit.org/show_bug.cgi?id=180657
2148         <rdar://problem/35970103>
2149
2150         Reviewed by Chris Dumez.
2151
2152         Now that we have support for the AnimationPlaybackEvent interface, we need a way to enqueue
2153         such events for dispatch at the opportune time. The Web Animations spec defines two ways
2154         to queue and dispatch events.
2155
2156         If the animation has a "document for timing", it should enqueue events on this document.
2157         In our implementation, if the animation timeline is set to a DocumentTimeline, that means
2158         it has a document for timing, and we let the DocumentTimeline enqueue those events, which
2159         will be dispatched through a dedicated GenericTaskQueue<Timer>. These events will be sorted
2160         by their respective timeline time before being dispatched.
2161
2162         If there is no document for timing, events should be dispatched as a standalone task.
2163
2164         * animation/DocumentTimeline.cpp:
2165         (WebCore::DocumentTimeline::~DocumentTimeline): Close the event dispatch task queue when the
2166         document timeline is torn down.
2167         (WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent): Add the provided event to the
2168         pending animation events queue and, if one hasn't been registered yet, enqueue a task to
2169         dispatch events using a GenericTaskQueue<Timer>.
2170         (WebCore::compareAnimationPlaybackEvents): Comparator used to sort events in performEventDispatchTask()
2171         where events are sorted such that unresolved timeline times come first, and then from the
2172         earlier resolved timeline times to the later resolved timeline times. Events with unresolved
2173         timeline times and equal resolved timeline times are sorted in the order they were enqueued.
2174         (WebCore::DocumentTimeline::performEventDispatchTask): Run a stable sort on a copy of the pending list
2175         of events to dispatch and dispatch the events individually on their respective animations.
2176         * animation/DocumentTimeline.h:
2177         * animation/WebAnimation.cpp:
2178         (WebCore::WebAnimation::create): Pass in the document to the constructor.
2179         (WebCore::WebAnimation::WebAnimation): Use the provided document to initialize ActiveDOMObject.
2180         (WebCore::WebAnimation::enqueueAnimationPlaybackEvent): Create an AnimationPlaybackEvent with
2181         the provided type, timeline time and animation time and enqueue it on the document timeline,
2182         if one is available, or dispatch on this animation as a standalone task.
2183         (WebCore::WebAnimation::acceleratedRunningStateDidChange):
2184         (WebCore::WebAnimation::activeDOMObjectName const):
2185         (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
2186         (WebCore::WebAnimation::stop):
2187         * animation/WebAnimation.h: Define WebAnimation to be an EventTarget and an ActiveDOMObject.
2188         * animation/WebAnimation.idl: Define WebAnimation to be an EventTarget and an ActiveDOMObject.
2189         * dom/EventTargetFactory.in:
2190
2191 2017-12-12  Chris Dumez  <cdumez@apple.com>
2192
2193         Simplify IPC code between WebProcess and StorageProcess for serviceWorker.postMessage()
2194         https://bugs.webkit.org/show_bug.cgi?id=180683
2195
2196         Reviewed by Brady Eidson.
2197
2198         Merge the 2 code paths from calling postMessage() from a ServiceWorkerClient and from
2199         a ServiceWorker. Also, postMessage() now only IPCs an identifier from the WebContent
2200         process to the StorageProcess. The ServiceWorkerClientData is looked up on Storage
2201         process side from the identifier before being sent to the context process.
2202
2203         * workers/service/SWClientConnection.h:
2204         * workers/service/ServiceWorker.cpp:
2205         (WebCore::ServiceWorker::postMessage):
2206         * workers/service/ServiceWorkerTypes.h:
2207         * workers/service/server/SWServer.cpp:
2208         (WebCore::SWServer::clientByID const):
2209         (WebCore::SWServer::matchAll):
2210         (WebCore::SWServer::forEachClientForOrigin):
2211         (WebCore::SWServer::claim):
2212         (WebCore::SWServer::registerServiceWorkerClient):
2213         (WebCore::SWServer::unregisterServiceWorkerClient):
2214         * workers/service/server/SWServer.h:
2215         * workers/service/server/SWServerWorker.cpp:
2216         (WebCore::SWServerWorker::findClientByIdentifier):
2217         * workers/service/server/SWServerWorker.h:
2218
2219 2017-12-12  Youenn Fablet  <youenn@apple.com>
2220
2221         Allow AudioContext to start when getUserMedia is on
2222         https://bugs.webkit.org/show_bug.cgi?id=180680
2223
2224         Reviewed by Eric Carlson.
2225
2226         Test: webrtc/getUserMedia-webaudio-autoplay.html
2227
2228         * Modules/webaudio/AudioContext.cpp:
2229         (WebCore::AudioContext::willBeginPlayback):
2230
2231 2017-12-12  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2232
2233         [Readable Streams API] Throw RangeError if a size is provided when creating a readable byte stream
2234         https://bugs.webkit.org/show_bug.cgi?id=180470
2235
2236         Reviewed by Youenn Fablet.
2237
2238         Throw a RangeError if a ReadableStream is created with type 'bytes' and with a
2239         non-undefined strategy size, as per latest spec:
2240         - https://github.com/whatwg/streams/pull/856
2241         - https://streams.spec.whatwg.org/#rs-constructor (step 4.c)
2242
2243         One new test imported from WPT to check that RangeError is thrown.
2244
2245         * Modules/streams/ReadableStream.js:
2246         (initializeReadableStream): Check strategy size and throw RangeError if needed.
2247
2248 2017-12-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2249
2250         [GTK][WebRTC] Stop warning with so much verbosity about not implemented RealtimeMediaSourceCenter
2251         https://bugs.webkit.org/show_bug.cgi?id=180694
2252
2253         Reviewed by Youenn Fablet.
2254
2255         No new tests -- no change in functionality.
2256
2257         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2258         (WebCore::RealtimeMediaSourceCenter::singleton):
2259
2260 2017-12-12  Ms2ger  <Ms2ger@igalia.com>
2261
2262         Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
2263         https://bugs.webkit.org/show_bug.cgi?id=180471
2264
2265         Reviewed by Darin Adler.
2266
2267         Test: imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html
2268
2269         * plugins/DOMMimeTypeArray.cpp:
2270         (WebCore::DOMMimeTypeArray::supportedPropertyNames):
2271         * plugins/DOMPluginArray.cpp:
2272         (WebCore::DOMPluginArray::supportedPropertyNames):
2273
2274 2017-12-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2275
2276         [WTF] Thread::create should have Thread::tryCreate
2277         https://bugs.webkit.org/show_bug.cgi?id=180333
2278
2279         Reviewed by Darin Adler.
2280
2281         No behavior change.
2282
2283         * bindings/js/GCController.cpp:
2284         (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
2285         * platform/audio/ReverbConvolver.cpp:
2286         (WebCore::ReverbConvolver::ReverbConvolver):
2287         * platform/audio/ReverbConvolver.h:
2288         * workers/WorkerThread.cpp:
2289         (WebCore::WorkerThread::start):
2290
2291 2017-12-11  Manuel Rego Casasnovas  <rego@igalia.com>
2292
2293         [css-grid] Automatic minimum size is not clamped if min track sizing function is auto
2294         https://bugs.webkit.org/show_bug.cgi?id=180283
2295
2296         Reviewed by Darin Adler.
2297
2298         We were not clamping the automatic minimum size when
2299         the min track sizing function was intrinsic (e.g. minmax(auto, 0px)).
2300         However the spec (https://drafts.csswg.org/css-grid/#min-size-auto)
2301         is very clear regarding that.
2302
2303         This patch modifies
2304         GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem(),
2305         so in the case of a fixed max track sizing function it clamps
2306         the automatic minimum size of the item to the stretch fit
2307         of the grid area's size.
2308         It needs to take into account if the item has fixed size, margin, border
2309         and/or padding as those cannot be clamped.
2310
2311         Using WPT tests to verify this behavior,
2312         and corrected a bunch of other tests that were wrong.
2313
2314         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-017.html
2315               imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-022.html
2316               imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-023.html
2317
2318         * rendering/GridTrackSizingAlgorithm.cpp:
2319         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
2320         * rendering/GridTrackSizingAlgorithm.h:
2321         (WebCore::GridTrack::growthLimitIsInfinite const):
2322         * rendering/style/GridTrackSize.h:
2323         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
2324         (WebCore::GridTrackSize::hasFixedMaxTrackBreadth const):
2325
2326 2017-12-11  Zan Dobersek  <zdobersek@igalia.com>
2327
2328         [Cairo] Cairo::clipToImageBuffer() should operate on a cairo_surface_t
2329         https://bugs.webkit.org/show_bug.cgi?id=180665
2330
2331         Reviewed by Michael Catanzaro.
2332
2333         Have the Cairo::clipToImageBuffer() function in the CairoUtilities code
2334         operate on a cairo_surface_t object, instead of an Image object.
2335
2336         Call site in GraphicsContext::clipToImageBuffer() is adjusted to first
2337         ensure a non-null Image object, and then retrieve a cairo_surface_t
2338         object from that, passing it on to Cairo::clipToImageBuffer().
2339
2340         No new tests -- no change in functionality.
2341
2342         * platform/graphics/cairo/CairoOperations.cpp:
2343         (WebCore::Cairo::clipToImageBuffer):
2344         * platform/graphics/cairo/CairoOperations.h:
2345         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2346         (WebCore::GraphicsContext::clipToImageBuffer):
2347
2348 2017-12-11  Zan Dobersek  <zdobersek@igalia.com>
2349
2350         [Cairo] Don't use a static cairo_surface_t object for CairoPath contexts
2351         https://bugs.webkit.org/show_bug.cgi?id=180663
2352
2353         Reviewed by Michael Catanzaro.
2354
2355         Instead of using a single cairo_surface_t object and sharing it between
2356         different cairo_t objects handled by CairoPath, create a new mock 1x1px
2357         alpha-only surface for each cairo_t object that's allocated in the
2358         CairoPath constructor.
2359
2360         This avoids potential issues in how Cairo's state handling internally
2361         uses these surfaces, which is completely opaque to us and out of our
2362         control. This also avoids crashes when using this one cairo_surface_t
2363         object through different CairoPath objects across different threads.
2364
2365         No new tests -- no change in behavior.
2366
2367         * platform/graphics/cairo/PlatformPathCairo.cpp:
2368         (WebCore::CairoPath::CairoPath):
2369         (WebCore::pathSurface): Deleted.
2370         * platform/graphics/cairo/PlatformPathCairo.h:
2371         (WebCore::CairoPath::context):
2372
2373 2017-12-11  Zan Dobersek  <zdobersek@igalia.com>
2374
2375         [CoordGraphics] Move UpdateAtlas, AreaAllocator into the platform layer
2376         https://bugs.webkit.org/show_bug.cgi?id=180641
2377
2378         Reviewed by Michael Catanzaro.
2379
2380         Move the UpdateAtlas and AreaAllocator classes and their source files
2381         into the platform layer. This still means using the WebCore namespace,
2382         but apart from that these two classes have no dependency on anything in
2383         the WebKit layer, so they can be moved from there.
2384
2385         No new tests -- no change in functionality.
2386
2387         * platform/TextureMapper.cmake:
2388         * platform/graphics/texmap/coordinated/AreaAllocator.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp.
2389         (WebCore::AreaAllocator::AreaAllocator):
2390         (WebCore::AreaAllocator::~AreaAllocator):
2391         (WebCore::AreaAllocator::expand):
2392         (WebCore::AreaAllocator::expandBy):
2393         (WebCore::AreaAllocator::release):
2394         (WebCore::AreaAllocator::overhead const):
2395         (WebCore::AreaAllocator::roundAllocation const):
2396         (WebCore::GeneralAreaAllocator::GeneralAreaAllocator):
2397         (WebCore::GeneralAreaAllocator::~GeneralAreaAllocator):
2398         (WebCore::GeneralAreaAllocator::freeNode):
2399         (WebCore::GeneralAreaAllocator::expand):
2400         (WebCore::fitsWithin):
2401         (WebCore::GeneralAreaAllocator::allocate):
2402         (WebCore::GeneralAreaAllocator::allocateFromNode):
2403         (WebCore::GeneralAreaAllocator::splitNode):
2404         (WebCore::GeneralAreaAllocator::updateLargestFree):
2405         (WebCore::GeneralAreaAllocator::release):
2406         (WebCore::GeneralAreaAllocator::overhead const):
2407         * platform/graphics/texmap/coordinated/AreaAllocator.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h.
2408         (WebCore::nextPowerOfTwo):
2409         (WebCore::AreaAllocator::size const):
2410         (WebCore::AreaAllocator::minimumAllocation const):
2411         (WebCore::AreaAllocator::setMinimumAllocation):
2412         (WebCore::AreaAllocator::margin const):
2413         (WebCore::AreaAllocator::setMargin):
2414         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp.
2415         (WebCore::UpdateAtlas::UpdateAtlas):
2416         (WebCore::UpdateAtlas::~UpdateAtlas):
2417         (WebCore::UpdateAtlas::buildLayoutIfNeeded):
2418         (WebCore::UpdateAtlas::didSwapBuffers):
2419         (WebCore::UpdateAtlas::getCoordinatedBuffer):
2420         * platform/graphics/texmap/coordinated/UpdateAtlas.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h.
2421         (WebCore::UpdateAtlas::size const):
2422         (WebCore::UpdateAtlas::supportsAlpha const):
2423         (WebCore::UpdateAtlas::addTimeInactive):
2424         (WebCore::UpdateAtlas::isInactive const):
2425         (WebCore::UpdateAtlas::isInUse const):
2426
2427 2017-12-11  Ryosuke Niwa  <rniwa@webkit.org>
2428
2429         Disable NoEventDispatchAssertion release assertion in WebKit1
2430         https://bugs.webkit.org/show_bug.cgi?id=180616
2431
2432         Reviewed by Zalan Bujtas.
2433
2434         Disabled the release assertion for NoEventDispatchAssertion in WebKit1 since there are many
2435         delegate callbacks that happen at unsafe timing, and we don't have any hope of fixing them
2436         in short term.
2437
2438         * bindings/js/ScriptController.cpp:
2439         (WebCore::ScriptController::canExecuteScripts):
2440         * dom/Document.cpp:
2441         (WebCore::isSafeToUpdateStyleOrLayout):
2442         * dom/ScriptElement.cpp:
2443         (WebCore::ScriptElement::executeClassicScript):
2444         * platform/RuntimeApplicationChecks.h:
2445         (WebCore::isInWebProcess):
2446         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2447         (WebCore::isInWebProcess): Extracted from IOSApplication::isWebProcess.
2448         (WebCore::IOSApplication::isWebProcess):
2449
2450 2017-12-11  Darin Adler  <darin@apple.com>
2451
2452         Improve FontSelectionAlgorithm, including moving from IntegerHasher to Hasher
2453         https://bugs.webkit.org/show_bug.cgi?id=180340
2454
2455         Reviewed by Dan Bates.
2456
2457         * css/CSSFontFaceSet.h: Moved FontSelectionRequestKey and FontSelectionRequestKeyHash
2458         here to be private members, and used a std::optional instead of a class for this.
2459         Also use the new Hasher to compute the hash. Also added FontSelectionRequestKeyHashTraits.
2460
2461         * platform/graphics/FontDescription.cpp:
2462         (WebCore::FontDescription::FontDescription): Updated since FontSelectionRequest
2463         does not always have a constructor any more.
2464
2465         * platform/graphics/FontSelectionAlgorithm.h: Tweaked comments. Used "using" instead
2466         of typedef. Formatted some trivial functions as single lines. Stopped using
2467         NeverDestroyed for simple classes like FontSelectionValue; it's not needed unless
2468         there is a destructor. Got rid of some incorrect use of const. Replaced some member
2469         functions with non-member functions. Moved some function bodies out of class definitions.
2470         Used a lot of constexpr functions.
2471         (WebCore::FontSelectionRequest::tied const): Added so we can easily write both == and the
2472         hash function without listing the data members.
2473         (WebCore::add): Added an overload so we can hash things that include FontSelectionRequest.
2474         (WebCore::FontSelectionRequestKey::FontSelectionRequestKey): Changed this class to
2475         use std::optional instead of a separate boolean for deleted values.
2476         (WebCore::FontSelectionRequestKey::isHashTableDeletedValue const): Ditto.
2477         (WebCore::FontSelectionRequestKey::operator== const): Ditto.
2478         (WebCore::FontSelectionRequestKeyHash::hash): Ditto.
2479         (WebCore::FontSelectionRequestKeyHash::equal): Ditto.
2480         (WebCore::FontSelectionCapabilities::tied const): Added so we can easily write both ==
2481         and the hash function without listing the data members.
2482         (WebCore::FontSelectionSpecifiedCapabilities::tied const): Ditto.
2483         (WebCore::FontSelectionAlgorithm::FontSelectionAlgorithm): Use make_unique instead of new.
2484
2485         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2486         (WebCore::findClosestFont): Move in the vector instead of copying it when creating a
2487         FontSelectionAlgorithm object.
2488
2489 2017-12-11  Jer Noble  <jer.noble@apple.com>
2490
2491         [EME] support update() for FairPlayStreaming in Modern EME API
2492         https://bugs.webkit.org/show_bug.cgi?id=180542
2493
2494         Reviewed by Eric Carlson.
2495
2496         Support the updateLicense() method in CDMInstanceFairPlayStreaming. Also, support adding a
2497         AVStreamDataParser to the AVContentKeySession.
2498
2499         Drive-by fixes:
2500
2501         - Sometimes, AVFoundation will give us a base64 encoded string with spaces url-disallowed
2502         characters, so use base64Decode() rather than base64URLDecode().
2503
2504         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
2505         (WebCore::validFairPlayStreamingSchemes):
2506         (WebCore::extractSinfData):
2507         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2508         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2509         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
2510         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
2511         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
2512         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2513         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstance const):
2514         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2515         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
2516         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
2517         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
2518         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2519         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2520         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
2521         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
2522
2523 2017-12-11  Eric Carlson  <eric.carlson@apple.com>
2524
2525         Web Inspector: Optionally log WebKit log parameters as JSON
2526         https://bugs.webkit.org/show_bug.cgi?id=180529
2527         <rdar://problem/35909462>
2528
2529         Reviewed by Joseph Pecoraro.
2530
2531         * dom/Document.cpp:
2532         (WebCore::Document::didLogMessage):Update for API change. Don't check for main thread, that
2533         is already done in addConsoleMessage.
2534         * dom/Document.h:
2535
2536         * html/HTMLMediaElement.cpp:
2537         (WebCore::HTMLMediaElement::updatePlayState): Cleanup logging.
2538
2539         * html/track/DataCue.cpp:
2540         (WebCore::DataCue::toJSONString const): Serialize to JSON string.
2541         (WebCore::DataCue::toString const): Deleted.
2542         * html/track/DataCue.h:
2543         (WTF::LogArgument<WebCore::DataCue>::toString):
2544
2545         * html/track/TextTrackCue.cpp:
2546         (WebCore::TextTrackCue::toJSON const): Ditto.
2547         (WebCore::TextTrackCue::toJSONString const):
2548         (WebCore::TextTrackCue::toString const): Deleted.
2549         * html/track/TextTrackCue.h:
2550         (WTF::LogArgument<WebCore::TextTrackCue>::toString):
2551
2552         * html/track/TextTrackCueGeneric.cpp:
2553         (WebCore::TextTrackCueGeneric::toJSONString const): Ditto.
2554         (WebCore::TextTrackCueGeneric::toString const): Deleted.
2555         * html/track/TextTrackCueGeneric.h:
2556         (WTF::LogArgument<WebCore::TextTrackCueGeneric>::toString):
2557
2558         * html/track/VTTCue.cpp:
2559         (WebCore::VTTCue::toJSONString const): Ditto.
2560         (WebCore::VTTCue::toString const): Deleted.
2561         * html/track/VTTCue.h:
2562         (WTF::LogArgument<WebCore::VTTCue>::toString):
2563
2564         * platform/graphics/InbandTextTrackPrivateClient.h:
2565         (WebCore::GenericCueData::toJSONString const): Ditto.
2566         (WTF::LogArgument<WebCore::GenericCueData>::toString):
2567         (WebCore::GenericCueData::toString const): Deleted.
2568
2569         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2570         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Cleanup logging.
2571         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues): Ditto.
2572         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Log the entire cue.
2573         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Cleanup logging.
2574
2575         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2576         (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const): Don't log, it isn't
2577         interesting and happens frequently.
2578         (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const): Ditto.
2579
2580         * platform/graphics/iso/ISOVTTCue.cpp:
2581         (WebCore::ISOWebVTTCue::toJSONString const): Serialize to JSON string.
2582
2583         * platform/graphics/iso/ISOVTTCue.h:
2584         (WTF::LogArgument<WebCore::ISOWebVTTCue>::toString): Ditto.
2585
2586 2017-12-11  Youenn Fablet  <youenn@apple.com>
2587
2588         Use VCP H264 encoder for platforms supporting it
2589         https://bugs.webkit.org/show_bug.cgi?id=179076
2590         rdar://problem/35180773
2591
2592         Reviewed by Eric Carlson.
2593
2594         Covered by existing test coverage.
2595
2596         * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
2597         (WebCore::VideoToolboxVideoEncoderFactory::setActive):
2598         (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
2599         (WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
2600         * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h:
2601
2602 2017-12-11  Chris Dumez  <cdumez@apple.com>
2603
2604         Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData
2605         https://bugs.webkit.org/show_bug.cgi?id=180669
2606
2607         Reviewed by Youenn Fablet.
2608
2609         Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData, for consistency with
2610         ServiceWorkerIdentifier / ServiceWorkerData, and start simplifying the postMessage() code.
2611
2612         * WebCore.xcodeproj/project.pbxproj:
2613         * dom/Document.cpp:
2614         (WebCore::Document::setServiceWorkerConnection):
2615         * workers/service/SWClientConnection.h:
2616         * workers/service/ServiceWorker.cpp:
2617         (WebCore::ServiceWorker::postMessage):
2618         * workers/service/ServiceWorkerClient.cpp:
2619         (WebCore::ServiceWorkerClient::getOrCreate):
2620         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
2621         * workers/service/ServiceWorkerClient.h:
2622         (WebCore::ServiceWorkerClient::identifier const):
2623         * workers/service/ServiceWorkerClientData.cpp:
2624         (WebCore::ServiceWorkerClientData::isolatedCopy const):
2625         (WebCore::ServiceWorkerClientData::from):
2626         * workers/service/ServiceWorkerClientData.h:
2627         (WebCore::ServiceWorkerClientData::encode const):
2628         (WebCore::ServiceWorkerClientData::decode):
2629         * workers/service/ServiceWorkerClientInformation.h: Removed.
2630         * workers/service/ServiceWorkerClients.cpp:
2631         (WebCore::didFinishGetRequest):
2632         (WebCore::ServiceWorkerClients::get):
2633         (WebCore::matchAllCompleted):
2634         * workers/service/ServiceWorkerTypes.h:
2635         * workers/service/ServiceWorkerWindowClient.cpp:
2636         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
2637         * workers/service/ServiceWorkerWindowClient.h:
2638         * workers/service/context/SWContextManager.cpp:
2639         (WebCore::SWContextManager::postMessageToServiceWorker):
2640         * workers/service/context/SWContextManager.h:
2641         * workers/service/context/ServiceWorkerThread.cpp:
2642         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
2643         * workers/service/context/ServiceWorkerThread.h:
2644         * workers/service/server/SWServer.cpp:
2645         (WebCore::SWServer::findClientByIdentifier):
2646         (WebCore::SWServer::matchAll):
2647         (WebCore::SWServer::claim):
2648         (WebCore::SWServer::registerServiceWorkerClient):
2649         * workers/service/server/SWServer.h:
2650         * workers/service/server/SWServerToContextConnection.h:
2651         * workers/service/server/SWServerWorker.h:
2652
2653 2017-12-11  Daniel Bates  <dabates@apple.com>
2654
2655         Fix the macOS Sierra build following r225179
2656         (https://bugs.webkit.org/show_bug.cgi?id=180011)
2657
2658         Substitute TARGET_MAC_OS_X_VERSION_LESS_THAN_101300 for TARGET_MAC_OS_X_VERSION_LESS_THAN_1013000.
2659
2660         * Configurations/WebCore.xcconfig:
2661
2662 2017-12-11  Zalan Bujtas  <zalan@apple.com>
2663
2664         Make FrameView objects IsoHeap allocated
2665         https://bugs.webkit.org/show_bug.cgi?id=180668
2666         <rdar://problem/35976738>
2667
2668         Reviewed by Simon Fraser.
2669
2670         Related to <https://trac.webkit.org/changeset/225719/webkit>
2671
2672         * page/FrameView.cpp:
2673         * page/FrameView.h:
2674
2675 2017-12-11  Antoine Quint  <graouts@apple.com>
2676
2677         [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
2678         https://bugs.webkit.org/show_bug.cgi?id=180647
2679
2680         Reviewed by Dean Jackson.
2681
2682         Actually fix Windows build this time.
2683
2684         * animation/AnimationPlaybackEventInit.h:
2685
2686 2017-12-11  Antoine Quint  <graouts@apple.com>
2687
2688         [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
2689         https://bugs.webkit.org/show_bug.cgi?id=180647
2690         <rdar://problem/35966325>
2691
2692         Reviewed by Dean Jackson.
2693
2694         Unreviewed, fix Windows build.
2695
2696         * animation/AnimationPlaybackEventInit.h:
2697
2698 2017-12-11  Zalan Bujtas  <zalan@apple.com>
2699
2700         FloatingObjects/FloatingObject classes should hold weak references to renderers
2701         https://bugs.webkit.org/show_bug.cgi?id=180627
2702         <rdar://problem/35954069>
2703
2704         Reviewed by Antti Koivisto.
2705
2706         * rendering/FloatingObjects.cpp:
2707         (WebCore::FloatingObject::FloatingObject):
2708         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
2709         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
2710         (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
2711         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
2712         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
2713         (WebCore::FloatingObjects::findNextFloatLogicalBottomBelow):
2714         (WebCore::FloatingObjects::findNextFloatLogicalBottomBelowForBlock):
2715         (WebCore::FloatingObjects::FloatingObjects):
2716         (WebCore::FloatingObjects::clearLineBoxTreePointers):
2717         (WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat):
2718         (WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat):
2719         (WebCore::FloatingObjects::logicalLeftOffset):
2720         (WebCore::FloatingObjects::logicalRightOffset):
2721         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
2722         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
2723         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining const):
2724         (WebCore::ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded):
2725         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
2726         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
2727         * rendering/FloatingObjects.h:
2728         (WebCore::FloatingObject::renderer const):
2729         (WebCore::FloatingObjects::renderer const):
2730
2731 2017-12-11  David Quesada  <david_quesada@apple.com>
2732
2733         Turn on ENABLE_APPLICATION_MANIFEST
2734         https://bugs.webkit.org/show_bug.cgi?id=180562
2735         rdar://problem/35924737
2736
2737         Reviewed by Geoffrey Garen.
2738
2739         * Configurations/FeatureDefines.xcconfig:
2740         * loader/LinkLoader.cpp:
2741         (WebCore::createLinkPreloadResourceClient):
2742         * loader/cached/CachedResourceRequest.cpp:
2743             Add a missing #include that was implicitly added in the unified source when
2744             the feature is disabled.
2745
2746 2017-12-11  Dean Jackson  <dino@apple.com>
2747
2748         Add a runtime feature flag for ImageBitmap and OffscreenCanvas
2749         https://bugs.webkit.org/show_bug.cgi?id=180652
2750         <rdar://problem/35969611>
2751
2752         Reviewed by Antoine Quint.
2753
2754         Add a RuntimeEnabledFeature for these interfaces, and link the bindings
2755         to the feature.
2756
2757         Test: fast/canvas/offscreen-enabled.html
2758
2759         * bindings/js/WebCoreBuiltinNames.h:
2760         * html/ImageBitmap.idl:
2761         * html/OffscreenCanvas.idl:
2762         * page/RuntimeEnabledFeatures.h:
2763         (WebCore::RuntimeEnabledFeatures::setImageBitmapOffscreenCanvasEnabled):
2764         (WebCore::RuntimeEnabledFeatures::imageBitmapOffscreenCanvasEnabled const):
2765         * page/WindowOrWorkerGlobalScope.idl:
2766
2767 2017-12-11  Antoine Quint  <graouts@apple.com>
2768
2769         [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
2770         https://bugs.webkit.org/show_bug.cgi?id=180647
2771         <rdar://problem/35966325>
2772
2773         Reviewed by Dean Jackson.
2774
2775         We implement the AnimationPlaybackEvent interface and AnimationPlaybackEventInit dictionary
2776         as the first step towards dispatching animation "finish" and "cancel" events.
2777
2778         Animation playback events will be dispatched on Animation objects and expose the timeline time
2779         and animation current time at the time they were constructed. Dispatch itself, which will be
2780         the focus of the next patch, is not synchronous, so it's important to track those values
2781         at creation time.
2782
2783         No new tests yet, followup patches will enable event dispatch and existing Web Platform Tests
2784         will show progressions.
2785
2786         * CMakeLists.txt:
2787         * DerivedSources.make:
2788         * Sources.txt:
2789         * WebCore.xcodeproj/project.pbxproj:
2790         * animation/AnimationPlaybackEvent.cpp: Added.
2791         (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
2792         (WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
2793         (WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
2794         * animation/AnimationPlaybackEvent.h: Added.
2795         * animation/AnimationPlaybackEvent.idl: Added.
2796         * animation/AnimationPlaybackEventInit.h: Added.
2797         * animation/AnimationPlaybackEventInit.idl: Added.
2798         * bindings/js/WebCoreBuiltinNames.h:
2799         * dom/EventNames.in:
2800
2801 2017-12-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2802
2803         [WinCairo] DumpRenderTree times out for all non-http tests
2804         https://bugs.webkit.org/show_bug.cgi?id=180571
2805
2806         Reviewed by Alex Christensen.
2807
2808         Bug fix on processing the curl event for file protocol.
2809
2810         No new tests. This fix is to run existing tests.
2811
2812         * platform/network/curl/CurlRequest.cpp:
2813         (WebCore::CurlRequest::completeDidReceiveResponse):
2814         * platform/network/curl/CurlRequest.h:
2815         (WebCore::CurlRequest::isCompleted const):
2816         (WebCore::CurlRequest::isCancelled const):
2817         (WebCore::CurlRequest::isCompletedOrCancelled const):
2818
2819 2017-12-11  Manuel Rego Casasnovas  <rego@igalia.com>
2820
2821         REGRESSION(r221931): Row stretch doesn't work for grid container with min-height
2822         https://bugs.webkit.org/show_bug.cgi?id=180287
2823
2824         Reviewed by Darin Adler.
2825
2826         In r221931 we moved the stretch phase as the last step of
2827         the track sizing algorithm.
2828         However this introduced a regression as we were no longer
2829         taking into account the grid container min-width|height constraints
2830         during this step.
2831
2832         The CSS WG modified the spec so it now defines what to do
2833         in these situations (https://drafts.csswg.org/css-grid/#algo-stretch):
2834           "If the free space is indefinite, but the grid container
2835            has a definite min-width/height, use that size to calculate
2836            the free space for this step instead."
2837
2838         This patch adds a new method
2839         GridTrackSizingAlgorithmStrategy::freeSpaceForStretchAutoTracksStep().
2840         When we're in the DefiniteSizeStrategy it just returns the current
2841         free space.
2842         For the IndefiniteSizeStrategy in the columns case we don't need
2843         any special computation (the same that happens in
2844         recomputeUsedFlexFractionIfNeeded()); for rows it uses the min size
2845         of the grid container (respecting min-width|height properties)
2846         to calculate the free space.
2847
2848         Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-stretch-respects-min-size-001.html
2849
2850         * rendering/GridTrackSizingAlgorithm.cpp:
2851         (WebCore::IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
2852         (WebCore::DefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
2853         (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks):
2854         * rendering/GridTrackSizingAlgorithm.h:
2855
2856 2017-12-10  Minsheng Liu  <lambda@liu.ms>
2857
2858         Incorrect bounds inside <mover>/<munder> when a stretchy operator is present
2859         https://bugs.webkit.org/show_bug.cgi?id=179682
2860
2861         Reviewed by Frédéric Wang.
2862
2863         Currently a stretchy operator inside <mover>/<munder>/<munderover> is stretched
2864         during paint() rather than layout(), which leads to both end user confusion
2865         and many unexpected behaviors. This patch rewrites
2866         RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren()
2867         to both eliminate the issue and make operator stretching more standard
2868         conforming.
2869
2870         A test is added to check the stretch width of stretchy operators in various
2871         scenarios:
2872         mathml/opentype/munderover-stretch-width.html
2873
2874         A previous test is updated:
2875         mathml/opentype/opentype-stretchy-horizontal.html
2876
2877         * rendering/mathml/RenderMathMLOperator.cpp:
2878         (WebCore::RenderMathMLOperator::stretchTo):
2879         (WebCore::RenderMathMLOperator::resetStretchSize):
2880         (WebCore::RenderMathMLOperator::paint):
2881         * rendering/mathml/RenderMathMLOperator.h:
2882         (WebCore::RenderMathMLOperator::setStretchWidthLocked):
2883         (WebCore::RenderMathMLOperator::isStretchWidthLocked const):
2884         * rendering/mathml/RenderMathMLUnderOver.cpp:
2885         (WebCore::toHorizontalStretchyOperator):
2886         (WebCore::fixLayoutAfterStretch):
2887         (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
2888
2889 2017-12-10  Yusuke Suzuki  <utatane.tea@gmail.com>
2890
2891         Unreviewed, follow-up patch after r225470
2892         https://bugs.webkit.org/show_bug.cgi?id=180308
2893
2894         * Modules/webdatabase/SQLTransaction.cpp:
2895         (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
2896         Use consistent operands.
2897
2898         * bindings/js/JSCallbackData.h:
2899         (WebCore::JSCallbackData::JSCallbackData):
2900         Use class field initializer.
2901
2902         * xml/parser/XMLDocumentParserLibxml2.cpp:
2903         (WebCore::openFunc):
2904         Use consistent operands.
2905
2906 2017-12-09  Ryosuke Niwa  <rniwa@webkit.org>
2907
2908         iOS: Crash in Document::updateLayout() via Document::processViewport
2909         https://bugs.webkit.org/show_bug.cgi?id=180619
2910         <rdar://problem/35717575>
2911
2912         Reviewed by Zalan Bujtas.
2913
2914         The crash is caused by modern media controls updating the layout in the middle of insertedIntoAncestor
2915         via HTMLMediaElement::setControllerJSProperty inside Document::pageScaleFactorChangedAndStable.
2916
2917         Fixed the crash by delaying the work to update the viewport configuration until didFinishInsertingNode
2918         since updating the viewport configuration results in a lot of related code running in response,
2919         and making sure all that code never tries to execute an author script is not attainable in the short term,
2920         and a maintenance nightmare in the long term.
2921
2922         Test: media/ios/viewport-change-with-video.html
2923
2924         * html/HTMLMetaElement.cpp:
2925         (WebCore::HTMLMetaElement::insertedIntoAncestor):
2926         (WebCore::HTMLMetaElement::didFinishInsertingNode): Added.
2927         * html/HTMLMetaElement.h:
2928
2929 2017-12-08  Zalan Bujtas  <zalan@apple.com>
2930
2931         Document::updateLayout() could destroy current frame.
2932         https://bugs.webkit.org/show_bug.cgi?id=180525
2933         <rdar://problem/35906836>
2934
2935         Reviewed by Simon Fraser.
2936
2937         Early return when Document::updateLayout() triggers Frame destruction.
2938
2939         Test: fast/frames/crash-when-iframe-is-remove-in-eventhandler.html
2940
2941         * dom/TreeScope.cpp:
2942         (WebCore::absolutePointIfNotClipped):
2943
2944 2017-12-08  Chris Dumez  <cdumez@apple.com>
2945
2946         ServiceWorkerGlobalScope is a global object and should be marked as [ImplicitThis] in the IDL
2947         https://bugs.webkit.org/show_bug.cgi?id=180615
2948
2949         Reviewed by Brady Eidson.
2950
2951         ServiceWorkerGlobalScope is a global object and should be marked as [ImplicitThis] in the IDL, similarly to what we do for Window.
2952         This allows a getter to be fallback to the global object as ThisValue when the cast of the ThisValue to the expected type fails.
2953
2954         No new tests, rebaselined existing test.
2955
2956         * workers/DedicatedWorkerGlobalScope.idl:
2957         * workers/WorkerGlobalScope.idl:
2958         * workers/service/ServiceWorkerGlobalScope.idl:
2959
2960 2017-12-08  Brady Eidson  <beidson@apple.com>
2961
2962         Delay some service worker operations until after the database import completes.
2963         https://bugs.webkit.org/show_bug.cgi?id=180573
2964
2965         Reviewed by Chris Dumez.
2966
2967         No new tests (Not testable yet).
2968
2969         Right after the storage process launches it starts importing registration records.
2970         During this time, a lot of the decisions we make regarding registrations, fetch, etc.
2971         are invalid, as they rely on those in-memory records being in place.
2972         
2973         This patch delays certain things until after the initial origin table import is complete.
2974         
2975         * workers/service/server/RegistrationStore.cpp:
2976         (WebCore::RegistrationStore::databaseOpenedAndRecordsImported):
2977
2978         * workers/service/server/SWOriginStore.h:
2979
2980         * workers/service/server/SWServer.cpp:
2981         (WebCore::SWServer::registrationStoreImportComplete): Tell the origin store the initial
2982           import was completed.
2983         (WebCore::SWServer::addRegistrationFromStore):
2984         * workers/service/server/SWServer.h:
2985
2986 2017-12-08  Youenn Fablet  <youenn@apple.com>
2987
2988         Service Worker should use a correct user agent
2989         https://bugs.webkit.org/show_bug.cgi?id=180566
2990         <rdar://problem/35926295>
2991
2992         Reviewed by Chris Dumez.
2993
2994         Test: http/wpt/service-workers/useragent.https.html
2995
2996         Make ServiceWorkerFrameLoaderClient return a valid UserAgent.
2997         Pass user agent to ServiceWorkerThread so that navigation.userAgent is correctly initialized.
2998         Allow ServiceWorkerFrameLoaderClient to clean itself when no longer needed.
2999
3000         * loader/EmptyFrameLoaderClient.h:
3001         * workers/service/context/ServiceWorkerThread.cpp:
3002         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
3003         * workers/service/context/ServiceWorkerThread.h:
3004         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3005         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
3006         (WebCore::ServiceWorkerThreadProxy::frameLoaderClient):
3007         * workers/service/context/ServiceWorkerThreadProxy.h:
3008
3009 2017-12-07  Simon Fraser  <simon.fraser@apple.com>
3010
3011         Wrong caret position for input field inside a fixed position parent on iOS 11
3012         https://bugs.webkit.org/show_bug.cgi?id=176896
3013         rdar://problem/33726145
3014
3015         Reviewed by Tim Horton.
3016
3017         In r219668 I added code to compute a layout viewport rect in the web process, so that
3018         after programmatic scrolling, getBoundingClientRect() would return the correct values.
3019         However, that computation sometimes used a different visual viewport than the UI process,
3020         resulting in a different layout viewport being set. This would happen when the keyboard
3021         was visible, and the combination of this and zooming when focusing an input would result
3022         in a state where the scrolling tree contained notes computed with the bad layout viewport.
3023         This could cause apparently offset fixed elements, and bad caret positioning if those fixed
3024         elements contained the focused input.
3025
3026         Fix by passing to the web process the same visual viewport rect that the UI process is using,
3027         namely "unobscuredContentRectRespectingInputViewBounds". This was already being set in
3028         VisibleContentRectUpdateInfo but wasn't encoded/decoded, so fix that. Set it as an optional<>
3029         on FrameView when different from the normal visual viewport, and return it from
3030         visualViewportRect().
3031
3032         Some other minor logging changes.
3033
3034         Test: fast/visual-viewport/ios/caret-after-focus-in-fixed.html
3035
3036         * page/FrameView.cpp:
3037         (WebCore::FrameView::setVisualViewportOverrideRect):
3038         (WebCore::FrameView::updateLayoutViewport):
3039         (WebCore::FrameView::visualViewportRect const):
3040         * page/FrameView.h:
3041         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
3042         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
3043
3044 2017-12-08  Zalan Bujtas  <zalan@apple.com>
3045
3046         Make inline box objects IsoHeap allocated.
3047         https://bugs.webkit.org/show_bug.cgi?id=180556
3048         <rdar://problem/35923629>
3049
3050         Reviewed by Filip Pizlo.
3051
3052         * rendering/EllipsisBox.cpp:
3053         * rendering/EllipsisBox.h:
3054         * rendering/InlineBox.cpp:
3055         * rendering/InlineBox.h:
3056         * rendering/InlineElementBox.cpp:
3057         * rendering/InlineElementBox.h:
3058         * rendering/InlineFlowBox.cpp:
3059         * rendering/InlineFlowBox.h:
3060         * rendering/InlineTextBox.cpp:
3061         * rendering/InlineTextBox.h:
3062         * rendering/RootInlineBox.cpp:
3063         * rendering/RootInlineBox.h:
3064         * rendering/TrailingFloatsRootInlineBox.h:
3065         * rendering/svg/SVGInlineFlowBox.cpp:
3066         * rendering/svg/SVGInlineFlowBox.h:
3067         * rendering/svg/SVGInlineTextBox.cpp:
3068         * rendering/svg/SVGInlineTextBox.h:
3069         * rendering/svg/SVGRootInlineBox.cpp:
3070         * rendering/svg/SVGRootInlineBox.h:
3071
3072 2017-12-08  Chris Dumez  <cdumez@apple.com>
3073
3074         Clearing all Website Data should remove service worker registrations on disk
3075         https://bugs.webkit.org/show_bug.cgi?id=180558
3076
3077         Reviewed by Youenn Fablet.
3078
3079         Clear service worker registrations on disk in addition to the ones in memory.
3080
3081         * workers/service/server/RegistrationDatabase.cpp:
3082         (WebCore::v1RecordsTableSchema):
3083         (WebCore::v1RecordsTableSchemaAlternate):
3084         (WebCore::databaseFilename):
3085         Make sure these always get called from the background thread since they use
3086         a static string.
3087
3088         (WebCore::RegistrationDatabase::RegistrationDatabase):
3089         Call importRecordsIfNecessary() instead of openSQLiteDatabase(). importRecordsIfNecessary()
3090         only calls openSQLiteDatabase() if the database file exists, to avoid creating a database
3091         file unnecessarily.
3092
3093         (WebCore::RegistrationDatabase::databasePath const):
3094         New method which returns the database file path.
3095
3096         (WebCore::RegistrationDatabase::openSQLiteDatabase):
3097
3098         (WebCore::RegistrationDatabase::importRecordsIfNecessary):
3099         New methods which imports records if the database file exist. It the database file does
3100         not exist, it does not create it.
3101
3102         (WebCore::RegistrationDatabase::pushChanges):
3103         Call completion handler when changes are pushed.
3104
3105         (WebCore::RegistrationDatabase::clearAll):
3106         Close the database if it is open, then remove the database files.
3107
3108         (WebCore::RegistrationDatabase::doPushChanges):
3109         If the database is not already open, we now open it when trying to write changes for
3110         the first time.
3111
3112         * workers/service/server/RegistrationDatabase.h:
3113         * workers/service/server/RegistrationStore.cpp:
3114         (WebCore::RegistrationStore::clearAll):
3115         (WebCore::RegistrationStore::flushChanges):
3116         * workers/service/server/RegistrationStore.h:
3117
3118         * workers/service/server/SWServer.cpp:
3119         (WebCore::SWServer::clearAll):
3120         (WebCore::SWServer::clear):
3121         Also clear the database.
3122
3123         * workers/service/server/SWServer.h:
3124
3125         * workers/service/server/SWServerWorker.cpp:
3126         (WebCore::SWServerWorker::terminate):
3127         Only call SWServer::terminateWorker() if the worker is running. Otherwise, we hit
3128         an assertion when clearing a registration would worker was already terminated.
3129
3130 2017-12-08  Joseph Pecoraro  <pecoraro@apple.com>
3131
3132         ServiceWorker Inspector: Various issues inspecting service worker on mobile.twitter.com
3133         https://bugs.webkit.org/show_bug.cgi?id=180520
3134         <rdar://problem/35900764>
3135
3136         Reviewed by Brian Burg.
3137
3138         * inspector/agents/worker/ServiceWorkerAgent.cpp:
3139         (WebCore::ServiceWorkerAgent::getInitializationInfo):
3140         * inspector/agents/worker/ServiceWorkerAgent.h:
3141         Add initial script content to initialization so we always at least have main resource content.
3142
3143 2017-12-08  Joseph Pecoraro  <pecoraro@apple.com>
3144
3145         ServiceWorker Inspector: Should be able to see image content from CacheStorage.add(url) network request
3146         https://bugs.webkit.org/show_bug.cgi?id=180506
3147
3148         Reviewed by Brian Burg.
3149
3150         No test as this only happens inside a ServiceWorker inspector which
3151         we don't yet have a way to test. In a Page Inspector, the
3152         CacheStorage.add network request already behaves as expected.
3153
3154         * inspector/NetworkResourcesData.cpp:
3155         (WebCore::NetworkResourcesData::responseReceived):
3156         (WebCore::shouldBufferResourceData):
3157         * inspector/NetworkResourcesData.h:
3158         (WebCore::NetworkResourcesData::ResourceData::forceBufferData const):
3159         (WebCore::NetworkResourcesData::ResourceData::setForceBufferData):
3160         Provide a way to force buffering in NetworkResourceData.
3161
3162         * inspector/agents/InspectorNetworkAgent.cpp:
3163         (WebCore::InspectorNetworkAgent::didReceiveResponse):
3164         * inspector/agents/InspectorNetworkAgent.h:
3165         * inspector/agents/page/PageNetworkAgent.h:
3166         * inspector/agents/worker/WorkerNetworkAgent.h:
3167         Enable force buffering in a Worker Network Agent.
3168
3169 2017-12-08  Daniel Bates  <dabates@apple.com>
3170
3171         Remove unnecessary prefix from AutoFillButtonType enumerators
3172         https://bugs.webkit.org/show_bug.cgi?id=180512
3173
3174         Reviewed by Tim Horton.
3175
3176         * testing/Internals.cpp:
3177         (WebCore::toAutoFillButtonType):
3178         * testing/Internals.h:
3179         * testing/Internals.idl:
3180
3181 2017-12-08  Dean Jackson  <dino@apple.com>
3182
3183         Implement transferToImageBitmap for WebGL offscreen canvas objects
3184         https://bugs.webkit.org/show_bug.cgi?id=180603
3185         <rdar://problem/34147143>
3186
3187         Reviewed by Sam Weinig.
3188
3189         Implement the basic version of creating an ImageBitmap from an
3190         OffscreenCanvas that is using a WebGL context.
3191
3192         Tests: http/wpt/offscreen-canvas/transferToImageBitmap-empty.html
3193                http/wpt/offscreen-canvas/transferToImageBitmap-webgl.html
3194
3195         * html/ImageBitmap.cpp:
3196         (WebCore::ImageBitmap::create): Add a new constructor to be used by OffscreenCanvas.
3197         Creates a blank ImageBitmap.
3198         * html/ImageBitmap.h:
3199
3200         * html/OffscreenCanvas.cpp:
3201         (WebCore::OffscreenCanvas::transferToImageBitmap): Create a new ImageBitmap
3202         and paint the current canvas into it.
3203
3204 2017-12-08  Youenn Fablet  <youenn@apple.com>
3205
3206         WebServiceWorkerProvider should use Cancellation error to notify DTL that it cannot handle a fetch
3207         https://bugs.webkit.org/show_bug.cgi?id=180584
3208
3209         Reviewed by Alex Christensen.
3210
3211         Previously, for each cross origin fetch that is going through a service worker and service worker is not handling the fetch,
3212         we return an AccessControl error so that DocumentThreadableLoader will do preflight and regular load through the network.
3213         This error is wrongly logged in the Inspector.
3214         Change error type to Cancellation so that the Inspector does not log it.
3215
3216         * loader/DocumentThreadableLoader.cpp:
3217         (WebCore::DocumentThreadableLoader::didFail):
3218
3219 2017-12-08  Youenn Fablet  <youenn@apple.com>
3220
3221         Service Worker should use a correct SessionID
3222         https://bugs.webkit.org/show_bug.cgi?id=180585
3223
3224         Reviewed by Alex Christensen.
3225
3226         Test: http/tests/workers/service/serviceworker-private-browsing.https.html
3227
3228         Store SessionID in SWServer and send it as part of service worker instantiation.
3229
3230         * workers/service/server/SWServer.cpp:
3231         (WebCore::SWServer::SWServer):
3232         (WebCore::SWServer::installContextData):
3233         (WebCore::SWServer::runServiceWorker):
3234         * workers/service/server/SWServer.h:
3235         * workers/service/server/SWServerToContextConnection.h:
3236
3237 2017-12-08  Youenn Fablet  <youenn@apple.com>
3238
3239         FetchResponse should keep unfiltered ResourceResponse so that it can be used in Service Worker
3240         https://bugs.webkit.org/show_bug.cgi?id=179641
3241         <rdar://problem/35923570>
3242
3243         Reviewed by Alex Christensen.
3244
3245         Covered by existing rebased tests.
3246
3247         FetchResponse will now store an unfiltered response.
3248         If it needs to expose it to JavaScript, it will create a filtered response lazily.
3249         This allows service worker to send back to web pages, opaque responses containing every information.
3250
3251         Updating Document::initSecurityContext so that any document loaded with a response whose tainting is Opaque gets a unique origin.
3252         This ensures cross-origin checks to work if service worker returns such a response on a same origin URL.
3253
3254         Updated SubresourceLoader to check cross origin service worker responses based on their tainting.
3255
3256         * Modules/fetch/FetchResponse.cpp:
3257         (WebCore::FetchResponse::create):
3258         (WebCore::FetchResponse::error):
3259         (WebCore::FetchResponse::redirect):
3260         (WebCore::FetchResponse::FetchResponse):
3261         (WebCore::FetchResponse::clone):
3262         (WebCore::FetchResponse::url const):
3263         (WebCore::FetchResponse::filteredResponse const):
3264         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
3265         (WebCore::FetchResponse::resourceResponse const):
3266         * Modules/fetch/FetchResponse.h:
3267         (WebCore::FetchResponse::create): Deleted.
3268         * dom/Document.cpp:
3269         (WebCore::Document::initSecurityContext):
3270         * loader/SubresourceLoader.cpp:
3271         (WebCore::SubresourceLoader::willSendRequestInternal):
3272         (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
3273
3274 2017-12-08  David Quesada  <david_quesada@apple.com>
3275
3276         ApplicationManifestParser should strip whitespace from the raw input
3277         https://bugs.webkit.org/show_bug.cgi?id=180539
3278         rdar://problem/35915075
3279
3280         Reviewed by Joseph Pecoraro.
3281
3282         * Modules/applicationmanifest/ApplicationManifestParser.cpp:
3283         (WebCore::ApplicationManifestParser::parseManifest):
3284
3285 2017-12-08  Eric Carlson  <eric.carlson@apple.com>
3286
3287         Move Logger from PAL to WTF so it can be used outside of WebCore
3288         https://bugs.webkit.org/show_bug.cgi?id=180561
3289
3290         Reviewed by Alex Christensen.
3291
3292         No new tests, existing API test updated.
3293
3294         * Modules/mediastream/PeerConnectionBackend.h:
3295         * Modules/mediastream/RTCPeerConnection.h:
3296         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3297         (PAL::LogArgument<webrtc::RTCStats>::toString): Deleted.
3298         * dom/Document.cpp:
3299         * dom/Document.h:
3300         * html/HTMLMediaElement.cpp:
3301         (PAL::LogArgument<WebCore::URL>::toString): Deleted.
3302         * html/HTMLMediaElement.h:
3303         * html/HTMLMediaElementEnums.h:
3304         (PAL::LogArgument<WebCore::HTMLMediaElementEnums::ReadyState>::toString): Deleted.
3305         (PAL::LogArgument<WebCore::HTMLMediaElementEnums::NetworkState>::toString): Deleted.
3306         * html/MediaElementSession.cpp:
3307         (WebCore::MediaElementSession::logger const):
3308         * html/MediaElementSession.h:
3309         * html/track/DataCue.h:
3310         (PAL::LogArgument<WebCore::DataCue>::toString): Deleted.
3311         * html/track/TextTrackCue.h:
3312         (PAL::LogArgument<WebCore::TextTrackCue>::toString): Deleted.
3313         * html/track/TextTrackCueGeneric.h:
3314         (PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString): Deleted.
3315         * html/track/TrackBase.cpp:
3316         (WebCore::nullLogger):
3317         (WebCore::TrackBase::TrackBase):
3318         * html/track/TrackBase.h:
3319         * html/track/VTTCue.h:
3320         (PAL::LogArgument<WebCore::VTTCue>::toString): Deleted.
3321         * platform/graphics/InbandTextTrackPrivate.h:
3322         * platform/graphics/InbandTextTrackPrivateClient.h:
3323         (PAL::LogArgument<WebCore::GenericCueData>::toString): Deleted.
3324         * platform/graphics/MediaPlayer.cpp:
3325         (WebCore::nullLogger):
3326         (WebCore::MediaPlayer::mediaPlayerLogger):
3327         * platform/graphics/MediaPlayer.h:
3328         (WTF::LogArgument<MediaTime>::toString):
3329         (PAL::LogArgument<WTF::MediaTime>::toString): Deleted.
3330         * platform/graphics/MediaPlayerEnums.h:
3331         (PAL::LogArgument<WebCore::MediaPlayerEnums::ReadyState>::toString): Deleted.
3332         (PAL::LogArgument<WebCore::MediaPlayerEnums::NetworkState>::toString): Deleted.
3333         * platform/graphics/TrackPrivateBase.cpp:
3334         (WebCore::TrackPrivateBase::setLogger):
3335         * platform/graphics/TrackPrivateBase.h:
3336         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3337         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3338         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3339         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3340         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3341         * platform/mediastream/RTCIceConnectionState.h:
3342         (PAL::LogArgument<WebCore::RTCIceConnectionState>::toString): Deleted.
3343         * platform/mediastream/RTCIceGatheringState.h:
3344         (PAL::LogArgument<WebCore::RTCIceGatheringState>::toString): Deleted.
3345         * platform/mediastream/RTCPeerConnectionState.h:
3346         (PAL::LogArgument<WebCore::RTCPeerConnectionState>::toString): Deleted.
3347         * platform/mediastream/RTCSignalingState.h:
3348         (PAL::LogArgument<WebCore::RTCSignalingState>::toString): Deleted.
3349         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3350
3351 2017-12-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3352
3353         Remove pthread_once in favor of dispatch_once
3354         https://bugs.webkit.org/show_bug.cgi?id=180591
3355
3356         Reviewed by Saam Barati.
3357
3358         No behavior change.
3359
3360         * platform/mac/WebCoreNSURLExtras.mm:
3361         (WebCore::allCharactersInIDNScriptWhiteList):
3362         (WebCore::readIDNScriptWhiteList): Deleted.
3363
3364 2017-12-08  Chris Dumez  <cdumez@apple.com>
3365
3366         Improve error handling in RegistrationDatabase
3367         https://bugs.webkit.org/show_bug.cgi?id=180587
3368
3369         Reviewed by Brady Eidson.
3370
3371         * workers/service/server/RegistrationDatabase.cpp:
3372         (WebCore::RegistrationDatabase::openSQLiteDatabase):
3373         (WebCore::RegistrationDatabase::doPushChanges):
3374
3375 2017-12-07  Darin Adler  <darin@apple.com>
3376
3377         Simplify and streamline some Color-related code to prepare for some Color/ExtendedColor work
3378         https://bugs.webkit.org/show_bug.cgi?id=180569
3379
3380         Reviewed by Sam Weinig.
3381
3382         * accessibility/AccessibilityNodeObject.cpp:
3383         (WebCore::AccessibilityNodeObject::colorValue const): Use valueAsColor instead of
3384         having custom code here to parse the color string.
3385
3386         * css/CSSGradientValue.cpp:
3387         (WebCore::interpolate): Deleted.
3388         (WebCore::CSSGradientValue::computeStops): Call blend instead of interpolate. The only
3389         difference is that the interpolate function truncated when converting from floating point
3390         to integer, and the blend function rounds instead.
3391
3392         * css/StyleResolver.cpp:
3393         (WebCore::StyleResolver::colorFromPrimitiveValue const): Removed unneeded special case
3394         for identifier of 0, since StyleColor::colorFromKeyword already handles that correctly.
3395         Also got rid of unneded local variable "state".
3396
3397         * html/ColorInputType.cpp:
3398         (WebCore::isValidSimpleColor): Rewrote to take a StringView instead of a String and
3399         to stay with a single loop since this does not need the extra efficiency of a separate
3400         8-bit and 16-bit character version. Renamed to more closely match what the specification
3401         calls this algorithm.
3402         (WebCore::parseSimpleColorValue): Added. To be used instead of relying on the behavior of
3403         the Color constructor that takes a String, so we can remove that later.
3404         (WebCore::ColorInputType::sanitizeValue const): Updated for name change.
3405         (WebCore::ColorInputType::valueAsColor const): Use parseSimpleColorValue instead of the
3406         Color constructor that takes a string.
3407         (WebCore::ColorInputType::typeMismatchFor const): Updated for name change.
3408         (WebCore::ColorInputType::selectColor): Updated to take a StringView instead of a Color.
3409         Note that this function is used for testing only.
3410
3411         * html/ColorInputType.h: Marked everything final instead of override. Updated the
3412         selectColor function to take a StringView instead of a Color.
3413
3414         * html/HTMLInputElement.cpp:
3415         (WebCore::HTMLInputElement::selectColor): Take a StringView instead of a Color.
3416         * html/HTMLInputElement.h: Ditto.
3417
3418         * html/InputType.cpp:
3419         (WebCore::InputType::selectColor): Take a StringView instead of a Color.
3420         * html/InputType.h: Ditto.
3421
3422         * testing/Internals.cpp:
3423         (WebCore::Internals::selectColorInColorChooser): Pass the string directly instead of
3424         constructing a Color with it.
3425         (WebCore::Internals::setViewBaseBackgroundColor): Instead of pasring the passed in string
3426         with the Color constructor, implemented the two names that are actually used with this
3427         function in tests: "transparent" and "white".
3428
3429 2017-12-08  Konstantin Tokarev  <annulen@yandex.ru>
3430
3431         Unreviewed, fix wrong letter case in #import HTMLIframeElement.h
3432
3433         * editing/cocoa/WebContentReaderCocoa.mm:
3434