3d4141932dbbda7bc4131ebfb4c54bf303e5a076
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-14  Antti Koivisto  <antti@apple.com>
2
3         [Render Tree Mutation] First letter should not mutate the render tree while in layout.
4         https://bugs.webkit.org/show_bug.cgi?id=163848
5
6         Reviewed by Zalan Bujtas.
7
8         RenderBlock::updateFirstLetter shouldn't be called during layout. Instead it should
9         be invoked by the RenderTreeUpdater.
10
11         With this future patches can move updateFirstLetter() and the related functions
12         completely out of the render tree.
13
14         * rendering/RenderBlock.cpp:
15         (WebCore::RenderBlock::layout):
16
17             No more updateFirstLetter calls during layout...
18
19         (WebCore::RenderBlock::computePreferredLogicalWidths):
20
21             ...or preferred width computation.
22
23         (WebCore::RenderBlock::updateFirstLetter):
24         * rendering/RenderBlock.h:
25         * rendering/RenderRubyRun.cpp:
26         (WebCore::RenderRubyRun::updateFirstLetter):
27         * rendering/RenderRubyRun.h:
28         * rendering/RenderTable.cpp:
29         (WebCore::RenderTable::updateFirstLetter):
30         * rendering/RenderTable.h:
31         * rendering/svg/RenderSVGText.cpp:
32         (WebCore::RenderSVGText::updateFirstLetter):
33         * rendering/svg/RenderSVGText.h:
34         * style/RenderTreeUpdater.cpp:
35         (WebCore::RenderTreeUpdater::popParent):
36
37             Call updateFirstLetter when closing the element. All of of descedant renderers are known here
38             so this can be resolved correctly.
39
40 2017-08-13  Manuel Rego Casasnovas  <rego@igalia.com>
41
42         Composition underline color is always black
43         https://bugs.webkit.org/show_bug.cgi?id=174675
44
45         Reviewed by Ryosuke Niwa.
46
47         This patch uses the current color of the text instead of black
48         for the composition underline marker.
49         This makes it visible in the case we have a black/dark background.
50
51         Test: editing/composition-underline-color.html
52
53         * editing/CompositionUnderline.h:
54         (WebCore::CompositionUnderline::CompositionUnderline):
55         Added new attribute compositionUnderlineColor.
56         * rendering/InlineTextBox.cpp:
57         (WebCore::InlineTextBox::paintCompositionUnderline):
58         Use the text color if compositionUnderlineColor is TextColor.
59
60 2017-08-13  Carlos Garcia Campos  <cgarcia@igalia.com>
61
62         [GTK] stop kinetic scrolling when a zero movement is reached
63         https://bugs.webkit.org/show_bug.cgi?id=175468
64
65         Reviewed by Michael Catanzaro.
66
67         This is GTK+ change by Christian Hergert.
68         https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6
69
70         When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels,
71         followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it
72         feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement.
73
74         * platform/ScrollAnimationKinetic.cpp:
75         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
76
77 2017-08-13  Chris Dumez  <cdumez@apple.com>
78
79         Drop non-const getter for CachedResource::resourceRequest()
80         https://bugs.webkit.org/show_bug.cgi?id=175524
81
82         Reviewed by Youenn Fablet.
83
84         Drop non-const getter for CachedResource::resourceRequest(). It would be unsafe to modify the request of a CachedResource
85         after it has been cached. Exposing such a getter is therefore a footgun.
86
87         * loader/LinkLoader.cpp:
88         (WebCore::LinkLoader::preloadIfNeeded):
89         * loader/cache/CachedImage.cpp:
90         (WebCore::CachedImage::CachedImage):
91         * loader/cache/CachedImage.h:
92         * loader/cache/CachedResource.cpp:
93         (WebCore::CachedResource::CachedResource):
94         * loader/cache/CachedResource.h:
95         (WebCore::CachedResource::resourceRequest const):
96         (WebCore::CachedResource::ignoreForRequestCount const):
97         (WebCore::CachedResource::setIgnoreForRequestCount):
98         * loader/cache/CachedResourceLoader.cpp:
99         (WebCore::CachedResourceLoader::requestResource):
100         * loader/cache/CachedResourceRequest.h:
101         (WebCore::CachedResourceRequest::ignoreForRequestCount const):
102         (WebCore::CachedResourceRequest::setIgnoreForRequestCount):
103         * loader/cache/MemoryCache.cpp:
104         (WebCore::MemoryCache::addImageToCache):
105         * platform/network/ResourceRequestBase.h:
106
107 2017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
108
109         [WPE] Implement WebCore::standardUserAgent()
110         https://bugs.webkit.org/show_bug.cgi?id=175507
111
112         Reviewed by Carlos Alberto Lopez Perez.
113
114         Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
115
116         * PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp.
117         * PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources.
118         * platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp.
119         (WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB".
120
121 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
122
123         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
124         https://bugs.webkit.org/show_bug.cgi?id=175474
125         <rdar://problem/33844628>
126
127         Reviewed by Wenson Hsieh.
128
129         Replaced the build flag by a runtime flag and added a stub implementation for DataTransferItemList
130         and DataTransferItem to make it compile. DataTransferItemList is created lazily by DataTransfer.items,
131         and its lifetime is tied to DataTransfer by forwarding ref and deref.
132
133         See https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface
134
135         Tests: editing/pasteboard/datatransfer-idl.html
136
137         * CMakeLists.txt:
138         * Configurations/FeatureDefines.xcconfig:
139         * WebCore.xcodeproj/project.pbxproj:
140         * dom/DataTransfer.cpp:
141         (WebCore::DataTransfer::items): Added. Create DataTransferItemList lazily
142         * dom/DataTransfer.h:
143         * dom/DataTransfer.idl:
144         * dom/DataTransferItem.cpp:
145         (WebCore::DataTransferItem::DataTransferItem): Added a stub implementation.
146         (WebCore::DataTransferItem::~DataTransferItem): Ditto.
147         (WebCore::DataTransferItem::getAsString const): Ditto.
148         (WebCore::DataTransferItem::getAsFile const): Ditto.
149         * dom/DataTransferItem.h:
150         (WebCore::DataTransferItemList): Devirtualized functions.
151         (WebCore::DataTransferItemList::kind const):
152         (WebCore::DataTransferItemList::type const):
153         * dom/DataTransferItem.idl:
154         * dom/DataTransferItemList.cpp: Added.
155         (WebCore::DataTransferItemList::length const): Added a stub implementation.
156         (WebCore::DataTransferItemList::item): Ditto.
157         (WebCore::DataTransferItemList::add): Ditto.
158         (WebCore::DataTransferItemList::remove): Ditto.
159         (WebCore::DataTransferItemList::clear): Ditto.
160         * dom/DataTransferItemList.h:
161         (WebCore::DataTransferItemList::DataTransferItemList):
162         (WebCore::DataTransferItemList::~DataTransferItemList): Deleted.
163         (WebCore::DataTransferItemList::ref): Forwards to DataTransfer's ref.
164         (WebCore::DataTransferItemList::deref): Ditto.
165         * dom/DataTransferItemList.idl: Updated to match the latest specification.
166         * page/RuntimeEnabledFeatures.h:
167         (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Added.
168         (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Added.
169
170 2017-08-11  Brady Eidson  <beidson@apple.com>
171
172         Move files inside WebCore/workers to WebCore/workers/service.
173         https://bugs.webkit.org/show_bug.cgi?id=175495
174
175         Rubberstamped by Tim Horton.
176
177         * CMakeLists.txt:
178         * DerivedSources.make:
179         * WebCore.xcodeproj/project.pbxproj:
180
181         * workers/service/ServiceWorker.cpp: Renamed from Source/WebCore/workers/ServiceWorker.cpp.
182         * workers/service/ServiceWorker.h: Renamed from Source/WebCore/workers/ServiceWorker.h.
183         * workers/service/ServiceWorker.idl: Renamed from Source/WebCore/workers/ServiceWorker.idl.
184         * workers/service/ServiceWorkerContainer.cpp: Renamed from Source/WebCore/workers/ServiceWorkerContainer.cpp.
185         * workers/service/ServiceWorkerContainer.h: Renamed from Source/WebCore/workers/ServiceWorkerContainer.h.
186         * workers/service/ServiceWorkerContainer.idl: Renamed from Source/WebCore/workers/ServiceWorkerContainer.idl.
187         * workers/service/ServiceWorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.cpp.
188         * workers/service/ServiceWorkerGlobalScope.h: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.h.
189         * workers/service/ServiceWorkerGlobalScope.idl: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.idl.
190         * workers/service/ServiceWorkerJob.cpp: Renamed from Source/WebCore/workers/ServiceWorkerJob.cpp.
191         * workers/service/ServiceWorkerJob.h: Renamed from Source/WebCore/workers/ServiceWorkerJob.h.
192         * workers/service/ServiceWorkerJobClient.h: Renamed from Source/WebCore/workers/ServiceWorkerJobClient.h.
193         * workers/service/ServiceWorkerProvider.cpp: Renamed from Source/WebCore/workers/ServiceWorkerProvider.cpp.
194         * workers/service/ServiceWorkerProvider.h: Renamed from Source/WebCore/workers/ServiceWorkerProvider.h.
195         * workers/service/ServiceWorkerRegistration.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.cpp.
196         * workers/service/ServiceWorkerRegistration.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.h.
197         * workers/service/ServiceWorkerRegistration.idl: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.idl.
198         * workers/service/ServiceWorkerRegistrationOptions.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationOptions.h.
199         * workers/service/ServiceWorkerRegistrationParameters.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.cpp.
200         * workers/service/ServiceWorkerRegistrationParameters.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.h.
201         * workers/service/ServiceWorkerUpdateViaCache.h: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.h.
202         * workers/service/ServiceWorkerUpdateViaCache.idl: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.idl.
203
204 2017-08-11  Chris Dumez  <cdumez@apple.com>
205
206         Implement quota limitation for keepalive Fetch requests
207         https://bugs.webkit.org/show_bug.cgi?id=175482
208
209         Reviewed by Sam Weinig and Youenn Fablet.
210
211         Implement quota limitation for keepalive Fetch requests as per:
212         - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)
213
214         This partly works for Beacon as well, meaning that no Beacon with a body
215         over 64Kb can be sent. However, we don't keep track about wether or not
216         beacon loads are inflight or not.
217
218         Also update CachedResourceLoader::requestResource() so that the caller
219         can get a ResourceError when it returns null. This is useful for both
220         Fetch and Beacon to return better error messages.
221
222         Test: http/wpt/beacon/beacon-quota.html
223
224         * CMakeLists.txt:
225         * Modules/beacon/NavigatorBeacon.cpp:
226         (WebCore::NavigatorBeacon::sendBeacon):
227         * Modules/fetch/FetchBodyOwner.cpp:
228         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
229         (WebCore::FetchBodyOwner::BlobLoader::didFail):
230         * Modules/fetch/FetchBodyOwner.h:
231         * Modules/fetch/FetchLoader.cpp:
232         (WebCore::FetchLoader::start):
233         (WebCore::FetchLoader::didFail):
234         * Modules/fetch/FetchLoaderClient.h:
235         * Modules/fetch/FetchResponse.cpp:
236         (WebCore::FetchResponse::BodyLoader::didFail):
237         * Modules/fetch/FetchResponse.h:
238         * WebCore.xcodeproj/project.pbxproj:
239         * loader/DocumentThreadableLoader.cpp:
240         (WebCore::DocumentThreadableLoader::loadRequest):
241         * loader/cache/CachedResource.cpp:
242         (WebCore::CachedResource::load):
243         * loader/cache/CachedResource.h:
244         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
245         * loader/cache/CachedResourceLoader.cpp:
246         (WebCore::createResource):
247         (WebCore::CachedResourceLoader::requestImage):
248         (WebCore::CachedResourceLoader::requestFont):
249         (WebCore::CachedResourceLoader::requestTextTrack):
250         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
251         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
252         (WebCore::CachedResourceLoader::requestScript):
253         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
254         (WebCore::CachedResourceLoader::requestSVGDocument):
255         (WebCore::CachedResourceLoader::requestLinkResource):
256         (WebCore::CachedResourceLoader::requestMedia):
257         (WebCore::CachedResourceLoader::requestIcon):
258         (WebCore::CachedResourceLoader::requestRawResource):
259         (WebCore::CachedResourceLoader::requestBeaconResource):
260         (WebCore::CachedResourceLoader::requestMainResource):
261         (WebCore::CachedResourceLoader::requestResource):
262         (WebCore::CachedResourceLoader::preload):
263         * loader/cache/CachedResourceLoader.h:
264         * loader/cache/KeepaliveRequestTracker.cpp: Added.
265         (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
266         (WebCore::KeepaliveRequestTracker::canLoadRequest):
267         (WebCore::KeepaliveRequestTracker::registerRequest):
268         (WebCore::KeepaliveRequestTracker::responseReceived):
269         (WebCore::KeepaliveRequestTracker::notifyFinished):
270         (WebCore::KeepaliveRequestTracker::unregisterRequest):
271         * loader/cache/KeepaliveRequestTracker.h: Added.
272         * platform/network/FormData.cpp:
273         (WebCore::FormDataElement::lengthInBytes const):
274         (WebCore::FormData::lengthInBytes const):
275         * platform/network/FormData.h:
276
277 2017-08-11  Don Olmstead  <don.olmstead@sony.com>
278
279         [WTF] Move ValueToString into WTF
280         https://bugs.webkit.org/show_bug.cgi?id=175469
281
282         Reviewed by Sam Weinig.
283
284         No new tests. No change in behavior.
285
286         * WebCore.xcodeproj/project.pbxproj:
287         * html/HTMLMediaElement.h:
288         (WTF::ValueToString<WebCore::TextTrackCue::string):
289         (WebCore::ValueToString<TextTrackCue::string): Deleted.
290         (WebCore::ValueToString<MediaTime>::string): Deleted.
291         * platform/LayoutUnit.h:
292         (WTF::ValueToString<WebCore::LayoutUnit>::string):
293         (WebCore::ValueToString<LayoutUnit>::string): Deleted.
294         * platform/PODInterval.h:
295         * platform/PODIntervalTree.h:
296         * platform/PODRedBlackTree.h:
297         * platform/graphics/FloatPolygon.h:
298         (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
299         (WebCore::ValueToString<FloatPolygonEdge::string): Deleted.
300         * rendering/FloatingObjects.h:
301         (WTF::ValueToString<WebCore::FloatingObject::string):
302         (WebCore::ValueToString<FloatingObject::string): Deleted.
303         * rendering/RenderFlowThread.h:
304         (WTF::ValueToString<WebCore::RenderRegion::string):
305         (WebCore::ValueToString<RenderRegion::string): Deleted.
306
307 2017-08-11  Sam Weinig  <sam@webkit.org>
308
309         [Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references
310         https://bugs.webkit.org/show_bug.cgi?id=175394
311
312         Reviewed by Chris Dumez.
313
314         * bindings/IDLTypes.h:
315         (WebCore::IDLWrapper::convertToParameterType): Deleted.
316
317             Remove no longer used convertToParameterType.
318
319         * bindings/js/DOMPromiseProxy.h:
320
321             - Replace Variant<Value, Exception> with ExceptionOr<Value> / ExceptionOr<void>.
322             - Update ResolveCallback to have a return type of IDLType::ParameterType, rather than
323               IDLType::ImplementationType, now that WTF::Function supports references as the 
324               return type. This is needed, since the IDLType::ParameterType for an interface T
325               is T&.
326
327         * css/FontFace.cpp:
328         * css/FontFace.h:
329         * css/FontFaceSet.cpp:
330         * css/FontFaceSet.h:
331
332             Update resolve callbacks to return a reference rather than a RefPtr, matching
333             the new signature requirement.
334
335 2017-08-11  Sam Weinig  <sam@webkit.org>
336
337         [WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
338         https://bugs.webkit.org/show_bug.cgi?id=175457
339
340         Reviewed by Chris Dumez.
341
342         * CMakeLists.txt:
343         * DerivedSources.make:
344         * WebCore.xcodeproj/project.pbxproj:
345         * bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed.
346         * bindings/js/JSCryptoAlgorithmBuilder.h: Removed.
347         * bindings/js/JSCryptoKeyCustom.cpp: Removed.
348
349             Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm
350             IDLs and headers.
351
352         * crypto/CryptoKey.cpp:
353         * crypto/CryptoKey.h:
354         * crypto/CryptoKey.idl:
355         
356             Replace custom algorithm attribute with a union of the supported key algorithms.
357         
358         * crypto/keys/CryptoAesKeyAlgorithm.h: Added.
359         * crypto/keys/CryptoAesKeyAlgorithm.idl: Added.
360         * crypto/keys/CryptoEcKeyAlgorithm.h: Added.
361         * crypto/keys/CryptoEcKeyAlgorithm.idl: Added.
362         * crypto/keys/CryptoHmacKeyAlgorithm.h: Added.
363         * crypto/keys/CryptoHmacKeyAlgorithm.idl: Added.
364         * crypto/keys/CryptoKeyAlgorithm.h: Added.
365         * crypto/keys/CryptoKeyAlgorithm.idl: Added.
366         * crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added.
367         * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added.
368         * crypto/keys/CryptoRsaKeyAlgorithm.h: Added.
369         * crypto/keys/CryptoRsaKeyAlgorithm.idl: Added.
370
371             Add IDLs and headers fo the supported key algorithms.
372
373         * crypto/keys/CryptoKeyAES.h:
374         * crypto/keys/CryptoKeyEC.h:
375         * crypto/keys/CryptoKeyHMAC.h:
376         * crypto/keys/CryptoKeyRSA.h:
377         * crypto/keys/CryptoKeyRaw.h:
378
379             Give each of the existing KeyAlgorithm subclasses a dictionary() function
380             that returns the populated corresponding spec'd dictionary.
381
382 2017-08-11  Simon Fraser  <simon.fraser@apple.com>
383
384         Some RenderSVGResource cleanup
385         https://bugs.webkit.org/show_bug.cgi?id=175494
386
387         Reviewed by Zalan Bujtas.
388
389         Use more initializers. Remove spurious use of bitfields that didn't save any space at all.
390         0 -> nullptr.
391
392         No behavior change.
393
394         * rendering/svg/RenderSVGResourceContainer.cpp:
395         (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer):
396         * rendering/svg/RenderSVGResourceContainer.h:
397         * rendering/svg/RenderSVGResourceGradient.cpp:
398         (WebCore::RenderSVGResourceGradient::RenderSVGResourceGradient):
399         (WebCore::RenderSVGResourceGradient::applyResource):
400         * rendering/svg/RenderSVGResourceGradient.h:
401         * rendering/svg/RenderSVGResourcePattern.cpp:
402         (WebCore::RenderSVGResourcePattern::RenderSVGResourcePattern):
403         * rendering/svg/RenderSVGResourcePattern.h:
404         * rendering/svg/RenderSVGShape.cpp:
405         (WebCore::RenderSVGShape::fillShape):
406         (WebCore::RenderSVGShape::strokeShape):
407         * rendering/svg/SVGRenderingContext.cpp:
408         (WebCore::SVGRenderingContext::~SVGRenderingContext):
409         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
410         * rendering/svg/SVGRenderingContext.h:
411         (WebCore::SVGRenderingContext::SVGRenderingContext):
412
413 2017-08-11  Tim Horton  <timothy_horton@apple.com>
414
415         Fix the build with modern Clang's -Wexpansion-to-defined
416         https://bugs.webkit.org/show_bug.cgi?id=175467
417         <rdar://problem/33667497>
418
419         Reviewed by Simon Fraser.
420
421         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
422
423 2017-08-11  Brady Eidson  <beidson@apple.com>
424
425         Crash under ServiceWorkerJob::failedWithException.
426         https://bugs.webkit.org/show_bug.cgi?id=175488
427
428         Reviewed by Tim Horton.
429
430         Covered by existing tests.
431
432         * workers/ServiceWorkerJob.cpp:
433         (WebCore::ServiceWorkerJob::failedWithException): jobDidFinish might cause the Job to be deleted, so make it last.
434
435 2017-08-10  Sam Weinig  <sam@webkit.org>
436
437         WTF::Function does not allow for reference / non-default constructible return types
438         https://bugs.webkit.org/show_bug.cgi?id=175244
439
440         Reviewed by Chris Dumez.
441
442         * bindings/js/JSCustomElementInterface.h:
443         (WebCore::JSCustomElementInterface::invokeCallback):
444         Update the default value for the addArguments parameter to be an empty lambda, rather than
445         default initialization, which leads to a null WTF::Function. This allows us to remove support
446         for calling null WTF::Function. No change in behavior.
447
448 2017-08-11  Antti Koivisto  <antti@apple.com>
449
450         Remove RenderQuote collection from RenderView
451         https://bugs.webkit.org/show_bug.cgi?id=175479
452
453         Reviewed by Andreas Kling.
454
455         We can do it well enough without maintaining this pointer structure.
456
457         Global updating doesn't work well with future direction for first-letter and similar anyway.
458         We need to update quote immediately when updating its style.
459
460         * rendering/RenderQuote.cpp:
461         (WebCore::RenderQuote::insertedIntoTree):
462         (WebCore::RenderQuote::willBeRemovedFromTree):
463
464             Just tell the view that there are renderers to update.
465
466         (WebCore::RenderQuote::styleDidChange):
467         (WebCore::RenderQuote::isOpen const):
468         (WebCore::RenderQuote::updateRenderer):
469         (WebCore::RenderQuote::updateRenderers): Deleted.
470
471             Update single renderer only. RenderTreeUpdater provides the previous renderer to compute the depth.
472
473         * rendering/RenderQuote.h:
474         * rendering/RenderView.cpp:
475         (WebCore::RenderView::registerQuote): Deleted.
476         (WebCore::RenderView::unregisterQuote): Deleted.
477         (WebCore::RenderView::updateSpecialRenderers): Deleted.
478
479             Remove the quote list.
480
481         * rendering/RenderView.h:
482         * style/RenderTreeUpdater.cpp:
483         (WebCore::RenderTreeUpdater::commit):
484
485             Ensure that all quotes are updated.
486
487         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
488         (WebCore::RenderTreeUpdater::updateQuotesUpTo):
489
490             Traverse render tree to find quotes to update starting from the previous updated quote.
491
492         * style/RenderTreeUpdater.h:
493
494 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
495
496         [CMake] Many warning about missing “override” keywords in ANGLE with Clang
497         https://bugs.webkit.org/show_bug.cgi?id=175475
498
499         Reviewed by Michael Catanzaro.
500
501         * CMakeLists.txt: Add "-Wno-inconsistent-missing-override" to the
502         compiler flags using for building the ANGLE sources.
503
504 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
505
506         [GTK][WPE] Overriden virtual function not marked “override” in ImageBufferDataCairo.h
507         https://bugs.webkit.org/show_bug.cgi?id=175476
508
509         Reviewed by Carlos Garcia Campos.
510
511         * platform/graphics/cairo/ImageBufferDataCairo.h: Add missing "override" qualifier.
512
513 2017-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
514
515         [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication
516         https://bugs.webkit.org/show_bug.cgi?id=175378
517
518         Reviewed by Sergio Villar Senin.
519
520         Bring back part of the code removed in r206732, to keep a reference to the SoupMessage in the
521         AuthenticationChallenge since it can be different to the resource message.
522
523         * platform/network/soup/AuthenticationChallenge.h:
524         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted.
525         (WebCore::AuthenticationChallenge::authenticationClient const): Deleted.
526         (WebCore::AuthenticationChallenge::soupAuth const): Deleted.
527         (WebCore::AuthenticationChallenge::setProposedCredential): Deleted.
528         * platform/network/soup/AuthenticationChallengeSoup.cpp:
529         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
530         (WebCore::AuthenticationChallenge::platformCompare):
531
532 2017-08-10  Dan Bernstein  <mitz@apple.com>
533
534         Fixed building for macOS 10.12 with the macOS 10.13 SDK.
535
536         Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
537         and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
538         starting in that release, they have been available as SPI earlier.
539
540         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
541         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
542         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
543         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
544         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
545         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
546         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
547         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
548         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
549         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
550         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
551         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
552         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
553         (WebCore::SourceBufferPrivateAVFObjC::flush):
554
555 2017-08-10  Brady Eidson  <beidson@apple.com>
556
557         Rename the source files for the WTF persistent coders.
558         https://bugs.webkit.org/show_bug.cgi?id=175441
559
560         Reviewed by Tim Horton.
561
562         * platform/network/NetworkLoadMetrics.h:
563
564 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
565
566         Make ThreadGlobalData RefCounted for web thread
567         https://bugs.webkit.org/show_bug.cgi?id=175439
568
569         Reviewed by Mark Lam.
570
571         When the web thread is enabled, we share ThreadGlobalData between the web thread and the main thread.
572         The problem happens when the main thread is dying. It could start deallocating TLS and the web
573         thread may see the destructed ThreadGlobalData.
574
575         Even though, the current implementation is safe because the main thread do not perform TLS deallocation
576         in the Darwin environment. But this is not true in Windows. And we should not rely on this condition
577         that depends on the platforms.
578
579         In this patch, we make ThreadGlobalData ThreadSafeRefCounted. This type verbosely describes that
580         ThreadGlobalData could be shared between threads when the web thread enabled. And make the life time
581         management simple instead of relying on the platform dependent TLS implementation.
582
583         * platform/ThreadGlobalData.cpp:
584         (WebCore::ThreadGlobalData::setWebCoreThreadData):
585         (WebCore::threadGlobalData):
586         * platform/ThreadGlobalData.h:
587         (WebCore::ThreadGlobalData::cachedResourceRequestInitiators): Deleted.
588         (WebCore::ThreadGlobalData::eventNames): Deleted.
589         (WebCore::ThreadGlobalData::threadTimers): Deleted.
590         (WebCore::ThreadGlobalData::qualifiedNameCache): Deleted.
591         (WebCore::ThreadGlobalData::cachedConverterICU): Deleted.
592         (WebCore::ThreadGlobalData::cachedConverterTEC): Deleted.
593
594 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
595
596         [JSC] Use @toNumber in builtins
597         https://bugs.webkit.org/show_bug.cgi?id=172692
598
599         Reviewed by Sam Weinig.
600
601         Use @toNumber bytecode intrinsic. It emits op_to_number, which efficiently converts
602         a given argument to a number.
603
604         * Modules/streams/ReadableByteStreamInternals.js:
605         (privateInitializeReadableByteStreamController):
606         (readableByteStreamControllerRespond):
607         * Modules/streams/StreamInternals.js:
608         (validateAndNormalizeQueuingStrategy):
609         (enqueueValueWithSize):
610
611 2017-08-10  Nan Wang  <n_wang@apple.com>
612
613         AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
614         https://bugs.webkit.org/show_bug.cgi?id=175340
615         <rdar://problem/33782159>
616
617         Reviewed by Chris Fleizach.
618
619         The issue here is that we manualy set the parent object of the AccessibilitySVGRoot object
620         and there are chances that the parent doesn't detach it properly during the parent's destroying
621         process. Accessing the stale parent object will lead to a crash.
622         Fixed this by making the parent object a weak pointer so we don't access an invalid memory. 
623
624         Test: accessibility/add-children-pseudo-element.html
625
626         * accessibility/AccessibilityRenderObject.cpp:
627         (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
628         * accessibility/AccessibilityRenderObject.h:
629         (WebCore::AccessibilityRenderObject::createWeakPtr):
630         * accessibility/AccessibilitySVGRoot.cpp:
631         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
632         (WebCore::AccessibilitySVGRoot::setParent):
633         (WebCore::AccessibilitySVGRoot::parentObject const):
634         * accessibility/AccessibilitySVGRoot.h:
635
636 2017-08-10  Chris Dumez  <cdumez@apple.com>
637
638         [Beacon] Do connect-src CSP check on redirects as well
639         https://bugs.webkit.org/show_bug.cgi?id=175410
640         <rdar://problem/33815470>
641
642         Reviewed by Youenn Fablet.
643
644         Pass ContentSecurityPolicy object to createPingHandle so that we can send
645         enough data to the NetworkProcess so do CSP checks for Ping loads such
646         as Beacon. For the IPC, we serialize the ContentSecurityPolicy's response
647         headers. Those headers are now cached in ContentSecurityPolicy for
648         performance reasons. CSP headers are rarely updated in practice but
649         sendBeacon() may get called repeatedly for a given document.
650
651         Tests: http/wpt/beacon/connect-src-beacon-redirect-allowed.sub.html
652                http/wpt/beacon/connect-src-beacon-redirect-blocked.sub.html
653
654         * loader/LoaderStrategy.h:
655         * loader/PingLoader.cpp:
656         (WebCore::PingLoader::loadImage):
657         (WebCore::PingLoader::sendPing):
658         (WebCore::PingLoader::sendViolationReport):
659         (WebCore::PingLoader::startPingLoad):
660         * loader/PingLoader.h:
661         * loader/cache/CachedResource.cpp:
662         (WebCore::CachedResource::load):
663         * page/csp/ContentSecurityPolicy.cpp:
664         (WebCore::ContentSecurityPolicy::responseHeaders const):
665         (WebCore::ContentSecurityPolicy::didReceiveHeader):
666         * page/csp/ContentSecurityPolicy.h:
667         * page/csp/ContentSecurityPolicyResponseHeaders.h:
668         (WebCore::ContentSecurityPolicyResponseHeaders::encode const):
669         (WebCore::ContentSecurityPolicyResponseHeaders::decode):
670
671 2017-08-09  Yusuke Suzuki  <utatane.tea@gmail.com>
672
673         [WTF] ThreadSpecific should not introduce additional indirection
674         https://bugs.webkit.org/show_bug.cgi?id=175187
675
676         Reviewed by Mark Lam.
677
678         We drop ThreadSpecific::replace feature which is only used by
679         Web thread. Instead, we use ThreadSpecific<std::unique_ptr<T>> here.
680
681         While this std::unique_ptr<T> shares one instance between main thread
682         and web thread, this is the same to the current implementation. It is
683         safe because the web thread never finishes.
684
685         And for non-web thread implementation, we just use ThreadSpecific<T>,
686         since it is the most efficient.
687
688         * platform/ThreadGlobalData.cpp:
689         (WebCore::ThreadGlobalData::ThreadGlobalData):
690         (WebCore::ThreadGlobalData::setWebCoreThreadData):
691         (WebCore::threadGlobalData):
692         We also drop StringImpl::empty() call since it is not necessary now:
693         StringImpl::empty data is statically initialized by using constexpr.
694
695         * platform/ThreadGlobalData.h:
696         We make it FAST_ALLOCATED since it is previously allocated by fast malloc
697         in ThreadSpecific.
698
699 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
700
701         REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie
702         https://bugs.webkit.org/show_bug.cgi?id=175426
703
704         Reviewed by Carlos Alberto Lopez Perez.
705
706         Also stop using GEOCLUE_LIBRARIES and GEOCLUE_INCLUDE_DIRS, since they are empty. Apparently
707         we have not actually been using the client library at all this whole time, only the D-Bus
708         interface.
709
710         * PlatformGTK.cmake:
711
712 2017-08-10  Brady Eidson  <beidson@apple.com>
713
714         Add ServiceWorkerJob.
715         https://bugs.webkit.org/show_bug.cgi?id=175241
716
717         Reviewed by Tim Horton.
718
719         Test: http/tests/workers/service/basic-register.html
720
721         This patch does a few things:
722         - Adds the spec concept of a ServiceWorkerJob (in the WebProcess, at least)
723         - Adds a ServiceWorkerProvider interface for WebKit to implement
724         - Actually creates a job for service worker registration and "schedules" it,
725           though it always immediately errors out the promise.
726
727         Actually queuing jobs and executing asynchronously is coming up soon.
728
729         * CMakeLists.txt:
730         * WebCore.xcodeproj/project.pbxproj:
731
732         * dom/Document.cpp:
733         (WebCore::Document::sessionID const):
734         * dom/Document.h:
735
736         * workers/ServiceWorkerContainer.cpp:
737         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
738         (WebCore::ServiceWorkerContainer::addRegistration):
739         (WebCore::ServiceWorkerContainer::scheduleJob):
740         (WebCore::ServiceWorkerContainer::jobDidFinish):
741         * workers/ServiceWorkerContainer.h:
742
743         * workers/ServiceWorkerJob.cpp: Added.
744         (WebCore::ServiceWorkerJob::ServiceWorkerJob):
745         (WebCore::ServiceWorkerJob::~ServiceWorkerJob):
746         (WebCore::ServiceWorkerJob::failedWithException):
747         * workers/ServiceWorkerJob.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h.
748         (WebCore::ServiceWorkerJob::createRegisterJob):
749         (WebCore::ServiceWorkerJob::identifier const):
750
751         * workers/ServiceWorkerJobClient.h: Added.
752         (WebCore::ServiceWorkerJobClient::~ServiceWorkerJobClient):
753
754         * workers/ServiceWorkerProvider.cpp: Added.
755         (WebCore::ServiceWorkerProvider::singleton):
756         (WebCore::ServiceWorkerProvider::setSharedProvider):
757         * workers/ServiceWorkerProvider.h: Added.
758         * workers/ServiceWorkerRegistrationOptions.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h.
759         * workers/ServiceWorkerRegistrationParameters.cpp: Added.
760         * workers/ServiceWorkerRegistrationParameters.h: Added.
761
762 2017-08-10  Tim Horton  <timothy_horton@apple.com>
763
764         Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture
765         https://bugs.webkit.org/show_bug.cgi?id=175436
766         <rdar://problem/33667497>
767
768         Reviewed by Simon Fraser.
769
770         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
771         (PlatformMediaSessionManager::updateSessionState):
772         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
773         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
774
775 2017-08-10  Commit Queue  <commit-queue@webkit.org>
776
777         Unreviewed, rolling out r220463.
778         https://bugs.webkit.org/show_bug.cgi?id=175435
779
780         unaccepted fix (Requested by n_wang on #webkit).
781
782         Reverted changeset:
783
784         "AX: crash at
785         WebCore::AccessibilityObject::supportsARIALiveRegion() const +
786         24"
787         https://bugs.webkit.org/show_bug.cgi?id=175340
788         http://trac.webkit.org/changeset/220463
789
790 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
791
792         Remove ENABLE_GAMEPAD_DEPRECATED
793         https://bugs.webkit.org/show_bug.cgi?id=175361
794
795         Reviewed by Carlos Garcia Campos.
796
797         * CMakeLists.txt:
798         * Configurations/FeatureDefines.xcconfig:
799         * PlatformGTK.cmake:
800         * PlatformWPE.cmake:
801         * platform/Linux.cmake: Removed.
802         * platform/gamepad/deprecated/Gamepads.h: Removed.
803         * platform/gamepad/glib/GamepadsGlib.cpp: Removed.
804         * platform/gamepad/linux/GamepadDeviceLinux.cpp: Removed.
805         * platform/gamepad/linux/GamepadDeviceLinux.h: Removed.
806
807 2017-08-10  Myles C. Maxfield  <mmaxfield@apple.com>
808
809         Addressing post-review comments after r219173.
810         https://bugs.webkit.org/show_bug.cgi?id=174149
811
812         Unreviewed.
813
814         * css/CSSFontStyleValue.h:
815         * editing/EditingStyle.cpp:
816         (WebCore::identifierForStyleProperty):
817
818 2017-08-10  Antti Koivisto  <antti@apple.com>
819
820         Try to fix windows build.
821
822         * style/StyleUpdate.h:
823         (WebCore::Style::TextUpdate::TextUpdate):
824
825 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
826
827         [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
828         https://bugs.webkit.org/show_bug.cgi?id=174161
829
830         Reviewed by Xabier Rodriguez-Calvar.
831
832         In r219385 we changed the early return in fillSelectionData() to check the selection data length instead of the
833         data pointer. However, the gtk_selection_data_get_length() can return -1, so we need to check also if the value
834         less than 0. The case of setting an empty string could be valid depending on the target type, so it's better to
835         return early only when data lenght is less than 0 and handle the 0 length case in each target.
836
837         * platform/gtk/PasteboardHelper.cpp:
838         (WebCore::PasteboardHelper::fillSelectionData):
839
840 2017-08-10  Antti Koivisto  <antti@apple.com>
841
842         Text renderer updates should be done by RenderTreeUpdater
843         https://bugs.webkit.org/show_bug.cgi?id=175417
844
845         Reviewed by Andreas Kling.
846
847         All render tree mutations should be done by RenderTreeUpdater. Currently
848         Text::updateRendererAfterContentChange calls RenderText::setTextWithOffset directly.
849
850         * dom/Document.cpp:
851         (WebCore::Document::updateTextRenderer):
852
853             Add range argument.
854
855         * dom/Document.h:
856         * dom/Text.cpp:
857         (WebCore::Text::updateRendererAfterContentChange):
858
859             Remove call to setTextWithOffset and pass the range to updateTextRenderer
860
861         * style/RenderTreeUpdater.cpp:
862         (WebCore::RenderTreeUpdater::updateRenderTree):
863         (WebCore::RenderTreeUpdater::updateTextRenderer):
864
865             Call setTextWithOffset here.
866
867         * style/RenderTreeUpdater.h:
868         * style/StyleTreeResolver.cpp:
869         (WebCore::Style::TreeResolver::resolveComposedTree):
870         * style/StyleUpdate.cpp:
871         (WebCore::Style::Update::textUpdate const):
872         (WebCore::Style::Update::addText):
873
874             Add TextUpdate struct similar to ElementUpdate to pass the range to the RenderTreeUpdater.
875
876         * style/StyleUpdate.h:
877
878 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
879
880         Unreviewed GTK+ build fix for ENABLE_GLES2=ON.
881
882         * platform/graphics/texmap/TextureMapperGLHeaders.h:
883         Define various GL constants that are not provided in GLES2 headers
884         but are only leveraged in OpenGL calls if at runtime the underlying
885         OpenGL is GLES2-capable.
886
887 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
888
889         [TexMap] Remove GraphicsContext3D usage from BitmapTexturePool
890         https://bugs.webkit.org/show_bug.cgi?id=175319
891
892         Reviewed by Carlos Garcia Campos.
893
894         Drop the GraphicsContext3D reference in BitmapTexturePool now
895         that the BitmapTextureGL doesn't require it anymore.
896
897         No new tests -- no change in behavior.
898
899         * platform/graphics/texmap/BitmapTexturePool.cpp:
900         (WebCore::BitmapTexturePool::BitmapTexturePool):
901         * platform/graphics/texmap/BitmapTexturePool.h:
902         * platform/graphics/texmap/TextureMapperGL.cpp:
903         (WebCore::TextureMapperGL::TextureMapperGL):
904
905 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
906
907         [TexMap] Drop GraphicsContext3D usage from BitmapTextureGL
908         https://bugs.webkit.org/show_bug.cgi?id=175317
909
910         Reviewed by Carlos Garcia Campos.
911
912         Have BitmapTextureGL use direct OpenGL API entrypoints and constants
913         instead of leveraging the GraphicsContext3D class. Any GraphicsContext3D
914         object passed to BitmapTextureGL would assume rendering to the GL context
915         that's current on that thread, translating method invocations to the
916         OpenGL API. We can do this by ourselves and benefit by avoiding allocating
917         GraphicsContext3D resources like the ANGLE compiler that are by most useful
918         for WebGL.
919
920         BitmapTextureGL::create() call sites are adjusted to stop passing a
921         GraphicsContext3D reference. BitmapTextureGL::bindAsSurface() doesn't need
922         a replacement for the passed-in GraphicsContext3D object since that object
923         originated from the TextureMapperGL instance, whose GraphicsContext3D is by
924         default of the render-to-current-context nature. Other changes are direct
925         translations of GraphicsContext3D methods to OpenGL API calls, or of
926         GraphicsContext3D values to OpenGL API constants.
927
928         No new tests -- no change in behavior.
929
930         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
931         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
932         * platform/graphics/texmap/BitmapTextureGL.cpp:
933         Also remove an unnecessary GraphicsContext.h header inclusion.
934         (WebCore::BitmapTextureGL::BitmapTextureGL):
935         (WebCore::BitmapTextureGL::didReset):
936         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
937         (WebCore::BitmapTextureGL::updateContents):
938         (WebCore::BitmapTextureGL::initializeStencil):
939         (WebCore::BitmapTextureGL::initializeDepthBuffer):
940         (WebCore::BitmapTextureGL::clearIfNeeded):
941         (WebCore::BitmapTextureGL::createFboIfNeeded):
942         (WebCore::BitmapTextureGL::bindAsSurface):
943         (WebCore::BitmapTextureGL::~BitmapTextureGL):
944         (WebCore::BitmapTextureGL::copyFromExternalTexture):
945         * platform/graphics/texmap/BitmapTextureGL.h:
946         (WebCore::BitmapTextureGL::create):
947         (WebCore::BitmapTextureGL::textureTarget const):
948         (WebCore::BitmapTextureGL::internalFormat const):
949         * platform/graphics/texmap/BitmapTexturePool.cpp:
950         (WebCore::BitmapTexturePool::createTexture):
951         * platform/graphics/texmap/TextureMapperGL.cpp:
952         (WebCore::TextureMapperGL::bindSurface):
953         (WebCore::TextureMapperGL::createTexture):
954
955 2017-08-09  Michael Catanzaro  <mcatanzaro@igalia.com>
956
957         [GTK] Remove support for geoclue1
958         https://bugs.webkit.org/show_bug.cgi?id=164205
959
960         Reviewed by Carlos Garcia Campos.
961
962         * PlatformGTK.cmake:
963         * platform/geoclue/GeolocationProviderGeoclue.h:
964         * platform/geoclue/GeolocationProviderGeoclue1.cpp: Removed.
965         * platform/geoclue/GeolocationProviderGeoclue2.cpp: Removed.
966
967 2017-08-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
968
969         [PAL] Move spi/cocoa and spi/cg directories into PAL
970         https://bugs.webkit.org/show_bug.cgi?id=175175
971
972         Reviewed by Myles C. Maxfield.
973
974         * Modules/applepay/cocoa/PaymentCocoa.mm:
975         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
976         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
977         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
978         * PlatformAppleWin.cmake:
979         * WebCore.xcodeproj/project.pbxproj:
980         * editing/cocoa/EditorCocoa.mm:
981         * editing/cocoa/HTMLConverter.mm:
982         * editing/ios/EditorIOS.mm:
983         * page/cocoa/ResourceUsageThreadCocoa.mm:
984         * page/mac/TextIndicatorWindow.mm:
985         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
986         * platform/cocoa/DataDetectorsCoreSoftLink.h:
987         * platform/cocoa/MIMETypeRegistryCocoa.mm:
988         * platform/cocoa/NetworkExtensionContentFilter.mm:
989         * platform/cocoa/ParentalControlsContentFilter.mm:
990         * platform/cocoa/SleepDisablerCocoa.cpp:
991         * platform/graphics/Font.cpp:
992         * platform/graphics/Font.h:
993         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
994         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
995         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
996         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
997         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
998         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
999         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1000         * platform/graphics/cg/ColorCG.cpp:
1001         * platform/graphics/cg/GraphicsContextCG.cpp:
1002         * platform/graphics/cg/ImageBufferCG.cpp:
1003         * platform/graphics/cg/ImageBufferDataCG.cpp:
1004         * platform/graphics/cg/ImageDecoderCG.cpp:
1005         * platform/graphics/cg/NativeImageCG.cpp:
1006         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1007         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1008         * platform/graphics/cocoa/FontCocoa.mm:
1009         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1010         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1011         * platform/graphics/cocoa/IOSurface.mm:
1012         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
1013         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
1014         * platform/graphics/ios/FontAntialiasingStateSaver.h:
1015         * platform/graphics/ios/FontCacheIOS.mm:
1016         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1017         * platform/graphics/mac/FontCacheMac.mm:
1018         * platform/graphics/mac/GlyphPageMac.cpp:
1019         * platform/graphics/win/FontCacheWin.cpp:
1020         * platform/ios/LegacyTileCache.mm:
1021         * platform/ios/LegacyTileGrid.mm:
1022         * platform/ios/LegacyTileGridTile.mm:
1023         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1024         * platform/ios/QuickLook.mm:
1025         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1026         * platform/ios/WebAVPlayerController.h:
1027         * platform/ios/WebAVPlayerController.mm:
1028         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1029         * platform/ios/wak/WKGraphics.mm:
1030         * platform/mac/DragImageMac.mm:
1031         * platform/mac/PlatformScreenMac.mm:
1032         * platform/mac/PlaybackSessionInterfaceMac.mm:
1033         * platform/mac/ThemeMac.mm:
1034         * platform/mac/VideoFullscreenInterfaceMac.mm:
1035         * platform/mac/WebPlaybackControlsManager.h:
1036         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1037         * platform/network/cocoa/CookieStorageObserver.mm:
1038         * platform/network/cocoa/NetworkLoadMetrics.mm:
1039         * platform/network/mac/AuthenticationMac.mm:
1040         * platform/network/mac/ResourceHandleMac.mm:
1041         * platform/spi/ios/DataDetectorsUISPI.h:
1042         * platform/spi/mac/DataDetectorsSPI.h:
1043         * platform/spi/mac/NSViewSPI.h:
1044         * rendering/RenderThemeCocoa.mm:
1045         * rendering/RenderThemeIOS.mm:
1046         * rendering/RenderThemeMac.mm:
1047
1048 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
1049
1050         [WTF] Move TextStream into WTF
1051         https://bugs.webkit.org/show_bug.cgi?id=175211
1052
1053         Reviewed by Myles C. Maxfield.
1054
1055         No new tests. No change in behavior.
1056
1057         * CMakeLists.txt:
1058         * WebCore.xcodeproj/project.pbxproj:
1059         * dom/ComposedTreeIterator.cpp:
1060         * dom/Position.cpp:
1061         * dom/Position.h:
1062         * dom/Range.cpp:
1063         (WebCore::operator<<):
1064         * dom/Range.h:
1065         * dom/ViewportArguments.cpp:
1066         * dom/ViewportArguments.h:
1067         * editing/VisiblePosition.cpp:
1068         * editing/VisiblePosition.h:
1069         * editing/VisibleSelection.cpp:
1070         * editing/VisibleSelection.h:
1071         * html/HTMLVideoElement.cpp:
1072         * html/canvas/CanvasRenderingContext2D.cpp:
1073         * page/FrameView.cpp:
1074         * page/ViewportConfiguration.cpp:
1075         * page/ViewportConfiguration.h:
1076         * page/WheelEventDeltaFilter.cpp:
1077         * page/animation/CSSPropertyAnimation.cpp:
1078         * page/scrolling/AsyncScrollingCoordinator.cpp:
1079         * page/scrolling/ScrollingConstraints.cpp:
1080         * page/scrolling/ScrollingConstraints.h:
1081         * page/scrolling/ScrollingCoordinator.cpp:
1082         * page/scrolling/ScrollingCoordinator.h:
1083         * page/scrolling/ScrollingStateFixedNode.cpp:
1084         * page/scrolling/ScrollingStateFixedNode.h:
1085         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1086         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1087         * page/scrolling/ScrollingStateNode.cpp:
1088         * page/scrolling/ScrollingStateNode.h:
1089         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
1090         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
1091         * page/scrolling/ScrollingStateScrollingNode.cpp:
1092         * page/scrolling/ScrollingStateScrollingNode.h:
1093         * page/scrolling/ScrollingStateStickyNode.cpp:
1094         * page/scrolling/ScrollingStateStickyNode.h:
1095         * page/scrolling/ScrollingTree.cpp:
1096         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1097         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1098         * page/scrolling/ScrollingTreeNode.cpp:
1099         * page/scrolling/ScrollingTreeNode.h:
1100         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1101         * page/scrolling/ScrollingTreeScrollingNode.h:
1102         * page/scrolling/mac/ScrollingTreeFixedNode.h:
1103         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1104         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1105         * page/scrolling/mac/ScrollingTreeStickyNode.h:
1106         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
1107         * platform/CalculationValue.cpp:
1108         * platform/CalculationValue.h:
1109         * platform/LayoutUnit.cpp:
1110         * platform/LayoutUnit.h:
1111         * platform/Length.cpp:
1112         * platform/Length.h:
1113         * platform/LengthBox.cpp:
1114         * platform/LengthBox.h:
1115         * platform/LengthPoint.cpp:
1116         * platform/LengthPoint.h:
1117         * platform/LengthSize.cpp:
1118         * platform/LengthSize.h:
1119         * platform/LogMacros.h:
1120         * platform/ScrollView.cpp:
1121         * platform/ScrollableArea.cpp:
1122         * platform/animation/TimingFunction.cpp:
1123         * platform/animation/TimingFunction.h:
1124         * platform/graphics/BitmapImage.cpp:
1125         * platform/graphics/BitmapImage.h:
1126         * platform/graphics/Color.cpp:
1127         * platform/graphics/Color.h:
1128         * platform/graphics/CrossfadeGeneratedImage.cpp:
1129         * platform/graphics/CrossfadeGeneratedImage.h:
1130         * platform/graphics/FloatPoint.cpp:
1131         * platform/graphics/FloatPoint.h:
1132         * platform/graphics/FloatPoint3D.cpp:
1133         * platform/graphics/FloatPoint3D.h:
1134         * platform/graphics/FloatRect.cpp:
1135         * platform/graphics/FloatRect.h:
1136         * platform/graphics/FloatRoundedRect.cpp:
1137         * platform/graphics/FloatRoundedRect.h:
1138         * platform/graphics/FloatSize.cpp:
1139         * platform/graphics/FloatSize.h:
1140         * platform/graphics/FontTaggedSettings.cpp:
1141         * platform/graphics/FontTaggedSettings.h:
1142         * platform/graphics/GradientImage.cpp:
1143         (WebCore::GradientImage::dump const):
1144         * platform/graphics/GradientImage.h:
1145         * platform/graphics/GraphicsContext.cpp:
1146         * platform/graphics/GraphicsContext.h:
1147         * platform/graphics/GraphicsLayer.cpp:
1148         * platform/graphics/GraphicsLayer.h:
1149         (WebCore::GraphicsLayer::dumpAdditionalProperties const):
1150         * platform/graphics/GraphicsTypes.cpp:
1151         * platform/graphics/GraphicsTypes.h:
1152         * platform/graphics/Image.cpp:
1153         * platform/graphics/Image.h:
1154         * platform/graphics/ImageSource.h:
1155         * platform/graphics/IntPoint.cpp:
1156         * platform/graphics/IntPoint.h:
1157         * platform/graphics/IntRect.cpp:
1158         * platform/graphics/IntRect.h:
1159         * platform/graphics/IntSize.cpp:
1160         * platform/graphics/IntSize.h:
1161         * platform/graphics/LayoutPoint.cpp:
1162         * platform/graphics/LayoutPoint.h:
1163         * platform/graphics/LayoutRect.cpp:
1164         * platform/graphics/LayoutRect.h:
1165         * platform/graphics/LayoutSize.cpp:
1166         * platform/graphics/LayoutSize.h:
1167         * platform/graphics/NamedImageGeneratedImage.cpp:
1168         * platform/graphics/NamedImageGeneratedImage.h:
1169         * platform/graphics/Path.cpp:
1170         * platform/graphics/Path.h:
1171         * platform/graphics/ca/GraphicsLayerCA.cpp:
1172         * platform/graphics/ca/GraphicsLayerCA.h:
1173         * platform/graphics/ca/PlatformCAAnimation.cpp:
1174         * platform/graphics/ca/PlatformCAAnimation.h:
1175         * platform/graphics/ca/PlatformCALayer.cpp:
1176         * platform/graphics/ca/PlatformCALayer.h:
1177         * platform/graphics/ca/TileController.cpp:
1178         * platform/graphics/ca/TileGrid.cpp:
1179         * platform/graphics/cg/GraphicsContextCG.cpp:
1180         * platform/graphics/cg/PDFDocumentImage.cpp:
1181         * platform/graphics/cg/PDFDocumentImage.h:
1182         * platform/graphics/cocoa/IOSurface.h:
1183         * platform/graphics/cocoa/IOSurface.mm:
1184         * platform/graphics/displaylists/DisplayList.cpp:
1185         (WebCore::DisplayList::DisplayList::description const):
1186         * platform/graphics/displaylists/DisplayList.h:
1187         * platform/graphics/displaylists/DisplayListItems.cpp:
1188         * platform/graphics/displaylists/DisplayListItems.h:
1189         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1190         * platform/graphics/displaylists/DisplayListReplayer.cpp:
1191         * platform/graphics/filters/DistantLightSource.cpp:
1192         * platform/graphics/filters/DistantLightSource.h:
1193         * platform/graphics/filters/FEBlend.cpp:
1194         * platform/graphics/filters/FEBlend.h:
1195         * platform/graphics/filters/FEColorMatrix.cpp:
1196         * platform/graphics/filters/FEColorMatrix.h:
1197         * platform/graphics/filters/FEComponentTransfer.cpp:
1198         * platform/graphics/filters/FEComponentTransfer.h:
1199         * platform/graphics/filters/FEComposite.cpp:
1200         * platform/graphics/filters/FEComposite.h:
1201         * platform/graphics/filters/FEConvolveMatrix.cpp:
1202         * platform/graphics/filters/FEConvolveMatrix.h:
1203         * platform/graphics/filters/FEDiffuseLighting.cpp:
1204         * platform/graphics/filters/FEDiffuseLighting.h:
1205         * platform/graphics/filters/FEDisplacementMap.cpp:
1206         * platform/graphics/filters/FEDisplacementMap.h:
1207         * platform/graphics/filters/FEDropShadow.cpp:
1208         * platform/graphics/filters/FEDropShadow.h:
1209         * platform/graphics/filters/FEFlood.cpp:
1210         * platform/graphics/filters/FEFlood.h:
1211         * platform/graphics/filters/FEGaussianBlur.cpp:
1212         * platform/graphics/filters/FEGaussianBlur.h:
1213         * platform/graphics/filters/FEMerge.cpp:
1214         * platform/graphics/filters/FEMerge.h:
1215         * platform/graphics/filters/FEMorphology.cpp:
1216         * platform/graphics/filters/FEMorphology.h:
1217         * platform/graphics/filters/FEOffset.cpp:
1218         * platform/graphics/filters/FEOffset.h:
1219         * platform/graphics/filters/FESpecularLighting.cpp:
1220         * platform/graphics/filters/FESpecularLighting.h:
1221         * platform/graphics/filters/FETile.cpp:
1222         * platform/graphics/filters/FETile.h:
1223         * platform/graphics/filters/FETurbulence.cpp:
1224         * platform/graphics/filters/FETurbulence.h:
1225         * platform/graphics/filters/FilterEffect.cpp:
1226         * platform/graphics/filters/FilterEffect.h:
1227         * platform/graphics/filters/FilterOperation.cpp:
1228         * platform/graphics/filters/FilterOperation.h:
1229         * platform/graphics/filters/FilterOperations.cpp:
1230         * platform/graphics/filters/FilterOperations.h:
1231         * platform/graphics/filters/LightSource.h:
1232         * platform/graphics/filters/PointLightSource.cpp:
1233         * platform/graphics/filters/PointLightSource.h:
1234         * platform/graphics/filters/SourceAlpha.cpp:
1235         * platform/graphics/filters/SourceAlpha.h:
1236         * platform/graphics/filters/SourceGraphic.cpp:
1237         * platform/graphics/filters/SourceGraphic.h:
1238         * platform/graphics/filters/SpotLightSource.cpp:
1239         * platform/graphics/filters/SpotLightSource.h:
1240         * platform/graphics/transforms/AffineTransform.cpp:
1241         * platform/graphics/transforms/AffineTransform.h:
1242         * platform/graphics/transforms/IdentityTransformOperation.h:
1243         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1244         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1245         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1246         * platform/graphics/transforms/MatrixTransformOperation.h:
1247         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
1248         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1249         * platform/graphics/transforms/RotateTransformOperation.cpp:
1250         * platform/graphics/transforms/RotateTransformOperation.h:
1251         * platform/graphics/transforms/ScaleTransformOperation.cpp:
1252         * platform/graphics/transforms/ScaleTransformOperation.h:
1253         * platform/graphics/transforms/SkewTransformOperation.cpp:
1254         * platform/graphics/transforms/SkewTransformOperation.h:
1255         * platform/graphics/transforms/TransformOperation.cpp:
1256         * platform/graphics/transforms/TransformOperation.h:
1257         * platform/graphics/transforms/TransformOperations.cpp:
1258         * platform/graphics/transforms/TransformOperations.h:
1259         * platform/graphics/transforms/TransformationMatrix.cpp:
1260         * platform/graphics/transforms/TransformationMatrix.h:
1261         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1262         * platform/graphics/transforms/TranslateTransformOperation.h:
1263         * platform/ios/SelectionRect.cpp:
1264         (WebCore::operator<<):
1265         * platform/ios/SelectionRect.h:
1266         * platform/mac/ScrollAnimatorMac.mm:
1267         * platform/text/TextAllInOne.cpp:
1268         * rendering/InlineBox.cpp:
1269         * rendering/InlineBox.h:
1270         * rendering/InlineFlowBox.cpp:
1271         (WebCore::InlineFlowBox::outputLineTreeAndMark const):
1272         * rendering/InlineFlowBox.h:
1273         * rendering/InlineTextBox.cpp:
1274         * rendering/InlineTextBox.h:
1275         * rendering/RenderBlockFlow.cpp:
1276         (WebCore::RenderBlockFlow::outputLineTreeAndMark const):
1277         * rendering/RenderBlockFlow.h:
1278         * rendering/RenderLayer.cpp:
1279         * rendering/RenderLayerCompositor.cpp:
1280         * rendering/RenderObject.cpp:
1281         * rendering/RenderObject.h:
1282         * rendering/RenderTreeAsText.cpp:
1283         * rendering/RenderTreeAsText.h:
1284         * rendering/ScrollAlignment.cpp:
1285         * rendering/ScrollAlignment.h:
1286         * rendering/SimpleLineLayoutCoverage.cpp:
1287         * rendering/SimpleLineLayoutFunctions.cpp:
1288         * rendering/SimpleLineLayoutFunctions.h:
1289         * rendering/style/FillLayer.cpp:
1290         * rendering/style/FillLayer.h:
1291         * rendering/style/NinePieceImage.cpp:
1292         * rendering/style/NinePieceImage.h:
1293         * rendering/style/RenderStyleConstants.cpp:
1294         * rendering/style/RenderStyleConstants.h:
1295         * rendering/svg/SVGRenderTreeAsText.cpp:
1296         (WebCore::operator<<):
1297         * rendering/svg/SVGRenderTreeAsText.h:
1298         (WebCore::operator<<):
1299         * svg/SVGLengthValue.cpp:
1300         * svg/SVGLengthValue.h:
1301         * svg/graphics/SVGImage.cpp:
1302         * svg/graphics/SVGImage.h:
1303         * svg/graphics/filters/SVGFEImage.cpp:
1304         * svg/graphics/filters/SVGFEImage.h:
1305
1306 2017-08-09  Commit Queue  <commit-queue@webkit.org>
1307
1308         Unreviewed, rolling out r220466, r220477, and r220487.
1309         https://bugs.webkit.org/show_bug.cgi?id=175411
1310
1311         This change broke existing API tests and follow up fixes did
1312         not resolve all the issues. (Requested by ryanhaddad on
1313         #webkit).
1314
1315         Reverted changesets:
1316
1317         https://bugs.webkit.org/show_bug.cgi?id=175244
1318         http://trac.webkit.org/changeset/220466
1319
1320         "WTF::Function does not allow for reference / non-default
1321         constructible return types"
1322         https://bugs.webkit.org/show_bug.cgi?id=175244
1323         http://trac.webkit.org/changeset/220477
1324
1325         https://bugs.webkit.org/show_bug.cgi?id=175244
1326         http://trac.webkit.org/changeset/220487
1327
1328 2017-08-09  Chris Dumez  <cdumez@apple.com>
1329
1330         [Beacon][NetworkSession] Support CORS-preflighting on redirects
1331         https://bugs.webkit.org/show_bug.cgi?id=175386
1332         <rdar://problem/33801370>
1333
1334         Reviewed by Youenn Fablet.
1335
1336         Export a couple of WebCore symbols so I can use them in WebKit2.
1337
1338         Tests: http/wpt/beacon/cors/cors-preflight-redirect-failure.html
1339                http/wpt/beacon/cors/cors-preflight-redirect-from-crossorigin-to-sameorigin.html
1340                http/wpt/beacon/cors/cors-preflight-redirect-success.html
1341
1342         * loader/CrossOriginAccessControl.h:
1343         * page/SecurityOrigin.h:
1344
1345 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
1346
1347         Use MPAVRoutingController instead of deprecated versions.
1348         https://bugs.webkit.org/show_bug.cgi?id=175063
1349
1350         Reviewed by Tim Horton.
1351
1352         No new tests because no behavior change. This uses a different platform class to present
1353         an interface.
1354
1355         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
1356         Add MPMediaControlsViewController.
1357
1358         * platform/spi/ios/MediaPlayerSPI.h:
1359
1360 2017-08-09  Myles C. Maxfield  <mmaxfield@apple.com>
1361
1362         Mark font-display as in development
1363         https://bugs.webkit.org/show_bug.cgi?id=175387
1364
1365         Unreviewed.
1366
1367         * features.json:
1368
1369 2017-08-09  Commit Queue  <commit-queue@webkit.org>
1370
1371         Unreviewed, rolling out r219334.
1372         https://bugs.webkit.org/show_bug.cgi?id=175398
1373
1374         Caused bug 175023 (Requested by ap on #webkit).
1375
1376         Reverted changeset:
1377
1378         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1379         https://bugs.webkit.org/show_bug.cgi?id=172545
1380         http://trac.webkit.org/changeset/219334
1381
1382 2017-08-09  Dave Hyatt  <hyatt@apple.com>
1383
1384         [Repaint from Layout Removal] Move layer repaint rects into a map
1385         https://bugs.webkit.org/show_bug.cgi?id=175393
1386
1387         Reviewed by Zalan Bujtas.
1388
1389         Move the two repaint rects held by RenderLayer into a RenderLayerModelObject -> RepaintLayoutRects hash map.
1390         RepaintLayoutRects is a new struct that holds both rects.
1391
1392         Eventually more objects than just self painting layers will be caching repaint rects, so this takes a first
1393         step towards having a common cache for these repaint rects. In addition this change saves memory, since
1394         layers that aren't self-painting no longer have empty repaint rects taking up space in RenderLayer.
1395
1396         * rendering/RenderBlockLineLayout.cpp:
1397         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
1398         * rendering/RenderLayer.cpp:
1399         (WebCore::RenderLayer::RenderLayer):
1400         (WebCore::RenderLayer::updateLayerPositions):
1401         (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants):
1402         (WebCore::RenderLayer::computeRepaintRects):
1403         (WebCore::RenderLayer::clearRepaintRects):
1404         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
1405         (WebCore::RenderLayer::scrollTo):
1406         * rendering/RenderLayer.h:
1407         * rendering/RenderLayerModelObject.cpp:
1408         (WebCore::RepaintLayoutRects::RepaintLayoutRects):
1409         (WebCore::RenderLayerModelObject::willBeDestroyed):
1410         (WebCore::RenderLayerModelObject::destroyLayer):
1411         (WebCore::RenderLayerModelObject::styleDidChange):
1412         (WebCore::RenderLayerModelObject::hasRepaintLayoutRects):
1413         (WebCore::RenderLayerModelObject::setRepaintLayoutRects):
1414         (WebCore::RenderLayerModelObject::clearRepaintLayoutRects):
1415         (WebCore::RenderLayerModelObject::repaintLayoutRects):
1416         (WebCore::RenderLayerModelObject::computeRepaintLayoutRects):
1417         * rendering/RenderLayerModelObject.h:
1418         (WebCore::RepaintLayoutRects::RepaintLayoutRects):
1419
1420 2017-08-09  Sam Weinig  <sam@webkit.org>
1421
1422         WTF::Function does not allow for reference / non-default constructible return types
1423         https://bugs.webkit.org/show_bug.cgi?id=175244
1424
1425         Reviewed by Chris Dumez.
1426
1427         * bindings/js/JSCustomElementInterface.h:
1428         (WebCore::JSCustomElementInterface::invokeCallback):
1429         Update the default value for the addArguments parameter to be an empty lambda, rather than
1430         default initialization, which leads to a null WTF::Function. This allows us to remove support
1431         for calling null WTF::Function. No change in behavior.
1432
1433 2017-08-09  Brady Eidson  <beidson@apple.com>
1434
1435         Teach ScriptExecutionContexts about their SessionID.
1436         https://bugs.webkit.org/show_bug.cgi?id=175391
1437
1438         Reviewed by Andy Estes.
1439
1440         No new tests (No current change in behavior).
1441
1442         Turns out that Workers need to know their SessionID for future feature development.
1443         So let's teach it to them.
1444
1445         * dom/ScriptExecutionContext.h: Expose a pure virtual SessionID accessor.
1446
1447         * dom/Document.cpp:
1448         (WebCore::Document::sessionID const):
1449         * dom/Document.h:
1450
1451         * page/SessionID.cpp:
1452         (WebCore::SessionID::isolatedCopy const):
1453         * page/SessionID.h:
1454
1455         * workers/DedicatedWorkerGlobalScope.cpp:
1456         (WebCore::DedicatedWorkerGlobalScope::create):
1457         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1458         * workers/DedicatedWorkerGlobalScope.h:
1459
1460         * workers/DedicatedWorkerThread.cpp:
1461         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1462         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1463         * workers/DedicatedWorkerThread.h:
1464
1465         * workers/Worker.cpp:
1466         (WebCore::Worker::notifyFinished):
1467
1468         * workers/WorkerGlobalScope.cpp:
1469         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1470         * workers/WorkerGlobalScope.h:
1471
1472         * workers/WorkerGlobalScopeProxy.h:
1473
1474         * workers/WorkerMessagingProxy.cpp:
1475         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1476         * workers/WorkerMessagingProxy.h:
1477
1478         * workers/WorkerThread.cpp:
1479         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1480         (WebCore::WorkerThread::WorkerThread):
1481         (WebCore::WorkerThread::workerThread):
1482         * workers/WorkerThread.h:
1483
1484 2017-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1485
1486         [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default
1487         https://bugs.webkit.org/show_bug.cgi?id=175392
1488         <rdar://problem/33783207>
1489
1490         Reviewed by Tim Horton and Megan Gardner.
1491
1492         Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10).
1493         No change in behavior.
1494
1495         * Configurations/FeatureDefines.xcconfig:
1496
1497 2017-08-09  Kirill Ovchinnikov  <kirill.ovchinnikov@lge.com>
1498
1499         Old subtitle track is not deleted on 'src' attribute change event
1500         https://bugs.webkit.org/show_bug.cgi?id=175031
1501
1502         Reviewed by Eric Carlson.
1503
1504         Test: media/track/text-track-src-change.html
1505
1506         * html/HTMLMediaElement.cpp:
1507         (WebCore::HTMLMediaElement::textTrackReadyStateChanged):
1508         * html/HTMLTrackElement.cpp:
1509         (WebCore::HTMLTrackElement::loadTimerFired):
1510         * html/shadow/MediaControls.cpp:
1511         (WebCore::MediaControls::clearTextDisplayContainer):
1512         * html/shadow/MediaControls.h:
1513
1514 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
1515
1516         Unreviewed, rolling out r220457.
1517
1518         This change introduced API test failures.
1519
1520         Reverted changeset:
1521
1522         "WTF::Function does not allow for reference / non-default
1523         constructible return types"
1524         https://bugs.webkit.org/show_bug.cgi?id=175244
1525         http://trac.webkit.org/changeset/220457
1526
1527 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
1528
1529         [WinCairo] Fix build after rev 220399
1530         https://bugs.webkit.org/show_bug.cgi?id=175360
1531
1532         Reviewed by Žan Doberšek.
1533
1534         No new tests. No change in behavior.
1535
1536         * platform/graphics/texmap/TextureMapperGLHeaders.h:
1537
1538 2017-08-09  Nan Wang  <n_wang@apple.com>
1539
1540         AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
1541         https://bugs.webkit.org/show_bug.cgi?id=175340
1542         <rdar://problem/33782159>
1543
1544         Reviewed by Chris Fleizach.
1545
1546         When adding a psuedo element child to a RenderBlockFlow element, there might be a chance where
1547         the element has already been layed out but we are still holding onto its stale children. Fixed it
1548         by notifying AX correctly when inserting/removing children during layout.
1549
1550         Test: accessibility/add-children-pseudo-element.html
1551
1552         * rendering/RenderBlockFlow.cpp:
1553         (WebCore::RenderBlockFlow::insertFloatingObject):
1554         (WebCore::RenderBlockFlow::removeFloatingObject):
1555
1556 2017-08-09  Charlie Turner  <cturner@igalia.com>
1557
1558         [GStreamer][MSE] Add missing lock around getStreamByTrackId
1559         https://bugs.webkit.org/show_bug.cgi?id=175323
1560
1561         Reviewed by Xabier Rodriguez-Calvar.
1562
1563         Covered by existing tests.
1564
1565         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1566         (WebCore::PlaybackPipeline::enqueueSample): Ensure the media source
1567         lock is taken before modifiying the track queues indirectly via the
1568         iterator use in getTrackId.
1569
1570 2017-08-09  Daniel Bates  <dabates@apple.com>
1571
1572         REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication
1573         https://bugs.webkit.org/show_bug.cgi?id=175247
1574         <rdar://problem/33679804>
1575
1576         Reviewed by Brady Eidson.
1577
1578         Add SPI so that Safari can differentiate between a form submission and a redirected form submission
1579         and have PolicyCheck notify the frame loader client if the navigation was in response to receiving a
1580         redirect response. This is the WebKit portion to fix an issue when a native app makes use of an OAuth
1581         OAuth flow that bounces to Safari for user login and then bounce back to the app. Microsoft Graph's
1582         OAuth flow is one example.
1583
1584         Safari was differentiating between a form submission and a redirected form submission based on the
1585         nullity of WKNavigationAction.sourceFrame because in both cases the navigation type was WKNavigationTypeFormSubmitted.
1586         The navigation type is the same for both navigations because WebKit always used the navigation
1587         action from the original request for the redirect request when the original request redirected.
1588         Prior to r219013, WKNavigationAction.sourceFrame would be nil for a form submission that redirects.
1589         Following r219013, WKNavigationAction.sourceFrame is non-nil unless the navigation was initiated by
1590         API. In particular, WKNavigationAction.sourceFrame is non-nil for the redirect navigation corresponding
1591         to a form submission that redirects.
1592
1593         * loader/EmptyClients.cpp:
1594         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1595         * loader/FrameLoaderClient.h:
1596         Have dispatchDecidePolicyForNavigationAction() take a boolean as to whether the navigation was in
1597         response to receiving a redirect response.
1598         * loader/PolicyChecker.cpp:
1599         (WebCore::PolicyChecker::checkNavigationPolicy): Notify the frame loader client whether the navigation
1600         is in response to receiving a redirect response.
1601
1602 2017-08-09  Sam Weinig  <sam@webkit.org>
1603
1604         WTF::Function does not allow for reference / non-default constructible return types
1605         https://bugs.webkit.org/show_bug.cgi?id=175244
1606
1607         Reviewed by Chris Dumez.
1608
1609         * bindings/js/JSCustomElementInterface.h:
1610         (WebCore::JSCustomElementInterface::invokeCallback):
1611         Update the default value for the addArguments parameter to be an empty lambda, rather than
1612         default initialization, which leads to a null WTF::Function. This allows us to remove support
1613         for calling null WTF::Function. No change in behavior.
1614
1615 2017-08-09  Andy Estes  <aestes@apple.com>
1616
1617         [QuickLook] Use case-insensitive comparison of preview MIME types
1618         https://bugs.webkit.org/show_bug.cgi?id=175350
1619         <rdar://problem/33761159>
1620
1621         Reviewed by Brady Eidson.
1622
1623         MIME types are case-insensitive, but PreviewLoader was using a case-sensitive comparison to
1624         determine if a MIME type was supported by QLPreviewConverter. As a result we would fail to
1625         preview Excel macro-enabled workbooks, since CFNetwork would sniff a MIME type of
1626         "application/vnd.ms-excel.sheet.macroEnabled.12" but QuickLook contained
1627         "application/vnd.ms-excel.sheet.macroenabled.12" in its set of supported MIME type strings.
1628
1629         Fix this by copying the QuickLook supported MIME type set into a HashSet using
1630         ASCIICaseInsensitiveHash and using that HashSet for MIME type checks.
1631
1632         Test: quicklook/excel-macro-enabled.html
1633
1634         * loader/ios/PreviewLoader.mm:
1635         (WebCore::PreviewLoader::shouldCreateForMIMEType):
1636
1637 2017-08-09  Ms2ger  <Ms2ger@igalia.com>
1638
1639         Remove unnecessary copies of PlatformMediaSessionManager::m_sessions
1640         https://bugs.webkit.org/show_bug.cgi?id=175375
1641
1642         Reviewed by Sam Weinig.
1643
1644         Remove unnecessary copies of PlatformMediaSessionManager::m_sessions.
1645
1646         These should have been removed in r207688.
1647
1648         No new tests: no behavior change.
1649
1650         * platform/audio/PlatformMediaSessionManager.cpp:
1651         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
1652         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
1653         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
1654         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
1655
1656 2017-08-09  Chris Dumez  <cdumez@apple.com>
1657
1658         Reinstate active flag for iterators
1659         https://bugs.webkit.org/show_bug.cgi?id=175312
1660
1661         Reviewed by Sam Weinig.
1662
1663         NodeIterator / TreeWalker should no longer allow recursive filters
1664         after the following change to the DOM specification:
1665         - https://github.com/whatwg/dom/pull/359
1666
1667         This patch aligns our behavior with the latest specification.
1668
1669         No new tests, updated existing tests.
1670
1671         * dom/NodeIterator.cpp:
1672         (WebCore::NodeIterator::nextNode):
1673         (WebCore::NodeIterator::previousNode):
1674         Note that we now also call m_candidateNode.clear() before returning an
1675         exception. This was a pre-existing bug that we failed to do so in the
1676         exception case but it became more obvious after this change now that
1677         we throw. This was causing traversal/moz-bug559526.html to fail
1678         otherwise (the filter was called one too many times). The test case
1679         is passing in Firefox (The filter is called 4 times and they throw
1680         each time).
1681
1682         * dom/Traversal.cpp:
1683         (WebCore::NodeIteratorBase::NodeIteratorBase):
1684         (WebCore::NodeIteratorBase::acceptNode):
1685         * dom/Traversal.h:
1686         * dom/TreeWalker.cpp:
1687
1688 2017-08-09  Antti Koivisto  <antti@apple.com>
1689
1690         RenderQuote should not mutate render tree
1691         https://bugs.webkit.org/show_bug.cgi?id=175328
1692
1693         Reviewed by Zalan Bujtas.
1694
1695         RenderQuote text renderers are currently created and deleted in a quirky fashion using a linked list.
1696         This patch moves to a simpler model that guarantees the mutations are always done in controlled fashion
1697         during render tree update.
1698
1699         * dom/Document.cpp:
1700         (WebCore::Document::updateTextRenderer):
1701
1702             Move text renderer updating to Document so we can set the inRenderTreeUpdate bit for it too.
1703
1704         * dom/Document.h:
1705         * dom/Text.cpp:
1706         (WebCore::Text::updateRendererAfterContentChange):
1707         * rendering/RenderDescendantIterator.h:
1708         (WebCore::RenderDescendantIteratorAdapter<T>::at):
1709         (WebCore::RenderDescendantConstIteratorAdapter<T>::at const):
1710
1711             Add at() function for starting iteration from a specified renderer.
1712
1713         * rendering/RenderQuote.cpp:
1714         (WebCore::RenderQuote::insertedIntoTree):
1715         (WebCore::RenderQuote::willBeRemovedFromTree):
1716
1717             Register and unregister quotes to RenderView.
1718             Don't do any mutations.
1719
1720         (WebCore::RenderQuote::styleDidChange):
1721
1722             Invalidate the text renderer but don't mutate it.
1723
1724         (WebCore::RenderQuote::updateTextRenderer):
1725         (WebCore::RenderQuote::computeText const):
1726         (WebCore::RenderQuote::updateRenderers):
1727
1728             Compute depth of all render quotes and update the text renderer as needed.
1729
1730         (WebCore::RenderQuote::willBeDestroyed): Deleted.
1731         (WebCore::RenderQuote::attachQuote): Deleted.
1732         (WebCore::RenderQuote::detachQuote): Deleted.
1733         (WebCore::RenderQuote::updateDepth): Deleted.
1734
1735             Get rid of the linked list.
1736
1737         * rendering/RenderQuote.h:
1738         * rendering/RenderView.cpp:
1739         (WebCore::RenderView::registerQuote):
1740         (WebCore::RenderView::unregisterQuote):
1741
1742             Maintain a render tree order ListHashSet of RenderQuotes.
1743
1744         (WebCore::RenderView::updateSpecialRenderers):
1745
1746             Add a function for making additional render tree mutations at the end of a render tree update.
1747             Currently this just invokes RenderQuote::updateRenderers.
1748
1749         * rendering/RenderView.h:
1750         * style/RenderTreeUpdater.cpp:
1751         (WebCore::RenderTreeUpdater::commit):
1752
1753             Call RenderView::updateSpecialRenderers after committing all other changes.
1754
1755 2017-08-09  Zan Dobersek  <zdobersek@igalia.com>
1756
1757         [Soup] Incorrect conversion in msToSoupDate()
1758         https://bugs.webkit.org/show_bug.cgi?id=175320
1759
1760         Reviewed by Carlos Garcia Campos.
1761
1762         Original patch by VaL Doroshchuk.
1763
1764         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1765         (WebCore::msToSoupDate): monthFromDayInYear() returns a value in the [0,11] range,
1766         while soup_date_new() expects a month value in the [1,12] range. The return value
1767         must be thus incremented by one to match that expectation.
1768
1769 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1770
1771         Unreviewed, rolling out r220393.
1772
1773         This patch regresses the performance of WebPage::editorState.
1774
1775         Reverted changeset:
1776
1777         "[iOS WK2] WKWebView schedules nonstop layout after pressing
1778         cmb+b,i,u inside a contenteditable div"
1779         https://bugs.webkit.org/show_bug.cgi?id=175116
1780         http://trac.webkit.org/changeset/220393
1781
1782 2017-08-08  Chris Dumez  <cdumez@apple.com>
1783
1784         [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION
1785         https://bugs.webkit.org/show_bug.cgi?id=175264
1786         <rdar://problem/33547793>
1787
1788         Reviewed by Youenn Fablet.
1789
1790         Pass additional information when creating a PingHandle so that the PingLoad
1791         can deal with CORS-preflighting on Network process side.
1792
1793         Tests: http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html
1794                http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html
1795                http/wpt/beacon/cors/cors-preflight-blob-failure.html
1796                http/wpt/beacon/cors/cors-preflight-blob-success.html
1797                http/wpt/beacon/cors/cors-preflight-cookie.html
1798
1799         * WebCore.xcodeproj/project.pbxproj:
1800         * loader/CrossOriginAccessControl.cpp:
1801         (WebCore::validatePreflightResponse):
1802         * loader/CrossOriginAccessControl.h:
1803         * loader/CrossOriginPreflightChecker.cpp:
1804         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
1805         * loader/CrossOriginPreflightResultCache.h:
1806         * loader/LoaderStrategy.h:
1807         * loader/PingLoader.cpp:
1808         (WebCore::PingLoader::loadImage):
1809         (WebCore::PingLoader::sendPing):
1810         (WebCore::PingLoader::sendViolationReport):
1811         (WebCore::PingLoader::startPingLoad):
1812         * loader/PingLoader.h:
1813         * loader/cache/CachedResource.cpp:
1814         (WebCore::CachedResource::load):
1815         * page/SecurityOrigin.h:
1816
1817 2017-08-08  Sam Weinig  <sam@webkit.org>
1818
1819         Address review feedback from https://bugs.webkit.org/show_bug.cgi?id=175246.
1820
1821         * bindings/js/DOMPromiseProxy.h:
1822         * css/FontFaceSet.cpp:
1823         * css/FontFaceSet.h:
1824
1825 2017-08-08  Devin Rousso  <drousso@apple.com>
1826
1827         Web Inspector: Canvas: support editing WebGL shaders
1828         https://bugs.webkit.org/show_bug.cgi?id=124211
1829         <rdar://problem/15448958>
1830
1831         Reviewed by Matt Baker.
1832
1833         Test: inspector/canvas/updateShader.html
1834
1835         * inspector/InspectorCanvasAgent.h:
1836         * inspector/InspectorCanvasAgent.cpp:
1837         (WebCore::InspectorCanvasAgent::updateShader):
1838
1839         * html/canvas/WebGLRenderingContextBase.h:
1840         * html/canvas/WebGLRenderingContextBase.cpp:
1841         (WebCore::WebGLRenderingContextBase::linkProgram):
1842         (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
1843         Normally, when a program is linked, it invalidates any WebGLUniformLocation associated with
1844         the program by incrementing its `linkCount`. In order to allow live editing of shaders, we
1845         need to be able to compile and link a shader without invalidating these locations. This
1846         patch moves the shader linking logic to its own function that is called by `linkProgram` so
1847         that InspectorCanvasAgent can compile and link without invalidation.
1848
1849 2017-08-08  Sam Weinig  <sam@webkit.org>
1850
1851         [WebIDL] Add support for Promise<> attributes
1852         https://bugs.webkit.org/show_bug.cgi?id=175246
1853
1854         Reviewed by Yusuke Suzuki.
1855
1856         Introduces and adopts DOMPromiseProxy, a new class for binding promises in a more
1857         straightforward and safe (from a wrapper world perspective) way.
1858
1859         * CMakeLists.txt:
1860         * WebCore.xcodeproj/project.pbxproj:
1861         * bindings/js/JSFontFaceCustom.cpp: Removed.
1862         * bindings/js/JSFontFaceSetCustom.cpp: Removed.
1863         * bindings/js/JSMediaKeySessionCustom.cpp: Removed.
1864         * bindings/js/JSServiceWorkerContainerCustom.cpp: Removed.
1865         * bindings/js/JSWebGPUCommandBufferCustom.cpp: Removed.
1866
1867             Remove custom bindings only needed for promise attributes. Add DOMPromiseProxy.h
1868
1869         * Modules/encryptedmedia/MediaKeySession.cpp:
1870         (WebCore::MediaKeySession::sessionClosed):
1871         (WebCore::MediaKeySession::registerClosedPromise): Deleted.
1872         * Modules/encryptedmedia/MediaKeySession.h:
1873         * Modules/encryptedmedia/MediaKeySession.idl:
1874
1875             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
1876
1877         * bindings/IDLTypes.h:
1878
1879             Add StorageType type alias to allow specifying a specific form for storage. This allows
1880             use to use Ref<> for interfaces in DOMPromiseProxy.
1881
1882         (WebCore::IDLWrapper::convertToParameterType):
1883             
1884             Also add convertToParameterType, an annoying hack to workaround the fact WTF::Function
1885             can't return references / no
1886
1887         * bindings/js/DOMPromiseProxy.h: Added.
1888         (WebCore::DOMPromiseProxy<IDLType>):
1889         
1890             DOMPromiseProxy is a new class (set of classes) to represent promises that works with the 
1891             standard toJS<> / JSDOMConvert infrastructure used by the bindings generator. From the
1892             implementation perspective, it is similar to DOMPromiseDeferred, but instead of receiving
1893             one as a parameter, you can initialize it directly in your constructor and start using it.
1894
1895             From the bindings perspective, a DOMPromiseProxy can be converted into a JS Promise by calling
1896             its promise function, which will either create a new promise, or return a cached one.
1897
1898             To make this work, DOMPromiseProxy maintains a Vector of DeferredPromises that hold onto those
1899             actualized promises. The reason it has a Vector, is that we need one DeferredPromises per
1900             DOMWrapperWorld, just like we need one wrapper for an interface per DOMWrapperWorld in the 
1901             wrapper cache. In most cases, only the normal world will be in play, so the Vector has an inline
1902             capacity of one.
1903             
1904             In addition, DOMPromiseProxy maintains a Variant of either an Exception or the result value type.
1905             This allows the DOMPromiseProxy to be resolved or rejected at anytime. Then, when the bindings
1906             request the promise, the stored result / exception can be resolved / rejected into the promise.
1907
1908         (WebCore::DOMPromiseProxy<IDLVoid>):
1909
1910             For void promises, we need slightly different semantics (resolve takes no parameters, Value is
1911             a bit indicating resolved state), so it is specialized.
1912
1913         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>):
1914
1915             In addition to the void specialization, we have DOMPromiseProxyWithResolveCallback. Instead of
1916             storing the value of the resolution directly, this specialization allows the owner to specify
1917             callback to be called when the resolved value is needed. This is needed to avoid reference
1918             cycles when the resolved value is the owner such as is the case with FontFace and FontFaceSet.
1919
1920         * bindings/js/JSDOMConvertPromise.h:
1921         (WebCore::JSConverter<IDLPromise<T>>::convert):
1922         Add converter that calls through to the DOMPromiseProxy function promise.
1923
1924         * bindings/js/JSDOMPromiseDeferred.cpp:
1925         (WebCore::DeferredPromise::callFunction):
1926         (WebCore::DeferredPromise::reject):
1927         * bindings/js/JSDOMPromiseDeferred.h:
1928         (WebCore::DeferredPromise::create):
1929         (WebCore::DeferredPromise::DeferredPromise):
1930
1931             Add a new create function for DeferredPromise that creates the JSPromiseDeferred for you.
1932             Also adds a mode to DeferredPromise to allow keeping the promise after resolution. Maintain
1933             the old behavior as the default.
1934
1935             Change reject to take an Exception as sink rather than an r-value, to allow DOMPromiseProxy
1936             to copy a Exception into multiple DeferredPromises. For callers already moving into reject,
1937             this should be no change.
1938
1939         * bindings/scripts/CodeGeneratorJS.pm:
1940         (AddToIncludesForIDLType):
1941         (GenerateParametersCheck):
1942         (GenerateImplementationFunctionCall):
1943         (NativeToJSValueDOMConvertNeedsState):
1944         (NativeToJSValueDOMConvertNeedsGlobalObject):
1945
1946             Add support DOMPromiseProxy. For now, this means a new extended attribute, [PromiseProxy],
1947             but once I convert all the existing promises over to using DOMPromiseProxy, it will be removed.
1948             
1949             Also specify the right #includes for promises and necessary parameters for conversion.
1950
1951         * bindings/scripts/IDLAttributes.json:
1952         
1953             Add [PromiseProxy], a temporary extended attribute for using DOMPromiseProxy.
1954
1955         * css/FontFace.cpp:
1956         * css/FontFace.h:
1957         * css/FontFace.idl:
1958         * css/FontFaceSet.cpp:
1959         * css/FontFaceSet.h:
1960         * css/FontFaceSet.idl:
1961
1962             Replace custom promise code using the registerPromise idiom with DOMPromiseProxyWithResolveCallback.
1963             The callback is necessary for these two classes since the value the resolve is themselves, and using
1964             a normal resolve would create a cycle.
1965
1966         * html/canvas/WebGPUCommandBuffer.cpp:
1967         * html/canvas/WebGPUCommandBuffer.h:
1968         * html/canvas/WebGPUCommandBuffer.idl:
1969         * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
1970         * platform/graphics/gpu/GPUCommandBuffer.cpp:
1971         * platform/graphics/gpu/GPUCommandBuffer.h:
1972
1973             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
1974
1975         * page/NavigatorBase.cpp:
1976         (WebCore::NavigatorBase::NavigatorBase):
1977         * page/NavigatorBase.h:
1978
1979             Forward declare ServiceWorkerContainer and add an explicit constructor to allow
1980             removing #include of ServiceWorkerContainer.h in the header, avoiding an #include cycle.
1981
1982         * workers/ServiceWorkerContainer.cpp:
1983         * workers/ServiceWorkerContainer.h:
1984         * workers/ServiceWorkerContainer.idl:
1985
1986             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
1987
1988         * bindings/scripts/test/JS/JSTestObj.cpp:
1989         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1990         * bindings/scripts/test/TestObj.idl:
1991
1992             Add / update tests.
1993
1994 2017-08-08  John Wilander  <wilander@apple.com>
1995
1996         Resource Load Statistics: Merge of dataRecordsRemoved should use std::max()
1997         https://bugs.webkit.org/show_bug.cgi?id=175348
1998         <rdar://problem/33785695>
1999
2000         Reviewed by Chris Dumez.
2001
2002         No new tests. Online change of a statistic that doesn't affect logic flow.
2003
2004         * loader/ResourceLoadStatistics.cpp:
2005         (WebCore::ResourceLoadStatistics::merge):
2006             Now uses std::max() instead of addition.
2007
2008 2017-08-08  Brent Fulgham  <bfulgham@apple.com>
2009
2010         Sandbox flags do not support document.domain control
2011         https://bugs.webkit.org/show_bug.cgi?id=175281
2012         <rdar://problem/33778936>
2013
2014         Reviewed by Chris Dumez.
2015
2016         Update the 'setDomain' logic to honor the sandbox properties as defined in the current
2017         HTML5 specification. This brings us in line with how Chrome and other browsers have
2018         worked for some time.
2019
2020         Test: fast/frames/sandboxed-iframe-domain.html
2021
2022         * dom/Document.cpp:
2023         (WebCore::Document::setDomain): Add check for sandbox flag (with appropriate error message)
2024         * dom/SecurityContext.h:
2025
2026 2017-08-08  Jeremy Jones  <jeremyj@apple.com>
2027
2028         Change fast seek logic to prevent ping-ponging.
2029         https://bugs.webkit.org/show_bug.cgi?id=175167
2030         rdar://problem/32936116
2031
2032         Reviewed by Jer Noble.
2033
2034         Updated test: media/video-fast-seek.html
2035
2036         Changed fast seek behavior to always seek early than seek time; and after current time when seeking forward.
2037         This prevents ping-ponging, where a fast seek overshoots the target looking for a keyframe.
2038         A subsequent seek will suddenly be on the other side of current time and
2039         will search in the opposite direction for a key frame; repeat.
2040
2041         * html/HTMLMediaElement.cpp:
2042         (WebCore::HTMLMediaElement::fastSeek):
2043
2044 2017-08-08  Ms2ger  <Ms2ger@igalia.com>
2045
2046         Unreviewed. Correct the function name in a debug message.
2047         https://bugs.webkit.org/show_bug.cgi?id=175262
2048
2049         No new tests: debug logs are not tested.
2050
2051         * platform/audio/PlatformMediaSessionManager.cpp:
2052         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
2053
2054 2017-08-08  Brent Fulgham  <bfulgham@apple.com>
2055
2056         Unreviewed build fix after r220376.
2057
2058         Don't attempt to use isPublicSuffix when building without that
2059         feature enabled.
2060
2061         * dom/Document.cpp:
2062         (WebCore::Document::domainIsRegisterable const):
2063
2064 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2065
2066         [CMake] Properly test if compiler supports compiler flags
2067         https://bugs.webkit.org/show_bug.cgi?id=174490
2068
2069         Reviewed by Konstantin Tokarev.
2070
2071         * CMakeLists.txt:
2072         * PlatformGTK.cmake:
2073         * PlatformWPE.cmake:
2074
2075 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2076
2077         [GStreamer] Don't use GraphicsContext3D in VideoTextureCoperGStreamer
2078         https://bugs.webkit.org/show_bug.cgi?id=174774
2079
2080         Reviewed by Carlos Garcia Campos.
2081
2082         VideoTextureCoperGStreamer class creates a new GraphicsContext3D internally
2083         that's used to render to whichever OpenGL context is current. Such usage
2084         doesn't add anything to the user since there's no underlying offscreen-based
2085         OpenGL context created, and instead all GraphicsContext3D calls are directly
2086         translated to usual OpenGL API calls. We should avoid using GraphicsContext3D
2087         in such cases and instead use direct OpenGL API calls.
2088
2089         This patch achieves that for the VideoTextureCoperGStreamer class. A
2090         GraphicsContext3D object is still created because it's needed to construct an
2091         instance of the TextureMapperShaderProgram class, but this will be removed as
2092         soon as TextureMapperShaderProgram drops the GraphicsContext3D dependence.
2093
2094         No new tests -- no change in behavior.
2095
2096         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2097         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2098         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
2099         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2100         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
2101         (WebCore::VideoTextureCopierGStreamer::resultTexture):
2102
2103 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2104
2105         [TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy}
2106         https://bugs.webkit.org/show_bug.cgi?id=175314
2107
2108         Reviewed by Carlos Garcia Campos.
2109
2110         Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and
2111         TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D*
2112         types provided in the GraphicsTypes3D.h header.
2113
2114         No new tests -- no change in behavior.
2115
2116         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2117         (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
2118         (WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset):
2119         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2120         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2121         (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
2122         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2123
2124 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2125
2126         [TexMap] Don't use GraphicsContext3D in ClipStack
2127         https://bugs.webkit.org/show_bug.cgi?id=174776
2128
2129         Reviewed by Carlos Garcia Campos.
2130
2131         Any GraphicsContext3D object that's passed to ClipStack methods is of the
2132         render-to-current-context nature, meaning there's no internally owned GL
2133         context that has to be properly handled and all calls are simply passed to
2134         OpenGL APIs. We should drop such (non-)usage of GraphicsContext3D in favor
2135         of direct OpenGL API invocations.
2136
2137         This patch covers TextureMapper's ClipStack. Call sites to the apply() and
2138         applyIfNeeded() are modified to not pass a reference to any
2139         GraphicsContext3D object. Internally, OpenGL API entrypoints and constants
2140         are used instead of GraphicsContext3D invocations.
2141
2142         No new tests -- no change in behavior.
2143
2144         * platform/graphics/texmap/BitmapTextureGL.cpp:
2145         (WebCore::BitmapTextureGL::clearIfNeeded):
2146         (WebCore::BitmapTextureGL::bindAsSurface):
2147         * platform/graphics/texmap/ClipStack.cpp:
2148         (WebCore::ClipStack::apply):
2149         (WebCore::ClipStack::applyIfNeeded):
2150         * platform/graphics/texmap/ClipStack.h:
2151         * platform/graphics/texmap/TextureMapperGL.cpp:
2152         (WebCore::TextureMapperGL::bindDefaultSurface):
2153         (WebCore::TextureMapperGL::beginScissorClip):
2154         (WebCore::TextureMapperGL::beginClip):
2155         (WebCore::TextureMapperGL::endClip):
2156
2157 2017-08-08  Javier Fernandez  <jfernandez@igalia.com>
2158
2159         Not possible to remove the 'li' element inside the table cell
2160         https://bugs.webkit.org/show_bug.cgi?id=173148
2161
2162         Reviewed by Ryosuke Niwa.
2163
2164         We need to add a new case for breaking out empty list items when they are
2165         at the start of an editable area. Since list items can be also inside
2166         table cells, we need to consider this kind of elements as well.
2167
2168         Tests: editing/deleting/delete-list-items-in-table-cell-1.html
2169                editing/deleting/delete-list-items-in-table-cell-2.html
2170                editing/deleting/delete-list-items-in-table-cell-3.html
2171                editing/deleting/delete-list-items-in-table-cell-4.html
2172                editing/deleting/delete-list-items-in-table-cell-5.html
2173                editing/deleting/delete-list-items-in-table-cell-6.html
2174                editing/deleting/delete-list-items-in-table-cell-7.html
2175                editing/deleting/delete-list-items-in-table-cell-8.html
2176
2177         * editing/TypingCommand.cpp:
2178         (WebCore::TypingCommand::deleteKeyPressed):
2179
2180 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2181
2182         [TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class
2183         https://bugs.webkit.org/show_bug.cgi?id=175316
2184
2185         Reviewed by Carlos Garcia Campos.
2186
2187         Move the TextureMapperPlatformLayerProxyProvider class (which is the type
2188         aliased to PlatformLayer for threaded CoordGraphics) into its own header
2189         file. This prevents including the TextureMapperPlatformLayerProxy.h header
2190         file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types
2191         and function declarations before the GStreamer GL headers include them
2192         later in the MediaPlayerPrivateGStreamerBase implementation file.
2193
2194         In the MediaPlayerPrivateGStreamerBase.h header file, only the new header
2195         is included, and a forward declaration of the TextureMapperPlatformLayerProxy
2196         class is used. proxy() and swapBuffersIfNeeded() methods are moved into
2197         the implementation file to avoid requiring the full definition of the
2198         TextureMapperPlatformLayerProxy class.
2199
2200         Similar is done for the TextureMapperGC3DPlatformLayer class and the
2201         Cairo-specific implementation of the ImageBufferData class. The
2202         CoordinatedGraphicsLayer implementation file also gains an include of the
2203         TextureMapperPlatformLayerProxyProvider.h header since it requires the full
2204         definition of that class.
2205
2206         No new tests -- no change in behavior.
2207
2208         * platform/graphics/cairo/ImageBufferCairo.cpp:
2209         (WebCore::ImageBufferData::proxy const):
2210         * platform/graphics/cairo/ImageBufferDataCairo.h:
2211         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2212         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
2213         (WebCore::MediaPlayerPrivateGStreamerBase::proxy const):
2214         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
2215         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2216         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
2217         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
2218         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2219         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added.
2220         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2221
2222 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2223
2224         Unreviewed. Follow-up to r220392 that fixes build on configurations
2225         that disable USE(GSTREAMER_GL).
2226
2227         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2228         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2229         When creating the BitmapTextureGL object, also provide an initialized
2230         TextureMapperContextAttributes object.
2231
2232 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2233
2234         [TexMap] Group GL header file inclusions in a single header file
2235         https://bugs.webkit.org/show_bug.cgi?id=175313
2236
2237         Reviewed by Carlos Garcia Campos.
2238
2239         Add a helper header file to the TextureMapper subsystem that includes
2240         the OpenGL headers, properly addressing the build configuration to
2241         include headers as provided by either libepoxy, the OpenGL ES library,
2242         or the OpenGL library.
2243
2244         TextureMapperContextAttributes implementation file is the only one
2245         that can leverage the header at the moment, but more will follow.
2246
2247         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
2248         * platform/graphics/texmap/TextureMapperGLHeaders.h: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp.
2249
2250 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2251
2252         [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
2253         https://bugs.webkit.org/show_bug.cgi?id=175116
2254         <rdar://problem/28279301>
2255
2256         Reviewed by Darin Adler and Ryosuke Niwa.
2257
2258         WebCore support for WebPage::editorState refactoring. See WebKit ChangeLogs for more detail.
2259
2260         Tests: EditorStateTests.TypingAttributesBold
2261                EditorStateTests.TypingAttributesItalic
2262                EditorStateTests.TypingAttributesUnderline
2263                EditorStateTests.TypingAttributesTextAlignmentAbsoluteAlignmentOptions
2264                EditorStateTests.TypingAttributesTextAlignmentStartEnd
2265                EditorStateTests.TypingAttributesTextAlignmentDirectionalText
2266                EditorStateTests.TypingAttributesTextColor
2267                EditorStateTests.TypingAttributesMixedStyles
2268                EditorStateTests.TypingAttributesLinkColor
2269
2270         * css/StyleProperties.cpp:
2271         (WebCore::StyleProperties::propertyAsColor const):
2272         (WebCore::StyleProperties::propertyAsValueID const):
2273
2274         Introduces some helper functions in StyleProperties to convert CSS property values to Color or a CSSValueID.
2275
2276         * css/StyleProperties.h:
2277         * editing/EditingStyle.cpp:
2278         (WebCore::EditingStyle::hasStyle):
2279
2280         Pull out logic in selectionStartHasStyle that asks for a style TriState into EditingStyle::hasStyle. This is
2281         because WebPage::editorState will now query for multiple styles at the selection start, but
2282         selectionStartHasStyle currently recomputes styleAtSelectionStart every time it is called. To prevent extra work
2283         from being done, we can just call selectionStartHasStyle once and use ask for EditingStyle::hasStyle on the
2284         computed EditingStyle at selection start.
2285
2286         * editing/EditingStyle.h:
2287         * editing/Editor.cpp:
2288         (WebCore::Editor::selectionStartHasStyle const):
2289
2290 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2291
2292         [TexMap] Add TextureMapperContextAttributes
2293         https://bugs.webkit.org/show_bug.cgi?id=175311
2294
2295         Reviewed by Carlos Garcia Campos.
2296
2297         Add and use TextureMapperContextAttributes, a slim struct that holds
2298         information about the type and extensions supported by the OpenGL
2299         context that's being used for one specific TextureMapperGL instance.
2300
2301         This struct is initialized in the TextureMapperGL constructor for the
2302         OpenGL context that's been made current on that thread, and that will
2303         be used for that TextureMapperGL instance through its lifetime. The
2304         struct is then also copied into any BitmapTextureGL objects that have
2305         been created through this TextureMapperGL (or its texture pool).
2306
2307         The struct is initialized with information about GLES2 support (which
2308         is at this point done through the USE_OPENGL_ES_2 macro) and about
2309         specific OpenGL extensions that are supported. These are then used in
2310         TextureMapperGL (NPOT textures) and BitmapTextureGL (BGRA support,
2311         sub-image unpacking) to deploy specific optimizations or workarounds.
2312
2313         This ultimately serves as a replacement for clunky static functions
2314         that need to operate on GraphicsContext3D objects to retrieve this
2315         information.
2316
2317         No new tests -- no change in behavior.
2318
2319         * platform/TextureMapper.cmake:
2320         * platform/graphics/texmap/BitmapTextureGL.cpp:
2321         (WebCore::BitmapTextureGL::BitmapTextureGL):
2322         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
2323         (WebCore::BitmapTextureGL::updateContents):
2324         (WebCore::driverSupportsSubImage): Deleted.
2325         * platform/graphics/texmap/BitmapTextureGL.h:
2326         (WebCore::BitmapTextureGL::create):
2327         * platform/graphics/texmap/BitmapTexturePool.cpp:
2328         (WebCore::BitmapTexturePool::BitmapTexturePool):
2329         (WebCore::BitmapTexturePool::createTexture):
2330         * platform/graphics/texmap/BitmapTexturePool.h:
2331         * platform/graphics/texmap/TextureMapperContextAttributes.cpp: Added.
2332         (WebCore::TextureMapperContextAttributes::initialize):
2333         * platform/graphics/texmap/TextureMapperContextAttributes.h: Added.
2334         * platform/graphics/texmap/TextureMapperGL.cpp:
2335         (WebCore::TextureMapperGL::TextureMapperGL):
2336         (WebCore::TextureMapperGL::drawTexture):
2337         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
2338         (WebCore::TextureMapperGL::createTexture):
2339         (WebCore::driverSupportsNPOTTextures): Deleted.
2340         * platform/graphics/texmap/TextureMapperGL.h:
2341
2342 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2343
2344         [TexMap] Don't expose GraphicsContext3D object
2345         https://bugs.webkit.org/show_bug.cgi?id=175310
2346
2347         Reviewed by Carlos Garcia Campos.
2348
2349         Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead,
2350         the clearColor() method is added that's to be used by the CoordinatedGraphicsScene
2351         class which was accessing the GraphicsContext3D object for this purpose.
2352
2353         * platform/graphics/texmap/TextureMapper.h:
2354         * platform/graphics/texmap/TextureMapperGL.cpp:
2355         (WebCore::TextureMapperGL::clearColor):
2356         * platform/graphics/texmap/TextureMapperGL.h:
2357         (WebCore::TextureMapperGL::graphicsContext3D const): Deleted.
2358
2359 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2360
2361         RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc
2362         https://bugs.webkit.org/show_bug.cgi?id=175304
2363
2364         Reviewed by Tim Horton.
2365
2366         r210758 changed DataRef::get() from returning a pointer to a reference. This caused all the places
2367         in RenderStyle::diff() and related functions, where we intended to do a quick pointer comparison,
2368         to doing deep compares via operator!=. This made the code slightly slower.
2369
2370         Fix by exposing ptr() on DataRef and using it wherever we wish to do pointer comparison.
2371
2372         * rendering/style/DataRef.h:
2373         (WebCore::DataRef::ptr const):
2374         * rendering/style/RenderStyle.cpp:
2375         (WebCore::RenderStyle::inheritedDataShared const):
2376         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
2377         (WebCore::RenderStyle::changeRequiresLayout const):
2378         (WebCore::RenderStyle::changeRequiresRecompositeLayer const):
2379         (WebCore::RenderStyle::listStyleImage const): Expand the function onto multiple lines.
2380
2381 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2382
2383         Add a fast path for rotate() and rotateZ() transform parsing
2384         https://bugs.webkit.org/show_bug.cgi?id=175308
2385
2386         Reviewed by Zalan Bujtas.
2387
2388         Fast paths only existed for translate-related functions, matrix3d() and scale3d(). Add
2389         rotate() and rotateX(), which gives a small boost to one of the MotionMark tests.
2390
2391         * css/parser/CSSParserFastPaths.cpp:
2392         (WebCore::parseSimpleAngle):
2393         (WebCore::parseTransformAngleArgument):
2394         (WebCore::parseSimpleTransformValue):
2395         (WebCore::transformCanLikelyUseFastPath):
2396
2397 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2398
2399         Re-order the tests in RenderLayerCompositor::requiresCompositingLayer() for performance
2400         https://bugs.webkit.org/show_bug.cgi?id=175306
2401
2402         Reviewed by Tim Horton.
2403
2404         Re-order the tests for compositing reasons so that reasons more likely to happen are higher in the list.
2405
2406         * rendering/RenderLayerCompositor.cpp:
2407         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2408         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2409
2410 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2411
2412         Avoid a hash lookup in FilterInfo::remove()
2413         https://bugs.webkit.org/show_bug.cgi?id=175301
2414
2415         Reviewed by Sam Weinig.
2416
2417         FilterInfo::remove() always called map().remove(&layer)), even when layer.m_hasFilterInfo
2418         was false (and even asserted that layer.m_hasFilterInfo == map().contains(&layer)).
2419
2420         So we can early return if layer.m_hasFilterInfo is false.
2421
2422         * rendering/RenderLayerFilterInfo.cpp:
2423         (WebCore::RenderLayer::FilterInfo::getIfExists):
2424         (WebCore::RenderLayer::FilterInfo::remove):
2425
2426 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2427
2428         Make TransformOperation::type() non-virtual
2429         https://bugs.webkit.org/show_bug.cgi?id=175297
2430
2431         Reviewed by Sam Weinig.
2432
2433         Store the OperationType in the base class so that type() and isSameType() can
2434         be non-virtual.
2435
2436         Small perf win on some benchmarks.
2437
2438         * platform/graphics/transforms/IdentityTransformOperation.h:
2439         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2440         * platform/graphics/transforms/MatrixTransformOperation.h:
2441         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2442         * platform/graphics/transforms/RotateTransformOperation.cpp:
2443         (WebCore::RotateTransformOperation::blend):
2444         * platform/graphics/transforms/RotateTransformOperation.h:
2445         * platform/graphics/transforms/ScaleTransformOperation.cpp:
2446         (WebCore::ScaleTransformOperation::blend):
2447         * platform/graphics/transforms/ScaleTransformOperation.h:
2448         * platform/graphics/transforms/SkewTransformOperation.cpp:
2449         (WebCore::SkewTransformOperation::blend):
2450         * platform/graphics/transforms/SkewTransformOperation.h:
2451         * platform/graphics/transforms/TransformOperation.h:
2452         (WebCore::TransformOperation::TransformOperation):
2453         (WebCore::TransformOperation::type const):
2454         (WebCore::TransformOperation::isSameType const):
2455         * platform/graphics/transforms/TranslateTransformOperation.cpp:
2456         (WebCore::TranslateTransformOperation::blend):
2457         * platform/graphics/transforms/TranslateTransformOperation.h:
2458
2459 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2460
2461         Inline ~Color and Color::isExtended()
2462         https://bugs.webkit.org/show_bug.cgi?id=175293
2463
2464         Reviewed by Zalan Bujtas.
2465
2466         The Color destructor and Color::isExtended() show up on profiles, so inline them.
2467         Before r207265 the destructor was inlined.
2468         
2469         Also make sure that LengthSize::operator== is inlined, which it was not (according
2470         to profiles).
2471
2472         * platform/LengthSize.h:
2473         (WebCore::operator==):
2474         * platform/graphics/Color.cpp:
2475         (WebCore::Color::~Color): Deleted.
2476         (WebCore::Color::isExtended const): Deleted.
2477         * platform/graphics/Color.h:
2478         (WebCore::Color::~Color):
2479         (WebCore::Color::isExtended const):
2480
2481 2017-08-04  Brent Fulgham  <bfulgham@apple.com>
2482
2483         Implement the HTML5 same-origin restriction specification
2484         https://bugs.webkit.org/show_bug.cgi?id=175226
2485         <rdar://problem/11079948>
2486
2487         Reviewed by Chris Dumez.
2488
2489         Follow the algorithms defined in the HTML5 specification for relaxing
2490         the same-origin restriction. We were missing a few steps related to
2491         checking for public suffix and presence of a browsing context.
2492
2493         Tested by new TestWebKitAPI tests.
2494
2495         * dom/Document.cpp:
2496         (WebCore::Document::domainIsRegisterable): Added helper function.
2497         (WebCore::Document::setDomain):
2498
2499 2017-08-07  Devin Rousso  <drousso@apple.com>
2500
2501         Web Inspector: Preview Canvas path when viewing a recording
2502         https://bugs.webkit.org/show_bug.cgi?id=174967
2503
2504         Reviewed by Brian Burg.
2505
2506         Tests: fast/canvas/2d.currentPoint.html
2507                fast/canvas/2d.getPath.modification.html
2508                fast/canvas/2d.getPath.newobject.html
2509                fast/canvas/2d.setPath.html
2510
2511         * html/canvas/CanvasPath.idl:
2512         * html/canvas/CanvasPath.h:
2513         * html/canvas/CanvasPath.cpp:
2514         (WebCore::CanvasPath::currentX const):
2515         (WebCore::CanvasPath::currentY const):
2516
2517         * html/canvas/CanvasRenderingContext2D.idl:
2518         * html/canvas/CanvasRenderingContext2D.h:
2519         * html/canvas/CanvasRenderingContext2D.cpp:
2520         (WebCore::CanvasRenderingContext2D::setPath):
2521         (WebCore::CanvasRenderingContext2D::getPath const):
2522
2523         * page/RuntimeEnabledFeatures.h:
2524         (WebCore::RuntimeEnabledFeatures::setInspectorAdditionsEnabled):
2525         (WebCore::RuntimeEnabledFeatures::inspectorAdditionsEnabled const):
2526         Add runtime flag for added IDL items above so that they are only usable within the inspector
2527         process. The runtime flag is not enabled from anywhere else as of now.
2528
2529         * inspector/InspectorCanvas.cpp:
2530         (WebCore::InspectorCanvas::buildInitialState):
2531         Send current path as part of the InitialState.
2532         Drive-by: deduplicate more string values.
2533
2534 2017-08-07  Chris Dumez  <cdumez@apple.com>
2535
2536         Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest
2537         https://bugs.webkit.org/show_bug.cgi?id=175280
2538
2539         Reviewed by Youenn Fablet.
2540
2541         Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest. FetchBody
2542         for data extraction is really the only thing we need at the moment.
2543         The new code also properly sets the CORS mode, which will be needed for Bug 175264.
2544
2545         * Modules/beacon/NavigatorBeacon.cpp:
2546         (WebCore::NavigatorBeacon::sendBeacon):
2547
2548 2017-08-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2549
2550         -Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue
2551         https://bugs.webkit.org/show_bug.cgi?id=174469
2552         <rdar://problem/33311638>
2553
2554         Reviewed by Simon Fraser.
2555
2556         Add a RELEASE_ASSERT_NOT_REACHED to silence this warning.
2557
2558         * css/CSSComputedStyleDeclaration.cpp:
2559         (WebCore::ComputedStyleExtractor::propertyValue):
2560
2561 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
2562
2563         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
2564         https://bugs.webkit.org/show_bug.cgi?id=174919
2565
2566         Reviewed by Keith Miller.
2567
2568         No new tests because no change in behavior.
2569         
2570         Adapting to API changes - we now specify the AlignedMemoryAllocator differently and we need to be
2571         specific about which Gigacage we're using.
2572
2573         * bindings/js/WebCoreJSClientData.cpp:
2574         (WebCore::JSVMClientData::JSVMClientData):
2575         * platform/graphics/cocoa/GPUBufferMetal.mm:
2576         (WebCore::GPUBuffer::GPUBuffer):
2577
2578 2017-08-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2579
2580         [Curl] Add abstraction layer of cookie jar implementation for Curl port
2581         https://bugs.webkit.org/show_bug.cgi?id=174943
2582
2583         Reviewed by Brent Fulgham.
2584
2585         * platform/network/curl/CookieJarCurl.cpp:
2586         (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM):
2587         (WebCore::CookieJarCurlFileSystem::cookiesForDOM):
2588         (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue):
2589         (WebCore::CookieJarCurlFileSystem::cookiesEnabled):
2590         (WebCore::CookieJarCurlFileSystem::getRawCookies):
2591         (WebCore::CookieJarCurlFileSystem::deleteCookie):
2592         (WebCore::CookieJarCurlFileSystem::getHostnamesWithCookies):
2593         (WebCore::CookieJarCurlFileSystem::deleteCookiesForHostnames):
2594         (WebCore::CookieJarCurlFileSystem::deleteAllCookies):
2595         (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
2596         (WebCore::cookiesForDOM):
2597         (WebCore::setCookiesFromDOM):
2598         (WebCore::cookieRequestHeaderFieldValue):
2599         (WebCore::cookiesEnabled):
2600         (WebCore::getRawCookies):
2601         (WebCore::deleteCookie):
2602         (WebCore::getHostnamesWithCookies):
2603         (WebCore::deleteCookiesForHostnames):
2604         (WebCore::deleteAllCookies):
2605         (WebCore::deleteAllCookiesModifiedSince):
2606         * platform/network/curl/CookieJarCurl.h: Added.
2607         * platform/network/curl/CurlContext.cpp:
2608         * platform/network/curl/CurlContext.h:
2609         (WebCore::CurlContext::cookieJar):
2610
2611 2017-08-07  Brady Eidson  <beidson@apple.com>
2612
2613         Implement most of ServiceWorkerContainer::addRegistration.
2614         https://bugs.webkit.org/show_bug.cgi?id=175237
2615
2616         Reviewed by Andy Estes.
2617
2618         No new tests (Covered by changes to existing tests).
2619
2620         There's still so much supporting infrastructure to add with these early patches
2621         that I'm still moving them in baby steps for now, hence not implementing
2622         register() all in one shot.
2623         
2624         Things will start moving very quickly once we no longer need to add lots of new
2625         primitives in each change.
2626         
2627         * CMakeLists.txt:
2628         * DerivedSources.make:
2629         * WebCore.xcodeproj/project.pbxproj:
2630         
2631         * page/DOMWindow.cpp:
2632         (WebCore::DOMWindow::navigator const):
2633         
2634         * page/Navigator.cpp:
2635         (WebCore::Navigator::Navigator): Make the constructor take a ScriptExecutionContext for 
2636           creation of objects where its import (e.g. ServiceWorkerContainer).
2637         * page/Navigator.h:
2638
2639         * page/WorkerNavigator.cpp:
2640         (WebCore::WorkerNavigator::WorkerNavigator): Ditto.
2641         * page/WorkerNavigator.h:
2642
2643         * page/NavigatorBase.cpp:
2644         (WebCore::NavigatorBase::NavigatorBase): Create the ServiceWorkerContainer upfront with
2645           the passed-in ScriptExecutionContext.
2646         (WebCore::NavigatorBase::serviceWorker):
2647         * page/NavigatorBase.h:
2648         
2649         Make ServiceWorkerContainer into an ActiveDOMObject. This will eventually be necessary for
2650         Document suspension reasons, but is also necessary because it also needs to be a
2651         ContextDestructionObserver (which ActiveDOMObject is):
2652         * workers/ServiceWorkerContainer.cpp:
2653         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2654         (WebCore::ServiceWorkerContainer::ready):
2655         (WebCore::ServiceWorkerContainer::addRegistration):
2656         (WebCore::ServiceWorkerContainer::getRegistration):
2657         (WebCore::ServiceWorkerContainer::getRegistrations):
2658         (WebCore::ServiceWorkerContainer::activeDOMObjectName const):
2659         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
2660         (WebCore::rejectLater): Deleted.
2661         (WebCore::ServiceWorkerContainer::eventTargetInterface const): Deleted.
2662         (WebCore::ServiceWorkerContainer::scriptExecutionContext const): Deleted.
2663         * workers/ServiceWorkerContainer.h:
2664         * workers/ServiceWorkerContainer.idl:
2665
2666         Add updateViaCache, etc:
2667         * workers/ServiceWorkerRegistration.cpp:
2668         (WebCore::ServiceWorkerRegistration::updateViaCache const):
2669         (WebCore::ServiceWorkerRegistration::update):
2670         (WebCore::ServiceWorkerRegistration::unregister):
2671         * workers/ServiceWorkerRegistration.h:
2672         * workers/ServiceWorkerRegistration.idl:
2673
2674         * workers/ServiceWorkerUpdateViaCache.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2675         * workers/ServiceWorkerUpdateViaCache.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2676
2677         * workers/WorkerGlobalScope.cpp:
2678         (WebCore::WorkerGlobalScope::navigator):
2679         (WebCore::WorkerGlobalScope::navigator const): Deleted.
2680         * workers/WorkerGlobalScope.h:
2681
2682         * workers/WorkerType.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2683         * workers/WorkerType.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2684
2685 2017-08-07  Ryan Haddad  <ryanhaddad@apple.com>
2686
2687         Unreviewed, rolling out r220299.
2688
2689         This change caused LayoutTest inspector/dom-debugger/dom-
2690         breakpoints.html to fail.
2691
2692         Reverted changeset:
2693
2694         "Web Inspector: capture async stack trace when workers/main
2695         context posts a message"
2696         https://bugs.webkit.org/show_bug.cgi?id=167084
2697         http://trac.webkit.org/changeset/220299
2698
2699 2017-08-07  Brian Burg  <bburg@apple.com>
2700
2701         Cleanup: simplify WebSockets code for RuntimeEnabledFeatures
2702         https://bugs.webkit.org/show_bug.cgi?id=175190
2703
2704         Reviewed by Sam Weinig.
2705
2706         This runtime enabled flag is not used by anything. It was added
2707         for V8 in <https://bugs.webkit.org/show_bug.cgi?id=29896>.
2708
2709         * Modules/websockets/WebSocket.cpp:
2710         (WebCore::WebSocket::setIsAvailable): Deleted.
2711         (WebCore::WebSocket::isAvailable): Deleted.
2712         * Modules/websockets/WebSocket.h:
2713         * Modules/websockets/WebSocket.idl:
2714         * page/RuntimeEnabledFeatures.cpp:
2715         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): Deleted.
2716         * page/RuntimeEnabledFeatures.h:
2717
2718 2017-08-07  Brian Burg  <bburg@apple.com>
2719
2720         Remove CANVAS_PATH compilation guard
2721         https://bugs.webkit.org/show_bug.cgi?id=175207
2722
2723         Reviewed by Sam Weinig.
2724
2725         * Configurations/FeatureDefines.xcconfig:
2726         * html/canvas/DOMPath.h:
2727         * html/canvas/DOMPath.idl:
2728
2729 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2730
2731         [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy.
2732         https://bugs.webkit.org/show_bug.cgi?id=175125
2733
2734         Reviewed by Michael Catanzaro.
2735
2736         No change of behavior, covered by existing tests.
2737
2738         * CMakeLists.txt: Instead of negating 3 times the use of libepoxy
2739         move the logic for (E)GL detection inside an else() block.
2740
2741 2017-08-07  Antti Koivisto  <antti@apple.com>
2742
2743         REGRESSION (r219121): Airmail 3 prints header part only.
2744         https://bugs.webkit.org/show_bug.cgi?id=175258
2745         <rdar://problem/33601173>
2746
2747         Reviewed by Andreas Kling.
2748
2749         When a WK1 WebViw is printed via AppKit view hierarchy it won't explictly set the page width
2750         but uses the existing width. r219121 assumes that all printing code paths set the page width.
2751
2752         No test, there appears to be no good way to test AppKit printing behaviors without adding complicated
2753         new testing infrastructure.
2754
2755         * rendering/RenderView.cpp:
2756         (WebCore::RenderView::layout):
2757
2758             If we are in printing layout and don't have page width set yet then use the current view width.
2759             This matches the behavior prior r219121.
2760
2761 2017-08-05  Youenn Fablet  <youenn@apple.com>
2762
2763         [Fetch API] Response should keep all ResourceResponse information
2764         https://bugs.webkit.org/show_bug.cgi?id=175099
2765
2766         Reviewed by Sam Weinig.
2767
2768         No change of behavior, covered by existing tests.
2769
2770         Disabling filtering of resource response at DocumentThreadableLoader for fetch API and doing the filtering at FetchResponse level.
2771         This requires passing the tainting parameter to FetchResponse. For that purpose, we store the tainting on the ResourceResponse itself.
2772         This allows mimicking the concept of internal response from the fetch spec.
2773         This might be useful for future developments related to caching the responses.
2774
2775         The body is now also stored in FetchResponse so a flag is added to ensure we only expose the body if allowed.
2776
2777         Changing storage of opaque redirect information to keep the redirection information in the response.
2778
2779         * Modules/fetch/FetchBodyOwner.cpp:
2780         (WebCore::FetchBodyOwner::blob):
2781         (WebCore::FetchBodyOwner::consumeNullBody):
2782         * Modules/fetch/FetchBodyOwner.h:
2783         * Modules/fetch/FetchLoader.cpp:
2784         (WebCore::FetchLoader::start):
2785         * Modules/fetch/FetchResponse.cpp:
2786         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
2787         (WebCore::FetchResponse::consume):
2788         (WebCore::FetchResponse::consumeBodyAsStream):
2789         (WebCore::FetchResponse::createReadableStreamSource):
2790         * Modules/fetch/FetchResponse.h:
2791         * loader/DocumentThreadableLoader.cpp:
2792         (WebCore::DocumentThreadableLoader::responseReceived):
2793         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2794         (WebCore::DocumentThreadableLoader::didFinishLoading):
2795         (WebCore::DocumentThreadableLoader::loadRequest):
2796         * loader/DocumentThreadableLoader.h:
2797         * loader/SubresourceLoader.cpp:
2798         (WebCore::SubresourceLoader::willSendRequestInternal):
2799         * loader/cache/CachedResource.cpp:
2800         (WebCore::CachedResource::setBodyDataFrom):
2801         (WebCore::CachedResource::setResponse):
2802         * platform/network/ResourceResponseBase.cpp:
2803         (WebCore::ResourceResponseBase::crossThreadData const):
2804         (WebCore::ResourceResponseBase::fromCrossThreadData):
2805         (WebCore::ResourceResponseBase::filter):
2806         * platform/network/ResourceResponseBase.h:
2807         (WebCore::ResourceResponseBase::setTainting):
2808         (WebCore::ResourceResponseBase::tainting const):
2809         (WebCore::ResourceResponseBase::encode const):
2810         (WebCore::ResourceResponseBase::decode):
2811
2812 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2813
2814         WebDriver: use in-view center point for clicks instead of bounding box center point
2815         https://bugs.webkit.org/show_bug.cgi?id=174863
2816
2817         Reviewed by Simon Fraser.
2818
2819         Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add
2820         FrameView::clientToDocumentPoint().
2821
2822         * WebCore.xcodeproj/project.pbxproj:
2823         * dom/Element.h:
2824         * page/FrameView.h:
2825         * platform/graphics/FloatPoint.h:
2826
2827 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2828
2829         getClientRects doesn't work with list box option elements
2830         https://bugs.webkit.org/show_bug.cgi?id=175016
2831
2832         Reviewed by Darin Adler.
2833
2834         Since HTMLOptionElement and HTMLOptGroupElement don't have a renderer, we are always returning an empty list
2835         from getClientRects. This is working fine in both chromium and firefox, option elements return its own bounding
2836         box and group elements return the bounding box of the group label and all its children items.
2837
2838         Test: fast/dom/HTMLSelectElement/listbox-items-client-rects.html
2839
2840         * dom/Element.cpp:
2841         (WebCore::listBoxElementBoundingBox): Helper function to return the bounding box of a HTMLOptionElement or
2842         HTMLOptGroupElement element.
2843         (WebCore::Element::getClientRects): Use listBoxElementBoundingBox() in case of HTMLOptionElement or
2844         HTMLOptGroupElement.
2845         (WebCore::Element::boundingClientRect): Ditto.
2846
2847 2017-08-04  Youenn Fablet  <youenn@apple.com>
2848
2849         [Cache API] Add Cache and CacheStorage IDL definitions
2850         https://bugs.webkit.org/show_bug.cgi?id=175201
2851
2852         Reviewed by Brady Eidson.
2853
2854         Covered by activated tests.
2855         Adding IDLs as per https://www.w3.org/TR/service-workers-1/#idl-index.
2856         Implementation is guarded by a runtime flag which is off by default.
2857         It is off for DRT but on for WTR.
2858
2859         * CMakeLists.txt:
2860         * DerivedSources.make:
2861         * Modules/cache/Cache.cpp: Added.
2862         (WebCore::Cache::match):
2863         (WebCore::Cache::matchAll):
2864         (WebCore::Cache::add):
2865         (WebCore::Cache::addAll):
2866         (WebCore::Cache::put):
2867         (WebCore::Cache::remove):
2868         (WebCore::Cache::keys):
2869         * Modules/cache/Cache.h: Added.
2870         (WebCore::Cache::create):
2871         (WebCore::Cache::Cache):
2872         * Modules/cache/Cache.idl: Added.
2873         * Modules/cache/CacheQueryOptions.h: Added.
2874         * Modules/cache/CacheQueryOptions.idl: Added.
2875         * Modules/cache/CacheStorage.cpp: Added.
2876         (WebCore::CacheStorage::match):
2877         (WebCore::CacheStorage::has):
2878         (WebCore::CacheStorage::open):
2879         (WebCore::CacheStorage::remove):
2880         (WebCore::CacheStorage::keys):
2881         * Modules/cache/CacheStorage.h: Added.
2882         (WebCore::CacheStorage::create):
2883         * Modules/cache/CacheStorage.idl: Added.
2884         * Modules/cache/DOMWindowCaches.cpp: Added.
2885         (WebCore::DOMWindowCaches::DOMWindowCaches):
2886         (WebCore::DOMWindowCaches::supplementName):
2887         (WebCore::DOMWindowCaches::from):
2888         (WebCore::DOMWindowCaches::caches):
2889         (WebCore::DOMWindowCaches::caches const):
2890         * Modules/cache/DOMWindowCaches.h: Added.
2891         * Modules/cache/DOMWindowCaches.idl: Added.
2892         * Modules/cache/WorkerGlobalScopeCaches.cpp: Added.
2893         (WebCore::WorkerGlobalScopeCaches::supplementName):
2894         (WebCore::WorkerGlobalScopeCaches::from):
2895         (WebCore::WorkerGlobalScopeCaches::caches):
2896         (WebCore::WorkerGlobalScopeCaches::caches const):
2897         * Modules/cache/WorkerGlobalScopeCaches.h: Added.
2898         * Modules/cache/WorkerGlobalScopeCaches.idl: Added.
2899         * WebCore.xcodeproj/project.pbxproj:
2900         * page/RuntimeEnabledFeatures.h:
2901         (WebCore::RuntimeEnabledFeatures::setCacheAPIEnabled):
2902         (WebCore::RuntimeEnabledFeatures::cacheAPIEnabled const):
2903
2904 2017-08-04  Brady Eidson  <beidson@apple.com>
2905
2906         Have navigator.serviceWorker() actually return a ServiceWorkerContainer object.
2907         https://bugs.webkit.org/show_bug.cgi?id=175215
2908
2909         Reviewed by Youenn Fablet.
2910
2911         * page/NavigatorBase.cpp:
2912         (WebCore::NavigatorBase::serviceWorker): Actually create and remember an object.
2913         * page/NavigatorBase.h:
2914
2915         * workers/ServiceWorkerContainer.cpp:
2916         (WebCore::rejectLater): Asynchronously reject the given promise with an error message.
2917         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2918         (WebCore::ServiceWorkerContainer::refEventTarget): Ref the underlying Navigator.
2919         (WebCore::ServiceWorkerContainer::derefEventTarget): Deref the underlying Navigator.
2920         (WebCore::ServiceWorkerContainer::ready): rejectLater the promise.
2921         (WebCore::ServiceWorkerContainer::addRegistration): Ditto.
2922         (WebCore::ServiceWorkerContainer::getRegistration): Ditto.
2923         (WebCore::ServiceWorkerContainer::getRegistrations): Ditto.
2924         * workers/ServiceWorkerContainer.h:
2925
2926 2017-08-04  Chris Dumez  <cdumez@apple.com>
2927
2928         [Beacon] Update sendBeacon to use the CachedResourceLoader
2929         https://bugs.webkit.org/show_bug.cgi?id=175192
2930         <rdar://problem/33725923>
2931
2932         Reviewed by Youenn Fablet.
2933
2934         Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of
2935         the PingLoader. This gets us closer to the specification which is based on
2936         Fetch and reduces code duplication. This also fixes an issue where our
2937         Origin header was not properly set on Beacon resquests.
2938
2939         In a follow-up, we will implement in CachedResourceLoader Fetch's quota for
2940         inflight keepalive requests which is needed to fully support sendBeacon().
2941
2942         * Modules/beacon/NavigatorBeacon.cpp:
2943         (WebCore::NavigatorBeacon::sendBeacon):
2944         * Modules/beacon/NavigatorBeacon.h:
2945         * loader/LinkLoader.cpp:
2946         (WebCore::createLinkPreloadResourceClient):
2947         * loader/PingLoader.cpp:
2948         * loader/PingLoader.h:
2949         * loader/ResourceLoadInfo.cpp:
2950         (WebCore::toResourceType):
2951         * loader/SubresourceLoader.cpp:
2952         (WebCore::logResourceLoaded):
2953         * loader/cache/CachedResource.cpp:
2954         (WebCore::CachedResource::defaultPriorityForResourceType):
2955         (WebCore::CachedResource::load):
2956         * loader/cache/CachedResource.h:
2957         * loader/cache/CachedResourceLoader.cpp:
2958         (WebCore::createResource):
2959         (WebCore::CachedResourceLoader::requestBeaconResource):
2960         (WebCore::contentTypeFromResourceType):
2961         (WebCore::CachedResourceLoader::checkInsecureContent const):
2962         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
2963         (WebCore::isResourceSuitableForDirectReuse):
2964         * loader/cache/CachedResourceLoader.h:
2965
2966 2017-08-04  John Wilander  <wilander@apple.com>
2967
2968         Resource Load Statistics: Report user interaction immediately, but only when needed
2969         https://bugs.webkit.org/show_bug.cgi?id=175090
2970         <rdar://problem/33685546>
2971
2972         Reviewed by Chris Dumez.
2973
2974         Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
2975
2976         * loader/ResourceLoadObserver.cpp:
2977         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
2978         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2979             Now tells the UI process immediately but also records that it has
2980             done so to avoid doing it when not needed.
2981         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
2982             Conditional throttling gone, now always throttles.
2983         (WebCore::ResourceLoadObserver::notifyObserver):
2984             Renamed from ResourceLoadObserver::notificationTimerFired().
2985         (WebCore::ResourceLoadObserver::clearState):
2986             New function to allow the test runner to reset the web process'
2987             statistics state now that we keep track of whether or not we've
2988             reported user interaction to the UI process.
2989         (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
2990         (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
2991         * loader/ResourceLoadObserver.h:
2992         (): Deleted.
2993         * testing/Internals.cpp:
2994         (WebCore::Internals::resetToConsistentState):
2995         (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
2996             No longer needed since user interaction is always communicated
2997             immediately.
2998         * testing/Internals.h:
2999         * testing/Internals.idl:
3000
3001 2017-08-04  Matt Baker  <mattbaker@apple.com>
3002
3003         Web Inspector: capture async stack trace when workers/main context posts a message
3004         https://bugs.webkit.org/show_bug.cgi?id=167084
3005         <rdar://problem/30033673>
3006
3007         Reviewed by Brian Burg.
3008
3009         Add instrumentation to DOMWindow to support showing asynchronous
3010         stack traces when the debugger pauses in a MessageEvent handler.
3011
3012         Test: inspector/debugger/async-stack-trace.html
3013
3014         * inspector/InspectorInstrumentation.cpp:
3015         (WebCore::InspectorInstrumentation::didPostMessageImpl):
3016         (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
3017         (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
3018         (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
3019
3020         * inspector/InspectorInstrumentation.h:
3021         (WebCore::InspectorInstrumentation::didPostMessage):
3022         (WebCore::InspectorInstrumentation::didFailPostMessage):
3023         (WebCore::InspectorInstrumentation::willDispatchPostMessage):
3024         (WebCore::InspectorInstrumentation::didDispatchPostMessage):
3025
3026         * inspector/PageDebuggerAgent.cpp:
3027         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
3028         (WebCore::PageDebuggerAgent::didPostMessage):
3029         (WebCore::PageDebuggerAgent::didFailPostMessage):
3030         (WebCore::PageDebuggerAgent::willDispatchPostMessage):
3031         (WebCore::PageDebuggerAgent::didDispatchPostMessage):
3032         * inspector/PageDebuggerAgent.h:
3033
3034         * page/DOMWindow.cpp:
3035         (WebCore::DOMWindow::postMessage):
3036         (WebCore::DOMWindow::postMessageTimerFired):
3037
3038 2017-08-04  Devin Rousso  <drousso@apple.com>
3039
3040         Web Inspector: add source view for WebGL shader programs
3041         https://bugs.webkit.org/show_bug.cgi?id=138593
3042         <rdar://problem/18936194>
3043
3044         Reviewed by Matt Baker.
3045
3046         Test: inspector/canvas/requestShaderSource.html
3047
3048         * inspector/InspectorCanvasAgent.h:
3049         * inspector/InspectorCanvasAgent.cpp:
3050         (WebCore::InspectorCanvasAgent::requestShaderSource):
3051
3052         * inspector/InspectorShaderProgram.h:
3053         * inspector/InspectorShaderProgram.cpp:
3054         (WebCore::InspectorShaderProgram::shaderForType):
3055
3056 2017-08-04  Matt Lewis  <jlewis3@apple.com>
3057
3058         Unreviewed, rolling out r220288.
3059
3060         This broke multiple builds.
3061
3062         Reverted changeset:
3063
3064         "Use MPAVRoutingController instead of deprecated versions."
3065         https://bugs.webkit.org/show_bug.cgi?id=175063
3066         http://trac.webkit.org/changeset/220288
3067
3068 2017-08-03  Filip Pizlo  <fpizlo@apple.com>
3069
3070         The allocator used to allocate memory for MarkedBlocks and LargeAllocations should not be the Subspace itself
3071         https://bugs.webkit.org/show_bug.cgi?id=175141
3072
3073         Reviewed by Mark Lam.
3074
3075         No new tests because no new behavior.
3076         
3077         Just adapting to an API change.
3078
3079         * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Added.
3080         * bindings/js/WebCoreJSClientData.cpp:
3081         (WebCore::JSVMClientData::JSVMClientData):
3082
3083 2017-08-04  Chris Dumez  <cdumez@apple.com>
3084
3085         Match newly-clarified spec on textarea defaultValue/value/child text content
3086         https://bugs.webkit.org/show_bug.cgi?id=173878
3087
3088         Reviewed by Darin Adler.
3089
3090         Update HTMLTextArea.defaultValue to match align with other browsers and match the
3091         latest HTML specification:
3092         - https://html.spec.whatwg.org/#dom-textarea-defaultvalue
3093
3094         The defaultValue getter should return the child text content:
3095         - https://dom.spec.whatwg.org/#concept-child-text-content
3096         Our code was traversing all Text descendants, not just the children.
3097
3098         The defaultValue setter should act as the setter of the Element's textContent
3099         IDL attribute. Previously, we had a custom logic that was only removing the
3100         text children.
3101
3102         Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html
3103
3104         * dom/ScriptElement.cpp:
3105         (WebCore::ScriptElement::scriptContent const):
3106         * dom/TextNodeTraversal.cpp:
3107         (WebCore::TextNodeTraversal::childTextContent):
3108         * dom/TextNodeTraversal.h:
3109         * html/HTMLTextAreaElement.cpp:
3110         (WebCore::HTMLTextAreaElement::defaultValue const):
3111         (WebCore::HTMLTextAreaElement::setDefaultValue):
3112         * html/HTMLTitleElement.cpp:
3113         (WebCore::HTMLTitleElement::text const):
3114
3115 2017-08-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
3116
3117         RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
3118         https://bugs.webkit.org/show_bug.cgi?id=174874
3119         <rdar://problem/33530130>
3120
3121         Reviewed by Simon Fraser.
3122
3123         If an <img> element has a non-CachedImage content data, e.g. -webkit-named-image,
3124         RenderImageResourceStyleImage will be created and  attached to the RenderImage.
3125         RenderImageResourceStyleImage::m_cachedImage will be set to null at the 
3126         beginning because the m_styleImage->isCachedImage() is false in this case.
3127         When ImageLoader finishes loading the url of the src attribute,
3128         RenderImageResource::setCachedImage() will be called to set m_cachedImage.
3129
3130         A crash will happen when the RenderImage is destroyed. Destroying the 
3131         RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
3132         m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
3133         which ends up calling CSSNamedImageValue::image() which returns a null pointer
3134         because the size is empty. RenderImageResourceStyleImage::shutdown() calls
3135         image()->stopAnimation() without checking the return value of image().
3136
3137         Another crash will happen later when deleting the CachedImage from the memory
3138         cache if CachedImage::canDestroyDecodedData() is called because the client
3139         it gets from m_clients is a freed pointer. This happens because RenderImageResourceStyleImage
3140         has m_styleImage of type StyleGeneratedImage but its m_cachedImage is set
3141         by RenderImageResource::setCachedImage(). When RenderImageResourceStyleImage::shutdown()
3142         is called, it calls  StyleGeneratedImage::removeClient() which does not 
3143         know anything about RenderImageResourceStyleImage::m_cachedImage. So we 
3144         end up having a freed pointer in the m_clients of the CachedImage.
3145
3146         Test: fast/images/image-element-image-content-data.html
3147
3148         * rendering/RenderImageResourceStyleImage.cpp:
3149         (WebCore::RenderImageResourceStyleImage::shutdown):  Revert back the changes
3150         of r208511 in this function. Add a call to image()->stopAnimation() without
3151         checking the return of image() since it will return the nullImage() if
3152         the image not available. There is no need to check m_cachedImage before 
3153         calling image() because image() does not check or access m_cachedImage.
3154
3155         If m_styleImage is not a CachedStyleImage but m_cachedImage is not null,
3156         we need to remove m_renderer from the set of the clients of this m_cachedImage.
3157
3158         (WebCore::RenderImageResourceStyleImage::image const): The base class method
3159         RenderImageResource::image() returns the nullImage() if the image not
3160         available. This is because CachedImage::imageForRenderer() returns
3161         the nullImage() if the image is not available; see CachedImage.h. We should
3162         do the same for the derived class for consistency.
3163
3164 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
3165
3166         Use MPAVRoutingController instead of deprecated versions.
3167         https://bugs.webkit.org/show_bug.cgi?id=175063
3168
3169         Reviewed by Tim Horton.
3170
3171         No new tests because no behavior change. This uses a different platform class to present
3172         an interface.
3173
3174         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
3175         Add MPMediaControlsViewController.
3176
3177         * platform/spi/ios/MediaPlayerSPI.h:
3178
3179 2017-08-04  Matt Baker  <mattbaker@apple.com>
3180
3181         Web Inspector: REGRESSION (r220233): Check for null pointer passed to WebGLRenderingContextBase::deleteProgram
3182         https://bugs.webkit.org/show_bug.cgi?id=175196
3183         <rdar://problem/33727603>
3184
3185         Reviewed by Devin Rousso.
3186
3187         * html/canvas/WebGLRenderingContextBase.cpp:
3188         (WebCore::WebGLRenderingContextBase::deleteProgram):
3189
3190 2017-08-04  Matt Lewis  <jlewis3@apple.com>
3191
3192         Unreviewed, rolling out r220271.
3193
3194         Rolling out due to Layout Test failing on iOS Simulator.
3195
3196         Reverted changeset:
3197
3198         "Remove STREAMS_API compilation guard"
3199         https://bugs.webkit.org/show_bug.cgi?id=175165
3200         http://trac.webkit.org/changeset/220271
3201
3202 2017-08-03  Sam Weinig  <sam@webkit.org>
3203
3204         [Cleanup] Remove ScriptGlobalObject
3205         https://bugs.webkit.org/show_bug.cgi?id=175173
3206
3207         Reviewed by Darin Adler.
3208
3209         ScriptGlobalObject's two functions were only being used in
3210         four places. Three of those uses (ScriptGlobalObject::set in 
3211         InspectorFrontendClientLocal, WebInspectorUI, and RemoteWebInspectorUI)
3212         were merged into the new function addSelfToGlobalObjectInWorld on
3213         InspectorFrontendHost. The remaining function (ScriptGlobalObject::get
3214         in InspectorFrontendHost) was easily inlined.
3215
3216         * CMakeLists.txt:
3217         * WebCore.xcodeproj/project.pbxproj:
3218         * bindings/js/JSBindingsAllInOne.cpp:
3219         * bindings/js/ScriptGlobalObject.cpp: Removed.
3220         * bindings/js/ScriptGlobalObject.h: Removed.
3221         Removed ScriptGlobalObject.
3222
3223         * inspector/InspectorFrontendClientLocal.cpp:
3224         (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
3225         Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.
3226
3227         * inspector/InspectorFrontendHost.h:
3228         * inspector/InspectorFrontendHost.cpp:
3229         (WebCore::InspectorFrontendHost::showContextMenu):
3230         Inline ScriptGlobalObject::get.
3231
3232         (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
3233         Add helper which inlines ScriptGlobalObject::set and works
3234         as a helper for the three inspector frontends.
3235
3236 2017-08-04  Ryan Haddad  <ryanhaddad@apple.com>
3237
3238         Unreviewed, rolling out r220268.
3239
3240         This change caused assertion failures on macOS and iOS Debug
3241         WK2.
3242
3243         Reverted changeset:
3244
3245         "Resource Load Statistics: Report user interaction
3246         immediately, but only when needed"
3247         https://bugs.webkit.org/show_bug.cgi?id=175090
3248         http://trac.webkit.org/changeset/220268
3249
3250 2017-08-04  Youenn Fablet  <youenn@apple.com>
3251
3252         Remove STREAMS_API compilation guard
3253         https://bugs.webkit.org/show_bug.cgi?id=175165
3254
3255         Reviewed by Darin Adler.
3256
3257         No change of behavior.
3258
3259         * Configurations/FeatureDefines.xcconfig:
3260         * Modules/fetch/FetchBody.cpp:
3261         (WebCore::FetchBody::consumeAsStream):
3262         * Modules/fetch/FetchBody.h:
3263         * Modules/fetch/FetchBodyOwner.cpp:
3264         (WebCore::FetchBodyOwner::isDisturbedOrLocked const):
3265         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
3266         (WebCore::FetchBodyOwner::blobLoadingFailed):
3267         (WebCore::FetchBodyOwner::blobChunk):
3268         * Modules/fetch/FetchBodyOwner.h:
3269         * Modules/fetch/FetchResponse.cpp:
3270         (WebCore::FetchResponse::BodyLoader::didSucceed):
3271         (WebCore::FetchResponse::BodyLoader::didFail):
3272         (WebCore::FetchResponse::BodyLoader::didReceiveData):
3273         * Modules/fetch/FetchResponse.h:
3274         * Modules/fetch/FetchResponse.idl:
3275         * Modules/fetch/FetchResponse.js:
3276         (initializeFetchResponse):
3277         * Modules/fetch/FetchResponseSource.cpp:
3278         * Modules/fetch/FetchResponseSource.h:
3279         * Modules/streams/ByteLengthQueuingStrategy.idl:
3280         * Modules/streams/ByteLengthQueuingStrategy.js:
3281         * Modules/streams/CountQueuingStrategy.idl:
3282         * Modules/streams/CountQueuingStrategy.js:
3283         * Modules/streams/ReadableByteStreamController.idl:
3284         * Modules/streams/ReadableByteStreamController.js:
3285         * Modules/streams/ReadableByteStreamInternals.js:
3286         * Modules/streams/ReadableStream.idl:
3287         * Modules/streams/ReadableStream.js:
3288         * Modules/streams/ReadableStreamBYOBReader.idl:
3289         * Modules/streams/ReadableStreamBYOBReader.js:
3290         * Modules/streams/ReadableStreamBYOBRequest.idl:
3291         * Modules/streams/ReadableStreamBYOBRequest.js:
3292         * Modules/streams/ReadableStreamDefaultController.idl:
3293         * Modules/streams/ReadableStreamDefaultController.js:
3294         * Modules/streams/ReadableStreamDefaultReader.idl:
3295         * Modules/streams/ReadableStreamDefaultReader.js:
3296         * Modules/streams/ReadableStreamInternals.js:
3297         * Modules/streams/ReadableStreamSource.h:
3298         * Modules/streams/ReadableStreamSource.idl:
3299         * Modules/streams/StreamInternals.js:
3300         * Modules/streams/WritableStream.idl:
3301         * Modules/streams/WritableStream.js:
3302         * Modules/streams/WritableStreamInternals.js:
3303         * bindings/js/JSDOMGlobalObject.cpp:
3304         (WebCore::isReadableByteStreamAPIEnabled):
3305         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3306         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
3307         * bindings/js/JSReadableStreamPrivateConstructors.h:
3308         * bindings/js/JSReadableStreamSourceCustom.cpp:
3309         * bindings/js/ReadableStreamDefaultController.cpp:
3310         * bindings/js/ReadableStreamDefaultController.h:
3311         * page/RuntimeEnabledFeatures.h:
3312         * testing/Internals.cpp:
3313         * testing/Internals.h:
3314         * testing/Internals.idl:
3315
3316 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
3317
3318         [EME][GStreamer] Register ClearKey CDMFactory
3319         https://bugs.webkit.org/show_bug.cgi?id=175136
3320
3321         Reviewed by Xabier Rodriguez-Calvar.
3322
3323         Register the ClearKey CDM factory in CDMFactoryGStreamer. A CDMFactoryClearKey
3324         singleton object is introduced and used for that registration.
3325
3326         The basic CDMFactoryClearKey and CDMPrivateClearKey methods are implemented,
3327         marking `org.w3.clearkey` as the supported key system and `keyids` as the
3328         supported init data type. Additional logic around key system configurations,
3329         distinctive identifiers, persistent state and related restrictions and
3330         requirements is implemented.
3331
3332         This improves the ClearKey EME tests a bit, now progressing to the point of
3333         failing with a NotAllowedError exception due to the CDMInstance object failing
3334         to properly initialize because of missing implementation.
3335
3336         No new tests -- relevant tests have underlying baselines updated to reflect
3337         changes in behavior.
3338
3339         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3340         (WebCore::CDMFactoryClearKey::singleton):
3341         (WebCore::CDMFactoryClearKey::supportsKeySystem):
3342         (WebCore::CDMPrivateClearKey::supportsInitDataType const):
3343         (WebCore::CDMPrivateClearKey::supportsConfiguration const):
3344         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
3345         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
3346         (WebCore::CDMPrivateClearKey::supportsRobustness const):
3347         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement const):
3348         (WebCore::CDMPrivateClearKey::persistentStateRequirement const):
3349         * platform/encryptedmedia/clearkey/CDMClearKey.h:
3350         * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp:
3351         (WebCore::CDMFactory::platformRegisterFactories):
3352
3353 2017-08-04  John Wilander  <wilander@apple.com>
3354
3355         Resource Load Statistics: Report user interaction immediately, but only when needed
3356         https://bugs.webkit.org/show_bug.cgi?id=175090
3357         <rdar://problem/33685546>
3358
3359         Reviewed by Chris Dumez.
3360
3361         Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
3362
3363         * loader/ResourceLoadObserver.cpp:
3364         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
3365         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3366             Now tells the UI process immediately but also records that it has
3367             done so to avoid doing it when not needed.
3368         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
3369             Conditional throttling gone, now always throttles.
3370         (WebCore::ResourceLoadObserver::notifyObserver):
3371             Renamed from ResourceLoadObserver::notificationTimerFired().
3372         (WebCore::ResourceLoadObserver::clearState):
3373             New function to allow the test runner to reset the web process'
3374             statistics state now that we keep track of whether or not we've
3375             reported user interaction to the UI process.
3376         (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
3377         (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
3378         * loader/ResourceLoadObserver.h:
3379         (): Deleted.
3380         * testing/Internals.cpp:
3381         (WebCore::Internals::resetToConsistentState):
3382         (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
3383             No longer needed since user interaction is always communicated
3384             immediately.
3385         * testing/Internals.h:
3386         * testing/Internals.idl:
3387
3388 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
3389
3390         [EME] Push CDMFactory into the platform layer
3391         https://bugs.webkit.org/show_bug.cgi?id=175129
3392
3393         Reviewed by Xabier Rodriguez-Calvar.
3394
3395         This is a follow-up to r219678 that moved the majority of CDM abstraction
3396         classes into the platform layer, but missed the CDMFactory class.
3397
3398         The CDMFactory abstraction is now also placed in the platform layer. Only
3399         change to the interface is that the createCDM() method can't accept a CDM
3400         object reference anymore since that class is cemented into the WebCore
3401         layer, and no current implementation used it anyway.
3402
3403         Additionally, the static Vector object of registered factories is moved
3404         under the CDMFactory class, along with the register and unregister
3405         functions. The platformRegisterFactories() function is added to allow for
3406         platform-specific factory registrations to occur when the registered
3407         factories are queried for the first time. Empty implementation for this
3408         function is provided for non-GStreamer platforms, while for GStreamer
3409         the implementation is kept in CDMFactoryGStreamer.cpp. It's still empty
3410         for now, but it will register the ClearKey factory there in the near
3411         future.
3412
3413         No new tests -- none affected, only refactoring.
3414
3415         * CMakeLists.txt:
3416         * Modules/encryptedmedia/CDM.cpp:
3417         (WebCore::createCDMPrivateForKeySystem):
3418         (WebCore::CDM::supportsKeySystem):
3419         (WebCore::CDM::CDM):
3420         (): Deleted.
3421         (WebCore::CDM::registerCDMFactory): Deleted.
3422         (WebCore::CDM::unregisterCDMFactory): Deleted.
3423         * Modules/encryptedmedia/CDM.h:
3424         (WebCore::CDMFactory::~CDMFactory): Deleted.
3425         * PlatformWPE.cmake:
3426         * platform/GStreamer.cmake:
3427         * platform/encryptedmedia/CDMFactory.cpp: Added.
3428         (WebCore::CDMFactory::registerFactory):
3429         (WebCore::CDMFactory::unregisterFactory):
3430         (WebCore::CDMFactory::platformRegisterFactories):
3431         * platform/encryptedmedia/CDMFactory.h: Added.
3432         (WebCore::CDMFactory::~CDMFactory):
3433         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3434         (WebCore::CDMFactoryClearKey::createCDM):
3435         * platform/encryptedmedia/clearkey/CDMClearKey.h:
3436         * platform/encryptedmedia/gstreamer/CDMFactoryGStreamer.cpp: Added.
3437         (WebCore::CDMFactory::platformRegisterFactories):
3438         * testing/MockCDMFactory.cpp:
3439         (WebCore::m_weakPtrFactory):
3440         (WebCore::MockCDMFactory::unregister):
3441         (WebCore::MockCDMFactory::createCDM):
3442         * testing/MockCDMFactory.h:
3443
3444 2017-08-04  Frederic Wang  <fwang@igalia.com>
3445
3446         ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle
3447         https://bugs.webkit.org/show_bug.cgi?id=175135
3448
3449         Reviewed by Simon Fraser.
3450
3451         This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so
3452         that it uses the fixed position rectangle relative of the first frame ancestor instead of
3453         the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS
3454         and RenderLayerCompositor. This fixes some flickering issues on iOS.
3455
3456         Test: fast/scrolling/ios/fixed-inside-overflow-inside-iframe.html
3457
3458         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3459         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Helper function to get the
3460         fixed position rect to use for that frame.
3461         * page/scrolling/ScrollingTreeNode.cpp:
3462         (WebCore::ScrollingTreeNode::enclosingFrameNode const): Helper function to get the enclosing
3463         frame for this scrolling node or null if there is none.
3464         * page/scrolling/ScrollingTreeNode.h: Declare enclosingFrameNode.
3465
3466 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
3467
3468         Unreviewed. Removing redundant NotImplemented.h header inclusions
3469         and cleaning up whitespace issues in libgcrypt-specific CryptoKeyEC
3470         and CryptoKeyRSA implementation files.
3471
3472         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
3473         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
3474
3475 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
3476
3477         Remove unnecesary call to status bar SPI.
3478         https://bugs.webkit.org/show_bug.cgi?id=175176
3479         rdar://problem/20887306
3480
3481         Reviewed by Darin Adler.
3482
3483         No new tests because no behavior change.
3484
3485         This removes an obsolete call to SPI.
3486
3487         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3488         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
3489
3490 2017-08-03  Zan Dobersek  <zdobersek@igalia.com>
3491
3492         [GCrypt] Implement CryptoKeyEC PKCS#8 imports
3493         https://bugs.webkit.org/show_bug.cgi?id=173647
3494
3495         Reviewed by Jiewen Tan.
3496
3497         No new tests -- affected tests are now passing and are unskipped.
3498
3499         Implement libgcrypt-based support for PKCS#8 imports of EC keys.
3500
3501         Existing libtasn1 utilities are used to achieve this. First, the provided key data
3502         is decoded against the PrivateKeyInfo ASN.1 definition. First, the version member
3503         of that structure is validated, followed by the algorithm member. The latter is
3504         also properly tested depending on this being an import of an ECDSA or ECDH key.
3505
3506         Data of the parameters member is decoded against the ECParameters ASN.1 definition,
3507         and the namedCurve object identifier is validated, making sure it represents a
3508         valid EC curve and that this curve maches the one specified for the import
3509         operation.
3510
3511         Data of the privateKey member is decoded against the ECPrivateKey ASN.1 definition.
3512         The version member of that structure is properly validated. The optional parameters
3513         member of that structure is already decoded against the ECParameters ASN.1
3514         definition. If present, it is checked to contain a valid EC curve identifier that
3515         matches the specified curve.
3516
3517         The optional publicKey member of the ECPrivateKey structure is validated, testing
3518         that its data matches in size an uncompressed EC point, and that the first byte
3519         of this data is 0x04, as expected for an uncompressed EC point.
3520
3521         What's left is the private key data on the initial ECPrivateKey structure. That
3522         data is retrieved and validated, making sure its size matches the size of the
3523         specified curve. The `private-key` s-expression is then constructed, embedding
3524         the curve name and the validated private key data. This s-expression is then used
3525         to construct an EC context.
3526
3527         If the optional publicKey data was provided, it's used to set the `q` parameter
3528         for this EC context. Otherwise, the value for `q` is computed on-the-fly for the
3529         specified EC and the provided private key. The `q` point is then tested through
3530         the gcry_mpi_ec_curve_point() function, making sure that the derived point is
3531         indeed located on the given EC.
3532
3533         Finally, with the private key properly validated, a new CryptoKeyEC object is
3534         constructed, using the `private-key` s-expression and the parameters that were
3535         specified for this import operation.
3536
3537         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
3538         (WebCore::CryptoKeyEC::platformImportPkcs8):
3539         * crypto/gcrypt/GCryptUtilities.h:
3540
3541 2017-08-03  Chris Dumez  <cdumez@apple.com>
3542
3543         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
3544         https://bugs.webkit.org/show_bug.cgi?id=175132
3545
3546         Reviewed by Darin Adler.
3547
3548         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.', without
3549         a leading 0. This is as per https://github.com/whatwg/html/pull/2852.
3550
3551         The latest spec is at:
3552         - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
3553
3554         Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
3555
3556         * html/parser/HTMLParserIdioms.cpp:
3557         (WebCore::parseHTTPRefreshInternal):
3558
3559 2017-08-03  Brian Burg  <bburg@apple.com>
3560
3561         Remove ENABLE(WEB_SOCKET) guards
3562         https://bugs.webkit.org/show_bug.cgi?id=167044
3563
3564         Reviewed by Joseph Pecoraro.
3565
3566         * Configurations/FeatureDefines.xcconfig:
3567         * Modules/websockets/ThreadableWebSocketChannel.cpp:
3568         * Modules/websockets/ThreadableWebSocketChannel.h:
3569         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
3570         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
3571         * Modules/websockets/WebSocket.cpp:
3572         * Modules/websockets/WebSocket.h:
3573         * Modules/websockets/WebSocket.idl:
3574         * Modules/websockets/WebSocketChannel.cpp:
3575         * Modules/websockets/WebSocketChannel.h:
3576         * Modules/websockets/WebSocketChannelClient.h:
3577         * Modules/websockets/WebSocketDeflateFramer.cpp:
3578         * Modules/websockets/WebSocketDeflateFramer.h:
3579         * Modules/websockets/WebSocketDeflater.cpp:
3580         * Modules/websockets/WebSocketDeflater.h:
3581         * Modules/websockets/WebSocketExtensionDispatcher.cpp:
3582         * Modules/websockets/WebSocketExtensionDispatcher.h:
3583         * Modules/websockets/WebSocketExtensionParser.cpp:
3584         * Modules/websockets/WebSocketExtensionParser.h:
3585         * Modules/websockets/WebSocketExtensionProcessor.h:
3586         * Modules/websockets/WebSocketFrame.cpp:
3587         * Modules/websockets/WebSocketFrame.h:
3588         * Modules/websockets/WebSocketHandshake.cpp:
3589         * Modules/websockets/WebSocketHandshake.h:
3590         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3591         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
3592         * dom/Document.cpp:
3593         (WebCore::Document::Document):
3594         (WebCore::Document::idbConnectionProxy):
3595         (WebCore::Document::socketProvider):
3596         * dom/Document.h:
3597         * dom/ScriptExecutionContext.h:
3598         * inspector/InspectorInstrumentation.cpp:
3599         (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl):
3600         * inspector/InspectorInstrumentation.h:
3601         (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
3602         * inspector/InspectorNetworkAgent.cpp:
3603         * inspector/InspectorNetworkAgent.h:
3604         * page/RuntimeEnabledFeatures.cpp:
3605         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const):
3606         * page/RuntimeEnabledFeatures.h:
3607         * page/SocketProvider.cpp:
3608         * page/SocketProvider.h:
3609         * workers/WorkerGlobalScope.cpp:
3610         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3611         * workers/WorkerGlobalScope.h:
3612         * workers/WorkerMessagingProxy.cpp:
3613         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3614         * workers/WorkerThread.cpp:
3615         (WebCore::WorkerThread::WorkerThread):
3616         (WebCore::WorkerThread::socketProvider):
3617         * workers/WorkerThread.h:
3618
3619 2017-08-03  Don Olmstead  <don.olmstead@sony.com>
3620
3621         Remove LayoutUnit dependency in TextStream
3622         https://bugs.webkit.org/show_bug.cgi?id=175110
3623
3624         Reviewed by Zalan Bujtas.
3625
3626         No new tests. No change in behavior.
3627
3628         * CMakeLists.txt:
3629         * WebCore.xcodeproj/project.pbxproj:
3630         * platform/LayoutUnit.cpp: Added.
3631         (WebCore::operator<<):
3632         * platform/LayoutUnit.h:
3633         * platform/text/TextStream.cpp:
3634         * platform/text/TextStream.h:
3635
3636 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
3637
3638         Improve WebKitLegacy video fullscreen animation begin and end rects.
3639         https://bugs.webkit.org/show_bug.cgi?id=175152
3640         rdar://problem/32840576
3641
3642         Reviewed by Eric Carlson.
3643
3644         No new tests, becuase this change has no effect on the DOM.
3645
3646         This change uses different rects for fullscreen animation to prevent the animation
3647         from failing, and to improve the aesthetics of the animation.
3648
3649         * platform/mac/WebVideoFullscreenController.mm:
3650         (frameExpandedToRatioOfFrame):
3651         (-[WebVideoFullscreenController enterFullscreen:]):
3652         (-[WebVideoFullscreenController exitFullscreen]):
3653         (-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]):
3654         (constrainFrameToRatioOfFrame): Deleted.
3655
3656 2017-08-03  Jer Noble  <jer.noble@apple.com>
3657
3658         [EME][Mac] SecureStop left on disk in Private Browsing mode.
3659         https://bugs.webkit.org/show_bug.cgi?id=175162
3660
3661         Reviewed by Eric Carlson.
3662
3663         Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should
3664         be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat
3665         an empty string as valid, and do not try to store or retrieve session information to disk in that case.
3666
3667         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
3668         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
3669         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3670         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
3671         (WebCore::CDMSessionAVContentKeySession::update):
3672         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
3673         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
3674         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
3675         (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const):
3676
3677 2017-08-03  Youenn Fablet  <youenn@apple.com>
3678
3679         [Fetch API] Add support for Request keepalive getter
3680         https://bugs.webkit.org/show_bug.cgi?id=175151
3681
3682         Reviewed by Chris Dumez.
3683
3684         Test: imported/w3c/web-platform-tests/fetch/api/request/request-keepalive.html
3685
3686         Adding keepalive as a fetch option.
3687         Adding initialization and getter of keepalive into FetchRequest.
3688
3689         * Modules/fetch/FetchRequest.cpp:
3690         (WebCore::buildOptions):
3691         * Modules/fetch/FetchRequest.h:
3692         * Modules/fetch/FetchRequest.idl:
3693         * loader/FetchOptions.h:
3694
3695 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
3696
3697         [PAL] Move spi/cf directory into PAL
3698         https://bugs.webkit.org/show_bug.cgi?id=175057
3699
3700         Reviewed by Antti Koivisto.
3701
3702         * WebCore.xcodeproj/project.pbxproj:
3703         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3704         * loader/cocoa/SubresourceLoaderCocoa.mm:
3705         * loader/mac/ResourceLoaderMac.mm:
3706         * platform/cf/CoreMediaSoftLink.cpp:
3707         * platform/cf/CoreMediaSoftLink.h:
3708         * platform/mac/PluginBlacklist.mm:
3709         * platform/mac/WebCoreNSStringExtras.mm:
3710         * platform/mac/WebGLBlacklist.mm:
3711         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3712         * platform/network/NetworkStorageSession.h:
3713         * platform/network/cf/CookieJarCFNet.cpp:
3714         * platform/network/cf/CredentialStorageCFNet.cpp:
3715         * platform/network/cf/ResourceHandleCFNet.cpp:
3716         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
3717         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3718         * platform/network/cf/ResourceRequestCFNet.cpp:
3719         * platform/network/cf/ResourceRequestCFNet.h:
3720         * platform/network/cf/ResourceResponse.h:
3721         * platform/network/cf/ResourceResponseCFNet.cpp:
3722         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3723         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3724         * platform/network/cocoa/CookieStorageObserver.h:
3725         * platform/network/cocoa/CredentialCocoa.h:
3726         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3727         * platform/network/cocoa/ResourceRequestCocoa.mm:
3728         * platform/network/cocoa/ResourceResponseCocoa.mm:
3729         * platform/network/ios/ResourceRequestIOS.mm:
3730         * platform/network/mac/CookieJarMac.mm:
3731         * platform/network/mac/FormDataStreamMac.mm:
3732         * platform/network/mac/ResourceHandleMac.mm:
3733         * platform/network/mac/ResourceRequestMac.mm:
3734         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3735         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3736         * platform/network/mac/WebCoreURLResponse.h:
3737         * testing/cocoa/WebArchiveDumpSupport.mm:
3738
3739 2017-08-03  Youenn Fablet  <youenn@apple.com>
3740
3741         Remove FETCH_API compilation guard
3742         https://bugs.webkit.org/show_bug.cgi?id=175154
3743
3744         Reviewed by Chris Dumez.
3745
3746         No change of behavior.
3747
3748         * Configurations/FeatureDefines.xcconfig:
3749         * Modules/fetch/DOMWindowFetch.cpp:
3750         * Modules/fetch/DOMWindowFetch.h:
3751         * Modules/fetch/DOMWindowFetch.idl:
3752         * Modules/fetch/FetchBody.cpp:
3753         * Modules/fetch/FetchBody.h:
3754         * Modules/fetch/FetchBody.idl:
3755         * Modules/fetch/FetchBodyConsumer.cpp:
3756         * Modules/fetch/FetchBodyConsumer.h:
3757         * Modules/fetch/FetchBodyOwner.cpp:
3758         * Modules/fetch/FetchBodyOwner.h:
3759         * Modules/fetch/FetchHeaders.cpp:
3760         * Modules/fetch/FetchHeaders.h:
3761         * Modules/fetch/FetchHeaders.idl:
3762         * Modules/fetch/FetchInternals.js:
3763         * Modules/fetch/FetchLoader.cpp:
3764         * Modules/fetch/FetchLoader.h:
3765         * Modules/fetch/FetchLoaderClient.h:
3766         * Modules/fetch/FetchRequest.cpp:
3767         * Modules/fetch/FetchRequest.h:
3768         * Modules/fetch/FetchRequest.idl:
3769         * Modules/fetch/FetchResponse.cpp:
3770         * Modules/fetch/FetchResponse.h:
3771         * Modules/fetch/FetchResponse.idl:
3772         * Modules/fetch/FetchResponse.js:
3773         * Modules/fetch/FetchResponseSource.cpp:
3774         * Modules/fetch/FetchResponseSource.h:
3775         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
3776         * Modules/fetch/WorkerGlobalScopeFetch.h:
3777         * Modules/fetch/WorkerGlobalScopeFetch.idl:
3778         * page/RuntimeEnabledFeatures.h:
3779         (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const):
3780
3781 2017-08-03  Devin Rousso  <drousso@apple.com>
3782
3783         Web Inspector: add button to open Inspector^2
3784         https://bugs.webkit.org/show_bug.cgi?id=175108
3785
3786         Reviewed by Brian Burg.
3787
3788         This patch just exposes a function to the inspector page. No new functionality was added.
3789
3790         * inspector/InspectorFrontendHost.idl:
3791         * inspector/InspectorFrontendHost.h:
3792         * inspector/InspectorFrontendHost.cpp:
3793         (WebCore::InspectorFrontendHost::inspectInspector):
3794
3795 2017-08-03  Matt Baker  <mattbaker@apple.com>
3796
3797         Web Inspector: Instrument WebGLProgram created/deleted
3798         https://bugs.webkit.org/show_bug.cgi?id=175059
3799
3800         Reviewed by Devin Rousso.
3801
3802         Tests: inspector/canvas/shaderProgram-add-remove-webgl.html
3803                inspector/canvas/shaderProgram-add-remove-webgl2.html
3804
3805         This patch adds instrumentation to WebGLRenderingContextBase for tracking
3806         WebGLPrograms. A new helper class, InspectorShaderProgram, is used by
3807         the CanvasAgent to hold related data.
3808
3809         * CMakeLists.txt:
3810         * WebCore.xcodeproj/project.pbxproj:
3811
3812         * html/canvas/WebGLRenderingContextBase.cpp:
3813         (WebCore::WebGLRenderingContextBase::createProgram):
3814         (WebCore::WebGLRenderingContextBase::deleteProgram):
3815
3816         * inspector/InspectorCanvasAgent.cpp:
3817         (WebCore::InspectorCanvasAgent::enable):
3818         (WebCore::InspectorCanvasAgent::frameNavigated):
3819         (WebCore::InspectorCanvasAgent::didCreateProgram):
3820         (WebCore::InspectorCanvasAgent::willDeleteProgram):
3821         (WebCore::InspectorCanvasAgent::clearCanvasData):
3822         (WebCore::InspectorCanvasAgent::unbindCanvas):
3823         (WebCore::InspectorCanvasAgent::unbindProgram):
3824         (WebCore::InspectorCanvasAgent::assertInspectorProgram):
3825         (WebCore::InspectorCanvasAgent::findInspectorProgram):
3826         * inspector/InspectorCanvasAgent.h:
3827
3828         * inspector/InspectorInstrumentation.cpp:
3829         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
3830         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
3831         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
3832         (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
3833         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
3834         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
3835         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
3836         (WebCore::InspectorInstrumentation::willDeleteProgramImpl):
3837
3838         * inspector/InspectorInstrumentation.h:
3839         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
3840         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
3841         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
3842         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
3843         (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
3844         (WebCore::InspectorInstrumentation::recordCanvasAction):
3845         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
3846         (WebCore::InspectorInstrumentation::didCreateProgram):
3847         (WebCore::InspectorInstrumentation::willDeleteProgram):
3848
3849         * inspector/InspectorShaderProgram.cpp: Added.
3850         (WebCore::InspectorShaderProgram::create):
3851         (WebCore::InspectorShaderProgram::InspectorShaderProgram):
3852         (WebCore::InspectorShaderProgram::context const):
3853         * inspector/InspectorShaderProgram.h: Added.
3854
3855 2017-08-03  Matt Lewis  <jlewis3@apple.com>
3856
3857         Unreviewed, rolling out r220209.
3858
3859         This caused internal build failures.
3860
3861         Reverted changeset:
3862
3863         "Use MPAVRoutingController instead of deprecated versions."
3864         https://bugs.webkit.org/show_bug.cgi?id=175063
3865         http://trac.webkit.org/changeset/220209
3866
3867 2017-08-03  Brady Eidson  <beidson@apple.com>
3868
3869         Add SW IDLs and stub out basic functionality.
3870         https://bugs.webkit.org/show_bug.cgi?id=175115
3871
3872         Reviewed by Chris Dumez.
3873
3874         No new tests (Currently no behavior change).
3875
3876         Overall note: This feature is EnabledAtRuntime as opposed to EnabledBySetting because
3877         the Settings-based code generation is completely broken for non-Document contexts,
3878         whereas the RuntimeEnabledFeatures-based generation is not.
3879     
3880         * CMakeLists.txt:
3881         * Configurations/FeatureDefines.xcconfig:
3882         * DerivedSources.make:
3883         * WebCore.xcodeproj/project.pbxproj:
3884
3885         * bindings/scripts/preprocess-idls.pl: Handle the new global scope c'tor file.
3886
3887         * bindings/js/JSServiceWorkerContainerCustom.cpp: Added.
3888         (WebCore::JSServiceWorkerContainer::ready const):
3889
3890         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3891         (WebCore::toJSWorkerGlobalScope): Refactor to handle both types of derived workers.
3892         (WebCore::toJSServiceWorkerGlobalScope):
3893         * bindings/js/JSWorkerGlobalScopeBase.h:
3894
3895         * dom/EventNames.h:
3896         * dom/EventTargetFactory.in:
3897
3898         * features.json: Change status of feature.
3899
3900         * page/Navigator.idl:
3901         * page/NavigatorBase.cpp:
3902         (WebCore::NavigatorBase::serviceWorker):
3903         * page/NavigatorBase.h:
3904         * page/NavigatorServiceWorker.idl: Added.
3905
3906         * page/RuntimeEnabledFeatures.h:
3907         (WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const):
3908         (WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled):
3909
3910         * workers/ServiceWorker.cpp: Added.
3911         (WebCore::ServiceWorker::postMessage):
3912         (WebCore::ServiceWorker::~ServiceWorker):
3913         (WebCore::ServiceWorker::scriptURL const):
3914         (WebCore::ServiceWorker::state const):
3915         (WebCore::ServiceWorker::eventTargetInterface const):
3916         (WebCore::ServiceWorker::scriptExecutionContext const):
3917         * workers/ServiceWorker.h: Added.
3918         * workers/ServiceWorker.idl: Added.
3919
3920         * workers/ServiceWorkerContainer.cpp: Added.
3921         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
3922         (WebCore::ServiceWorkerContainer::controller const):
3923         (WebCore::ServiceWorkerContainer::ready):
3924         (WebCore::ServiceWorkerContainer::addRegistration):
3925         (WebCore::ServiceWorkerContainer::getRegistration):
3926         (WebCore::ServiceWorkerContainer::getRegistrations):
3927         (WebCore::ServiceWorkerContainer::startMessages):
3928         (WebCore::ServiceWorkerContainer::eventTargetInterface const):
3929         (WebCore::ServiceWorkerContainer::scriptExecutionContext const):
3930         * workers/ServiceWorkerContainer.h: Added.
3931         * workers/ServiceWorkerContainer.idl: Added.
3932
3933         * workers/ServiceWorkerGlobalScope.cpp: Added.
3934         (WebCore::ServiceWorkerGlobalScope::registration):
3935         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
3936         * workers/ServiceWorkerGlobalScope.h: Added.
3937         * workers/ServiceWorkerGlobalScope.idl: Added.
3938
3939         * workers/ServiceWorkerRegistration.cpp: Added.
3940         (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
3941         (WebCore::ServiceWorkerRegistration::installing):
3942         (WebCore::ServiceWorkerRegistration::waiting):
3943         (WebCore::ServiceWorkerRegistration::active):
3944         (WebCore::ServiceWorkerRegistration::scope const):
3945         (WebCore::ServiceWorkerRegistration::update):
3946         (WebCore::ServiceWorkerRegistration::unregister):
3947         (WebCore::ServiceWorkerRegistration::eventTargetInterface const):
3948         (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
3949         * workers/ServiceWorkerRegistration.h: Added.
3950         * workers/ServiceWorkerRegistration.idl: Added.
3951
3952 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
3953
3954         [WebCore] Sort Xcode project files
3955         https://bugs.webkit.org/show_bug.cgi?id=175121
3956
3957         Reviewed by Antti Koivisto.
3958
3959         * WebCore.xcodeproj/project.pbxproj:
3960
3961 2017-08-02  Sam Weinig  <sam@webkit.org>
3962
3963         [WebIDL] Convert MutationCallback to be a normal generated callback
3964         https://bugs.webkit.org/show_bug.cgi?id=174140
3965
3966         Reviewed by Darin Adler.
3967
3968         To make this work more nicely, I:
3969         - Added the ability to for non-nullable interfaces in sequences to be passed
3970           via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
3971           (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
3972           signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
3973           than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
3974         - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
3975           which allows you to specify that the callback needs a this object in addition
3976           to its arguments. When specified, the first argument of the C++ implementation
3977           function will now correspond to the this object, with the remaining arguments
3978           shifted over one.
3979         - Converted callback objects to all inherit directly from ActiveDOMCallback rather
3980           than having the generated JS callback derived class inherit from it. This allows
3981           us to have access to a callback's canInvokeCallback() function anywhere (needed
3982           for MutationCallback) as well as giving a place to put an optional virtual 
3983           visitJSFunction to allow marking weak callbacks (while not an ideal layering, 
3984           this matches what we do in EventListener). This change requires each callback to
3985           have a bit more code to import the ActiveDOMCallback's constructor and requires
3986           non-JS derived callbacks to pass a ScriptExecutionContext (e.g. the Document).
3987
3988         * CMakeLists.txt:
3989         * DerivedSources.make:
3990         * WebCore.xcodeproj/project.pbxproj:
3991         * bindings/js/JSMutationCallback.cpp: Removed.
3992         * bindings/js/JSMutationCallback.h: Removed.
3993         Remove custom JSMutationCallback.h/cpp
3994
3995         * Modules/geolocation/PositionCallback.h:
3996         * Modules/geolocation/PositionErrorCallback.h:
3997         * Modules/notifications/NotificationPermissionCallback.h:
3998         * Modules/webaudio/AudioBufferCallback.h:
3999         * Modules/webdatabase/DatabaseCallback.h:
4000         * Modules/webdatabase/SQLStatementCallback.h:
4001         * Modules/webdatabase/SQLStatementErrorCallback.h:
4002         * Modules/webdatabase/SQLTransactionCallback.h:
4003         * Modules/webdatabase/SQLTransactionErrorCallback.h:
4004         * css/MediaQueryListListener.h:
4005         * dom/NodeFilter.h:
4006         * dom/RequestAnimationFrameCallback.h:
4007         * dom/StringCallback.h:
4008         * fileapi/BlobCallback.h:
4009         * html/VoidCallback.h:
4010         * page/IntersectionObserverCallback.h:
4011         * page/PerformanceObserverCallback.h:
4012         Add ActiveDOMCallback as a base class. Import the ActiveDOMCallback constructor.
4013
4014         * Modules/mediastream/MediaDevicesRequest.cpp:
4015         (WebCore::MediaDevicesRequest::filterDeviceList):
4016         (WebCore::MediaDevicesRequest::start):
4017         * Modules/mediastream/MediaDevicesRequest.h:
4018         Change filterDeviceList to take a Vector of Refs.
4019
4020         * bindings/IDLTypes.h:
4021         Add InnerParameterType and NullableInnerParameterType type hooks
4022         and specialize wrappers to use Ref for InnerParameterType, and RefPtr
4023         for NullableInnerParameterType.
4024
4025         * bindings/js/JSCallbackData.cpp:
4026         * bindings/js/JSCallbackData.h:
4027         Add support for passing a this object and give JSCallbackDataWeak a visitJSFunction
4028         to allow marking the underlying function.
4029
4030         * bindings/js/JSMutationObserverCustom.cpp:
4031         (WebCore::JSMutationObserver::visitAdditionalChildren):
4032         (WebCore::constructJSMutationObserver): Deleted.
4033         Remove the custom constructor and replace it with a custom visitAdditionalChildren
4034         that calls the new ActiveDOMObject's visitJSFunction.