1 2017-12-17 John Wilander <wilander@apple.com>
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>
7 Reviewed by Alex Christensen.
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
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.
17 (WebCore::Document::hasStorageAccess):
18 * page/ChromeClient.h:
20 2017-12-17 Chris Dumez <cdumez@apple.com>
22 Strip fragment identifier from ServiceWorker's scriptURL
23 https://bugs.webkit.org/show_bug.cgi?id=180887
25 Reviewed by Darin Adler.
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
31 No new tests, rebaselined existing test.
33 * workers/service/server/SWServerWorker.cpp:
36 2017-12-17 Antti Koivisto <antti@apple.com>
38 Move render tree updating related files under rendering/updating/
39 https://bugs.webkit.org/show_bug.cgi?id=180918
41 Reviewed by Darin Adler.
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.
76 2017-12-17 Yusuke Suzuki <utatane.tea@gmail.com>
78 [JSC][WebCore][CSSJIT] Remove VM reference in CSSJIT
79 https://bugs.webkit.org/show_bug.cgi?id=180917
81 Reviewed by Sam Weinig.
83 Remove VM reference in CSSJIT. CSSJIT should not be
84 bound to a specific VM.
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:
98 2017-12-16 Dan Bernstein <mitz@apple.com>
100 WKWebView has no equivalent of -[WebView setAlwaysShowVerticalScroller:]
101 https://bugs.webkit.org/show_bug.cgi?id=180613
102 <rdar://problem/35946124>
104 Reviewed by Geoff Garen.
106 Test: TestWebKitAPI/Tests/WebKitCocoa/WKWebViewAlwaysShowsScroller.mm
108 * platform/ScrollView.h: Exported setScrollbarModes.
110 2017-12-16 Antti Koivisto <antti@apple.com>
112 Introduce RenderTreeBuilder
113 https://bugs.webkit.org/show_bug.cgi?id=180817
115 Reviewed by Zalan Bujtas.
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.
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.
123 It also moves one addChild implementation (RenderRuby::addChild -> RenderTreeBuilder::rubyRunInsertChild)
124 to RenderTreeBuilder as a test.
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):
243 2017-12-16 Romain Bellessort <romain.bellessort@crf.canon.fr>
245 [Readable Streams API] Fix filling of descriptor from queue
246 https://bugs.webkit.org/show_bug.cgi?id=172717
248 Reviewed by Youenn Fablet.
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
254 [1] https://streams.spec.whatwg.org/#readable-byte-stream-controller-fill-pull-into-descriptor-from-queue
256 No new tests (covered by WPT tests, whose expectations have been updated).
258 * Modules/streams/ReadableByteStreamInternals.js:
259 (readableByteStreamControllerFillDescriptorFromQueue): Updated.
261 2017-12-16 Brady Eidson <beidson@apple.com>
263 Implement getting ServiceWorker registrations for the WKWebsiteDataStore API
264 https://bugs.webkit.org/show_bug.cgi?id=180886
266 Reviewed by Chris Dumez.
268 No new tests (API test coming soon).
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:
277 2017-12-16 Yusuke Suzuki <utatane.tea@gmail.com>
279 Remove unnecessary boolean result of start() functions
280 https://bugs.webkit.org/show_bug.cgi?id=180856
282 Reviewed by Darin Adler.
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
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:
306 2017-12-16 Chris Dumez <cdumez@apple.com>
308 Add optimization when updating a SW registration results in the exact same script
309 https://bugs.webkit.org/show_bug.cgi?id=180891
311 Reviewed by Geoffrey Garen.
313 Add optimization when updating a SW registration results in the exact same script:
314 - https://w3c.github.io/ServiceWorker/#update-algorithm (step 8)
316 No new tests, rebaselined existing test.
318 * workers/service/server/SWServerJobQueue.cpp:
319 (WebCore::SWServerJobQueue::scriptFetchFinished):
321 2017-12-16 Youenn Fablet <youenn@apple.com>
323 Service worker script fetch request should set the Service-Worker header
324 https://bugs.webkit.org/show_bug.cgi?id=180889
326 Reviewed by Chris Dumez.
328 Test: http/wpt/service-workers/check-service-worker-header.https.html
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.
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):
341 2017-12-15 Ryan Haddad <ryanhaddad@apple.com>
343 Unreviewed, rolling out r225969.
345 This change introduced LayoutTest crashes.
349 "Introduce RenderTreeBuilder"
350 https://bugs.webkit.org/show_bug.cgi?id=180817
351 https://trac.webkit.org/changeset/225969
353 2017-12-15 Chris Dumez <cdumez@apple.com>
355 Support updating a service worker registration's updateViaCache flag
356 https://bugs.webkit.org/show_bug.cgi?id=180888
358 Reviewed by Brady Eidson.
360 Support updating a service worker registration's updateViaCache flag to match other browsers:
361 - https://github.com/w3c/ServiceWorker/issues/1189
363 No new tests, rebaselined existing test.
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:
378 2017-12-15 Ryan Haddad <ryanhaddad@apple.com>
380 Unreviewed, rolling out r225941.
382 This change introduced LayoutTest crashes and assertion
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
392 2017-12-15 Ryosuke Niwa <rniwa@webkit.org>
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>
398 Reviewed by David Kilzer.
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.
403 * platform/Timer.cpp:
404 (WebCore::TimerBase::~TimerBase):
405 (WebCore::TimerBase::setNextFireTime):
408 2017-12-15 Simon Fraser <simon.fraser@apple.com>
410 Elements animated on-screen are missing sometimes
411 https://bugs.webkit.org/show_bug.cgi?id=180773
412 rdar://problem/34923438
414 Reviewed by Zalan Bujtas.
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.
420 Fix by making sure that GraphicsLayer's "animatedExtent" took composited child layers into account.
422 As for r225310, no test because this is timing sensitive and hard to reliably make a test for.
424 * rendering/RenderLayer.cpp:
425 (WebCore::RenderLayer::calculateClipRects const):
426 * rendering/RenderLayer.h:
427 * rendering/RenderLayerBacking.cpp:
428 (WebCore::RenderLayerBacking::updateGeometry):
430 2017-12-15 Chris Dumez <cdumez@apple.com>
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
435 Reviewed by Brady Eidson.
437 Fix assertion to make sure the worker is terminating if it is already in m_runningOrTerminatingWorkers.
439 * workers/service/server/SWServer.cpp:
440 (WebCore::SWServer::runServiceWorker):
442 2017-12-15 Chris Dumez <cdumez@apple.com>
444 Service Worker Registration promise is sometimes not rejected when the script load fails
445 https://bugs.webkit.org/show_bug.cgi?id=180849
447 Reviewed by Brady Eidson.
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.
453 No new tests, rebaselined exisiting tests.
455 * workers/WorkerScriptLoader.cpp:
456 (WebCore::WorkerScriptLoader::notifyError):
457 * workers/service/ServiceWorkerJob.cpp:
458 (WebCore::ServiceWorkerJob::notifyFinished):
460 2017-12-15 Youenn Fablet <youenn@apple.com>
462 WebRTC Stats should not be console logged from a background thread
463 https://bugs.webkit.org/show_bug.cgi?id=180845
465 Reviewed by Eric Carlson.
467 Ensuring console log are done in the main thread.
469 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
470 (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
472 2017-12-15 Antti Koivisto <antti@apple.com>
474 Introduce RenderTreeBuilder
475 https://bugs.webkit.org/show_bug.cgi?id=180817
477 Reviewed by Zalan Bujtas.
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.
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.
485 It also moves one addChild implementation (RenderRuby::addChild -> RenderTreeBuilder::rubyRunInsertChild)
486 to RenderTreeBuilder as a test.
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):
605 2017-12-14 Youenn Fablet <youenn@apple.com>
607 Implement <iframe allow="camera; microphone">
608 https://bugs.webkit.org/show_bug.cgi?id=167430
610 Reviewed by Eric Carlson.
612 Tests: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.sub.html
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.
620 * Modules/mediastream/UserMediaRequest.cpp:
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:
631 2017-12-14 Zalan Bujtas <zalan@apple.com>
633 Inconsistent section grid could lead to CrashOnOverflow
634 https://bugs.webkit.org/show_bug.cgi?id=180850
635 <rdar://problem/34064811>
637 Reviewed by Simon Fraser.
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).
644 Test: fast/table/table-row-oveflow-crash.html
646 * rendering/RenderTable.cpp:
647 (WebCore::RenderTable::recalcSections const):
648 * rendering/RenderTableSection.cpp:
649 (WebCore::RenderTableSection::removeRedundantColumns):
650 * rendering/RenderTableSection.h:
652 2017-12-14 David Kilzer <ddkilzer@apple.com>
654 Enable -Wstrict-prototypes for WebKit
655 <https://webkit.org/b/180757>
656 <rdar://problem/36024132>
658 Rubber-stamped by Joseph Pecoraro.
660 * Configurations/Base.xcconfig:
661 (CLANG_WARN_STRICT_PROTOTYPES): Add. Set to YES.
663 2017-12-14 Youenn Fablet <youenn@apple.com>
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
670 Manually tested since there is no way to gather reflexive or stun candidates in WebKit CI.
672 * Modules/mediastream/PeerConnectionBackend.cpp:
673 (WebCore::filterICECandidate):
675 2017-12-14 Commit Queue <commit-queue@webkit.org>
677 Unreviewed, rolling out r225878.
678 https://bugs.webkit.org/show_bug.cgi?id=180855
680 Introduced a crash in HTMLPictureElement. We're taking a
681 different approach for webkit.org/b/180769 (Requested by rniwa
686 "Crash inside ImageLoader::updateFromElement()"
687 https://bugs.webkit.org/show_bug.cgi?id=180769
688 https://trac.webkit.org/changeset/225878
690 2017-12-14 Ryan Haddad <ryanhaddad@apple.com>
692 Unreviewed, rolling out r225931.
694 Breaks internal builds.
698 "Fix Mac CMake build"
699 https://bugs.webkit.org/show_bug.cgi?id=180835
700 https://trac.webkit.org/changeset/225931
702 2017-12-14 Simon Fraser <simon.fraser@apple.com>
704 Another Windows build fix.
706 * platform/graphics/cg/GraphicsContextCG.cpp:
707 (WebCore::extendedSRGBColorSpaceRef):
709 2017-12-14 Simon Fraser <simon.fraser@apple.com>
711 Fix Windows build after r225915.
713 Windows doens't have dispatch_once with blocks. Switch to use lambda functions instead.
715 * platform/graphics/cg/GraphicsContextCG.cpp:
716 (WebCore::sRGBColorSpaceRef):
717 (WebCore::linearRGBColorSpaceRef):
718 (WebCore::extendedSRGBColorSpaceRef):
719 (WebCore::displayP3ColorSpaceRef):
721 2017-12-14 Devin Rousso <webkit@devinrousso.com>
723 Web Inspector: replace HTMLCanvasElement with CanvasRenderingContext for instrumentation logic
724 https://bugs.webkit.org/show_bug.cgi?id=180770
726 Reviewed by Joseph Pecoraro.
728 No change in functionality.
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.
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.
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):
775 * inspector/InspectorShaderProgram.h:
776 * inspector/InspectorShaderProgram.cpp:
777 (WebCore::InspectorShaderProgram::context const):
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.
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.
834 * page/PageConsoleClient.cpp:
835 (WebCore::PageConsoleClient::record):
836 (WebCore::PageConsoleClient::recordEnd):
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.
846 2017-12-14 Chris Dumez <cdumez@apple.com>
848 self.importScripts() should obey updateViaCache inside service workers
849 https://bugs.webkit.org/show_bug.cgi?id=180826
851 Reviewed by Youenn Fablet.
853 self.importScripts() should obey updateViaCache inside service workers, as per:
854 - https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts
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
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:
877 2017-12-14 Yusuke Suzuki <utatane.tea@gmail.com>
879 Drop Thread::tryCreate
880 https://bugs.webkit.org/show_bug.cgi?id=180808
882 Reviewed by Darin Adler.
884 This change reveals that nobody cares the WorkerThread::start's failure.
885 We should use `Thread::create` to ensure thread is actually starting.
887 * workers/WorkerThread.cpp:
888 (WebCore::WorkerThread::start):
889 * workers/WorkerThread.h:
891 2017-12-14 Alicia Boya GarcÃa <aboya@igalia.com>
893 [MSE] Add isValid() check before using trackBuffer.lastEnqueuedPresentationTime
894 https://bugs.webkit.org/show_bug.cgi?id=180258
896 Reviewed by Jer Noble.
898 * Modules/mediasource/SourceBuffer.cpp:
899 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
901 2017-12-14 John Wilander <wilander@apple.com>
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>
907 Reviewed by Alex Christensen.
909 No new tests. Changed expected result from existing test.
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.
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.
922 (WebCore::Document::requestStorageAccess):
923 * loader/CookieJar.cpp:
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):
963 2017-12-14 Alex Christensen <achristensen@webkit.org>
966 https://bugs.webkit.org/show_bug.cgi?id=180835
968 Reviewed by Andy Estes.
971 * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
973 2017-12-14 Antoine Quint <graouts@apple.com>
975 [Web Animations] Use is<> when possible
976 https://bugs.webkit.org/show_bug.cgi?id=180832
978 Reviewed by Dean Jackson.
980 Adopt is<> when possible.
982 * animation/WebAnimation.cpp:
983 (WebCore::WebAnimation::setEffect):
984 (WebCore::WebAnimation::setTimeline):
985 (WebCore::WebAnimation::startOrStopAccelerated):
987 2017-12-14 Antoine Quint <graouts@apple.com>
989 [Web Animations] Bring timeline and currentTime setters closer to compliance
990 https://bugs.webkit.org/show_bug.cgi?id=180834
992 Reviewed by Dean Jackson.
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.
998 Web Platform Tests cover these behaviors, but we're currently failing those tests
999 due to lacking an implementation for Element.animate().
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
1014 2017-12-14 Antoine Quint <graouts@apple.com>
1016 [Web Animations] Implement the cancel() method on Animation
1017 https://bugs.webkit.org/show_bug.cgi?id=180830
1018 <rdar://problem/36055816>
1020 Reviewed by Dean Jackson.
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.
1027 * animation/WebAnimation.cpp:
1028 (WebCore::WebAnimation::setEffect):
1029 (WebCore::WebAnimation::cancel):
1030 (WebCore::WebAnimation::resetPendingTasks):
1031 * animation/WebAnimation.h:
1032 * animation/WebAnimation.idl:
1034 2017-12-14 Jer Noble <jer.noble@apple.com>
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>
1040 Reviewed by Eric Carlson.
1042 Explicitly set the NSVisualAffectView's .appearance property.
1044 * platform/mac/WebCoreFullScreenPlaceholderView.mm:
1045 (-[WebCoreFullScreenPlaceholderView initWithFrame:]):
1047 2017-12-14 Antoine Quint <graouts@apple.com>
1049 [Web Animations] Implement the finish() method on Animation
1050 https://bugs.webkit.org/show_bug.cgi?id=180822
1051 <rdar://problem/36053282>
1053 Reviewed by Dean Jackson.
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.
1060 * animation/WebAnimation.cpp:
1061 (WebCore::WebAnimation::silentlySetCurrentTime):
1062 (WebCore::WebAnimation::setCurrentTime):
1063 (WebCore::WebAnimation::finish):
1064 * animation/WebAnimation.h:
1065 * animation/WebAnimation.idl:
1067 2017-12-14 Chris Dumez <cdumez@apple.com>
1069 Service worker script fetching currently always uses the network cache
1070 https://bugs.webkit.org/show_bug.cgi?id=180816
1072 Reviewed by Alex Christensen.
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)
1077 Tests: http/tests/workers/service/registration-updateViaCache-all.html
1078 http/tests/workers/service/registration-updateViaCache-none.html
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):
1104 2017-12-14 Simon Fraser <simon.fraser@apple.com>
1106 Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace
1107 https://bugs.webkit.org/show_bug.cgi?id=180689
1109 Reviewed by Darin Adler.
1111 Address issues noted by Darin in r225797:
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.
1117 Fix a case where the extendedSRGBColorSpaceRef() fallback was returning deviceRGB
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):
1128 2017-12-13 Keith Miller <keith_miller@apple.com>
1130 JSObjects should have a mask for loading indexed properties
1131 https://bugs.webkit.org/show_bug.cgi?id=180768
1133 Reviewed by Mark Lam.
1135 * bindings/js/JSDOMConvertSequences.h:
1136 (WebCore::Detail::NumericSequenceConverter::convertArray):
1137 (WebCore::Detail::SequenceConverter::convertArray):
1139 2017-12-13 Antoine Quint <graouts@apple.com>
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>
1145 Reviewed by Eric Carlson.
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.
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.
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:
1167 2017-12-14 Frederic Wang <fwang@igalia.com>
1169 Make GraphicsLayer::dumpProperties dump m_offsetFromRenderer
1170 https://bugs.webkit.org/show_bug.cgi?id=180473
1172 Reviewed by Antonio Gomes.
1174 No new tests, this is just a new debug info.
1176 * platform/graphics/GraphicsLayer.cpp:
1177 (WebCore::GraphicsLayer::dumpProperties const): Dump the offset from renderer if nonzero.
1179 2017-12-12 Yusuke Suzuki <utatane.tea@gmail.com>
1181 REGRESSION(r225769): Build errors with constexpr std::tie on older gcc
1182 https://bugs.webkit.org/show_bug.cgi?id=180692
1184 Reviewed by Carlos Garcia Campos.
1186 * platform/graphics/FontSelectionAlgorithm.h:
1187 (WebCore::FontSelectionRange::operator== const):
1188 (WebCore::FontSelectionRequest::tied const):
1189 (WebCore::FontSelectionCapabilities::tied const):
1190 (WebCore::FontSelectionSpecifiedCapabilities:: const):
1192 2017-12-13 Daniel Bates <dabates@apple.com>
1194 Fix the Windows build after <https://trac.webkit.org/changeset/225879>
1195 (https://bugs.webkit.org/show_bug.cgi?id=180651)
1197 * html/TextFieldInputType.cpp:
1198 (WebCore::autoFillButtonTypeToAccessibilityLabel):
1199 (WebCore::autoFillButtonTypeToAutoFillButtonText):
1200 (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
1202 2017-12-13 Devin Rousso <webkit@devinrousso.com>
1204 Web Inspector: add instrumentation for ImageBitmapRenderingContext
1205 https://bugs.webkit.org/show_bug.cgi?id=180736
1207 Reviewed by Joseph Pecoraro.
1209 Tests: inspector/canvas/create-context-bitmaprenderer.html
1210 inspector/canvas/requestContent-bitmaprenderer.html
1211 inspector/canvas/resolveCanvasContext-bitmaprenderer.html
1215 * WebCore.xcodeproj/project.pbxproj:
1217 * html/HTMLCanvasElement.cpp:
1218 (WebCore::HTMLCanvasElement::getContext):
1219 (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
1220 Support passing an optional settings dictionary when creating an ImageBitmapRenderingContext.
1222 * inspector/agents/InspectorCanvasAgent.cpp:
1223 (WebCore::InspectorCanvasAgent::requestContent):
1224 (WebCore::contextAsScriptValue):
1226 * bindings/js/CallTracerTypes.h:
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.
1235 2017-12-13 Daniel Bates <dabates@apple.com>
1237 Add more auto fill button types
1238 https://bugs.webkit.org/show_bug.cgi?id=180651
1239 <rdar://problem/35891125>
1241 <rdar://problem/35977943>
1243 Reviewed by Brent Fulgham.
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
1252 * English.lproj/Localizable.strings:
1253 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1254 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Add strings for new auto fill button types.
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:
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.
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.
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.
1285 * html/HTMLInputElement.h:
1286 (WebCore::HTMLInputElement::autoFillButtonType const): Fix style nit; use a C++ style cast while I am in
1288 (WebCore::HTMLInputElement::hasAutoFillStrongPasswordButton const): Added.
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.
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.
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.
1313 * platform/LocalizedStrings.cpp:
1314 (WebCore::AXAutoFillStrongPasswordLabel):
1315 (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
1316 (WebCore::autoFillStrongPasswordLabel):
1317 * platform/LocalizedStrings.h:
1318 Add localized strings.
1320 * rendering/RenderTextControlSingleLine.h: Disallow scrolling depending on the auto fill button type.
1322 * testing/Internals.cpp:
1323 (WebCore::toAutoFillButtonType):
1324 * testing/Internals.h:
1325 * testing/Internals.idl:
1326 Add support for testing.
1328 2017-12-13 Ryosuke Niwa <rniwa@webkit.org>
1330 Crash inside ImageLoader::updateFromElement()
1331 https://bugs.webkit.org/show_bug.cgi?id=180769
1332 <rdar://problem/35278782>
1334 Reviewed by Antti Koivisto.
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.
1339 No new test since existing tests cover this with a newly added release assert in ImageLoader.
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.
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:
1381 2017-12-13 Zalan Bujtas <zalan@apple.com>
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>
1387 Reviewed by Simon Fraser.
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
1393 This patch also makes RenderImageResource's m_renderer a weak pointer.
1395 Test: fast/images/crash-when-image-renderer-is-destroyed-before-calling-initializeStyle.html
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):
1409 2017-12-13 Ryosuke Niwa <rniwa@webkit.org>
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>
1415 Reviewed by Antti Koivisto.
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.
1423 No new tests. Covered by existing tests.
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.
1431 (WebCore::Document::svgUseElements const): Added.
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:
1456 2017-12-13 Per Arne Vollan <pvollan@apple.com>
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>
1462 Reviewed by Brent Fulgham.
1466 * platform/mac/EventLoopMac.mm:
1467 (WebCore::EventLoop::cycle):
1469 2017-12-13 Antoine Quint <graouts@apple.com>
1471 [Web Animations] Implement the "updating the finished state" procedure
1472 https://bugs.webkit.org/show_bug.cgi?id=180743
1473 <rdar://problem/36017232>
1475 Reviewed by Simon Fraser.
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.
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.
1485 * animation/DocumentTimeline.cpp:
1486 (WebCore::DocumentTimeline::updateAnimations): Update the finished state as the timeline time changes with both flags
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:
1503 2017-12-13 Simon Fraser <simon.fraser@apple.com>
1505 Fix crash under Document::visualUpdatesSuppressionTimerFired()
1506 https://bugs.webkit.org/show_bug.cgi?id=180758
1507 Document::visualUpdatesSuppressionTimerFired
1509 Reviewed by Zalan Bujtas.
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.
1515 (WebCore::Document::setVisualUpdatesAllowed):
1516 (WebCore::Document::visualUpdatesSuppressionTimerFired):
1518 2017-12-13 Zalan Bujtas <zalan@apple.com>
1520 ASSERT(LayoutDisallowedScope::isLayoutAllowed()) whenever hitting Enter in Web Inspector console
1521 https://bugs.webkit.org/show_bug.cgi?id=180690
1523 Reviewed by Simon Fraser.
1525 Defer text replacement notification until after layout is done to avoid unexpected forced layouts.
1527 Covered by existing tests.
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):
1544 2017-12-13 Ryan Haddad <ryanhaddad@apple.com>
1546 Unreviewed, rolling out r225836.
1548 Broke the Windows build.
1552 "Unify some WebGL sources"
1553 https://bugs.webkit.org/show_bug.cgi?id=180726
1554 https://trac.webkit.org/changeset/225836
1556 2017-12-13 Andy Estes <aestes@apple.com>
1558 [Payment Request] Remove ApplePayPaymentMethodUpdateEvent and use PaymentDetailsModifiers instead
1559 https://bugs.webkit.org/show_bug.cgi?id=180737
1560 <rdar://problem/36013152>
1562 Reviewed by Brady Eidson.
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.
1568 Test: http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html
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:
1594 * dom/EventNames.in:
1595 * testing/MockPaymentCoordinator.cpp:
1597 (WebCore::MockPaymentCoordinator::updateTotalAndLineItems):
1598 (WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
1599 (WebCore::MockPaymentCoordinator::completeShippingContactSelection):
1600 (WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
1601 * testing/MockPaymentCoordinator.h:
1602 * testing/MockPaymentCoordinator.idl:
1604 2017-12-12 Zalan Bujtas <zalan@apple.com>
1606 is<HTMLTextFormControlElement> reports the input type.
1607 https://bugs.webkit.org/show_bug.cgi?id=180721
1608 <rdar://problem/36005123>
1610 Reviewed by Ryosuke Niwa.
1612 This patch ensures that is<HTMLTextFormControlElement> consistently returns true even
1613 when the input type changes from text to non-text (checkbox etc).
1615 * accessibility/AccessibilityObject.cpp:
1616 (WebCore::AccessibilityObject::selectText):
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:
1651 * rendering/HitTestResult.cpp:
1652 (WebCore::HitTestResult::isOverTextInsideFormControlElement const):
1654 2017-12-12 Dean Jackson <dino@apple.com>
1656 Unify some WebGL sources
1657 https://bugs.webkit.org/show_bug.cgi?id=180726
1659 Rubber-stamped by Keith, weeks ago.
1662 * WebCore.xcodeproj/project.pbxproj:
1663 * html/canvas/WebGLRenderingContextBase.cpp:
1665 2017-12-12 Michael Catanzaro <mcatanzaro@igalia.com>
1667 Unreviewed, fix !ENABLE(MEDIA_STREAM) build after r225822
1668 https://bugs.webkit.org/show_bug.cgi?id=180666
1669 <rdar://problem/36008948>
1671 * html/HTMLMediaElement.cpp:
1673 2017-12-12 Alex Christensen <achristensen@webkit.org>
1675 Fix possible out-of-bounds read in protocolIsInHTTPFamily
1676 https://bugs.webkit.org/show_bug.cgi?id=180688
1678 Reviewed by Daniel Bates.
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.
1684 (WebCore::protocolIsInHTTPFamily):
1685 Check bounds before reading a string.
1687 2017-12-12 Youenn Fablet <youenn@apple.com>
1689 getUserMedia is resolving before the document knows it is capturing
1690 https://bugs.webkit.org/show_bug.cgi?id=180699
1692 Reviewed by Eric Carlson.
1694 Covered by updated test.
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.
1700 Introduce PendingActivationMediaStream for waiting for the MediaStream to produce data.
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:
1716 2017-12-12 John Wilander <wilander@apple.com>
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>
1722 Reviewed by Alex Christensen.
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
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.
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
1736 (WebCore::Document::requestStorageAccess):
1737 Now submits frameID and pageID in the request call and sets
1738 m_hasFrameSpecificStorageAccess upon granted access callback.
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.
1758 2017-12-12 Youenn Fablet <youenn@apple.com>
1760 Playing webrtc video tracks should prevent from display to got to sleep
1761 https://bugs.webkit.org/show_bug.cgi?id=180666
1763 Reviewed by Darin Adler.
1765 Done through manual testing by checking screen assertions taken on webrtc sites.
1767 * html/HTMLMediaElement.cpp:
1768 (WebCore::HTMLMediaElement::shouldDisableSleep const):
1770 2017-12-12 Dean Jackson <dino@apple.com>
1772 Add CanvasRenderingContext2DBase class and OffscreenCanvasRenderingContext2D
1773 https://bugs.webkit.org/show_bug.cgi?id=180718
1774 <rdar://problem/36004015>
1776 Reviewed by Sam Weinig.
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.
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.
1787 No change in functionality at the moment, so covered by the existing tests.
1789 * DerivedSources.make: Add the new IDL file.
1791 * Sources.txt: Add all the new files to compile.
1792 * WebCore.xcodeproj/project.pbxproj:
1794 * bindings/js/JSCanvasRenderingContext2DCustom.cpp: Removed some unnecessary headers, and
1795 added JSC:: where appropriate.
1796 (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
1797 (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
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):
1804 * bindings/js/JSWorkerNavigatorCustom.cpp: Add JSC:: to fix a compilation error.
1805 (WebCore::JSWorkerNavigator::visitAdditionalChildren):
1807 * bindings/js/WebCoreBuiltinNames.h: New IDL types.
1809 * html/OffscreenCanvas.idl: Explicitly generates an IsReachable.
1811 * html/canvas/CanvasRenderingContext.h:
1812 (WebCore::CanvasRenderingContext::isOffscreen2d const): Helper for is<> trait.
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.
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.
1825 2017-12-12 Jer Noble <jer.noble@apple.com>
1827 [EME] Support FPS-over-HLS in the Modern EME API
1828 https://bugs.webkit.org/show_bug.cgi?id=180707
1830 Reviewed by Eric Carlson.
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:
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.
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.
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):
1859 Add support for AVContentKeySession to MediaPlayerPrivateAVFoundationObjC, and for emitting
1860 initializationData messages when encountering a loading request for a "skd" URI.
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):
1869 2017-12-12 Antoine Quint <graouts@apple.com>
1871 [Web Animations] Expose promises on Animation interface
1872 https://bugs.webkit.org/show_bug.cgi?id=180710
1873 <rdar://problem/36000604>
1875 Reviewed by Dean Jackson.
1877 Expose the "ready" and "finished" promises on Animation. A future patch will fulfil or reject them.
1879 * animation/WebAnimation.cpp:
1880 (WebCore::WebAnimation::WebAnimation):
1881 (WebCore::WebAnimation::readyPromiseResolve):
1882 (WebCore::WebAnimation::finishedPromiseResolve):
1883 * animation/WebAnimation.h:
1884 * animation/WebAnimation.idl:
1886 2017-12-12 Youenn Fablet <youenn@apple.com>
1888 Fetch Event header filtering should apply in CORS mode only
1889 https://bugs.webkit.org/show_bug.cgi?id=180708
1891 Reviewed by Alex Christensen.
1893 Covered by no-longer failing test.
1895 * workers/service/context/ServiceWorkerFetch.cpp: cleaning headers only in case of CORS mode.
1897 2017-12-12 Myles C. Maxfield <mmaxfield@apple.com>
1899 REGRESSION (Safari 11): custom <font-face> tag crashes a page
1900 https://bugs.webkit.org/show_bug.cgi?id=177848
1902 Reviewed by Darin Adler.
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
1911 Test: svg/text/font-style-keyword.html
1913 * svg/SVGFontFaceElement.cpp:
1914 (WebCore::SVGFontFaceElement::parseAttribute):
1916 2017-12-12 Antoine Quint <graouts@apple.com>
1918 [Web Animations] Implement the playState property on Animation
1919 https://bugs.webkit.org/show_bug.cgi?id=180711
1920 <rdar://problem/36000982>
1922 Reviewed by Dean Jackson.
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.
1929 * animation/WebAnimation.cpp:
1930 (WebCore::WebAnimation::playState const):
1931 (WebCore::WebAnimation::effectEndTime const):
1932 * animation/WebAnimation.h:
1933 * animation/WebAnimation.idl:
1935 2017-12-12 Javier Fernandez <jfernandez@igalia.com>
1937 [css-grid] Implement alignment for absolute positioned grid items
1938 https://bugs.webkit.org/show_bug.cgi?id=180632
1940 Reviewed by Manuel Rego Casasnovas.
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.
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.
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'.
1956 It's worth mentioning that some of the test cases using vertical-rl
1957 writing mode will fail because of the bug 180633.
1959 Updated web-platform-tests results of the test cases that pass now.
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:
1994 2017-12-12 Jer Noble <jer.noble@apple.com>
1996 [EME] Support reporting and restoring persistent usage data.
1997 https://bugs.webkit.org/show_bug.cgi?id=180684
1999 Reviewed by Eric Carlson.
2001 Add support for reading and acknowledging persistent usage data from the MediaKeys storage
2004 Add a mechanism for passing the storage location down to CDMPrivate and CDMInstance objects
2005 inside of the CDM class itself:
2007 * Modules/encryptedmedia/CDM.cpp:
2008 (WebCore::CDM::createInstance):
2009 (WebCore::CDM::storageDirectory const):
2010 * Modules/encryptedmedia/CDM.h:
2012 Support loading expired session data, acknowledging expired session data, closing sessions
2013 and removing usable key data.
2015 * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2016 * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2018 (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
2019 (WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession):
2020 (WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession):
2021 (WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData):
2023 2017-12-12 Christopher Reid <chris.reid@sony.com>
2025 WebGL TextureMapperShaderProgram shaders don't compile in MSVC
2026 https://bugs.webkit.org/show_bug.cgi?id=180709
2028 Reviewed by Myles C. Maxfield.
2030 No new tests, no change in behavior.
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.
2036 Moved these #if conditions outside of STRINGIFY to remove compiler ambiguity.
2038 * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
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
2045 Reviewed by Simon Fraser.
2047 * platform/graphics/ImageSource.h:
2048 This method will be used by clients outside WebCore, so
2051 2017-12-12 Simon Fraser <simon.fraser@apple.com>
2053 Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace
2054 https://bugs.webkit.org/show_bug.cgi?id=180689
2056 Reviewed by Tim Horton.
2058 Remove the ColorSpaceDeviceRGB enum and users.
2060 ImageBuffer now uses sRGB instead of deviceRGB in the few cases that used the latter.
2062 Switch Windows CG code to use sRGBColorSpaceRef() instead of deviceRGBColorSpaceRef().
2064 Have linearRGBColorSpaceRef() use kCGColorSpaceLinearSRGB, which is present in iOS 9 and 10.11 and later.
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):
2103 2017-12-12 Youenn Fablet <youenn@apple.com>
2105 Navigation requests should use navigate fetch mode
2106 https://bugs.webkit.org/show_bug.cgi?id=179808
2108 Reviewed by Chris Dumez.
2110 Covered by existing tests.
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.
2121 2017-12-12 Simon Fraser <simon.fraser@apple.com>
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>
2127 Reviewed by Antti Koivisto.
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.
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.
2136 Test: fast/dom/iframe-innerWidth.html
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):
2144 2017-12-11 Antoine Quint <graouts@apple.com>
2146 [Web Animations] Enqueue and dispatch animation events
2147 https://bugs.webkit.org/show_bug.cgi?id=180657
2148 <rdar://problem/35970103>
2150 Reviewed by Chris Dumez.
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.
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.
2162 If there is no document for timing, events should be dispatched as a standalone task.
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:
2191 2017-12-12 Chris Dumez <cdumez@apple.com>
2193 Simplify IPC code between WebProcess and StorageProcess for serviceWorker.postMessage()
2194 https://bugs.webkit.org/show_bug.cgi?id=180683
2196 Reviewed by Brady Eidson.
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.
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:
2219 2017-12-12 Youenn Fablet <youenn@apple.com>
2221 Allow AudioContext to start when getUserMedia is on
2222 https://bugs.webkit.org/show_bug.cgi?id=180680
2224 Reviewed by Eric Carlson.
2226 Test: webrtc/getUserMedia-webaudio-autoplay.html
2228 * Modules/webaudio/AudioContext.cpp:
2229 (WebCore::AudioContext::willBeginPlayback):
2231 2017-12-12 Romain Bellessort <romain.bellessort@crf.canon.fr>
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
2236 Reviewed by Youenn Fablet.
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)
2243 One new test imported from WPT to check that RangeError is thrown.
2245 * Modules/streams/ReadableStream.js:
2246 (initializeReadableStream): Check strategy size and throw RangeError if needed.
2248 2017-12-12 Carlos Alberto Lopez Perez <clopez@igalia.com>
2250 [GTK][WebRTC] Stop warning with so much verbosity about not implemented RealtimeMediaSourceCenter
2251 https://bugs.webkit.org/show_bug.cgi?id=180694
2253 Reviewed by Youenn Fablet.
2255 No new tests -- no change in functionality.
2257 * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2258 (WebCore::RealtimeMediaSourceCenter::singleton):
2260 2017-12-12 Ms2ger <Ms2ger@igalia.com>
2262 Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
2263 https://bugs.webkit.org/show_bug.cgi?id=180471
2265 Reviewed by Darin Adler.
2267 Test: imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html
2269 * plugins/DOMMimeTypeArray.cpp:
2270 (WebCore::DOMMimeTypeArray::supportedPropertyNames):
2271 * plugins/DOMPluginArray.cpp:
2272 (WebCore::DOMPluginArray::supportedPropertyNames):
2274 2017-12-12 Yusuke Suzuki <utatane.tea@gmail.com>
2276 [WTF] Thread::create should have Thread::tryCreate
2277 https://bugs.webkit.org/show_bug.cgi?id=180333
2279 Reviewed by Darin Adler.
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):
2291 2017-12-11 Manuel Rego Casasnovas <rego@igalia.com>
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
2296 Reviewed by Darin Adler.
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.
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.
2311 Using WPT tests to verify this behavior,
2312 and corrected a bunch of other tests that were wrong.
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
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):
2326 2017-12-11 Zan Dobersek <zdobersek@igalia.com>
2328 [Cairo] Cairo::clipToImageBuffer() should operate on a cairo_surface_t
2329 https://bugs.webkit.org/show_bug.cgi?id=180665
2331 Reviewed by Michael Catanzaro.
2333 Have the Cairo::clipToImageBuffer() function in the CairoUtilities code
2334 operate on a cairo_surface_t object, instead of an Image object.
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().
2340 No new tests -- no change in functionality.
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):
2348 2017-12-11 Zan Dobersek <zdobersek@igalia.com>
2350 [Cairo] Don't use a static cairo_surface_t object for CairoPath contexts
2351 https://bugs.webkit.org/show_bug.cgi?id=180663
2353 Reviewed by Michael Catanzaro.
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.
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.
2365 No new tests -- no change in behavior.
2367 * platform/graphics/cairo/PlatformPathCairo.cpp:
2368 (WebCore::CairoPath::CairoPath):
2369 (WebCore::pathSurface): Deleted.
2370 * platform/graphics/cairo/PlatformPathCairo.h:
2371 (WebCore::CairoPath::context):
2373 2017-12-11 Zan Dobersek <zdobersek@igalia.com>
2375 [CoordGraphics] Move UpdateAtlas, AreaAllocator into the platform layer
2376 https://bugs.webkit.org/show_bug.cgi?id=180641
2378 Reviewed by Michael Catanzaro.
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.
2385 No new tests -- no change in functionality.
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):
2427 2017-12-11 Ryosuke Niwa <rniwa@webkit.org>
2429 Disable NoEventDispatchAssertion release assertion in WebKit1
2430 https://bugs.webkit.org/show_bug.cgi?id=180616
2432 Reviewed by Zalan Bujtas.
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
2438 * bindings/js/ScriptController.cpp:
2439 (WebCore::ScriptController::canExecuteScripts):
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):
2450 2017-12-11 Darin Adler <darin@apple.com>
2452 Improve FontSelectionAlgorithm, including moving from IntegerHasher to Hasher
2453 https://bugs.webkit.org/show_bug.cgi?id=180340
2455 Reviewed by Dan Bates.
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.
2461 * platform/graphics/FontDescription.cpp:
2462 (WebCore::FontDescription::FontDescription): Updated since FontSelectionRequest
2463 does not always have a constructor any more.
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.
2485 * platform/graphics/cocoa/FontCacheCoreText.cpp:
2486 (WebCore::findClosestFont): Move in the vector instead of copying it when creating a
2487 FontSelectionAlgorithm object.
2489 2017-12-11 Jer Noble <jer.noble@apple.com>
2491 [EME] support update() for FairPlayStreaming in Modern EME API
2492 https://bugs.webkit.org/show_bug.cgi?id=180542
2494 Reviewed by Eric Carlson.
2496 Support the updateLicense() method in CDMInstanceFairPlayStreaming. Also, support adding a
2497 AVStreamDataParser to the AVContentKeySession.
2501 - Sometimes, AVFoundation will give us a base64 encoded string with spaces url-disallowed
2502 characters, so use base64Decode() rather than base64URLDecode().
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):
2523 2017-12-11 Eric Carlson <eric.carlson@apple.com>
2525 Web Inspector: Optionally log WebKit log parameters as JSON
2526 https://bugs.webkit.org/show_bug.cgi?id=180529
2527 <rdar://problem/35909462>
2529 Reviewed by Joseph Pecoraro.
2532 (WebCore::Document::didLogMessage):Update for API change. Don't check for main thread, that
2533 is already done in addConsoleMessage.
2536 * html/HTMLMediaElement.cpp:
2537 (WebCore::HTMLMediaElement::updatePlayState): Cleanup logging.
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):
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):
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):
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):
2564 * platform/graphics/InbandTextTrackPrivateClient.h:
2565 (WebCore::GenericCueData::toJSONString const): Ditto.
2566 (WTF::LogArgument<WebCore::GenericCueData>::toString):
2567 (WebCore::GenericCueData::toString const): Deleted.
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.
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.
2580 * platform/graphics/iso/ISOVTTCue.cpp:
2581 (WebCore::ISOWebVTTCue::toJSONString const): Serialize to JSON string.
2583 * platform/graphics/iso/ISOVTTCue.h:
2584 (WTF::LogArgument<WebCore::ISOWebVTTCue>::toString): Ditto.
2586 2017-12-11 Youenn Fablet <youenn@apple.com>
2588 Use VCP H264 encoder for platforms supporting it
2589 https://bugs.webkit.org/show_bug.cgi?id=179076
2590 rdar://problem/35180773
2592 Reviewed by Eric Carlson.
2594 Covered by existing test coverage.
2596 * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
2597 (WebCore::VideoToolboxVideoEncoderFactory::setActive):
2598 (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
2599 (WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
2600 * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h:
2602 2017-12-11 Chris Dumez <cdumez@apple.com>
2604 Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData
2605 https://bugs.webkit.org/show_bug.cgi?id=180669
2607 Reviewed by Youenn Fablet.
2609 Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData, for consistency with
2610 ServiceWorkerIdentifier / ServiceWorkerData, and start simplifying the postMessage() code.
2612 * WebCore.xcodeproj/project.pbxproj:
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:
2653 2017-12-11 Daniel Bates <dabates@apple.com>
2655 Fix the macOS Sierra build following r225179
2656 (https://bugs.webkit.org/show_bug.cgi?id=180011)
2658 Substitute TARGET_MAC_OS_X_VERSION_LESS_THAN_101300 for TARGET_MAC_OS_X_VERSION_LESS_THAN_1013000.
2660 * Configurations/WebCore.xcconfig:
2662 2017-12-11 Zalan Bujtas <zalan@apple.com>
2664 Make FrameView objects IsoHeap allocated
2665 https://bugs.webkit.org/show_bug.cgi?id=180668
2666 <rdar://problem/35976738>
2668 Reviewed by Simon Fraser.
2670 Related to <https://trac.webkit.org/changeset/225719/webkit>
2672 * page/FrameView.cpp:
2675 2017-12-11 Antoine Quint <graouts@apple.com>
2677 [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
2678 https://bugs.webkit.org/show_bug.cgi?id=180647
2680 Reviewed by Dean Jackson.
2682 Actually fix Windows build this time.
2684 * animation/AnimationPlaybackEventInit.h:
2686 2017-12-11 Antoine Quint <graouts@apple.com>
2688 [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
2689 https://bugs.webkit.org/show_bug.cgi?id=180647
2690 <rdar://problem/35966325>
2692 Reviewed by Dean Jackson.
2694 Unreviewed, fix Windows build.
2696 * animation/AnimationPlaybackEventInit.h:
2698 2017-12-11 Zalan Bujtas <zalan@apple.com>
2700 FloatingObjects/FloatingObject classes should hold weak references to renderers
2701 https://bugs.webkit.org/show_bug.cgi?id=180627
2702 <rdar://problem/35954069>
2704 Reviewed by Antti Koivisto.
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):
2731 2017-12-11 David Quesada <david_quesada@apple.com>
2733 Turn on ENABLE_APPLICATION_MANIFEST
2734 https://bugs.webkit.org/show_bug.cgi?id=180562
2735 rdar://problem/35924737
2737 Reviewed by Geoffrey Garen.
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.
2746 2017-12-11 Dean Jackson <dino@apple.com>
2748 Add a runtime feature flag for ImageBitmap and OffscreenCanvas
2749 https://bugs.webkit.org/show_bug.cgi?id=180652
2750 <rdar://problem/35969611>
2752 Reviewed by Antoine Quint.
2754 Add a RuntimeEnabledFeature for these interfaces, and link the bindings
2757 Test: fast/canvas/offscreen-enabled.html
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:
2767 2017-12-11 Antoine Quint <graouts@apple.com>
2769 [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
2770 https://bugs.webkit.org/show_bug.cgi?id=180647
2771 <rdar://problem/35966325>
2773 Reviewed by Dean Jackson.
2775 We implement the AnimationPlaybackEvent interface and AnimationPlaybackEventInit dictionary
2776 as the first step towards dispatching animation "finish" and "cancel" events.
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
2783 No new tests yet, followup patches will enable event dispatch and existing Web Platform Tests
2784 will show progressions.
2787 * DerivedSources.make:
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:
2801 2017-12-11 Basuke Suzuki <Basuke.Suzuki@sony.com>
2803 [WinCairo] DumpRenderTree times out for all non-http tests
2804 https://bugs.webkit.org/show_bug.cgi?id=180571
2806 Reviewed by Alex Christensen.
2808 Bug fix on processing the curl event for file protocol.
2810 No new tests. This fix is to run existing tests.
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):
2819 2017-12-11 Manuel Rego Casasnovas <rego@igalia.com>
2821 REGRESSION(r221931): Row stretch doesn't work for grid container with min-height
2822 https://bugs.webkit.org/show_bug.cgi?id=180287
2824 Reviewed by Darin Adler.
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
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."
2838 This patch adds a new method
2839 GridTrackSizingAlgorithmStrategy::freeSpaceForStretchAutoTracksStep().
2840 When we're in the DefiniteSizeStrategy it just returns the current
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.
2848 Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-stretch-respects-min-size-001.html
2850 * rendering/GridTrackSizingAlgorithm.cpp:
2851 (WebCore::IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
2852 (WebCore::DefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
2853 (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks):
2854 * rendering/GridTrackSizingAlgorithm.h:
2856 2017-12-10 Minsheng Liu <lambda@liu.ms>
2858 Incorrect bounds inside <mover>/<munder> when a stretchy operator is present
2859 https://bugs.webkit.org/show_bug.cgi?id=179682
2861 Reviewed by Frédéric Wang.
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
2870 A test is added to check the stretch width of stretchy operators in various
2872 mathml/opentype/munderover-stretch-width.html
2874 A previous test is updated:
2875 mathml/opentype/opentype-stretchy-horizontal.html
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):
2889 2017-12-10 Yusuke Suzuki <utatane.tea@gmail.com>
2891 Unreviewed, follow-up patch after r225470
2892 https://bugs.webkit.org/show_bug.cgi?id=180308
2894 * Modules/webdatabase/SQLTransaction.cpp:
2895 (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
2896 Use consistent operands.
2898 * bindings/js/JSCallbackData.h:
2899 (WebCore::JSCallbackData::JSCallbackData):
2900 Use class field initializer.
2902 * xml/parser/XMLDocumentParserLibxml2.cpp:
2903 (WebCore::openFunc):
2904 Use consistent operands.
2906 2017-12-09 Ryosuke Niwa <rniwa@webkit.org>
2908 iOS: Crash in Document::updateLayout() via Document::processViewport
2909 https://bugs.webkit.org/show_bug.cgi?id=180619
2910 <rdar://problem/35717575>
2912 Reviewed by Zalan Bujtas.
2914 The crash is caused by modern media controls updating the layout in the middle of insertedIntoAncestor
2915 via HTMLMediaElement::setControllerJSProperty inside Document::pageScaleFactorChangedAndStable.
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.
2922 Test: media/ios/viewport-change-with-video.html
2924 * html/HTMLMetaElement.cpp:
2925 (WebCore::HTMLMetaElement::insertedIntoAncestor):
2926 (WebCore::HTMLMetaElement::didFinishInsertingNode): Added.
2927 * html/HTMLMetaElement.h:
2929 2017-12-08 Zalan Bujtas <zalan@apple.com>
2931 Document::updateLayout() could destroy current frame.
2932 https://bugs.webkit.org/show_bug.cgi?id=180525
2933 <rdar://problem/35906836>
2935 Reviewed by Simon Fraser.
2937 Early return when Document::updateLayout() triggers Frame destruction.
2939 Test: fast/frames/crash-when-iframe-is-remove-in-eventhandler.html
2941 * dom/TreeScope.cpp:
2942 (WebCore::absolutePointIfNotClipped):
2944 2017-12-08 Chris Dumez <cdumez@apple.com>
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
2949 Reviewed by Brady Eidson.
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.
2954 No new tests, rebaselined existing test.
2956 * workers/DedicatedWorkerGlobalScope.idl:
2957 * workers/WorkerGlobalScope.idl:
2958 * workers/service/ServiceWorkerGlobalScope.idl:
2960 2017-12-08 Brady Eidson <beidson@apple.com>
2962 Delay some service worker operations until after the database import completes.
2963 https://bugs.webkit.org/show_bug.cgi?id=180573
2965 Reviewed by Chris Dumez.
2967 No new tests (Not testable yet).
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.
2973 This patch delays certain things until after the initial origin table import is complete.
2975 * workers/service/server/RegistrationStore.cpp:
2976 (WebCore::RegistrationStore::databaseOpenedAndRecordsImported):
2978 * workers/service/server/SWOriginStore.h:
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:
2986 2017-12-08 Youenn Fablet <youenn@apple.com>
2988 Service Worker should use a correct user agent
2989 https://bugs.webkit.org/show_bug.cgi?id=180566
2990 <rdar://problem/35926295>
2992 Reviewed by Chris Dumez.
2994 Test: http/wpt/service-workers/useragent.https.html
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.
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:
3009 2017-12-07 Simon Fraser <simon.fraser@apple.com>
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
3015 Reviewed by Tim Horton.
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.
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().
3032 Some other minor logging changes.
3034 Test: fast/visual-viewport/ios/caret-after-focus-in-fixed.html
3036 * page/FrameView.cpp:
3037 (WebCore::FrameView::setVisualViewportOverrideRect):
3038 (WebCore::FrameView::updateLayoutViewport):
3039 (WebCore::FrameView::visualViewportRect const):
3041 * page/scrolling/mac/ScrollingTreeFixedNode.mm:
3042 (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
3044 2017-12-08 Zalan Bujtas <zalan@apple.com>
3046 Make inline box objects IsoHeap allocated.
3047 https://bugs.webkit.org/show_bug.cgi?id=180556
3048 <rdar://problem/35923629>
3050 Reviewed by Filip Pizlo.
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:
3072 2017-12-08 Chris Dumez <cdumez@apple.com>
3074 Clearing all Website Data should remove service worker registrations on disk
3075 https://bugs.webkit.org/show_bug.cgi?id=180558
3077 Reviewed by Youenn Fablet.
3079 Clear service worker registrations on disk in addition to the ones in memory.
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
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
3093 (WebCore::RegistrationDatabase::databasePath const):
3094 New method which returns the database file path.
3096 (WebCore::RegistrationDatabase::openSQLiteDatabase):
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.
3102 (WebCore::RegistrationDatabase::pushChanges):
3103 Call completion handler when changes are pushed.
3105 (WebCore::RegistrationDatabase::clearAll):
3106 Close the database if it is open, then remove the database files.
3108 (WebCore::RegistrationDatabase::doPushChanges):
3109 If the database is not already open, we now open it when trying to write changes for
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:
3118 * workers/service/server/SWServer.cpp:
3119 (WebCore::SWServer::clearAll):
3120 (WebCore::SWServer::clear):
3121 Also clear the database.
3123 * workers/service/server/SWServer.h:
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.
3130 2017-12-08 Joseph Pecoraro <pecoraro@apple.com>
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>
3136 Reviewed by Brian Burg.
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.
3143 2017-12-08 Joseph Pecoraro <pecoraro@apple.com>
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
3148 Reviewed by Brian Burg.
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.
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.
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.
3169 2017-12-08 Daniel Bates <dabates@apple.com>
3171 Remove unnecessary prefix from AutoFillButtonType enumerators
3172 https://bugs.webkit.org/show_bug.cgi?id=180512
3174 Reviewed by Tim Horton.
3176 * testing/Internals.cpp:
3177 (WebCore::toAutoFillButtonType):
3178 * testing/Internals.h:
3179 * testing/Internals.idl:
3181 2017-12-08 Dean Jackson <dino@apple.com>
3183 Implement transferToImageBitmap for WebGL offscreen canvas objects
3184 https://bugs.webkit.org/show_bug.cgi?id=180603
3185 <rdar://problem/34147143>
3187 Reviewed by Sam Weinig.
3189 Implement the basic version of creating an ImageBitmap from an
3190 OffscreenCanvas that is using a WebGL context.
3192 Tests: http/wpt/offscreen-canvas/transferToImageBitmap-empty.html
3193 http/wpt/offscreen-canvas/transferToImageBitmap-webgl.html
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:
3200 * html/OffscreenCanvas.cpp:
3201 (WebCore::OffscreenCanvas::transferToImageBitmap): Create a new ImageBitmap
3202 and paint the current canvas into it.
3204 2017-12-08 Youenn Fablet <youenn@apple.com>
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
3209 Reviewed by Alex Christensen.
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.
3216 * loader/DocumentThreadableLoader.cpp:
3217 (WebCore::DocumentThreadableLoader::didFail):
3219 2017-12-08 Youenn Fablet <youenn@apple.com>
3221 Service Worker should use a correct SessionID
3222 https://bugs.webkit.org/show_bug.cgi?id=180585
3224 Reviewed by Alex Christensen.
3226 Test: http/tests/workers/service/serviceworker-private-browsing.https.html
3228 Store SessionID in SWServer and send it as part of service worker instantiation.
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:
3237 2017-12-08 Youenn Fablet <youenn@apple.com>
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>
3243 Reviewed by Alex Christensen.
3245 Covered by existing rebased tests.
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.
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.
3254 Updated SubresourceLoader to check cross origin service worker responses based on their tainting.
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.
3269 (WebCore::Document::initSecurityContext):
3270 * loader/SubresourceLoader.cpp:
3271 (WebCore::SubresourceLoader::willSendRequestInternal):
3272 (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
3274 2017-12-08 David Quesada <david_quesada@apple.com>
3276 ApplicationManifestParser should strip whitespace from the raw input
3277 https://bugs.webkit.org/show_bug.cgi?id=180539
3278 rdar://problem/35915075
3280 Reviewed by Joseph Pecoraro.
3282 * Modules/applicationmanifest/ApplicationManifestParser.cpp:
3283 (WebCore::ApplicationManifestParser::parseManifest):
3285 2017-12-08 Eric Carlson <eric.carlson@apple.com>
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
3290 Reviewed by Alex Christensen.
3292 No new tests, existing API test updated.
3294 * Modules/mediastream/PeerConnectionBackend.h:
3295 * Modules/mediastream/RTCPeerConnection.h:
3296 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3297 (PAL::LogArgument<webrtc::RTCStats>::toString): Deleted.
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:
3351 2017-12-08 Yusuke Suzuki <utatane.tea@gmail.com>
3353 Remove pthread_once in favor of dispatch_once
3354 https://bugs.webkit.org/show_bug.cgi?id=180591
3356 Reviewed by Saam Barati.
3360 * platform/mac/WebCoreNSURLExtras.mm:
3361 (WebCore::allCharactersInIDNScriptWhiteList):
3362 (WebCore::readIDNScriptWhiteList): Deleted.
3364 2017-12-08 Chris Dumez <cdumez@apple.com>
3366 Improve error handling in RegistrationDatabase
3367 https://bugs.webkit.org/show_bug.cgi?id=180587
3369 Reviewed by Brady Eidson.
3371 * workers/service/server/RegistrationDatabase.cpp:
3372 (WebCore::RegistrationDatabase::openSQLiteDatabase):
3373 (WebCore::RegistrationDatabase::doPushChanges):
3375 2017-12-07 Darin Adler <darin@apple.com>
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
3380 Reviewed by Sam Weinig.
3382 * accessibility/AccessibilityNodeObject.cpp:
3383 (WebCore::AccessibilityNodeObject::colorValue const): Use valueAsColor instead of
3384 having custom code here to parse the color string.
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.
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".
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.
3411 * html/ColorInputType.h: Marked everything final instead of override. Updated the
3412 selectColor function to take a StringView instead of a Color.
3414 * html/HTMLInputElement.cpp:
3415 (WebCore::HTMLInputElement::selectColor): Take a StringView instead of a Color.
3416 * html/HTMLInputElement.h: Ditto.
3418 * html/InputType.cpp:
3419 (WebCore::InputType::selectColor): Take a StringView instead of a Color.
3420 * html/InputType.h: Ditto.
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".
3429 2017-12-08 Konstantin Tokarev <annulen@yandex.ru>
3431 Unreviewed, fix wrong letter case in #import HTMLIframeElement.h
3433 * editing/cocoa/WebContentReaderCocoa.mm: