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