[Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-12-11  Antoine Quint  <graouts@apple.com>
2
3         [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
4         https://bugs.webkit.org/show_bug.cgi?id=180647
5         <rdar://problem/35966325>
6
7         Reviewed by Dean Jackson.
8
9         Unreviewed, fix Windows build.
10
11         * animation/AnimationPlaybackEventInit.h:
12
13 2017-12-11  Zalan Bujtas  <zalan@apple.com>
14
15         FloatingObjects/FloatingObject classes should hold weak references to renderers
16         https://bugs.webkit.org/show_bug.cgi?id=180627
17         <rdar://problem/35954069>
18
19         Reviewed by Antti Koivisto.
20
21         * rendering/FloatingObjects.cpp:
22         (WebCore::FloatingObject::FloatingObject):
23         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
24         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
25         (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
26         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
27         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
28         (WebCore::FloatingObjects::findNextFloatLogicalBottomBelow):
29         (WebCore::FloatingObjects::findNextFloatLogicalBottomBelowForBlock):
30         (WebCore::FloatingObjects::FloatingObjects):
31         (WebCore::FloatingObjects::clearLineBoxTreePointers):
32         (WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat):
33         (WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat):
34         (WebCore::FloatingObjects::logicalLeftOffset):
35         (WebCore::FloatingObjects::logicalRightOffset):
36         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
37         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
38         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining const):
39         (WebCore::ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded):
40         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
41         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
42         * rendering/FloatingObjects.h:
43         (WebCore::FloatingObject::renderer const):
44         (WebCore::FloatingObjects::renderer const):
45
46 2017-12-11  David Quesada  <david_quesada@apple.com>
47
48         Turn on ENABLE_APPLICATION_MANIFEST
49         https://bugs.webkit.org/show_bug.cgi?id=180562
50         rdar://problem/35924737
51
52         Reviewed by Geoffrey Garen.
53
54         * Configurations/FeatureDefines.xcconfig:
55         * loader/LinkLoader.cpp:
56         (WebCore::createLinkPreloadResourceClient):
57         * loader/cached/CachedResourceRequest.cpp:
58             Add a missing #include that was implicitly added in the unified source when
59             the feature is disabled.
60
61 2017-12-11  Dean Jackson  <dino@apple.com>
62
63         Add a runtime feature flag for ImageBitmap and OffscreenCanvas
64         https://bugs.webkit.org/show_bug.cgi?id=180652
65         <rdar://problem/35969611>
66
67         Reviewed by Antoine Quint.
68
69         Add a RuntimeEnabledFeature for these interfaces, and link the bindings
70         to the feature.
71
72         Test: fast/canvas/offscreen-enabled.html
73
74         * bindings/js/WebCoreBuiltinNames.h:
75         * html/ImageBitmap.idl:
76         * html/OffscreenCanvas.idl:
77         * page/RuntimeEnabledFeatures.h:
78         (WebCore::RuntimeEnabledFeatures::setImageBitmapOffscreenCanvasEnabled):
79         (WebCore::RuntimeEnabledFeatures::imageBitmapOffscreenCanvasEnabled const):
80         * page/WindowOrWorkerGlobalScope.idl:
81
82 2017-12-11  Antoine Quint  <graouts@apple.com>
83
84         [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
85         https://bugs.webkit.org/show_bug.cgi?id=180647
86         <rdar://problem/35966325>
87
88         Reviewed by Dean Jackson.
89
90         We implement the AnimationPlaybackEvent interface and AnimationPlaybackEventInit dictionary
91         as the first step towards dispatching animation "finish" and "cancel" events.
92
93         Animation playback events will be dispatched on Animation objects and expose the timeline time
94         and animation current time at the time they were constructed. Dispatch itself, which will be
95         the focus of the next patch, is not synchronous, so it's important to track those values
96         at creation time.
97
98         No new tests yet, followup patches will enable event dispatch and existing Web Platform Tests
99         will show progressions.
100
101         * CMakeLists.txt:
102         * DerivedSources.make:
103         * Sources.txt:
104         * WebCore.xcodeproj/project.pbxproj:
105         * animation/AnimationPlaybackEvent.cpp: Added.
106         (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
107         (WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
108         (WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
109         * animation/AnimationPlaybackEvent.h: Added.
110         * animation/AnimationPlaybackEvent.idl: Added.
111         * animation/AnimationPlaybackEventInit.h: Added.
112         * animation/AnimationPlaybackEventInit.idl: Added.
113         * bindings/js/WebCoreBuiltinNames.h:
114         * dom/EventNames.in:
115
116 2017-12-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
117
118         [WinCairo] DumpRenderTree times out for all non-http tests
119         https://bugs.webkit.org/show_bug.cgi?id=180571
120
121         Reviewed by Alex Christensen.
122
123         Bug fix on processing the curl event for file protocol.
124
125         No new tests. This fix is to run existing tests.
126
127         * platform/network/curl/CurlRequest.cpp:
128         (WebCore::CurlRequest::completeDidReceiveResponse):
129         * platform/network/curl/CurlRequest.h:
130         (WebCore::CurlRequest::isCompleted const):
131         (WebCore::CurlRequest::isCancelled const):
132         (WebCore::CurlRequest::isCompletedOrCancelled const):
133
134 2017-12-11  Manuel Rego Casasnovas  <rego@igalia.com>
135
136         REGRESSION(r221931): Row stretch doesn't work for grid container with min-height
137         https://bugs.webkit.org/show_bug.cgi?id=180287
138
139         Reviewed by Darin Adler.
140
141         In r221931 we moved the stretch phase as the last step of
142         the track sizing algorithm.
143         However this introduced a regression as we were no longer
144         taking into account the grid container min-width|height constraints
145         during this step.
146
147         The CSS WG modified the spec so it now defines what to do
148         in these situations (https://drafts.csswg.org/css-grid/#algo-stretch):
149           "If the free space is indefinite, but the grid container
150            has a definite min-width/height, use that size to calculate
151            the free space for this step instead."
152
153         This patch adds a new method
154         GridTrackSizingAlgorithmStrategy::freeSpaceForStretchAutoTracksStep().
155         When we're in the DefiniteSizeStrategy it just returns the current
156         free space.
157         For the IndefiniteSizeStrategy in the columns case we don't need
158         any special computation (the same that happens in
159         recomputeUsedFlexFractionIfNeeded()); for rows it uses the min size
160         of the grid container (respecting min-width|height properties)
161         to calculate the free space.
162
163         Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-stretch-respects-min-size-001.html
164
165         * rendering/GridTrackSizingAlgorithm.cpp:
166         (WebCore::IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
167         (WebCore::DefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
168         (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks):
169         * rendering/GridTrackSizingAlgorithm.h:
170
171 2017-12-10  Minsheng Liu  <lambda@liu.ms>
172
173         Incorrect bounds inside <mover>/<munder> when a stretchy operator is present
174         https://bugs.webkit.org/show_bug.cgi?id=179682
175
176         Reviewed by Frédéric Wang.
177
178         Currently a stretchy operator inside <mover>/<munder>/<munderover> is stretched
179         during paint() rather than layout(), which leads to both end user confusion
180         and many unexpected behaviors. This patch rewrites
181         RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren()
182         to both eliminate the issue and make operator stretching more standard
183         conforming.
184
185         A test is added to check the stretch width of stretchy operators in various
186         scenarios:
187         mathml/opentype/munderover-stretch-width.html
188
189         A previous test is updated:
190         mathml/opentype/opentype-stretchy-horizontal.html
191
192         * rendering/mathml/RenderMathMLOperator.cpp:
193         (WebCore::RenderMathMLOperator::stretchTo):
194         (WebCore::RenderMathMLOperator::resetStretchSize):
195         (WebCore::RenderMathMLOperator::paint):
196         * rendering/mathml/RenderMathMLOperator.h:
197         (WebCore::RenderMathMLOperator::setStretchWidthLocked):
198         (WebCore::RenderMathMLOperator::isStretchWidthLocked const):
199         * rendering/mathml/RenderMathMLUnderOver.cpp:
200         (WebCore::toHorizontalStretchyOperator):
201         (WebCore::fixLayoutAfterStretch):
202         (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
203
204 2017-12-10  Yusuke Suzuki  <utatane.tea@gmail.com>
205
206         Unreviewed, follow-up patch after r225470
207         https://bugs.webkit.org/show_bug.cgi?id=180308
208
209         * Modules/webdatabase/SQLTransaction.cpp:
210         (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
211         Use consistent operands.
212
213         * bindings/js/JSCallbackData.h:
214         (WebCore::JSCallbackData::JSCallbackData):
215         Use class field initializer.
216
217         * xml/parser/XMLDocumentParserLibxml2.cpp:
218         (WebCore::openFunc):
219         Use consistent operands.
220
221 2017-12-09  Ryosuke Niwa  <rniwa@webkit.org>
222
223         iOS: Crash in Document::updateLayout() via Document::processViewport
224         https://bugs.webkit.org/show_bug.cgi?id=180619
225         <rdar://problem/35717575>
226
227         Reviewed by Zalan Bujtas.
228
229         The crash is caused by modern media controls updating the layout in the middle of insertedIntoAncestor
230         via HTMLMediaElement::setControllerJSProperty inside Document::pageScaleFactorChangedAndStable.
231
232         Fixed the crash by delaying the work to update the viewport configuration until didFinishInsertingNode
233         since updating the viewport configuration results in a lot of related code running in response,
234         and making sure all that code never tries to execute an author script is not attainable in the short term,
235         and a maintenance nightmare in the long term.
236
237         Test: media/ios/viewport-change-with-video.html
238
239         * html/HTMLMetaElement.cpp:
240         (WebCore::HTMLMetaElement::insertedIntoAncestor):
241         (WebCore::HTMLMetaElement::didFinishInsertingNode): Added.
242         * html/HTMLMetaElement.h:
243
244 2017-12-08  Zalan Bujtas  <zalan@apple.com>
245
246         Document::updateLayout() could destroy current frame.
247         https://bugs.webkit.org/show_bug.cgi?id=180525
248         <rdar://problem/35906836>
249
250         Reviewed by Simon Fraser.
251
252         Early return when Document::updateLayout() triggers Frame destruction.
253
254         Test: fast/frames/crash-when-iframe-is-remove-in-eventhandler.html
255
256         * dom/TreeScope.cpp:
257         (WebCore::absolutePointIfNotClipped):
258
259 2017-12-08  Chris Dumez  <cdumez@apple.com>
260
261         ServiceWorkerGlobalScope is a global object and should be marked as [ImplicitThis] in the IDL
262         https://bugs.webkit.org/show_bug.cgi?id=180615
263
264         Reviewed by Brady Eidson.
265
266         ServiceWorkerGlobalScope is a global object and should be marked as [ImplicitThis] in the IDL, similarly to what we do for Window.
267         This allows a getter to be fallback to the global object as ThisValue when the cast of the ThisValue to the expected type fails.
268
269         No new tests, rebaselined existing test.
270
271         * workers/DedicatedWorkerGlobalScope.idl:
272         * workers/WorkerGlobalScope.idl:
273         * workers/service/ServiceWorkerGlobalScope.idl:
274
275 2017-12-08  Brady Eidson  <beidson@apple.com>
276
277         Delay some service worker operations until after the database import completes.
278         https://bugs.webkit.org/show_bug.cgi?id=180573
279
280         Reviewed by Chris Dumez.
281
282         No new tests (Not testable yet).
283
284         Right after the storage process launches it starts importing registration records.
285         During this time, a lot of the decisions we make regarding registrations, fetch, etc.
286         are invalid, as they rely on those in-memory records being in place.
287         
288         This patch delays certain things until after the initial origin table import is complete.
289         
290         * workers/service/server/RegistrationStore.cpp:
291         (WebCore::RegistrationStore::databaseOpenedAndRecordsImported):
292
293         * workers/service/server/SWOriginStore.h:
294
295         * workers/service/server/SWServer.cpp:
296         (WebCore::SWServer::registrationStoreImportComplete): Tell the origin store the initial
297           import was completed.
298         (WebCore::SWServer::addRegistrationFromStore):
299         * workers/service/server/SWServer.h:
300
301 2017-12-08  Youenn Fablet  <youenn@apple.com>
302
303         Service Worker should use a correct user agent
304         https://bugs.webkit.org/show_bug.cgi?id=180566
305         <rdar://problem/35926295>
306
307         Reviewed by Chris Dumez.
308
309         Test: http/wpt/service-workers/useragent.https.html
310
311         Make ServiceWorkerFrameLoaderClient return a valid UserAgent.
312         Pass user agent to ServiceWorkerThread so that navigation.userAgent is correctly initialized.
313         Allow ServiceWorkerFrameLoaderClient to clean itself when no longer needed.
314
315         * loader/EmptyFrameLoaderClient.h:
316         * workers/service/context/ServiceWorkerThread.cpp:
317         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
318         * workers/service/context/ServiceWorkerThread.h:
319         * workers/service/context/ServiceWorkerThreadProxy.cpp:
320         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
321         (WebCore::ServiceWorkerThreadProxy::frameLoaderClient):
322         * workers/service/context/ServiceWorkerThreadProxy.h:
323
324 2017-12-07  Simon Fraser  <simon.fraser@apple.com>
325
326         Wrong caret position for input field inside a fixed position parent on iOS 11
327         https://bugs.webkit.org/show_bug.cgi?id=176896
328         rdar://problem/33726145
329
330         Reviewed by Tim Horton.
331
332         In r219668 I added code to compute a layout viewport rect in the web process, so that
333         after programmatic scrolling, getBoundingClientRect() would return the correct values.
334         However, that computation sometimes used a different visual viewport than the UI process,
335         resulting in a different layout viewport being set. This would happen when the keyboard
336         was visible, and the combination of this and zooming when focusing an input would result
337         in a state where the scrolling tree contained notes computed with the bad layout viewport.
338         This could cause apparently offset fixed elements, and bad caret positioning if those fixed
339         elements contained the focused input.
340
341         Fix by passing to the web process the same visual viewport rect that the UI process is using,
342         namely "unobscuredContentRectRespectingInputViewBounds". This was already being set in
343         VisibleContentRectUpdateInfo but wasn't encoded/decoded, so fix that. Set it as an optional<>
344         on FrameView when different from the normal visual viewport, and return it from
345         visualViewportRect().
346
347         Some other minor logging changes.
348
349         Test: fast/visual-viewport/ios/caret-after-focus-in-fixed.html
350
351         * page/FrameView.cpp:
352         (WebCore::FrameView::setVisualViewportOverrideRect):
353         (WebCore::FrameView::updateLayoutViewport):
354         (WebCore::FrameView::visualViewportRect const):
355         * page/FrameView.h:
356         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
357         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
358
359 2017-12-08  Zalan Bujtas  <zalan@apple.com>
360
361         Make inline box objects IsoHeap allocated.
362         https://bugs.webkit.org/show_bug.cgi?id=180556
363         <rdar://problem/35923629>
364
365         Reviewed by Filip Pizlo.
366
367         * rendering/EllipsisBox.cpp:
368         * rendering/EllipsisBox.h:
369         * rendering/InlineBox.cpp:
370         * rendering/InlineBox.h:
371         * rendering/InlineElementBox.cpp:
372         * rendering/InlineElementBox.h:
373         * rendering/InlineFlowBox.cpp:
374         * rendering/InlineFlowBox.h:
375         * rendering/InlineTextBox.cpp:
376         * rendering/InlineTextBox.h:
377         * rendering/RootInlineBox.cpp:
378         * rendering/RootInlineBox.h:
379         * rendering/TrailingFloatsRootInlineBox.h:
380         * rendering/svg/SVGInlineFlowBox.cpp:
381         * rendering/svg/SVGInlineFlowBox.h:
382         * rendering/svg/SVGInlineTextBox.cpp:
383         * rendering/svg/SVGInlineTextBox.h:
384         * rendering/svg/SVGRootInlineBox.cpp:
385         * rendering/svg/SVGRootInlineBox.h:
386
387 2017-12-08  Chris Dumez  <cdumez@apple.com>
388
389         Clearing all Website Data should remove service worker registrations on disk
390         https://bugs.webkit.org/show_bug.cgi?id=180558
391
392         Reviewed by Youenn Fablet.
393
394         Clear service worker registrations on disk in addition to the ones in memory.
395
396         * workers/service/server/RegistrationDatabase.cpp:
397         (WebCore::v1RecordsTableSchema):
398         (WebCore::v1RecordsTableSchemaAlternate):
399         (WebCore::databaseFilename):
400         Make sure these always get called from the background thread since they use
401         a static string.
402
403         (WebCore::RegistrationDatabase::RegistrationDatabase):
404         Call importRecordsIfNecessary() instead of openSQLiteDatabase(). importRecordsIfNecessary()
405         only calls openSQLiteDatabase() if the database file exists, to avoid creating a database
406         file unnecessarily.
407
408         (WebCore::RegistrationDatabase::databasePath const):
409         New method which returns the database file path.
410
411         (WebCore::RegistrationDatabase::openSQLiteDatabase):
412
413         (WebCore::RegistrationDatabase::importRecordsIfNecessary):
414         New methods which imports records if the database file exist. It the database file does
415         not exist, it does not create it.
416
417         (WebCore::RegistrationDatabase::pushChanges):
418         Call completion handler when changes are pushed.
419
420         (WebCore::RegistrationDatabase::clearAll):
421         Close the database if it is open, then remove the database files.
422
423         (WebCore::RegistrationDatabase::doPushChanges):
424         If the database is not already open, we now open it when trying to write changes for
425         the first time.
426
427         * workers/service/server/RegistrationDatabase.h:
428         * workers/service/server/RegistrationStore.cpp:
429         (WebCore::RegistrationStore::clearAll):
430         (WebCore::RegistrationStore::flushChanges):
431         * workers/service/server/RegistrationStore.h:
432
433         * workers/service/server/SWServer.cpp:
434         (WebCore::SWServer::clearAll):
435         (WebCore::SWServer::clear):
436         Also clear the database.
437
438         * workers/service/server/SWServer.h:
439
440         * workers/service/server/SWServerWorker.cpp:
441         (WebCore::SWServerWorker::terminate):
442         Only call SWServer::terminateWorker() if the worker is running. Otherwise, we hit
443         an assertion when clearing a registration would worker was already terminated.
444
445 2017-12-08  Joseph Pecoraro  <pecoraro@apple.com>
446
447         ServiceWorker Inspector: Various issues inspecting service worker on mobile.twitter.com
448         https://bugs.webkit.org/show_bug.cgi?id=180520
449         <rdar://problem/35900764>
450
451         Reviewed by Brian Burg.
452
453         * inspector/agents/worker/ServiceWorkerAgent.cpp:
454         (WebCore::ServiceWorkerAgent::getInitializationInfo):
455         * inspector/agents/worker/ServiceWorkerAgent.h:
456         Add initial script content to initialization so we always at least have main resource content.
457
458 2017-12-08  Joseph Pecoraro  <pecoraro@apple.com>
459
460         ServiceWorker Inspector: Should be able to see image content from CacheStorage.add(url) network request
461         https://bugs.webkit.org/show_bug.cgi?id=180506
462
463         Reviewed by Brian Burg.
464
465         No test as this only happens inside a ServiceWorker inspector which
466         we don't yet have a way to test. In a Page Inspector, the
467         CacheStorage.add network request already behaves as expected.
468
469         * inspector/NetworkResourcesData.cpp:
470         (WebCore::NetworkResourcesData::responseReceived):
471         (WebCore::shouldBufferResourceData):
472         * inspector/NetworkResourcesData.h:
473         (WebCore::NetworkResourcesData::ResourceData::forceBufferData const):
474         (WebCore::NetworkResourcesData::ResourceData::setForceBufferData):
475         Provide a way to force buffering in NetworkResourceData.
476
477         * inspector/agents/InspectorNetworkAgent.cpp:
478         (WebCore::InspectorNetworkAgent::didReceiveResponse):
479         * inspector/agents/InspectorNetworkAgent.h:
480         * inspector/agents/page/PageNetworkAgent.h:
481         * inspector/agents/worker/WorkerNetworkAgent.h:
482         Enable force buffering in a Worker Network Agent.
483
484 2017-12-08  Daniel Bates  <dabates@apple.com>
485
486         Remove unnecessary prefix from AutoFillButtonType enumerators
487         https://bugs.webkit.org/show_bug.cgi?id=180512
488
489         Reviewed by Tim Horton.
490
491         * testing/Internals.cpp:
492         (WebCore::toAutoFillButtonType):
493         * testing/Internals.h:
494         * testing/Internals.idl:
495
496 2017-12-08  Dean Jackson  <dino@apple.com>
497
498         Implement transferToImageBitmap for WebGL offscreen canvas objects
499         https://bugs.webkit.org/show_bug.cgi?id=180603
500         <rdar://problem/34147143>
501
502         Reviewed by Sam Weinig.
503
504         Implement the basic version of creating an ImageBitmap from an
505         OffscreenCanvas that is using a WebGL context.
506
507         Tests: http/wpt/offscreen-canvas/transferToImageBitmap-empty.html
508                http/wpt/offscreen-canvas/transferToImageBitmap-webgl.html
509
510         * html/ImageBitmap.cpp:
511         (WebCore::ImageBitmap::create): Add a new constructor to be used by OffscreenCanvas.
512         Creates a blank ImageBitmap.
513         * html/ImageBitmap.h:
514
515         * html/OffscreenCanvas.cpp:
516         (WebCore::OffscreenCanvas::transferToImageBitmap): Create a new ImageBitmap
517         and paint the current canvas into it.
518
519 2017-12-08  Youenn Fablet  <youenn@apple.com>
520
521         WebServiceWorkerProvider should use Cancellation error to notify DTL that it cannot handle a fetch
522         https://bugs.webkit.org/show_bug.cgi?id=180584
523
524         Reviewed by Alex Christensen.
525
526         Previously, for each cross origin fetch that is going through a service worker and service worker is not handling the fetch,
527         we return an AccessControl error so that DocumentThreadableLoader will do preflight and regular load through the network.
528         This error is wrongly logged in the Inspector.
529         Change error type to Cancellation so that the Inspector does not log it.
530
531         * loader/DocumentThreadableLoader.cpp:
532         (WebCore::DocumentThreadableLoader::didFail):
533
534 2017-12-08  Youenn Fablet  <youenn@apple.com>
535
536         Service Worker should use a correct SessionID
537         https://bugs.webkit.org/show_bug.cgi?id=180585
538
539         Reviewed by Alex Christensen.
540
541         Test: http/tests/workers/service/serviceworker-private-browsing.https.html
542
543         Store SessionID in SWServer and send it as part of service worker instantiation.
544
545         * workers/service/server/SWServer.cpp:
546         (WebCore::SWServer::SWServer):
547         (WebCore::SWServer::installContextData):
548         (WebCore::SWServer::runServiceWorker):
549         * workers/service/server/SWServer.h:
550         * workers/service/server/SWServerToContextConnection.h:
551
552 2017-12-08  Youenn Fablet  <youenn@apple.com>
553
554         FetchResponse should keep unfiltered ResourceResponse so that it can be used in Service Worker
555         https://bugs.webkit.org/show_bug.cgi?id=179641
556         <rdar://problem/35923570>
557
558         Reviewed by Alex Christensen.
559
560         Covered by existing rebased tests.
561
562         FetchResponse will now store an unfiltered response.
563         If it needs to expose it to JavaScript, it will create a filtered response lazily.
564         This allows service worker to send back to web pages, opaque responses containing every information.
565
566         Updating Document::initSecurityContext so that any document loaded with a response whose tainting is Opaque gets a unique origin.
567         This ensures cross-origin checks to work if service worker returns such a response on a same origin URL.
568
569         Updated SubresourceLoader to check cross origin service worker responses based on their tainting.
570
571         * Modules/fetch/FetchResponse.cpp:
572         (WebCore::FetchResponse::create):
573         (WebCore::FetchResponse::error):
574         (WebCore::FetchResponse::redirect):
575         (WebCore::FetchResponse::FetchResponse):
576         (WebCore::FetchResponse::clone):
577         (WebCore::FetchResponse::url const):
578         (WebCore::FetchResponse::filteredResponse const):
579         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
580         (WebCore::FetchResponse::resourceResponse const):
581         * Modules/fetch/FetchResponse.h:
582         (WebCore::FetchResponse::create): Deleted.
583         * dom/Document.cpp:
584         (WebCore::Document::initSecurityContext):
585         * loader/SubresourceLoader.cpp:
586         (WebCore::SubresourceLoader::willSendRequestInternal):
587         (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
588
589 2017-12-08  David Quesada  <david_quesada@apple.com>
590
591         ApplicationManifestParser should strip whitespace from the raw input
592         https://bugs.webkit.org/show_bug.cgi?id=180539
593         rdar://problem/35915075
594
595         Reviewed by Joseph Pecoraro.
596
597         * Modules/applicationmanifest/ApplicationManifestParser.cpp:
598         (WebCore::ApplicationManifestParser::parseManifest):
599
600 2017-12-08  Eric Carlson  <eric.carlson@apple.com>
601
602         Move Logger from PAL to WTF so it can be used outside of WebCore
603         https://bugs.webkit.org/show_bug.cgi?id=180561
604
605         Reviewed by Alex Christensen.
606
607         No new tests, existing API test updated.
608
609         * Modules/mediastream/PeerConnectionBackend.h:
610         * Modules/mediastream/RTCPeerConnection.h:
611         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
612         (PAL::LogArgument<webrtc::RTCStats>::toString): Deleted.
613         * dom/Document.cpp:
614         * dom/Document.h:
615         * html/HTMLMediaElement.cpp:
616         (PAL::LogArgument<WebCore::URL>::toString): Deleted.
617         * html/HTMLMediaElement.h:
618         * html/HTMLMediaElementEnums.h:
619         (PAL::LogArgument<WebCore::HTMLMediaElementEnums::ReadyState>::toString): Deleted.
620         (PAL::LogArgument<WebCore::HTMLMediaElementEnums::NetworkState>::toString): Deleted.
621         * html/MediaElementSession.cpp:
622         (WebCore::MediaElementSession::logger const):
623         * html/MediaElementSession.h:
624         * html/track/DataCue.h:
625         (PAL::LogArgument<WebCore::DataCue>::toString): Deleted.
626         * html/track/TextTrackCue.h:
627         (PAL::LogArgument<WebCore::TextTrackCue>::toString): Deleted.
628         * html/track/TextTrackCueGeneric.h:
629         (PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString): Deleted.
630         * html/track/TrackBase.cpp:
631         (WebCore::nullLogger):
632         (WebCore::TrackBase::TrackBase):
633         * html/track/TrackBase.h:
634         * html/track/VTTCue.h:
635         (PAL::LogArgument<WebCore::VTTCue>::toString): Deleted.
636         * platform/graphics/InbandTextTrackPrivate.h:
637         * platform/graphics/InbandTextTrackPrivateClient.h:
638         (PAL::LogArgument<WebCore::GenericCueData>::toString): Deleted.
639         * platform/graphics/MediaPlayer.cpp:
640         (WebCore::nullLogger):
641         (WebCore::MediaPlayer::mediaPlayerLogger):
642         * platform/graphics/MediaPlayer.h:
643         (WTF::LogArgument<MediaTime>::toString):
644         (PAL::LogArgument<WTF::MediaTime>::toString): Deleted.
645         * platform/graphics/MediaPlayerEnums.h:
646         (PAL::LogArgument<WebCore::MediaPlayerEnums::ReadyState>::toString): Deleted.
647         (PAL::LogArgument<WebCore::MediaPlayerEnums::NetworkState>::toString): Deleted.
648         * platform/graphics/TrackPrivateBase.cpp:
649         (WebCore::TrackPrivateBase::setLogger):
650         * platform/graphics/TrackPrivateBase.h:
651         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
652         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
653         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
654         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
655         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
656         * platform/mediastream/RTCIceConnectionState.h:
657         (PAL::LogArgument<WebCore::RTCIceConnectionState>::toString): Deleted.
658         * platform/mediastream/RTCIceGatheringState.h:
659         (PAL::LogArgument<WebCore::RTCIceGatheringState>::toString): Deleted.
660         * platform/mediastream/RTCPeerConnectionState.h:
661         (PAL::LogArgument<WebCore::RTCPeerConnectionState>::toString): Deleted.
662         * platform/mediastream/RTCSignalingState.h:
663         (PAL::LogArgument<WebCore::RTCSignalingState>::toString): Deleted.
664         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
665
666 2017-12-08  Yusuke Suzuki  <utatane.tea@gmail.com>
667
668         Remove pthread_once in favor of dispatch_once
669         https://bugs.webkit.org/show_bug.cgi?id=180591
670
671         Reviewed by Saam Barati.
672
673         No behavior change.
674
675         * platform/mac/WebCoreNSURLExtras.mm:
676         (WebCore::allCharactersInIDNScriptWhiteList):
677         (WebCore::readIDNScriptWhiteList): Deleted.
678
679 2017-12-08  Chris Dumez  <cdumez@apple.com>
680
681         Improve error handling in RegistrationDatabase
682         https://bugs.webkit.org/show_bug.cgi?id=180587
683
684         Reviewed by Brady Eidson.
685
686         * workers/service/server/RegistrationDatabase.cpp:
687         (WebCore::RegistrationDatabase::openSQLiteDatabase):
688         (WebCore::RegistrationDatabase::doPushChanges):
689
690 2017-12-07  Darin Adler  <darin@apple.com>
691
692         Simplify and streamline some Color-related code to prepare for some Color/ExtendedColor work
693         https://bugs.webkit.org/show_bug.cgi?id=180569
694
695         Reviewed by Sam Weinig.
696
697         * accessibility/AccessibilityNodeObject.cpp:
698         (WebCore::AccessibilityNodeObject::colorValue const): Use valueAsColor instead of
699         having custom code here to parse the color string.
700
701         * css/CSSGradientValue.cpp:
702         (WebCore::interpolate): Deleted.
703         (WebCore::CSSGradientValue::computeStops): Call blend instead of interpolate. The only
704         difference is that the interpolate function truncated when converting from floating point
705         to integer, and the blend function rounds instead.
706
707         * css/StyleResolver.cpp:
708         (WebCore::StyleResolver::colorFromPrimitiveValue const): Removed unneeded special case
709         for identifier of 0, since StyleColor::colorFromKeyword already handles that correctly.
710         Also got rid of unneded local variable "state".
711
712         * html/ColorInputType.cpp:
713         (WebCore::isValidSimpleColor): Rewrote to take a StringView instead of a String and
714         to stay with a single loop since this does not need the extra efficiency of a separate
715         8-bit and 16-bit character version. Renamed to more closely match what the specification
716         calls this algorithm.
717         (WebCore::parseSimpleColorValue): Added. To be used instead of relying on the behavior of
718         the Color constructor that takes a String, so we can remove that later.
719         (WebCore::ColorInputType::sanitizeValue const): Updated for name change.
720         (WebCore::ColorInputType::valueAsColor const): Use parseSimpleColorValue instead of the
721         Color constructor that takes a string.
722         (WebCore::ColorInputType::typeMismatchFor const): Updated for name change.
723         (WebCore::ColorInputType::selectColor): Updated to take a StringView instead of a Color.
724         Note that this function is used for testing only.
725
726         * html/ColorInputType.h: Marked everything final instead of override. Updated the
727         selectColor function to take a StringView instead of a Color.
728
729         * html/HTMLInputElement.cpp:
730         (WebCore::HTMLInputElement::selectColor): Take a StringView instead of a Color.
731         * html/HTMLInputElement.h: Ditto.
732
733         * html/InputType.cpp:
734         (WebCore::InputType::selectColor): Take a StringView instead of a Color.
735         * html/InputType.h: Ditto.
736
737         * testing/Internals.cpp:
738         (WebCore::Internals::selectColorInColorChooser): Pass the string directly instead of
739         constructing a Color with it.
740         (WebCore::Internals::setViewBaseBackgroundColor): Instead of pasring the passed in string
741         with the Color constructor, implemented the two names that are actually used with this
742         function in tests: "transparent" and "white".
743
744 2017-12-08  Konstantin Tokarev  <annulen@yandex.ru>
745
746         Unreviewed, fix wrong letter case in #import HTMLIframeElement.h
747
748         * editing/cocoa/WebContentReaderCocoa.mm:
749
750 2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
751
752         Use WTF::RecursiveLockAdapter instead of using pthread_mutex_t with recursive lock option
753         https://bugs.webkit.org/show_bug.cgi?id=180449
754
755         Reviewed by Mark Lam.
756
757         Use WTF::RecursiveLockAdapter<StaticLock> instead. We can remove pthread_mutex_xxx,
758         pthread_once and FontLocker wrapper.
759
760         * platform/graphics/FontCache.cpp:
761         (WebCore::FontCache::getCachedFontPlatformData):
762         (WebCore::FontCache::fontForPlatformData):
763         (WebCore::FontCache::purgeInactiveFontData):
764         (WebCore::FontCache::inactiveFontCount):
765         (initFontCacheLockOnce): Deleted.
766         (FontLocker::FontLocker): Deleted.
767         (FontLocker::~FontLocker): Deleted.
768
769 2017-12-07  Eric Carlson  <eric.carlson@apple.com>
770
771         Simplify log channel configuration UI
772         https://bugs.webkit.org/show_bug.cgi?id=180527
773         <rdar://problem/35908382>
774
775         Reviewed by Joseph Pecoraro.
776
777         No new tests, updated existing test.
778
779         * inspector/agents/WebConsoleAgent.cpp:
780         (WebCore::WebConsoleAgent::getLoggingChannels):
781         (WebCore::channelConfigurationForString):
782
783 2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
784
785         Use StaticLock instead of NeverDestroyed<Lock>
786         https://bugs.webkit.org/show_bug.cgi?id=180507
787
788         Reviewed by Saam Barati.
789
790         StaticLock can be used instead of using NeverDestroyed<Lock>.
791
792         No behavior change.
793
794         * Modules/webdatabase/Database.cpp:
795         (WebCore::Database::performOpenAndVerify):
796         * Modules/webdatabase/DatabaseTracker.cpp:
797         (WebCore::DatabaseTracker::openDatabaseMutex):
798         (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled):
799         (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish):
800         (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
801         (WebCore::DatabaseTracker::scheduleForNotification):
802         (WebCore::DatabaseTracker::notifyDatabasesChanged):
803         (WebCore::notificationMutex): Deleted.
804         * Modules/webdatabase/DatabaseTracker.h:
805         * platform/URL.cpp:
806         (WebCore::registerDefaultPortForProtocolForTesting):
807         (WebCore::clearDefaultPortForProtocolMapForTesting):
808         (WebCore::defaultPortForProtocol):
809         (WebCore::defaultPortForProtocolMapForTestingLock): Deleted.
810         * platform/graphics/MediaPlayer.cpp:
811         (WebCore::buildMediaEnginesVector):
812         (WebCore::installedMediaEngines):
813         (WebCore::MediaPlayer::resetMediaEngines):
814         (WebCore::mediaEngineVectorLock): Deleted.
815         * platform/ios/QuickLook.mm:
816         (WebCore::removeQLPreviewConverterForURL):
817         (WebCore::addQLPreviewConverterWithFileForURL):
818         (WebCore::qlPreviewConverterDictionaryMutex): Deleted.
819         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
820         (+[WebDatabaseTransactionBackgroundTaskController startBackgroundTask]):
821         (+[WebDatabaseTransactionBackgroundTaskController endBackgroundTask]):
822         (transactionBackgroundTaskIdentifierLock): Deleted.
823         * platform/network/curl/CurlContext.cpp:
824         (WebCore::CurlShareHandle::lockCallback):
825         (WebCore::CurlShareHandle::unlockCallback):
826         (WebCore::CurlShareHandle::mutexFor):
827         * platform/network/curl/CurlContext.h:
828
829 2017-12-07  Brady Eidson  <beidson@apple.com>
830
831         Read registrations in from disk.
832         https://bugs.webkit.org/show_bug.cgi?id=180543
833
834         Reviewed by Andy Estes.
835
836         No new tests (Not testable quite yet)
837
838         On launch, read through the database.
839
840         Set up enough objects in the SWServer necessary to cause fetches and postMessages to
841         go to a worker that has never run before.
842
843         * workers/service/ServiceWorkerContextData.cpp:
844         (WebCore::ServiceWorkerContextData::isolatedCopy const):
845         * workers/service/ServiceWorkerContextData.h:
846         (WebCore::ServiceWorkerContextData::encode const):
847         (WebCore::ServiceWorkerContextData::decode):
848
849         * workers/service/ServiceWorkerRegistrationKey.cpp:
850         (WebCore::ServiceWorkerRegistrationKey::toDatabaseKey const):
851         (WebCore::ServiceWorkerRegistrationKey::fromDatabaseKey):
852         * workers/service/ServiceWorkerRegistrationKey.h:
853
854         * workers/service/server/RegistrationDatabase.cpp:
855         (WebCore::stringToUpdateViaCache):
856         (WebCore::stringToWorkerType):
857         (WebCore::RegistrationDatabase::doPushChanges):
858         (WebCore::RegistrationDatabase::importRecords):
859         (WebCore::RegistrationDatabase::addRegistrationToStore):
860         * workers/service/server/RegistrationDatabase.h:
861
862         * workers/service/server/RegistrationStore.cpp:
863         (WebCore::RegistrationStore::RegistrationStore):
864         (WebCore::RegistrationStore::addRegistrationFromDatabase):
865         * workers/service/server/RegistrationStore.h:
866
867         * workers/service/server/SWServer.cpp:
868         (WebCore::SWServer::addRegistrationFromStore):
869         (WebCore::SWServer::SWServer):
870         (WebCore::SWServer::updateWorker):
871         (WebCore::SWServer::tryInstallContextData):
872         (WebCore::SWServer::installContextData):
873         (WebCore::generateServiceWorkerIdentifier): Deleted.
874         * workers/service/server/SWServer.h:
875
876         * workers/service/server/SWServerRegistration.h:
877
878         * workers/service/server/SWServerWorker.cpp:
879         (WebCore::SWServerWorker::contextData const):
880
881 2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
882
883         Use WTF Locking primitives in WebThread and drop pthread_xxx use
884         https://bugs.webkit.org/show_bug.cgi?id=180445
885
886         Reviewed by Saam Barati.
887
888         We remove use of pthread locking primitives from WebThread implementation,
889         and use WTF Lock and Condition instead.
890
891         No behavior change.
892
893         * platform/ios/wak/WebCoreThread.mm:
894         (HandleDelegateSource):
895         (SendDelegateMessage):
896         (WebThreadRunOnMainThread):
897         (WebThreadAdoptAndRelease):
898         (WebCoreObjCDeallocOnWebThreadImpl):
899         (WebCoreObjCDeallocWithWebThreadLockImpl):
900         (HandleWebThreadReleaseSource):
901         (_WebThreadAutoLock):
902         (WebRunLoopLockInternal):
903         (CurrentThreadContext):
904         Use WTF::ThreadSpecific.
905
906         (StartWebThread):
907         (_WebThreadLock):
908         Remove `shouldTry` parameter since it is always `false`. We clean up code based on `shouldTry = false`,
909         and rename it from _WebTryThreadLock to _WebThreadLock since it does not try now.
910
911         (_WebThreadLockFromAnyThread):
912         (WebThreadUnlockFromAnyThread):
913         (_WebThreadUnlock):
914         (lockWebCoreReleaseLock): Deleted.
915         (unlockWebCoreReleaseLock): Deleted.
916         (WebTimedConditionLock): Deleted.
917         (_WebTryThreadLock): Deleted.
918
919 2017-12-07  Alex Christensen  <achristensen@webkit.org>
920
921         Fix API test after r225645.
922         https://bugs.webkit.org/show_bug.cgi?id=180544
923
924         * loader/FrameLoader.cpp:
925         (WebCore::FrameLoader::loadURL):
926         (WebCore::FrameLoader::loadWithDocumentLoader):
927         The API test WebKitLegacy.FragmentNavigation started failing after r225645.
928         It does call the completion handler with ignore to cancel fragment navigation.
929         To make this work and increase compatibility, only synchronously continue with
930         fragment navigations if we haven't received a synchronous answer to the
931         decidePolicyForNavigationAction callback.
932
933 2017-12-07  Oleksandr Skachkov  <gskachkov@gmail.com>
934
935         WebAssembly: sending module to iframe fails
936         https://bugs.webkit.org/show_bug.cgi?id=179263
937
938         Reviewed by JF Bastien.
939
940         Allow use WebAssembly.Module as input parameters for postMessage 
941         in window and iframe object.
942
943         Tests: wasm/iframe-postmessage.html
944                wasm/window-postmessage.html
945
946         * bindings/js/SerializedScriptValue.cpp:
947         (WebCore::CloneSerializer::dumpIfTerminal):
948         * bindings/js/SerializedScriptValue.h:
949         * page/DOMWindow.cpp:
950         (WebCore::DOMWindow::postMessage):
951
952 2017-12-07  Joseph Pecoraro  <pecoraro@apple.com>
953
954         Web Inspector: Fix style in remote inspector classes
955         https://bugs.webkit.org/show_bug.cgi?id=180545
956
957         Reviewed by Youenn Fablet.
958
959         * page/PageDebuggable.h:
960         * workers/service/context/ServiceWorkerDebuggable.h:
961
962 2017-12-07  Antti Koivisto  <antti@apple.com>
963
964         Move security origin filtering for getMatchedCSSRules out of StyleResolver
965         https://bugs.webkit.org/show_bug.cgi?id=180468
966
967         Reviewed by Zalan Bujtas.
968
969         The non-standard getMatchedCSSRules API should not return rules from stylesheets in different security origins.
970         To implement this we currently have lots of invasive code in StyleResolver, RuleSets and ElementRuleCollector
971         basically passing around a bit. This also makes RuleSets document specific blocking optimizations.
972
973         This patches replaces the mechanism with a bit in StyleRule which is much simpler.
974
975         * css/DocumentRuleSets.cpp:
976         (WebCore::makeRuleSet):
977         * css/ElementRuleCollector.cpp:
978         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
979         * css/ElementRuleCollector.h:
980         (WebCore::ElementRuleCollector::setPseudoStyleRequest):
981         (WebCore::ElementRuleCollector::setSameOriginOnly): Deleted.
982         * css/RuleFeature.cpp:
983         (WebCore::RuleFeatureSet::collectFeatures):
984         * css/RuleFeature.h:
985         (WebCore::RuleFeature::RuleFeature):
986         * css/RuleSet.cpp:
987         (WebCore::RuleData::RuleData):
988         (WebCore::RuleSet::addRule):
989         (WebCore::RuleSet::addChildRules):
990         (WebCore::RuleSet::addRulesFromSheet):
991         (WebCore::RuleSet::addStyleRule):
992         * css/RuleSet.h:
993         (WebCore::RuleData::linkMatchType const):
994         (WebCore::RuleData::hasDocumentSecurityOrigin const): Deleted.
995         * css/StyleResolver.cpp:
996         (WebCore::StyleResolver::pseudoStyleRulesForElement):
997         * css/StyleResolver.h:
998         * css/StyleRule.cpp:
999         (WebCore::StyleRule::StyleRule):
1000         (WebCore::StyleRule::createForSplitting):
1001         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount const):
1002         (WebCore::StyleRule::create): Deleted.
1003         * css/StyleRule.h:
1004         (WebCore::StyleRuleBase::StyleRuleBase):
1005         (WebCore::StyleRuleBase::hasDocumentSecurityOrigin const):
1006
1007             Add a bit.
1008
1009         * css/parser/CSSParser.cpp:
1010         (WebCore::CSSParserContext::CSSParserContext):
1011
1012             Include hasDocumentSecurityOrigin bit to parser context. This means that a stylesheet data structures
1013             can't be shared between a contexts where this differs. This likely very rare in practice.
1014
1015         (WebCore::operator==):
1016         * css/parser/CSSParserImpl.cpp:
1017         (WebCore::CSSParserImpl::consumeStyleRule):
1018         * css/parser/CSSParserMode.h:
1019         (WebCore::CSSParserContextHash::hash):
1020         * editing/EditingStyle.cpp:
1021         (WebCore::EditingStyle::mergeStyleFromRules):
1022         * page/DOMWindow.cpp:
1023         (WebCore::DOMWindow::getMatchedCSSRules const):
1024
1025             Filter out rules from different security origin after getting them from style resolver.
1026
1027 2017-12-07  Zalan Bujtas  <zalan@apple.com>
1028
1029         AX: Document::existingAXObjectCache() should always return the existing AXObjectCache.
1030         https://bugs.webkit.org/show_bug.cgi?id=180548
1031         <rdar://problem/35917755>
1032
1033         Reviewed by Chris Fleizach.
1034
1035         Currently the AX cache becomes unreachable through Document::existingAXObjectCache soon after the render tree is destroyed.
1036         From this point, the Node objects can't deregister themselves from the AX cache anymore. In some cases, it's
1037         redundant/not advised to notify the cache about certain changes when the document is being destroyed, but the
1038         callsites should make that decision.
1039
1040         Covered by existing tests.
1041
1042         * dom/Document.cpp:
1043         (WebCore::Document::existingAXObjectCacheSlow const):
1044         * rendering/RenderElement.cpp:
1045         (WebCore::RenderElement::takeChildInternal):
1046
1047 2017-12-07  Youenn Fablet  <youenn@apple.com>
1048
1049         Fix erroneous ASSERT in DocumentThreadableLoader::didFail
1050         https://bugs.webkit.org/show_bug.cgi?id=180549
1051
1052         Reviewed by Alex Christensen.
1053
1054         * loader/DocumentThreadableLoader.cpp:
1055         (WebCore::DocumentThreadableLoader::didFail): ASSERT was checking whether the optional was null.
1056         This could never be the case since we move the value of the optional, not the optional itself.
1057         Ensure that the optional value is null so that we are sure request is being loaded and make the optional null just after that.
1058
1059 2017-12-07  Ryosuke Niwa  <rniwa@webkit.org>
1060
1061         iOS: Many AMP pages crash inside Document::updateStyleIfNeeded
1062         https://bugs.webkit.org/show_bug.cgi?id=180550
1063         <rdar://problem/35410390>
1064
1065         Reviewed by Zalan Bujtas.
1066
1067         The crash was caused when updatign the layout of an non-flattened frame inside a flattened frame.
1068         In those cases, isInChildFrameWithFrameFlattening is false on the inner frame.
1069
1070         No new tests for now.
1071
1072         * dom/NoEventDispatchAssertion.h:
1073         * rendering/RenderFrameBase.cpp:
1074         (WebCore::RenderFrameBase::performLayoutWithFlattening): Disable the assertion temporarily here.
1075         In theory, we should be able to remove the check for isInChildFrameWithFrameFlattening but we err
1076         on the safer side for now.
1077
1078 2017-12-07  Alex Christensen  <achristensen@webkit.org>
1079
1080         Always synchronously continue with fragment navigations
1081         https://bugs.webkit.org/show_bug.cgi?id=180544
1082         <rdar://problem/34815986> and <rdar://problem/35126690>
1083
1084         Reviewed by Geoffrey Garen.
1085
1086         Test: http/tests/dom/document-fragment.html
1087
1088         When a decidePolicyForNavigationAction completionHandler is called asynchronously,
1089         the document's URL has not changed yet when JavaScript execution continues.  This causes
1090         significant web incompatibility because all browsers change the document's URL immediately
1091         during fragment navigations.  In order to make WebKit applications more web compatible,
1092         we now immediately continue to have the state consistent.  To keep compatibility with any
1093         WebView, UIWebView, or WKWebView applications that use these delegate callbacks to update
1094         state, we still call decidePolicyForNavigationAction.  This would break a theoretical app
1095         that would cancel fragment navigations, but it fixes apps that continue fragment navigations
1096         asynchronously.
1097
1098         * loader/FrameLoader.cpp:
1099         (WebCore::FrameLoader::loadURL):
1100         (WebCore::FrameLoader::loadWithDocumentLoader):
1101
1102 2017-12-07  Youenn Fablet  <youenn@apple.com>
1103
1104         Activate IDB and WebSockets in service workers
1105         https://bugs.webkit.org/show_bug.cgi?id=180534
1106
1107         Reviewed by Brady Eidson.
1108
1109         Tests: http/tests/workers/service/serviceworker-idb.https.html
1110                http/tests/workers/service/serviceworker-websocket.https.html
1111
1112         Using the dummy document used for loading to also fuel IDB and WebSocket.
1113
1114         * workers/service/context/ServiceWorkerThread.cpp:
1115         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1116         * workers/service/context/ServiceWorkerThread.h:
1117         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1118         (WebCore::idbConnectionProxy):
1119         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1120
1121 2017-12-07  Matt Lewis  <jlewis3@apple.com>
1122
1123         Unreviewed, rolling out r225634.
1124
1125         This caused layout tests to time out.
1126
1127         Reverted changeset:
1128
1129         "Simplify log channel configuration UI"
1130         https://bugs.webkit.org/show_bug.cgi?id=180527
1131         https://trac.webkit.org/changeset/225634
1132
1133 2017-12-07  Jer Noble  <jer.noble@apple.com>
1134
1135         [EME] Support the 'encrypted' event for FPS encrypted streams
1136         https://bugs.webkit.org/show_bug.cgi?id=180480
1137
1138         Reviewed by Eric Carlson.
1139
1140         Test: platform/mac/media/encrypted-media/fps-encrypted-event.html
1141
1142         Pass initData and initDataType up to HTMLMediaElement from SourceBufferPrivateAVFObjC.
1143
1144         Drive-by fix: initialize the initData and initDataType values of MediaEncryptedEvent from
1145         values in its initializer struct.
1146
1147         * html/HTMLMediaElement.cpp:
1148         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
1149         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
1150         * html/MediaEncryptedEvent.cpp:
1151         (WebCore::MediaEncryptedEvent::MediaEncryptedEvent):
1152         (WebCore::MediaEncryptedEvent::initDataType): Deleted.
1153         (WebCore::MediaEncryptedEvent::initData): Deleted.
1154         * html/MediaEncryptedEvent.h:
1155         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1156         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1157         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
1158         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1159         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1160
1161 2017-12-07  Myles C. Maxfield  <mmaxfield@apple.com>
1162
1163         [Cocoa] Add SPI to disallow user-installed fonts
1164         https://bugs.webkit.org/show_bug.cgi?id=180062
1165         <rdar://problem/35042408>
1166
1167         Reviewed by Simon Fraser.
1168
1169         This hooks up a WK2 preference, ShouldDisallowUserInstalledFonts, to our font selection
1170         code. This preference works by specifying an attribute to our font selection code which
1171         will prohibit user-installed fonts from ever being selected. This works both to disallow
1172         newly installed fonts, as well as disallowing user-installed fonts which "shadow" (or
1173         have the same name as) existing fonts, so that the existing font is selected instead.
1174
1175         The goal of this setting is to decrease the fingerprinting surface area which trackers
1176         can use to identify users on the open Web.
1177
1178         Tests: fast/text/user-installed-font.html
1179                fast/text/user-installed-fonts/disable.html
1180                fast/text/user-installed-fonts/shadow-disable.html
1181                fast/text/user-installed-fonts/shadow-family-disable.html
1182                fast/text/user-installed-fonts/shadow-family.html
1183                fast/text/user-installed-fonts/shadow-postscript-disable.html
1184                fast/text/user-installed-fonts/shadow-postscript-family-disable.html
1185                fast/text/user-installed-fonts/shadow-postscript-family.html
1186                fast/text/user-installed-fonts/shadow-postscript.html
1187                fast/text/user-installed-fonts/shadow.html
1188
1189         * css/CSSFontFaceSet.cpp:
1190         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
1191         * css/StyleResolver.cpp:
1192         (WebCore::StyleResolver::initializeFontStyle):
1193         * page/Settings.yaml:
1194         * platform/graphics/FontCache.h:
1195         * platform/graphics/FontDescription.cpp:
1196         (WebCore::FontDescription::FontDescription):
1197         * platform/graphics/FontDescription.h:
1198         (WebCore::FontDescription::mayRepresentUserInstalledFont const):
1199         (WebCore::FontDescription::setMayRepresentUserInstalledFont):
1200         (WebCore::FontDescription::operator== const):
1201         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1202         (WebCore::FontDatabase::singleton):
1203         (WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
1204         (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
1205         (WebCore::FontDatabase::collectionForFamily):
1206         (WebCore::FontDatabase::fontForPostScriptName):
1207         (WebCore::FontDatabase::FontDatabase):
1208         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
1209         (WebCore::platformFontLookupWithFamily):
1210         (WebCore::invalidateFontCache):
1211         (WebCore::fontWithFamily):
1212         * style/StyleResolveForDocument.cpp:
1213         (WebCore::Style::resolveForDocument):
1214         * testing/InternalSettings.cpp:
1215         (WebCore::InternalSettings::setShouldDisallowUserInstalledFonts):
1216         * testing/InternalSettings.h:
1217         * testing/InternalSettings.idl:
1218
1219 2017-12-07  David Quesada  <david_quesada@apple.com>
1220
1221         [Web App Manifest] Support display-mode media feature
1222         https://bugs.webkit.org/show_bug.cgi?id=180376
1223         rdar://problem/35837993
1224
1225         Reviewed by Geoffrey Garen.
1226
1227         Tests: applicationmanifest/display-mode-subframe.html
1228                applicationmanifest/display-mode.html
1229
1230         * Modules/applicationmanifest/ApplicationManifest.h:
1231         (WebCore::ApplicationManifest::encode const):
1232         (WebCore::ApplicationManifest::decode):
1233         * Modules/applicationmanifest/ApplicationManifestParser.cpp:
1234         (WebCore::ApplicationManifestParser::parseManifest):
1235         (WebCore::ApplicationManifestParser::parseDisplay):
1236         * Modules/applicationmanifest/ApplicationManifestParser.h:
1237             Add a 'display' property to ApplicationManifest and have ApplicationManifestParser
1238             populate it by parsing the 'display' property from the raw manifest.
1239
1240         * css/CSSValueKeywords.in:
1241         * css/MediaFeatureNames.h:
1242         * css/MediaQueryEvaluator.cpp:
1243         (WebCore::displayModeEvaluate):
1244             To evaluate whether a display-mode query matches, compare the parameter to the
1245             display mode of the manifest applied to the main frame. If there is no manifest,
1246             use the fallback display mode 'browser' - the spec mandates that display-mode
1247             must be exposed even if there is no applied manifest.
1248         * css/MediaQueryExpression.cpp:
1249         (WebCore::featureWithValidIdent):
1250         (WebCore::isFeatureValidWithoutValue):
1251
1252 2017-12-07  Jer Noble  <jer.noble@apple.com>
1253
1254         Creating a second AVPlayerItemVideoOutput causes flakey failures
1255         https://bugs.webkit.org/show_bug.cgi?id=177119
1256         <rdar://problem/34507977>
1257
1258         Reviewed by Dean Jackson.
1259
1260         Rather than having two concurrent AVPlayerItemVideoOutputs when painting to OpenGL,
1261         use only one, but with the OpenGL compatibility flags enabled, for both 3D and 2D
1262         canvas painting.
1263
1264         Of course, once this is fixed, the test breaks again because VideoTextureCopierCV is
1265         stomping on top of some WebGL state set by the test. Rather than expand the
1266         VideoTextureCopierCV's GraphicsStateSaver, use a totally separate (but shared) GL context to
1267         implement the texture copy, so that its own state will not affect the state of the WebGL
1268         context.
1269
1270         This necessitates adding a new createShared() factory for GraphicsContext3D. Since this is only
1271         used on Cocoa platforms (for now), make it platform specific, and modify the other implementations
1272         only so far as to throw assertions if somehow a shared context pointer is passed into their
1273         constructors.
1274
1275         Drive-by fixes: 
1276
1277         - These changes exposed some test failures, which were off-by-1-or-2 errors in the color
1278         output of videos painted into WebGL contexts. The Y' parameter needs to be scaled by 16/255
1279         for video-range conversions and the CbCr vales by 128/255 (rather than just 0.5). Make the
1280         color transforms a full 4x4 matrix and do the scaling in the matrix rather than tracked by a
1281         separate uniform.
1282
1283         - There was a slight error in WebCoreDecompressionSession that could cause seeks to never
1284         complete because incoming frames would be skipped if their startTime was in the past
1285         (rather than their startTime + duration being in the past).
1286
1287         - The matrix name comparison should use CFEqual rather than pointer equality to test.
1288
1289         - iOS currently has a bug where the red and green color channels will be reversed when
1290         uploading BGRA pixel formatted data to a texture; work around this bug for now.
1291
1292         * platform/graphics/GraphicsContext3D.h:
1293         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1294         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1295         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer):
1296         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame const):
1297         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
1298         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoOutputHasAvailableFrame):
1299         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
1300         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1301         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture):
1302         (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
1303         (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
1304         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1305         (WebCore::GraphicsContext3D::GraphicsContext3D):
1306         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1307         (WebCore::GraphicsContext3D::createShared):
1308         (WebCore::GraphicsContext3D::GraphicsContext3D):
1309         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1310         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV):
1311         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
1312         (WebCore::transferFunctionFromString):
1313         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
1314         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
1315         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
1316         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
1317         * platform/graphics/cv/VideoTextureCopierCV.h:
1318         (WebCore::VideoTextureCopierCV::context):
1319         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1320         (WebCore::GraphicsContext3D::GraphicsContext3D):
1321
1322 2017-12-07  Jer Noble  <jer.noble@apple.com>
1323
1324         [EME] Support generateRequest() in CDMFairPlayStreaming
1325         https://bugs.webkit.org/show_bug.cgi?id=179752
1326
1327         Reviewed by Eric Carlson.
1328
1329         Tests: platform/mac/media/encrypted-media/fps-createSession.html
1330                platform/mac/media/encrypted-media/fps-generateRequest.html
1331
1332         Add support for generating license requests from initialization data in
1333         CDMFairPlayStreaming. To do so, add explicit checks for FairPlay Steraming requirements:
1334         reqests will fail if no server certificate exists, and will fail if no content key id exists
1335         in the initialization data.
1336
1337         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
1338         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf):
1339         (WebCore::CDMPrivateFairPlayStreaming::sanitizeSinf):
1340         (WebCore::CDMFactory::platformRegisterFactories):
1341         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
1342         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1343         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense):
1344         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
1345
1346 2017-12-07  Jer Noble  <jer.noble@apple.com>
1347
1348         [EME] Possible deadlock when aborting a SourceBufferPrivateAVFObjC append operation
1349         https://bugs.webkit.org/show_bug.cgi?id=180486
1350
1351         Reviewed by Eric Carlson.
1352
1353         It's possible that an abort() operation which is blocked on the ongoing appendBuffer()
1354         operation completing will deadlock forever, with either the willProvideContentKeyRequest
1355         or didProvideContentKeyRequest callbacks blocking waiting to be run on the main thread
1356         (which is itself blocked waiting for the append operation to complete).
1357
1358         To break this deadlock, add a new abortSemaphore which is signaled in the abort() method
1359         and have the willProvide... and didProvide... methods block both on their own semaphores
1360         as well as the abortSemaphore, allowing them to break out even if their main thread calls
1361         never get a chance to execute.
1362
1363         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1364         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
1365         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
1366         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1367         (WebCore::SourceBufferPrivateAVFObjC::abort):
1368
1369 2017-12-07  Eric Carlson  <eric.carlson@apple.com>
1370
1371         Simplify log channel configuration UI
1372         https://bugs.webkit.org/show_bug.cgi?id=180527
1373         <rdar://problem/35908382>
1374
1375         Reviewed by Joseph Pecoraro.
1376
1377         No new tests -- no change in functionality.
1378
1379         * inspector/agents/WebConsoleAgent.cpp:
1380         (WebCore::WebConsoleAgent::getLoggingChannels):
1381         (WebCore::channelConfigurationForString):
1382
1383 2017-12-07  Joseph Pecoraro  <pecoraro@apple.com>
1384
1385         ServiceWorker Inspector: Use the SW's scope url for the remote inspection target metadata
1386         https://bugs.webkit.org/show_bug.cgi?id=180519
1387
1388         Reviewed by Youenn Fablet.
1389
1390         * workers/service/context/ServiceWorkerDebuggable.cpp:
1391         (WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable):
1392         * workers/service/context/ServiceWorkerDebuggable.h:
1393         Switch to the scope URL for the remote inspector target info.
1394
1395 2017-12-07  Per Arne Vollan  <pvollan@apple.com>
1396
1397         Unreviewed Windows build fix.
1398
1399         * PlatformWin.cmake:
1400
1401 2017-12-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1402
1403         [WPE][GTK] Freeze WebKit version in user agent
1404         https://bugs.webkit.org/show_bug.cgi?id=180475
1405
1406         Reviewed by Carlos Garcia Campos.
1407
1408         Apple has frozen the WebKit version in its user agent, so we should too, at the same point.
1409
1410         * platform/glib/UserAgentGLib.cpp:
1411         (WebCore::versionForUAString):
1412
1413 2017-12-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1414
1415         [WPE][GTK] Update user agent quirk version strings
1416         https://bugs.webkit.org/show_bug.cgi?id=180474
1417
1418         Reviewed by Carlos Garcia Campos.
1419
1420         * platform/UserAgentQuirks.cpp:
1421         (WebCore::UserAgentQuirks::stringForQuirk):
1422         * platform/glib/UserAgentGLib.cpp:
1423         (WebCore::platformVersionForUAString):
1424
1425 2017-12-06  Chris Dumez  <cdumez@apple.com>
1426
1427         We should be able to recover after a Service Worker process crash
1428         https://bugs.webkit.org/show_bug.cgi?id=180477
1429
1430         Reviewed by Brady Eidson and Youenn Fablet.
1431
1432         Test: http/tests/workers/service/postmessage-after-sw-process-crash.https.html
1433
1434         * workers/service/server/SWServer.cpp:
1435         (WebCore::SWServer::serverToContextConnectionCreated):
1436         Once the connection with the context process is established, process "run service worker"
1437         requests that ocurred while establishing the connection.
1438
1439         (WebCore::SWServer::runServiceWorkerIfNecessary):
1440         Take in a lambda function that gets called after the "run service worker" request
1441         is processed. We used to assert that we had a connection to the context process.
1442         We now wait for the connection to be established to process the request, thus
1443         making the operation asynchronous.
1444
1445         (WebCore::SWServer::runServiceWorker):
1446         Split some logic out of runServiceWorkerIfNecessary() to reuse in serverToContextConnectionCreated().
1447
1448         (WebCore::SWServer::markAllWorkersAsTerminated):
1449         Add method to mark all service workers as terminated. This is called when the Service
1450         Worker process crashes.
1451
1452         * workers/service/server/SWServer.h:
1453
1454 2017-12-06  Saam Barati  <sbarati@apple.com>
1455
1456         Unreviewed. Fix iOS (and maybe other platform) build
1457
1458         * workers/service/server/RegistrationDatabase.cpp:
1459         (WebCore::RegistrationDatabase::openSQLiteDatabase):
1460
1461 2017-12-02  Darin Adler  <darin@apple.com>
1462
1463         Modernize some aspects of text codecs, eliminate WebKit use of strcasecmp
1464         https://bugs.webkit.org/show_bug.cgi?id=180009
1465
1466         Reviewed by Alex Christensen.
1467
1468         * Modules/fetch/FetchBody.cpp:
1469         (WebCore::FetchBody::consumeAsStream): Update to use size since the result of
1470         encode is now Vector rather than CString. And for the new UnencodableHandling.
1471         (WebCore::FetchBody::consumeText): Removed now-unneeded type cast. Ditto.
1472         (WebCore::FetchBody::bodyAsFormData const): Ditto.
1473         (WebCore::FetchBody::take): Pass result of encode directly to SharedBuffer::create.
1474
1475         * Modules/websockets/WebSocketDeflater.cpp: Removed include of StringExtras.h.
1476         * bridge/IdentifierRep.h: Ditto.
1477         * bridge/c/c_instance.cpp: Ditto.
1478
1479         * fileapi/BlobBuilder.cpp:
1480         (WebCore::BlobBuilder::append): Updated for CString to Vector change and
1481         for UnencodableHandling.
1482
1483         * html/parser/HTMLMetaCharsetParser.cpp:
1484         (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Call the decode function
1485         with all the arguments since there is only one decode function now.
1486
1487         * inspector/agents/InspectorDOMAgent.cpp:
1488         (WebCore::computeContentSecurityPolicySHA256Hash): Updated for CString to Vector
1489         change and for UnencodableHandling.
1490
1491         * loader/ResourceCryptographicDigest.cpp:
1492         (WebCore::cryptographicDigestForBytes): Changed argument type to const void*.
1493         * loader/ResourceCryptographicDigest.h: Ditto.
1494
1495         * loader/TextResourceDecoder.cpp:
1496         (WebCore::TextResourceDecoder::TextResourceDecoder): Moved initialization of data
1497         members to class definition.
1498         (WebCore::TextResourceDecoder::create): Moved function body here from the header.
1499         (WebCore::TextResourceDecoder::setEncoding): Use equalLettersIgnoringASCIICase.
1500         (WebCore::TextResourceDecoder::shouldAutoDetect const): Updated for name change
1501         to m_parentFrameAutoDetectedEncoding, which obviates a comment.
1502         (WebCore::TextResourceDecoder::flush): Ditto.
1503         * loader/TextResourceDecoder.h: Moved initialization here from constructor.
1504         Moved function bodies out of the class. Renamed m_hintEncoding to
1505         m_parentFrameAutoDetectedEncoding since that is a more accurate description.
1506
1507         * loader/appcache/ApplicationCacheStorage.cpp: Removed include of StringExtras.h.
1508         * page/FrameTree.cpp: Ditto.
1509         * page/PageSerializer.cpp: Ditto.
1510         (WebCore::PageSerializer::serializeFrame): Pass result of encode directly to
1511         StringBuffer::create and update for UnencodableHandling.
1512         (WebCore::PageSerializer::serializeCSSStyleSheet): Ditto.
1513         * page/csp/ContentSecurityPolicy.cpp:
1514         (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies const): Ditto.
1515
1516         * platform/FileHandle.cpp: Removed include of StringExtras.h.
1517
1518         * platform/SharedBuffer.cpp:
1519         (WebCore::SharedBuffer::create): Added an overload that takes Vector<uint8_t>.
1520         * platform/SharedBuffer.h: Ditto.
1521
1522         * platform/URLParser.cpp:
1523         (WebCore::URLParser::encodeQuery): Updated since encode returns a Vector instead
1524         of a CString now and for UnencodableHandling.
1525         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1526         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): Ditto.
1527
1528         * platform/graphics/ca/PlatformCALayer.cpp: Removed include of StringExtras.h.
1529
1530         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1531         (WebCore::ResourceHandleCurlDelegate::handleDataURL): Updated for Vector instead
1532         of CString.
1533
1534         * platform/network/FormData.cpp:
1535         (WebCore::FormData::create): Added new overload, and simplified some existing ones.
1536         (WebCore::normalizeStringData): Changed return type to Vector<uint8_t> and updated
1537         for UnencodableHandling.
1538         (WebCore::FormData::appendMultiPartStringValue): Updated for change in type of
1539         result of normalizeStringData.
1540         * platform/network/FormData.h: Updated for the above and updated comments.
1541
1542         * platform/network/FormDataBuilder.cpp: Made this a namespace instead of a class.
1543         (WebCore::FormDataBuilder::append): Added an overload for Vector<uint8_t>.
1544         (WebCore::FormDataBuilder::appendQuoted): Renamed from appendQuotedString and
1545         changed the argument type.
1546         (WebCore::FormDataBuilder::appendFormURLEncoded): Moved logic up from the
1547         encodeStringAsFormData function into a new separate helper.
1548         (WebCore::FormDataBuilder::addFilenameToMultiPartHeader): Updated for change to
1549         UnencodableHandling.
1550         (WebCore::FormDataBuilder::beginMultiPartHeader): Changed argument type.
1551         (WebCore::FormDataBuilder::addKeyValuePairAsFormData): Ditto.
1552         (WebCore::FormDataBuilder::encodeStringAsFormData): Updated to call helper.
1553         * platform/network/FormDataBuilder.h: Updated for the above.
1554
1555         * platform/text/DecodeEscapeSequences.h: Use Vector<uint8_t> instead of
1556         Vector<char>, also updated the code that calls encode for the new return type
1557         and updated for change to UnencodableHandler.
1558
1559         * platform/text/TextCodec.cpp:
1560         (WebCore::TextCodec::getUnencodableReplacement): Updated since we are using
1561         std::array now, so the out argument is easier to understand, also updated for
1562         change to UnencodablaHandler.
1563         * platform/text/TextCodec.h: Use std::array for the UnencodableReplacementArray
1564         type, removed the overload of decode so there is only one decode function.
1565
1566         * platform/text/TextCodecICU.cpp:
1567         (WebCore::ICUConverterWrapper::~ICUConverterWrapper): Deleted.
1568         Not needed any more since we use ICUConverterPtr instead now.
1569         (WebCore::cachedConverterICU): Deleted.
1570         (WebCore::TextCodecICU::create): Deleted. Callers just use make_unique
1571         directly now.
1572         (WebCore::TextCodecICU::registerCodecs): Rewrote to use lambdas instead
1573         of functions with void* pointers.
1574         (WebCore::TextCodecICU::TextCodecICU): Moved initializers into the header.
1575         (WebCore::TextCodecICU::~TextCodecICU): Moved the body of releaseICUConverter
1576         in here. Also greatly simplified it now that ICUConverterPtr handles closing
1577         it as needed.
1578         (WebCore::TextCodecICU::releaseICUConverter const): Deleted.
1579         (WebCore::TextCodecICU::createICUConverter const): Rewrote to simplfy now that
1580         we can use ICUConverterPtr.
1581         (WebCore::ErrorCallbackSetter::ErrorCallbackSetter): Take a reference instead
1582         of a pointer.
1583         (WebCore::ErrorCallbackSetter::~ErrorCallbackSetter): Ditto.
1584         (WebCore::TextCodecICU::decode): Use equalLettersIgnoringASCIICase instead of
1585         strcasecmp.
1586         (WebCore::TextCodecICU::encode): Return a Vector instead of a CString.
1587         Take a StringView instead of a pointer and length. Simplified
1588         the backslash-as-currency-symbol code by using String::replace.
1589         * platform/text/TextCodecICU.h: Updated for above. Fixed indentation.
1590         Added a new ICUConverterPtr typedef that uses std::unique_ptr to close the
1591         converter; combined with move semantics it simplifies things so we don't have
1592         to be so careful about calling ucnv_close.
1593
1594         * platform/text/TextCodecLatin1.cpp: Renamed the Latin-1 to Unicode table from
1595         "table" to latin1ConversionTable.
1596         (WebCore::TextCodecLatin1::registerCodecs): Use a lambda.
1597         (WebCore::encodeComplexWindowsLatin1): Return a Vector instad of CString.
1598         Also use StringView::codePoints instead of our own U16_NEXT.
1599         (WebCore::TextCodecLatin1::encode): More of the same.
1600         * platform/text/TextCodecLatin1.h: Updated for the above.
1601
1602         * platform/text/TextCodecReplacement.cpp:
1603         (WebCore::TextCodecReplacement::create): Deleted.
1604         (WebCore::TextCodecReplacement::TextCodecReplacement): Deleted.
1605         (WebCore::TextCodecReplacement::registerCodecs): Use a lambda.
1606         * platform/text/TextCodecReplacement.h: Updated for the above.
1607
1608         * platform/text/TextCodecUTF16.cpp:
1609         (WebCore::newStreamingTextDecoderUTF16LE): Deleted.
1610         (WebCore::newStreamingTextDecoderUTF16BE): Deleted.
1611         (WebCore::TextCodecUTF16::registerCodecs): Use lambdas.
1612         (WebCore::TextCodecUTF16::encode): Return a Vector.
1613         * platform/text/TextCodecUTF16.h: Updated for the above.
1614
1615         * platform/text/TextCodecUTF8.cpp:
1616         (WebCore::TextCodecUTF8::registerCodecs): Use a lambda.
1617         (WebCore::TextCodecUTF8::encode): Return a Vector.
1618         * platform/text/TextCodecUTF8.h: Updated for the above.
1619
1620         * platform/text/TextCodecUserDefined.cpp:
1621         (WebCore::newStreamingTextDecoderUserDefined): Deleted.
1622         (WebCore::TextCodecUserDefined::registerCodecs): Use a lambda.
1623         (WebCore::encodeComplexUserDefined): Return a Vector.
1624         (WebCore::TextCodecUserDefined::encode): Ditto.
1625         * platform/text/TextCodecUserDefined.h: Updated for the above.
1626
1627         * platform/text/TextEncoding.cpp: Changed TextCodecMap to just hold a
1628         WTF::Function instead of holding a function and an additional data pointer.
1629         (WebCore::TextEncoding::TextEncoding): Use equalLettersIgnoringASCIICase
1630         instead of a special isReplacementEncoding function.
1631         (WebCore::TextEncoding::encode const): Return a Vector instead of a CString.
1632         Pass StringView instead of a pointer and length.
1633         * platform/text/TextEncoding.h: Updated for the above.
1634
1635         * platform/text/TextEncodingRegistry.cpp:
1636         (WebCore::addToTextCodecMap): Removed the additionalData pointer and used
1637         WTFMove since NewTextCodecFunction is now a WTF::Function rather than a C
1638         function pointer.
1639         (WebCore::isReplacementEncoding): Deleted.
1640         (WebCore::newTextCodec): Use find instead of get now that the fucntions in
1641         the map are WTF::Function and can't be copied.
1642         (WebCore::dumpTextEncodingNameMap): Deleted.
1643         * platform/text/TextEncodingRegistry.h: Updated for the above.
1644
1645         * platform/text/win/TextCodecWin.cpp:
1646         (WebCore::TextCodecWin::encode): Updated comment.
1647
1648         * xml/XMLHttpRequest.cpp:
1649         (WebCore::XMLHttpRequest::send): Updated for change to UnencodableHandling.
1650
1651         * xml/XSLTUnicodeSort.cpp: Removed include of StringExtras.h.
1652         * xml/parser/XMLDocumentParser.cpp: Ditto.
1653         * xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.
1654
1655 2017-12-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1656
1657         Support the decoding="sync/async" syntax for image async attribute
1658         https://bugs.webkit.org/show_bug.cgi?id=179432
1659
1660         Reviewed by Darin Adler.
1661
1662         Support the HTMLElementImage decoding attribute to allow controlling the
1663         decoding of an image as per:
1664                 https://github.com/whatwg/html/pull/3221
1665                 https://whatpr.org/html/3221/images.html#decoding-images
1666
1667         Tests: fast/images/decode-decoding-attribute-async-large-image.html
1668                fast/images/decoding-attribute-async-small-image.html
1669                fast/images/decoding-attribute-dynamic-async-small-image.html
1670                fast/images/decoding-attribute-sync-large-image.html
1671
1672         * html/HTMLAttributeNames.in:
1673         * html/HTMLImageElement.cpp:
1674         (WebCore::HTMLImageElement::decodingMode const):
1675         * html/HTMLImageElement.h:
1676         * html/HTMLImageElement.idl:
1677         * platform/graphics/BitmapImage.cpp:
1678         (WebCore::BitmapImage::draw):
1679         (WebCore::BitmapImage::internalStartAnimation):
1680         (WebCore::BitmapImage::advanceAnimation):
1681         (WebCore::BitmapImage::internalAdvanceAnimation):
1682         * platform/graphics/DecodingOptions.h:
1683         (WebCore::DecodingOptions::DecodingOptions):
1684         (WebCore::DecodingOptions::isAuto const):
1685         (WebCore::DecodingOptions::isAsynchronousCompatibleWith const):
1686         (WebCore::DecodingOptions::isNone const): Deleted.
1687         * platform/graphics/ImageDecoder.h:
1688         * platform/graphics/ImageFrame.cpp:
1689         (WebCore::ImageFrame::clearImage):
1690         * platform/graphics/ImageSource.cpp:
1691         (WebCore::ImageSource::frameAtIndexCacheIfNeeded):
1692         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1693         * platform/graphics/cg/ImageDecoderCG.h:
1694         * platform/graphics/win/ImageDecoderDirect2D.h:
1695         * platform/image-decoders/ScalableImageDecoder.h:
1696         * rendering/RenderBoxModelObject.cpp:
1697         (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
1698         The element attributes and the document settings should be checked before
1699         checking our heuristics. And since the "decoding" attribute is per an image
1700         and isLargeImageAsyncDecodingEnabledForTesting() is a global setting, the
1701         decoding attribute should be checked first.
1702
1703 2017-12-06  David Quesada  <david_quesada@apple.com>
1704
1705         [Web App Manifest] Add SPI for applying a manifest to a top-level browsing context
1706         https://bugs.webkit.org/show_bug.cgi?id=180368
1707         rdar://problem/34748067
1708
1709         Reviewed by Geoffrey Garen.
1710
1711         Support applying a manifest to a top-level browsing context by adding a manifest
1712         property on PageConfiguration to be stored on MainFrame instances created from the
1713         configuration.
1714
1715         No new tests, no change in behavior.
1716
1717         * page/MainFrame.cpp:
1718         (WebCore::MainFrame::MainFrame):
1719         * page/MainFrame.h:
1720         * page/PageConfiguration.h:
1721
1722 2017-12-06  Zalan Bujtas  <zalan@apple.com>
1723
1724         Remove nodes from AXObjectCache when the associated subframe document is getting destroyed.
1725         https://bugs.webkit.org/show_bug.cgi?id=180503
1726         <rdar://problem/35891328
1727
1728         Reviewed by Chris Fleizach.
1729
1730         While AXObjectCache lives on the mainframe's document, it caches nodes from every subframe document.
1731         When a node is being destroyed, we deregister it from the AX cache through the Node's destructor.
1732         Soon after the document is detached from the frame/frame is detached from the frame tree, this codepath
1733         is no longer available (no access to the AXObjectCache object) and from this point we are unable to deregister
1734         nodes associated with the current document.
1735         In AXObjectCache::prepareForDocumentDestruction(), we preemptively remove all the cached nodes associated
1736         with the about-to-be-destroyed document.
1737
1738         Covered by existing tests.
1739
1740         * accessibility/AXObjectCache.cpp:
1741         (WebCore::AXObjectCache::remove):
1742         (WebCore::filterForRemoval):
1743         (WebCore::AXObjectCache::prepareForDocumentDestruction): Collecting the nodes and removing them later is
1744         not the most performant way but in order to have a single code path for the de-registration (AXObjectCache::remove)
1745         I think it's worth going down the slower path -which should not really be that slower anyway since those
1746         lists tend to stay small.
1747         (WebCore::AXObjectCache::clearTextMarkerNodesInUse): Deleted.
1748         * accessibility/AXObjectCache.h:
1749         (WebCore::AXObjectCache::removeNodeForUse):
1750         (WebCore::AXObjectCache::remove):
1751         * dom/Document.cpp:
1752         (WebCore::Document::prepareForDestruction):
1753         * dom/Node.cpp:
1754         (WebCore::Node::willBeDeletedFrom):
1755         (WebCore::Node::moveNodeToNewDocument):
1756
1757 2017-12-06  Brady Eidson  <beidson@apple.com>
1758
1759         Start writing ServiceWorker registrations to disk.
1760         https://bugs.webkit.org/show_bug.cgi?id=180488
1761
1762         Reviewed by Chris Dumez.
1763
1764         No new tests (No observable behavior change).
1765
1766         As registrations changes occurs, we now write them to disk.
1767         We don't re-read them in yet.
1768
1769         * Sources.txt:
1770         * WebCore.xcodeproj/project.pbxproj:
1771
1772         * workers/service/ServiceWorkerRegistrationData.cpp:
1773         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
1774         * workers/service/ServiceWorkerRegistrationData.h:
1775         (WebCore::ServiceWorkerRegistrationData::encode const):
1776         (WebCore::ServiceWorkerRegistrationData::decode):
1777
1778         * workers/service/ServiceWorkerRegistrationKey.cpp:
1779         (WebCore::ServiceWorkerRegistrationKey::toDatabaseKey const):
1780         * workers/service/ServiceWorkerRegistrationKey.h:
1781
1782         * workers/service/server/RegistrationDatabase.cpp: Added.
1783         (WebCore::v1RecordsTableSchema):
1784         (WebCore::v1RecordsTableSchemaAlternate):
1785         (WebCore::databaseFilename):
1786         (WebCore::RegistrationDatabase::RegistrationDatabase):
1787         (WebCore::RegistrationDatabase::~RegistrationDatabase):
1788         (WebCore::RegistrationDatabase::openSQLiteDatabase):
1789         (WebCore::RegistrationDatabase::ensureValidRecordsTable):
1790         (WebCore::updateViaCacheToString):
1791         (WebCore::workerTypeToString):
1792         (WebCore::RegistrationDatabase::pushChanges):
1793         (WebCore::RegistrationDatabase::doPushChanges):
1794         (WebCore::RegistrationDatabase::importRecords):
1795         (WebCore::RegistrationDatabase::databaseFailedToOpen):
1796         (WebCore::RegistrationDatabase::databaseOpenedAndRecordsImported):
1797         * workers/service/server/RegistrationDatabase.h: Copied from Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp.
1798         (WebCore::RegistrationDatabase::isClosed const):
1799
1800         * workers/service/server/RegistrationStore.cpp: Added.
1801         (WebCore::RegistrationStore::RegistrationStore):
1802         (WebCore::RegistrationStore::~RegistrationStore):
1803         (WebCore::RegistrationStore::scheduleDatabasePushIfNecessary):
1804         (WebCore::RegistrationStore::pushChangesToDatabase):
1805         (WebCore::RegistrationStore::updateRegistration):
1806         (WebCore::RegistrationStore::removeRegistration):
1807         (WebCore::RegistrationStore::databaseFailedToOpen):
1808         (WebCore::RegistrationStore::databaseOpenedAndRecordsImported):
1809         * workers/service/server/RegistrationStore.h: Copied from Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp.
1810
1811         * workers/service/server/SWServer.cpp:
1812         (WebCore::SWServer::removeRegistration):
1813         (WebCore::SWServer::SWServer):
1814         (WebCore::SWServer::updateWorker):
1815         (WebCore::SWServer::installContextData):
1816         * workers/service/server/SWServer.h:
1817
1818         * workers/service/server/SWServerRegistration.cpp:
1819         (WebCore::SWServerRegistration::data const):
1820         * workers/service/server/SWServerRegistration.h:
1821         (WebCore::SWServerRegistration::setLastUpdateTime):
1822
1823 2017-12-06  Chris Dumez  <cdumez@apple.com>
1824
1825         Unreviewed, fix build after r225577.
1826
1827         * bindings/js/JSDOMGlobalObject.cpp:
1828
1829 2017-12-06  David Quesada  <david_quesada@apple.com>
1830
1831         [Web App Manifest] Add SPI for fetching the manifest
1832         https://bugs.webkit.org/show_bug.cgi?id=180294
1833         rdar://problem/34747968
1834
1835         Reviewed by Geoffrey Garen.
1836
1837         Test: applicationmanifest/developer-warnings.html
1838
1839         * Modules/applicationmanifest/ApplicationManifest.h:
1840         (WebCore::ApplicationManifest::encode const):
1841         (WebCore::ApplicationManifest::decode):
1842         * Modules/applicationmanifest/ApplicationManifestParser.cpp:
1843         (WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
1844         (WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
1845             Drive-by wording changes. Since the warning is prefixed with "parsing
1846             application manifest:", remove a redundant use of "application manifest".
1847
1848 2017-12-06  Per Arne Vollan  <pvollan@apple.com>
1849
1850         The WebProcess should use the NSRunLoop runloop type.
1851         https://bugs.webkit.org/show_bug.cgi?id=179804
1852         <rdar://problem/14012823>
1853
1854         Reviewed by Brent Fulgham.
1855
1856         No new tests.
1857
1858         * platform/mac/EventLoopMac.mm:
1859         (WebCore::EventLoop::cycle):
1860
1861 2017-12-06  Antti Koivisto  <antti@apple.com>
1862
1863         Prefer ids and classes over tag names in selector filter
1864         https://bugs.webkit.org/show_bug.cgi?id=180433
1865         <rdar://problem/35859103>
1866
1867         Reviewed by Zalan Bujtas.
1868
1869         There are only four slots in the filter and currently we just pick whatever identifiers we find traversing the selector
1870         from right to left. More specific selector types are on average more valuable (id > class > tag) so we should prefer them.
1871
1872         This appears to be 4-5% StyleBench progression.
1873
1874         * css/RuleSet.cpp:
1875         (WebCore::RuleData::RuleData):
1876         * css/SelectorFilter.cpp:
1877         (WebCore::collectSimpleSelectorHash):
1878         (WebCore::collectSelectorHashes):
1879
1880             This function collects all hashes from the selector.
1881
1882         (WebCore::chooseSelectorHashesForFilter):
1883
1884             This function chooses the most valuable hashes to use with the filter.
1885
1886         (WebCore::SelectorFilter::collectHashes):
1887
1888             Factor into two separate steps.
1889
1890         (WebCore::collectDescendantSelectorIdentifierHashes): Deleted.
1891         (WebCore::SelectorFilter::collectIdentifierHashes): Deleted.
1892         * css/SelectorFilter.h:
1893         (WebCore::SelectorFilter::fastRejectSelector const):
1894
1895 2017-12-06  Jer Noble  <jer.noble@apple.com>
1896
1897         [EME] Make CDMInstance& parameter passed through MediaPlayer non-const
1898         https://bugs.webkit.org/show_bug.cgi?id=180484
1899
1900         Reviewed by Jon Lee.
1901
1902         One can only call const methods on const references, and the obvious intent
1903         of these methods is for the callee to call non-const methods on the parameters.
1904
1905         * Modules/encryptedmedia/MediaKeys.h:
1906         (WebCore::MediaKeys::cdmInstance):
1907         * platform/graphics/MediaPlayer.cpp:
1908         (WebCore::MediaPlayer::cdmInstanceAttached):
1909         (WebCore::MediaPlayer::cdmInstanceDetached):
1910         (WebCore::MediaPlayer::attemptToDecryptWithInstance):
1911         * platform/graphics/MediaPlayer.h:
1912         * platform/graphics/MediaPlayerPrivate.h:
1913         (WebCore::MediaPlayerPrivateInterface::cdmInstanceAttached):
1914         (WebCore::MediaPlayerPrivateInterface::cdmInstanceDetached):
1915         (WebCore::MediaPlayerPrivateInterface::attemptToDecryptWithInstance):
1916         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1917         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
1918         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
1919         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithInstance):
1920         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1921         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1922         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
1923         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1924
1925 2017-12-06  Youenn Fablet  <youenn@apple.com>
1926
1927         Preflight should bypass service worker
1928         https://bugs.webkit.org/show_bug.cgi?id=180463
1929
1930         Reviewed by Alex Christensen.
1931
1932         Covered by updated test.
1933
1934         * loader/CrossOriginPreflightChecker.cpp:
1935         (WebCore::CrossOriginPreflightChecker::startPreflight): Ensure service worker is not used.
1936         * loader/DocumentThreadableLoader.cpp:
1937         (WebCore::DocumentThreadableLoader::didFail): Tighten check and clear resource proactively to not hit loadRequest ASSERT.
1938
1939 2017-12-06  John Wilander  <wilander@apple.com>
1940
1941         Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes
1942         https://bugs.webkit.org/show_bug.cgi?id=176944
1943         <rdar://problem/34440658>
1944
1945         Reviewed by Brent Fulgham.
1946
1947         Test: http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-user-gesture.html
1948
1949         This change introduces document.hasStorageAccess() as a function which
1950         returns a promise instead of being a property. Since cookie access can
1951         be due to both a granted request and recent user interaction as first
1952         party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted.
1953
1954         * dom/Document.cpp:
1955         (WebCore::Document::hasStorageAccess):
1956         (WebCore::Document::requestStorageAccess):
1957             Removed check of the previous m_hasStorageAccess member.
1958             Same-origin check done earlier. This was a request/suggestion
1959             from Mozilla.
1960         * dom/Document.h:
1961         (WebCore::Document::hasStorageAccess const): Deleted.
1962             Now uses a promise.
1963         * dom/Document.idl:
1964         * page/ChromeClient.h:
1965
1966 2017-12-06  Youenn Fablet  <youenn@apple.com>
1967
1968         REGRESSION (r225537): Crash in WebCore::SWServerWorker::setHasPendingEvents(bool) + 68
1969         https://bugs.webkit.org/show_bug.cgi?id=180481
1970
1971         Reviewed by Chris Dumez.
1972
1973         Replacing ASSERT by if null check since there is no strong guarantee right now that there is a registration
1974         in SWServer registration map associated to a SWServerWorker.
1975
1976         * workers/service/server/SWServerWorker.cpp:
1977         (WebCore::SWServerWorker::setHasPendingEvents):
1978
1979 2017-12-06  Chris Dumez  <cdumez@apple.com>
1980
1981         ServiceWorkers API should reject promises when calling objects inside detached frames
1982         https://bugs.webkit.org/show_bug.cgi?id=180444
1983
1984         Reviewed by Youenn Fablet.
1985
1986         ServiceWorkers API should reject promises when calling objects inside detached frames.
1987
1988         No new tests, rebaselined existing test.
1989
1990         * bindings/js/JSDOMPromiseDeferred.h:
1991         (WebCore::callPromiseFunction):
1992         Use the caller's globalObject instead of the lexicalGlobalObject when constructing the
1993         deferred promise. The bug became visible when working on this service worker bug since
1994         rejecting the promise when the frame is detached did not actually work. The issue is
1995         that since the promise was created with the detached frame's globalObject, then it was
1996         suspended and would not run script.
1997
1998         * bindings/js/JSDOMWindowBase.cpp:
1999         (WebCore::callerGlobalObject):
2000         (WebCore::incumbentDOMWindow):
2001         * bindings/js/JSDOMWindowBase.h:
2002         Add convenience function to get the caller's globalObject. It was carved out of
2003         incumbentDOMWindow().
2004
2005         * workers/service/ServiceWorker.cpp:
2006         (WebCore::ServiceWorker::postMessage):
2007         * workers/service/ServiceWorkerContainer.cpp:
2008         (WebCore::ServiceWorkerContainer::addRegistration):
2009         (WebCore::ServiceWorkerContainer::getRegistration):
2010         (WebCore::ServiceWorkerContainer::getRegistrations):
2011         * workers/service/ServiceWorkerRegistration.cpp:
2012         (WebCore::ServiceWorkerRegistration::update):
2013         (WebCore::ServiceWorkerRegistration::unregister):
2014         Reject the promise when m_isStopped flag is set (i.e. ActiveDOMObject::stop()
2015         has been called).
2016
2017 2017-12-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2018
2019         [Mac] REGRESSION (r224527): Drawing a path with box-shadow takes double the blur-radius on Retina display
2020         https://bugs.webkit.org/show_bug.cgi?id=180460
2021         <rdar://problem/35869866>
2022
2023         Reviewed by Daniel Bates.
2024
2025         Disable using CGContextDrawPathDirect() for macOS High Sierra or earlier.
2026         This API has a bug when drawing a path with a shadow on Retina display.
2027         This bug is tracked internally by <rdar://problem/35620690>.
2028
2029
2030         * platform/graphics/cg/GraphicsContextCG.cpp:
2031
2032 2017-12-06  Youenn Fablet  <youenn@apple.com>
2033
2034         Service Worker fetch should filter HTTP headers that are added by CachedResourceLoader/CachedResource
2035         https://bugs.webkit.org/show_bug.cgi?id=180462
2036
2037         Reviewed by Geoffrey Garen.
2038
2039         Coved by rebased test.
2040
2041         * loader/CrossOriginAccessControl.cpp:
2042         (WebCore::cleanRedirectedRequestForAccessControl): Accept header is a safe header so it is fine to keep it.
2043         * workers/service/context/ServiceWorkerFetch.cpp:
2044         (WebCore::ServiceWorkerFetch::dispatchFetchEvent): Cleaning headers added by CachedResourceLoader/CachedResource.
2045
2046 2017-12-06  Zan Dobersek  <zdobersek@igalia.com>
2047
2048         [CoordGraphics] Introduce Nicosia::PaintingContext, add Cairo implementation
2049         https://bugs.webkit.org/show_bug.cgi?id=180239
2050
2051         Reviewed by Michael Catanzaro.
2052
2053         As the next step in the Nicosia abstraction formation, we introduce
2054         Nicosia::PaintingContext. Implementations of this class will leverage a
2055         chosen 2D graphics library to paint (through GraphicsContext) into the
2056         memory area that's specified by a given Nicosia::Buffer object.
2057
2058         Nicosia::Buffer is slimmed down to only control the memory that's
2059         required for rasterization of an RGBA32 painting output. It mimics the
2060         Cairo ImageBuffer implementation by using FastMalloc to allocate the
2061         necessary memory. In the future this class might become an interface of
2062         which different implementations will be providing memory that's
2063         allocated through different ways. For instance, when GLES3 is available,
2064         it would be possible to map GPU memory into the process memory space and
2065         rasterize into that, effectively eliminating need for GPU uploads.
2066
2067         Since the ImageBuffer use in Nicosia::Buffer is dropped, the context()
2068         and uploadImage() methods are also removed. The functionality of
2069         ImageBuffer that was leveraged for CoordinatedGraphics rasterization
2070         still remains used through the PaintingContextCairo implementation. In
2071         the constructor of that class, with the target Nicosia::Buffer provided,
2072         we construct the cairo_surface_t and cairo_t objects that are necessary
2073         to create a combination of PlatformContextCairo and GraphicsContext
2074         objects that we can then use for rasterization.
2075
2076         Reference of the passed-in Nicosia::Buffer object is increased for the
2077         lifetime of the cairo_surface_t object that will be drawing into that
2078         buffer's memory area. This ensures the memory area doesn't disappear
2079         from a live cairo_surface_t. Still, the expectation is that the
2080         cairo_surface_t object won't outlive the PaintingContextCairo object's
2081         lifetime, since the cairo_t object is also managed here and deleted in
2082         the destructor. To test that, we use a cairo_surface_t user data key
2083         that in its destroy callback dereferences the Nicosia::Buffer object and
2084         also marks the deletion process for the related PaintingContextCairo
2085         object as complete. This m_deletionComplete value is tested in the
2086         destructor of the class, once all the Cairo references are nulled out.
2087
2088         The PaintingContext objects should be limited to a single scope,
2089         enabling the implementation resources to assume that the lifetime of the
2090         implementation object won't extend outside of the scope where it was
2091         created. To ensure that, the PaintingContext::paint() static function is
2092         added that creates the PaintingContext object and then executes the
2093         passed-in functor, passing it the GraphicsContext that should be used
2094         for drawing. Drawing is thus limited to that functor only, and the
2095         PaintingContext's create() function and the virtual graphicsContext()
2096         are not made public in the class.
2097
2098         No new tests -- no change in functionality.
2099
2100         * platform/TextureMapper.cmake:
2101         * platform/graphics/nicosia/NicosiaBuffer.cpp:
2102         (Nicosia::Buffer::Buffer):
2103         (Nicosia::Buffer::context): Deleted.
2104         (Nicosia::Buffer::uploadImage): Deleted.
2105         * platform/graphics/nicosia/NicosiaBuffer.h:
2106         (Nicosia::Buffer::stride const):
2107         (Nicosia::Buffer::data const):
2108         * platform/graphics/nicosia/NicosiaPaintingContext.cpp: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp.
2109         (Nicosia::PaintingContext::create):
2110         * platform/graphics/nicosia/NicosiaPaintingContext.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp.
2111         (Nicosia::PaintingContext::paint):
2112         * platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp: Added.
2113         (Nicosia::PaintingContextCairo::PaintingContextCairo):
2114         (Nicosia::PaintingContextCairo::~PaintingContextCairo):
2115         (Nicosia::PaintingContextCairo::graphicsContext):
2116         * platform/graphics/nicosia/NicosiaPaintingContextCairo.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.h.
2117         * platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp:
2118         (Nicosia::PaintingEngineBasic::paint):
2119         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
2120         (WebCore::CoordinatedImageBacking::update):
2121
2122 2017-12-05  Fujii Hironori  <Hironori.Fujii@sony.com>
2123
2124         [GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html crashes and times out
2125         https://bugs.webkit.org/show_bug.cgi?id=160131
2126
2127         Reviewed by Eric Carlson.
2128
2129         Null dereference can be happen if VideoTrack and AudioTrack are
2130         disconnected from its media element.
2131
2132         No new tests, no behavior change.
2133
2134         * html/track/AudioTrack.cpp:
2135         (WebCore::AudioTrack::willRemove): Null-check mediaElement.
2136         * html/track/VideoTrack.cpp:
2137         (WebCore::VideoTrack::setLanguage): Ditto.
2138
2139 2017-12-05  Chris Dumez  <cdumez@apple.com>
2140
2141         ServiceWorkerGlobalScope prototype chain should be immutable
2142         https://bugs.webkit.org/show_bug.cgi?id=180450
2143
2144         Reviewed by Youenn Fablet.
2145
2146         ServiceWorkerGlobalScope prototype chain should be immutable, similarly
2147         to what we do for DOMWindow. This is covered by a web-platform-test
2148         which was timing out because it was successfuly overwriting the
2149         ServiceWorkerGlobalScope prototype.
2150
2151         No new tests, rebaselined existing test.
2152
2153         * workers/DedicatedWorkerGlobalScope.idl:
2154         * workers/WorkerGlobalScope.idl:
2155         * workers/service/ServiceWorkerGlobalScope.idl:
2156
2157 2017-12-05  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2158
2159         Fast binding generation by batching several files at once
2160         https://bugs.webkit.org/show_bug.cgi?id=179958
2161
2162         Reviewed by Alex Christensen.
2163
2164         Passing several files to the sub process at once and reducing the total cost of
2165         process generation. Especially Windows port has great speed improvement because
2166         its implementation of fork/exec is terrible.
2167
2168         * bindings/scripts/generate-bindings-all.pl:
2169         (spawnGenerateBindingsIfNeeded):
2170         * bindings/scripts/generate-bindings.pl:
2171         (generateBindings):
2172
2173 2017-12-05  David Quesada  <david_quesada@apple.com>
2174
2175         [Web App Manifest] Support fetching the app manifest 
2176         https://bugs.webkit.org/show_bug.cgi?id=180292
2177
2178         Reviewed by Geoffrey Garen.
2179
2180         Add support in WebCore for loading and parsing application manifests. This functionality
2181         is currently exposed with two methods: DocumentLoader::loadApplicationManifest() to call
2182         to start loading the manifest, and FrameLoaderClient::finishedLoadingApplicationManifest()
2183         for clients to override in order to be notified of the loaded manifest.
2184
2185         No new tests, since no functionality is exposed to web content or embedders yet. The
2186         needed SPI will be added in an upcoming patch.
2187
2188         * Sources.txt:
2189         * WebCore.xcodeproj/project.pbxproj:
2190             Added CachedApplicationManifest and ApplicationManifestLoader.
2191         * html/HTMLLinkElement.h:
2192         * html/LinkRelAttribute.cpp:
2193         (WebCore::LinkRelAttribute::LinkRelAttribute):
2194         (WebCore::LinkRelAttribute::isSupported):
2195             Add "manifest" as a supported 'rel' type for links.
2196         * html/LinkRelAttribute.h:
2197         * inspector/agents/InspectorPageAgent.cpp:
2198         (WebCore::InspectorPageAgent::resourceTypeJSON):
2199         (WebCore::InspectorPageAgent::inspectorResourceType):
2200         * inspector/agents/InspectorPageAgent.h:
2201         * loader/ApplicationManifestLoader.cpp: Added.
2202             Added a class ApplicationManifestLoader which handles creating a ResourceRequest,
2203             loading the resource from the CachedResourceLoader, and parsing the resulting text.
2204             This class and its relation to DocumentLoader are roughly based on that of IconLoader,
2205             which serves a similar purpose - requesting a resource on the page and ultimately
2206             providing it to the embedder.
2207         (WebCore::ApplicationManifestLoader::ApplicationManifestLoader):
2208         (WebCore::ApplicationManifestLoader::~ApplicationManifestLoader):
2209         (WebCore::ApplicationManifestLoader::startLoading):
2210         (WebCore::ApplicationManifestLoader::stopLoading):
2211         (WebCore::ApplicationManifestLoader::processManifest):
2212         (WebCore::ApplicationManifestLoader::notifyFinished):
2213         * loader/ApplicationManifestLoader.h: Copied from Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.h.
2214         * loader/DocumentLoader.cpp:
2215         (WebCore::DocumentLoader::stopLoading):
2216         (WebCore::DocumentLoader::loadApplicationManifest):
2217         (WebCore::DocumentLoader::finishedLoadingApplicationManifest):
2218         (WebCore::DocumentLoader::notifyFinishedLoadingApplicationManifest):
2219         * loader/DocumentLoader.h:
2220         * loader/FrameLoaderClient.h:
2221         * loader/LinkLoader.cpp:
2222         (WebCore::createLinkPreloadResourceClient):
2223         (WebCore::LinkLoader::isSupportedType):
2224         * loader/ResourceLoadInfo.cpp:
2225         (WebCore::toResourceType):
2226         * loader/SubresourceLoader.cpp:
2227         (WebCore::logResourceLoaded):
2228         * loader/cache/CachedApplicationManifest.cpp: Added.
2229         (WebCore::CachedApplicationManifest::CachedApplicationManifest):
2230         (WebCore::CachedApplicationManifest::finishLoading):
2231         (WebCore::CachedApplicationManifest::setEncoding):
2232         (WebCore::CachedApplicationManifest::encoding const):
2233         (WebCore::CachedApplicationManifest::process):
2234             Add a method to process the fetched text into an ApplicationManifest. CachedApplicationManifest
2235             does not store the resulting ApplicationManifest because the text of an application
2236             manifest can yield a different ApplicationManifest depending on the URL of the document
2237             processing it.
2238         * loader/cache/CachedApplicationManifest.h: Copied from Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.h.
2239         * loader/cache/CachedResource.cpp:
2240         (WebCore::CachedResource::defaultPriorityForResourceType):
2241         * loader/cache/CachedResource.h:
2242         * loader/cache/CachedResourceLoader.cpp:
2243         (WebCore::createResource):
2244         (WebCore::CachedResourceLoader::requestApplicationManifest):
2245         (WebCore::contentTypeFromResourceType):
2246         (WebCore::CachedResourceLoader::checkInsecureContent const):
2247         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
2248         * loader/cache/CachedResourceLoader.h:
2249         * page/DiagnosticLoggingKeys.cpp:
2250         (WebCore::DiagnosticLoggingKeys::applicationManifestKey):
2251         * page/DiagnosticLoggingKeys.h:
2252         * page/csp/ContentSecurityPolicy.cpp:
2253         (WebCore::ContentSecurityPolicy::allowManifestFromSource const):
2254         * page/csp/ContentSecurityPolicy.h:
2255         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2256         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForManifest const):
2257         (WebCore::ContentSecurityPolicyDirectiveList::addDirective):
2258         * page/csp/ContentSecurityPolicyDirectiveList.h:
2259         * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
2260         * page/csp/ContentSecurityPolicyDirectiveNames.h:
2261
2262 2017-12-05  Stephan Szabo  <stephan.szabo@sony.com>
2263
2264         Switch windows build to Visual Studio 2017
2265         https://bugs.webkit.org/show_bug.cgi?id=172412
2266
2267         Reviewed by Per Arne Vollan.
2268
2269         Only changes proj file to update generator
2270
2271         * WebCore.vcxproj/WebCore.proj:
2272
2273 2017-12-05  Brent Fulgham  <bfulgham@apple.com>
2274
2275         Limit user agent versioning to an upper bound
2276         https://bugs.webkit.org/show_bug.cgi?id=180365
2277         <rdar://problem/34550617>
2278
2279         Reviewed by Joseph Pecoraro.
2280
2281         Freeze the version reported as User Agent to OS 10.13.4 (OS 11.3 on iOS) and WebKit 605.1.15
2282         for User Agent purposes.
2283
2284         Test: fast/dom/navigator-userAgent-frozen.html
2285
2286         * page/cocoa/UserAgent.h:
2287         * page/cocoa/UserAgent.mm:
2288         (WebCore::versionPredatesFreeze): Helper function. Returns true for Version 10.13.3 or older.
2289         (WebCore::systemMarketingVersionForUserAgentString):
2290         (WebCore::userAgentBundleVersion):
2291         (WebCore::userVisibleWebKitBundleVersionFromFullVersion): Deleted.
2292         (WebCore::userAgentBundleVersionFromFullVersionString): Deleted.
2293         * page/ios/UserAgentIOS.mm:
2294         (WebCore::standardUserAgentWithApplicationName): Don't take the WebKit bundle version
2295         as an argument, or pass it to the user agent string generator.
2296         * page/mac/UserAgentMac.mm:
2297         (WebCore::standardUserAgentWithApplicationName): Ditto. 
2298
2299 2017-12-05  Matt Lewis  <jlewis3@apple.com>
2300
2301         Unreviewed, rolling out r225430.
2302
2303         This caused an API failure on release.
2304
2305         Reverted changeset:
2306
2307         "Move DateComponents into WTF"
2308         https://bugs.webkit.org/show_bug.cgi?id=180211
2309         https://trac.webkit.org/changeset/225430
2310
2311 2017-12-05  Simon Fraser  <simon.fraser@apple.com>
2312
2313         Composited frames incorrectly get requestAnimationFrame throttled
2314         https://bugs.webkit.org/show_bug.cgi?id=178396
2315
2316         Reviewed by Zalan Bujtas.
2317
2318         If a composited iframe was inside overflow:scroll, and the overflow was scrolled to the left
2319         further than the window width, then RenderLayer::childrenClipRect() would return an empty rectangle
2320         and we'd incorrectly consider the iframe out of view, and thus throttle its requestAnimationFrame.
2321
2322         childrenClipRect() was taking unscaledDocumentRect(), applying the clip, and then mapping the result
2323         from local to absolute coordinates (which mapped it through the overflow scroll offset). This is incorrect
2324         because it considers the unscaledDocumentRect() to be in local coordinates, which it is not.
2325
2326         Instead, start with the infinite rect, which essentially tells us if we have any clipping, and then
2327         intersect that with the document rect at the end. Something similar is done in other places that call.
2328         calculateRects().
2329
2330         Test: fast/animation/request-animation-frame-throttle-inside-overflow-scroll.html
2331
2332         * rendering/RenderLayer.cpp:
2333         (WebCore::RenderLayer::calculateClipRects const):
2334
2335 2017-12-05  Michael Saboff  <msaboff@apple.com>
2336
2337         Make WebKit build for ARM64_32
2338         https://bugs.webkit.org/show_bug.cgi?id=180447
2339
2340         Reviewed by Mark Lam.
2341
2342         No new test as this isn't a change to functionality.
2343
2344         * platform/graphics/transforms/TransformationMatrix.cpp:
2345         (WebCore::TransformationMatrix::multiply): Fallback to the C++ version for
2346         ARM64_32.
2347
2348 2017-12-05  Chris Dumez  <cdumez@apple.com>
2349
2350         XMLHttpRequest should not be exposed to service workers
2351         https://bugs.webkit.org/show_bug.cgi?id=180446
2352
2353         Reviewed by Youenn Fablet.
2354
2355         Stop exposing XMLHttpRequest to service workers, as per:
2356         - https://xhr.spec.whatwg.org/#interface-xmlhttprequest
2357
2358         * xml/XMLHttpRequest.idl:
2359
2360 2017-12-05  Joseph Pecoraro  <pecoraro@apple.com>
2361
2362         Web Inspector: content views for resources loaded through XHR do not reflect declared mime-type
2363         https://bugs.webkit.org/show_bug.cgi?id=141389
2364         <rdar://problem/19767070>
2365
2366         Reviewed by Brian Burg.
2367
2368         Updated: http/tests/inspector/network/xhr-response-body.html:
2369                  http/tests/inspector/network/fetch-response-body.html:
2370
2371         * xml/XMLHttpRequest.cpp:
2372         (WebCore::XMLHttpRequest::didFinishLoading):
2373         * inspector/InspectorInstrumentation.cpp:
2374         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl): Deleted.
2375         * inspector/InspectorInstrumentation.h:
2376         (WebCore::InspectorInstrumentation::didFinishXHRLoading): Deleted.
2377         Remove special handling of XHR content that decoded output as text.
2378
2379         * inspector/NetworkResourcesData.h:
2380         (WebCore::NetworkResourcesData::ResourceData::requestId const):
2381         (WebCore::NetworkResourcesData::ResourceData::loaderId const):
2382         (WebCore::NetworkResourcesData::ResourceData::frameId const):
2383         (WebCore::NetworkResourcesData::ResourceData::url const):
2384         (WebCore::NetworkResourcesData::ResourceData::content const):
2385         (WebCore::NetworkResourcesData::ResourceData::isContentEvicted const):
2386         (WebCore::NetworkResourcesData::ResourceData::textEncodingName const):
2387         * inspector/NetworkResourcesData.cpp:
2388         (WebCore::NetworkResourcesData::ResourceData::ResourceData):
2389         (WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
2390         (WebCore::NetworkResourcesData::responseReceived):
2391         (WebCore::NetworkResourcesData::setResourceContent):
2392         (WebCore::shouldBufferResourceData):
2393         (WebCore::NetworkResourcesData::maybeAddResourceData):
2394         (WebCore::NetworkResourcesData::maybeDecodeDataToContent):
2395
2396         Make NetworkResourcesData only create a text decoder for resources we
2397         really think are text, and buffer resource data if it is text data
2398         or if it is a resource that would otherwise not be buffered by WebCore
2399         (such as XHRs with a DoNotBufferData policy). This ensures that the
2400         Inspector will have data to show for resources that won't be cached.
2401
2402         * inspector/agents/InspectorPageAgent.cpp:
2403         (WebCore::InspectorPageAgent::resourceContent):
2404         (WebCore::InspectorPageAgent::sourceMapURLForResource):
2405         (WebCore::InspectorPageAgent::searchInResource):
2406         (WebCore::InspectorPageAgent::searchInResources):
2407         (WebCore::hasTextContent): Deleted.
2408         (WebCore::InspectorPageAgent::cachedResourceContent): Deleted.
2409         (WebCore::InspectorPageAgent::createTextDecoder): Deleted.
2410         (WebCore::textContentForCachedResource): Deleted.
2411         * inspector/agents/InspectorPageAgent.h:
2412         * inspector/agents/InspectorNetworkAgent.cpp:
2413         (WebCore::InspectorNetworkAgent::didReceiveData):
2414         (WebCore::InspectorNetworkAgent::willDestroyCachedResource):
2415         (WebCore::InspectorNetworkAgent::getResponseBody):
2416         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
2417         (WebCore::InspectorNetworkAgent::createTextDecoder):
2418         (WebCore::InspectorNetworkAgent::textContentForCachedResource):
2419         (WebCore::InspectorNetworkAgent::cachedResourceContent):
2420         (WebCore::textContentForResourceData):
2421         (WebCore::InspectorNetworkAgent::searchOtherRequests):
2422         (WebCore::isErrorStatusCode): Deleted.
2423         (WebCore::InspectorNetworkAgent::didFinishXHRLoading): Deleted.
2424         * inspector/agents/InspectorNetworkAgent.h:
2425         Move static PageAgent functions related to the generic data tuple
2426         (content, base64Encoded) to NetworkAgent. Also generalize it to
2427         not rely on the CachedResourceType, but instead rely on the MIME type.
2428         This has a few changes in behavior:
2429
2430             - Images, may now be text if they have a text mime type (image/svg+xml).
2431             - XHR / Fetch / Other may be sent as text if they have a text mime type.
2432             - XHR / Fetch / Other are not assumed to be text, and may be sent as base64 encoded.
2433         
2434         For this to be useful the frontend should also check the mime type and
2435         display an appropriate ContentView.
2436
2437 2017-12-05  Youenn Fablet  <youenn@apple.com>
2438
2439         Implement https://w3c.github.io/ServiceWorker/#clients-claim
2440         https://bugs.webkit.org/show_bug.cgi?id=180261
2441
2442         Reviewed by Chris Dumez.
2443
2444         Test: http/tests/workers/service/serviceworkerclients-claim.https.html
2445
2446         Implement claim by going to the storage process and then iterate over clients to see whether active worker can be set.
2447         Update SWServerWorker to call registration tryClear/tryActivate whenever a service worker has no pending event.
2448
2449         * workers/service/ServiceWorkerClients.cpp:
2450         (WebCore::ServiceWorkerClients::claim):
2451         * workers/service/context/SWContextManager.h:
2452         * workers/service/server/SWServer.cpp:
2453         (WebCore::SWServer::claim):
2454         (WebCore::SWServer::doRegistrationMatching):
2455         (WebCore::SWServer::doRegistrationMatching const): Deleted.
2456         * workers/service/server/SWServer.h:
2457         (WebCore::SWServer::Connection::doRegistrationMatching):
2458         * workers/service/server/SWServerRegistration.cpp:
2459         (WebCore::SWServerRegistration::controlClient):
2460         * workers/service/server/SWServerRegistration.h:
2461         * workers/service/server/SWServerToContextConnection.cpp:
2462         (WebCore::SWServerToContextConnection::claim):
2463         * workers/service/server/SWServerToContextConnection.h:
2464         * workers/service/server/SWServerWorker.cpp:
2465         (WebCore::SWServerWorker::claim):
2466         * workers/service/server/SWServerWorker.h:
2467
2468 2017-12-05  Per Arne Vollan  <pvollan@apple.com>
2469
2470         [Win] Scrollbars are sometimes not rendered in accelerated compositing mode.
2471         https://bugs.webkit.org/show_bug.cgi?id=180431
2472         <rdar://problem/34531264>
2473
2474         Reviewed by Simon Fraser.
2475
2476         No new tests, covered by existing tests.
2477
2478         When a scroll layer is required, we will create an overflow control hosts layer.
2479         In this case the method RenderLayerCompositor::shouldCompositeOverflowControls()
2480         should return true, otherwise the scrollbars will not be rendered.
2481  
2482         * rendering/RenderLayerCompositor.cpp:
2483         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
2484
2485 2017-12-05  Youenn Fablet  <youenn@apple.com>
2486
2487         Call "Terminate Service Worker" on all workers when all their clients are gone
2488         https://bugs.webkit.org/show_bug.cgi?id=179552
2489         <rdar://problem/35836323>
2490
2491         Unreviewed.
2492
2493         * workers/service/server/SWServer.cpp: Reducing from 60_s to 10_s based on bugzilla comment.
2494
2495 2017-12-05  Chris Dumez  <cdumez@apple.com>
2496
2497         Add support for ServiceWorkerContainer.prototype.ready
2498         https://bugs.webkit.org/show_bug.cgi?id=180383
2499
2500         Reviewed by Youenn Fablet.
2501
2502         Add support for ServiceWorkerContainer.prototype.ready:
2503         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-ready
2504
2505         No new tests, rebaselined existing test.
2506
2507         * workers/service/SWClientConnection.h:
2508         * workers/service/ServiceWorkerContainer.cpp:
2509         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2510         (WebCore::ServiceWorkerContainer::ready):
2511         * workers/service/ServiceWorkerContainer.h:
2512         * workers/service/ServiceWorkerRegistrationKey.h:
2513         * workers/service/server/SWServer.cpp:
2514         (WebCore::SWServer::resolveRegistrationReadyRequests):
2515         * workers/service/server/SWServer.h:
2516         * workers/service/server/SWServerRegistration.cpp:
2517         (WebCore::SWServerRegistration::activate):
2518         (WebCore::SWServerRegistration::setIsUninstalling):
2519         * workers/service/server/SWServerRegistration.h:
2520
2521 2017-12-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2522
2523         Modernize WebThread code for further refactoring
2524         https://bugs.webkit.org/show_bug.cgi?id=180344
2525
2526         Reviewed by Alex Christensen.
2527
2528         When touching Thread and its initialization component, we need to touch
2529         web thread initialization code too. However, since web thread code is old,
2530         it's style is not following to WebKit coding style guidelines.
2531
2532         This patch first modernizes WebThread code for further refactoring.
2533
2534         1. `Type*` instead of `Type *`.
2535         2. Use std::call_once instead of pthread_once.
2536         3. Use static_cast instead of C-cast.
2537         4. Use nullptr instead of NULL.
2538         5. Use `ret` or `!ret` instead of `ret != 0` or `ret == 0`.
2539         6. Do not use #pragma unused.
2540         7. if-else with one statement should not have braces.
2541
2542         In this patch, we do not change pthread_condition_t to WTF::Condition and
2543         pthread_mutex_t to WTF::Lock since web thread code requires extra care about
2544         threading.
2545
2546         No behavior change.
2547
2548         * platform/ios/wak/WebCoreThread.mm:
2549         (-[NSObject releaseOnMainThread]):
2550         (SendMessage):
2551         (HandleDelegateSource):
2552         (SendDelegateMessage):
2553         (WebThreadAdoptAndRelease):
2554         (lockWebCoreReleaseLock):
2555         (unlockWebCoreReleaseLock):
2556         (WebCoreObjCDeallocOnWebThreadImpl):
2557         (WebCoreObjCDeallocWithWebThreadLockImpl):
2558         (HandleWebThreadReleaseSource):
2559         (WebThreadCallDelegate):
2560         (WebThreadPostNotification):
2561         (WebThreadCallDelegateAsync):
2562         (WebThreadMakeNSInvocation):
2563         (MainRunLoopAutoUnlock):
2564         (_WebThreadAutoLock):
2565         (WebRunLoopLock):
2566         (WebRunLoopUnlock):
2567         (MainRunLoopUnlockGuard):
2568         (CurrentThreadContext):
2569         (RunWebThread):
2570         (StartWebThread):
2571         (WebTimedConditionLock):
2572         (_WebTryThreadLock):
2573         (WebThreadUnlockFromAnyThread):
2574         (WebThreadUnlockGuardForMail):
2575         (_WebThreadUnlock):
2576         (WebThreadIsLocked):
2577         (WebThreadLockPopModal):
2578         (WebThreadCurrentContext):
2579         (WebThreadEnable):
2580         (FreeThreadContext): Deleted.
2581         (InitThreadContextKey): Deleted.
2582
2583 2017-12-05  Alex Christensen  <achristensen@webkit.org>
2584
2585         Fix non-unified build after r225381
2586         https://bugs.webkit.org/show_bug.cgi?id=180434
2587
2588         Reviewed by Keith Miller.
2589
2590         * loader/ResourceTimingInformation.cpp:
2591         FrameLoader.h is included in other files that are combined with this file in unified builds,
2592         but we need to merge r225381 to a branch that doesn't use unified builds.  This build failure
2593         would've come up randomly in the future when we add files, too.
2594
2595 2017-12-05  Simon Fraser  <simon.fraser@apple.com>
2596
2597         Remove webkitGetImageDataHD and webkitPutImageDataHD from canvas API
2598         https://bugs.webkit.org/show_bug.cgi?id=180387
2599
2600         Reviewed by Dean Jackson.
2601
2602         CanvasRenderingContext2D.webkitGetImageDataHD and webkitPutImageDataHD were never standardized,
2603         and Blink removed support in 2014 (https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/FOPH5dloGG8).
2604
2605         Since our canvas backing store is always 1x, they have no use anyway, so remove them.
2606
2607         * html/canvas/CanvasRenderingContext2D.cpp:
2608         (WebCore::CanvasRenderingContext2D::putImageData):
2609         (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD const): Deleted.
2610         (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Deleted.
2611         * html/canvas/CanvasRenderingContext2D.h:
2612         * html/canvas/CanvasRenderingContext2D.idl:
2613
2614 2017-12-05  Youenn Fablet  <youenn@apple.com>
2615
2616         Implement setting of service worker to client in SWServer without going to WebProcess
2617         https://bugs.webkit.org/show_bug.cgi?id=180382
2618
2619         Reviewed by Chris Dumez.
2620
2621         No change of behavior.
2622
2623         This patch removes the notification of active worker setting from ScriptExecution/WebProcess up to SWServer/StorageProcess.
2624         Instead, active worker setting is fully done/controlled in SWServer.
2625         Whenever there is a change, SWServer notifies WebProcess and ScriptExecutionContext gets updated accordingly.
2626
2627         * dom/Document.cpp:
2628         (WebCore::Document::setServiceWorkerConnection):
2629         * dom/ScriptExecutionContext.cpp:
2630         (WebCore::ScriptExecutionContext::setActiveServiceWorker):
2631         * loader/DocumentLoader.cpp:
2632         (WebCore::DocumentLoader::commitData):
2633         * workers/service/SWClientConnection.h:
2634         * workers/service/server/SWServer.cpp:
2635         (WebCore::SWServer::setClientActiveWorker):
2636         (WebCore::SWServer::registerServiceWorkerClient):
2637         (WebCore::SWServer::registrationFromServiceWorkerIdentifier):
2638         (WebCore::SWServer::unregisterServiceWorkerClient):
2639         (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient): Deleted.
2640         (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient): Deleted.
2641         (WebCore::SWServer::serviceWorkerStartedControllingClient): Deleted.
2642         (WebCore::SWServer::serviceWorkerStoppedControllingClient): Deleted.
2643         * workers/service/server/SWServer.h:
2644         * workers/service/server/SWServerRegistration.cpp:
2645         (WebCore::SWServerRegistration::activate):
2646
2647 2017-12-01  Filip Pizlo  <fpizlo@apple.com>
2648
2649         GC constraint solving should be parallel
2650         https://bugs.webkit.org/show_bug.cgi?id=179934
2651
2652         Reviewed by JF Bastien.
2653
2654         No new tests because no change in behavior. This change is best tested using DOM-GC-intensive
2655         benchmarks like Speedometer and Dromaeo.
2656         
2657         This parallelizes the DOM's output constraint, and makes some small changes to make this more
2658         scalable.
2659
2660         * ForwardingHeaders/heap/SimpleMarkingConstraint.h: Added.
2661         * ForwardingHeaders/heap/VisitingTimeout.h: Removed.
2662         * Sources.txt:
2663         * WebCore.xcodeproj/project.pbxproj:
2664         * bindings/js/DOMGCOutputConstraint.cpp: Added.
2665         (WebCore::DOMGCOutputConstraint::DOMGCOutputConstraint):
2666         (WebCore::DOMGCOutputConstraint::~DOMGCOutputConstraint):
2667         (WebCore::DOMGCOutputConstraint::executeImpl):
2668         (WebCore::DOMGCOutputConstraint::doParallelWorkImpl):
2669         (WebCore::DOMGCOutputConstraint::finishParallelWorkImpl):
2670         * bindings/js/DOMGCOutputConstraint.h: Added.
2671         * bindings/js/WebCoreJSClientData.cpp:
2672         (WebCore::JSVMClientData::initNormalWorld):
2673         * dom/Node.cpp:
2674         (WebCore::Node::eventTargetDataConcurrently):
2675         (WebCore::Node::ensureEventTargetData):
2676         (WebCore::Node::clearEventTargetData):
2677
2678 2017-12-05  Antoine Quint  <graouts@apple.com>
2679
2680         <video> and scale() transforms yield shrunk small or clipped controls
2681         https://bugs.webkit.org/show_bug.cgi?id=180358
2682         <rdar://problem/34436124>
2683
2684         Unreviewed.
2685
2686         Use DOMMatrix vs. WebKitCSSMatrix per Simon's post-commit review feedback.
2687
2688         * Modules/modern-media-controls/media/media-controller.js:
2689         (MediaController.prototype._updateControlsSize):
2690
2691 2017-12-04  Chris Dumez  <cdumez@apple.com>
2692
2693         Support container.getRegistration() / getRegistrations() inside service workers
2694         https://bugs.webkit.org/show_bug.cgi?id=180360
2695
2696         Reviewed by Youenn Fablet.
2697
2698         Support container.getRegistration() / getRegistrations() inside service workers
2699         by making sure we hop to the right thread when needed.
2700
2701         Test: http/tests/workers/service/ServiceWorkerGlobalScope_getRegistration.html
2702
2703         * dom/ScriptExecutionContext.cpp:
2704         (WebCore::ScriptExecutionContext::postTaskTo):
2705         * dom/ScriptExecutionContext.h:
2706         * workers/service/SWClientConnection.cpp:
2707         (WebCore::SWClientConnection::jobRejectedInServer):
2708         (WebCore::SWClientConnection::registrationJobResolvedInServer):
2709         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
2710         (WebCore::SWClientConnection::startScriptFetchForServer):
2711         (WebCore::SWClientConnection::clearPendingJobs):
2712         * workers/service/SWClientConnection.h:
2713         * workers/service/ServiceWorkerContainer.cpp:
2714         (WebCore::ServiceWorkerContainer::getRegistration):
2715         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
2716         (WebCore::ServiceWorkerContainer::getRegistrations):
2717         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
2718         (WebCore::ServiceWorkerContainer::stop):
2719         * workers/service/ServiceWorkerContainer.h:
2720
2721 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
2722
2723         Cleanup code that computes iframe content offsets in FrameView
2724         https://bugs.webkit.org/show_bug.cgi?id=180385
2725
2726         Reviewed by Zalan Bujtas.
2727
2728         The coordinate conversion functions in FrameView explicitly added borderLeft/paddingLeft
2729         and borderTop/paddingTop to compute the offset from the contents of a frame to its parent renderer.
2730         
2731         This is equivalent to the call to contextBoxRect() that RenderWidget::updateWidgetGeometry() does,
2732         which also takes left-side scrollbars into account.
2733         
2734         Coordinate offsets don't need height and width, so add RenderBox::contentBoxLocation() that just
2735         computes the top left, and use it in FrameView.
2736
2737         * page/FrameView.cpp:
2738         (WebCore::FrameView::invalidateRect):
2739         (WebCore::FrameView::convertToContainingView const):
2740         (WebCore::FrameView::convertFromContainingView const):
2741         * platform/graphics/FloatPoint.h:
2742         (WebCore::FloatPoint::scaled const):
2743         (WebCore::FloatPoint::scaled): Deleted.
2744         * rendering/RenderBox.cpp:
2745         (WebCore::RenderBox::contentBoxLocation const):
2746         * rendering/RenderBox.h:
2747
2748 2017-12-04  Nan Wang  <n_wang@apple.com>
2749
2750         AX: AOM: Implement relation type properties
2751         https://bugs.webkit.org/show_bug.cgi?id=179500
2752
2753         Reviewed by Ryosuke Niwa.
2754
2755         Accessibility Object Model
2756         Explainer: https://wicg.github.io/aom/explainer.html
2757         Spec: https://wicg.github.io/aom/spec/
2758
2759         Implemented the AOM support for activeDescendant, details and errorMessage.
2760         The corresponding ARIA attributes all take IDREFs, and the AOM properties
2761         take references to AccessibleNodes instead.
2762
2763         Test: accessibility/mac/AOM-relation-property.html
2764
2765         * accessibility/AccessibilityObject.cpp:
2766         (WebCore::AccessibilityObject::getAttribute const):
2767         (WebCore::AccessibilityObject::hasProperty const):
2768         (WebCore::AccessibilityObject::stringValueForProperty const):
2769         (WebCore::AccessibilityObject::boolValueForProperty const):
2770         (WebCore::AccessibilityObject::intValueForProperty const):
2771         (WebCore::AccessibilityObject::unsignedValueForProperty const):
2772         (WebCore::AccessibilityObject::doubleValueForProperty const):
2773         (WebCore::AccessibilityObject::elementValueForProperty const):
2774         (WebCore::AccessibilityObject::supportsARIAAttributes const):
2775         (WebCore::AccessibilityObject::elementsFromProperty const):
2776         (WebCore::AccessibilityObject::elementsReferencedByProperty const):
2777         (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
2778         (WebCore::AccessibilityObject::ariaDetailsElements const):
2779         (WebCore::AccessibilityObject::ariaDetailsReferencingElements const):
2780         (WebCore::AccessibilityObject::ariaErrorMessageElements const):
2781         (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements const):
2782         * accessibility/AccessibilityObject.h:
2783         * accessibility/AccessibilityRenderObject.cpp:
2784         (WebCore::AccessibilityRenderObject::activeDescendant const):
2785         * accessibility/AccessibleNode.cpp:
2786         (WebCore::ariaAttributeMap):
2787         (WebCore::isPropertyValueRelation):
2788         (WebCore::AccessibleNode::attributeFromAXPropertyName):
2789         (WebCore::AccessibleNode::setRelationProperty):
2790         (WebCore::AccessibleNode::singleRelationValueForProperty):
2791         (WebCore::AccessibleNode::activeDescendant const):
2792         (WebCore::AccessibleNode::setActiveDescendant):
2793         (WebCore::AccessibleNode::details const):
2794         (WebCore::AccessibleNode::setDetails):
2795         (WebCore::AccessibleNode::errorMessage const):
2796         (WebCore::AccessibleNode::setErrorMessage):
2797         * accessibility/AccessibleNode.h:
2798         * accessibility/AccessibleNode.idl:
2799         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2800         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2801
2802 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
2803
2804         Minor DisplayRefreshMonitor-related cleanup
2805         https://bugs.webkit.org/show_bug.cgi?id=179802
2806
2807         Reviewed by Sam Weinig.
2808
2809         New trace point for when the CVDisplayLink fires on its own thread.
2810
2811         Some #pragma once, and put all the WellKnownRunLoopOrders in one place.
2812
2813         * inspector/agents/InspectorTimelineAgent.cpp:
2814         (WebCore::InspectorTimelineAgent::internalStart):
2815         * platform/cf/RunLoopObserver.h:
2816         * platform/graphics/DisplayRefreshMonitor.cpp:
2817         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
2818         * platform/graphics/ca/LayerFlushScheduler.h:
2819         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
2820         (WebCore::LayerFlushScheduler::LayerFlushScheduler):
2821
2822 2017-12-04  David Quesada  <david_quesada@apple.com>
2823
2824         Add a class for parsing application manifests
2825         https://bugs.webkit.org/show_bug.cgi?id=177973
2826         rdar://problem/34747949
2827
2828         Reviewed by Geoffrey Garen.
2829
2830         Add a new struct ApplicationManifest, along with ApplicationManifestParser to initialize
2831         ApplicationManifests from JSON data, according to the App Manifest spec. Just a basic subset
2832         of the manifests's properties are implemented to start with.
2833
2834         ApplicationManifestParser is tested by new unit tests in TestWebKitAPI.
2835
2836         * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
2837         * Modules/applicationmanifest/ApplicationManifest.h: Added.
2838         * Modules/applicationmanifest/ApplicationManifestParser.cpp: Added.
2839         (WebCore::ApplicationManifestParser::parse):
2840         The main entry point for eventual clients (and currently the unit tests) to invoke
2841         ApplicationManifestParser. There is a variant that accepts a ScriptExecutionContext that
2842         uses the context exclusively for logging console warnings while parsing the manifest, and
2843         not for actually executing any scripts.
2844         (WebCore::ApplicationManifestParser::ApplicationManifestParser):
2845         (WebCore::ApplicationManifestParser::parseManifest):
2846         (WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
2847         (WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
2848         (WebCore::ApplicationManifestParser::logDeveloperWarning):
2849         (WebCore::ApplicationManifestParser::parseStartURL):
2850         (WebCore::ApplicationManifestParser::parseName):
2851         (WebCore::ApplicationManifestParser::parseDescription):
2852         (WebCore::ApplicationManifestParser::parseShortName):
2853         (WebCore::isInScope):
2854         (WebCore::ApplicationManifestParser::parseScope):
2855         (WebCore::ApplicationManifestParser::parseGenericString):
2856         * Modules/applicationmanifest/ApplicationManifestParser.h: Added.
2857         * Sources.txt:
2858         * WebCore.xcodeproj/project.pbxproj:
2859         * features.json: Change the Web App Manifest feature status to "In Development"
2860
2861 2017-12-04  Zalan Bujtas  <zalan@apple.com>
2862
2863         RenderMultiColumnFlow::fragmentedFlowDescendantInserted should not destroy incoming newDescendant
2864         https://bugs.webkit.org/show_bug.cgi?id=180181
2865
2866         Reviewed by Antti Koivisto.
2867
2868         This is in preparation for having all multicolumn related tree mutation in RenderTreeUpdaterMultiColumn.
2869
2870         Covered by fast/multicol/column-span-range-crash.html
2871
2872         * rendering/RenderMultiColumnFlow.cpp:
2873         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
2874         * rendering/RenderMultiColumnFlow.h:
2875         * style/RenderTreeUpdaterMultiColumn.cpp:
2876         (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):
2877
2878 2017-12-04  JF Bastien  <jfbastien@apple.com>
2879
2880         Update std::expected to match libc++ coding style
2881         https://bugs.webkit.org/show_bug.cgi?id=180264
2882
2883         Reviewed by Alex Christensen.
2884
2885         Update various uses of Expected, mostly renaming valueOr and
2886         hasValue to the STL naming convention.
2887
2888         * Modules/cache/DOMCache.cpp:
2889         (WebCore::DOMCache::retrieveRecords):
2890         (WebCore::DOMCache::batchDeleteOperation):
2891         (WebCore::DOMCache::batchPutOperation):
2892         * Modules/cache/DOMCacheStorage.cpp:
2893         (WebCore::DOMCacheStorage::retrieveCaches):
2894         (WebCore::DOMCacheStorage::open):
2895         (WebCore::DOMCacheStorage::remove):
2896         * Modules/cache/WorkerCacheStorageConnection.cpp:
2897         (WebCore::WorkerCacheStorageConnection::doRemove):
2898         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
2899         (WebCore::recordsDataOrErrorFromRecords):
2900         (WebCore::recordsOrErrorFromRecordsData):
2901         * bindings/js/CachedScriptFetcher.cpp:
2902         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
2903         * contentextensions/ContentExtensionCompiler.cpp:
2904         (WebCore::ContentExtensions::compileRuleList):
2905         * contentextensions/ContentExtensionParser.cpp:
2906         (WebCore::ContentExtensions::getDomainList):
2907         (WebCore::ContentExtensions::loadTrigger):
2908         (WebCore::ContentExtensions::loadRule):
2909         (WebCore::ContentExtensions::loadEncodedRules):
2910         (WebCore::ContentExtensions::parseRuleList):
2911         * css/CSSFontFaceSrcValue.cpp:
2912         (WebCore::CSSFontFaceSrcValue::cachedFont):
2913         * css/CSSImageSetValue.cpp:
2914         (WebCore::CSSImageSetValue::loadBestFitImage):
2915         * css/CSSImageValue.cpp:
2916         (WebCore::CSSImageValue::loadImage):
2917         * css/StyleRuleImport.cpp:
2918         (WebCore::StyleRuleImport::requestStyleSheet):
2919         * dom/CallbackResult.h:
2920         (WebCore::CallbackResult<ReturnType>::type const):
2921         (WebCore::CallbackResult<ReturnType>::releaseReturnValue):
2922         * dom/Element.cpp:
2923         (WebCore::Element::getIntegralAttribute const):
2924         (WebCore::Element::getUnsignedIntegralAttribute const):
2925         * dom/ExceptionOr.h:
2926         (WebCore::ExceptionOr<ReturnType>::hasException const):
2927         (WebCore::ExceptionOr<void>::hasException const):
2928         * dom/ProcessingInstruction.cpp:
2929         (WebCore::ProcessingInstruction::checkStyleSheet):
2930         * html/HTMLInputElement.cpp:
2931         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
2932         (WebCore::HTMLInputElement::minLengthAttributeChanged):
2933         * html/HTMLLinkElement.cpp:
2934         (WebCore::HTMLLinkElement::process):
2935         * html/HTMLTextAreaElement.cpp:
2936         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
2937         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
2938         * html/parser/HTMLParserIdioms.cpp:
2939         (WebCore::parseHTMLNonNegativeInteger):
2940         * html/parser/HTMLParserIdioms.h:
2941         (WebCore::limitToOnlyHTMLNonNegative):
2942         * loader/CrossOriginPreflightChecker.cpp:
2943         (WebCore::CrossOriginPreflightChecker::startPreflight):
2944         * loader/DocumentLoader.cpp:
2945         (WebCore::DocumentLoader::loadMainResource):
2946         * loader/DocumentThreadableLoader.cpp:
2947         (WebCore::DocumentThreadableLoader::loadRequest):
2948         * loader/ImageLoader.cpp:
2949         (WebCore::ImageLoader::updateFromElement):
2950         * loader/LinkLoader.cpp:
2951         (WebCore::LinkLoader::preloadIfNeeded):
2952         (WebCore::LinkLoader::loadLink):
2953         * loader/MediaResourceLoader.cpp:
2954         (WebCore::MediaResourceLoader::requestResource):
2955         * loader/TextTrackLoader.cpp:
2956         (WebCore::TextTrackLoader::load):
2957         * loader/cache/CachedSVGDocumentReference.cpp:
2958         (WebCore::CachedSVGDocumentReference::load):
2959         * loader/icon/IconLoader.cpp:
2960         (WebCore::IconLoader::startLoading):
2961         * platform/URLParser.cpp:
2962         (WebCore::URLParser::parseIPv4Host):
2963         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2964         (WebCore::WebCoreAVCFResourceLoader::startLoading):
2965         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2966         (WebCore::WebCoreAVFResourceLoader::startLoading):
2967         * svg/SVGFEImageElement.cpp:
2968         (WebCore::SVGFEImageElement::requestImageResource):
2969         * svg/SVGFontFaceUriElement.cpp:
2970         (WebCore::SVGFontFaceUriElement::loadFont):
2971         * svg/SVGUseElement.cpp:
2972         (WebCore::SVGUseElement::updateExternalDocument):
2973         * xml/XSLImportRule.cpp:
2974         (WebCore::XSLImportRule::loadSheet):
2975
2976 2017-12-04  Zalan Bujtas  <zalan@apple.com>
2977
2978         REGRESSION (r211531): Text flow changes and overlaps other text after double-click selecting paragraph
2979         https://bugs.webkit.org/show_bug.cgi?id=180377
2980         <rdar://problem/34337967>
2981
2982         Reviewed by Antti Koivisto.
2983
2984         Take floats into account when computing the available width for a certain vertical position.
2985
2986         Test: fast/block/float/simple-line-layout-float-shrink-line.html
2987
2988         * rendering/SimpleLineLayout.cpp:
2989         (WebCore::SimpleLineLayout::updateLineConstrains):
2990
2991 2017-12-04  Antoine Quint  <graouts@apple.com>
2992
2993         <video> and scale() transforms yield shrunk small or clipped controls
2994         https://bugs.webkit.org/show_bug.cgi?id=180358
2995         <rdar://problem/34436124>
2996
2997         Reviewed by Dean Jackson.
2998
2999         To compute the bounds of the media controls, we would call getBoundingClientRect()
3000         on the root-most element in the shadow root, which is styled to have width and height
3001         set to 100%, which allows to match the metrics of the host media element, without
3002         the borders.
3003
3004         However, if the host media element has CSS transforms applied, these would be factored
3005         into calls to getBoundingClientRect() and the controls would be too large and clipped,
3006         in case the scale was more than 1, or shrunk, in case the scale was less than 1.
3007
3008         To obtain correct metrics, we computed the complete transformation matrix applied to
3009         the host media element, and apply its inverted matrix to each corner point of the
3010         bounds returned for the root-most container element in the shadow root.
3011
3012         Then we compute the width and height of this transformed rectangle and set those to
3013         be our media controls' metrics.
3014
3015         Test: media/modern-media-controls/css/transformed-media.html
3016
3017         * Modules/modern-media-controls/media/media-controller.js:
3018         (MediaController.prototype._updateControlsSize):
3019         (MediaController.prototype._controlsWidth): Deleted.
3020
3021 2017-12-04  Antoine Quint  <graouts@apple.com>
3022
3023         Cursor is not visible after exiting full screen video
3024         https://bugs.webkit.org/show_bug.cgi?id=180247
3025         <rdar://problem/33885922>
3026
3027         Reviewed by Dean Jackson.
3028
3029         There is a dedicated NSCursor method to temporarily hide the mouse cursor while the mouse is idle,
3030         so we use this platform functionality, already exposed through the page chrome, instead which
3031         implements the expected behavior. Now, the mouse cursor is hidden while the mouse is stationary
3032         when a <video> is fullscreen, as before, but as soon as the user exits fullscreen, the mouse cursor
3033         reappears.
3034
3035         No test provided as I don't believe this platform behavior can be tested, there is no API to query
3036         whether the cursor is visible.
3037
3038         * page/EventHandler.cpp:
3039         (WebCore::EventHandler::cancelAutoHideCursorTimer):
3040         (WebCore::EventHandler::autoHideCursorTimerFired):
3041
3042 2017-12-04  Chris Dumez  <cdumez@apple.com>
3043
3044         ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&) is unsafe
3045         https://bugs.webkit.org/show_bug.cgi?id=180372
3046
3047         Reviewed by Youenn Fablet.
3048
3049         Ref the WorkerThread and capture it in the lambda. Keep the pending promises in
3050         a HashMap on the ServiceWorkerGlobalScope so that they stay on the worker thread.
3051
3052         * workers/service/ServiceWorkerGlobalScope.cpp:
3053         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
3054         * workers/service/ServiceWorkerGlobalScope.h:
3055
3056 2017-12-04  Brady Eidson  <beidson@apple.com>
3057
3058         Get a directory path to SWServers for storing ServiceWorker registrations.
3059         https://bugs.webkit.org/show_bug.cgi?id=180362
3060
3061         Reviewed by Chris Dumez.
3062
3063         No new tests (No observable behavior change yet).
3064
3065         * workers/service/server/SWServer.cpp:
3066         (WebCore::SWServer::SWServer):
3067         * workers/service/server/SWServer.h:
3068
3069 2017-12-04  Devin Rousso  <webkit@devinrousso.com>
3070
3071         Web Inspector: provide method for recording CanvasRenderingContext2D from JavaScript
3072         https://bugs.webkit.org/show_bug.cgi?id=175166
3073         <rdar://problem/34040740>
3074
3075         Reviewed by Joseph Pecoraro.
3076
3077         No new tests, updated existing tests.
3078
3079         * inspector/InspectorCanvas.h:
3080         * inspector/InspectorCanvas.cpp:
3081         (WebCore::InspectorCanvas::resetRecordingData):
3082
3083         * inspector/InspectorCanvasAgent.h:
3084         * inspector/InspectorCanvasAgent.cpp:
3085         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
3086         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
3087
3088         * inspector/InspectorInstrumentation.h:
3089         * inspector/InspectorInstrumentation.cpp:
3090         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
3091         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvasImpl):
3092
3093         * page/PageConsoleClient.h:
3094         * page/PageConsoleClient.cpp:
3095         (WebCore::PageConsoleClient::record):
3096         (WebCore::PageConsoleClient::recordEnd):
3097
3098         * workers/WorkerConsoleClient.h:
3099         * workers/WorkerConsoleClient.cpp:
3100         (WebCore::WorkerConsoleClient::record):
3101         (WebCore::WorkerConsoleClient::recordEnd):
3102
3103 2017-12-04  Youenn Fablet  <youenn@apple.com>
3104
3105         Call "Terminate Service Worker" on all workers when all their clients are gone
3106         https://bugs.webkit.org/show_bug.cgi?id=179552
3107
3108         Reviewed by Chris Dumez.
3109
3110         Tested manually.
3111
3112         When SWServer detects that there is no longer any client for a given client origin,
3113         it iterates through the running workers to terminate them if they have the given client origin.
3114         A timer of 60 seconds is used in case a user closes a tab or a window, and reopens one with the same origin shortly after.
3115
3116         * workers/service/server/SWServer.cpp:
3117         (WebCore::SWServer::findClientByIdentifier):
3118         (WebCore::SWServer::matchAll):
3119         (WebCore::SWServer::registerServiceWorkerClient):
3120         (WebCore::SWServer::unregisterServiceWorkerClient):
3121         * workers/service/server/SWServer.h:
3122
3123 2017-12-04  Antti Koivisto  <antti@apple.com>
3124
3125         Enable selector filtering for ::before and ::after pseudo element resolution
3126         https://bugs.webkit.org/show_bug.cgi?id=180364
3127
3128         Reviewed by Ryosuke Niwa.
3129
3130         Since these pseudo elements are now resolved by TreeResolver we can use selector filter for them.
3131
3132         This is 10%+ progression in StyleBench pseudo element subtest.
3133
3134         * css/StyleResolver.cpp:
3135         (WebCore::StyleResolver::pseudoStyleForElement):
3136         * css/StyleResolver.h:
3137         * style/StyleTreeResolver.cpp:
3138         (WebCore::Style::TreeResolver::resolvePseudoStyle):
3139
3140 2017-12-04  Youenn Fablet  <youenn@apple.com>
3141
3142         Add support https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
3143         https://bugs.webkit.org/show_bug.cgi?id=180359
3144
3145         Reviewed by Chris Dumez.
3146
3147         This algorithm is needed for implementation of claim.
3148         As per specification, it is run for every client unload, hence why this is put in removeClientUsingRegistration.
3149
3150         * workers/service/server/SWServerRegistration.cpp:
3151         (WebCore::SWServerRegistration::removeClientUsingRegistration):
3152         (WebCore::SWServerRegistration::handleClientUnload):
3153         * workers/service/server/SWServerRegistration.h:
3154
3155 2017-12-04  Antti Koivisto  <antti@apple.com>
3156
3157         Remove duplicates from selector filter hashes
3158         https://bugs.webkit.org/show_bug.cgi?id=180354
3159
3160         Reviewed by Simon Fraser.
3161
3162         We have only four slots for hashes in RuleSet and adding more regresses performance. To use the limited slots
3163         better we should eliminate duplicates.
3164
3165         This patch also switches to using std::array instead of a C array for the hashes.
3166
3167         The patch reduces the number of selectors passing through the selector filter in StyleBench by ~0.4%.
3168
3169         * css/ElementRuleCollector.cpp:
3170         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
3171         * css/RuleSet.cpp:
3172         (WebCore::RuleData::RuleData):
3173         * css/RuleSet.h:
3174         (WebCore::RuleData::descendantSelectorIdentifierHashes const):
3175         * css/SelectorFilter.cpp:
3176         (WebCore::collectDescendantSelectorIdentifierHashes):
3177         (WebCore::SelectorFilter::collectIdentifierHashes):
3178         * css/SelectorFilter.h:
3179         (WebCore::SelectorFilter::fastRejectSelector const):
3180
3181 2017-12-04  Youenn Fablet  <youenn@apple.com>
3182
3183         WorkerCacheStorageConnection should handle the case of terminated workers
3184         https://bugs.webkit.org/show_bug.cgi?id=180304
3185
3186         Reviewed by Chris Dumez.
3187
3188         No web page observable change of behavior.
3189
3190         Reworked WorkerCacheStorageConnection hopping.
3191         Instead of refing/unrefing itself, it refs the worker thread and the main thread connection.
3192         This worker thread is then used on the way back from the main thread.
3193
3194         * Modules/cache/WorkerCacheStorageConnection.cpp:
3195         (WebCore::WorkerCacheStorageConnection::create):
3196         (WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
3197         (WebCore::WorkerCacheStorageConnection::doOpen):
3198         (WebCore::WorkerCacheStorageConnection::doRemove):
3199         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
3200         (WebCore::WorkerCacheStorageConnection::reference):
3201         (WebCore::WorkerCacheStorageConnection::dereference):
3202         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
3203         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
3204         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
3205         * Modules/cache/WorkerCacheStorageConnection.h:
3206         * workers/WorkerGlobalScope.cpp:
3207         (WebCore::WorkerGlobalScope::cacheStorageConnection):
3208         * workers/WorkerGlobalScope.h:
3209
3210 2017-12-04  Frederic Wang  <fwang@igalia.com>
3211
3212         Make ScrollingTreeNode::enclosingFrameNode return the node itself for frame nodes
3213         https://bugs.webkit.org/show_bug.cgi?id=180353
3214
3215         Reviewed by Antonio Gomes.
3216
3217         This function was introduced in bug 175135 to solve a rendering bug with fixed positioned
3218         nodes in overflow nodes. For a frame node, the reference frame to use for fixed nodes is
3219         actually the frame node itself or otherwise we will get the same rendering bug. This patch
3220         makes enclosingFrameNode return the node itself when it is a frame node and renames it to
3221         clarify this behavior. Currently, enclosingFrameNode is not used for frame nodes so the
3222         behavior is unchanged.
3223
3224         No new tests, behavior is unchanged.
3225
3226         * page/scrolling/ScrollingTreeNode.cpp:
3227         (WebCore::ScrollingTreeNode::enclosingFrameNodeIncludingSelf): Start the search from a frame
3228         scrolling node from the node itself. Renamed to make explicit that this function may include
3229         the node itself.
3230         * page/scrolling/ScrollingTreeNode.h: Renamed.
3231
3232 2017-12-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3233
3234         [WPE][GTK] Implement PAL::SleepDisabler
3235         https://bugs.webkit.org/show_bug.cgi?id=178485
3236
3237         Reviewed by Carlos Garcia Campos.
3238
3239         Add a comment to warn about some odd use of SleepDisabler in HTMLMediaElement.
3240
3241         * html/HTMLMediaElement.cpp:
3242         (WebCore::HTMLMediaElement::shouldDisableSleep const):
3243
3244 2017-12-04  Frederic Wang  <fwang@igalia.com>
3245
3246         Bug 161300 - Move RenderMathMLRoot:RootType and RenderMathMLScripts:ScriptsType to element classes
3247         https://bugs.webkit.org/show_bug.cgi?id=161300
3248
3249         Reviewed by Darin Adler.
3250
3251         RenderMathMLRoot::m_kind and RenderMathMLScripts::m_scriptType are initialized in the
3252         constructors of the renderer classes from the tag name of the corresponding elements.
3253         This patch moves them into the corresponding element classes and makes them const members
3254         parsed in the constructors. It also introduces a MathMLRootElement class deriving from
3255         MathMLRowElement to store the new member. Finally, the types are redefined as enum classes.
3256
3257         No new tests, behavior unchanged and already covered by existing tests.
3258
3259         * Sources.txt: Add MathMLRootElement files.
3260         * WebCore.xcodeproj/project.pbxproj: Ditto.
3261         * mathml/MathMLAllInOne.cpp: Ditto.
3262         * mathml/MathMLRootElement.cpp:
3263         (WebCore::element): Override this function to downcast to MathMLRootElement.
3264         (WebCore::rootTypeOf): Helper function to parse the root type, moved from RenderMathMLRoot.
3265         (WebCore::MathMLRootElement::MathMLRootElement): Initialize the root type.
3266         (WebCore::MathMLRootElement::create):
3267         (WebCore::MathMLRootElement::createElementRenderer): Moved from MathMLRowElement.
3268         * mathml/MathMLRootElement.h: New class deriving from MathMLRowElement, with a RootType
3269         member exposed to the renderer class.
3270         * mathml/MathMLRowElement.cpp: Remove header for RenderMathMLRoot.h.
3271         (WebCore::MathMLRowElement::createElementRenderer): Moved to MathMLRootElement.
3272         * mathml/MathMLScriptsElement.cpp: Introduce a script type.
3273         (WebCore::scriptTypeOf): Helper function to parse the script type, moved from
3274         RenerMathMLScripts.
3275         (WebCore::MathMLScriptsElement::MathMLScriptsElement): Initialize the script type.
3276         * mathml/MathMLScriptsElement.h: Add new script type member.
3277         (WebCore::MathMLScriptsElement::scriptType const): Expose the script type to the renderer
3278         class.
3279         * mathml/mathtags.in: Map <msqrt> and <mroot> to MathMLRootElement.
3280         * rendering/mathml/RenderMathMLRoot.cpp:
3281         (WebCore::RenderMathMLRoot::RenderMathMLRoot): Use MathMLRootElement and remove parsing of
3282         the root type.
3283         (WebCore::RenderMathMLRoot::rootType const): Helper function to access the root type from
3284         the element class.
3285         (WebCore::RenderMathMLRoot::isValid const): Use rootType() and add prefix for enum class
3286         values.
3287         (WebCore::RenderMathMLRoot::getBase const): Ditto.
3288         (WebCore::RenderMathMLRoot::getIndex const): Ditto.
3289         (WebCore::RenderMathMLRoot::horizontalParameters): Ditto.
3290         (WebCore::RenderMathMLRoot::verticalParameters): Ditto.
3291         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): Ditto.
3292         (WebCore::RenderMathMLRoot::layoutBlock): Ditto.
3293         (WebCore::RenderMathMLRoot::paint): Ditto.
3294         * rendering/mathml/RenderMathMLRoot.h: Define root type as an enum class, replace
3295         MathMLRowElement with MathMLRootElement, declare and use new rootType() function and remove
3296         the m_kind member.
3297         * rendering/mathml/RenderMathMLScripts.cpp:
3298         (WebCore::RenderMathMLScripts::RenderMathMLScripts): Remove parsing of script type.
3299         (WebCore::RenderMathMLScripts::scriptType const): Helper function to access the script type
3300         from the element class.
3301         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren): Use scriptType() and add
3302         prefix for enum class values.
3303         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Ditto.
3304         (WebCore::RenderMathMLScripts::verticalMetrics): Ditto.
3305         (WebCore::RenderMathMLScripts::layoutBlock): Ditto.
3306         * rendering/mathml/RenderMathMLScripts.h: Define root type as an enum class, declare the
3307         scriptType() function and remove the m_scriptType member.
3308         * rendering/mathml/RenderMathMLUnderOver.cpp:
3309         (WebCore::RenderMathMLUnderOver::isValid const): Use scriptType() and add prefix for enum
3310         class values.
3311         (WebCore::RenderMathMLUnderOver::under const): Ditto.
3312         (WebCore::RenderMathMLUnderOver::over const): Ditto.
3313         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Ditto.
3314         (WebCore::RenderMathMLUnderOver::hasAccent const): Ditto.
3315         (WebCore::RenderMathMLUnderOver::layoutBlock): Ditto.
3316
3317 2017-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3318
3319         [GStreamer] More leaks in TextCombinerGStreamer
3320         https://bugs.webkit.org/show_bug.cgi?id=180331
3321
3322         Reviewed by Michael Catanzaro.
3323
3324         I've noticed more leaks reading the code, but I couldn't check them with valgrind, because I don't know how to
3325         trigger that code path. This patch cleans up the file using smart pointer everywhere.
3326
3327         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
3328         (webkit_text_combiner_pad_init):
3329         (webkitTextCombinerPadEvent):
3330         (webkitTextCombinerReleasePad):
3331
3332 2017-12-04  Jer Noble  <jer.noble@apple.com>
3333
3334         Include 'video/*' in image request Accept header if browser supports video media in image contexts.
3335         https://bugs.webkit.org/show_bug.cgi?id=179178
3336
3337         Reviewed by Alex Christensen.
3338
3339         Test: http/tests/images/image-supports-video.html
3340
3341         Ensure that 'video/*' is included in the Accept header by asking the ImageDecoder whether "Video"
3342         media is supported. The ImageDecoder will ask all it's constituent decoders, which aside from
3343         ImageDecoderAVFObjC will say only support the "Image" media type.
3344
3345         Drive-by fix: Make sure the MIMETypeRegistry includes all the types supported by AVFoundation when
3346         ImageDecoderAVFObjC is enabled. Also, now that Image reports it can support video mime types, check
3347         whether MediaDocument can support a given mime type before asking ImageDocument.
3348
3349         * html/HTMLImageElement.cpp:
3350         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3351         * loader/LinkLoader.cpp:
3352         (WebCore::LinkLoader::isSupportedType):
3353         * loader/cache/CachedResourceRequest.cpp:
3354         (WebCore::acceptHeaderValueFromType):
3355         * platform/MIMETypeRegistry.cpp:
3356         (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
3357         (WebCore::MIMETypeRegistry::isSupportedImageOrSVGMIMEType): Deleted.
3358         * platform/MIMETypeRegistry.h:
3359         * platform/graphics/ImageDecoder.cpp:
3360         (WebCore::ImageDecoder::supportsMediaType):
3361         * platform/graphics/ImageDecoder.h:
3362         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
3363         (WebCore::ImageDecoderAVFObjC::supportsMediaType):
3364         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3365         (WebCore::ImageDecoderAVFObjC::supportsContentType):
3366         * platform/graphics/cg/ImageDecoderCG.h:
3367         * platform/graphics/win/ImageDecoderDirect2D.h:
3368         * platform/image-decoders/ScalableImageDecoder.h:
3369         (WebCore::ScalableImageDecoder::supportsMediaType):
3370         * html/parser/HTMLPreloadScanner.cpp:
3371         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3372
3373 2017-12-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3374
3375         WTF shouldn't have both Thread and ThreadIdentifier
3376         https://bugs.webkit.org/show_bug.cgi?id=180308
3377
3378         Reviewed by Darin Adler.
3379
3380         No behavior change.
3381
3382         * Modules/indexeddb/IDBActiveDOMObject.h:
3383         (WebCore::IDBActiveDOMObject::originThread const):
3384         (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread):
3385         (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread):
3386         (WebCore::IDBActiveDOMObject::originThreadID const): Deleted.
3387         * Modules/indexeddb/IDBCursor.cpp:
3388         (WebCore::IDBCursor::IDBCursor):
3389         (WebCore::IDBCursor::~IDBCursor):
3390         (WebCore::IDBCursor::sourcesDeleted const):
3391         (WebCore::IDBCursor::transaction const):
3392         (WebCore::IDBCursor::update):
3393         (WebCore::IDBCursor::advance):
3394         (WebCore::IDBCursor::continueFunction):
3395         (WebCore::IDBCursor::uncheckedIterateCursor):
3396         (WebCore::IDBCursor::deleteFunction):
3397         (WebCore::IDBCursor::setGetResult):
3398         * Modules/indexeddb/IDBDatabase.cpp:
3399         (WebCore::IDBDatabase::~IDBDatabase):
3400         (WebCore::IDBDatabase::hasPendingActivity const):
3401         (WebCore::IDBDatabase::name const):
3402         (WebCore::IDBDatabase::version const):
3403         (WebCore::IDBDatabase::objectStoreNames const):
3404         (WebCore::IDBDatabase::renameObjectStore):
3405         (WebCore::IDBDatabase::renameIndex):
3406         (WebCore::IDBDatabase::createObjectStore):
3407         (WebCore::IDBDatabase::transaction):
3408         (WebCore::IDBDatabase::deleteObjectStore):
3409         (WebCore::IDBDatabase::close):
3410         (WebCore::IDBDatabase::connectionToServerLost):
3411         (WebCore::IDBDatabase::maybeCloseInServer):
3412         (WebCore::IDBDatabase::activeDOMObjectName const):
3413         (WebCore::IDBDatabase::canSuspendForDocumentSuspension const):
3414         (WebCore::IDBDatabase::stop):
3415         (WebCore::IDBDatabase::startVersionChangeTransaction):
3416         (WebCore::IDBDatabase::didStartTransaction):
3417         (WebCore::IDBDatabase::willCommitTransaction):
3418         (WebCore::IDBDatabase::didCommitTransaction):
3419         (WebCore::IDBDatabase::willAbortTransaction):
3420         (WebCore::IDBDatabase::didAbortTransaction):