cde22511ad63c295c142d32daac47b6465734ad7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-12-06  John Wilander  <wilander@apple.com>
2
3         Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes
4         https://bugs.webkit.org/show_bug.cgi?id=176944
5         <rdar://problem/34440658>
6
7         Reviewed by Brent Fulgham.
8
9         Test: http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-user-gesture.html
10
11         This change introduces document.hasStorageAccess() as a function which
12         returns a promise instead of being a property. Since cookie access can
13         be due to both a granted request and recent user interaction as first
14         party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted.
15
16         * dom/Document.cpp:
17         (WebCore::Document::hasStorageAccess):
18         (WebCore::Document::requestStorageAccess):
19             Removed check of the previous m_hasStorageAccess member.
20             Same-origin check done earlier. This was a request/suggestion
21             from Mozilla.
22         * dom/Document.h:
23         (WebCore::Document::hasStorageAccess const): Deleted.
24             Now uses a promise.
25         * dom/Document.idl:
26         * page/ChromeClient.h:
27
28 2017-12-06  Youenn Fablet  <youenn@apple.com>
29
30         REGRESSION (r225537): Crash in WebCore::SWServerWorker::setHasPendingEvents(bool) + 68
31         https://bugs.webkit.org/show_bug.cgi?id=180481
32
33         Reviewed by Chris Dumez.
34
35         Replacing ASSERT by if null check since there is no strong guarantee right now that there is a registration
36         in SWServer registration map associated to a SWServerWorker.
37
38         * workers/service/server/SWServerWorker.cpp:
39         (WebCore::SWServerWorker::setHasPendingEvents):
40
41 2017-12-06  Chris Dumez  <cdumez@apple.com>
42
43         ServiceWorkers API should reject promises when calling objects inside detached frames
44         https://bugs.webkit.org/show_bug.cgi?id=180444
45
46         Reviewed by Youenn Fablet.
47
48         ServiceWorkers API should reject promises when calling objects inside detached frames.
49
50         No new tests, rebaselined existing test.
51
52         * bindings/js/JSDOMPromiseDeferred.h:
53         (WebCore::callPromiseFunction):
54         Use the caller's globalObject instead of the lexicalGlobalObject when constructing the
55         deferred promise. The bug became visible when working on this service worker bug since
56         rejecting the promise when the frame is detached did not actually work. The issue is
57         that since the promise was created with the detached frame's globalObject, then it was
58         suspended and would not run script.
59
60         * bindings/js/JSDOMWindowBase.cpp:
61         (WebCore::callerGlobalObject):
62         (WebCore::incumbentDOMWindow):
63         * bindings/js/JSDOMWindowBase.h:
64         Add convenience function to get the caller's globalObject. It was carved out of
65         incumbentDOMWindow().
66
67         * workers/service/ServiceWorker.cpp:
68         (WebCore::ServiceWorker::postMessage):
69         * workers/service/ServiceWorkerContainer.cpp:
70         (WebCore::ServiceWorkerContainer::addRegistration):
71         (WebCore::ServiceWorkerContainer::getRegistration):
72         (WebCore::ServiceWorkerContainer::getRegistrations):
73         * workers/service/ServiceWorkerRegistration.cpp:
74         (WebCore::ServiceWorkerRegistration::update):
75         (WebCore::ServiceWorkerRegistration::unregister):
76         Reject the promise when m_isStopped flag is set (i.e. ActiveDOMObject::stop()
77         has been called).
78
79 2017-12-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
80
81         [Mac] REGRESSION (r224527): Drawing a path with box-shadow takes double the blur-radius on Retina display
82         https://bugs.webkit.org/show_bug.cgi?id=180460
83         <rdar://problem/35869866>
84
85         Reviewed by Daniel Bates.
86
87         Disable using CGContextDrawPathDirect() for macOS High Sierra or earlier.
88         This API has a bug when drawing a path with a shadow on Retina display.
89
90         * platform/graphics/cg/GraphicsContextCG.cpp:
91
92 2017-12-06  Youenn Fablet  <youenn@apple.com>
93
94         Service Worker fetch should filter HTTP headers that are added by CachedResourceLoader/CachedResource
95         https://bugs.webkit.org/show_bug.cgi?id=180462
96
97         Reviewed by Geoffrey Garen.
98
99         Coved by rebased test.
100
101         * loader/CrossOriginAccessControl.cpp:
102         (WebCore::cleanRedirectedRequestForAccessControl): Accept header is a safe header so it is fine to keep it.
103         * workers/service/context/ServiceWorkerFetch.cpp:
104         (WebCore::ServiceWorkerFetch::dispatchFetchEvent): Cleaning headers added by CachedResourceLoader/CachedResource.
105
106 2017-12-06  Zan Dobersek  <zdobersek@igalia.com>
107
108         [CoordGraphics] Introduce Nicosia::PaintingContext, add Cairo implementation
109         https://bugs.webkit.org/show_bug.cgi?id=180239
110
111         Reviewed by Michael Catanzaro.
112
113         As the next step in the Nicosia abstraction formation, we introduce
114         Nicosia::PaintingContext. Implementations of this class will leverage a
115         chosen 2D graphics library to paint (through GraphicsContext) into the
116         memory area that's specified by a given Nicosia::Buffer object.
117
118         Nicosia::Buffer is slimmed down to only control the memory that's
119         required for rasterization of an RGBA32 painting output. It mimics the
120         Cairo ImageBuffer implementation by using FastMalloc to allocate the
121         necessary memory. In the future this class might become an interface of
122         which different implementations will be providing memory that's
123         allocated through different ways. For instance, when GLES3 is available,
124         it would be possible to map GPU memory into the process memory space and
125         rasterize into that, effectively eliminating need for GPU uploads.
126
127         Since the ImageBuffer use in Nicosia::Buffer is dropped, the context()
128         and uploadImage() methods are also removed. The functionality of
129         ImageBuffer that was leveraged for CoordinatedGraphics rasterization
130         still remains used through the PaintingContextCairo implementation. In
131         the constructor of that class, with the target Nicosia::Buffer provided,
132         we construct the cairo_surface_t and cairo_t objects that are necessary
133         to create a combination of PlatformContextCairo and GraphicsContext
134         objects that we can then use for rasterization.
135
136         Reference of the passed-in Nicosia::Buffer object is increased for the
137         lifetime of the cairo_surface_t object that will be drawing into that
138         buffer's memory area. This ensures the memory area doesn't disappear
139         from a live cairo_surface_t. Still, the expectation is that the
140         cairo_surface_t object won't outlive the PaintingContextCairo object's
141         lifetime, since the cairo_t object is also managed here and deleted in
142         the destructor. To test that, we use a cairo_surface_t user data key
143         that in its destroy callback dereferences the Nicosia::Buffer object and
144         also marks the deletion process for the related PaintingContextCairo
145         object as complete. This m_deletionComplete value is tested in the
146         destructor of the class, once all the Cairo references are nulled out.
147
148         The PaintingContext objects should be limited to a single scope,
149         enabling the implementation resources to assume that the lifetime of the
150         implementation object won't extend outside of the scope where it was
151         created. To ensure that, the PaintingContext::paint() static function is
152         added that creates the PaintingContext object and then executes the
153         passed-in functor, passing it the GraphicsContext that should be used
154         for drawing. Drawing is thus limited to that functor only, and the
155         PaintingContext's create() function and the virtual graphicsContext()
156         are not made public in the class.
157
158         No new tests -- no change in functionality.
159
160         * platform/TextureMapper.cmake:
161         * platform/graphics/nicosia/NicosiaBuffer.cpp:
162         (Nicosia::Buffer::Buffer):
163         (Nicosia::Buffer::context): Deleted.
164         (Nicosia::Buffer::uploadImage): Deleted.
165         * platform/graphics/nicosia/NicosiaBuffer.h:
166         (Nicosia::Buffer::stride const):
167         (Nicosia::Buffer::data const):
168         * platform/graphics/nicosia/NicosiaPaintingContext.cpp: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp.
169         (Nicosia::PaintingContext::create):
170         * platform/graphics/nicosia/NicosiaPaintingContext.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp.
171         (Nicosia::PaintingContext::paint):
172         * platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp: Added.
173         (Nicosia::PaintingContextCairo::PaintingContextCairo):
174         (Nicosia::PaintingContextCairo::~PaintingContextCairo):
175         (Nicosia::PaintingContextCairo::graphicsContext):
176         * platform/graphics/nicosia/NicosiaPaintingContextCairo.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.h.
177         * platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp:
178         (Nicosia::PaintingEngineBasic::paint):
179         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
180         (WebCore::CoordinatedImageBacking::update):
181
182 2017-12-05  Fujii Hironori  <Hironori.Fujii@sony.com>
183
184         [GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html crashes and times out
185         https://bugs.webkit.org/show_bug.cgi?id=160131
186
187         Reviewed by Eric Carlson.
188
189         Null dereference can be happen if VideoTrack and AudioTrack are
190         disconnected from its media element.
191
192         No new tests, no behavior change.
193
194         * html/track/AudioTrack.cpp:
195         (WebCore::AudioTrack::willRemove): Null-check mediaElement.
196         * html/track/VideoTrack.cpp:
197         (WebCore::VideoTrack::setLanguage): Ditto.
198
199 2017-12-05  Chris Dumez  <cdumez@apple.com>
200
201         ServiceWorkerGlobalScope prototype chain should be immutable
202         https://bugs.webkit.org/show_bug.cgi?id=180450
203
204         Reviewed by Youenn Fablet.
205
206         ServiceWorkerGlobalScope prototype chain should be immutable, similarly
207         to what we do for DOMWindow. This is covered by a web-platform-test
208         which was timing out because it was successfuly overwriting the
209         ServiceWorkerGlobalScope prototype.
210
211         No new tests, rebaselined existing test.
212
213         * workers/DedicatedWorkerGlobalScope.idl:
214         * workers/WorkerGlobalScope.idl:
215         * workers/service/ServiceWorkerGlobalScope.idl:
216
217 2017-12-05  Basuke Suzuki  <Basuke.Suzuki@sony.com>
218
219         Fast binding generation by batching several files at once
220         https://bugs.webkit.org/show_bug.cgi?id=179958
221
222         Reviewed by Alex Christensen.
223
224         Passing several files to the sub process at once and reducing the total cost of
225         process generation. Especially Windows port has great speed improvement because
226         its implementation of fork/exec is terrible.
227
228         * bindings/scripts/generate-bindings-all.pl:
229         (spawnGenerateBindingsIfNeeded):
230         * bindings/scripts/generate-bindings.pl:
231         (generateBindings):
232
233 2017-12-05  David Quesada  <david_quesada@apple.com>
234
235         [Web App Manifest] Support fetching the app manifest 
236         https://bugs.webkit.org/show_bug.cgi?id=180292
237
238         Reviewed by Geoffrey Garen.
239
240         Add support in WebCore for loading and parsing application manifests. This functionality
241         is currently exposed with two methods: DocumentLoader::loadApplicationManifest() to call
242         to start loading the manifest, and FrameLoaderClient::finishedLoadingApplicationManifest()
243         for clients to override in order to be notified of the loaded manifest.
244
245         No new tests, since no functionality is exposed to web content or embedders yet. The
246         needed SPI will be added in an upcoming patch.
247
248         * Sources.txt:
249         * WebCore.xcodeproj/project.pbxproj:
250             Added CachedApplicationManifest and ApplicationManifestLoader.
251         * html/HTMLLinkElement.h:
252         * html/LinkRelAttribute.cpp:
253         (WebCore::LinkRelAttribute::LinkRelAttribute):
254         (WebCore::LinkRelAttribute::isSupported):
255             Add "manifest" as a supported 'rel' type for links.
256         * html/LinkRelAttribute.h:
257         * inspector/agents/InspectorPageAgent.cpp:
258         (WebCore::InspectorPageAgent::resourceTypeJSON):
259         (WebCore::InspectorPageAgent::inspectorResourceType):
260         * inspector/agents/InspectorPageAgent.h:
261         * loader/ApplicationManifestLoader.cpp: Added.
262             Added a class ApplicationManifestLoader which handles creating a ResourceRequest,
263             loading the resource from the CachedResourceLoader, and parsing the resulting text.
264             This class and its relation to DocumentLoader are roughly based on that of IconLoader,
265             which serves a similar purpose - requesting a resource on the page and ultimately
266             providing it to the embedder.
267         (WebCore::ApplicationManifestLoader::ApplicationManifestLoader):
268         (WebCore::ApplicationManifestLoader::~ApplicationManifestLoader):
269         (WebCore::ApplicationManifestLoader::startLoading):
270         (WebCore::ApplicationManifestLoader::stopLoading):
271         (WebCore::ApplicationManifestLoader::processManifest):
272         (WebCore::ApplicationManifestLoader::notifyFinished):
273         * loader/ApplicationManifestLoader.h: Copied from Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.h.
274         * loader/DocumentLoader.cpp:
275         (WebCore::DocumentLoader::stopLoading):
276         (WebCore::DocumentLoader::loadApplicationManifest):
277         (WebCore::DocumentLoader::finishedLoadingApplicationManifest):
278         (WebCore::DocumentLoader::notifyFinishedLoadingApplicationManifest):
279         * loader/DocumentLoader.h:
280         * loader/FrameLoaderClient.h:
281         * loader/LinkLoader.cpp:
282         (WebCore::createLinkPreloadResourceClient):
283         (WebCore::LinkLoader::isSupportedType):
284         * loader/ResourceLoadInfo.cpp:
285         (WebCore::toResourceType):
286         * loader/SubresourceLoader.cpp:
287         (WebCore::logResourceLoaded):
288         * loader/cache/CachedApplicationManifest.cpp: Added.
289         (WebCore::CachedApplicationManifest::CachedApplicationManifest):
290         (WebCore::CachedApplicationManifest::finishLoading):
291         (WebCore::CachedApplicationManifest::setEncoding):
292         (WebCore::CachedApplicationManifest::encoding const):
293         (WebCore::CachedApplicationManifest::process):
294             Add a method to process the fetched text into an ApplicationManifest. CachedApplicationManifest
295             does not store the resulting ApplicationManifest because the text of an application
296             manifest can yield a different ApplicationManifest depending on the URL of the document
297             processing it.
298         * loader/cache/CachedApplicationManifest.h: Copied from Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.h.
299         * loader/cache/CachedResource.cpp:
300         (WebCore::CachedResource::defaultPriorityForResourceType):
301         * loader/cache/CachedResource.h:
302         * loader/cache/CachedResourceLoader.cpp:
303         (WebCore::createResource):
304         (WebCore::CachedResourceLoader::requestApplicationManifest):
305         (WebCore::contentTypeFromResourceType):
306         (WebCore::CachedResourceLoader::checkInsecureContent const):
307         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
308         * loader/cache/CachedResourceLoader.h:
309         * page/DiagnosticLoggingKeys.cpp:
310         (WebCore::DiagnosticLoggingKeys::applicationManifestKey):
311         * page/DiagnosticLoggingKeys.h:
312         * page/csp/ContentSecurityPolicy.cpp:
313         (WebCore::ContentSecurityPolicy::allowManifestFromSource const):
314         * page/csp/ContentSecurityPolicy.h:
315         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
316         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForManifest const):
317         (WebCore::ContentSecurityPolicyDirectiveList::addDirective):
318         * page/csp/ContentSecurityPolicyDirectiveList.h:
319         * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
320         * page/csp/ContentSecurityPolicyDirectiveNames.h:
321
322 2017-12-05  Stephan Szabo  <stephan.szabo@sony.com>
323
324         Switch windows build to Visual Studio 2017
325         https://bugs.webkit.org/show_bug.cgi?id=172412
326
327         Reviewed by Per Arne Vollan.
328
329         Only changes proj file to update generator
330
331         * WebCore.vcxproj/WebCore.proj:
332
333 2017-12-05  Brent Fulgham  <bfulgham@apple.com>
334
335         Limit user agent versioning to an upper bound
336         https://bugs.webkit.org/show_bug.cgi?id=180365
337         <rdar://problem/34550617>
338
339         Reviewed by Joseph Pecoraro.
340
341         Freeze the version reported as User Agent to OS 10.13.4 (OS 11.3 on iOS) and WebKit 605.1.15
342         for User Agent purposes.
343
344         Test: fast/dom/navigator-userAgent-frozen.html
345
346         * page/cocoa/UserAgent.h:
347         * page/cocoa/UserAgent.mm:
348         (WebCore::versionPredatesFreeze): Helper function. Returns true for Version 10.13.3 or older.
349         (WebCore::systemMarketingVersionForUserAgentString):
350         (WebCore::userAgentBundleVersion):
351         (WebCore::userVisibleWebKitBundleVersionFromFullVersion): Deleted.
352         (WebCore::userAgentBundleVersionFromFullVersionString): Deleted.
353         * page/ios/UserAgentIOS.mm:
354         (WebCore::standardUserAgentWithApplicationName): Don't take the WebKit bundle version
355         as an argument, or pass it to the user agent string generator.
356         * page/mac/UserAgentMac.mm:
357         (WebCore::standardUserAgentWithApplicationName): Ditto. 
358
359 2017-12-05  Matt Lewis  <jlewis3@apple.com>
360
361         Unreviewed, rolling out r225430.
362
363         This caused an API failure on release.
364
365         Reverted changeset:
366
367         "Move DateComponents into WTF"
368         https://bugs.webkit.org/show_bug.cgi?id=180211
369         https://trac.webkit.org/changeset/225430
370
371 2017-12-05  Simon Fraser  <simon.fraser@apple.com>
372
373         Composited frames incorrectly get requestAnimationFrame throttled
374         https://bugs.webkit.org/show_bug.cgi?id=178396
375
376         Reviewed by Zalan Bujtas.
377
378         If a composited iframe was inside overflow:scroll, and the overflow was scrolled to the left
379         further than the window width, then RenderLayer::childrenClipRect() would return an empty rectangle
380         and we'd incorrectly consider the iframe out of view, and thus throttle its requestAnimationFrame.
381
382         childrenClipRect() was taking unscaledDocumentRect(), applying the clip, and then mapping the result
383         from local to absolute coordinates (which mapped it through the overflow scroll offset). This is incorrect
384         because it considers the unscaledDocumentRect() to be in local coordinates, which it is not.
385
386         Instead, start with the infinite rect, which essentially tells us if we have any clipping, and then
387         intersect that with the document rect at the end. Something similar is done in other places that call.
388         calculateRects().
389
390         Test: fast/animation/request-animation-frame-throttle-inside-overflow-scroll.html
391
392         * rendering/RenderLayer.cpp:
393         (WebCore::RenderLayer::calculateClipRects const):
394
395 2017-12-05  Michael Saboff  <msaboff@apple.com>
396
397         Make WebKit build for ARM64_32
398         https://bugs.webkit.org/show_bug.cgi?id=180447
399
400         Reviewed by Mark Lam.
401
402         No new test as this isn't a change to functionality.
403
404         * platform/graphics/transforms/TransformationMatrix.cpp:
405         (WebCore::TransformationMatrix::multiply): Fallback to the C++ version for
406         ARM64_32.
407
408 2017-12-05  Chris Dumez  <cdumez@apple.com>
409
410         XMLHttpRequest should not be exposed to service workers
411         https://bugs.webkit.org/show_bug.cgi?id=180446
412
413         Reviewed by Youenn Fablet.
414
415         Stop exposing XMLHttpRequest to service workers, as per:
416         - https://xhr.spec.whatwg.org/#interface-xmlhttprequest
417
418         * xml/XMLHttpRequest.idl:
419
420 2017-12-05  Joseph Pecoraro  <pecoraro@apple.com>
421
422         Web Inspector: content views for resources loaded through XHR do not reflect declared mime-type
423         https://bugs.webkit.org/show_bug.cgi?id=141389
424         <rdar://problem/19767070>
425
426         Reviewed by Brian Burg.
427
428         Updated: http/tests/inspector/network/xhr-response-body.html:
429                  http/tests/inspector/network/fetch-response-body.html:
430
431         * xml/XMLHttpRequest.cpp:
432         (WebCore::XMLHttpRequest::didFinishLoading):
433         * inspector/InspectorInstrumentation.cpp:
434         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl): Deleted.
435         * inspector/InspectorInstrumentation.h:
436         (WebCore::InspectorInstrumentation::didFinishXHRLoading): Deleted.
437         Remove special handling of XHR content that decoded output as text.
438
439         * inspector/NetworkResourcesData.h:
440         (WebCore::NetworkResourcesData::ResourceData::requestId const):
441         (WebCore::NetworkResourcesData::ResourceData::loaderId const):
442         (WebCore::NetworkResourcesData::ResourceData::frameId const):
443         (WebCore::NetworkResourcesData::ResourceData::url const):
444         (WebCore::NetworkResourcesData::ResourceData::content const):
445         (WebCore::NetworkResourcesData::ResourceData::isContentEvicted const):
446         (WebCore::NetworkResourcesData::ResourceData::textEncodingName const):
447         * inspector/NetworkResourcesData.cpp:
448         (WebCore::NetworkResourcesData::ResourceData::ResourceData):
449         (WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
450         (WebCore::NetworkResourcesData::responseReceived):
451         (WebCore::NetworkResourcesData::setResourceContent):
452         (WebCore::shouldBufferResourceData):
453         (WebCore::NetworkResourcesData::maybeAddResourceData):
454         (WebCore::NetworkResourcesData::maybeDecodeDataToContent):
455
456         Make NetworkResourcesData only create a text decoder for resources we
457         really think are text, and buffer resource data if it is text data
458         or if it is a resource that would otherwise not be buffered by WebCore
459         (such as XHRs with a DoNotBufferData policy). This ensures that the
460         Inspector will have data to show for resources that won't be cached.
461
462         * inspector/agents/InspectorPageAgent.cpp:
463         (WebCore::InspectorPageAgent::resourceContent):
464         (WebCore::InspectorPageAgent::sourceMapURLForResource):
465         (WebCore::InspectorPageAgent::searchInResource):
466         (WebCore::InspectorPageAgent::searchInResources):
467         (WebCore::hasTextContent): Deleted.
468         (WebCore::InspectorPageAgent::cachedResourceContent): Deleted.
469         (WebCore::InspectorPageAgent::createTextDecoder): Deleted.
470         (WebCore::textContentForCachedResource): Deleted.
471         * inspector/agents/InspectorPageAgent.h:
472         * inspector/agents/InspectorNetworkAgent.cpp:
473         (WebCore::InspectorNetworkAgent::didReceiveData):
474         (WebCore::InspectorNetworkAgent::willDestroyCachedResource):
475         (WebCore::InspectorNetworkAgent::getResponseBody):
476         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
477         (WebCore::InspectorNetworkAgent::createTextDecoder):
478         (WebCore::InspectorNetworkAgent::textContentForCachedResource):
479         (WebCore::InspectorNetworkAgent::cachedResourceContent):
480         (WebCore::textContentForResourceData):
481         (WebCore::InspectorNetworkAgent::searchOtherRequests):
482         (WebCore::isErrorStatusCode): Deleted.
483         (WebCore::InspectorNetworkAgent::didFinishXHRLoading): Deleted.
484         * inspector/agents/InspectorNetworkAgent.h:
485         Move static PageAgent functions related to the generic data tuple
486         (content, base64Encoded) to NetworkAgent. Also generalize it to
487         not rely on the CachedResourceType, but instead rely on the MIME type.
488         This has a few changes in behavior:
489
490             - Images, may now be text if they have a text mime type (image/svg+xml).
491             - XHR / Fetch / Other may be sent as text if they have a text mime type.
492             - XHR / Fetch / Other are not assumed to be text, and may be sent as base64 encoded.
493         
494         For this to be useful the frontend should also check the mime type and
495         display an appropriate ContentView.
496
497 2017-12-05  Youenn Fablet  <youenn@apple.com>
498
499         Implement https://w3c.github.io/ServiceWorker/#clients-claim
500         https://bugs.webkit.org/show_bug.cgi?id=180261
501
502         Reviewed by Chris Dumez.
503
504         Test: http/tests/workers/service/serviceworkerclients-claim.https.html
505
506         Implement claim by going to the storage process and then iterate over clients to see whether active worker can be set.
507         Update SWServerWorker to call registration tryClear/tryActivate whenever a service worker has no pending event.
508
509         * workers/service/ServiceWorkerClients.cpp:
510         (WebCore::ServiceWorkerClients::claim):
511         * workers/service/context/SWContextManager.h:
512         * workers/service/server/SWServer.cpp:
513         (WebCore::SWServer::claim):
514         (WebCore::SWServer::doRegistrationMatching):
515         (WebCore::SWServer::doRegistrationMatching const): Deleted.
516         * workers/service/server/SWServer.h:
517         (WebCore::SWServer::Connection::doRegistrationMatching):
518         * workers/service/server/SWServerRegistration.cpp:
519         (WebCore::SWServerRegistration::controlClient):
520         * workers/service/server/SWServerRegistration.h:
521         * workers/service/server/SWServerToContextConnection.cpp:
522         (WebCore::SWServerToContextConnection::claim):
523         * workers/service/server/SWServerToContextConnection.h:
524         * workers/service/server/SWServerWorker.cpp:
525         (WebCore::SWServerWorker::claim):
526         * workers/service/server/SWServerWorker.h:
527
528 2017-12-05  Per Arne Vollan  <pvollan@apple.com>
529
530         [Win] Scrollbars are sometimes not rendered in accelerated compositing mode.
531         https://bugs.webkit.org/show_bug.cgi?id=180431
532         <rdar://problem/34531264>
533
534         Reviewed by Simon Fraser.
535
536         No new tests, covered by existing tests.
537
538         When a scroll layer is required, we will create an overflow control hosts layer.
539         In this case the method RenderLayerCompositor::shouldCompositeOverflowControls()
540         should return true, otherwise the scrollbars will not be rendered.
541  
542         * rendering/RenderLayerCompositor.cpp:
543         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
544
545 2017-12-05  Youenn Fablet  <youenn@apple.com>
546
547         Call "Terminate Service Worker" on all workers when all their clients are gone
548         https://bugs.webkit.org/show_bug.cgi?id=179552
549         <rdar://problem/35836323>
550
551         Unreviewed.
552
553         * workers/service/server/SWServer.cpp: Reducing from 60_s to 10_s based on bugzilla comment.
554
555 2017-12-05  Chris Dumez  <cdumez@apple.com>
556
557         Add support for ServiceWorkerContainer.prototype.ready
558         https://bugs.webkit.org/show_bug.cgi?id=180383
559
560         Reviewed by Youenn Fablet.
561
562         Add support for ServiceWorkerContainer.prototype.ready:
563         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-ready
564
565         No new tests, rebaselined existing test.
566
567         * workers/service/SWClientConnection.h:
568         * workers/service/ServiceWorkerContainer.cpp:
569         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
570         (WebCore::ServiceWorkerContainer::ready):
571         * workers/service/ServiceWorkerContainer.h:
572         * workers/service/ServiceWorkerRegistrationKey.h:
573         * workers/service/server/SWServer.cpp:
574         (WebCore::SWServer::resolveRegistrationReadyRequests):
575         * workers/service/server/SWServer.h:
576         * workers/service/server/SWServerRegistration.cpp:
577         (WebCore::SWServerRegistration::activate):
578         (WebCore::SWServerRegistration::setIsUninstalling):
579         * workers/service/server/SWServerRegistration.h:
580
581 2017-12-05  Yusuke Suzuki  <utatane.tea@gmail.com>
582
583         Modernize WebThread code for further refactoring
584         https://bugs.webkit.org/show_bug.cgi?id=180344
585
586         Reviewed by Alex Christensen.
587
588         When touching Thread and its initialization component, we need to touch
589         web thread initialization code too. However, since web thread code is old,
590         it's style is not following to WebKit coding style guidelines.
591
592         This patch first modernizes WebThread code for further refactoring.
593
594         1. `Type*` instead of `Type *`.
595         2. Use std::call_once instead of pthread_once.
596         3. Use static_cast instead of C-cast.
597         4. Use nullptr instead of NULL.
598         5. Use `ret` or `!ret` instead of `ret != 0` or `ret == 0`.
599         6. Do not use #pragma unused.
600         7. if-else with one statement should not have braces.
601
602         In this patch, we do not change pthread_condition_t to WTF::Condition and
603         pthread_mutex_t to WTF::Lock since web thread code requires extra care about
604         threading.
605
606         No behavior change.
607
608         * platform/ios/wak/WebCoreThread.mm:
609         (-[NSObject releaseOnMainThread]):
610         (SendMessage):
611         (HandleDelegateSource):
612         (SendDelegateMessage):
613         (WebThreadAdoptAndRelease):
614         (lockWebCoreReleaseLock):
615         (unlockWebCoreReleaseLock):
616         (WebCoreObjCDeallocOnWebThreadImpl):
617         (WebCoreObjCDeallocWithWebThreadLockImpl):
618         (HandleWebThreadReleaseSource):
619         (WebThreadCallDelegate):
620         (WebThreadPostNotification):
621         (WebThreadCallDelegateAsync):
622         (WebThreadMakeNSInvocation):
623         (MainRunLoopAutoUnlock):
624         (_WebThreadAutoLock):
625         (WebRunLoopLock):
626         (WebRunLoopUnlock):
627         (MainRunLoopUnlockGuard):
628         (CurrentThreadContext):
629         (RunWebThread):
630         (StartWebThread):
631         (WebTimedConditionLock):
632         (_WebTryThreadLock):
633         (WebThreadUnlockFromAnyThread):
634         (WebThreadUnlockGuardForMail):
635         (_WebThreadUnlock):
636         (WebThreadIsLocked):
637         (WebThreadLockPopModal):
638         (WebThreadCurrentContext):
639         (WebThreadEnable):
640         (FreeThreadContext): Deleted.
641         (InitThreadContextKey): Deleted.
642
643 2017-12-05  Alex Christensen  <achristensen@webkit.org>
644
645         Fix non-unified build after r225381
646         https://bugs.webkit.org/show_bug.cgi?id=180434
647
648         Reviewed by Keith Miller.
649
650         * loader/ResourceTimingInformation.cpp:
651         FrameLoader.h is included in other files that are combined with this file in unified builds,
652         but we need to merge r225381 to a branch that doesn't use unified builds.  This build failure
653         would've come up randomly in the future when we add files, too.
654
655 2017-12-05  Simon Fraser  <simon.fraser@apple.com>
656
657         Remove webkitGetImageDataHD and webkitPutImageDataHD from canvas API
658         https://bugs.webkit.org/show_bug.cgi?id=180387
659
660         Reviewed by Dean Jackson.
661
662         CanvasRenderingContext2D.webkitGetImageDataHD and webkitPutImageDataHD were never standardized,
663         and Blink removed support in 2014 (https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/FOPH5dloGG8).
664
665         Since our canvas backing store is always 1x, they have no use anyway, so remove them.
666
667         * html/canvas/CanvasRenderingContext2D.cpp:
668         (WebCore::CanvasRenderingContext2D::putImageData):
669         (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD const): Deleted.
670         (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Deleted.
671         * html/canvas/CanvasRenderingContext2D.h:
672         * html/canvas/CanvasRenderingContext2D.idl:
673
674 2017-12-05  Youenn Fablet  <youenn@apple.com>
675
676         Implement setting of service worker to client in SWServer without going to WebProcess
677         https://bugs.webkit.org/show_bug.cgi?id=180382
678
679         Reviewed by Chris Dumez.
680
681         No change of behavior.
682
683         This patch removes the notification of active worker setting from ScriptExecution/WebProcess up to SWServer/StorageProcess.
684         Instead, active worker setting is fully done/controlled in SWServer.
685         Whenever there is a change, SWServer notifies WebProcess and ScriptExecutionContext gets updated accordingly.
686
687         * dom/Document.cpp:
688         (WebCore::Document::setServiceWorkerConnection):
689         * dom/ScriptExecutionContext.cpp:
690         (WebCore::ScriptExecutionContext::setActiveServiceWorker):
691         * loader/DocumentLoader.cpp:
692         (WebCore::DocumentLoader::commitData):
693         * workers/service/SWClientConnection.h:
694         * workers/service/server/SWServer.cpp:
695         (WebCore::SWServer::setClientActiveWorker):
696         (WebCore::SWServer::registerServiceWorkerClient):
697         (WebCore::SWServer::registrationFromServiceWorkerIdentifier):
698         (WebCore::SWServer::unregisterServiceWorkerClient):
699         (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient): Deleted.
700         (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient): Deleted.
701         (WebCore::SWServer::serviceWorkerStartedControllingClient): Deleted.
702         (WebCore::SWServer::serviceWorkerStoppedControllingClient): Deleted.
703         * workers/service/server/SWServer.h:
704         * workers/service/server/SWServerRegistration.cpp:
705         (WebCore::SWServerRegistration::activate):
706
707 2017-12-01  Filip Pizlo  <fpizlo@apple.com>
708
709         GC constraint solving should be parallel
710         https://bugs.webkit.org/show_bug.cgi?id=179934
711
712         Reviewed by JF Bastien.
713
714         No new tests because no change in behavior. This change is best tested using DOM-GC-intensive
715         benchmarks like Speedometer and Dromaeo.
716         
717         This parallelizes the DOM's output constraint, and makes some small changes to make this more
718         scalable.
719
720         * ForwardingHeaders/heap/SimpleMarkingConstraint.h: Added.
721         * ForwardingHeaders/heap/VisitingTimeout.h: Removed.
722         * Sources.txt:
723         * WebCore.xcodeproj/project.pbxproj:
724         * bindings/js/DOMGCOutputConstraint.cpp: Added.
725         (WebCore::DOMGCOutputConstraint::DOMGCOutputConstraint):
726         (WebCore::DOMGCOutputConstraint::~DOMGCOutputConstraint):
727         (WebCore::DOMGCOutputConstraint::executeImpl):
728         (WebCore::DOMGCOutputConstraint::doParallelWorkImpl):
729         (WebCore::DOMGCOutputConstraint::finishParallelWorkImpl):
730         * bindings/js/DOMGCOutputConstraint.h: Added.
731         * bindings/js/WebCoreJSClientData.cpp:
732         (WebCore::JSVMClientData::initNormalWorld):
733         * dom/Node.cpp:
734         (WebCore::Node::eventTargetDataConcurrently):
735         (WebCore::Node::ensureEventTargetData):
736         (WebCore::Node::clearEventTargetData):
737
738 2017-12-05  Antoine Quint  <graouts@apple.com>
739
740         <video> and scale() transforms yield shrunk small or clipped controls
741         https://bugs.webkit.org/show_bug.cgi?id=180358
742         <rdar://problem/34436124>
743
744         Unreviewed.
745
746         Use DOMMatrix vs. WebKitCSSMatrix per Simon's post-commit review feedback.
747
748         * Modules/modern-media-controls/media/media-controller.js:
749         (MediaController.prototype._updateControlsSize):
750
751 2017-12-04  Chris Dumez  <cdumez@apple.com>
752
753         Support container.getRegistration() / getRegistrations() inside service workers
754         https://bugs.webkit.org/show_bug.cgi?id=180360
755
756         Reviewed by Youenn Fablet.
757
758         Support container.getRegistration() / getRegistrations() inside service workers
759         by making sure we hop to the right thread when needed.
760
761         Test: http/tests/workers/service/ServiceWorkerGlobalScope_getRegistration.html
762
763         * dom/ScriptExecutionContext.cpp:
764         (WebCore::ScriptExecutionContext::postTaskTo):
765         * dom/ScriptExecutionContext.h:
766         * workers/service/SWClientConnection.cpp:
767         (WebCore::SWClientConnection::jobRejectedInServer):
768         (WebCore::SWClientConnection::registrationJobResolvedInServer):
769         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
770         (WebCore::SWClientConnection::startScriptFetchForServer):
771         (WebCore::SWClientConnection::clearPendingJobs):
772         * workers/service/SWClientConnection.h:
773         * workers/service/ServiceWorkerContainer.cpp:
774         (WebCore::ServiceWorkerContainer::getRegistration):
775         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
776         (WebCore::ServiceWorkerContainer::getRegistrations):
777         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
778         (WebCore::ServiceWorkerContainer::stop):
779         * workers/service/ServiceWorkerContainer.h:
780
781 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
782
783         Cleanup code that computes iframe content offsets in FrameView
784         https://bugs.webkit.org/show_bug.cgi?id=180385
785
786         Reviewed by Zalan Bujtas.
787
788         The coordinate conversion functions in FrameView explicitly added borderLeft/paddingLeft
789         and borderTop/paddingTop to compute the offset from the contents of a frame to its parent renderer.
790         
791         This is equivalent to the call to contextBoxRect() that RenderWidget::updateWidgetGeometry() does,
792         which also takes left-side scrollbars into account.
793         
794         Coordinate offsets don't need height and width, so add RenderBox::contentBoxLocation() that just
795         computes the top left, and use it in FrameView.
796
797         * page/FrameView.cpp:
798         (WebCore::FrameView::invalidateRect):
799         (WebCore::FrameView::convertToContainingView const):
800         (WebCore::FrameView::convertFromContainingView const):
801         * platform/graphics/FloatPoint.h:
802         (WebCore::FloatPoint::scaled const):
803         (WebCore::FloatPoint::scaled): Deleted.
804         * rendering/RenderBox.cpp:
805         (WebCore::RenderBox::contentBoxLocation const):
806         * rendering/RenderBox.h:
807
808 2017-12-04  Nan Wang  <n_wang@apple.com>
809
810         AX: AOM: Implement relation type properties
811         https://bugs.webkit.org/show_bug.cgi?id=179500
812
813         Reviewed by Ryosuke Niwa.
814
815         Accessibility Object Model
816         Explainer: https://wicg.github.io/aom/explainer.html
817         Spec: https://wicg.github.io/aom/spec/
818
819         Implemented the AOM support for activeDescendant, details and errorMessage.
820         The corresponding ARIA attributes all take IDREFs, and the AOM properties
821         take references to AccessibleNodes instead.
822
823         Test: accessibility/mac/AOM-relation-property.html
824
825         * accessibility/AccessibilityObject.cpp:
826         (WebCore::AccessibilityObject::getAttribute const):
827         (WebCore::AccessibilityObject::hasProperty const):
828         (WebCore::AccessibilityObject::stringValueForProperty const):
829         (WebCore::AccessibilityObject::boolValueForProperty const):
830         (WebCore::AccessibilityObject::intValueForProperty const):
831         (WebCore::AccessibilityObject::unsignedValueForProperty const):
832         (WebCore::AccessibilityObject::doubleValueForProperty const):
833         (WebCore::AccessibilityObject::elementValueForProperty const):
834         (WebCore::AccessibilityObject::supportsARIAAttributes const):
835         (WebCore::AccessibilityObject::elementsFromProperty const):
836         (WebCore::AccessibilityObject::elementsReferencedByProperty const):
837         (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
838         (WebCore::AccessibilityObject::ariaDetailsElements const):
839         (WebCore::AccessibilityObject::ariaDetailsReferencingElements const):
840         (WebCore::AccessibilityObject::ariaErrorMessageElements const):
841         (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements const):
842         * accessibility/AccessibilityObject.h:
843         * accessibility/AccessibilityRenderObject.cpp:
844         (WebCore::AccessibilityRenderObject::activeDescendant const):
845         * accessibility/AccessibleNode.cpp:
846         (WebCore::ariaAttributeMap):
847         (WebCore::isPropertyValueRelation):
848         (WebCore::AccessibleNode::attributeFromAXPropertyName):
849         (WebCore::AccessibleNode::setRelationProperty):
850         (WebCore::AccessibleNode::singleRelationValueForProperty):
851         (WebCore::AccessibleNode::activeDescendant const):
852         (WebCore::AccessibleNode::setActiveDescendant):
853         (WebCore::AccessibleNode::details const):
854         (WebCore::AccessibleNode::setDetails):
855         (WebCore::AccessibleNode::errorMessage const):
856         (WebCore::AccessibleNode::setErrorMessage):
857         * accessibility/AccessibleNode.h:
858         * accessibility/AccessibleNode.idl:
859         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
860         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
861
862 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
863
864         Minor DisplayRefreshMonitor-related cleanup
865         https://bugs.webkit.org/show_bug.cgi?id=179802
866
867         Reviewed by Sam Weinig.
868
869         New trace point for when the CVDisplayLink fires on its own thread.
870
871         Some #pragma once, and put all the WellKnownRunLoopOrders in one place.
872
873         * inspector/agents/InspectorTimelineAgent.cpp:
874         (WebCore::InspectorTimelineAgent::internalStart):
875         * platform/cf/RunLoopObserver.h:
876         * platform/graphics/DisplayRefreshMonitor.cpp:
877         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
878         * platform/graphics/ca/LayerFlushScheduler.h:
879         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
880         (WebCore::LayerFlushScheduler::LayerFlushScheduler):
881
882 2017-12-04  David Quesada  <david_quesada@apple.com>
883
884         Add a class for parsing application manifests
885         https://bugs.webkit.org/show_bug.cgi?id=177973
886         rdar://problem/34747949
887
888         Reviewed by Geoffrey Garen.
889
890         Add a new struct ApplicationManifest, along with ApplicationManifestParser to initialize
891         ApplicationManifests from JSON data, according to the App Manifest spec. Just a basic subset
892         of the manifests's properties are implemented to start with.
893
894         ApplicationManifestParser is tested by new unit tests in TestWebKitAPI.
895
896         * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
897         * Modules/applicationmanifest/ApplicationManifest.h: Added.
898         * Modules/applicationmanifest/ApplicationManifestParser.cpp: Added.
899         (WebCore::ApplicationManifestParser::parse):
900         The main entry point for eventual clients (and currently the unit tests) to invoke
901         ApplicationManifestParser. There is a variant that accepts a ScriptExecutionContext that
902         uses the context exclusively for logging console warnings while parsing the manifest, and
903         not for actually executing any scripts.
904         (WebCore::ApplicationManifestParser::ApplicationManifestParser):
905         (WebCore::ApplicationManifestParser::parseManifest):
906         (WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
907         (WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
908         (WebCore::ApplicationManifestParser::logDeveloperWarning):
909         (WebCore::ApplicationManifestParser::parseStartURL):
910         (WebCore::ApplicationManifestParser::parseName):
911         (WebCore::ApplicationManifestParser::parseDescription):
912         (WebCore::ApplicationManifestParser::parseShortName):
913         (WebCore::isInScope):
914         (WebCore::ApplicationManifestParser::parseScope):
915         (WebCore::ApplicationManifestParser::parseGenericString):
916         * Modules/applicationmanifest/ApplicationManifestParser.h: Added.
917         * Sources.txt:
918         * WebCore.xcodeproj/project.pbxproj:
919         * features.json: Change the Web App Manifest feature status to "In Development"
920
921 2017-12-04  Zalan Bujtas  <zalan@apple.com>
922
923         RenderMultiColumnFlow::fragmentedFlowDescendantInserted should not destroy incoming newDescendant
924         https://bugs.webkit.org/show_bug.cgi?id=180181
925
926         Reviewed by Antti Koivisto.
927
928         This is in preparation for having all multicolumn related tree mutation in RenderTreeUpdaterMultiColumn.
929
930         Covered by fast/multicol/column-span-range-crash.html
931
932         * rendering/RenderMultiColumnFlow.cpp:
933         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
934         * rendering/RenderMultiColumnFlow.h:
935         * style/RenderTreeUpdaterMultiColumn.cpp:
936         (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):
937
938 2017-12-04  JF Bastien  <jfbastien@apple.com>
939
940         Update std::expected to match libc++ coding style
941         https://bugs.webkit.org/show_bug.cgi?id=180264
942
943         Reviewed by Alex Christensen.
944
945         Update various uses of Expected, mostly renaming valueOr and
946         hasValue to the STL naming convention.
947
948         * Modules/cache/DOMCache.cpp:
949         (WebCore::DOMCache::retrieveRecords):
950         (WebCore::DOMCache::batchDeleteOperation):
951         (WebCore::DOMCache::batchPutOperation):
952         * Modules/cache/DOMCacheStorage.cpp:
953         (WebCore::DOMCacheStorage::retrieveCaches):
954         (WebCore::DOMCacheStorage::open):
955         (WebCore::DOMCacheStorage::remove):
956         * Modules/cache/WorkerCacheStorageConnection.cpp:
957         (WebCore::WorkerCacheStorageConnection::doRemove):
958         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
959         (WebCore::recordsDataOrErrorFromRecords):
960         (WebCore::recordsOrErrorFromRecordsData):
961         * bindings/js/CachedScriptFetcher.cpp:
962         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
963         * contentextensions/ContentExtensionCompiler.cpp:
964         (WebCore::ContentExtensions::compileRuleList):
965         * contentextensions/ContentExtensionParser.cpp:
966         (WebCore::ContentExtensions::getDomainList):
967         (WebCore::ContentExtensions::loadTrigger):
968         (WebCore::ContentExtensions::loadRule):
969         (WebCore::ContentExtensions::loadEncodedRules):
970         (WebCore::ContentExtensions::parseRuleList):
971         * css/CSSFontFaceSrcValue.cpp:
972         (WebCore::CSSFontFaceSrcValue::cachedFont):
973         * css/CSSImageSetValue.cpp:
974         (WebCore::CSSImageSetValue::loadBestFitImage):
975         * css/CSSImageValue.cpp:
976         (WebCore::CSSImageValue::loadImage):
977         * css/StyleRuleImport.cpp:
978         (WebCore::StyleRuleImport::requestStyleSheet):
979         * dom/CallbackResult.h:
980         (WebCore::CallbackResult<ReturnType>::type const):
981         (WebCore::CallbackResult<ReturnType>::releaseReturnValue):
982         * dom/Element.cpp:
983         (WebCore::Element::getIntegralAttribute const):
984         (WebCore::Element::getUnsignedIntegralAttribute const):
985         * dom/ExceptionOr.h:
986         (WebCore::ExceptionOr<ReturnType>::hasException const):
987         (WebCore::ExceptionOr<void>::hasException const):
988         * dom/ProcessingInstruction.cpp:
989         (WebCore::ProcessingInstruction::checkStyleSheet):
990         * html/HTMLInputElement.cpp:
991         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
992         (WebCore::HTMLInputElement::minLengthAttributeChanged):
993         * html/HTMLLinkElement.cpp:
994         (WebCore::HTMLLinkElement::process):
995         * html/HTMLTextAreaElement.cpp:
996         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
997         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
998         * html/parser/HTMLParserIdioms.cpp:
999         (WebCore::parseHTMLNonNegativeInteger):
1000         * html/parser/HTMLParserIdioms.h:
1001         (WebCore::limitToOnlyHTMLNonNegative):
1002         * loader/CrossOriginPreflightChecker.cpp:
1003         (WebCore::CrossOriginPreflightChecker::startPreflight):
1004         * loader/DocumentLoader.cpp:
1005         (WebCore::DocumentLoader::loadMainResource):
1006         * loader/DocumentThreadableLoader.cpp:
1007         (WebCore::DocumentThreadableLoader::loadRequest):
1008         * loader/ImageLoader.cpp:
1009         (WebCore::ImageLoader::updateFromElement):
1010         * loader/LinkLoader.cpp:
1011         (WebCore::LinkLoader::preloadIfNeeded):
1012         (WebCore::LinkLoader::loadLink):
1013         * loader/MediaResourceLoader.cpp:
1014         (WebCore::MediaResourceLoader::requestResource):
1015         * loader/TextTrackLoader.cpp:
1016         (WebCore::TextTrackLoader::load):
1017         * loader/cache/CachedSVGDocumentReference.cpp:
1018         (WebCore::CachedSVGDocumentReference::load):
1019         * loader/icon/IconLoader.cpp:
1020         (WebCore::IconLoader::startLoading):
1021         * platform/URLParser.cpp:
1022         (WebCore::URLParser::parseIPv4Host):
1023         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1024         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1025         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1026         (WebCore::WebCoreAVFResourceLoader::startLoading):
1027         * svg/SVGFEImageElement.cpp:
1028         (WebCore::SVGFEImageElement::requestImageResource):
1029         * svg/SVGFontFaceUriElement.cpp:
1030         (WebCore::SVGFontFaceUriElement::loadFont):
1031         * svg/SVGUseElement.cpp:
1032         (WebCore::SVGUseElement::updateExternalDocument):
1033         * xml/XSLImportRule.cpp:
1034         (WebCore::XSLImportRule::loadSheet):
1035
1036 2017-12-04  Zalan Bujtas  <zalan@apple.com>
1037
1038         REGRESSION (r211531): Text flow changes and overlaps other text after double-click selecting paragraph
1039         https://bugs.webkit.org/show_bug.cgi?id=180377
1040         <rdar://problem/34337967>
1041
1042         Reviewed by Antti Koivisto.
1043
1044         Take floats into account when computing the available width for a certain vertical position.
1045
1046         Test: fast/block/float/simple-line-layout-float-shrink-line.html
1047
1048         * rendering/SimpleLineLayout.cpp:
1049         (WebCore::SimpleLineLayout::updateLineConstrains):
1050
1051 2017-12-04  Antoine Quint  <graouts@apple.com>
1052
1053         <video> and scale() transforms yield shrunk small or clipped controls
1054         https://bugs.webkit.org/show_bug.cgi?id=180358
1055         <rdar://problem/34436124>
1056
1057         Reviewed by Dean Jackson.
1058
1059         To compute the bounds of the media controls, we would call getBoundingClientRect()
1060         on the root-most element in the shadow root, which is styled to have width and height
1061         set to 100%, which allows to match the metrics of the host media element, without
1062         the borders.
1063
1064         However, if the host media element has CSS transforms applied, these would be factored
1065         into calls to getBoundingClientRect() and the controls would be too large and clipped,
1066         in case the scale was more than 1, or shrunk, in case the scale was less than 1.
1067
1068         To obtain correct metrics, we computed the complete transformation matrix applied to
1069         the host media element, and apply its inverted matrix to each corner point of the
1070         bounds returned for the root-most container element in the shadow root.
1071
1072         Then we compute the width and height of this transformed rectangle and set those to
1073         be our media controls' metrics.
1074
1075         Test: media/modern-media-controls/css/transformed-media.html
1076
1077         * Modules/modern-media-controls/media/media-controller.js:
1078         (MediaController.prototype._updateControlsSize):
1079         (MediaController.prototype._controlsWidth): Deleted.
1080
1081 2017-12-04  Antoine Quint  <graouts@apple.com>
1082
1083         Cursor is not visible after exiting full screen video
1084         https://bugs.webkit.org/show_bug.cgi?id=180247
1085         <rdar://problem/33885922>
1086
1087         Reviewed by Dean Jackson.
1088
1089         There is a dedicated NSCursor method to temporarily hide the mouse cursor while the mouse is idle,
1090         so we use this platform functionality, already exposed through the page chrome, instead which
1091         implements the expected behavior. Now, the mouse cursor is hidden while the mouse is stationary
1092         when a <video> is fullscreen, as before, but as soon as the user exits fullscreen, the mouse cursor
1093         reappears.
1094
1095         No test provided as I don't believe this platform behavior can be tested, there is no API to query
1096         whether the cursor is visible.
1097
1098         * page/EventHandler.cpp:
1099         (WebCore::EventHandler::cancelAutoHideCursorTimer):
1100         (WebCore::EventHandler::autoHideCursorTimerFired):
1101
1102 2017-12-04  Chris Dumez  <cdumez@apple.com>
1103
1104         ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&) is unsafe
1105         https://bugs.webkit.org/show_bug.cgi?id=180372
1106
1107         Reviewed by Youenn Fablet.
1108
1109         Ref the WorkerThread and capture it in the lambda. Keep the pending promises in
1110         a HashMap on the ServiceWorkerGlobalScope so that they stay on the worker thread.
1111
1112         * workers/service/ServiceWorkerGlobalScope.cpp:
1113         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
1114         * workers/service/ServiceWorkerGlobalScope.h:
1115
1116 2017-12-04  Brady Eidson  <beidson@apple.com>
1117
1118         Get a directory path to SWServers for storing ServiceWorker registrations.
1119         https://bugs.webkit.org/show_bug.cgi?id=180362
1120
1121         Reviewed by Chris Dumez.
1122
1123         No new tests (No observable behavior change yet).
1124
1125         * workers/service/server/SWServer.cpp:
1126         (WebCore::SWServer::SWServer):
1127         * workers/service/server/SWServer.h:
1128
1129 2017-12-04  Devin Rousso  <webkit@devinrousso.com>
1130
1131         Web Inspector: provide method for recording CanvasRenderingContext2D from JavaScript
1132         https://bugs.webkit.org/show_bug.cgi?id=175166
1133         <rdar://problem/34040740>
1134
1135         Reviewed by Joseph Pecoraro.
1136
1137         No new tests, updated existing tests.
1138
1139         * inspector/InspectorCanvas.h:
1140         * inspector/InspectorCanvas.cpp:
1141         (WebCore::InspectorCanvas::resetRecordingData):
1142
1143         * inspector/InspectorCanvasAgent.h:
1144         * inspector/InspectorCanvasAgent.cpp:
1145         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1146         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
1147
1148         * inspector/InspectorInstrumentation.h:
1149         * inspector/InspectorInstrumentation.cpp:
1150         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
1151         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvasImpl):
1152
1153         * page/PageConsoleClient.h:
1154         * page/PageConsoleClient.cpp:
1155         (WebCore::PageConsoleClient::record):
1156         (WebCore::PageConsoleClient::recordEnd):
1157
1158         * workers/WorkerConsoleClient.h:
1159         * workers/WorkerConsoleClient.cpp:
1160         (WebCore::WorkerConsoleClient::record):
1161         (WebCore::WorkerConsoleClient::recordEnd):
1162
1163 2017-12-04  Youenn Fablet  <youenn@apple.com>
1164
1165         Call "Terminate Service Worker" on all workers when all their clients are gone
1166         https://bugs.webkit.org/show_bug.cgi?id=179552
1167
1168         Reviewed by Chris Dumez.
1169
1170         Tested manually.
1171
1172         When SWServer detects that there is no longer any client for a given client origin,
1173         it iterates through the running workers to terminate them if they have the given client origin.
1174         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.
1175
1176         * workers/service/server/SWServer.cpp:
1177         (WebCore::SWServer::findClientByIdentifier):
1178         (WebCore::SWServer::matchAll):
1179         (WebCore::SWServer::registerServiceWorkerClient):
1180         (WebCore::SWServer::unregisterServiceWorkerClient):
1181         * workers/service/server/SWServer.h:
1182
1183 2017-12-04  Antti Koivisto  <antti@apple.com>
1184
1185         Enable selector filtering for ::before and ::after pseudo element resolution
1186         https://bugs.webkit.org/show_bug.cgi?id=180364
1187
1188         Reviewed by Ryosuke Niwa.
1189
1190         Since these pseudo elements are now resolved by TreeResolver we can use selector filter for them.
1191
1192         This is 10%+ progression in StyleBench pseudo element subtest.
1193
1194         * css/StyleResolver.cpp:
1195         (WebCore::StyleResolver::pseudoStyleForElement):
1196         * css/StyleResolver.h:
1197         * style/StyleTreeResolver.cpp:
1198         (WebCore::Style::TreeResolver::resolvePseudoStyle):
1199
1200 2017-12-04  Youenn Fablet  <youenn@apple.com>
1201
1202         Add support https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
1203         https://bugs.webkit.org/show_bug.cgi?id=180359
1204
1205         Reviewed by Chris Dumez.
1206
1207         This algorithm is needed for implementation of claim.
1208         As per specification, it is run for every client unload, hence why this is put in removeClientUsingRegistration.
1209
1210         * workers/service/server/SWServerRegistration.cpp:
1211         (WebCore::SWServerRegistration::removeClientUsingRegistration):
1212         (WebCore::SWServerRegistration::handleClientUnload):
1213         * workers/service/server/SWServerRegistration.h:
1214
1215 2017-12-04  Antti Koivisto  <antti@apple.com>
1216
1217         Remove duplicates from selector filter hashes
1218         https://bugs.webkit.org/show_bug.cgi?id=180354
1219
1220         Reviewed by Simon Fraser.
1221
1222         We have only four slots for hashes in RuleSet and adding more regresses performance. To use the limited slots
1223         better we should eliminate duplicates.
1224
1225         This patch also switches to using std::array instead of a C array for the hashes.
1226
1227         The patch reduces the number of selectors passing through the selector filter in StyleBench by ~0.4%.
1228
1229         * css/ElementRuleCollector.cpp:
1230         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1231         * css/RuleSet.cpp:
1232         (WebCore::RuleData::RuleData):
1233         * css/RuleSet.h:
1234         (WebCore::RuleData::descendantSelectorIdentifierHashes const):
1235         * css/SelectorFilter.cpp:
1236         (WebCore::collectDescendantSelectorIdentifierHashes):
1237         (WebCore::SelectorFilter::collectIdentifierHashes):
1238         * css/SelectorFilter.h:
1239         (WebCore::SelectorFilter::fastRejectSelector const):
1240
1241 2017-12-04  Youenn Fablet  <youenn@apple.com>
1242
1243         WorkerCacheStorageConnection should handle the case of terminated workers
1244         https://bugs.webkit.org/show_bug.cgi?id=180304
1245
1246         Reviewed by Chris Dumez.
1247
1248         No web page observable change of behavior.
1249
1250         Reworked WorkerCacheStorageConnection hopping.
1251         Instead of refing/unrefing itself, it refs the worker thread and the main thread connection.
1252         This worker thread is then used on the way back from the main thread.
1253
1254         * Modules/cache/WorkerCacheStorageConnection.cpp:
1255         (WebCore::WorkerCacheStorageConnection::create):
1256         (WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
1257         (WebCore::WorkerCacheStorageConnection::doOpen):
1258         (WebCore::WorkerCacheStorageConnection::doRemove):
1259         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
1260         (WebCore::WorkerCacheStorageConnection::reference):
1261         (WebCore::WorkerCacheStorageConnection::dereference):
1262         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
1263         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
1264         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
1265         * Modules/cache/WorkerCacheStorageConnection.h:
1266         * workers/WorkerGlobalScope.cpp:
1267         (WebCore::WorkerGlobalScope::cacheStorageConnection):
1268         * workers/WorkerGlobalScope.h:
1269
1270 2017-12-04  Frederic Wang  <fwang@igalia.com>
1271
1272         Make ScrollingTreeNode::enclosingFrameNode return the node itself for frame nodes
1273         https://bugs.webkit.org/show_bug.cgi?id=180353
1274
1275         Reviewed by Antonio Gomes.
1276
1277         This function was introduced in bug 175135 to solve a rendering bug with fixed positioned
1278         nodes in overflow nodes. For a frame node, the reference frame to use for fixed nodes is
1279         actually the frame node itself or otherwise we will get the same rendering bug. This patch
1280         makes enclosingFrameNode return the node itself when it is a frame node and renames it to
1281         clarify this behavior. Currently, enclosingFrameNode is not used for frame nodes so the
1282         behavior is unchanged.
1283
1284         No new tests, behavior is unchanged.
1285
1286         * page/scrolling/ScrollingTreeNode.cpp:
1287         (WebCore::ScrollingTreeNode::enclosingFrameNodeIncludingSelf): Start the search from a frame
1288         scrolling node from the node itself. Renamed to make explicit that this function may include
1289         the node itself.
1290         * page/scrolling/ScrollingTreeNode.h: Renamed.
1291
1292 2017-12-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1293
1294         [WPE][GTK] Implement PAL::SleepDisabler
1295         https://bugs.webkit.org/show_bug.cgi?id=178485
1296
1297         Reviewed by Carlos Garcia Campos.
1298
1299         Add a comment to warn about some odd use of SleepDisabler in HTMLMediaElement.
1300
1301         * html/HTMLMediaElement.cpp:
1302         (WebCore::HTMLMediaElement::shouldDisableSleep const):
1303
1304 2017-12-04  Frederic Wang  <fwang@igalia.com>
1305
1306         Bug 161300 - Move RenderMathMLRoot:RootType and RenderMathMLScripts:ScriptsType to element classes
1307         https://bugs.webkit.org/show_bug.cgi?id=161300
1308
1309         Reviewed by Darin Adler.
1310
1311         RenderMathMLRoot::m_kind and RenderMathMLScripts::m_scriptType are initialized in the
1312         constructors of the renderer classes from the tag name of the corresponding elements.
1313         This patch moves them into the corresponding element classes and makes them const members
1314         parsed in the constructors. It also introduces a MathMLRootElement class deriving from
1315         MathMLRowElement to store the new member. Finally, the types are redefined as enum classes.
1316
1317         No new tests, behavior unchanged and already covered by existing tests.
1318
1319         * Sources.txt: Add MathMLRootElement files.
1320         * WebCore.xcodeproj/project.pbxproj: Ditto.
1321         * mathml/MathMLAllInOne.cpp: Ditto.
1322         * mathml/MathMLRootElement.cpp:
1323         (WebCore::element): Override this function to downcast to MathMLRootElement.
1324         (WebCore::rootTypeOf): Helper function to parse the root type, moved from RenderMathMLRoot.
1325         (WebCore::MathMLRootElement::MathMLRootElement): Initialize the root type.
1326         (WebCore::MathMLRootElement::create):
1327         (WebCore::MathMLRootElement::createElementRenderer): Moved from MathMLRowElement.
1328         * mathml/MathMLRootElement.h: New class deriving from MathMLRowElement, with a RootType
1329         member exposed to the renderer class.
1330         * mathml/MathMLRowElement.cpp: Remove header for RenderMathMLRoot.h.
1331         (WebCore::MathMLRowElement::createElementRenderer): Moved to MathMLRootElement.
1332         * mathml/MathMLScriptsElement.cpp: Introduce a script type.
1333         (WebCore::scriptTypeOf): Helper function to parse the script type, moved from
1334         RenerMathMLScripts.
1335         (WebCore::MathMLScriptsElement::MathMLScriptsElement): Initialize the script type.
1336         * mathml/MathMLScriptsElement.h: Add new script type member.
1337         (WebCore::MathMLScriptsElement::scriptType const): Expose the script type to the renderer
1338         class.
1339         * mathml/mathtags.in: Map <msqrt> and <mroot> to MathMLRootElement.
1340         * rendering/mathml/RenderMathMLRoot.cpp:
1341         (WebCore::RenderMathMLRoot::RenderMathMLRoot): Use MathMLRootElement and remove parsing of
1342         the root type.
1343         (WebCore::RenderMathMLRoot::rootType const): Helper function to access the root type from
1344         the element class.
1345         (WebCore::RenderMathMLRoot::isValid const): Use rootType() and add prefix for enum class
1346         values.
1347         (WebCore::RenderMathMLRoot::getBase const): Ditto.
1348         (WebCore::RenderMathMLRoot::getIndex const): Ditto.
1349         (WebCore::RenderMathMLRoot::horizontalParameters): Ditto.
1350         (WebCore::RenderMathMLRoot::verticalParameters): Ditto.
1351         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): Ditto.
1352         (WebCore::RenderMathMLRoot::layoutBlock): Ditto.
1353         (WebCore::RenderMathMLRoot::paint): Ditto.
1354         * rendering/mathml/RenderMathMLRoot.h: Define root type as an enum class, replace
1355         MathMLRowElement with MathMLRootElement, declare and use new rootType() function and remove
1356         the m_kind member.
1357         * rendering/mathml/RenderMathMLScripts.cpp:
1358         (WebCore::RenderMathMLScripts::RenderMathMLScripts): Remove parsing of script type.
1359         (WebCore::RenderMathMLScripts::scriptType const): Helper function to access the script type
1360         from the element class.
1361         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren): Use scriptType() and add
1362         prefix for enum class values.
1363         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Ditto.
1364         (WebCore::RenderMathMLScripts::verticalMetrics): Ditto.
1365         (WebCore::RenderMathMLScripts::layoutBlock): Ditto.
1366         * rendering/mathml/RenderMathMLScripts.h: Define root type as an enum class, declare the
1367         scriptType() function and remove the m_scriptType member.
1368         * rendering/mathml/RenderMathMLUnderOver.cpp:
1369         (WebCore::RenderMathMLUnderOver::isValid const): Use scriptType() and add prefix for enum
1370         class values.
1371         (WebCore::RenderMathMLUnderOver::under const): Ditto.
1372         (WebCore::RenderMathMLUnderOver::over const): Ditto.
1373         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Ditto.
1374         (WebCore::RenderMathMLUnderOver::hasAccent const): Ditto.
1375         (WebCore::RenderMathMLUnderOver::layoutBlock): Ditto.
1376
1377 2017-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1378
1379         [GStreamer] More leaks in TextCombinerGStreamer
1380         https://bugs.webkit.org/show_bug.cgi?id=180331
1381
1382         Reviewed by Michael Catanzaro.
1383
1384         I've noticed more leaks reading the code, but I couldn't check them with valgrind, because I don't know how to
1385         trigger that code path. This patch cleans up the file using smart pointer everywhere.
1386
1387         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
1388         (webkit_text_combiner_pad_init):
1389         (webkitTextCombinerPadEvent):
1390         (webkitTextCombinerReleasePad):
1391
1392 2017-12-04  Jer Noble  <jer.noble@apple.com>
1393
1394         Include 'video/*' in image request Accept header if browser supports video media in image contexts.
1395         https://bugs.webkit.org/show_bug.cgi?id=179178
1396
1397         Reviewed by Alex Christensen.
1398
1399         Test: http/tests/images/image-supports-video.html
1400
1401         Ensure that 'video/*' is included in the Accept header by asking the ImageDecoder whether "Video"
1402         media is supported. The ImageDecoder will ask all it's constituent decoders, which aside from
1403         ImageDecoderAVFObjC will say only support the "Image" media type.
1404
1405         Drive-by fix: Make sure the MIMETypeRegistry includes all the types supported by AVFoundation when
1406         ImageDecoderAVFObjC is enabled. Also, now that Image reports it can support video mime types, check
1407         whether MediaDocument can support a given mime type before asking ImageDocument.
1408
1409         * html/HTMLImageElement.cpp:
1410         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1411         * loader/LinkLoader.cpp:
1412         (WebCore::LinkLoader::isSupportedType):
1413         * loader/cache/CachedResourceRequest.cpp:
1414         (WebCore::acceptHeaderValueFromType):
1415         * platform/MIMETypeRegistry.cpp:
1416         (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
1417         (WebCore::MIMETypeRegistry::isSupportedImageOrSVGMIMEType): Deleted.
1418         * platform/MIMETypeRegistry.h:
1419         * platform/graphics/ImageDecoder.cpp:
1420         (WebCore::ImageDecoder::supportsMediaType):
1421         * platform/graphics/ImageDecoder.h:
1422         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1423         (WebCore::ImageDecoderAVFObjC::supportsMediaType):
1424         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1425         (WebCore::ImageDecoderAVFObjC::supportsContentType):
1426         * platform/graphics/cg/ImageDecoderCG.h:
1427         * platform/graphics/win/ImageDecoderDirect2D.h:
1428         * platform/image-decoders/ScalableImageDecoder.h:
1429         (WebCore::ScalableImageDecoder::supportsMediaType):
1430         * html/parser/HTMLPreloadScanner.cpp:
1431         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1432
1433 2017-12-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1434
1435         WTF shouldn't have both Thread and ThreadIdentifier
1436         https://bugs.webkit.org/show_bug.cgi?id=180308
1437
1438         Reviewed by Darin Adler.
1439
1440         No behavior change.
1441
1442         * Modules/indexeddb/IDBActiveDOMObject.h:
1443         (WebCore::IDBActiveDOMObject::originThread const):
1444         (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread):
1445         (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread):
1446         (WebCore::IDBActiveDOMObject::originThreadID const): Deleted.
1447         * Modules/indexeddb/IDBCursor.cpp:
1448         (WebCore::IDBCursor::IDBCursor):
1449         (WebCore::IDBCursor::~IDBCursor):
1450         (WebCore::IDBCursor::sourcesDeleted const):
1451         (WebCore::IDBCursor::transaction const):
1452         (WebCore::IDBCursor::update):
1453         (WebCore::IDBCursor::advance):
1454         (WebCore::IDBCursor::continueFunction):
1455         (WebCore::IDBCursor::uncheckedIterateCursor):
1456         (WebCore::IDBCursor::deleteFunction):
1457         (WebCore::IDBCursor::setGetResult):
1458         * Modules/indexeddb/IDBDatabase.cpp:
1459         (WebCore::IDBDatabase::~IDBDatabase):
1460         (WebCore::IDBDatabase::hasPendingActivity const):
1461         (WebCore::IDBDatabase::name const):
1462         (WebCore::IDBDatabase::version const):
1463         (WebCore::IDBDatabase::objectStoreNames const):
1464         (WebCore::IDBDatabase::renameObjectStore):
1465         (WebCore::IDBDatabase::renameIndex):
1466         (WebCore::IDBDatabase::createObjectStore):
1467         (WebCore::IDBDatabase::transaction):
1468         (WebCore::IDBDatabase::deleteObjectStore):
1469         (WebCore::IDBDatabase::close):
1470         (WebCore::IDBDatabase::connectionToServerLost):
1471         (WebCore::IDBDatabase::maybeCloseInServer):
1472         (WebCore::IDBDatabase::activeDOMObjectName const):
1473         (WebCore::IDBDatabase::canSuspendForDocumentSuspension const):
1474         (WebCore::IDBDatabase::stop):
1475         (WebCore::IDBDatabase::startVersionChangeTransaction):
1476         (WebCore::IDBDatabase::didStartTransaction):
1477         (WebCore::IDBDatabase::willCommitTransaction):
1478         (WebCore::IDBDatabase::didCommitTransaction):
1479         (WebCore::IDBDatabase::willAbortTransaction):
1480         (WebCore::IDBDatabase::didAbortTransaction):
1481         (WebCore::IDBDatabase::didCommitOrAbortTransaction):
1482         (WebCore::IDBDatabase::fireVersionChangeEvent):
1483         (WebCore::IDBDatabase::dispatchEvent):
1484         (WebCore::IDBDatabase::didCreateIndexInfo):
1485         (WebCore::IDBDatabase::didDeleteIndexInfo):
1486         * Modules/indexeddb/IDBIndex.cpp:
1487         (WebCore::IDBIndex::IDBIndex):
1488         (WebCore::IDBIndex::~IDBIndex):
1489         (WebCore::IDBIndex::name const):
1490         (WebCore::IDBIndex::setName):
1491         (WebCore::IDBIndex::objectStore):
1492         (WebCore::IDBIndex::keyPath const):
1493         (WebCore::IDBIndex::unique const):
1494         (WebCore::IDBIndex::multiEntry const):
1495         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
1496         (WebCore::IDBIndex::openCursor):
1497         (WebCore::IDBIndex::openKeyCursor):
1498         (WebCore::IDBIndex::doCount):
1499         (WebCore::IDBIndex::doGet):
1500         (WebCore::IDBIndex::doGetKey):
1501         (WebCore::IDBIndex::getAll):
1502         (WebCore::IDBIndex::getAllKeys):
1503         (WebCore::IDBIndex::markAsDeleted):
1504         * Modules/indexeddb/IDBObjectStore.cpp:
1505         (WebCore::IDBObjectStore::IDBObjectStore):
1506         (WebCore::IDBObjectStore::~IDBObjectStore):
1507         (WebCore::IDBObjectStore::name const):
1508         (WebCore::IDBObjectStore::setName):
1509         (WebCore::IDBObjectStore::keyPath const):
1510         (WebCore::IDBObjectStore::indexNames const):
1511         (WebCore::IDBObjectStore::transaction):
1512         (WebCore::IDBObjectStore::autoIncrement const):
1513         (WebCore::IDBObjectStore::openCursor):
1514         (WebCore::IDBObjectStore::openKeyCursor):
1515         (WebCore::IDBObjectStore::get):
1516         (WebCore::IDBObjectStore::getKey):
1517         (WebCore::IDBObjectStore::putOrAdd):
1518         (WebCore::IDBObjectStore::doDelete):
1519         (WebCore::IDBObjectStore::clear):
1520         (WebCore::IDBObjectStore::createIndex):
1521         (WebCore::IDBObjectStore::index):
1522         (WebCore::IDBObjectStore::deleteIndex):
1523         (WebCore::IDBObjectStore::doCount):
1524         (WebCore::IDBObjectStore::getAll):
1525         (WebCore::IDBObjectStore::getAllKeys):
1526         (WebCore::IDBObjectStore::markAsDeleted):
1527         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
1528         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1529         (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
1530         (WebCore::IDBOpenDBRequest::onError):
1531         (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
1532         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
1533         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
1534         (WebCore::IDBOpenDBRequest::dispatchEvent):
1535         (WebCore::IDBOpenDBRequest::onSuccess):
1536         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
1537         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
1538         (WebCore::IDBOpenDBRequest::requestCompleted):
1539         (WebCore::IDBOpenDBRequest::requestBlocked):
1540         * Modules/indexeddb/IDBRequest.cpp:
1541         (WebCore::IDBRequest::~IDBRequest):
1542         (WebCore:: const):
1543         (WebCore::IDBRequest::setSource):
1544         (WebCore::IDBRequest::setVersionChangeTransaction):
1545         (WebCore::IDBRequest::transaction const):
1546         (WebCore::IDBRequest::sourceObjectStoreIdentifier const):
1547         (WebCore::IDBRequest::sourceIndexIdentifier const):
1548         (WebCore::IDBRequest::requestedObjectStoreRecordType const):
1549         (WebCore::IDBRequest::requestedIndexRecordType const):
1550         (WebCore::IDBRequest::eventTargetInterface const):
1551         (WebCore::IDBRequest::activeDOMObjectName const):
1552         (WebCore::IDBRequest::canSuspendForDocumentSuspension const):
1553         (WebCore::IDBRequest::hasPendingActivity const):
1554         (WebCore::IDBRequest::stop):
1555         (WebCore::IDBRequest::enqueueEvent):
1556         (WebCore::IDBRequest::dispatchEvent):
1557         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
1558         (WebCore::IDBRequest::setResult):
1559         (WebCore::IDBRequest::setResultToStructuredClone):
1560         (WebCore::IDBRequest::setResultToUndefined):
1561         (WebCore::IDBRequest::resultCursor):
1562         (WebCore::IDBRequest::willIterateCursor):
1563         (WebCore::IDBRequest::didOpenOrIterateCursor):
1564         (WebCore::IDBRequest::completeRequestAndDispatchEvent):
1565         (WebCore::IDBRequest::onError):
1566         (WebCore::IDBRequest::onSuccess):
1567         * Modules/indexeddb/IDBTransaction.cpp:
1568         (WebCore::IDBTransaction::IDBTransaction):
1569         (WebCore::IDBTransaction::~IDBTransaction):
1570         (WebCore::IDBTransaction::objectStoreNames const):
1571         (WebCore::IDBTransaction::db):
1572         (WebCore::IDBTransaction::error const):
1573         (WebCore::IDBTransaction::objectStore):
1574         (WebCore::IDBTransaction::abortDueToFailedRequest):
1575         (WebCore::IDBTransaction::transitionedToFinishing):
1576         (WebCore::IDBTransaction::abort):
1577         (WebCore::IDBTransaction::internalAbort):
1578         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
1579         (WebCore::IDBTransaction::activeDOMObjectName const):
1580         (WebCore::IDBTransaction::canSuspendForDocumentSuspension const):
1581         (WebCore::IDBTransaction::hasPendingActivity const):
1582         (WebCore::IDBTransaction::stop):
1583         (WebCore::IDBTransaction::isActive const):
1584         (WebCore::IDBTransaction::isFinishedOrFinishing const):
1585         (WebCore::IDBTransaction::addRequest):
1586         (WebCore::IDBTransaction::removeRequest):
1587         (WebCore::IDBTransaction::scheduleOperation):
1588         (WebCore::IDBTransaction::schedulePendingOperationTimer):
1589         (WebCore::IDBTransaction::pendingOperationTimerFired):
1590         (WebCore::IDBTransaction::operationCompletedOnServer):
1591         (WebCore::IDBTransaction::scheduleCompletedOperationTimer):
1592         (WebCore::IDBTransaction::completedOperationTimerFired):
1593         (WebCore::IDBTransaction::commit):
1594         (WebCore::IDBTransaction::commitOnServer):
1595         (WebCore::IDBTransaction::finishAbortOrCommit):
1596         (WebCore::IDBTransaction::didStart):
1597         (WebCore::IDBTransaction::notifyDidAbort):
1598         (WebCore::IDBTransaction::didAbort):
1599         (WebCore::IDBTransaction::didCommit):
1600         (WebCore::IDBTransaction::fireOnComplete):
1601         (WebCore::IDBTransaction::fireOnAbort):
1602         (WebCore::IDBTransaction::enqueueEvent):
1603         (WebCore::IDBTransaction::dispatchEvent):
1604         (WebCore::IDBTransaction::createObjectStore):
1605         (WebCore::IDBTransaction::createObjectStoreOnServer):
1606         (WebCore::IDBTransaction::didCreateObjectStoreOnServer):
1607         (WebCore::IDBTransaction::renameObjectStore):
1608         (WebCore::IDBTransaction::renameObjectStoreOnServer):
1609         (WebCore::IDBTransaction::didRenameObjectStoreOnServer):
1610         (WebCore::IDBTransaction::createIndex):
1611         (WebCore::IDBTransaction::createIndexOnServer):
1612         (WebCore::IDBTransaction::didCreateIndexOnServer):
1613         (WebCore::IDBTransaction::renameIndex):
1614         (WebCore::IDBTransaction::renameIndexOnServer):
1615         (WebCore::IDBTransaction::didRenameIndexOnServer):
1616         (WebCore::IDBTransaction::requestOpenCursor):
1617         (WebCore::IDBTransaction::doRequestOpenCursor):
1618         (WebCore::IDBTransaction::openCursorOnServer):
1619         (WebCore::IDBTransaction::didOpenCursorOnServer):
1620         (WebCore::IDBTransaction::iterateCursor):
1621         (WebCore::IDBTransaction::iterateCursorOnServer):
1622         (WebCore::IDBTransaction::didIterateCursorOnServer):
1623         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
1624         (WebCore::IDBTransaction::requestGetAllIndexRecords):
1625         (WebCore::IDBTransaction::getAllRecordsOnServer):
1626         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
1627         (WebCore::IDBTransaction::requestGetRecord):
1628         (WebCore::IDBTransaction::requestGetValue):
1629         (WebCore::IDBTransaction::requestGetKey):
1630         (WebCore::IDBTransaction::requestIndexRecord):
1631         (WebCore::IDBTransaction::getRecordOnServer):
1632         (WebCore::IDBTransaction::didGetRecordOnServer):
1633         (WebCore::IDBTransaction::requestCount):
1634         (WebCore::IDBTransaction::getCountOnServer):
1635         (WebCore::IDBTransaction::didGetCountOnServer):
1636         (WebCore::IDBTransaction::requestDeleteRecord):
1637         (WebCore::IDBTransaction::deleteRecordOnServer):
1638         (WebCore::IDBTransaction::didDeleteRecordOnServer):
1639         (WebCore::IDBTransaction::requestClearObjectStore):
1640         (WebCore::IDBTransaction::clearObjectStoreOnServer):
1641         (WebCore::IDBTransaction::didClearObjectStoreOnServer):
1642         (WebCore::IDBTransaction::requestPutOrAdd):
1643         (WebCore::IDBTransaction::putOrAddOnServer):
1644         (WebCore::IDBTransaction::didPutOrAddOnServer):
1645         (WebCore::IDBTransaction::deleteObjectStore):
1646         (WebCore::IDBTransaction::deleteObjectStoreOnServer):
1647         (WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
1648         (WebCore::IDBTransaction::deleteIndex):
1649         (WebCore::IDBTransaction::deleteIndexOnServer):
1650         (WebCore::IDBTransaction::didDeleteIndexOnServer):
1651         (WebCore::IDBTransaction::operationCompletedOnClient):
1652         (WebCore::IDBTransaction::establishOnServer):
1653         (WebCore::IDBTransaction::activate):
1654         (WebCore::IDBTransaction::deactivate):
1655         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1656         (WebCore::IDBClient::removeItemsMatchingCurrentThread):
1657         * Modules/indexeddb/client/TransactionOperation.h:
1658         (WebCore::IDBClient::TransactionOperation::~TransactionOperation):
1659         (WebCore::IDBClient::TransactionOperation::perform):
1660         (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread):
1661         (WebCore::IDBClient::TransactionOperation::transitionToComplete):
1662         (WebCore::IDBClient::TransactionOperation::doComplete):
1663         (WebCore::IDBClient::TransactionOperation::originThread const):
1664         (WebCore::IDBClient::TransactionOperation::originThreadID const): Deleted.
1665         * Modules/webaudio/AudioContext.cpp:
1666         (WebCore::AudioContext::AudioContext):
1667         (WebCore::AudioContext::lock):
1668         (WebCore::AudioContext::tryLock):
1669         (WebCore::AudioContext::unlock):
1670         (WebCore::AudioContext::isAudioThread const):
1671         (WebCore::AudioContext::isGraphOwner const):
1672         * Modules/webaudio/AudioContext.h:
1673         (WebCore::AudioContext::setAudioThread):
1674         (WebCore::AudioContext::audioThread const):
1675         * Modules/webaudio/AudioDestinationNode.cpp:
1676         (WebCore::AudioDestinationNode::render):
1677         * Modules/webdatabase/Database.cpp:
1678         (WebCore::Database::performClose):
1679         (WebCore::Database::securityOrigin):
1680         * Modules/webdatabase/DatabaseDetails.h:
1681         (WebCore::DatabaseDetails::DatabaseDetails):
1682         (WebCore::DatabaseDetails::operator=):
1683         (WebCore::DatabaseDetails::thread const):
1684         (WebCore::DatabaseDetails::threadID const): Deleted.
1685         * Modules/webdatabase/DatabaseManager.cpp:
1686         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1687         * Modules/webdatabase/DatabaseThread.cpp:
1688         (WebCore::DatabaseThread::databaseThread):
1689         (WebCore::DatabaseThread::recordDatabaseOpen):
1690         (WebCore::DatabaseThread::recordDatabaseClosed):
1691         * Modules/webdatabase/DatabaseThread.h:
1692         (WebCore::DatabaseThread::getThread):
1693         (WebCore::DatabaseThread::getThreadID): Deleted.
1694         * Modules/webdatabase/SQLTransaction.cpp:
1695         (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
1696         * Modules/webdatabase/SQLTransactionBackend.cpp:
1697         (WebCore::SQLTransactionBackend::doCleanup):
1698         (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown):
1699         * bindings/js/JSCallbackData.h:
1700         (WebCore::JSCallbackData::JSCallbackData):
1701         (WebCore::JSCallbackData::~JSCallbackData):
1702         * bindings/js/ScheduledAction.cpp:
1703         (WebCore::ScheduledAction::execute):
1704         * dom/ScriptExecutionContext.cpp:
1705         (WebCore::ScriptExecutionContext::createdMessagePort):
1706         (WebCore::ScriptExecutionContext::destroyedMessagePort):
1707         * page/ResourceUsageOverlay.h:
1708         * page/scrolling/ScrollingThread.cpp:
1709         (WebCore::ScrollingThread::isCurrentThread):
1710         * platform/Supplementable.h:
1711         (WebCore::Supplementable::provideSupplement):
1712         (WebCore::Supplementable::removeSupplement):
1713         (WebCore::Supplementable::requireSupplement):
1714         (WebCore::Supplementable::Supplementable): Deleted.
1715         * platform/Timer.cpp:
1716         (WebCore::TimerBase::TimerBase):
1717         (WebCore::TimerBase::start):
1718         (WebCore::TimerBase::stop):
1719         (WebCore::TimerBase::setNextFireTime):
1720         * platform/Timer.h:
1721         (WebCore::TimerBase::isActive const):
1722         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1723         (WebCore::shouldAutoActivateFontIfNeeded):
1724         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1725         (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
1726         (WebCore::TextureMapperPlatformLayerProxy::invalidate):
1727         (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
1728         (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers):
1729         (WebCore::TextureMapperPlatformLayerProxy::swapBuffer):
1730         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
1731         (): Deleted.
1732         * platform/ios/wak/WebCoreThread.mm:
1733         (RunWebThread):
1734         (StartWebThread):
1735         * platform/sql/SQLiteDatabase.cpp:
1736         (WebCore::SQLiteDatabase::open):
1737         (WebCore::SQLiteDatabase::close):
1738         * platform/sql/SQLiteDatabase.h:
1739         (WebCore::SQLiteDatabase::sqlite3Handle const):
1740         * workers/WorkerGlobalScope.cpp:
1741         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
1742         (WebCore::WorkerGlobalScope::isContextThread const):
1743         * workers/WorkerMessagingProxy.cpp:
1744         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
1745         (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy):
1746         * workers/WorkerRunLoop.cpp:
1747         (WebCore::WorkerRunLoop::runInMode):
1748         (WebCore::WorkerRunLoop::runCleanupTasks):
1749         * workers/WorkerThread.h:
1750         (WebCore::WorkerThread::thread const):
1751         (WebCore::WorkerThread::threadID const): Deleted.
1752         * workers/service/ServiceWorkerContainer.cpp:
1753         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
1754         (WebCore::ServiceWorkerContainer::scheduleJob):
1755         (WebCore::ServiceWorkerContainer::jobFailedWithException):
1756         (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
1757         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1758         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
1759         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
1760         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
1761         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
1762         (WebCore::ServiceWorkerContainer::jobDidFinish):
1763         (WebCore::ServiceWorkerContainer::addRegistration):
1764         (WebCore::ServiceWorkerContainer::removeRegistration):
1765         (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
1766         (WebCore::ServiceWorkerContainer::contextIdentifier):
1767         * workers/service/ServiceWorkerContainer.h:
1768         * workers/service/ServiceWorkerJob.cpp:
1769         (WebCore::ServiceWorkerJob::~ServiceWorkerJob):
1770         (WebCore::ServiceWorkerJob::failedWithException):
1771         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
1772         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
1773         (WebCore::ServiceWorkerJob::startScriptFetch):
1774         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
1775         (WebCore::ServiceWorkerJob::didReceiveResponse):
1776         (WebCore::ServiceWorkerJob::notifyFinished):
1777         * workers/service/ServiceWorkerJob.h:
1778         * xml/parser/XMLDocumentParserLibxml2.cpp:
1779         (WebCore::matchFunc):
1780         (WebCore::openFunc):
1781         (WebCore::initializeXMLParser):
1782         (WebCore::XMLParserContext::createStringParser):
1783         (WebCore::XMLParserContext::createMemoryParser):
1784
1785 2017-12-03  Youenn Fablet  <youenn@apple.com>
1786
1787         WebSocketChannel should ensure its client is live when calling it in error case
1788         https://bugs.webkit.org/show_bug.cgi?id=180285
1789
1790         Reviewed by Darin Adler.
1791
1792         No observable change of behavior.
1793         This makes it consistent with other calls of didReceiveMessageError.
1794
1795         * Modules/websockets/WebSocketChannel.cpp:
1796         (WebCore::WebSocketChannel::fail):
1797
1798 2017-12-03  Alexey Proskuryakov  <ap@apple.com>
1799
1800         WebArchiveResourceWebResourceHandler leaks when pasting
1801         https://bugs.webkit.org/show_bug.cgi?id=180339
1802
1803         Reviewed by Joseph Pecoraro.
1804
1805         * editing/cocoa/WebContentReaderCocoa.mm:
1806         (WebCore::attributesForAttributedStringConversion):
1807
1808 2017-12-03  Chris Dumez  <cdumez@apple.com>
1809
1810         Support serviceWorker.postMessage() inside service workers
1811         https://bugs.webkit.org/show_bug.cgi?id=180328
1812
1813         Reviewed by Darin Adler.
1814
1815         Support serviceWorker.postMessage() inside service workers.
1816
1817         No new tests, unskipped and rebaselined existing test that is
1818         now passing.
1819
1820         * workers/service/SWClientConnection.h:
1821         * workers/service/ServiceWorker.cpp:
1822         (WebCore::ServiceWorker::postMessage):
1823         * workers/service/context/SWContextManager.cpp:
1824         (WebCore::SWContextManager::postMessageToServiceWorker):
1825         * workers/service/context/SWContextManager.h:
1826         * workers/service/context/ServiceWorkerThread.cpp:
1827         (WebCore::fireMessageEvent):
1828         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
1829         * workers/service/context/ServiceWorkerThread.h:
1830
1831 2017-12-03  Chris Dumez  <cdumez@apple.com>
1832
1833         Implement self.skipWaiting() inside service workers
1834         https://bugs.webkit.org/show_bug.cgi?id=180329
1835
1836         Reviewed by Darin Adler.
1837
1838         Implement self.skipWaiting() inside service workers:
1839         - https://w3c.github.io/ServiceWorker/#service-worker-global-scope-skipwaiting
1840
1841         Also fixes a bug where tryActivate() was calling activate() even though the
1842         registration's active worker was "in use":
1843         - https://w3c.github.io/ServiceWorker/#try-activate-algorithm
1844
1845         No new tests, rebaselined existing tests.
1846
1847         * workers/service/ServiceWorkerGlobalScope.cpp:
1848         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
1849         * workers/service/context/SWContextManager.h:
1850         * workers/service/server/SWServerRegistration.cpp:
1851         (WebCore::SWServerRegistration::tryActivate):
1852         * workers/service/server/SWServerToContextConnection.cpp:
1853         (WebCore::SWServerToContextConnection::skipWaiting):
1854         * workers/service/server/SWServerToContextConnection.h:
1855         * workers/service/server/SWServerWorker.cpp:
1856         (WebCore::SWServerWorker::skipWaiting):
1857         * workers/service/server/SWServerWorker.h:
1858         (WebCore::SWServerWorker::isSkipWaitingFlagSet const):
1859
1860 2017-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1861
1862         [GStreamer] GstPad leaked in WebKitTextCombiner
1863         https://bugs.webkit.org/show_bug.cgi?id=180314
1864
1865         Reviewed by Michael Catanzaro.
1866
1867         gst_element_get_static_pad() returns a full reference that si never freed, because gst_ghost_pad_new doesn't
1868         take the ownership of the given pad.
1869
1870         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
1871         (webkit_text_combiner_init):
1872
1873 2017-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1874
1875         [GStreamer] GstCaps leaked in MediaPlayerPrivateGStreamer::createGSTPlayBin
1876         https://bugs.webkit.org/show_bug.cgi?id=180311
1877
1878         Reviewed by Michael Catanzaro.
1879
1880         gst_caps_new_empty_simple() is passed directly to g_object_set(). The returned caps should be freed with
1881         gst_caps_unref().
1882
1883         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1884         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1885
1886 2017-12-02  Youenn Fablet  <youenn@apple.com>
1887
1888         Move registration activation and clearing from SWServerJobQueue to SWServerRegistration
1889         https://bugs.webkit.org/show_bug.cgi?id=180325
1890
1891         Reviewed by Chris Dumez.
1892
1893         No change of behavior.
1894
1895         These algorithms fit naturally in SWServerRegistration and will be used as part of clients.claim.
1896
1897         * workers/service/server/SWServer.cpp:
1898         (WebCore::SWServer::clearAll):
1899         (WebCore::SWServer::didFinishActivation):
1900         * workers/service/server/SWServerJobQueue.cpp:
1901         (WebCore::SWServerJobQueue::scriptFetchFinished):
1902         (WebCore::SWServerJobQueue::scriptContextFailedToStart):
1903         (WebCore::SWServerJobQueue::didFinishInstall):
1904         (WebCore::SWServerJobQueue::runUnregisterJob):
1905         (WebCore::SWServerJobQueue::tryActivate): Deleted.
1906         (WebCore::SWServerJobQueue::activate): Deleted.
1907         (WebCore::SWServerJobQueue::didFinishActivation): Deleted.
1908         (WebCore::SWServerJobQueue::tryClearRegistration): Deleted.
1909         (WebCore::clearRegistrationWorker): Deleted.
1910         (WebCore::SWServerJobQueue::clearRegistration): Deleted.
1911         * workers/service/server/SWServerJobQueue.h:
1912         * workers/service/server/SWServerRegistration.cpp:
1913         (WebCore::SWServerRegistration::tryClear):
1914         (WebCore::clearRegistrationWorker):
1915         (WebCore::SWServerRegistration::clear):
1916         (WebCore::SWServerRegistration::tryActivate):
1917         (WebCore::SWServerRegistration::activate):
1918         (WebCore::SWServerRegistration::didFinishActivation):
1919         * workers/service/server/SWServerRegistration.h:
1920
1921 2017-12-02  Chris Dumez  <cdumez@apple.com>
1922
1923         Support container.register() / registration.unregister() /  inside service workers
1924         https://bugs.webkit.org/show_bug.cgi?id=180326
1925
1926         Reviewed by Youenn Fablet.
1927
1928         Support container.register() / registration.unregister() /  inside service workers.
1929         This is mostly about removing the is<Document>() checks and adding testing given
1930         that most of the work was done in r225455.
1931
1932         Test: http/tests/workers/service/ServiceWorkerGlobalScope_register.html
1933
1934         * workers/service/ServiceWorkerContainer.cpp:
1935         (WebCore::ServiceWorkerContainer::addRegistration):
1936         * workers/service/ServiceWorkerRegistration.cpp:
1937         (WebCore::ServiceWorkerRegistration::update):
1938         (WebCore::ServiceWorkerRegistration::unregister):
1939
1940 2017-12-02  Chris Dumez  <cdumez@apple.com>
1941
1942         Support serviceWorkerRegistration.update() inside service workers
1943         https://bugs.webkit.org/show_bug.cgi?id=180215
1944
1945         Reviewed by Darin Adler.
1946
1947         Support serviceWorkerRegistration.update() inside service workers. The code paths
1948         for job scheduling and resolution have been made thread safe by hopping to the right
1949         thread when necessary. In particular, ServiceWorkerContainer always makes sure to to
1950         a callOnMainThread() before calling methods on the SWClientConnection. Also, the
1951         SWClientConnection relies on a new postTaskTo() method before calling methods on the
1952         job.
1953
1954         Test: http/tests/workers/service/self_registration_update.html
1955
1956         * workers/service/SWClientConnection.cpp:
1957         (WebCore::SWClientConnection::scheduleJob):
1958         (WebCore::SWClientConnection::finishedFetchingScript):
1959         (WebCore::SWClientConnection::failedFetchingScript):
1960         (WebCore::SWClientConnection::jobRejectedInServer):
1961         (WebCore::SWClientConnection::registrationJobResolvedInServer):
1962         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
1963         (WebCore::SWClientConnection::startScriptFetchForServer):
1964         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
1965         (WebCore::SWClientConnection::updateRegistrationState):
1966         (WebCore::SWClientConnection::updateWorkerState):
1967         (WebCore::SWClientConnection::fireUpdateFoundEvent):
1968         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
1969         (WebCore::SWClientConnection::clearPendingJobs):
1970         (WebCore::SWClientConnection::postTaskTo):
1971         * workers/service/SWClientConnection.h:
1972         * workers/service/ServiceWorkerContainer.cpp:
1973         (WebCore::ServiceWorkerContainer::scheduleJob):
1974         (WebCore::ServiceWorkerContainer::jobFailedWithException):
1975         (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
1976         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1977         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
1978         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
1979         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
1980         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
1981         (WebCore::ServiceWorkerContainer::jobDidFinish):
1982         (WebCore::ServiceWorkerContainer::addRegistration):
1983         (WebCore::ServiceWorkerContainer::removeRegistration):
1984         (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
1985         (WebCore::ServiceWorkerContainer::contextIdentifier):
1986         * workers/service/ServiceWorkerContainer.h:
1987         * workers/service/ServiceWorkerJob.cpp:
1988         (WebCore::ServiceWorkerJob::ServiceWorkerJob):
1989         * workers/service/ServiceWorkerJob.h:
1990         (WebCore::ServiceWorkerJob::contextIdentifier):
1991         * workers/service/ServiceWorkerJobClient.h:
1992         * workers/service/ServiceWorkerRegistration.cpp:
1993         (WebCore::ServiceWorkerRegistration::update):
1994         * workers/service/ServiceWorkerTypes.h:
1995
1996 2017-12-02  Simon Fraser  <simon.fraser@apple.com>
1997
1998         Make IOSurface::Locker and use it in ImageBufferDataCG
1999         https://bugs.webkit.org/show_bug.cgi?id=180317
2000
2001         Reviewed by Zalan Bujtas.
2002
2003         Add an RAII IOSurface::Locker which can lock readonly or readwrite. Access
2004         to the IOSurface base address is through the locker.
2005         
2006         Add IOSurface::bytesPerRow() to wrap IOSurfaceGetBytesPerRow().
2007         
2008         After this, there is only one location where we access the IOSurfaceRef
2009         directly, in WebGL code.
2010
2011         * platform/graphics/cg/ImageBufferDataCG.cpp:
2012         (WebCore::ImageBufferData::toBGRAData const):
2013         (WebCore::ImageBufferData::getData const):
2014         (WebCore::ImageBufferData::putData):
2015         * platform/graphics/cocoa/IOSurface.h:
2016         * platform/graphics/cocoa/IOSurface.mm:
2017         (WebCore::IOSurface::bytesPerRow const):
2018
2019 2017-12-02  Simon Fraser  <simon.fraser@apple.com>
2020
2021         Add an AlphaPremultiplication enum and use it consistently
2022         https://bugs.webkit.org/show_bug.cgi?id=180316
2023
2024         Reviewed by Zalan Bujtas.
2025
2026         ImageBuffer-related code sometimes used the 'Multiply' enum, and sometimes
2027         a bool to represent alpha premultiplication. Make an enum class and use it
2028         everywhere. Re-order and rename some parameters to clarify the meaning of this
2029         argument.
2030
2031         * html/canvas/CanvasRenderingContext2D.cpp:
2032         (WebCore::CanvasRenderingContext2D::putImageData):
2033         * platform/graphics/GraphicsTypes.cpp:
2034         (WebCore::operator<<):
2035         * platform/graphics/GraphicsTypes.h:
2036         * platform/graphics/ImageBuffer.cpp:
2037         (WebCore::ImageBuffer::genericConvertToLuminanceMask):
2038         * platform/graphics/ImageBuffer.h:
2039         * platform/graphics/ShadowBlur.cpp:
2040         (WebCore::ShadowBlur::blurShadowBuffer):
2041         * platform/graphics/cairo/ImageBufferCairo.cpp:
2042         (WebCore::getImageData):
2043         (WebCore::ImageBuffer::getUnmultipliedImageData const):
2044         (WebCore::ImageBuffer::getPremultipliedImageData const):
2045         (WebCore::ImageBuffer::putByteArray):
2046         * platform/graphics/cg/ImageBufferCG.cpp:
2047         (WebCore::ImageBuffer::getUnmultipliedImageData const):
2048         (WebCore::ImageBuffer::getPremultipliedImageData const):
2049         (WebCore::ImageBuffer::putByteArray):
2050         * platform/graphics/cg/ImageBufferDataCG.cpp:
2051         (WebCore::ImageBufferData::getData const):
2052         (WebCore::ImageBufferData::putData):
2053         * platform/graphics/cg/ImageBufferDataCG.h:
2054         * platform/graphics/filters/FEColorMatrix.cpp:
2055         (WebCore::FEColorMatrix::platformApplySoftware):
2056         * platform/graphics/filters/FEDropShadow.cpp:
2057         (WebCore::FEDropShadow::platformApplySoftware):
2058         * platform/graphics/filters/FilterEffect.cpp:
2059         (WebCore::FilterEffect::imageBufferResult):
2060         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2061         (WebCore::ImageBufferData::getData const):
2062         (WebCore::ImageBufferData::putData):
2063         * platform/graphics/win/ImageBufferDataDirect2D.h:
2064         * platform/graphics/win/ImageBufferDirect2D.cpp:
2065         (WebCore::ImageBuffer::getUnmultipliedImageData const):
2066         (WebCore::ImageBuffer::getPremultipliedImageData const):
2067         (WebCore::ImageBuffer::putByteArray):
2068
2069 2017-12-02  Youenn Fablet  <youenn@apple.com>
2070
2071         Implement https://w3c.github.io/ServiceWorker/#clients-getall
2072         https://bugs.webkit.org/show_bug.cgi?id=180276
2073
2074         Reviewed by Chris Dumez.
2075
2076         Test: http/tests/workers/service/serviceworkerclients-matchAll.https.html
2077
2078         Move Clients QueryOptions to its own class since it is used by various parties.
2079         Add encoder/decoder routines.
2080
2081         Add a ServieWorkerClientInformation which replaces SWServer::ClientInformation structure.
2082         This is what is sent back as a result to matchAll requests.
2083         Add encoder/decoder routines.
2084
2085         Implement matchAll by hopping to the main thread, making IPC to the storage process.
2086         SWServer in storage process then iterates through the relevant service workers and does some filtering.
2087         Additional filtering and information should be gathered in future patches to fully implement the algorithm.
2088
2089         Add to SWServer a HashMap to easily identify by which service worker a client is controlled, if any.
2090         This map is updated at the same time registrations are updated.
2091
2092         matchAll is given a callback as in the future, window client information will be retrieved asynchronously.
2093
2094         * WebCore.xcodeproj/project.pbxproj:
2095         * workers/service/ServiceWorkerClientInformation.h: Added.
2096         (WebCore::ServiceWorkerClientInformation::isolatedCopy const):
2097         (WebCore::ServiceWorkerClientInformation::encode const):
2098         (WebCore::ServiceWorkerClientInformation::decode):
2099         * workers/service/ServiceWorkerClientQueryOptions.h: Added.
2100         (WebCore::ServiceWorkerClientQueryOptions::encode const):
2101         (WebCore::ServiceWorkerClientQueryOptions::decode):
2102         * workers/service/ServiceWorkerClients.cpp:
2103         (WebCore::ServiceWorkerClients::matchAll):
2104         * workers/service/ServiceWorkerClients.h:
2105         * workers/service/context/SWContextManager.h:
2106         * workers/service/server/SWServer.cpp:
2107         (WebCore::SWServer::matchAll):
2108         (WebCore::SWServer::registerServiceWorkerClient):
2109         * workers/service/server/SWServer.h:
2110         * workers/service/server/SWServerToContextConnection.cpp:
2111         (WebCore::SWServerToContextConnection::matchAll):
2112         * workers/service/server/SWServerToContextConnection.h:
2113         * workers/service/server/SWServerWorker.cpp:
2114         (WebCore::SWServerWorker::matchAll):
2115         * workers/service/server/SWServerWorker.h:
2116
2117 2017-12-02  Brady Eidson  <beidson@apple.com>
2118
2119         Factor out the "databaseTaskQueue" parts of IDBServer into something reusable.
2120         https://bugs.webkit.org/show_bug.cgi?id=180298
2121
2122         Reviewed by Chris Dumez.
2123
2124         No new tests (Refactor only).
2125
2126         * Modules/indexeddb/server/IDBServer.cpp:
2127         (WebCore::IDBServer::IDBServer::IDBServer):
2128         (WebCore::IDBServer::IDBServer::postDatabaseTask):
2129         (WebCore::IDBServer::IDBServer::postDatabaseTaskReply):
2130         (WebCore::IDBServer::IDBServer::databaseRunLoop): Deleted.
2131         (WebCore::IDBServer::IDBServer::handleTaskRepliesOnMainThread): Deleted.
2132         * Modules/indexeddb/server/IDBServer.h:
2133         (): Deleted.
2134
2135 2017-12-02  Simon Fraser  <simon.fraser@apple.com>
2136
2137         Add a log channel for viewports
2138         https://bugs.webkit.org/show_bug.cgi?id=180295
2139
2140         Reviewed by Zalan Bujtas.
2141
2142         Add a "Viewports" log channel to log viewport scaling information, and enhance the
2143         WebKit "VisibleRects" channel to log additional data for the same reason.
2144
2145         * dom/Document.cpp:
2146         (WebCore::Document::processViewport):
2147         * loader/FrameLoader.cpp:
2148         (WebCore::FrameLoader::finishedParsing):
2149         (WebCore::FrameLoader::completed):
2150         * page/FrameView.cpp:
2151         (WebCore::FrameView::resetScrollbarsAndClearContentsSize):
2152         (WebCore::FrameView::scrollToAnchor):
2153         (WebCore::FrameView::maintainScrollPositionAtAnchor):
2154         (WebCore::FrameView::setScrollPosition):
2155         (WebCore::FrameView::autoSizeIfEnabled):
2156         (WebCore::FrameView::setWasScrolledByUser):
2157         * page/LayoutContext.cpp:
2158         (WebCore::LayoutContext::layout):
2159         * page/Page.cpp:
2160         (WebCore::Page::setPageScaleFactor):
2161         * page/ViewportConfiguration.cpp:
2162         (WebCore::ViewportConfiguration::setContentsSize):
2163         (WebCore::ViewportConfiguration::setViewportArguments):
2164         (WebCore::ViewportConfiguration::updateConfiguration):
2165         (WebCore::operator<<):
2166         (WebCore::ViewportConfiguration::description const):
2167         (WebCore::ViewportConfiguration::dump const):
2168         * page/ViewportConfiguration.h:
2169         * platform/Logging.h:
2170         * platform/ScrollView.cpp:
2171         (WebCore::ScrollView::setFixedLayoutSize):
2172
2173 2017-12-01  Alicia Boya García  <aboya@igalia.com>
2174
2175         [MSE] Use correct range end checks in sourceBufferPrivateDidReceiveSample()
2176         https://bugs.webkit.org/show_bug.cgi?id=179690
2177
2178         Reviewed by Jer Noble.
2179
2180         The Coded Frame Processing algorithm as defined in
2181         https://www.w3.org/TR/media-source/#sourcebuffer-coded-frame-processing states:
2182
2183         1.14. Remove existing coded frames in track buffer:
2184          -> If highest end timestamp for track buffer is not set:
2185                [...]
2186          -> If highest end timestamp for track buffer is set and less than or
2187             equal to presentation timestamp:
2188                Remove all coded frames from track buffer that have a
2189                presentation timestamp greater than or equal to highest end
2190                timestamp and less than frame end timestamp.
2191
2192         Note the removal range is closed-open [a, b). WebKit is actually removing
2193         frames using an open-closed range (a, b], which causes frames not to be removed
2194         in situations where they should and frames to be removed in situations when
2195         they should not.
2196
2197         Tests: media/media-source/media-source-range-end-frame-not-removed.html
2198                media/media-source/media-source-range-start-frame-replaced.html
2199
2200         * Modules/mediasource/SampleMap.cpp:
2201         (WebCore::PresentationOrderSampleMap::findSamplesBetweenPresentationTimesFromEnd):
2202         * Modules/mediasource/SampleMap.h:
2203         * Modules/mediasource/SourceBuffer.cpp:
2204         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2205
2206 2017-12-01  Simon Fraser  <simon.fraser@apple.com>
2207
2208         Reduce the number of calls to ViewportConfiguration::updateConfiguration()
2209         https://bugs.webkit.org/show_bug.cgi?id=180299
2210
2211         Reviewed by Zalan Bujtas.
2212
2213         There are several calls to ViewportConfiguration::setDefaultConfiguration() during loading
2214         with the same arguments. We can avoid unnecessary calls to updateConfiguration() by returning
2215         early if the configuration hasn't changed.
2216
2217         * page/ViewportConfiguration.cpp:
2218         (WebCore::ViewportConfiguration::setDefaultConfiguration):
2219         * page/ViewportConfiguration.h:
2220         (WebCore::ViewportConfiguration::Parameters::operator== const):
2221
2222 2017-12-01  Aishwarya Nirmal  <anirmal@apple.com>
2223
2224         [Touch Bar Web API] Object representing Touch Bar Menu to send between Web and UI Processes
2225         https://bugs.webkit.org/show_bug.cgi?id=179714
2226
2227         Reviewed by Wenson Hsieh.
2228
2229         These changes allow the HTMLMenuElement and HTMLMenuItemElement to parse attributes relating
2230         to the touch bar and convey changes to the elements that will eventually be propogated to the
2231         UI process.
2232
2233         No new tests at this point because the changes to HTMLMenuElement and HTMLMenuItemElement are
2234         new properties, which might not be worth testing, and overriden methods for insertedIntoAncestor
2235         and removedFromAncestor, which are involved in sending a message to a UI process but might be
2236         difficult to test at this point since the UI process only receives (and does not yet process)
2237         the message.
2238
2239         * html/HTMLMenuElement.cpp:
2240         (WebCore::HTMLMenuElement::insertedIntoAncestor):
2241         (WebCore::HTMLMenuElement::removedFromAncestor):
2242         (WebCore::HTMLMenuElement::parseAttribute):
2243         * html/HTMLMenuElement.h:
2244         * html/HTMLMenuItemElement.cpp:
2245         (WebCore::HTMLMenuItemElement::insertedIntoAncestor):
2246         (WebCore::HTMLMenuItemElement::removedFromAncestor):
2247         * html/HTMLMenuItemElement.h:
2248         * page/ChromeClient.h:
2249
2250 2017-12-01  Daniel Bates  <dabates@apple.com>
2251
2252         AlternativePresentationButtonSubstitution::unapply() may not undo substitution
2253         https://bugs.webkit.org/show_bug.cgi?id=180279
2254         <rdar://problem/35800599>
2255
2256         Reviewed by Simon Fraser.
2257
2258         Fixes an issue where removing an alternative presentation button substituted for a non-HTML input
2259         element did not restore the original appearance of the element before the substitution.
2260
2261         To substitute the alternative presentation button for a non-HTML input element we attach a
2262         user-agent shadow root to it. Adding a shadow root, including a user-agent shadow root,
2263         tears down the existing renderers for the element. Currently when we unapply such a substitution
2264         we ultimately just remove the shadow root and do not create new renderers for the subtree
2265         that the shadow root was removed from. We need to create new renderers for this subtree
2266         to restore the original appearance of the element before the substitution.
2267
2268         * editing/cocoa/AlternativePresentationButtonSubstitution.cpp:
2269         (WebCore::AlternativePresentationButtonSubstitution::unapply):
2270
2271 2017-12-01  Christopher Reid  <chris.reid@sony.com>
2272
2273         Move DateComponents into WTF
2274         https://bugs.webkit.org/show_bug.cgi?id=180211
2275
2276         Reviewed by Myles C. Maxfield.
2277
2278         No new tests no change in behavior.
2279
2280         Moved DateComponents from platform into WTF.
2281
2282         * Sources.txt: Removed DateComponents
2283         * WebCore.xcodeproj/project.pbxproj: Removed DateComponents
2284         * dom/Document.cpp:
2285         * html/BaseDateAndTimeInputType.h:
2286         * html/DateTimeInputType.h: Fixed a call to the wrong parent constructor
2287         * html/HTMLInputElement.h:
2288         * html/InputType.cpp:
2289         * html/InputType.h:
2290         * platform/text/PlatformLocale.cpp:
2291         * platform/text/PlatformLocale.h:
2292         * platform/text/ios/LocalizedDateCache.h:
2293         * platform/text/mac/LocaleMac.h:
2294         * platform/text/win/LocaleWin.cpp:
2295         * platform/text/win/LocaleWin.h:
2296         * rendering/RenderThemeIOS.mm:
2297
2298 2017-12-01  Daniel Bates  <dabates@apple.com>
2299
2300         Alternative Presentation Button: Provide a way to query for the replaced elements
2301         https://bugs.webkit.org/show_bug.cgi?id=180114
2302         <rdar://problem/35710539>
2303
2304         Reviewed by Tim Horton.
2305
2306         Add SPI to query for the elements that were replaced by an Alternative Presentation Button.
2307
2308         Test: fast/forms/alternative-presentation-button/replaced-elements.html
2309
2310         * editing/Editor.cpp:
2311         (WebCore::Editor::elementsReplacedByAlternativePresentationButton): Added.
2312         * editing/Editor.h:
2313         * editing/cocoa/AlternativePresentationButtonSubstitution.cpp:
2314         (WebCore::AlternativePresentationButtonSubstitution::replacedElements): Added.
2315         * editing/cocoa/AlternativePresentationButtonSubstitution.h:
2316         * testing/Internals.cpp:
2317         (WebCore::Internals::elementsReplacedByAlternativePresentationButton): Added.
2318         * testing/Internals.h:
2319         * testing/Internals.idl: Expose internals function elementsReplacedByAlternativePresentationButton()
2320         so as to test Editor::elementsReplacedByAlternativePresentationButton().
2321
2322 2017-12-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
2323
2324         Rename ImageFrameCache to ImageSource
2325         https://bugs.webkit.org/show_bug.cgi?id=180172
2326
2327         Reviewed by Per Arne Vollan.
2328
2329         This is a follow-up for r225300. ImageSource is the intended name after
2330         merging ImageFrameCache and ImageSource.
2331
2332         * Sources.txt:
2333         * WebCore.xcodeproj/project.pbxproj:
2334         * platform/graphics/BitmapImage.cpp:
2335         (WebCore::BitmapImage::BitmapImage):
2336         * platform/graphics/BitmapImage.h:
2337         * platform/graphics/ImageFrame.h:
2338         * platform/graphics/ImageFrameCache.cpp: Removed.
2339         * platform/graphics/ImageFrameCache.h: Removed.
2340         * platform/graphics/ImageSource.cpp: Added.
2341         (WebCore::ImageSource::ImageSource):
2342         (WebCore::ImageSource::~ImageSource):
2343         (WebCore::ImageSource::ensureDecoderAvailable):
2344         (WebCore::ImageSource::setData):
2345         (WebCore::ImageSource::resetData):
2346         (WebCore::ImageSource::dataChanged):
2347         (WebCore::ImageSource::isAllDataReceived):
2348         (WebCore::ImageSource::destroyDecodedData):
2349         (WebCore::ImageSource::destroyIncompleteDecodedData):
2350         (WebCore::ImageSource::clearFrameBufferCache):
2351         (WebCore::ImageSource::decodedSizeChanged):
2352         (WebCore::ImageSource::decodedSizeIncreased):
2353         (WebCore::ImageSource::decodedSizeDecreased):
2354         (WebCore::ImageSource::decodedSizeReset):
2355         (WebCore::ImageSource::didDecodeProperties):
2356         (WebCore::ImageSource::growFrames):
2357         (WebCore::ImageSource::setNativeImage):
2358         (WebCore::ImageSource::cacheMetadataAtIndex):
2359         (WebCore::ImageSource::cacheNativeImageAtIndex):
2360         (WebCore::ImageSource::cacheNativeImageAtIndexAsync):
2361         (WebCore::ImageSource::decodingQueue):
2362         (WebCore::ImageSource::frameRequestQueue):
2363         (WebCore::ImageSource::canUseAsyncDecoding):
2364         (WebCore::ImageSource::startAsyncDecodingQueue):
2365         (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
2366         (WebCore::ImageSource::isAsyncDecodingQueueIdle const):
2367         (WebCore::ImageSource::stopAsyncDecodingQueue):
2368         (WebCore::ImageSource::frameAtIndexCacheIfNeeded):
2369         (WebCore::ImageSource::clearMetadata):
2370         (WebCore::ImageSource::sourceURL const):
2371         (WebCore::ImageSource::mimeType const):
2372         (WebCore::ImageSource::expectedContentLength const):
2373         (WebCore::ImageSource::metadata):
2374         (WebCore::ImageSource::frameMetadataAtIndex):
2375         (WebCore::ImageSource::frameMetadataAtIndexCacheIfNeeded):
2376         (WebCore::ImageSource::encodedDataStatus):
2377         (WebCore::ImageSource::frameCount):
2378         (WebCore::ImageSource::repetitionCount):
2379         (WebCore::ImageSource::uti):
2380         (WebCore::ImageSource::filenameExtension):
2381         (WebCore::ImageSource::hotSpot):
2382         (WebCore::ImageSource::size):
2383         (WebCore::ImageSource::sizeRespectingOrientation):
2384         (WebCore::ImageSource::singlePixelSolidColor):
2385         (WebCore::ImageSource::maximumSubsamplingLevel):
2386         (WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex):
2387         (WebCore::ImageSource::frameDecodingStatusAtIndex):
2388         (WebCore::ImageSource::frameHasAlphaAtIndex):
2389         (WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex):
2390         (WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex):
2391         (WebCore::ImageSource::frameSubsamplingLevelAtIndex):
2392         (WebCore::ImageSource::frameSizeAtIndex):
2393         (WebCore::ImageSource::frameBytesAtIndex):
2394         (WebCore::ImageSource::frameDurationAtIndex):
2395         (WebCore::ImageSource::frameOrientationAtIndex):
2396         (WebCore::ImageSource::setTargetContext):
2397         (WebCore::ImageSource::createFrameImageAtIndex):
2398         (WebCore::ImageSource::frameImageAtIndex):
2399         (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded):
2400         (WebCore::ImageSource::dump):
2401         * platform/graphics/ImageSource.h: Added.
2402         (WebCore::ImageSource::create):
2403         (WebCore::ImageSource::decodedSize const):
2404         (WebCore::ImageSource::destroyAllDecodedData):
2405         (WebCore::ImageSource::destroyAllDecodedDataExcludeFrame):
2406         (WebCore::ImageSource::destroyDecodedDataBeforeFrame):
2407         (WebCore::ImageSource::clearImage):
2408         (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
2409         (WebCore::ImageSource::hasAsyncDecodingQueue const):
2410         (WebCore::ImageSource::isSizeAvailable):
2411         (WebCore::ImageSource::isDecoderAvailable const):
2412         (WebCore::ImageSource::frameAtIndexCacheIfNeeded):
2413         (WebCore::ImageSource::ImageFrameRequest::operator== const):
2414         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2415         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2416         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2417         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2418
2419 2017-12-01  Youenn Fablet  <youenn@apple.com>
2420
2421         Implement https://w3c.github.io/ServiceWorker/#clients-get
2422         https://bugs.webkit.org/show_bug.cgi?id=180167
2423
2424         Reviewed by Chris Dumez.
2425
2426         Test: http/tests/workers/service/serviceworkerclients-get.https.html
2427
2428         Implement clients get by having service worker clients do the following:
2429         - Go to main thread to query the SWClientConnection for getting the client.
2430         - SWClientConnection requests it through IPC to StorageProcess SWServer.
2431         - SWServer looks at its client map and returns client data based on the given identifier.
2432         - SWClientConnection sends it back to the right clients for resolving the promise.
2433
2434         Identifier is parsed at service worker process level.
2435
2436         Made ServiceWorkerClients no longer an ActiveDOMObject since it is owned by ServiceWorkerGlobalScope
2437         and is only exposed in service workers.
2438
2439         * workers/service/ServiceWorkerClientIdentifier.h:
2440         (WebCore::ServiceWorkerClientIdentifier::fromString):
2441         * workers/service/ServiceWorkerClients.cpp:
2442         (WebCore::ServiceWorkerClients::ServiceWorkerClients):
2443         (WebCore::ServiceWorkerClients::get):
2444         * workers/service/ServiceWorkerClients.h:
2445         (WebCore::ServiceWorkerClients::create):
2446         * workers/service/context/SWContextManager.cpp:
2447         (WebCore::SWContextManager::postTaskToServiceWorker):
2448         * workers/service/context/SWContextManager.h:
2449         * workers/service/server/SWServer.cpp:
2450         (WebCore::SWServer::getClientFromId):
2451         * workers/service/server/SWServer.h:
2452         * workers/service/server/SWServerToContextConnection.cpp:
2453         (WebCore::SWServerToContextConnection::findClientByIdentifier):
2454         * workers/service/server/SWServerToContextConnection.h:
2455         * workers/service/server/SWServerWorker.cpp:
2456         (WebCore::SWServerWorker::origin const):
2457         (WebCore::SWServerWorker::findClientByIdentifier):
2458         * workers/service/server/SWServerWorker.h:
2459
2460 2017-12-01  Brian Burg  <bburg@apple.com>
2461
2462         Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
2463         https://bugs.webkit.org/show_bug.cgi?id=173662
2464
2465         Reviewed by Joseph Pecoraro.
2466
2467         Adopt new type names.
2468
2469         * inspector/InspectorCanvas.cpp:
2470         (WebCore::InspectorCanvas::recordAction):
2471         (WebCore::InspectorCanvas::releaseFrames):
2472         (WebCore::InspectorCanvas::releaseData):
2473         (WebCore::InspectorCanvas::indexForData):
2474         (WebCore::buildArrayForAffineTransform):
2475         (WebCore::buildArrayForVector):
2476         (WebCore::InspectorCanvas::buildInitialState):
2477         (WebCore::InspectorCanvas::buildAction):
2478         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
2479         (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
2480         (WebCore::InspectorCanvas::buildArrayForImageData):
2481         (WebCore::InspectorCanvas::buildArrayForImageBitmap):
2482         * inspector/InspectorCanvas.h:
2483         * inspector/InspectorController.cpp:
2484         (WebCore::InspectorController::buildObjectForHighlightedNodes const):
2485         * inspector/InspectorController.h:
2486         * inspector/InspectorOverlay.cpp:
2487         (WebCore::buildObjectForHighlight):
2488         (WebCore::InspectorOverlay::drawPaintRects):
2489         (WebCore::buildArrayForRendererFragments):
2490         (WebCore::buildObjectForElementData):
2491         (WebCore::InspectorOverlay::buildHighlightObjectForNode const):
2492         (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const):
2493         * inspector/InspectorOverlay.h:
2494         * inspector/InspectorStyleSheet.cpp:
2495         (WebCore::fillMediaListChain):
2496         (WebCore::InspectorStyle::buildArrayForComputedStyle const):
2497         (WebCore::InspectorStyle::styleWithProperties const):
2498         (WebCore::buildObjectForSelectorHelper):
2499         (WebCore::selectorsFromSource):
2500         (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
2501         (WebCore::InspectorStyleSheet::buildObjectForRule):
2502         (WebCore::InspectorStyleSheet::buildObjectForStyle):
2503         (WebCore::InspectorStyleSheet::buildArrayForRuleList):
2504         * inspector/InspectorStyleSheet.h:
2505         * inspector/agents/InspectorApplicationCacheAgent.cpp:
2506         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
2507         (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
2508         * inspector/agents/InspectorApplicationCacheAgent.h:
2509         * inspector/agents/InspectorCSSAgent.cpp:
2510         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
2511         (WebCore::InspectorCSSAgent::getComputedStyleForNode):
2512         (WebCore::InspectorCSSAgent::getAllStyleSheets):
2513         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
2514         (WebCore::InspectorCSSAgent::getSupportedSystemFontFamilyNames):
2515         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
2516         * inspector/agents/InspectorCSSAgent.h:
2517         * inspector/agents/InspectorCanvasAgent.cpp:
2518         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
2519         * inspector/agents/InspectorCanvasAgent.h:
2520         * inspector/agents/InspectorDOMAgent.cpp:
2521         (WebCore::InspectorDOMAgent::querySelectorAll):
2522         (WebCore::InspectorDOMAgent::pushNodePathToFrontend):
2523         (WebCore::InspectorDOMAgent::getEventListenersForNode):
2524         (WebCore::InspectorDOMAgent::getSearchResults):
2525         (WebCore::InspectorDOMAgent::getAttributes):
2526         (WebCore::InspectorDOMAgent::buildObjectForNode):
2527         (WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
2528         (WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
2529         (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
2530         (WebCore::InspectorDOMAgent::processAccessibilityChildren):
2531         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2532         (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
2533         * inspector/agents/InspectorDOMAgent.h:
2534         * inspector/agents/InspectorDOMStorageAgent.cpp:
2535         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
2536         * inspector/agents/InspectorDOMStorageAgent.h:
2537         * inspector/agents/InspectorDatabaseAgent.cpp:
2538         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
2539         * inspector/agents/InspectorDatabaseAgent.h:
2540         * inspector/agents/InspectorIndexedDBAgent.cpp:
2541         (WebCore::Inspector::keyPathFromIDBKeyPath):
2542         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
2543         * inspector/agents/InspectorLayerTreeAgent.cpp:
2544         (WebCore::InspectorLayerTreeAgent::layersForNode):
2545         (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
2546         (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy):
2547         * inspector/agents/InspectorLayerTreeAgent.h:
2548         * inspector/agents/InspectorMemoryAgent.cpp:
2549         (WebCore::InspectorMemoryAgent::collectSample):
2550         * inspector/agents/InspectorNetworkAgent.cpp:
2551         (WebCore::InspectorNetworkAgent::searchOtherRequests):
2552         (WebCore::InspectorNetworkAgent::searchInRequest):
2553         * inspector/agents/InspectorNetworkAgent.h:
2554         * inspector/agents/InspectorPageAgent.cpp:
2555         (WebCore::buildArrayForCookies):
2556         (WebCore::InspectorPageAgent::getCookies):
2557         (WebCore::InspectorPageAgent::searchInResource):
2558         (WebCore::InspectorPageAgent::searchInResources):
2559         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
2560         * inspector/agents/InspectorPageAgent.h:
2561         * inspector/agents/WebConsoleAgent.cpp:
2562         (WebCore::WebConsoleAgent::getLoggingChannels):
2563         * inspector/agents/WebConsoleAgent.h:
2564
2565 2017-12-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2566
2567         [Attachment Support] Implement SPI for clients to update a given attachment's data
2568         https://bugs.webkit.org/show_bug.cgi?id=180184
2569         <rdar://problem/35355731>
2570
2571         Reviewed by Tim Horton.
2572
2573         Add native API support for Mail to update the data (and optionally, the name and type) of a given attachment
2574         element. See per-method comments below for more detail.
2575
2576         Test: WKAttachmentTests.ChangeAttachmentDataAndFileInformation
2577               WKAttachmentTests.ChangeAttachmentDataUpdatesWithInPlaceDisplay
2578
2579         * editing/Editor.cpp:
2580         (WebCore::Editor::insertAttachment):
2581         * html/HTMLAttachmentElement.cpp:
2582         (WebCore::HTMLAttachmentElement::setFile):
2583         (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary):
2584
2585         Pull out logic to hide and reset shadow DOM state into a separate helper, and additionally hide both the image
2586         and video child elements if they exist. This prevents us from getting into a state where both image and video
2587         elements may appear side-by-side when changing data from an image to a video or vice versa.
2588
2589         (WebCore::HTMLAttachmentElement::updateFileWithData):
2590
2591         Add a new helper to update the backing File of an attachment element from data, optionally updating the filename
2592         and content type as well.
2593
2594         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
2595         * html/HTMLAttachmentElement.h:
2596
2597 2017-12-01  Chris Dumez  <cdumez@apple.com>
2598
2599         Get rid of microtask in ServiceWorkerContainer::jobResolvedWithRegistration()
2600         https://bugs.webkit.org/show_bug.cgi?id=180263
2601
2602         Reviewed by Youenn Fablet.
2603
2604         Get rid of microtask in ServiceWorkerContainer::jobResolvedWithRegistration(). It
2605         is no longer needed and MicrotaskQueue::mainThreadQueue() is only safe to use from
2606         the main thread, as its name suggest. ServiceWorkerContainer are also instantiated
2607         in Service worker threads nowadays.
2608
2609         * workers/service/SWClientConnection.cpp:
2610         (WebCore::SWClientConnection::registrationJobResolvedInServer):
2611         * workers/service/ServiceWorkerContainer.cpp:
2612         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2613         * workers/service/ServiceWorkerContainer.h:
2614         * workers/service/ServiceWorkerJob.cpp:
2615         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
2616         * workers/service/ServiceWorkerJob.h:
2617         * workers/service/ServiceWorkerJobClient.h:
2618
2619 2017-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
2620
2621         Free FontFaceSets may include fonts that were never actually added to them
2622         https://bugs.webkit.org/show_bug.cgi?id=180164
2623
2624         Reviewed by Simon Fraser.
2625
2626         There are two circumstances where this can occur:
2627
2628         - If script makes a so-called "free" FontFaceSet, by using "new FontFaceSet". This object is not
2629         associated with the document, and should therefore only include fonts which have been manually
2630         added to it from script. However, today, this object includes preinstalled fonts which have the
2631         same names as any fonts manually added to it. (So, if you manually add "Helvetica", the object
2632         would have two objects - the one you just added and the preinstalled version too).
2633
2634         - For the document's FontFaceSet, the same thing would happen. This one is a little trickier
2635         because the spec is not clear whether or not the document's FontFaceSet should include these
2636         preinstalled fonts. However, running this test in Firefox and Chrome, they both agree that 
2637         preinstalled fonts should not be present, so this patch adheres to this behavior.
2638
2639         We can't actually remove the preinstalled fonts from the document's FontFaceSet (because that's
2640         how normal font lookups are performed), but we can filter them out at the point they meet the
2641         Javascript API. And, for "free" FontFaceSets, we can avoid adding them in the first place for
2642         performance.
2643
2644         Test: fast/text/font-face-api-preinstalled.html
2645
2646         * css/CSSFontFaceSet.cpp:
2647         (WebCore::CSSFontFaceSet::CSSFontFaceSet):
2648         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
2649         (WebCore::CSSFontFaceSet::addToFacesLookupTable):
2650         (WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts):
2651         (WebCore::CSSFontFaceSet::check):
2652         (WebCore::CSSFontFaceSet::matchingFaces): Deleted.
2653         * css/CSSFontFaceSet.h:
2654         * css/CSSFontSelector.cpp:
2655         (WebCore::CSSFontSelector::CSSFontSelector):
2656         * css/FontFaceSet.cpp:
2657         (WebCore::FontFaceSet::load):
2658
2659 2017-12-01  Dean Jackson  <dino@apple.com>
2660
2661         Attempted build fix.
2662
2663         * platform/graphics/ANGLEWebKitBridge.cpp:
2664         (WebCore::ANGLEWebKitBridge::compileShaderSource):
2665         * platform/graphics/ANGLEWebKitBridge.h:
2666         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2667         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
2668
2669 2017-12-01  Dean Jackson  <dino@apple.com>
2670
2671         Use SH_INITIALIZE_UNINITIALIZED_LOCALS now that ANGLE has been updated
2672         https://bugs.webkit.org/show_bug.cgi?id=177929
2673         <rdar://problem/34866210>
2674
2675         Reviewed by Sam Weinig.
2676
2677         Test: fast/canvas/webgl/uninitialized-locals.html
2678
2679         * platform/graphics/ANGLEWebKitBridge.cpp:
2680         (WebCore::ANGLEWebKitBridge::compileShaderSource):
2681         * platform/graphics/ANGLEWebKitBridge.h:
2682         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2683         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
2684
2685 2017-12-01  Youenn Fablet  <youenn@apple.com>
2686
2687         Many imported/w3c/web-platform-tests/service-workers/ test are failing together intermittently
2688         https://bugs.webkit.org/show_bug.cgi?id=180227
2689
2690         Reviewed by Mark Lam.
2691
2692         No observable change.
2693
2694         * bindings/js/JSDOMPromise.cpp:
2695         (WebCore::callFunction):
2696
2697 2017-12-01  Brady Eidson  <beidson@apple.com>
2698
2699         Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage.
2700         https://bugs.webkit.org/show_bug.cgi?id=180170
2701
2702         Reviewed by Chris Dumez.
2703
2704         Test: http/tests/workers/service/postmessage-after-terminate.https.html
2705
2706         * dom/ActiveDOMObject.cpp:
2707         (WebCore::ActiveDOMObject::~ActiveDOMObject):
2708
2709         * testing/Internals.cpp:
2710         (WebCore::Internals::terminateServiceWorker):
2711         * testing/Internals.h:
2712         * testing/Internals.idl:
2713
2714         * workers/service/SWClientConnection.h:
2715
2716         * workers/service/ServiceWorker.idl:
2717
2718         * workers/service/context/SWContextManager.cpp:
2719         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
2720         (WebCore::SWContextManager::terminateWorker):
2721         * workers/service/context/SWContextManager.h:
2722
2723         * workers/service/context/ServiceWorkerThreadProxy.h:
2724
2725         * workers/service/server/SWServer.cpp:
2726         (WebCore::SWServer::workerByID const):
2727         (WebCore::SWServer::Connection::syncTerminateWorker):
2728         (WebCore::SWServer::installContextData):
2729         (WebCore::SWServer::invokeRunServiceWorker):
2730         (WebCore::SWServer::terminateWorker):
2731         (WebCore::SWServer::syncTerminateWorker):
2732         (WebCore::SWServer::terminateWorkerInternal):
2733         (WebCore::SWServer::workerContextTerminated):
2734         * workers/service/server/SWServer.h:
2735         (WebCore::SWServer::workerByID const): Deleted.
2736
2737         * workers/service/server/SWServerToContextConnection.h:
2738
2739         * workers/service/server/SWServerWorker.cpp:
2740         (WebCore::SWServerWorker::contextData const):
2741         * workers/service/server/SWServerWorker.h:
2742         (WebCore::SWServerWorker::isRunning const):
2743         (WebCore::SWServerWorker::isTerminating const):
2744         (WebCore::SWServerWorker::setState):
2745         (WebCore::SWServerWorker::server):
2746
2747 2017-12-01  Zalan Bujtas  <zalan@apple.com>
2748
2749         Nullptr deref in WebCore::RenderTableCaption::containingBlockLogicalWidthForContent
2750         https://bugs.webkit.org/show_bug.cgi?id=180251
2751         <rdar://problem/34138562>
2752
2753         Reviewed by Simon Fraser.
2754
2755         containingBlockLogicalWidthForContent should check whether the renderer is actually
2756         attached to the tree.
2757
2758         Test: fast/table/caption-crash-when-layer-backed.html
2759
2760         * rendering/RenderBoxModelObject.cpp:
2761         (WebCore::RenderBoxModelObject::containingBlockLogicalWidthForContent const):
2762         * rendering/RenderTableCaption.h:
2763         (WebCore::RenderTableCaption::containingBlockLogicalWidthForContent const):
2764
2765 2017-12-01  Youenn Fablet  <youenn@apple.com>
2766
2767         Clear WebSWClientConnection in case storage process IPC connection is closing
2768         https://bugs.webkit.org/show_bug.cgi?id=180210
2769
2770         Reviewed by Chris Dumez.
2771
2772         No observable change of behavior.
2773
2774         * dom/Document.h: Keeping a ref since object may be deleted otherwise.
2775
2776 2017-12-01  Chris Dumez  <cdumez@apple.com>
2777
2778         Drop clientCreationURL from ServiceWorkerRegistrationKey
2779         https://bugs.webkit.org/show_bug.cgi?id=180255
2780
2781         Reviewed by Youenn Fablet.
2782
2783         Drop clientCreationURL from ServiceWorkerRegistrationKey. It is not needed and leads to
2784         wrong behavior when using the Service Worker API from inside service workers.
2785
2786         * workers/service/ServiceWorkerJobData.cpp:
2787         (WebCore::ServiceWorkerJobData::registrationKey const):
2788         * workers/service/ServiceWorkerRegistrationKey.cpp:
2789         (WebCore::ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey):
2790         (WebCore::ServiceWorkerRegistrationKey::hash const):
2791         (WebCore::ServiceWorkerRegistrationKey::operator== const):
2792         (WebCore::ServiceWorkerRegistrationKey::isolatedCopy const):
2793         (WebCore::ServiceWorkerRegistrationKey::loggingString const):
2794         * workers/service/ServiceWorkerRegistrationKey.h:
2795         (WebCore::ServiceWorkerRegistrationKey::scope const):
2796         (WebCore::ServiceWorkerRegistrationKey::setScope):
2797         (WebCore::ServiceWorkerRegistrationKey::encode const):
2798         (WebCore::ServiceWorkerRegistrationKey::decode):
2799         (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue):
2800         (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::isDeletedValue):
2801         (WebCore::ServiceWorkerRegistrationKey::clientCreationURL const): Deleted.
2802         (WebCore::ServiceWorkerRegistrationKey::setClientCreationURL): Deleted.
2803
2804 2017-12-01  Fujii Hironori  <Hironori.Fujii@sony.com>
2805
2806         [WinCairo] Wrongly placed scroll bars in HiDPI
2807         https://bugs.webkit.org/show_bug.cgi?id=180066
2808
2809         Reviewed by Žan Doberšek.
2810
2811         PlatformContextCairo wasn't properly initialized. It should have a
2812         pointer to GraphicsContextPrivate in WinCairo port to paint
2813         controls in right places.
2814
2815         No new tests, no behavior change.
2816
2817         * platform/graphics/win/GraphicsContextCairoWin.cpp:
2818         (WebCore::GraphicsContext::platformInit): Call PlatformContextCairo::setGraphicsContextPrivate.
2819
2820 2017-12-01  Eric Carlson  <eric.carlson@apple.com>
2821
2822         [MediaStream] Use CaptureDevice instead of device ID to identify devices
2823         https://bugs.webkit.org/show_bug.cgi?id=180206
2824         <rdar://problem/35775758>
2825
2826         Reviewed by Youenn Fablet.
2827
2828         No new tests, no change in behavior.
2829
2830         * Modules/mediastream/UserMediaRequest.cpp:
2831         (WebCore::UserMediaRequest::allow):
2832         * Modules/mediastream/UserMediaRequest.h:
2833         (WebCore::UserMediaRequest::allowedAudioDeviceUID const): Deleted.
2834         (WebCore::UserMediaRequest::allowedVideoDeviceUID const): Deleted.
2835         * platform/mediastream/RealtimeMediaSource.h:
2836         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2837         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
2838         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
2839         * platform/mediastream/RealtimeMediaSourceCenter.h:
2840         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2841         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2842         * platform/mock/MockRealtimeAudioSource.cpp:
2843         * platform/mock/MockRealtimeVideoSource.cpp:
2844
2845 2017-11-30  Alex Christensen  <achristensen@webkit.org>
2846
2847         Extra PerformanceEntryList entry after iframe navigation
2848         https://bugs.webkit.org/show_bug.cgi?id=178433
2849
2850         Reviewed by Joseph Pecoraro.
2851
2852         Test: http/tests/security/PerformanceEntryList-parent-only-first-navigation.html
2853
2854         When an iframe is loaded, its main resource load should be reported to the parent frame's PerformanceEntryList.
2855         Subsequent main resource loads should not.
2856
2857         * loader/FrameLoader.h:
2858         (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
2859         * loader/ResourceTimingInformation.cpp:
2860         (WebCore::ResourceTimingInformation::addResourceTiming):
2861
2862 2017-11-30  Zalan Bujtas  <zalan@apple.com>
2863
2864         [Simple line layout] Incorrect repaint rect with vertically shrinking content and bottom-padding.
2865         https://bugs.webkit.org/show_bug.cgi?id=180223
2866         <rdar://problem/34122210>
2867
2868         Reviewed by Simon Fraser.
2869
2870         Repaint rect should be extended all the way to bottom border/padding.
2871
2872         Test: fast/repaint/simple-line-layout-shrinking-content.html
2873
2874         * rendering/RenderBlockFlow.cpp:
2875         (WebCore::RenderBlockFlow::layoutSimpleLines):
2876
2877 2017-11-30  Stephan Szabo  <stephan.szabo@sony.com>
2878
2879         Make LegacyCustomProtocolManager optional for network process
2880         https://bugs.webkit.org/show_bug.cgi?id=176230
2881
2882         Reviewed by Alex Christensen.
2883
2884         No new tests, only sets up feature define
2885
2886         * Configurations/FeatureDefines.xcconfig:
2887
2888 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
2889
2890         [Cocoa] Fix CVPixelBuffer leak
2891         https://bugs.webkit.org/show_bug.cgi?id=180224
2892
2893         Reviewed by Youenn Fablet.
2894
2895         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
2896         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
2897         Adopt the newly created pixel buffer.
2898
2899         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2900         Release the format description as soon as we are done with it. Otherwise
2901         we could have bailed before releasing it.
2902
2903 2017-11-30  Simon Fraser  <simon.fraser@apple.com>
2904
2905         Improve filter logging
2906         https://bugs.webkit.org/show_bug.cgi?id=180182
2907
2908         Reviewed by Sam Weinig.
2909
2910         Add a parameter to FilterEffect::externalRepresentation() so that we can log extra
2911         data without breaking layout tests.
2912
2913         Add TextStream output for ColorSpace.
2914         
2915         Improve logging of FEComponentTransfer ComponentTransferFunctions by logging the data
2916         that's appropriate for the function type, and rebaseline affected tests.
2917
2918         * platform/graphics/Color.cpp:
2919         (WebCore::operator<<):
2920         * platform/graphics/Color.h:
2921         * platform/graphics/filters/FEBlend.cpp:
2922         (WebCore::FEBlend::externalRepresentation const):
2923         * platform/graphics/filters/FEBlend.h:
2924         * platform/graphics/filters/FEColorMatrix.cpp:
2925         (WebCore::FEColorMatrix::externalRepresentation const):
2926         * platform/graphics/filters/FEColorMatrix.h:
2927         * platform/graphics/filters/FEComponentTransfer.cpp:
2928         (WebCore::operator<<):
2929         (WebCore::FEComponentTransfer::externalRepresentation const):
2930         * platform/graphics/filters/FEComponentTransfer.h:
2931         * platform/graphics/filters/FEComposite.cpp:
2932         (WebCore::FEComposite::externalRepresentation const):
2933         * platform/graphics/filters/FEComposite.h:
2934         * platform/graphics/filters/FEConvolveMatrix.cpp:
2935         (WebCore::FEConvolveMatrix::externalRepresentation const):
2936         * platform/graphics/filters/FEConvolveMatrix.h:
2937         * platform/graphics/filters/FEDiffuseLighting.cpp:
2938         (WebCore::FEDiffuseLighting::externalRepresentation const):
2939         * platform/graphics/filters/FEDiffuseLighting.h:
2940         * platform/graphics/filters/FEDisplacementMap.cpp:
2941         (WebCore::FEDisplacementMap::externalRepresentation const):
2942         * platform/graphics/filters/FEDisplacementMap.h:
2943         * platform/graphics/filters/FEDropShadow.cpp:
2944         (WebCore::FEDropShadow::externalRepresentation const):
2945         * platform/graphics/filters/FEDropShadow.h:
2946         * platform/graphics/filters/FEFlood.cpp:
2947         (WebCore::FEFlood::externalRepresentation const):
2948         * platform/graphics/filters/FEFlood.h:
2949         * platform/graphics/filters/FEGaussianBlur.cpp:
2950         (WebCore::FEGaussianBlur::externalRepresentation const):
2951         * platform/graphics/filters/FEGaussianBlur.h:
2952         * platform/graphics/filters/FEMerge.cpp:
2953         (WebCore::FEMerge::externalRepresentation const):
2954         * platform/graphics/filters/FEMerge.h:
2955         * platform/graphics/filters/FEMorphology.cpp:
2956         (WebCore::FEMorphology::externalRepresentation const):
2957         * platform/graphics/filters/FEMorphology.h:
2958         * platform/graphics/filters/FEOffset.cpp:
2959         (WebCore::FEOffset::externalRepresentation const):
2960         * platform/graphics/filters/FEOffset.h:
2961         * platform/graphics/filters/FESpecularLighting.cpp:
2962         (WebCore::FESpecularLighting::externalRepresentation const):
2963         * platform/graphics/filters/FESpecularLighting.h:
2964         * platform/graphics/filters/FETile.cpp:
2965         (WebCore::FETile::externalRepresentation const):
2966         * platform/graphics/filters/FETile.h:
2967         * platform/graphics/filters/FETurbulence.cpp:
2968         (WebCore::FETurbulence::externalRepresentation const):
2969         * platform/graphics/filters/FETurbulence.h:
2970         * platform/graphics/filters/FilterEffect.cpp:
2971         (WebCore::FilterEffect::externalRepresentation const):
2972         (WebCore::operator<<):
2973         * platform/graphics/filters/FilterEffect.h:
2974         * platform/graphics/filters/SourceAlpha.cpp:
2975         (WebCore::SourceAlpha::externalRepresentation const):
2976         * platform/graphics/filters/SourceAlpha.h:
2977         * platform/graphics/filters/SourceGraphic.cpp:
2978         (WebCore::SourceGraphic::externalRepresentation const):
2979         * platform/graphics/filters/SourceGraphic.h:
2980         * rendering/svg/RenderSVGResourceFilter.cpp:
2981         (WebCore::RenderSVGResourceFilter::applyResource):
2982         * svg/graphics/filters/SVGFEImage.cpp:
2983         (WebCore::FEImage::externalRepresentation const):
2984         * svg/graphics/filters/SVGFEImage.h:
2985
2986 2017-11-30  Ryan Haddad  <ryanhaddad@apple.com>
2987
2988         Unreviewed build fix, removed unused lambda captures.
2989
2990         * workers/service/context/ServiceWorkerThread.cpp:
2991         (WebCore::ServiceWorkerThread::postFetchTask):
2992         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
2993
2994 2017-11-30  Chris Dumez  <cdumez@apple.com>
2995
2996         Move SWClientConnection class out of server/ folder
2997         https://bugs.webkit.org/show_bug.cgi?id=180217
2998
2999         Reviewed by Brady Eidson.
3000
3001         Move SWClientConnection class out of server/ folder since the client connection
3002         lives in the WebProcess, not the Storage process.
3003
3004         * Sources.txt:
3005         * WebCore.xcodeproj/project.pbxproj:
3006         * workers/service/SWClientConnection.cpp: Renamed from Source/WebCore/workers/service/server/SWClientConnection.cpp.
3007         (WebCore::SWClientConnection::scheduleJob):
3008         (WebCore::SWClientConnection::finishedFetchingScript):
3009         (WebCore::SWClientConnection::failedFetchingScript):
3010         (WebCore::SWClientConnection::jobRejectedInServer):
3011         (WebCore::SWClientConnection::registrationJobResolvedInServer):
3012         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
3013         (WebCore::SWClientConnection::startScriptFetchForServer):
3014         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
3015         (WebCore::SWClientConnection::forEachContainer):
3016         (WebCore::SWClientConnection::updateRegistrationState):
3017         (WebCore::SWClientConnection::updateWorkerState):
3018         (WebCore::SWClientConnection::fireUpdateFoundEvent):
3019         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
3020         * workers/service/SWClientConnection.h: Renamed from Source/WebCore/workers/service/server/SWClientConnection.h.
3021         * workers/service/ServiceWorkerContainer.cpp:
3022
3023 2017-11-30  Chris Dumez  <cdumez@apple.com>
3024
3025         ServiceWorkerThread's m_extendedEvents gets destroyed on the wrong thread
3026         https://bugs.webkit.org/show_bug.cgi?id=180216
3027
3028         Reviewed by Brady Eidson.
3029
3030         ServiceWorkerThread's m_extendedEvents gets destroyed on the wrong thread. Those events live on the worker
3031         thread so we should destroy them on the worker thread, not the main thread. To address the issue, m_extendedEvents
3032         was moved to ServiceWorkerGlobalScope, which actually lives on the right thread.
3033
3034         * workers/service/ServiceWorkerGlobalScope.cpp:
3035         (WebCore::ServiceWorkerGlobalScope::updateExtendedEventsSet):
3036         * workers/service/ServiceWorkerGlobalScope.h:
3037         * workers/service/context/ServiceWorkerThread.cpp:
3038         (WebCore::ServiceWorkerThread::postFetchTask):
3039         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
3040         (WebCore::ServiceWorkerThread::updateExtendedEventsSet): Deleted.
3041         * workers/service/context/ServiceWorkerThread.h:
3042         (WebCore::ServiceWorkerThread::hasPendingEvents const): Deleted.
3043
3044 2017-11-30  Chris Dumez  <cdumez@apple.com>
3045
3046         SWServerToContextConnection / SWServerWorker do not need to be ThreadSafeRefCounted
3047         https://bugs.webkit.org/show_bug.cgi?id=180214
3048
3049         Reviewed by Brady Eidson.
3050
3051         SWServerToContextConnection / SWServerWorker do not need to be ThreadSafeRefCounted.
3052         RefCounted is sufficient as there is no longer any multithreading on server side.
3053
3054         * workers/service/server/SWServerToContextConnection.h:
3055         * workers/service/server/SWServerWorker.h:
3056
3057 2017-11-30  Chris Dumez  <cdumez@apple.com>
3058
3059         ServiceWorkerGlobalScope::skipWaiting() should resolve its promise
3060         https://bugs.webkit.org/show_bug.cgi?id=180204
3061
3062         Reviewed by Brady Eidson.
3063
3064         ServiceWorkerGlobalScope::skipWaiting() should resolve its promise, even if it is not
3065         implemented yet. For now, always reject the promise.
3066
3067         * workers/service/ServiceWorkerGlobalScope.cpp:
3068         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
3069
3070 2017-11-30  Chris Dumez  <cdumez@apple.com>
3071
3072         Mark a few heap-allocated service worker types as WTF_MAKE_FAST_ALLOCATED
3073         https://bugs.webkit.org/show_bug.cgi?id=180212
3074
3075         Reviewed by Geoffrey Garen.
3076
3077         Mark a few heap-allocated service worker types as WTF_MAKE_FAST_ALLOCATED for performance.
3078
3079         * workers/service/server/SWOriginStore.h:
3080         * workers/service/server/SWServer.h:
3081         * workers/service/server/SWServerJobQueue.h:
3082         * workers/service/server/SWServerRegistration.h:
3083
3084 2017-11-30  Brady Eidson  <beidson@apple.com>
3085
3086         Make WorkerThread lifetime much more predictable.
3087         https://bugs.webkit.org/show_bug.cgi?id=180203
3088
3089         Reviewed by Chris Dumez.
3090
3091         No new tests (Fixes flakiness in existing and future tests).
3092
3093         The family of classes related to Workers has a complicated ownership model.
3094
3095         For Dedicated Workers, the WorkerThread object is owned by the WorkerMessagingProxy,
3096         which manages its own lifetime. Additionally, other object(s) have raw C++ references
3097         to it, and the expected lifetimes are described in comments scattered through a few files.
3098
3099         What it boils down to is that the "Worker" DOM object - which lives on the main thread - 
3100         is the key to the proper destruction of all of these objects.
3101
3102         For ServiceWorkers running in their own context process, there is no "Worker" on the main thread.
3103
3104         As a result, ServiceWorkers can get into a situation where their WorkerThread can be destroyed before
3105         their ServiceWorkerGlobalScope is destroyed on the running background thread.
3106
3107         There's no reason to not have WorkerThread guarantee its own lifetime until its background thread
3108         has actually completed.
3109
3110         * workers/WorkerThread.cpp:
3111         (WebCore::WorkerThread::workerThread): Protect the WorkerThread object during the entire runtime
3112           of the background thread itself, and release that protection on the main thread.
3113         * workers/WorkerThread.h:
3114
3115 2017-11-30  Chris Dumez  <cdumez@apple.com>
3116
3117         Populate self.registration.installing/waiting/active inside service workers
3118         https://bugs.webkit.org/show_bug.cgi?id=180168
3119
3120         Reviewed by Brady Eidson.
3121
3122         Populate self.registration.installing/waiting/active inside service workers.
3123         Also make sure the ServiceWorker's state properly gets updated inside
3124         service workers.
3125
3126         No new tests, extended existing test for self.registration.
3127
3128         * workers/service/ServiceWorker.cpp:
3129         (WebCore::ServiceWorker::scheduleTaskToUpdateState):
3130         * workers/service/context/SWContextManager.cpp:
3131         (WebCore::SWContextManager::forEachServiceWorkerThread):
3132         * workers/service/context/SWContextManager.h:
3133         * workers/service/context/ServiceWorkerThread.cpp:
3134         (WebCore::ServiceWorkerThread::fireInstallEvent):
3135         (WebCore::ServiceWorkerThread::fireActivateEvent):
3136         * workers/service/server/SWClientConnection.cpp:
3137         (WebCore::SWClientConnection::updateRegistrationState):
3138         (WebCore::SWClientConnection::updateWorkerState):
3139         (WebCore::SWClientConnection::fireUpdateFoundEvent):
3140         * workers/service/server/SWClientConnection.h:
3141
3142 2017-11-30  Chris Dumez  <cdumez@apple.com>
3143
3144         Rename RegistrationOptions to ServiceWorkerRegistrationOptions
3145         https://bugs.webkit.org/show_bug.cgi?id=180207
3146
3147         Reviewed by Geoffrey Garen.
3148
3149         Rename RegistrationOptions to ServiceWorkerRegistrationOptions as the name
3150         RegistrationOptions is too generic and likely to conflict. Also modernize
3151         ServiceWorkerRegistrationOptions' IPC decoder.
3152
3153         * workers/service/ServiceWorkerContainer.h:
3154         * workers/service/ServiceWorkerJobData.h:
3155         (WebCore::ServiceWorkerJobData::decode):
3156         * workers/service/ServiceWorkerRegistrationOptions.cpp:
3157         (WebCore::ServiceWorkerRegistrationOptions::isolatedCopy const):
3158         * workers/service/ServiceWorkerRegistrationOptions.h:
3159         (WebCore::ServiceWorkerRegistrationOptions::encode const):
3160         (WebCore::ServiceWorkerRegistrationOptions::decode):
3161
3162 2017-11-30  Darin Adler  <darin@apple.com>
3163
3164         [Mac] remove unneeded RetainPtr use introduced in r225142
3165         https://bugs.webkit.org/show_bug.cgi?id=180202
3166
3167         Reviewed by Tim Horton.
3168
3169         * editing/mac/DictionaryLookup.h: Changed out arguments back to NSDictionary ** instead
3170         of RetainPtr because these use autorelease.
3171
3172         * editing/mac/DictionaryLookup.mm:
3173         (WebCore::tokenRange): Use NSDictionary **.
3174         (WebCore::DictionaryLookup::rangeForSelection): Ditto.
3175         (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto.
3176         (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
3177
3178 2017-11-30  Chris Dumez  <cdumez@apple.com>
3179
3180         Mark ServiceWorkerGlobalScope as final
3181         https://bugs.webkit.org/show_bug.cgi?id=180201
3182
3183         Reviewed by Alex Christensen.
3184
3185         * workers/service/ServiceWorkerGlobalScope.h:
3186
3187 2017-11-30  Zan Dobersek  <zdobersek@igalia.com>
3188
3189         [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine
3190         https://bugs.webkit.org/show_bug.cgi?id=180141
3191
3192         Reviewed by Carlos Garcia Campos.
3193
3194         Introduce a painting engine concept that's used to perform painting
3195         for a given GraphicsLayer object.
3196
3197         The Nicosia::PaintingEngine object is leveraged in the
3198         CoordinatedGraphicsLayer::updateContentBuffers() method. It's retrieved
3199         through the CoordinatedGraphicsLayerClient interface, with a new method
3200         introduced there for this purpose.
3201
3202         The Nicosia::PaintingEngine interface is kept simple for now, with only
3203         a single paint() method. The only current implementation is the
3204         PaintingEngineBasic class, which simply reuses the code that was
3205         previously in CoordinatedGraphicsLayer::updateContentBuffers(),
3206         maintaining the current functionality.
3207
3208         The Nicosia::PaintingEngine::create() function returns a new
3209         PaintingEngine object. For now it defaults to PaintingEngineBasic, but
3210         it could be configured at configure-time or even runtime in the future
3211         to return a more advanced engine implementation.
3212
3213         No new tests -- no change in behavior.
3214
3215         * platform/TextureMapper.cmake:
3216         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp: Added.
3217         (Nicosia::PaintingEngine::create):
3218         * platform/graphics/nicosia/NicosiaPaintingEngine.h: Added.
3219         * platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp: Added.
3220         (Nicosia::PaintingEngineBasic::paint):
3221         * platform/graphics/nicosia/NicosiaPaintingEngineBasic.h: Added.
3222         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3223         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3224         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3225
3226 2017-11-30  Adrian Perez de Castro  <aperez@igalia.com>
3227
3228         [GStreamer] Builds fails with ENABLE_VIDEO=OFF due to GStreamer usage
3229         https://bugs.webkit.org/show_bug.cgi?id=179373
3230
3231         Reviewed by Xabier Rodriguez-Calvar.
3232
3233         This allows to build with WebAudio enabled even if video support is
3234         disabled by guarding usage of HTMLMediaElement with ENABLE(VIDEO).
3235
3236         No new tests needed.
3237
3238         * page/DeprecatedGlobalSettings.cpp:
3239         (WebCore::DeprecatedGlobalSettings::setGStreamerEnabled): Guard usage of HTMLMediaElement.
3240
3241 2017-11-29  Chris Dumez  <cdumez@apple.com>
3242
3243         ServiceWorker WebProcess sometimes crashes in JSVMClientData::~JSVMClientData()
3244         https://bugs.webkit.org/show_bug.cgi?id=180173
3245
3246         Reviewed by Alex Christensen.
3247
3248         The leak was caused by EventListeners remaining when destroying the VM, because
3249         JSEventListener refs the DOMWrapperWorld. To address the issue, we now call
3250         removeAllEventListeners() in the stop() method of ServiceWorkerContainer,
3251         ServiceWorkerRegistration and ServiceWorker. Those event listeners are no
3252         longer needed after ActiveDOMObject::stop() is called since the script
3253         execution context is about to be destroyed.
3254
3255         This is the same pattern used in IDBDatabase::stop(), IDBRequest::stop().
3256
3257         No new tests, already covered by existing test.
3258
3259         * workers/service/ServiceWorker.cpp:
3260         (WebCore::ServiceWorker::stop):
3261         * workers/service/ServiceWorkerContainer.cpp:
3262         (WebCore::ServiceWorkerContainer::stop):
3263         * workers/service/ServiceWorkerContainer.h:
3264         * workers/service/ServiceWorkerRegistration.cpp:
3265         (WebCore::ServiceWorkerRegistration::stop):
3266
3267 2017-11-29  Filip Pizlo  <fpizlo@apple.com>
3268
3269         GC should support isoheaps
3270         https://bugs.webkit.org/show_bug.cgi?id=179288
3271
3272         Reviewed by Saam Barati.
3273
3274         No new tests because no new behavior.
3275         
3276         Adopting changes in JSC Subspace API.
3277
3278         * ForwardingHeaders/runtime/JSDestructibleObjectHeapCellType.h: Added.
3279         * ForwardingHeaders/runtime/JSSegmentedVariableObjectHeapCellType.h: Added.
3280         * bindings/js/JSDOMWrapper.cpp:
3281         (WebCore::outputConstraintSubspaceFor):
3282         (WebCore::globalObjectOutputConstraintSubspaceFor):
3283         * bindings/js/JSDOMWrapper.h:
3284         * bindings/js/WebCoreJSClientData.cpp:
3285         (WebCore::JSVMClientData::JSVMClientData):
3286         * bindings/js/WebCoreJSClientData.h:
3287         (WebCore::JSVMClientData::outputConstraintSpace):
3288         (WebCore::JSVMClientData::globalObjectOutputConstraintSpace):
3289         * bindings/scripts/CodeGeneratorJS.pm:
3290         (GenerateHeader):
3291
3292 2017-11-29  Eric Carlson  <eric.carlson@apple.com>
3293
3294         [MediaStream] Clean up audio and video capture factories
3295         https://bugs.webkit.org/show_bug.cgi?id=180156
3296         <rdar://problem/35753435>
3297
3298         Reviewed by Youenn Fablet.
3299
3300         No new tests, no behavior change.
3301
3302         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3303         (WebCore::RealtimeMediaSourceCenter::setAudioFactory): Deleted.
3304         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): Deleted.
3305         (WebCore::RealtimeMediaSourceCenter::audioFactory): Deleted.
3306         (WebCore::RealtimeMediaSourceCenter::setVideoFactory): Deleted.
3307         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory): Deleted.
3308         (WebCore::RealtimeMediaSourceCenter::videoFactory): Deleted.
3309         (WebCore::RealtimeMediaSourceCenter::setAudioCaptureDeviceManager): Deleted.
3310         (WebCore::RealtimeMediaSourceCenter::unsetAudioCaptureDeviceManager): Deleted.
3311         (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): Deleted.
3312         (WebCore::RealtimeMediaSourceCenter::setVideoCaptureDeviceManager): Deleted.
3313         (WebCore::RealtimeMediaSourceCenter::unsetVideoCaptureDeviceManager): Deleted.
3314         (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): Deleted.
3315         * platform/mediastream/RealtimeMediaSourceCenter.h:
3316         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
3317         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
3318         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
3319         (WebCore::RealtimeMediaSourceSettings::facingMode):
3320         (WebCore::RealtimeMediaSourceSettings::videoFacingModeEnum):
3321         (WebCore::userFacing): Deleted.
3322         (WebCore::environmentFacing): Deleted.
3323         (WebCore::leftFacing): Deleted.
3324         (WebCore::rightFacing): Deleted.
3325         * platform/mediastream/RealtimeMediaSourceSettings.h:
3326         (WebCore::RealtimeMediaSourceSettings::RealtimeMediaSourceSettings): Deleted.
3327         * platform/mediastream/mac/AVVideoCaptureSource.h:
3328         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3329         (WebCore::AVVideoCaptureSource::create):
3330         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
3331         (WebCore::AVVideoCaptureSource::setupCaptureSession):
3332         (): Deleted.
3333         (WebCore::AVVideoCaptureSourceFactory::setVideoCapturePageState): Deleted.
3334         (WebCore::avVideoCaptureSourceFactory): Deleted.
3335         (WebCore::AVVideoCaptureSource::factory): Deleted.
3336         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3337         (WebCore::videoCaptureSourceFactory):
3338         (WebCore::RealtimeMediaSourceCenterMac::audioFactory):
3339         (WebCore::RealtimeMediaSourceCenterMac::videoFactory):
3340         (WebCore::RealtimeMediaSourceCenterMac::audioCaptureDeviceManager):
3341         (WebCore::RealtimeMediaSourceCenterMac::videoCaptureDeviceManager):
3342         (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac): Deleted.
3343         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory): Deleted.
3344         (WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory): Deleted.
3345         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager): Deleted.
3346         (WebCore::RealtimeMediaSourceCenterMac::defaultVideoCaptureDeviceManager): Deleted.
3347         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
3348         * platform/mock/MockRealtimeAudioSource.cpp:
3349         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
3350         (WebCore::MockRealtimeAudioSource::startProducingData):
3351         * platform/mock/MockRealtimeMediaSourceCenter.h:
3352         * platform/mock/MockRealtimeVideoSource.cpp:
3353         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource):
3354         (WebCore::MockRealtimeVideoSource::startProducingData):
3355         * platform/mock/MockRealtimeVideoSource.h:
3356
3357 2017-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3358
3359         [Attachment Support] Implement SPI for clients to make an attachment element display in-place
3360         https://bugs.webkit.org/show_bug.cgi?id=180153
3361         <rdar://problem/35735252>
3362
3363         Reviewed by Tim Horton.
3364
3365         Adds SPI support for inserting attachments using in-place display style, and updating display options for
3366         existing attachments. See comments below for more detail.
3367
3368         Tests: WKAttachmentTests.InPlaceImageAttachmentToggleDisplayMode
3369                WKAttachmentTests.InPlaceImageAttachmentParagraphInsertion
3370                WKAttachmentTests.InPlaceVideoAttachmentInsertionWithinList
3371                WKAttachmentTests.InPlacePDFAttachmentCutAndPaste
3372
3373         * WebCore.xcodeproj/project.pbxproj:
3374         * editing/Editor.cpp:
3375         (WebCore::Editor::insertAttachment):
3376         (WebCore::Editor::insertAttachmentFromFile):
3377
3378         Update display options for the attachment before inserting into the document.
3379
3380         * editing/Editor.h:
3381         * html/AttachmentTypes.h: Added.
3382
3383         Add a new header to define the new attachment display types. This lets us avoid importing HTMLAttachmentElement.h
3384         and instead just import AttachmentTypes.h in some places in WebKit that only deal with plumbing
3385         AttachmentDisplayOptions to the web process.
3386
3387         (WebCore::AttachmentDisplayOptions::encode const):
3388         (WebCore::AttachmentDisplayOptions::decode):
3389
3390         Support serializing and deserializing attachment display options.
3391
3392         * html/HTMLAttachmentElement.cpp:
3393         (WebCore::HTMLAttachmentElement::setFile):
3394
3395         Regenerate the shadow root if needed when setting the file.
3396
3397         (WebCore::HTMLAttachmentElement::updateDisplayMode):
3398
3399         Introduce a new method to update the display mode of an attachment element. This builds up the shadow root of
3400         the attachment if it is displayed in-place.
3401
3402         (WebCore::HTMLAttachmentElement::ensureInnerImage):
3403         (WebCore::HTMLAttachmentElement::ensureInnerVideo):
3404
3405         Helpers to insert image and video elements into the shadow root if needed, and return the image or video element.
3406
3407         (WebCore::HTMLAttachmentElement::innerImage const):
3408         (WebCore::HTMLAttachmentElement::innerVideo const):
3409
3410         Helpers to retrieve existing image and video elements in the shadow root.
3411
3412         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
3413
3414         Appends and configures the attachment element's shadow root for inline display, initializing an image or video
3415         element or neither, depending on the attachment type.
3416
3417         * html/HTMLAttachmentElement.h:
3418
3419         Introduce an AttachmentDisplayOptions struct which mirrors _WKAttachmentDisplayOptions in the WebKit layer. For
3420         now, this only contains a display mode enum.
3421
3422         * platform/audio/ios/AudioSessionIOS.mm:
3423
3424         Avoid this AVAudioSession assertion when targeting iOS simulator. AVAudioSession always throws this error when
3425         setting an audio session category in the simulator, even in a basic test app, since AVFoundation doesn't support
3426         audio sessions in the simulator.
3427 <