9fef19ecae725031f666ddc39d742201cdb50217
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-21  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         Addressing post-review comments after r220725
4         https://bugs.webkit.org/show_bug.cgi?id=175382
5
6         Reviewed by Darin Adler.
7
8         * css/CSSFontFace.cpp:
9         (WebCore::CSSFontFace::setUnicodeRange):
10
11 2017-08-21  Youenn Fablet  <youenn@apple.com>
12
13         [Cache API] Add support for CacheStorage.match
14         https://bugs.webkit.org/show_bug.cgi?id=175747
15
16         Reviewed by Chris Dumez.
17
18         Covered by rebased tests.
19
20         Introducing Cache::doMatch so that CacheStorage can use it.
21         Make Cache::match use Cache::doMatch as well.
22
23         Implementing CacheStorage.match as per spec:
24         - If name is provided, query only the cache with the given name.
25         - Otherwise pick the first matching response in the caches.
26         The sequential asynchronous search is done in doSequentialMatch.
27
28         Making sure that response with a status code are returning false to isNull.
29         This allows passing more tests.
30
31         * Modules/cache/Cache.cpp:
32         (WebCore::Cache::match):
33         (WebCore::Cache::doMatch):
34         (WebCore::Cache::matchAll):
35         (WebCore::toConnectionRecord):
36         * Modules/cache/Cache.h:
37         * Modules/cache/CacheStorage.cpp:
38         (WebCore::doSequentialMatch):
39         (WebCore::copyCaches):
40         (WebCore::CacheStorage::match):
41         * platform/network/ResourceResponseBase.cpp:
42         (WebCore::ResourceResponseBase::setHTTPStatusCode):
43
44 2017-08-21  Dean Jackson  <dino@apple.com>
45
46         Persistent WebGL Warning "vertex WARNING: 0:1: extension 'GL_ARB_gpu_shader5' is not supported" in Safari 10.1.2
47         https://bugs.webkit.org/show_bug.cgi?id=175783
48         <rdar://problem/33623867>
49
50         Reviewed by Alex Christensen.
51
52         The version of ANGLE we use inserts this line into each shader:
53         #extension GL_ARB_gpu_shader5 : enable
54         It causes our lower-level GLSL compiler to give a warning, which is
55         confusing to developers because they didn't write this code.
56
57         Until we upgrade our OpenGL support to version 4.1, we should remove
58         this error message from the log returned to the developer.
59         See https://bugs.webkit.org/show_bug.cgi?id=175785
60
61         Test: fast/canvas/webgl/no-info-log-for-simple-shaders.html
62
63         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
64         (WebCore::GraphicsContext3D::getUnmangledInfoLog): Search for and remove
65         this warning.
66
67 2017-08-21  Andy Estes  <aestes@apple.com>
68
69         [Payment Request] Use ExistingExceptionError to propagate JS exceptions thrown during JSON stringification
70         https://bugs.webkit.org/show_bug.cgi?id=175776
71
72         Reviewed by Darin Adler.
73
74         * Modules/paymentrequest/PaymentRequest.cpp:
75         (WebCore::PaymentRequest::create):
76         * Modules/paymentrequest/PaymentRequest.h:
77
78 2017-08-21  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
79
80         [PAL] Move spi/mac directory into PAL
81         https://bugs.webkit.org/show_bug.cgi?id=175649
82
83         Reviewed by Myles C. Maxfield.
84
85         * WebCore.xcodeproj/project.pbxproj:
86         * editing/cocoa/DataDetection.mm:
87         * editing/mac/DictionaryLookup.h:
88         * editing/mac/DictionaryLookup.mm:
89         * page/mac/ServicesOverlayController.mm:
90         * page/mac/WheelEventDeltaFilterMac.mm:
91         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
92         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
93         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
94         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
95         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
96         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
97         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
98         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
99         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
100         * platform/graphics/mac/FontCacheMac.mm:
101         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
102         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
103         * platform/graphics/mac/MediaTimeQTKit.h:
104         * platform/mac/MediaRemoteSoftLink.cpp:
105         * platform/mac/MediaRemoteSoftLink.h:
106         * platform/mac/PasteboardWriter.mm:
107         * platform/mac/PlatformEventFactoryMac.mm:
108         * platform/mac/ScrollAnimatorMac.mm:
109         * platform/mac/ScrollbarThemeMac.mm:
110         * platform/mac/VideoFullscreenInterfaceMac.mm:
111         * platform/mac/WebVideoFullscreenController.mm:
112         * rendering/RenderThemeMac.mm:
113
114 2017-08-21  Adrian Perez de Castro  <aperez@igalia.com>
115
116         [GTK][WPE][GSTREAMER_GL] Overriden virtual function not marked “override” in MediaPlayerPrivateGStreamerBase.h
117         https://bugs.webkit.org/show_bug.cgi?id=175780
118
119         Reviewed by Konstantin Tokarev.
120
121         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Add missing "override" qualifier.
122
123 2017-08-21  Brady Eidson  <beidson@apple.com>
124
125         Split the one SWServer::Connection into SWClientConnection and SWServer::Connection.
126         https://bugs.webkit.org/show_bug.cgi?id=175745
127
128         Reviewed by Andy Estes.
129
130         No new tests (No behavior change).
131
132         Each of these has a much different environment that it lives in, so being the same object
133         hinders clean development.
134         
135         This split will also make it easier for the WebCore objects to directly handle WK2 messages.
136         
137         * CMakeLists.txt:
138         * WebCore.xcodeproj/project.pbxproj:
139         
140         * platform/Logging.h:
141
142         * workers/service/ServiceWorkerContainer.cpp:
143         (WebCore::ServiceWorkerContainer::addRegistration):
144         (WebCore::ServiceWorkerContainer::scheduleJob):
145         * workers/service/ServiceWorkerContainer.h:
146
147         * workers/service/ServiceWorkerProvider.h:
148
149         * workers/service/server/SWClientConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServer.cpp.
150         (WebCore::SWClientConnection::SWClientConnection):
151         (WebCore::SWClientConnection::~SWClientConnection):
152         (WebCore::SWClientConnection::scheduleJob):
153         (WebCore::SWClientConnection::jobRejectedInServer):
154         * workers/service/server/SWClientConnection.h: Copied from Source/WebCore/workers/service/server/SWServer.h.
155
156         * workers/service/server/SWServer.cpp:
157         (WebCore::SWServer::Connection::Connection):
158         (WebCore::SWServer::Connection::~Connection):
159         (WebCore::SWServer::~SWServer):
160         (WebCore::SWServer::Connection::scheduleJobInServer):
161         (WebCore::SWServer::scheduleJob):
162         (WebCore::SWServer::registerConnection):
163         (WebCore::SWServer::unregisterConnection):
164         (WebCore::SWServer::Connection::scheduleJob): Deleted.
165         (WebCore::SWServer::Connection::jobRejected): Deleted.
166         * workers/service/server/SWServer.h:
167         (WebCore::SWServer::Connection::server):
168         (WebCore::SWServer::Connection::~Connection): Deleted.
169
170 2017-08-21  Andy Estes  <aestes@apple.com>
171
172         [Payment Request] Implement the PaymentRequest constructor
173         https://bugs.webkit.org/show_bug.cgi?id=175755
174
175         Reviewed by Darin Adler.
176
177         * Modules/paymentrequest/PaymentDetailsModifier.h: Changed total to an std::optional<PaymentItem>.
178         * Modules/paymentrequest/PaymentRequest.cpp:
179         (WebCore::isWellFormedCurrencyCode): Implements the IsWellFormedCurrencyCode abstract operation from ECMA 402.
180         (WebCore::isValidDecimalMonetaryValue): Implements the "valid decimal monetary value" validity checker.
181         (WebCore::checkAndCanonicalizeAmount): Implements the "check and canonicalize amount" validity checker.
182         (WebCore::checkAndCanonicalizeTotal): Implements the "check and canonicalize total" validity checker.
183         (WebCore::PaymentRequest::create): Implements the PaymentRequest Constructor
184         (WebCore::PaymentRequest::PaymentRequest):
185         (WebCore::PaymentRequest::id const): Implements the PaymentRequest id attribute.
186         (WebCore::PaymentRequest::shippingType const): Implements the PaymentRequest shippingType attribute.
187         * Modules/paymentrequest/PaymentRequest.h:
188         * Modules/paymentrequest/PaymentRequest.idl: Annotated PaymentRequest with ConstructorMayThrowException.
189         * WebCore.xcodeproj/project.pbxproj:
190
191 2017-08-21  Per Arne Vollan  <pvollan@apple.com>
192
193         [Win] DRT should only allow any https certificate for localhost.
194         https://bugs.webkit.org/show_bug.cgi?id=175147
195
196         Reviewed by Brent Fulgham.
197
198         Disabling validation of certificate chains, breaks SSL on Windows. In order
199         for SSL tests to succeed on Windows, we should avoid disabling it.
200
201         No new tests, covered by existing tests.
202
203         * platform/network/cf/ResourceHandleCFNet.cpp:
204         (WebCore::ResourceHandle::createCFURLConnection):
205
206 2017-08-21  Zan Dobersek  <zdobersek@igalia.com>
207
208         [EME] HTMLMediaElement: basic implementations of 'Attempt to Decrypt', 'Attempt to Resume Playback If Necessary'
209         https://bugs.webkit.org/show_bug.cgi?id=175761
210
211         Reviewed by Xabier Rodriguez-Calvar.
212
213         Add initial and incomplete implementations of the 'Attempt to Decrypt' and
214         'Attempt to Resume Playback If Necessary' algorithms.  The implementations
215         are interleaved with the specification text for clarity.
216
217         'Attempt to Decrypt' implementation doesn't yet address the encrypted block
218         queue or the 'decryption blocked waiting for key' flag since it's not yet
219         clear whether it would make more sense for this state to reside lower, in
220         the platform layer. The gist of the algorithm is to invoke the decryption
221         attempt through the MediaPlayer object, passing along the CDMInstance object
222         retrieved from the MediaKeys object that is associated with this media
223         element.
224
225         'Attempt to Resume Playback if Necessary' implementation similarly for now
226         omits the various state flag operations. The main task at this point is to
227         dispatch the 'Attempt to Decrypt' algorithm.
228
229         HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary() method now
230         invokes the attemptToResumePlaybackIfNecessary() method.
231
232         MediaKeys::hasOpenSessions() is introduced, returning true if any session
233         that was created through this MediaKeys instance is still open. This allows
234         the 'Attempt to Decrypt' algorithm to proceed with the decryption attempt
235         dispatch into the MediaPlayer hierarchy.
236
237         For that, the MediaPlayer::attemptToDecryptWithInstance() method is added,
238         which simply dispatches the mirror method on MediaPlayerPrivate interface.
239         This will enable the platform-layer implementations to use the passed-in
240         CDMInstance object for decryption purposes.
241
242         * Modules/encryptedmedia/MediaKeySession.h:
243         * Modules/encryptedmedia/MediaKeys.cpp:
244         (WebCore::MediaKeys::hasOpenSessions const):
245         * Modules/encryptedmedia/MediaKeys.h:
246         * html/HTMLMediaElement.cpp:
247         (WebCore::HTMLMediaElement::attemptToDecrypt):
248         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
249         (WebCore::HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary):
250         * html/HTMLMediaElement.h: Mark cdmClientAttemptToResumePlaybackIfNecessary() as final.
251         * platform/graphics/MediaPlayer.cpp:
252         (WebCore::MediaPlayer::attemptToDecryptWithInstance):
253         * platform/graphics/MediaPlayer.h:
254         * platform/graphics/MediaPlayerPrivate.h:
255         (WebCore::MediaPlayerPrivateInterface::attemptToDecryptWithInstance):
256
257 2017-08-20  Zan Dobersek  <zdobersek@igalia.com>
258
259         [EME] Add basic implementation of HTMLMediaElement::setMediaKeys()
260         https://bugs.webkit.org/show_bug.cgi?id=175717
261
262         Reviewed by Xabier Rodriguez-Calvar.
263
264         Add an initial and incomplete implementation of HTMLMediaElement::setMediaKeys(),
265         interleaved with the specification wording of how this operation should behave.
266         The implementation still doesn't cover cases of CDM instances being already
267         associated with a different HTMLMediaElement, of CDM instances that can't be
268         disassociated from the current HTMLMediaElement, and of failures during both
269         association and disassociation of MediaKeys with the HTMLMediaElement.
270
271         The HTMLMediaElement (as a CDMClient inheritor) has to be attached or detached
272         from the MediaKeys object as appropriate. This attachment allows MediaKeys to
273         initiate an attempt to resume playback whenever the key statuses of the
274         associated MediaKeys object are updated.
275
276         Upon association and disassociation with MediaKeys, the CDMInstance object of
277         that specific MediaKeys instance is attached to or detached from the MediaPlayer
278         instance. This allows the platform layer to gather information about the
279         CDMInstance that will be used for decryption of media content for this specific
280         media element.
281
282         Additionally, the detachment from both MediaKeys and MediaPlayer is done upon
283         HTMLMediaElement destruction.
284
285         Upon setting the MediaKeys object, a task is queued that launches the 'Attempt to
286         Resume Playback If Necessary' algorithm. A placeholder method is added that will
287         implement the algorithm in the future.
288
289         The HTMLMediaElement::mediaKeys() getter is also implemented, returning pointer
290         held in m_mediaKeys.
291
292         Covered to a degree by existing imported W3C tests, with a setMediaKeys()-oriented
293         test having WPE-specific baseline update.
294
295         * Modules/encryptedmedia/MediaKeys.h:
296         (WebCore::MediaKeys::cdmInstance const):
297         * html/HTMLMediaElement.cpp:
298         (WebCore::HTMLMediaElement::~HTMLMediaElement):
299         (WebCore::HTMLMediaElement::mediaKeys const):
300         (WebCore::HTMLMediaElement::setMediaKeys):
301         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
302         (WebCore::HTMLMediaElement::contextDestroyed):
303         * html/HTMLMediaElement.h:
304         * platform/graphics/MediaPlayer.cpp:
305         (WebCore::MediaPlayer::cdmInstanceAttached):
306         (WebCore::MediaPlayer::cdmInstanceDetached):
307         * platform/graphics/MediaPlayer.h:
308         * platform/graphics/MediaPlayerPrivate.h:
309         (WebCore::MediaPlayerPrivateInterface::cdmInstanceAttached):
310         (WebCore::MediaPlayerPrivateInterface::cdmInstanceDetached):
311
312 2017-08-20  Chris Dumez  <cdumez@apple.com>
313
314         Simplify calls to LoaderStrategy::startPingLoad()
315         https://bugs.webkit.org/show_bug.cgi?id=175756
316
317         Reviewed by Sam Weinig.
318
319         Simplify calls to LoaderStrategy::startPingLoad() by passing the Frame to it
320         and let its implementation gets what it needs from the frame. This reduces
321         the number of parameters to startPingLoad() and is more easily extensible.
322
323         * dom/Document.h:
324         * loader/LoaderStrategy.h:
325         * loader/PingLoader.cpp:
326         (WebCore::PingLoader::loadImage):
327         (WebCore::PingLoader::sendPing):
328         (WebCore::PingLoader::sendViolationReport):
329         (WebCore::PingLoader::startPingLoad):
330         * loader/PingLoader.h:
331         * loader/cache/CachedResource.cpp:
332         (WebCore::CachedResource::load):
333
334 2017-08-20  Antti Koivisto  <antti@apple.com>
335
336         Factor :before/:after render tree mutations into a RenderTreeUpdater helper class
337         https://bugs.webkit.org/show_bug.cgi?id=175752
338
339         Reviewed by Andreas Kling.
340
341         Move code that constructs generated content renderers out from PseudoElement.
342         Also refactor the related code from RenderTreeUpdater main class into
343         RenderTreeUpdater::GeneratedContent helper class.
344
345         * WebCore.xcodeproj/project.pbxproj:
346         * dom/PseudoElement.cpp:
347         (WebCore::PseudoElement::resolveCustomStyle): Deleted.
348
349             Not needed anymore.
350
351         (WebCore::PseudoElement::didAttachRenderers): Deleted.
352
353             Moves to createContentRenderers in GeneratedContent.
354
355         (WebCore::PseudoElement::didRecalcStyle): Deleted.
356
357             Moves to updateStyleForContentRenderers in GeneratedContent.
358
359         * dom/PseudoElement.h:
360         * style/RenderTreeUpdater.cpp:
361         (WebCore::RenderTreeUpdater::RenderTreeUpdater):
362         (WebCore::RenderTreeUpdater::~RenderTreeUpdater):
363         (WebCore::RenderTreeUpdater::commit):
364         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
365         (WebCore::RenderTreeUpdater::updateAfterDescendants):
366         (WebCore::needsPseudoElement): Deleted.
367         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Deleted.
368         (WebCore::RenderTreeUpdater::updateQuotesUpTo): Deleted.
369
370             Quotes and other :before/:after support moves to GeneratedContent helpwe.
371
372         * style/RenderTreeUpdater.h:
373         (WebCore::RenderTreeUpdater::generatedContent):
374         * style/RenderTreeUpdaterGeneratedContent.cpp: Added.
375         (WebCore::RenderTreeUpdater::GeneratedContent::GeneratedContent):
376         (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement):
377         (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement):
378         (WebCore::RenderTreeUpdater::GeneratedContent::updateRemainingQuotes):
379         (WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):
380         (WebCore::createContentRenderers):
381         (WebCore::updateStyleForContentRenderers):
382         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
383         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
384         * style/RenderTreeUpdaterGeneratedContent.h: Added.
385
386 2017-08-19  Andy Estes  <aestes@apple.com>
387
388         [Payment Request] Add interface stubs
389         https://bugs.webkit.org/show_bug.cgi?id=175730
390
391         Reviewed by Youenn Fablet.
392
393         * DerivedSources.make:
394         * Modules/paymentrequest/PaymentAddress.h: Added.
395         * Modules/paymentrequest/PaymentAddress.idl: Added.
396         * Modules/paymentrequest/PaymentComplete.h: Added.
397         * Modules/paymentrequest/PaymentComplete.idl: Added.
398         * Modules/paymentrequest/PaymentCurrencyAmount.h: Added.
399         * Modules/paymentrequest/PaymentCurrencyAmount.idl: Added.
400         * Modules/paymentrequest/PaymentDetailsBase.h: Added.
401         * Modules/paymentrequest/PaymentDetailsBase.idl: Added.
402         * Modules/paymentrequest/PaymentDetailsInit.h: Added.
403         * Modules/paymentrequest/PaymentDetailsInit.idl: Added.
404         * Modules/paymentrequest/PaymentDetailsModifier.h: Added.
405         * Modules/paymentrequest/PaymentDetailsModifier.idl: Added.
406         * Modules/paymentrequest/PaymentDetailsUpdate.h: Added.
407         * Modules/paymentrequest/PaymentDetailsUpdate.idl: Added.
408         * Modules/paymentrequest/PaymentItem.h: Added.
409         * Modules/paymentrequest/PaymentItem.idl: Added.
410         * Modules/paymentrequest/PaymentMethodData.h: Added.
411         * Modules/paymentrequest/PaymentMethodData.idl: Added.
412         * Modules/paymentrequest/PaymentOptions.h: Added.
413         * Modules/paymentrequest/PaymentOptions.idl: Added.
414         * Modules/paymentrequest/PaymentRequest.cpp: Added.
415         (WebCore::PaymentRequest::create):
416         (WebCore::PaymentRequest::PaymentRequest):
417         (WebCore::PaymentRequest::~PaymentRequest):
418         (WebCore::PaymentRequest::show):
419         (WebCore::PaymentRequest::abort):
420         (WebCore::PaymentRequest::canMakePayment):
421         * Modules/paymentrequest/PaymentRequest.h: Added.
422         * Modules/paymentrequest/PaymentRequest.idl: Added.
423         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp: Added.
424         (WebCore::PaymentRequestUpdateEvent::~PaymentRequestUpdateEvent):
425         (WebCore::PaymentRequestUpdateEvent::updateWith):
426         * Modules/paymentrequest/PaymentRequestUpdateEvent.h: Added.
427         * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: Added.
428         * Modules/paymentrequest/PaymentRequestUpdateEventInit.h: Added.
429         * Modules/paymentrequest/PaymentRequestUpdateEventInit.idl: Added.
430         * Modules/paymentrequest/PaymentResponse.cpp: Added.
431         (WebCore::PaymentResponse::complete):
432         * Modules/paymentrequest/PaymentResponse.h: Added.
433         * Modules/paymentrequest/PaymentResponse.idl: Added.
434         * Modules/paymentrequest/PaymentShippingOption.h: Added.
435         * Modules/paymentrequest/PaymentShippingOption.idl: Added.
436         * Modules/paymentrequest/PaymentShippingType.h: Added.
437         * Modules/paymentrequest/PaymentShippingType.idl: Added.
438         * WebCore.xcodeproj/project.pbxproj:
439         * dom/EventNames.h:
440         * dom/EventNames.in:
441         * dom/EventTargetFactory.in:
442
443 2017-08-19  Sam Weinig  <sam@webkit.org>
444
445         [WebCrypto] Remove the KeyAlgorithm type hierarchy
446         https://bugs.webkit.org/show_bug.cgi?id=175750
447
448         Reviewed by Chris Dumez.
449
450         Removes the unnecessary indirection that existed to generate a
451         KeyAlgorithm dictionary (or rather, one of its derived dictionaries)
452         for a CryptoKey. We were calling the virtual buildAlgorithm(), which
453         return a std::unique_ptr<KeyAlgorithm>, which we then casted to the 
454         correct derived class and called dictionary() on. This can now be
455         simplified by making each CryptoKey derived class override a function
456         that returns the KeyAlgorithm variant.
457
458         * crypto/CryptoKey.cpp:
459         (WebCore::CryptoKey::algorithm const): Deleted.
460         * crypto/CryptoKey.h:
461         (WebCore::CryptoKey::extractable const):
462         (WebCore::KeyAlgorithm::~KeyAlgorithm): Deleted.
463         (WebCore::KeyAlgorithm::name const): Deleted.
464         (WebCore::KeyAlgorithm::KeyAlgorithm): Deleted.
465         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
466         (WebCore::CryptoKeyRSA::algorithm const):
467         (WebCore::CryptoKeyRSA::buildAlgorithm const): Deleted.
468         * crypto/keys/CryptoKeyAES.cpp:
469         (WebCore::CryptoKeyAES::algorithm const):
470         (WebCore::AesKeyAlgorithm::dictionary const): Deleted.
471         (WebCore::CryptoKeyAES::buildAlgorithm const): Deleted.
472         * crypto/keys/CryptoKeyAES.h:
473         * crypto/keys/CryptoKeyEC.cpp:
474         (WebCore::CryptoKeyEC::algorithm const):
475         (WebCore::EcKeyAlgorithm::dictionary const): Deleted.
476         (WebCore::CryptoKeyEC::buildAlgorithm const): Deleted.
477         * crypto/keys/CryptoKeyEC.h:
478         (WebCore::EcKeyAlgorithm::EcKeyAlgorithm): Deleted.
479         (WebCore::EcKeyAlgorithm::namedCurve const): Deleted.
480         * crypto/keys/CryptoKeyHMAC.cpp:
481         (WebCore::CryptoKeyHMAC::algorithm const):
482         (WebCore::HmacKeyAlgorithm::dictionary const): Deleted.
483         (WebCore::CryptoKeyHMAC::buildAlgorithm const): Deleted.
484         * crypto/keys/CryptoKeyHMAC.h:
485         * crypto/keys/CryptoKeyRSA.cpp:
486         (WebCore::RsaKeyAlgorithm::dictionary const): Deleted.
487         (WebCore::RsaHashedKeyAlgorithm::dictionary const): Deleted.
488         * crypto/keys/CryptoKeyRSA.h:
489         (WebCore::RsaKeyAlgorithm::RsaKeyAlgorithm): Deleted.
490         (WebCore::RsaKeyAlgorithm::modulusLength const): Deleted.
491         (WebCore::RsaKeyAlgorithm::publicExponent const): Deleted.
492         * crypto/keys/CryptoKeyRaw.cpp:
493         (WebCore::CryptoKeyRaw::algorithm const):
494         (WebCore::RawKeyAlgorithm::dictionary const): Deleted.
495         (WebCore::CryptoKeyRaw::buildAlgorithm const): Deleted.
496         * crypto/keys/CryptoKeyRaw.h:
497         (WebCore::RawKeyAlgorithm::RawKeyAlgorithm): Deleted.
498         * crypto/mac/CryptoKeyRSAMac.cpp:
499         (WebCore::CryptoKeyRSA::algorithm const):
500         (WebCore::CryptoKeyRSA::buildAlgorithm const): Deleted.
501
502 2017-08-19  Sam Weinig  <sam@webkit.org>
503
504         [Mac] Change uint8_t* to Vector<uint8_t> type in all crypto algorithm implementation
505         https://bugs.webkit.org/show_bug.cgi?id=164939
506
507         Reviewed by Chris Dumez.
508
509         Address FIXMEs, replacing uint8_t*/size_t parameters with Vector<uint8_t>&.
510
511         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
512         (WebCore::transformAES_CBC):
513         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
514         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
515         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
516         (WebCore::wrapKeyAES_KW):
517         (WebCore::unwrapKeyAES_KW):
518         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
519         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
520         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
521         (WebCore::calculateSignature):
522         (WebCore::CryptoAlgorithmHMAC::platformSign):
523         (WebCore::CryptoAlgorithmHMAC::platformVerify):
524         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
525         (WebCore::encryptRSAES_PKCS1_v1_5):
526         (WebCore::decryptRSAES_PKCS1_v1_5):
527         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
528         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
529         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
530         (WebCore::signRSASSA_PKCS1_v1_5):
531         (WebCore::verifyRSASSA_PKCS1_v1_5):
532         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
533         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
534         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
535         (WebCore::encryptRSA_OAEP):
536         (WebCore::decryptRSA_OAEP):
537         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
538         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
539
540 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
541
542         Forbid setDragImage after dragstart
543         https://bugs.webkit.org/show_bug.cgi?id=175751
544
545         Reviewed by Wenson Hsieh.
546
547         Removed the code to allow setting the drag mage after dragstart had happened.
548
549         The feature was apparently used in Mac WebKit1 port but using it today causes the drag image
550         to disapepar while the user is moving the mouse cursor and being drawn once it's stopped
551         and results in the contionus flickering of the drag image.
552
553         The feaure was never supported in WebKit2 and doesn't match the HTML5 specification:
554         https://html.spec.whatwg.org/multipage/dnd.html#concept-dnd-rw
555         https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdragimage
556         or the behaviors of other browsers such as Chrome and Firefox.
557
558         No new tests. This patch simply removes code.
559
560         * dom/DataTransfer.cpp:
561         (WebCore::DataTransfer::setDragImage):
562         (WebCore::DataTransfer::canSetDragImage const): Deleted.
563         * dom/DataTransfer.h:
564         (WebCore::DataTransfer::makeDragImageWritable): Deleted.
565         * page/EventHandler.cpp:
566         (WebCore::EventHandler::handleDrag):
567
568 2017-08-18  Sam Weinig  <sam@webkit.org>
569
570         [WebCrypto] Get rid of CryptoKeyData class and all its subclasses
571         https://bugs.webkit.org/show_bug.cgi?id=169806
572
573         Reviewed by Chris Dumez.
574
575         - Replaces the CryptoKeyData type hierarchy 
576
577             CryptoKeyData
578               - CryptoKeyDataOctetSequence
579               - CryptoKeyDataRSAComponents
580
581           with the renamed CryptoKeyRSAComponents.
582
583         - Removes pure virtual exportData function on CryptoKey, and all
584           the implementations except the one on CryptoKeyRSA, which now is
585           non-virtual, and returns a CryptoKeyRSAComponents. Update the one
586           external caller, SerializedScriptValue, to handle this.
587
588         * CMakeLists.txt:
589         * WebCore.xcodeproj/project.pbxproj:
590         * bindings/js/SerializedScriptValue.cpp:
591         * crypto/CryptoAlgorithm.h:
592         * crypto/CryptoKey.h:
593         * crypto/CryptoKeyData.h: Removed.
594         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
595         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
596         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
597         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
598         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
599         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
600         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
601         (WebCore::CryptoKeyRSA::create):
602         (WebCore::CryptoKeyRSA::exportData const):
603         * crypto/keys/CryptoKeyAES.cpp:
604         (WebCore::CryptoKeyAES::exportData const): Deleted.
605         * crypto/keys/CryptoKeyAES.h:
606         * crypto/keys/CryptoKeyDataOctetSequence.cpp: Removed.
607         * crypto/keys/CryptoKeyDataOctetSequence.h: Removed.
608         * crypto/keys/CryptoKeyDataRSAComponents.cpp: Removed.
609         * crypto/keys/CryptoKeyDataRSAComponents.h: Removed.
610         * crypto/keys/CryptoKeyEC.cpp:
611         (WebCore::CryptoKeyEC::exportData const): Deleted.
612         * crypto/keys/CryptoKeyEC.h:
613         * crypto/keys/CryptoKeyHMAC.cpp:
614         (WebCore::CryptoKeyHMAC::exportData const): Deleted.
615         * crypto/keys/CryptoKeyHMAC.h:
616         * crypto/keys/CryptoKeyRSA.cpp:
617         (WebCore::CryptoKeyRSA::importJwk):
618         (WebCore::CryptoKeyRSA::exportJwk const):
619         * crypto/keys/CryptoKeyRSA.h:
620         * crypto/keys/CryptoKeyRSAComponents.cpp: Copied from crypto/keys/CryptoKeyDataRSAComponents.cpp.
621         (WebCore::CryptoKeyRSAComponents::CryptoKeyRSAComponents):
622         (WebCore::CryptoKeyRSAComponents::~CryptoKeyRSAComponents):
623         (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents): Deleted.
624         (WebCore::CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents): Deleted.
625         * crypto/keys/CryptoKeyRSAComponents.h: Copied from crypto/keys/CryptoKeyDataRSAComponents.h.
626         (WebCore::CryptoKeyRSAComponents::createPublic):
627         (WebCore::CryptoKeyRSAComponents::createPrivate):
628         (WebCore::CryptoKeyRSAComponents::createPrivateWithAdditionalData):
629         * crypto/keys/CryptoKeyRaw.cpp:
630         (WebCore::CryptoKeyRaw::exportData const): Deleted.
631         * crypto/keys/CryptoKeyRaw.h:
632         * crypto/mac/CryptoKeyRSAMac.cpp:
633         (WebCore::getPrivateKeyComponents):
634         (WebCore::CryptoKeyRSA::create):
635         (WebCore::CryptoKeyRSA::exportData const):
636
637 2017-08-18  Youenn Fablet  <youenn@apple.com>
638
639         [Cache API] Add support for being loaded responses
640         https://bugs.webkit.org/show_bug.cgi?id=175732
641
642         Reviewed by Chris Dumez.
643
644         Covered by existing and rebased tests.
645
646         Introducing a callback-based method to consume the body when the load is finished.
647         Using that new method in Cache::put and calling batchPutOperation when the load is finished.
648
649         Fixing the case of a fetch response being cloned, in which case its body should be marked as ReadableStream.
650
651         * Modules/cache/Cache.cpp:
652         (WebCore::Cache::put): Changing order of checks to reduce test flakiness risks as there is not yet support for putting responses with ReadableStream.
653         (WebCore::toConnectionRecord):
654         (WebCore::Cache::batchPutOperation):
655         * Modules/cache/Cache.h:
656         * Modules/fetch/FetchBody.cpp:
657         (WebCore::FetchBody::readableStreamBody): Deleted.
658         * Modules/fetch/FetchBody.h:
659         (WebCore::FetchBody::loadingBody):
660         (WebCore::FetchBody::setAsReadableStream):
661         * Modules/fetch/FetchResponse.cpp:
662         (WebCore::FetchResponse::BodyLoader::didSucceed):
663         (WebCore::FetchResponse::BodyLoader::didFail):
664         (WebCore::FetchResponse::consumeBody):
665         (WebCore::FetchResponse::consumeBodyWhenLoaded):
666         * Modules/fetch/FetchResponse.h:
667
668 2017-08-18  Chris Dumez  <cdumez@apple.com>
669
670         [Beacon] Improve error reporting
671         https://bugs.webkit.org/show_bug.cgi?id=175723
672
673         Reviewed by Darin Adler.
674
675         Have Ping loads such as beacons report errors via their completion handler.
676         The Beacon API is using this error to log a console message when beacon loads
677         fail, provided that the page is still alive.
678
679         Test: http/wpt/beacon/beacon-async-error-logging.html
680
681         * Modules/beacon/NavigatorBeacon.cpp:
682         (WebCore::NavigatorBeacon::NavigatorBeacon):
683         (WebCore::NavigatorBeacon::~NavigatorBeacon):
684         (WebCore::NavigatorBeacon::from):
685         (WebCore::NavigatorBeacon::supplementName):
686         (WebCore::NavigatorBeacon::notifyFinished):
687         (WebCore::NavigatorBeacon::logError):
688         (WebCore::NavigatorBeacon::sendBeacon):
689         * Modules/beacon/NavigatorBeacon.h:
690         * loader/LoaderStrategy.h:
691         * loader/cache/CachedResource.cpp:
692         (WebCore::CachedResource::load):
693         * loader/cache/CachedResourceLoader.cpp:
694         (WebCore::CachedResourceLoader::requestBeaconResource):
695         * loader/cache/CachedResourceLoader.h:
696         * platform/network/PingHandle.h:
697
698 2017-08-18  Sam Weinig  <sam@webkit.org>
699
700         Remove the deprecated WebKitSubtleCrypto interface
701         https://bugs.webkit.org/show_bug.cgi?id=164938
702         <rdar://problem/29894563>
703
704         Reviewed by Chris Dumez.
705
706         Remove WebKitSubtleCrypto and all of its helper classes / functionality.
707
708         * CMakeLists.txt:
709         * DerivedSources.cpp:
710         * DerivedSources.make:
711         * WebCore.xcodeproj/project.pbxproj:
712         * bindings/js/JSCryptoAlgorithmDictionary.cpp: Removed.
713         * bindings/js/JSCryptoAlgorithmDictionary.h: Removed.
714         * bindings/js/JSCryptoKeySerializationJWK.cpp: Removed.
715         * bindings/js/JSCryptoKeySerializationJWK.h: Removed.
716         * bindings/js/JSCryptoOperationData.cpp: Removed.
717         * bindings/js/JSCryptoOperationData.h: Removed.
718         * bindings/js/JSWebKitSubtleCryptoCustom.cpp: Removed.
719         * crypto/CryptoAlgorithm.cpp:
720         (WebCore::CryptoAlgorithm::deriveKey): Deleted.
721         (WebCore::CryptoAlgorithm::encryptForWrapKey): Deleted.
722         (WebCore::CryptoAlgorithm::decryptForUnwrapKey): Deleted.
723         * crypto/CryptoAlgorithm.h:
724         * crypto/CryptoAlgorithmParametersDeprecated.h: Removed.
725         * crypto/CryptoKeySerialization.h: Removed.
726         * crypto/WebKitSubtleCrypto.cpp: Removed.
727         * crypto/WebKitSubtleCrypto.h: Removed.
728         * crypto/WebKitSubtleCrypto.idl: Removed.
729         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
730         (WebCore::CryptoAlgorithmAES_CBC::keyAlgorithmMatches const): Deleted.
731         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
732         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
733         (WebCore::CryptoAlgorithmAES_KW::encryptForWrapKey): Deleted.
734         (WebCore::CryptoAlgorithmAES_KW::decryptForUnwrapKey): Deleted.
735         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
736         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
737         (WebCore::CryptoAlgorithmHMAC::keyAlgorithmMatches const): Deleted.
738         * crypto/algorithms/CryptoAlgorithmHMAC.h:
739         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
740         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
741         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
742         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::keyAlgorithmMatches const): Deleted.
743         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
744         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
745         (WebCore::CryptoAlgorithmRSA_OAEP::keyAlgorithmMatches const): Deleted.
746         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
747         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
748         * crypto/algorithms/CryptoAlgorithmSHA1.h:
749         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
750         * crypto/algorithms/CryptoAlgorithmSHA224.h:
751         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
752         * crypto/algorithms/CryptoAlgorithmSHA256.h:
753         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
754         * crypto/algorithms/CryptoAlgorithmSHA384.h:
755         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
756         * crypto/algorithms/CryptoAlgorithmSHA512.h:
757         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
758         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
759         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
760         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
761         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
762         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
763         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
764         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
765         * crypto/keys/CryptoKeySerializationRaw.cpp: Removed.
766         * crypto/keys/CryptoKeySerializationRaw.h: Removed.
767         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
768         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
769         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
770         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
771         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
772         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
773         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
774         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
775         * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h: Removed.
776         * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h: Removed.
777         * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Removed.
778         * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h: Removed.
779         * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Removed.
780         * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h: Removed.
781         * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Removed.
782         * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h: Removed.
783         * features.json:
784         * page/Crypto.cpp:
785         * page/Crypto.h:
786         * page/Crypto.idl:
787
788 2017-08-18  Tim Horton  <timothy_horton@apple.com>
789
790         Remove classic mode screen scale clamping
791         https://bugs.webkit.org/show_bug.cgi?id=175739
792         <rdar://problem/33894531>
793
794         Reviewed by Andy Estes.
795
796         * platform/ios/PlatformScreenIOS.mm:
797         (WebCore::screenScaleFactor):
798         This code is no longer needed.
799
800 2017-08-18  Daewoong Jang  <daewoong.jang@navercorp.com>
801
802         [Curl] Improve multi-threaded networking
803         https://bugs.webkit.org/show_bug.cgi?id=175713
804
805         Reviewed by Alex Christensen.
806
807         * platform/Curl.cmake:
808         * platform/network/ResourceHandleInternal.h:
809         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
810         (WebCore::ResourceHandleInternal::m_failureTimer): Deleted.
811         * platform/network/curl/CurlCacheManager.cpp:
812         (WebCore::CurlCacheManager::didReceiveResponse):
813         * platform/network/curl/CurlDownload.cpp:
814         (WebCore::CurlDownload::init):
815         (WebCore::CurlDownload::start):
816         (WebCore::CurlDownload::cancel):
817         (WebCore::CurlDownload::retain):
818         (WebCore::CurlDownload::release):
819         (WebCore::CurlDownload::setupRequest):
820         (WebCore::CurlDownload::notifyFinish):
821         (WebCore::CurlDownload::notifyFail):
822         * platform/network/curl/CurlDownload.h:
823         * platform/network/curl/CurlJobManager.cpp:
824         (WebCore::CurlJobList::isEmpty const):
825         (WebCore::CurlJobList::startJobs):
826         (WebCore::CurlJobList::finishJobs):
827         (WebCore::CurlJobList::notifyResult):
828         (WebCore::CurlJobManager::add):
829         (WebCore::CurlJobManager::cancel):
830         (WebCore::CurlJobManager::callOnJobThread):
831         (WebCore::CurlJobManager::startThreadIfNeeded):
832         (WebCore::CurlJobManager::updateJobList):
833         (WebCore::CurlJobManager::workerThread):
834         (WebCore::CurlJobList::append): Deleted.
835         (WebCore::CurlJobList::cancel): Deleted.
836         (WebCore::CurlJobList::complete): Deleted.
837         (WebCore::CurlJobList::withJob): Deleted.
838         (WebCore::CurlJobList::withCurlHandle): Deleted.
839         (WebCore::CurlJob::invoke): Deleted.
840         (WebCore::CurlJobManager::updateJobs): Deleted.
841         * platform/network/curl/CurlJobManager.h:
842         (WebCore::CurlJob::CurlJob): Deleted.
843         (WebCore::CurlJob::~CurlJob): Deleted.
844         (WebCore::CurlJob::operator=): Deleted.
845         (WebCore::CurlJob::curlHandle const): Deleted.
846         (WebCore::CurlJob::ticket const): Deleted.
847         (WebCore::CurlJob::finished): Deleted.
848         (WebCore::CurlJob::error): Deleted.
849         (WebCore::CurlJob::cancel): Deleted.
850         (WebCore::CurlJobManager::isActiveJob const): Deleted.
851         * platform/network/curl/MultipartHandle.cpp:
852         (WebCore::MultipartHandle::didReceiveData):
853         * platform/network/curl/ResourceHandleCurl.cpp:
854         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
855         (WebCore::ResourceHandle::start):
856         (WebCore::ResourceHandle::cancel):
857         (WebCore::ResourceHandle::platformSetDefersLoading):
858         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
859         (WebCore::ResourceHandle::receivedCredential):
860         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
861         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
862         (WebCore::ResourceHandleInternal::initialize): Deleted.
863         (WebCore::ResourceHandleInternal::applyAuthentication): Deleted.
864         (WebCore::getFormElementsCount): Deleted.
865         (WebCore::ResourceHandleInternal::setupPUT): Deleted.
866         (WebCore::ResourceHandleInternal::setupPOST): Deleted.
867         (WebCore::ResourceHandleInternal::setupFormData): Deleted.
868         (WebCore::ResourceHandleInternal::didFinish): Deleted.
869         (WebCore::ResourceHandleInternal::didFail): Deleted.
870         (WebCore::ResourceHandleInternal::calculateWebTimingInformations): Deleted.
871         (WebCore::ResourceHandleInternal::handleLocalReceiveResponse): Deleted.
872         (WebCore::isHttpInfo): Deleted.
873         (WebCore::isHttpRedirect): Deleted.
874         (WebCore::isHttpAuthentication): Deleted.
875         (WebCore::isHttpNotModified): Deleted.
876         (WebCore::isAppendableHeader): Deleted.
877         (WebCore::removeLeadingAndTrailingQuotes): Deleted.
878         (WebCore::getProtectionSpace): Deleted.
879         (WebCore::ResourceHandleInternal::willPrepareSendData): Deleted.
880         (WebCore::ResourceHandleInternal::didReceiveHeaderLine): Deleted.
881         (WebCore::ResourceHandleInternal::didReceiveAllHeaders): Deleted.
882         (WebCore::ResourceHandleInternal::didReceiveContentData): Deleted.
883         (WebCore::ResourceHandleInternal::readCallback): Deleted.
884         (WebCore::ResourceHandleInternal::headerCallback): Deleted.
885         (WebCore::ResourceHandleInternal::writeCallback): Deleted.
886         (WebCore::ResourceHandleInternal::dispatchSynchronousJob): Deleted.
887         (WebCore::ResourceHandleInternal::handleDataURL): Deleted.
888         * platform/network/curl/ResourceHandleCurlDelegate.cpp: Added.
889         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
890         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
891         (WebCore::ResourceHandleCurlDelegate::hasHandle const):
892         (WebCore::ResourceHandleCurlDelegate::releaseHandle):
893         (WebCore::ResourceHandleCurlDelegate::start):
894         (WebCore::ResourceHandleCurlDelegate::cancel):
895         (WebCore::ResourceHandleCurlDelegate::setDefersLoading):
896         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
897         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
898         (WebCore::ResourceHandleCurlDelegate::retain):
899         (WebCore::ResourceHandleCurlDelegate::release):
900         (WebCore::ResourceHandleCurlDelegate::setupRequest):
901         (WebCore::ResourceHandleCurlDelegate::notifyFinish):
902         (WebCore::ResourceHandleCurlDelegate::notifyFail):
903         (WebCore::ResourceHandleCurlDelegate::response):
904         (WebCore::ResourceHandleCurlDelegate::setupAuthentication):
905         (WebCore::removeLeadingAndTrailingQuotes):
906         (WebCore::ResourceHandleCurlDelegate::getProtectionSpace):
907         (WebCore::isHttpInfo):
908         (WebCore::isHttpRedirect):
909         (WebCore::isHttpAuthentication):
910         (WebCore::isHttpNotModified):
911         (WebCore::isAppendableHeader):
912         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderLine):
913         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
914         (WebCore::ResourceHandleCurlDelegate::didReceiveContentData):
915         (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
916         (WebCore::ResourceHandleCurlDelegate::prepareSendData):
917         (WebCore::ResourceHandleCurlDelegate::didFinish):
918         (WebCore::ResourceHandleCurlDelegate::didFail):
919         (WebCore::ResourceHandleCurlDelegate::handleDataURL):
920         (WebCore::ResourceHandleCurlDelegate::setupPOST):
921         (WebCore::ResourceHandleCurlDelegate::setupPUT):
922         (WebCore::ResourceHandleCurlDelegate::getFormElementsCount):
923         (WebCore::ResourceHandleCurlDelegate::setupFormData):
924         (WebCore::ResourceHandleCurlDelegate::applyAuthentication):
925         (WebCore::ResourceHandleCurlDelegate::setWebTimings):
926         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
927         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
928         (WebCore::ResourceHandleCurlDelegate::willSendData):
929         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderCallback):
930         (WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback):
931         (WebCore::ResourceHandleCurlDelegate::willSendDataCallback):
932         * platform/network/curl/ResourceHandleCurlDelegate.h: Added.
933
934 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
935
936         iOS 10 debug build fix.
937
938         * dom/DataTransfer.cpp:
939         (WebCore::DataTransfer::DataTransfer):
940
941 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
942
943         Rename DataTransferAccessPolicy to match spec and refactor related node
944         https://bugs.webkit.org/show_bug.cgi?id=175704
945
946         Reviewed by Wenson Hsieh.
947
948         Renamed DataTransferAccessPolicy to DataTransfer::StoreMode to match the drag data store mode concept
949         in the HTML5 specification:
950         https://html.spec.whatwg.org/multipage/dnd.html#drag-data-store-mode
951
952         DataTransfer in addition to those states can be disassociated from the drag data store when it becomes
953         no longer valid. We also support a special mode which allows only updating the drag image.
954         These two states, Invalid and DragImageWritable, are added in addition to the three states in the spec.
955
956         Also split DragAndDrop type of DataTransfer into DragAndDropData and DragAndDropFiles, and refactored
957         the related code.
958
959         No new tests since there should be no behavioral change.
960
961         * WebCore.xcodeproj/project.pbxproj:
962         * dom/DataTransfer.cpp:
963         (WebCore::DataTransfer::DataTransfer): No longer takes forFileDrag boolean since it's folded into type.
964         (WebCore::DataTransfer::createForCopyAndPaste):
965         (WebCore::DataTransfer::~DataTransfer):
966         (WebCore::DataTransfer::setAccessPolicy): Deleted.
967         (WebCore::DataTransfer::canReadTypes const):
968         (WebCore::DataTransfer::canReadData const):
969         (WebCore::DataTransfer::canWriteData const):
970         (WebCore::DataTransfer::createForInputEvent):
971         (WebCore::DataTransfer::createForDrag):
972         (WebCore::DataTransfer::createForDrop):
973         (WebCore::DataTransfer::canSetDragImage const):
974         * dom/DataTransfer.h:
975         (WebCore::DataTransfer::makeInvalidForSecurity): Added.
976         (WebCore::DataTransfer::makeDragImageWritable): Added.
977         * dom/DataTransferAccessPolicy.h: Removed.
978         * editing/Editor.cpp:
979         (WebCore::dispatchClipboardEvent): Moved and renamed from dispatchCPPEvent. Now computes the store mode
980         inside the function to match the spec: https://w3c.github.io/clipboard-apis/#fire-a-clipboard-event
981         (WebCore::Editor::canDHTMLCut):
982         (WebCore::Editor::canDHTMLCopy):
983         (WebCore::Editor::canDHTMLPaste):
984         (WebCore::Editor::tryDHTMLCopy):
985         (WebCore::Editor::tryDHTMLCut):
986         (WebCore::Editor::tryDHTMLPaste):
987         (WebCore::Editor::dispatchCPPEvent): Deleted.
988         * editing/Editor.h:
989         * page/DragController.cpp:
990         (WebCore::createDataTransferToUpdateDrag): Extracted to share code.
991         (WebCore::DragController::dragExited):
992         (WebCore::DragController::performDragOperation):
993         (WebCore::DragController::tryDHTMLDrag):
994         * page/EventHandler.cpp:
995         (WebCore::EventHandler::invalidateDataTransfer):
996         (WebCore::EventHandler::handleDrag):
997
998 2017-08-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
999
1000         Followup (r220289): RenderImageResourceStyleImage code clean up
1001         https://bugs.webkit.org/show_bug.cgi?id=175444
1002
1003         Reviewed by Darin Adler.
1004
1005         RenderImageResourceStyleImage may be created with a StyleImage of type
1006         StyleGeneratedImage. It may also be associated with a CachedImage which 
1007         is loaded through a source URL. In this case, adding and removing m_renderer
1008         as a client of the CachedImage will be done through 
1009         RenderImageResource::setCachedImage().
1010
1011         RenderImageResource::setCachedImage() is already called from 
1012         ImageLoader::updateRenderer() when the CachedImage finishes loading. This
1013         call adds m_renderer to the clients of the CachedImage. 
1014         RenderImageResource::setCachedImage() will also be called from 
1015         RenderImageResourceStyleImage::shutdown() via RenderImageResource::shutdown()
1016         to remove m_renderer from the clients of CachedImage by passing a null pointer.
1017
1018         * rendering/RenderImage.cpp:
1019         (WebCore::RenderImage::styleWillChange):
1020         * rendering/RenderImageResource.cpp:
1021         (WebCore::RenderImageResource::initialize):
1022         (WebCore::RenderImageResource::shutdown):
1023         (WebCore::RenderImageResource::setCachedImage):
1024         (WebCore::RenderImageResource::resetAnimation):
1025         (WebCore::RenderImageResource::image const):
1026         (WebCore::RenderImageResource::setContainerSizeForRenderer):
1027         (WebCore::RenderImageResource::imageSize const):
1028         (WebCore::RenderImageResource::~RenderImageResource): Deleted.
1029         (WebCore::RenderImageResource::errorOccurred const): Deleted.
1030         (WebCore::RenderImageResource::imageHasRelativeWidth const): Deleted.
1031         (WebCore::RenderImageResource::imageHasRelativeHeight const): Deleted.
1032         (WebCore::RenderImageResource::intrinsicSize const): Deleted.
1033         (WebCore::RenderImageResource::getImageSize const): Deleted.
1034         * rendering/RenderImageResource.h:
1035         (WebCore::RenderImageResource::initialize):
1036         (WebCore::RenderImageResource::renderer const):
1037         (WebCore::RenderImageResource::errorOccurred const):
1038         (WebCore::RenderImageResource::imageHasRelativeWidth const):
1039         (WebCore::RenderImageResource::imageHasRelativeHeight const):
1040         (WebCore::RenderImageResource::imageSize const):
1041         (WebCore::RenderImageResource::intrinsicSize const):
1042         (WebCore::RenderImageResource::imagePtr const):
1043         * rendering/RenderImageResourceStyleImage.cpp:
1044         (WebCore::RenderImageResourceStyleImage::initialize):
1045         (WebCore::RenderImageResourceStyleImage::shutdown):
1046         (WebCore::RenderImageResourceStyleImage::image const):
1047         (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer):
1048         (WebCore::RenderImageResourceStyleImage::~RenderImageResourceStyleImage): Deleted.
1049         * rendering/RenderImageResourceStyleImage.h:
1050         * rendering/RenderSnapshottedPlugIn.cpp:
1051         (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn):
1052         * rendering/svg/RenderSVGImage.cpp:
1053         (WebCore::RenderSVGImage::RenderSVGImage):
1054
1055 2017-08-18  Jiewen Tan  <jiewen_tan@apple.com>
1056
1057         [WebCrypto][Mac] Replace CCECCryptorGetKeyComponents with CCECCryptorExportKey for exporting ECC JWKs
1058         https://bugs.webkit.org/show_bug.cgi?id=175657
1059         <rdar://problem/33797150>
1060
1061         Reviewed by Brent Fulgham.
1062
1063         CCECCryptorGetKeyComponents returns components in unpadded formats. In some minor cases, the ECC components
1064         do need padding. Therefore, we occasionally see some corrupted outputs in JWKs. To overcome that, this patch
1065         replaces CCECCryptorGetKeyComponents with CCECCryptorExportKey which does padding all the time.
1066
1067         In the meantime, this patch also makes export* methods return OperationError if any error occur in the
1068         underlying operations though very unlikely.
1069
1070         Test: crypto/subtle/ecdsa-generate-export-import-jwk-sign-verify.html
1071
1072         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
1073         (WebCore::CryptoAlgorithmECDH::exportKey):
1074         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
1075         (WebCore::CryptoAlgorithmECDSA::exportKey):
1076         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1077         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1078         * crypto/keys/CryptoKeyEC.cpp:
1079         (WebCore::CryptoKeyEC::exportRaw const):
1080         (WebCore::CryptoKeyEC::exportJwk const):
1081         (WebCore::CryptoKeyEC::exportSpki const):
1082         (WebCore::CryptoKeyEC::exportPkcs8 const):
1083         * crypto/keys/CryptoKeyEC.h:
1084         * crypto/mac/CryptoKeyECMac.cpp:
1085         (WebCore::CryptoKeyEC::platformExportRaw const):
1086         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1087         (WebCore::CryptoKeyEC::platformExportSpki const):
1088         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
1089
1090 2017-08-18  Per Arne Vollan  <pvollan@apple.com>
1091
1092         [Win] accessibility/heading-crash-after-hidden.html is a flaky crash.
1093         https://bugs.webkit.org/show_bug.cgi?id=173536
1094
1095         Reviewed by Brent Fulgham.
1096
1097         If the tree state is dirty, accessible objects are deleted while iterating over children
1098         under AccessibilityNodeObject::textUnderElement when the style is updated. Make sure the
1099         style is updated before this method is called.
1100
1101         No new tests, covered by existing tests.
1102
1103         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
1104         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
1105
1106 2017-08-18  Youenn Fablet  <youenn@apple.com>
1107
1108         [Cache API] Add response body storage
1109         https://bugs.webkit.org/show_bug.cgi?id=175658
1110
1111         Reviewed by Alex Christensen.
1112
1113         Covered by rebased tests.
1114         Tests are still flaky until waiting for end of fetch load is implemented.
1115
1116         Adding a response body within CacheStorageConnection::Record.
1117         Adding ability to pass this body from/to the main thread.
1118
1119         Adding response body consumption into a CacheStorageConnection::Record.
1120         Adding response body setting from a CacheStorageConnection::Record.
1121
1122         * Modules/beacon/NavigatorBeacon.cpp:
1123         (WebCore::NavigatorBeacon::sendBeacon):
1124         * Modules/cache/Cache.cpp:
1125         (WebCore::Cache::put):
1126         (WebCore::toConnectionRecord):
1127         (WebCore::Cache::updateRecords):
1128         * Modules/cache/CacheStorageConnection.cpp:
1129         (WebCore::CacheStorageConnection::copyResponseBody):
1130         (WebCore::CacheStorageConnection::isolatedResponseBody):
1131         (WebCore::CacheStorageConnection::Record::copy const):
1132         * Modules/cache/CacheStorageConnection.h:
1133         * Modules/cache/WorkerCacheStorageConnection.cpp:
1134         (WebCore::toCrossThreadRecordData):
1135         (WebCore::fromCrossThreadRecordData):
1136         * Modules/fetch/FetchBody.cpp:
1137         (WebCore::FetchBody::bodyAsFormData const):
1138         (WebCore::FetchBody::take):
1139         (WebCore::FetchBody::bodyForInternalRequest const): Deleted.
1140         * Modules/fetch/FetchBody.h:
1141         (WebCore::FetchBody::setAsFormData):
1142         * Modules/fetch/FetchBodyConsumer.h:
1143         (WebCore::FetchBodyConsumer::setData):
1144         * Modules/fetch/FetchRequest.cpp:
1145         (WebCore::FetchRequest::resourceRequest const):
1146         * Modules/fetch/FetchResponse.cpp:
1147         (WebCore::FetchResponse::consumeBody):
1148         (WebCore::FetchResponse::setBodyData):
1149         * Modules/fetch/FetchResponse.h:
1150
1151 2017-08-18  Youenn Fablet  <youenn@apple.com>
1152
1153         [Fetch API] Add support for a callback-based fetch
1154         https://bugs.webkit.org/show_bug.cgi?id=175710
1155
1156         Reviewed by Alex Christensen.
1157
1158         No change of behavior.
1159
1160         Moving from a DOMPromise to a Callback taking an ExceptionOr<FetchResponse&>.
1161         Updating window and worker call sites.
1162
1163         * Modules/fetch/DOMWindowFetch.cpp:
1164         (WebCore::DOMWindowFetch::fetch):
1165         * Modules/fetch/FetchResponse.cpp:
1166         (WebCore::FetchResponse::fetch):
1167         (WebCore::FetchResponse::BodyLoader::didFail):
1168         (WebCore::FetchResponse::BodyLoader::BodyLoader):
1169         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
1170         (WebCore::FetchResponse::BodyLoader::stop):
1171         * Modules/fetch/FetchResponse.h:
1172         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
1173         (WebCore::WorkerGlobalScopeFetch::fetch):
1174
1175 2017-08-18  Brady Eidson  <beidson@apple.com>
1176
1177         Bounce ServiceWorker jobs to the Storage Process.
1178         https://bugs.webkit.org/show_bug.cgi?id=175650
1179
1180         Reviewed by Andy Estes.
1181
1182         No new tests (Covered by both changes and consistencies in existing tests)
1183
1184         This lays the groundwork for the SW job queue being in the StorageProcess by actually
1185         setting up some objects for IPC communication and actually sending things over the wire.
1186
1187         The main point of IPC is the WebCore abstract base class "SWServer::Connection"
1188
1189         A collection of them will soon be managed by the SWServer itself in the StorageProcess.
1190
1191         That object will be the stand-in for IPC on both the WebProcess and StorageProcess side.
1192
1193         Currently, any job that we try to schedule still immediately rejects (though now it does
1194         so asynchronously instead of synchronously).
1195
1196         * CMakeLists.txt:
1197         * WebCore.xcodeproj/project.pbxproj:
1198
1199         * dom/ExceptionData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
1200         (WebCore::ExceptionData::toException const):
1201         (WebCore::ExceptionData::encode const):
1202         (WebCore::ExceptionData::decode):
1203
1204         * workers/service/ServiceWorkerContainer.cpp:
1205         (WebCore::ServiceWorkerContainer::addRegistration):
1206         (WebCore::ServiceWorkerContainer::scheduleJob):
1207         * workers/service/ServiceWorkerContainer.h:
1208
1209         * workers/service/ServiceWorkerJob.cpp:
1210         (WebCore::ServiceWorkerJob::failedWithException):
1211         (WebCore::ServiceWorkerJob::data const):
1212         * workers/service/ServiceWorkerJob.h:
1213
1214         * workers/service/ServiceWorkerJobData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
1215         (WebCore::ServiceWorkerJobData::encode const):
1216         (WebCore::ServiceWorkerJobData::decode):
1217
1218         * workers/service/ServiceWorkerJobType.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
1219
1220         * workers/service/ServiceWorkerProvider.h:
1221
1222         * workers/service/ServiceWorkerRegistrationParameters.h:
1223
1224         * workers/service/server/SWServer.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
1225         (WebCore::SWServer::Connection::scheduleJob):
1226         (WebCore::SWServer::Connection::jobRejected):
1227         * workers/service/server/SWServer.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
1228         (WebCore::SWServer::Connection::~Connection):
1229
1230 2017-08-18  Chris Dumez  <cdumez@apple.com>
1231
1232         [Beacon] Add support for quota limitation
1233         https://bugs.webkit.org/show_bug.cgi?id=175443
1234         <rdar://problem/33729002>
1235
1236         Reviewed by Youenn Fablet.
1237
1238         LoaderStrategy::startPingLoad() now takes a completion handler parameter, allowing CachedResource::load()
1239         to know when a Beacon load is complete. This was needed in order for the fetch in-flight keepalive request
1240         quota limit to work properly for beacon loads as well. We need to know when the beacon load completes in
1241         order to know if the beacon is in-flight or not and only free up its allocated quota once it is no longer
1242         in-flight.
1243
1244         No new tests, updated existing test.
1245
1246         * loader/LoaderStrategy.h:
1247         * loader/PingLoader.cpp:
1248         (WebCore::PingLoader::startPingLoad):
1249         * loader/cache/CachedResource.cpp:
1250         (WebCore::CachedResource::load):
1251         * platform/network/PingHandle.h:
1252
1253 2017-08-18  Youenn Fablet  <youenn@apple.com>
1254
1255         [Cache API] Add a WK2 implementation of CacheStorageConnection
1256         https://bugs.webkit.org/show_bug.cgi?id=175640
1257
1258         Reviewed by Alex Christensen & Chris Dumez.
1259
1260         * Modules/cache/CacheStorageConnection.cpp: Adding Internal error.
1261         * Modules/cache/CacheStorageConnection.h: Ditto.
1262         * WebCore.xcodeproj/project.pbxproj: Exporting CacheQueryOptions.h header.
1263
1264 2017-08-18  Antti Koivisto  <antti@apple.com>
1265
1266         Factor render tree mutation code from RenderListItem to RenderTreeUpdater
1267         https://bugs.webkit.org/show_bug.cgi?id=175718
1268
1269         Reviewed by Andreas Kling.
1270
1271         We already stopped doing layout time mutations. We can now move the code out too.
1272
1273         * WebCore.xcodeproj/project.pbxproj:
1274         * rendering/RenderListItem.cpp:
1275         (WebCore::isHTMLListElement):
1276         (WebCore::getParentOfFirstLineBox): Deleted.
1277         (WebCore::firstNonMarkerChild): Deleted.
1278         (WebCore::RenderListItem::updateMarkerRenderer): Deleted.
1279
1280             Moved to RenderTreeUpdater::ListItem.
1281
1282         * rendering/RenderListItem.h:
1283         * rendering/RenderListMarker.cpp:
1284         (WebCore::RenderListMarker::willBeDestroyed):
1285         * rendering/TextAutoSizing.cpp:
1286         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
1287         * style/RenderTreeUpdater.cpp:
1288         (WebCore::RenderTreeUpdater::pushParent):
1289         (WebCore::RenderTreeUpdater::popParent):
1290         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
1291         (WebCore::RenderTreeUpdater::updateAfterDescendants):
1292
1293             Factor pre/post update into functions.
1294
1295         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1296         * style/RenderTreeUpdater.h:
1297         * style/RenderTreeUpdaterListItem.cpp: Added.
1298
1299             Mutation functions move here.
1300
1301         (WebCore::getParentOfFirstLineBox):
1302         (WebCore::firstNonMarkerChild):
1303         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
1304         * style/RenderTreeUpdaterListItem.h: Added.
1305
1306 2017-08-18  Ms2ger  <Ms2ger@gmail.com>
1307
1308         [GTK] Show controls if a video element isn't allowed to play inline.
1309         https://bugs.webkit.org/show_bug.cgi?id=141705
1310
1311         Reviewed by Xabier Rodriguez-Calvar.
1312
1313         Test: covered by media/video-fullscreeen-only-controls.html [sic].
1314
1315         * Modules/mediacontrols/mediaControlsGtk.js:
1316         (ControllerGtk.prototype.shouldHaveControls):
1317
1318 2017-08-18  Zan Dobersek  <zdobersek@igalia.com>
1319
1320         [EME] MediaKeySession has to initiate playback resume on HTMLMediaElement
1321         https://bugs.webkit.org/show_bug.cgi?id=175671
1322
1323         Reviewed by Xabier Rodriguez-Calvar.
1324
1325         In MediaKeySession::updateKeyStatuses(), HTMLMediaElement objects that are
1326         associated with the MediaKeys instance that created this session have to
1327         be notified in order to run the 'Attempt to Resume Playback If Necessary'
1328         algorithm.
1329
1330         MediaKeys object now tracks the sessions that were created through it.
1331         MediaKeySession object is passed a MediaKeys reference, and has that
1332         reference invalidated if/when the MediaKeys object is destroyed.
1333
1334         In MediaKeySession::updateKeyStatuses(), a task is now queued, notifying
1335         the MediaKeys object, if any, that the associated HTMLMediaElement
1336         instances have to run the mentioned algorithm. The associated media
1337         elements are stored through CDMClient pointers, with HTMLMediaElement
1338         class inheriting from the newly-introduced CDMClient interface.
1339
1340         HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary() is left
1341         unimplemented for now. The object will attach itself to and detach from
1342         the associated MediaKeys object in setMediaKeys() and the destructor,
1343         enabling the MediaKeys object to properly dispatch the playback resume
1344         requests for the attached clients.
1345
1346         * Modules/encryptedmedia/CDMClient.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
1347         (WebCore::CDMClient::~CDMClient):
1348         * Modules/encryptedmedia/MediaKeySession.cpp:
1349         (WebCore::MediaKeySession::create):
1350         (WebCore::MediaKeySession::MediaKeySession):
1351         (WebCore::MediaKeySession::detachKeys):
1352         (WebCore::MediaKeySession::updateKeyStatuses):
1353         * Modules/encryptedmedia/MediaKeySession.h:
1354         * Modules/encryptedmedia/MediaKeys.cpp:
1355         (WebCore::MediaKeys::~MediaKeys):
1356         (WebCore::MediaKeys::createSession):
1357         (WebCore::MediaKeys::attachCDMClient):
1358         (WebCore::MediaKeys::detachCDMClient):
1359         (WebCore::MediaKeys::attemptToResumePlaybackOnClients):
1360         * Modules/encryptedmedia/MediaKeys.h:
1361         * html/HTMLMediaElement.cpp:
1362         (WebCore::HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary):
1363         * html/HTMLMediaElement.h:
1364
1365 2017-08-18  Commit Queue  <commit-queue@webkit.org>
1366
1367         Unreviewed, rolling out r220854.
1368         https://bugs.webkit.org/show_bug.cgi?id=175716
1369
1370         I'm not sure we really need this (Requested by KaL on
1371         #webkit).
1372
1373         Reverted changeset:
1374
1375         "[GTK][WPE] Add NTLM authentication enabled API"
1376         https://bugs.webkit.org/show_bug.cgi?id=122952
1377         http://trac.webkit.org/changeset/220854
1378
1379 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1380
1381         [Input Events] Rename inputType "formatForeColor" to "formatFontColor"
1382         https://bugs.webkit.org/show_bug.cgi?id=175703
1383
1384         Reviewed by Ryosuke Niwa.
1385
1386         Renames an inputType value to match the spec. There is no other change in behavior.
1387         Rebaselines fast/events/input-events-selection-forecolor-data.html and fast/events/input-events-forecolor-data.html.
1388
1389         * editing/EditCommand.cpp:
1390         (WebCore::inputTypeNameForEditingAction):
1391
1392 2017-08-17  Daewoong Jang  <daewoong.jang@navercorp.com>
1393
1394         [Curl] Improve multi-threaded networking
1395         https://bugs.webkit.org/show_bug.cgi?id=175253
1396
1397         Reviewed by Alex Christensen.
1398
1399         * platform/network/curl/CurlContext.cpp:
1400         (WebCore::CurlMultiHandle::CurlMultiHandle):
1401         (WebCore::CurlHandle::CurlHandle):
1402         (WebCore::CurlHandle::initialize):
1403         (WebCore::CurlHandle::setSslKeyPassword):
1404         (WebCore::CurlHandle::setSslErrors):
1405         (WebCore::CurlHandle::getSslErrors):
1406         * platform/network/curl/CurlContext.h:
1407         * platform/network/curl/CurlDownload.cpp:
1408         (WebCore::CurlDownload::init):
1409         (WebCore::CurlDownload::getResponse const):
1410         (WebCore::CurlDownload::setupRequest):
1411         (WebCore::CurlDownload::didReceiveHeader):
1412         (WebCore::CurlDownload::didReceiveData):
1413         (WebCore::CurlDownload::headerCallback):
1414         (WebCore::CurlDownload::getTempPath const): Deleted.
1415         (WebCore::CurlDownload::getUrl const): Deleted.
1416         (WebCore::CurlDownload::downloadFinishedCallback): Deleted.
1417         (WebCore::CurlDownload::downloadFailedCallback): Deleted.
1418         (WebCore::CurlDownload::receivedDataCallback): Deleted.
1419         (WebCore::CurlDownload::receivedResponseCallback): Deleted.
1420         * platform/network/curl/CurlDownload.h:
1421         * platform/network/curl/ResourceError.h:
1422         (WebCore::ResourceError::ResourceError):
1423         (WebCore::ResourceError::sslErrors const):
1424         (WebCore::ResourceError::setSSLErrors): Deleted.
1425         * platform/network/curl/ResourceHandleCurl.cpp:
1426         (WebCore::ResourceHandleInternal::initialize):
1427         (WebCore::ResourceHandleInternal::didFail):
1428         (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
1429         * platform/network/curl/SSLHandle.cpp:
1430         (WebCore::allowedClientHosts):
1431         (WebCore::addAllowedClientCertificate):
1432         (WebCore::getSSLClientCertificate):
1433         (WebCore::certVerifyCallback):
1434         (WebCore::setSSLVerifyOptions):
1435         (WebCore::setSSLClientCertificate): Deleted.
1436         * platform/network/curl/SSLHandle.h:
1437
1438 2017-08-17  Chris Dumez  <cdumez@apple.com>
1439
1440         Regression(r220817): We should only copy the original request headers for Ping loads
1441         https://bugs.webkit.org/show_bug.cgi?id=175679
1442
1443         Reviewed by Youenn Fablet.
1444
1445         For performance reason, we should only copy the original request headers for Ping loads
1446         (Beacon at the moment), not for all CachedResourceRequests.
1447
1448         * loader/LoaderStrategy.h:
1449         * loader/cache/CachedResource.cpp:
1450         (WebCore::CachedResource::CachedResource):
1451         (WebCore::CachedResource::load):
1452         * loader/cache/CachedResource.h:
1453         (WebCore::CachedResource::shouldUsePingLoad):
1454         (WebCore::CachedResource::setOriginalRequestHeaders):
1455         * loader/cache/CachedResourceLoader.cpp:
1456         (WebCore::CachedResourceLoader::requestResource):
1457         * loader/cache/CachedResourceRequest.cpp:
1458         (WebCore::CachedResourceRequest::CachedResourceRequest):
1459         * loader/cache/CachedResourceRequest.h:
1460         (WebCore::CachedResourceRequest::releaseResourceRequest):
1461         (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders): Deleted.
1462
1463 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
1464
1465         [PAL] Relocate SessionID to root
1466         https://bugs.webkit.org/show_bug.cgi?id=175684
1467
1468         Reviewed by Alex Christensen.
1469
1470         No new tests. No change in functionality.
1471
1472         * dom/Document.h:
1473         * html/HTMLMediaElement.cpp:
1474         * loader/cache/CachedResource.h:
1475         * loader/cache/CachedResourceLoader.cpp:
1476         * loader/cache/MemoryCache.h:
1477         * loader/cocoa/DiskCacheMonitorCocoa.h:
1478         * page/CacheStorageProvider.h:
1479         * page/Page.h:
1480         * page/PlugInClient.h:
1481         * page/SocketProvider.h:
1482         * platform/CookiesStrategy.h:
1483         * platform/WebCoreCrossThreadCopier.cpp:
1484         * platform/network/CacheValidation.h:
1485         * platform/network/NetworkStorageSession.cpp:
1486         * platform/network/NetworkStorageSession.h:
1487         * platform/network/cf/SocketStreamHandleImpl.h:
1488         * platform/network/curl/SocketStreamHandleImpl.h:
1489         * platform/network/soup/SocketStreamHandleImpl.h:
1490         * workers/WorkerGlobalScope.h:
1491         * workers/service/ServiceWorkerContainer.h:
1492         * workers/service/ServiceWorkerRegistrationParameters.h:
1493
1494 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1495
1496         Fix the build on other platforms after r220865
1497         https://bugs.webkit.org/show_bug.cgi?id=175683
1498
1499         Reviewed by Tim Horton.
1500
1501         Instead of special casing iOS 10 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED < 110000, revert to special
1502         casing iOS 11 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000. This is because other targets that are
1503         neither iOS 10 nor 11 will fail the "before iOS 11" compile-time check, and subsequently assume that item
1504         providers exist. To fix this, flip the compiler-time checks and the order of codeblocks in the
1505         PlatformPasteboard::write methods.
1506
1507         There is no change in behavior.
1508
1509         * platform/ios/PlatformPasteboardIOS.mm:
1510         (WebCore::registerItemToPasteboard):
1511         (WebCore::PlatformPasteboard::write):
1512
1513 2017-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1514
1515         -Wreturn-type warnings in CryptoKey.cpp and SubtleCrypto.cpp
1516         https://bugs.webkit.org/show_bug.cgi?id=175675
1517
1518         Reviewed by Jiewen Tan.
1519
1520         * crypto/CryptoKey.cpp:
1521         (WebCore::CryptoKey::algorithm const):
1522         * crypto/SubtleCrypto.cpp:
1523         (WebCore::toCryptoKeyUsageBitmap):
1524         (WebCore::toKeyData):
1525
1526 2017-08-17  Andreas Kling  <akling@apple.com>
1527
1528         Disable CSS regions at compile time
1529         https://bugs.webkit.org/show_bug.cgi?id=175630
1530
1531         Reviewed by Antti Koivisto.
1532
1533         * Configurations/FeatureDefines.xcconfig:
1534
1535 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1536
1537         [iOS] Respect type fidelities when copying image elements to the pasteboard
1538         https://bugs.webkit.org/show_bug.cgi?id=175638
1539         <rdar://problem/26556043>
1540
1541         Reviewed by Ryosuke Niwa.
1542
1543         Ensures that we respect type fidelities when copying on iOS, by unifying pasteboard writing codepaths across
1544         dragging and copying. When dragging and copying, we now generate and set UIItemProviders on the UIPasteboard.
1545
1546         Tests: ActionSheetTests.CopyImageElementWithHREF
1547                ActionSheetTests.CopyImageElementWithoutHREF
1548
1549         * platform/PlatformPasteboard.h:
1550
1551         Remove all variants of the writeObjectRepresentations helper method. Now that both paths for writing to the
1552         pasteboard are unified, it's no longer useful to separate out item-provider-based pasteboard logic.
1553
1554         * platform/ios/AbstractPasteboard.h:
1555         * platform/ios/PlatformPasteboardIOS.mm:
1556
1557         Replaces -setItemsUsingRegistrationInfoLists: with -setRegistrationInfoLists:. Rather than have a helper that
1558         both sets up item providers and item registration lists, split this functionality out into two setters. This is
1559         because UIPasteboard does not need to know about the registration info lists used to set up the item providers
1560         in the first place, but internal drag-and-drop clients require this information immediately when starting a drag
1561         in order to construct custom drag previews.
1562
1563         (WebCore::richTextRepresentationsForPasteboardWebContent):
1564         (WebCore::registerItemToPasteboard):
1565
1566         Add a new helper to register item providers to the pasteboard, given an WebItemProviderRegistrationInfoList.
1567
1568         (WebCore::PlatformPasteboard::write):
1569         (WebCore::PlatformPasteboard::writeObjectRepresentations): Deleted.
1570
1571         Refactors PlatformPasteboard::write to always generate and set item providers, unless we're building for an SDK
1572         prior to iOS 11. For images, strings and URLs, we can simply transition to using the new item-provider-based
1573         codepaths used for drag and drop. For web content, we add two additional UTIs that were present when copying,
1574         but not when dragging: flat RTFD and a string constant used to indicate to UIKit that the pasteboard contains
1575         rich text.
1576
1577         * platform/ios/WebItemProviderPasteboard.h:
1578         * platform/ios/WebItemProviderPasteboard.mm:
1579         (-[WebItemProviderRegistrationInfoList init]):
1580         (-[WebItemProviderRegistrationInfoList addData:forType:]):
1581         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
1582         (-[WebItemProviderRegistrationInfoList numberOfItems]):
1583         (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
1584         (-[WebItemProviderRegistrationInfoList itemProvider]):
1585         (-[WebItemProviderRegistrationInfoList description]):
1586
1587         Make some small tweaks in WebItemProviderPasteboard (and related classes):
1588         1. Transition to preferredPresentationSize from estimatedDisplayedSize, which is now deprecated.
1589         2. Remove calls to -initWithItemProviderData:typeIdentifier:error:, which is deprecated.
1590         3. Rename _items to _representations to better reflect the role of WebItemProviderRegistrationInfo.
1591         4. Implement -description for WebItemProviderRegistrationInfoList for debugging purposes.
1592
1593         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1594         (-[WebItemProviderPasteboard setRegistrationInfoLists:]):
1595         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]): Deleted.
1596
1597 2017-08-17  Youenn Fablet  <youenn@apple.com>
1598
1599         Add a DOMPromiseDeferred method to handle ExceptionOr<> results
1600         https://bugs.webkit.org/show_bug.cgi?id=175603
1601
1602         Reviewed by Darin Adler.
1603
1604         No change of behavior.
1605
1606         Introduce DOMPromiseDeferred::settle to reject/resolve a promise with an ExceptionOr<>.
1607         Making batchPutOperation/batchDeleteOperation take a Function with an ExceptionOr<>.
1608         Using DOMPromiseDeferred::settle in Cache put/remove.
1609         Updated CacheStorageConnection to create ExceptionOr<> from CacheStorageConnection::Error.
1610
1611         * Modules/cache/Cache.cpp:
1612         (WebCore::Cache::put):
1613         (WebCore::Cache::remove):
1614         (WebCore::Cache::batchDeleteOperation):
1615         (WebCore::Cache::batchPutOperation):
1616         * Modules/cache/Cache.h:
1617         * Modules/cache/CacheStorage.cpp:
1618         (WebCore::CacheStorage::open):
1619         (WebCore::CacheStorage::remove):
1620         * Modules/cache/CacheStorageConnection.cpp:
1621         (WebCore::CacheStorageConnection::errorToException):
1622         * Modules/cache/CacheStorageConnection.h:
1623         (WebCore::CacheStorageConnection::errorToException):
1624         (WebCore::CacheStorageConnection::exceptionOrResult):
1625         * bindings/js/JSDOMPromiseDeferred.h:
1626         (WebCore::DOMPromiseDeferred::settle):
1627         (WebCore::DOMPromiseDeferred<void>::settle):
1628
1629 2017-08-17  Zan Dobersek  <zdobersek@igalia.com>
1630
1631         [GStreamer] AppendPipeline: support dispatch of decryption-specific GstStructure into the pipeline
1632         https://bugs.webkit.org/show_bug.cgi?id=175668
1633
1634         Reviewed by Xabier Rodriguez-Calvar.
1635
1636         Add the AppendPipeline::dispatchDecryptionStructure() method. Callers can
1637         pass in a GstStructure object that contains all the information the
1638         decryption elements in the pipeline will require to properly decrypt the
1639         content. In case the decryptor element isn't available yet, the
1640         GstStructure is stored and dispatched when that element becomes available.
1641
1642         The dispatch itself simply creates a new custom GstEvent that adopts the
1643         given GstStructure object, sends that into the pipeline element, and
1644         shifts the state to 'ongoing'.
1645
1646         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1647         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1648         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure):
1649         (WebCore::AppendPipeline::dispatchDecryptionStructure):
1650         * platform/graphics/gstreamer/mse/AppendPipeline.h: Remove a redundant private: label.
1651
1652 2017-08-17  Zan Dobersek  <zdobersek@igalia.com>
1653
1654         [GStreamer] GstStructure shouldn't be handled through GRefPtr
1655         https://bugs.webkit.org/show_bug.cgi?id=175673
1656
1657         Reviewed by Xabier Rodriguez-Calvar.
1658
1659         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1660         (webkitMediaCommonEncryptionDecryptTransformCaps): GstStructure isn't
1661         ref-counted, so it should be handled through the GUniquePtr<GstStructure>
1662         smart pointer.
1663
1664 2017-08-17  Youenn Fablet  <youenn@apple.com>
1665
1666         [Mac/iOS] Increase the audio buffer size when audio capture is on but web audio is not used
1667         https://bugs.webkit.org/show_bug.cgi?id=175631
1668
1669         Reviewed by Eric Carlson.
1670
1671         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
1672         (PlatformMediaSessionManager::updateSessionState): Change value from 128 to the equivalent of 20ms when audio capture happens but not web audio.
1673
1674 2017-08-17  Antti Koivisto  <antti@apple.com>
1675
1676         RenderListItem - Avoid render tree mutation during layout
1677         https://bugs.webkit.org/show_bug.cgi?id=175666
1678
1679         Reviewed by Andreas Kling.
1680
1681         Mutations should be done by RenderTreeUpdater only.
1682
1683         * rendering/RenderListItem.cpp:
1684         (WebCore::RenderListItem::updateMarkerRenderer):
1685
1686             This is now called by RenderTreeUpdater only.
1687             Remove code dealing with this being called at layout time.
1688             Merged marker construction code from styleDidChange here and renamed for clarity.
1689
1690         (WebCore::RenderListItem::layout):
1691         (WebCore::RenderListItem::computePreferredLogicalWidths):
1692
1693             Remove mutating calls.
1694
1695         (WebCore::RenderListItem::styleDidChange): Deleted.
1696         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded): Deleted.
1697         * rendering/RenderListItem.h:
1698         * rendering/TextAutoSizing.cpp:
1699         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
1700
1701             Call updateMarkerRenderer.
1702
1703         * style/RenderTreeUpdater.cpp:
1704         (WebCore::RenderTreeUpdater::popParent):
1705         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1706
1707             Call updateMarkerRenderer.
1708
1709 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
1710
1711         [PAL] Move SessionID into PAL
1712         https://bugs.webkit.org/show_bug.cgi?id=174192
1713
1714         Reviewed by Antti Koivisto.
1715
1716         No new tests. No change in behavior.
1717
1718         * CMakeLists.txt:
1719         * Modules/websockets/WebSocketChannel.cpp:
1720         (WebCore::WebSocketChannel::connect):
1721         * WebCore.xcodeproj/project.pbxproj:
1722         * dom/Document.cpp:
1723         (WebCore::Document::sessionID const):
1724         * dom/Document.h:
1725         * dom/ScriptExecutionContext.h:
1726         * html/HTMLMediaElement.cpp:
1727         (WebCore::HTMLMediaElement::elementWithID):
1728         (WebCore::HTMLMediaElement::finishParsingChildren):
1729         (WebCore::HTMLMediaElement::scheduleEvent):
1730         (WebCore::HTMLMediaElement::canPlayType const):
1731         (WebCore::HTMLMediaElement::load):
1732         (WebCore::HTMLMediaElement::loadResource):
1733         (WebCore::HTMLMediaElement::textTracksAreReady const):
1734         (WebCore::HTMLMediaElement::textTrackModeChanged):
1735         (WebCore::HTMLMediaElement::noneSupported):
1736         (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
1737         (WebCore::HTMLMediaElement::mediaLoadingFailed):
1738         (WebCore::HTMLMediaElement::setReadyState):
1739         (WebCore::HTMLMediaElement::addPlayedRange):
1740         (WebCore::HTMLMediaElement::seekTask):
1741         (WebCore::HTMLMediaElement::refreshCachedTime const):
1742         (WebCore::HTMLMediaElement::currentMediaTime const):
1743         (WebCore::HTMLMediaElement::setWebkitPreservesPitch):
1744         (WebCore::HTMLMediaElement::ended const):
1745         (WebCore::HTMLMediaElement::playInternal):
1746         (WebCore::HTMLMediaElement::pause):
1747         (WebCore::HTMLMediaElement::togglePlayState):
1748         (WebCore::HTMLMediaElement::beginScrubbing):
1749         (WebCore::HTMLMediaElement::playbackProgressTimerFired):
1750         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
1751         (WebCore::HTMLMediaElement::didAddTextTrack):
1752         (WebCore::HTMLMediaElement::didRemoveTextTrack):
1753         (WebCore::controllerJSValue):
1754         (WebCore::HTMLMediaElement::configureTextTracks):
1755         (WebCore::HTMLMediaElement::selectNextSourceChild):
1756         (WebCore::HTMLMediaElement::sourceWasAdded):
1757         (WebCore::HTMLMediaElement::sourceWasRemoved):
1758         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1759         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
1760         (WebCore::HTMLMediaElement::potentiallyPlaying const):
1761         (WebCore::HTMLMediaElement::endedPlayback const):
1762         (WebCore::HTMLMediaElement::stoppedDueToErrors const):
1763         (WebCore::HTMLMediaElement::updatePlayState):
1764         (WebCore::HTMLMediaElement::userCancelledLoad):
1765         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const):
1766         (WebCore::HTMLMediaElement::addEventListener):
1767         (WebCore::HTMLMediaElement::isFullscreen const):
1768         (WebCore::HTMLMediaElement::toggleStandardFullscreenState):
1769         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
1770         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
1771         (WebCore::HTMLMediaElement::updateTextTrackDisplay):
1772         (WebCore::HTMLMediaElement::mediaControls const):
1773         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
1774         (WebCore::HTMLMediaElement::setMediaGroup):
1775         (WebCore::HTMLMediaElement::setControllerForBindings):
1776         (WebCore::HTMLMediaElement::isBlockedOnMediaController const):
1777         (WebCore::HTMLMediaElement::prepareMediaFragmentURI):
1778         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1779         (WebCore::HTMLMediaElement::fileSize const):
1780         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1781         (WebCore::needsSeekingSupportQuirk):
1782         (WebCore::HTMLMediaElement::supportsSeeking const):
1783         (WebCore::HTMLMediaElement::doesHaveAttribute const):
1784         (WebCore::HTMLMediaElement::isVideoTooSmallForInlinePlayback):
1785         * loader/DocumentLoader.cpp:
1786         (WebCore::DocumentLoader::continueAfterContentPolicy):
1787         * loader/EmptyClients.cpp:
1788         * loader/FrameLoaderClient.h:
1789         * loader/cache/CachedCSSStyleSheet.cpp:
1790         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
1791         * loader/cache/CachedCSSStyleSheet.h:
1792         * loader/cache/CachedFont.cpp:
1793         (WebCore::CachedFont::CachedFont):
1794         * loader/cache/CachedFont.h:
1795         * loader/cache/CachedImage.cpp:
1796         (WebCore::CachedImage::CachedImage):
1797         * loader/cache/CachedImage.h:
1798         * loader/cache/CachedRawResource.cpp:
1799         (WebCore::CachedRawResource::CachedRawResource):
1800         * loader/cache/CachedRawResource.h:
1801         * loader/cache/CachedResource.cpp:
1802         (WebCore::CachedResource::CachedResource):
1803         * loader/cache/CachedResource.h:
1804         (WebCore::CachedResource::sessionID const):
1805         * loader/cache/CachedResourceLoader.cpp:
1806         (WebCore::createResource):
1807         (WebCore::CachedResourceLoader::sessionID const):
1808         * loader/cache/CachedResourceLoader.h:
1809         * loader/cache/CachedSVGDocument.cpp:
1810         (WebCore::CachedSVGDocument::CachedSVGDocument):
1811         * loader/cache/CachedSVGDocument.h:
1812         * loader/cache/CachedSVGFont.cpp:
1813         (WebCore::CachedSVGFont::CachedSVGFont):
1814         * loader/cache/CachedSVGFont.h:
1815         * loader/cache/CachedScript.cpp:
1816         (WebCore::CachedScript::CachedScript):
1817         * loader/cache/CachedScript.h:
1818         * loader/cache/CachedTextTrack.cpp:
1819         (WebCore::CachedTextTrack::CachedTextTrack):
1820         * loader/cache/CachedTextTrack.h:
1821         * loader/cache/CachedXSLStyleSheet.cpp:
1822         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
1823         * loader/cache/CachedXSLStyleSheet.h:
1824         * loader/cache/MemoryCache.cpp:
1825         (WebCore::MemoryCache::sessionResourceMap const):
1826         (WebCore::MemoryCache::ensureSessionResourceMap):
1827         (WebCore::MemoryCache::resourceForRequest):
1828         (WebCore::MemoryCache::addImageToCache):
1829         (WebCore::MemoryCache::removeImageFromCache):
1830         (WebCore::MemoryCache::forEachSessionResource):
1831         (WebCore::MemoryCache::removeResourcesWithOrigins):
1832         (WebCore::MemoryCache::originsWithCache const):
1833         (WebCore::MemoryCache::evictResources):
1834         * loader/cache/MemoryCache.h:
1835         * loader/cocoa/DiskCacheMonitorCocoa.h:
1836         (WebCore::DiskCacheMonitor::sessionID const):
1837         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1838         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation):
1839         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
1840         * page/CacheStorageProvider.h:
1841         * page/DatabaseProvider.h:
1842         * page/Page.cpp:
1843         (WebCore::Page::Page):
1844         (WebCore::Page::enableLegacyPrivateBrowsing):
1845         (WebCore::Page::sessionID const):
1846         (WebCore::Page::setSessionID):
1847         * page/Page.h:
1848         * page/PlugInClient.h:
1849         * page/SocketProvider.cpp:
1850         (WebCore::SocketProvider::createSocketStreamHandle):
1851         * page/SocketProvider.h:
1852         * platform/CookiesStrategy.h:
1853         * platform/WebCoreCrossThreadCopier.cpp:
1854         (WTF::PAL::SessionID>::copy):
1855         (WTF::WebCore::SessionID>::copy): Deleted.
1856         * platform/WebCoreCrossThreadCopier.h:
1857         * platform/network/CacheValidation.cpp:
1858         (WebCore::headerValueForVary):
1859         (WebCore::collectVaryingRequestHeaders):
1860         (WebCore::verifyVaryingRequestHeaders):
1861         * platform/network/CacheValidation.h:
1862         * platform/network/NetworkStorageSession.cpp:
1863         (WebCore::NetworkStorageSession::globalSessionMap):
1864         (WebCore::NetworkStorageSession::storageSession):
1865         (WebCore::NetworkStorageSession::destroySession):
1866         * platform/network/NetworkStorageSession.h:
1867         (WebCore::NetworkStorageSession::sessionID const):
1868         * platform/network/NetworkStorageSessionStub.cpp:
1869         (WebCore::NetworkStorageSession::NetworkStorageSession):
1870         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1871         (WebCore::NetworkStorageSession::ensureSession):
1872         (WebCore::NetworkStorageSession::defaultStorageSession):
1873         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1874         (WebCore::NetworkStorageSession::NetworkStorageSession):
1875         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1876         (WebCore::NetworkStorageSession::defaultStorageSession):
1877         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1878         (WebCore::NetworkStorageSession::ensureSession):
1879         * platform/network/cf/SocketStreamHandleImpl.h:
1880         (WebCore::SocketStreamHandleImpl::create):
1881         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1882         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
1883         * platform/network/curl/SocketStreamHandleImpl.h:
1884         (WebCore::SocketStreamHandleImpl::create):
1885         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1886         (WebCore::NetworkStorageSession::NetworkStorageSession):
1887         (WebCore::NetworkStorageSession::defaultStorageSession):
1888         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1889         (WebCore::NetworkStorageSession::ensureSession):
1890         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1891         * platform/network/soup/SocketStreamHandleImpl.h:
1892         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1893         (WebCore::SocketStreamHandleImpl::create):
1894         * workers/DedicatedWorkerGlobalScope.cpp:
1895         (WebCore::DedicatedWorkerGlobalScope::create):
1896         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1897         * workers/DedicatedWorkerGlobalScope.h:
1898         * workers/DedicatedWorkerThread.cpp:
1899         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1900         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1901         * workers/DedicatedWorkerThread.h:
1902         * workers/Worker.cpp:
1903         (WebCore::Worker::notifyFinished):
1904         * workers/WorkerGlobalScope.cpp:
1905         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1906         * workers/WorkerGlobalScope.h:
1907         * workers/WorkerGlobalScopeProxy.h:
1908         * workers/WorkerMessagingProxy.cpp:
1909         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1910         * workers/WorkerMessagingProxy.h:
1911         * workers/WorkerThread.cpp:
1912         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1913         (WebCore::WorkerThread::WorkerThread):
1914         * workers/WorkerThread.h:
1915         * workers/service/ServiceWorkerContainer.h:
1916         * workers/service/ServiceWorkerRegistrationParameters.h:
1917
1918 2017-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1919
1920         [GTK][WPE] Add NTLM authentication enabled API
1921         https://bugs.webkit.org/show_bug.cgi?id=122952
1922
1923         Reviewed by Michael Catanzaro.
1924
1925         Add/remove NTLM feature to/from soup session depending on whether the feature is enabled or disabled.
1926
1927         * platform/network/soup/SoupNetworkSession.cpp:
1928         (WebCore::SoupNetworkSession::SoupNetworkSession):
1929         (WebCore::SoupNetworkSession::setInitialNTLMAuthenticationEnabled):
1930         (WebCore::SoupNetworkSession::setNTLMAuthenticationEnabled):
1931         * platform/network/soup/SoupNetworkSession.h:
1932
1933 2017-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1934
1935         Add the support for mutating clipboard data via DataTransferItemList
1936         https://bugs.webkit.org/show_bug.cgi?id=175639
1937
1938         Reviewed by Wenson Hsieh.
1939
1940         Added the support for adding plaintext data via dataTransfer.items.add, clearing data via clear,
1941         and removing an entry via remove. When DataTransferItem is removed from DataTransferItemList,
1942         we must put into the disabled mode.
1943
1944         To support the removal of DataTransferItem, this patch replaces a reference to DataTransfer by
1945         a WeakPtr to DataTransferItemList, and stops forwarding ref from DataTransferItem to DataTransfer.
1946         This means that DataTransfer can now be GC'ed before DataTransferItem is GC'ed.
1947
1948         Because the identify and the order of DataTransferItems need to be preserved, we can't simply
1949         re-popluate m_itemList in DataTransferItemList. Instead, whenever the clipboard content is mutated,
1950         we make the parallel modifications to m_itemList. This includes changes made via DataTransfer
1951         methods such as setData and clearData.
1952
1953         Test: editing/pasteboard/datatransfer-items-copy-plaintext.html
1954
1955         * dom/DataTransfer.cpp:
1956         (WebCore::DataTransfer::clearData): Invoke didClearStringData when m_itemList exists.
1957         (WebCore::DataTransfer::setData): Ditto.
1958         (WebCore::DataTransfer::createForInputEvent):
1959         (WebCore::DataTransfer::createForDrag):
1960         (WebCore::DataTransfer::createForDrop):
1961         * dom/DataTransferItem.cpp:
1962         (WebCore::DataTransferItem::create):
1963         (WebCore::DataTransferItem::DataTransferItem):
1964         (WebCore::DataTransferItem::clearListAndPutIntoDisabledMode): Added.
1965         (WebCore::DataTransferItem::type const): Moved from the header.
1966         (WebCore::DataTransferItem::getAsString const):
1967         (WebCore::DataTransferItem::getAsFile const):
1968         * dom/DataTransferItem.h:
1969         (WebCore::DataTransferItem::ref): Deleted.
1970         (WebCore::DataTransferItem::deref): Deleted.
1971         (WebCore::DataTransferItem::isFile const): Added.
1972         (WebCore::DataTransferItem::type const): Move to the cpp file.
1973         * dom/DataTransferItemList.cpp:
1974         (WebCore::isSupportedType): Moved.
1975         (WebCore::DataTransferItemList::DataTransferItemList): Moved from the header.
1976         (WebCore::DataTransferItemList::~DataTransferItemList): Added.
1977         (WebCore::DataTransferItemList::item):
1978         (WebCore::DataTransferItemList::add): Implemented the variant to add string data.
1979         (WebCore::DataTransferItemList::remove): Implemented. For now, we don't have to deal with removing
1980         a file since a writable dataTransfer never contains a File object.
1981         (WebCore::DataTransferItemList::clear): Implemented.
1982         (WebCore::DataTransferItemList::ensureItems const):
1983         (WebCore::removeStringItemOfLowercasedType): Added.
1984         (WebCore::DataTransferItemList::didClearStringData): Called when dataTransfer.clear is called.
1985         (WebCore::DataTransferItemList::didSetStringData): Ditto for 
1986         * dom/DataTransferItemList.h:
1987         (WebCore::DataTransferItemList): Added a WeakPtrFactory. Also use a vector of Ref<DataTransferItem>
1988         instead of unique_ptr<DataTransferItem> since DataTransferItem can outlive DataTransferItemList.
1989         (WebCore::DataTransferItemList::dataTransfer): Added.
1990         * dom/DataTransferItemList.idl:
1991
1992 2017-08-16  Andy Estes  <aestes@apple.com>
1993
1994         [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest
1995         https://bugs.webkit.org/show_bug.cgi?id=175648
1996
1997         Reviewed by Tim Horton.
1998
1999         The W3C Payment Request API defines an interface called PaymentRequest, which conflicts with
2000         an existing Apple Pay class. This patch renames PaymentRequest to
2001         ApplePaySessionPaymentRequest so that a follow-on patch can introduce PaymentRequest for the
2002         W3C API.
2003
2004         * Modules/applepay/ApplePayError.h:
2005         * Modules/applepay/ApplePayLineItem.h:
2006         * Modules/applepay/ApplePayPaymentRequest.h:
2007         * Modules/applepay/ApplePaySession.cpp:
2008         (WebCore::convertAndValidateTotal):
2009         (WebCore::convertAndValidate):
2010         (WebCore::ApplePaySession::ApplePaySession):
2011         (WebCore::ApplePaySession::didSelectShippingMethod):
2012         * Modules/applepay/ApplePaySession.h:
2013         * Modules/applepay/ApplePaySessionPaymentRequest.cpp: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.cpp.
2014         (WebCore::ApplePaySessionPaymentRequest::ApplePaySessionPaymentRequest):
2015         (WebCore::ApplePaySessionPaymentRequest::~ApplePaySessionPaymentRequest):
2016         (WebCore::ApplePaySessionPaymentRequest::isValidSupportedNetwork):
2017         * Modules/applepay/ApplePaySessionPaymentRequest.h: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.h.
2018         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
2019         (WebCore::convert):
2020         (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
2021         * Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
2022         * Modules/applepay/PaymentCoordinator.cpp:
2023         (WebCore::PaymentCoordinator::beginPaymentSession):
2024         (WebCore::PaymentCoordinator::didSelectShippingMethod):
2025         * Modules/applepay/PaymentCoordinator.h:
2026         * Modules/applepay/PaymentCoordinatorClient.h:
2027         * Modules/applepay/PaymentHeaders.h:
2028         * Modules/applepay/PaymentRequestValidator.cpp:
2029         (WebCore::PaymentRequestValidator::validate):
2030         (WebCore::PaymentRequestValidator::validateTotal):
2031         (WebCore::validateMerchantCapabilities):
2032         (WebCore::validateShippingMethod):
2033         (WebCore::validateShippingMethods):
2034         * Modules/applepay/PaymentRequestValidator.h:
2035         * WebCore.xcodeproj/project.pbxproj:
2036         * loader/EmptyClients.cpp:
2037
2038 2017-08-16  Chris Dumez  <cdumez@apple.com>
2039
2040         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight
2041         https://bugs.webkit.org/show_bug.cgi?id=175628
2042         <rdar://problem/33919278>
2043
2044         Reviewed by Geoffrey Garen.
2045
2046         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight.
2047         To achieve this, the following changes were made:
2048         1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload
2049         2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS
2050            preflight merely because the fetch mode is set to "cors").
2051
2052         Test: http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html
2053
2054         * Modules/fetch/FetchBody.cpp:
2055         (WebCore::FetchBody::extract):
2056         * loader/CrossOriginAccessControl.h:
2057         * loader/LoaderStrategy.h:
2058         * loader/PingLoader.cpp:
2059         (WebCore::PingLoader::loadImage):
2060         (WebCore::PingLoader::sendPing):
2061         (WebCore::PingLoader::sendViolationReport):
2062         (WebCore::PingLoader::startPingLoad):
2063         * loader/PingLoader.h:
2064         * loader/cache/CachedResource.cpp:
2065         (WebCore::CachedResource::CachedResource):
2066         (WebCore::CachedResource::load):
2067         * loader/cache/CachedResource.h:
2068         * loader/cache/CachedResourceRequest.cpp:
2069         (WebCore::CachedResourceRequest::CachedResourceRequest):
2070         * loader/cache/CachedResourceRequest.h:
2071         (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders):
2072         * platform/network/HTTPHeaderValues.cpp:
2073         * platform/network/HTTPHeaderValues.h:
2074
2075 2017-08-16  Matt Baker  <mattbaker@apple.com>
2076
2077         Web Inspector: capture async stack trace when workers/main context posts a message
2078         https://bugs.webkit.org/show_bug.cgi?id=167084
2079         <rdar://problem/30033673>
2080
2081         Reviewed by Brian Burg.
2082
2083         Add instrumentation to DOMWindow to support showing asynchronous
2084         stack traces when the debugger pauses in a MessageEvent handler.
2085
2086         Test: inspector/debugger/async-stack-trace.html
2087
2088         * inspector/InspectorInstrumentation.cpp:
2089         (WebCore::InspectorInstrumentation::didPostMessageImpl):
2090         (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
2091         (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
2092         (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
2093
2094         * inspector/InspectorInstrumentation.h:
2095         (WebCore::InspectorInstrumentation::didPostMessage):
2096         (WebCore::InspectorInstrumentation::didFailPostMessage):
2097         (WebCore::InspectorInstrumentation::willDispatchPostMessage):
2098         (WebCore::InspectorInstrumentation::didDispatchPostMessage):
2099
2100         * inspector/PageDebuggerAgent.cpp:
2101         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
2102         (WebCore::PageDebuggerAgent::didPostMessage):
2103         (WebCore::PageDebuggerAgent::didFailPostMessage):
2104         (WebCore::PageDebuggerAgent::willDispatchPostMessage):
2105         (WebCore::PageDebuggerAgent::didDispatchPostMessage):
2106         * inspector/PageDebuggerAgent.h:
2107
2108         * page/DOMWindow.cpp:
2109         (WebCore::DOMWindow::postMessage):
2110         (WebCore::DOMWindow::postMessageTimerFired):
2111
2112 2017-08-16  Timothy Horton  <timothy_horton@apple.com>
2113
2114         Try to fix the build
2115
2116         * platform/ios/PlatformPasteboardIOS.mm:
2117
2118 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
2119
2120         Build fix after r220812
2121
2122         Fix builds where LOG_DISABLED is defined.
2123
2124         * css/MediaQueryEvaluator.cpp:
2125
2126 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
2127
2128         Add a log channel for media queries
2129         https://bugs.webkit.org/show_bug.cgi?id=175591
2130
2131         Reviewed by Zalan Bujtas.
2132
2133         Add a "MediaQueries" log channel which logs data about media query evaluation.
2134
2135         * css/MediaList.cpp:
2136         (WebCore::MediaQuerySet::MediaQuerySet):
2137         (WebCore::operator<<):
2138         * css/MediaList.h:
2139         * css/MediaQuery.cpp:
2140         (WebCore::operator<<):
2141         * css/MediaQuery.h:
2142         * css/MediaQueryEvaluator.cpp:
2143         (WebCore::operator<<):
2144         (WebCore::MediaQueryEvaluator::evaluate const):
2145         (WebCore::aspectRatioValueAsString):
2146         (WebCore::orientationEvaluate):
2147         (WebCore::aspectRatioEvaluate):
2148         (WebCore::deviceAspectRatioEvaluate):
2149         (WebCore::evaluateResolution):
2150         (WebCore::deviceHeightEvaluate):
2151         (WebCore::deviceWidthEvaluate):
2152         (WebCore::heightEvaluate):
2153         (WebCore::widthEvaluate):
2154         * css/MediaQueryExpression.cpp:
2155         (WebCore::operator<<):
2156         * css/MediaQueryExpression.h:
2157         * css/MediaQueryMatcher.cpp:
2158         (WebCore::MediaQueryMatcher::styleResolverChanged):
2159         * css/StyleResolver.cpp:
2160         (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange const):
2161         (WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange const):
2162         * dom/InlineStyleSheetOwner.cpp:
2163         (WebCore::InlineStyleSheetOwner::createSheet):
2164         * html/HTMLImageElement.cpp:
2165         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2166         * html/HTMLLinkElement.cpp:
2167         (WebCore::HTMLLinkElement::process):
2168         * html/HTMLMediaElement.cpp:
2169         (WebCore::HTMLMediaElement::selectNextSourceChild):
2170         * html/HTMLPictureElement.cpp:
2171         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture const):
2172         * html/parser/HTMLPreloadScanner.cpp:
2173         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2174         * page/FrameView.cpp:
2175         (WebCore::FrameView::layout):
2176         * platform/Logging.cpp:
2177         (WebCore::initializeLogChannelsIfNecessary):
2178         * platform/Logging.h:
2179         * platform/URL.cpp:
2180         (WebCore::isSchemeFirstChar):
2181         (WebCore::operator<<):
2182         * platform/URL.h:
2183
2184 2017-08-16  Sam Weinig  <sam@webkit.org>
2185
2186         [WebIDL] Remove the need for JSSubtleCryptoCustom.cpp
2187         https://bugs.webkit.org/show_bug.cgi?id=175526
2188
2189         Reviewed by Chris Dumez.
2190
2191         - Generates bindings for all of SubtleCrypto except AlgorithmIdentifier normalization, 
2192           which is defined in the WebCrypto spec to happen after normal IDL operations.
2193         - Adds initial support for IDL object types in unions (some, unneeded at the moment,
2194           edge cases remain).
2195
2196         * CMakeLists.txt:
2197         * WebCore.xcodeproj/project.pbxproj:
2198         * bindings/js/JSSubtleCryptoCustom.cpp: Removed.
2199
2200             Remove JSSubtleCryptoCustom.cpp, added CryptoKeyFormat.h
2201
2202         * bindings/js/JSDOMConvertObject.h:
2203
2204             Add needed, when included in generated code, #include of StrongInlines.h
2205
2206         * bindings/js/JSDOMConvertUnion.h:
2207         
2208             Add initial support for object (needed for AlgorithmIdentifier which is 
2209             (object or DOMString)). Remaining support will be handled by https://webkit.org/b/175616
2210
2211             Also add remaining spec comments while in the area.
2212
2213         * bindings/js/JSDOMPromiseDeferred.cpp:
2214         (WebCore::DeferredPromise::reject):
2215
2216             Add support for the special ExistingExceptionError error code. Capturing
2217             the current exception and using it as the rejection value.
2218
2219         * crypto/SubtleCrypto.cpp:
2220         (WebCore::SubtleCrypto::~SubtleCrypto):
2221         (WebCore::toHashIdentifier):
2222         (WebCore::normalizeCryptoAlgorithmParameters):
2223         (WebCore::toCryptoKeyUsageBitmap):
2224         (WebCore::rejectWithException):
2225         (WebCore::normalizeJsonWebKey):
2226         (WebCore::toKeyData):
2227         (WebCore::copyToVector):
2228         (WebCore::isSupportedExportKey):
2229         (WebCore::SubtleCrypto::encrypt):
2230         (WebCore::SubtleCrypto::decrypt):
2231         (WebCore::SubtleCrypto::sign):
2232         (WebCore::SubtleCrypto::verify):
2233         (WebCore::SubtleCrypto::digest):
2234         (WebCore::SubtleCrypto::generateKey):
2235         (WebCore::SubtleCrypto::deriveKey):
2236         (WebCore::SubtleCrypto::deriveBits):
2237         (WebCore::SubtleCrypto::importKey):
2238         (WebCore::SubtleCrypto::exportKey):
2239         (WebCore::SubtleCrypto::wrapKey):
2240         (WebCore::SubtleCrypto::unwrapKey):
2241         * crypto/SubtleCrypto.h:
2242         * crypto/SubtleCrypto.idl:
2243
2244             Moves implementation from JSSubtleCryptoCustom.cpp -> here. Important changes that come
2245             with that are:
2246             - All parameters are now converted / type checked for us.
2247             - Rather than throwing exceptions and expecting the bindings layer to convert
2248               them to promise rejections, all rejections are now explicitly made.
2249             - Algorithms are no longer checked for being supported twice, once in normalizeCryptoAlgorithmParameters
2250               and then again in the operation. We instead rely on normalizeCryptoAlgorithmParameters to return
2251               an Exception if its not supported.
2252             - Shaves 251 lines off the file.
2253
2254         * crypto/CryptoKeyFormat.h: Added.
2255
2256             Add new header for unified key format enum. (For bindings purposes, SubtleCrypto
2257             re aliases it to SubtleCrypto::KeyFormat).
2258
2259         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2260         * crypto/CryptoAlgorithm.cpp:
2261         * crypto/CryptoAlgorithm.h:
2262         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2263         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2264         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2265         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2266         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2267         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2268         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2269         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2270         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2271         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2272         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2273         * crypto/algorithms/CryptoAlgorithmECDH.h:
2274         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2275         * crypto/algorithms/CryptoAlgorithmECDSA.h:
2276         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2277         * crypto/algorithms/CryptoAlgorithmHKDF.h:
2278         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2279         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2280         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2281         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2282         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2283         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2284         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2285         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2286         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2287         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2288         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2289         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2290
2291             Use CryptoKeyFormat enum directly, rather than SubtleCrypto::KeyFormat,
2292             to allow not including SubtleCrypto.h.
2293
2294         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2295         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2296         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2297         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2298         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2299         * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
2300         * crypto/parameters/EcdsaParams.idl:
2301         * crypto/parameters/HkdfParams.idl:
2302         * crypto/parameters/HmacKeyParams.idl:
2303         * crypto/parameters/Pbkdf2Params.idl:
2304         * crypto/parameters/RsaHashedImportParams.idl:
2305         * crypto/parameters/RsaHashedKeyGenParams.idl:
2306
2307             Update IDLs and implementations to use the correct definition of HashAlgorithmIdentifier,
2308             which is (object or DOMString), now that it is supported.
2309
2310 2017-08-16  Youenn Fablet  <youenn@apple.com>
2311
2312         [Cache API] Implement Worker connection to the Cache storage engine
2313         https://bugs.webkit.org/show_bug.cgi?id=175599
2314
2315         Reviewed by Chris Dumez.
2316
2317         Covered by existing tests.
2318
2319         Adding a WorkerCacheStorageConnection to connect workers Cache/CacheStorage
2320         to the cache storage engine.
2321         WorkerCacheStorageConnection does this by hopping to the main thread to call the document cache storage connection to do the actual job.
2322         Doing some CacheStorageConnection refactoring to share code with WK2 implementation of the cache storage connection. 
2323
2324         * Modules/cache/CacheQueryOptions.h:
2325         (WebCore::CacheQueryOptions::isolatedCopy const):
2326         * Modules/cache/CacheStorageConnection.cpp:
2327         (WebCore::CacheStorageConnection::open):
2328         (WebCore::CacheStorageConnection::remove):
2329         (WebCore::CacheStorageConnection::retrieveCaches):
2330         (WebCore::CacheStorageConnection::retrieveRecords):
2331         (WebCore::CacheStorageConnection::batchDeleteOperation):
2332         (WebCore::CacheStorageConnection::batchPutOperation):
2333         (WebCore::CacheStorageConnection::openOrRemoveCompleted):
2334         (WebCore::CacheStorageConnection::updateCaches):
2335         (WebCore::CacheStorageConnection::updateRecords):
2336         (WebCore::CacheStorageConnection::removeRecordsCompleted):
2337         (WebCore::CacheStorageConnection::putRecordsCompleted):
2338         * Modules/cache/CacheStorageConnection.h:
2339         (WebCore::CacheStorageConnection::openCompleted):
2340         (WebCore::CacheStorageConnection::removeCompleted):
2341         (WebCore::CacheStorageConnection::doOpen):
2342         (WebCore::CacheStorageConnection::doRemove):
2343         (WebCore::CacheStorageConnection::doRetrieveCaches):
2344         (WebCore::CacheStorageConnection::doRetrieveRecords):
2345         (WebCore::CacheStorageConnection::doBatchDeleteOperation):
2346         (WebCore::CacheStorageConnection::doBatchPutOperation):
2347         * Modules/cache/WorkerCacheStorageConnection.cpp: Added.
2348         (WebCore::toCrossThreadRecordData):
2349         (WebCore::fromCrossThreadRecordData):
2350         (WebCore::WorkerCacheStorageConnection::create):
2351         (WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
2352         (WebCore::WorkerCacheStorageConnection::doOpen):
2353         (WebCore::WorkerCacheStorageConnection::doRemove):
2354         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
2355         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
2356         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
2357         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
2358         * Modules/cache/WorkerCacheStorageConnection.h: Added.
2359         * Modules/cache/WorkerGlobalScopeCaches.cpp:
2360         (WebCore::WorkerGlobalScopeCaches::caches const):
2361         * WebCore.xcodeproj/project.pbxproj:
2362         * loader/FetchOptions.h:
2363         (WebCore::FetchOptions::isolatedCopy const):
2364         * workers/WorkerGlobalScope.cpp:
2365         (WebCore::WorkerGlobalScope::cacheStorageConnection):
2366         * workers/WorkerGlobalScope.h:
2367
2368 2017-08-16  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2369
2370         [PAL] Move spi/ios and spi/win directories into PAL
2371         https://bugs.webkit.org/show_bug.cgi?id=175171
2372
2373         Reviewed by Antti Koivisto.
2374
2375         * PlatformWin.cmake:
2376         * WebCore.xcodeproj/project.pbxproj:
2377         * editing/cocoa/DataDetection.mm:
2378         * loader/ios/PreviewLoader.mm:
2379         * page/CaptionUserPreferencesMediaAF.cpp:
2380         * page/cocoa/MemoryReleaseCocoa.mm:
2381         * page/cocoa/SettingsCocoa.mm:
2382         * page/ios/UserAgentIOS.mm:
2383         * platform/audio/ios/MediaSessionManagerIOS.mm:
2384         * platform/graphics/ca/PlatformCALayer.cpp:
2385         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2386         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2387         * platform/graphics/opentype/OpenTypeCG.h:
2388         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2389         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
2390         * platform/ios/Device.h:
2391         * platform/ios/PlatformPasteboardIOS.mm:
2392         * platform/ios/PlatformScreenIOS.mm:
2393         * platform/ios/QuickLookSoftLink.h:
2394         * platform/ios/QuickLookSoftLink.mm:
2395         * platform/ios/ValidationBubbleIOS.mm:
2396         * platform/ios/WebItemProviderPasteboard.mm:
2397         * platform/network/ios/PreviewConverter.mm:
2398         * platform/sql/SQLiteFileSystem.cpp:
2399         * rendering/RenderThemeIOS.mm:
2400
2401 2017-08-16  Tim Horton  <timothy_horton@apple.com>
2402
2403         2-3% of main thread time under UTTypeCreatePreferredIdentifierForTag on wunderground map
2404         https://bugs.webkit.org/show_bug.cgi?id=175618
2405
2406         Reviewed by Simon Fraser.
2407
2408         No new tests, just a perf win.
2409
2410         UTTypeCreatePreferredIdentifierForTag is fairly expensive, and is called
2411         under every toDataURL, which the Wunderground wundermap does a /lot/.
2412
2413         Keep a 16-item LRU cache of MIMEType->UTI mappings.
2414
2415         Also, make other callers of UTTypeCreatePreferredIdentifierForTag use
2416         the UTIUtilities version so they can share in the caching.
2417
2418         Also, as a drive-by, add and make other callers use mimeTypeFromUTI too,
2419         and make the UTIUtilities operate on Strings for a slightly more WebCore-y feel.
2420
2421         * editing/ios/EditorIOS.mm:
2422         (WebCore::Editor::WebContentReader::readImage):
2423         * platform/MIMETypeRegistry.cpp:
2424         (WebCore::initializeSupportedImageMIMETypes):
2425         (WebCore::initializeSupportedImageMIMETypesForEncoding):
2426         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2427         (WebCore::createFileTypesSet):
2428         * platform/graphics/cg/ImageSourceCGMac.mm:
2429         (WebCore::MIMETypeForImageSourceType):
2430         Adopt newly-added MIMETypeFromUTI().
2431
2432         * platform/graphics/cg/ImageBufferCG.cpp:
2433         (WebCore::utiFromImageBufferMIMEType):
2434         (WebCore::ImageBuffer::toCFData const):
2435         (WebCore::cfData):
2436         (WebCore::utiFromMIMEType): Deleted.
2437         Adopt UTIFromMIMEType, and rename the local helper that does something
2438         different (a small static map) on iOS and Windows to not have an overlapping name.
2439
2440         * platform/ios/PasteboardIOS.mm:
2441         (WebCore::Pasteboard::resourceMIMEType):
2442         (WebCore::utiTypeFromCocoaType):
2443         Adopt UTIFromMIMEType().
2444
2445         * platform/ios/PlatformPasteboardIOS.mm:
2446         (WebCore::PlatformPasteboard::writeObjectRepresentations):
2447         * platform/mac/PasteboardMac.mm:
2448         (WebCore::cocoaTypeFromHTMLClipboardType):
2449         Adopt isDeclaredUTI and UTIFromMIMEType().
2450
2451         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2452         (WebCore::WebCoreAVFResourceLoader::responseReceived):
2453         * platform/network/ios/WebCoreURLResponseIOS.mm:
2454         (WebCore::adjustMIMETypeIfNecessary):
2455         * platform/network/mac/WebCoreURLResponse.mm:
2456         (WebCore::adjustMIMETypeIfNecessary):
2457         * rendering/RenderThemeIOS.mm:
2458         (WebCore::iconForAttachment):
2459         * rendering/RenderThemeMac.mm:
2460         (WebCore::iconForAttachment):
2461         Deal with the fact that UTI utilities deal in Strings now.
2462
2463         * platform/network/mac/UTIUtilities.h:
2464         * platform/network/mac/UTIUtilities.mm:
2465         (WebCore::MIMETypeFromUTI):
2466         Added. This doesn't crawl up the UTI tree if the first conversion fails,
2467         which is what most of the existing code does. It's possible we want to
2468         use MIMETypeFromUTITree's logic everywhere, but I didn't want to change
2469         that in this patch.
2470
2471         (WebCore::MIMETypeFromUTITree):
2472         (WebCore::isDeclaredUTI):
2473         Take and return strings.
2474
2475         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
2476         (WebCore::UTIFromMIMEType):
2477         Add the aforementioned cache.
2478
2479 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
2480
2481         Make RenderLayer and RenderLayerBacking TextStream-loggable, and clean up compositing logging
2482         https://bugs.webkit.org/show_bug.cgi?id=175634
2483
2484         Reviewed by Zalan Bujtas.
2485
2486         Add operator<<(TextStream&) for RenderLayer and RenderLayer backing, and use them for compositing logging.
2487
2488         Convert CompositingUpdateType to an enum class.
2489
2490         * page/FrameView.cpp:
2491         (WebCore::FrameView::updateCompositingLayersAfterLayout):
2492         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
2493         * page/ios/FrameIOS.mm:
2494         (WebCore::Frame::viewportOffsetChanged):
2495         * rendering/RenderLayer.cpp:
2496         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
2497         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
2498         (WebCore::RenderLayer::calculateClipRects const):
2499         * rendering/RenderLayer.h:
2500         * rendering/RenderLayerBacking.cpp:
2501         (WebCore::RenderLayerBacking::updateAfterLayout):
2502         (WebCore::RenderLayerBacking::updateGeometry):
2503         (WebCore::operator<<):
2504         * rendering/RenderLayerBacking.h:
2505         * rendering/RenderLayerCompositor.cpp:
2506         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2507         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2508         (WebCore::RenderLayerCompositor::updateCompositingLayersTimerFired):
2509         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2510         (WebCore::RenderLayerCompositor::layerTreeAsText):
2511         (WebCore::operator<<):
2512         * rendering/RenderLayerCompositor.h:
2513
2514 2017-08-16  Eric Carlson  <eric.carlson@apple.com>
2515
2516         Consider allow gUM to be called from localhost without https
2517         https://bugs.webkit.org/show_bug.cgi?id=173457
2518         <rdar://problem/33900527>
2519
2520         Reviewed by Youenn Fablet.
2521
2522         Tests: http/tests/media/media-stream/get-user-media-localhost.html
2523                http/tests/media/media-stream/get-user-media-loopback-ip.html
2524
2525         * Modules/mediastream/UserMediaRequest.cpp:
2526         (WebCore::isSecure): Call SchemeRegistry::shouldTreatURLSchemeAsSecure instead of looking for
2527         the string 'https'.
2528         (WebCore::canCallGetUserMedia): Allow localhost or loopback address.
2529
2530         * page/SecurityOrigin.cpp:
2531         (WebCore::isLoopbackIPAddress): Add a comment.
2532         (WebCore::shouldTreatAsPotentionallyTrustworthy): Move tests for localhost and loopback address
2533         to isLocalHostOrLoopbackIPAddress, call it.
2534         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress): 
2535         * page/SecurityOrigin.h:
2536
2537 2017-08-16  Chris Dumez  <cdumez@apple.com>
2538
2539         EventSource: ignore IDs with U+0000
2540         https://bugs.webkit.org/show_bug.cgi?id=175178
2541
2542         Reviewed by Darin Adler.
2543
2544         EventSource: ignore IDs with U+0000 as per:
2545         https://github.com/whatwg/html/pull/2849
2546
2547         Test: imported/w3c/web-platform-tests/eventsource/format-field-id-null.htm
2548
2549         * page/EventSource.cpp:
2550         (WebCore::EventSource::parseEventStreamLine):
2551
2552 2017-08-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2553
2554         [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
2555         https://bugs.webkit.org/show_bug.cgi?id=174418
2556
2557         Reviewed by Michael Catanzaro.
2558
2559         HarfBuzzShaper should normalize the input text before collecting
2560         HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does
2561         the task. But, this function hasn't been called from anywhere
2562         since Bug 90951.
2563
2564         Test: fast/text/international/vietnamese-nfd.html
2565               imported/blink/fast/text/international/text-shaping-arabic-diffs.html
2566
2567         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2568         (WebCore::HarfBuzzShaper::HarfBuzzShaper):
2569         Call setNormalizedBuffer instead of normalizeCharacters.
2570         (WebCore::normalizeCharacters): Deleted.
2571         (WebCore::normalizeSpacesAndMirrorChars) Use
2572         FontCascade::treatAsZeroWidthSpaceInComplexScript instead of
2573         FontCascade::treatAsZeroWidthSpace to preserve ZWJ and ZWNJ.
2574
2575 2017-08-16  Antti Koivisto  <antti@apple.com>
2576
2577         Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
2578         https://bugs.webkit.org/show_bug.cgi?id=175627
2579
2580         Reviewed by Andreas Kling.
2581
2582         Render tree should not mutate itself. We already fixed this for first-letter, supporting code
2583         can now move to RenderTreeUpdater too.
2584
2585         * CMakeLists.txt:
2586         * WebCore.xcodeproj/project.pbxproj:
2587         * rendering/RenderBlock.cpp:
2588         (WebCore::styleForFirstLetter): Deleted.
2589         (WebCore::isPunctuationForFirstLetter): Deleted.
2590         (WebCore::shouldSkipForFirstLetter): Deleted.
2591         (WebCore::RenderBlock::updateFirstLetterStyle): Deleted.
2592         (WebCore::RenderBlock::createFirstLetterRenderer): Deleted.
2593         (WebCore::RenderBlock::updateFirstLetter): Deleted.
2594         * rendering/RenderBlock.h:
2595         * rendering/RenderRubyRun.cpp:
2596         (WebCore::RenderRubyRun::updateFirstLetter): Deleted.
2597         * rendering/RenderRubyRun.h:
2598         * rendering/RenderTable.cpp:
2599         (WebCore::RenderTable::updateFirstLetter): Deleted.
2600         * rendering/RenderTable.h:
2601
2602             Virtual overrides just disabled first letter for some RenderBlock subclasses. This is now achieved via
2603             supportsFirstLetter test in the first letter updater.
2604
2605         * rendering/TextAutoSizing.cpp:
2606         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2607         * rendering/svg/RenderSVGText.cpp:
2608         (WebCore::RenderSVGText::updateFirstLetter): Deleted.
2609         * rendering/svg/RenderSVGText.h:
2610         * style/RenderTreeUpdater.cpp:
2611         (WebCore::RenderTreeUpdater::popParent):
2612         * style/RenderTreeUpdater.h:
2613         * style/RenderTreeUpdaterFirstLetter.cpp: Added.
2614         (WebCore::styleForFirstLetter):
2615         (WebCore::isPunctuationForFirstLetter):
2616         (WebCore::shouldSkipForFirstLetter):
2617         (WebCore::updateFirstLetterStyle):
2618         (WebCore::createFirstLetterRenderer):
2619         (WebCore::supportsFirstLetter):
2620         (WebCore::RenderTreeUpdater::FirstLetter::update):
2621         * style/RenderTreeUpdaterFirstLetter.h: Added.
2622
2623 2017-08-16  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2624
2625         [GStreamer][EME] Rework handling key systems and UUIDs
2626         https://bugs.webkit.org/show_bug.cgi?id=175567
2627
2628         Reviewed by Žan Doberšek.
2629
2630         The UUIDs and key system strings were moved to the
2631         GStreamerEMEUtilities class because so far they were managed by
2632         the decryptors and that was ugly.
2633
2634         * platform/GStreamer.cmake:
2635         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2636         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
2637         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp: Added.
2638         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Added.
2639         (WebCore::GStreamerEMEUtilities::isClearKeyKeySystem):
2640         (WebCore::GStreamerEMEUtilities::keySystemToUuid):
2641         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2642         (webkit_media_clear_key_decrypt_class_init):
2643         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
2644
2645 2017-08-16  Andy Estes  <aestes@apple.com>
2646
2647         [Payment Request] Add an ENABLE flag and an experimental feature preference
2648         https://bugs.webkit.org/show_bug.cgi?id=175622
2649
2650         Reviewed by Tim Horton.
2651
2652         * Configurations/FeatureDefines.xcconfig:
2653         * page/Settings.in:
2654
2655 2017-08-15  Ryosuke Niwa  <rniwa@webkit.org>
2656
2657         Make DataTransferItemList work with plain text entries
2658         https://bugs.webkit.org/show_bug.cgi?id=175596
2659
2660         Reviewed by Wenson Hsieh.
2661
2662         Added the basic machinery to get the list of plain text items to DataTransferItemList and DataTransferItem.
2663
2664         Each DataTransferItem now depends on DataTransfer so it does ref-forwarding like DataTransferItemList to make
2665         DataTransfer alive as long as any DataTransferItem is alive.
2666
2667         Specifications: https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitem-interface
2668                         https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface
2669
2670         Tests: editing/pasteboard/datatransfer-items-drop-plaintext-file.html
2671                editing/pasteboard/datatransfer-items-paste-plaintext.html
2672
2673         * dom/DataTransferItem.cpp:
2674         (WebCore::DataTransferItem::DataTransferItem): Added two variants one for plain text and another one for a file.
2675         (WebCore::DataTransferItem::kind const): Rewritten.
2676         (WebCore::DataTransferItem::getAsString const): Implemented.
2677         (WebCore::DataTransferItem::getAsFile const): Implemented.
2678         * dom/DataTransferItem.h:
2679         (WebCore::DataTransferItem::ref): Added.
2680         (WebCore::DataTransferItem::deref): Added.
2681         (WebCore::DataTransferItem::type const): Returns String instead of AtomicString.
2682         (WebCore::DataTransferItem::kind const): Moved to cpp.
2683         * dom/DataTransferItem.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow.
2684         * dom/DataTransferItemList.cpp:
2685         (WebCore::DataTransferItemList::length): Implemented.
2686         (WebCore::DataTransferItemList::item): Ditto.
2687         (WebCore::isSupportedType): Added. For now, we only support text/plain.
2688         (WebCore::DataTransferItemList::ensureItems): Added. Constructs the list of DataTransferItems.
2689         * dom/DataTransferItemList.h:
2690         (DataTransferItemList): Added m_items. The list is filled lazily by ensureItems.
2691         * dom/DataTransferItemList.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow.
2692
2693 2017-08-15  Simon Fraser  <simon.fraser@apple.com>
2694
2695         Remove ScrollView::clipsRepaints() which was only used by Chromium
2696         https://bugs.webkit.org/show_bug.cgi?id=175594
2697
2698         Reviewed by Tim Horton.
2699
2700         clipsRepaints() was added in r74568 but was only used by Chromium. It's always
2701         true for other platforms, so remove conditionals that test for it and assume true.
2702
2703         * page/FrameView.cpp:
2704         (WebCore::FrameView::scrollContentsFastPath):
2705         * platform/ScrollView.cpp:
2706         (WebCore::ScrollView::repaintContentRectangle):
2707         (WebCore::ScrollView::setClipsRepaints): Deleted.
2708         * platform/ScrollView.h:
2709         (WebCore::ScrollView::clipsRepaints const): Deleted.
2710
2711 2017-08-15  Simon Fraser  <simon.fraser@apple.com>
2712
2713         Allow WebCore logging channels to be set from the UI process
2714         https://bugs.webkit.org/show_bug.cgi?id=175608
2715
2716         Reviewed by Tim Horton.
2717
2718         Change initializeLogChannelsIfNecessary() to take an optional String, which can
2719         be a list of log channels passed from the UI process.
2720
2721         * platform/LogInitialization.h:
2722         * platform/Logging.cpp:
2723         (WebCore::initializeLogChannelsIfNecessary):
2724
2725 2017-08-15  Chris Dumez  <cdumez@apple.com>
2726
2727         Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView
2728         https://bugs.webkit.org/show_bug.cgi?id=175600
2729
2730         Reviewed by Youenn Fablet.
2731
2732         Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView in Fetch & Beacon.
2733         If we don't set a Content-Type header, our underlying network stack is going to add a "application/x-www-form-urlencoded"
2734         Content-Type header, which is worse.
2735
2736         Chrome is already using "application/octet-stream" Content-Type in Beacon, but use no Content-Type in Fetch.
2737         The Fetch/Beacon specification says we should have no Content-Type header in this case but this is unfortunately
2738         not something we can support at the moment. Using "application/octet-stream" Content-Type for now seems like the
2739         lesser evil.
2740
2741         Test: http/wpt/fetch/fetch-request-arraybuffer-content-type.html
2742
2743         * Modules/fetch/FetchBody.cpp:
2744         (WebCore::FetchBody::extract):
2745         * platform/network/HTTPHeaderValues.cpp:
2746         (WebCore::HTTPHeaderValues::octetStreamContentType):
2747         * platform/network/HTTPHeaderValues.h:
2748
2749 2017-08-15  Robin Morisset  <rmorisset@apple.com>
2750
2751         Change the order of arguments of JSWithScope::create() for consistency
2752         https://bugs.webkit.org/show_bug.cgi?id=175585
2753
2754         Reviewed by Saam Barati.
2755
2756         No change of behavior.
2757
2758         * bindings/js/JSHTMLElementCustom.cpp:
2759         (WebCore::JSHTMLElement::pushEventHandlerScope const):
2760
2761 2017-08-15  Youenn Fablet  <youenn@apple.com>
2762
2763         [Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields are set
2764         https://bugs.webkit.org/show_bug.cgi?id=175538
2765
2766         Reviewed by Chris Dumez.
2767
2768         No change of behavior.
2769         This change ensures that response type is preserved when encoding/decoding ResourceResponse, in particular the error type.
2770         This will allow Cache API to preserve responses when reading them from a different process.
2771
2772         * platform/network/ResourceResponseBase.cpp:
2773         (WebCore::ResourceResponseBase::setType):
2774         * platform/network/ResourceResponseBase.h:
2775         (WebCore::ResourceResponseBase::setType):
2776
2777 2017-08-15  Chris Dumez  <cdumez@apple.com>
2778
2779         Update CachedResourceLoader::requestResource() to return a WTF::Expected
2780         https://bugs.webkit.org/show_bug.cgi?id=175505
2781
2782         Reviewed by Youenn Fablet.
2783
2784         Update CachedResourceLoader::requestResource() to return a WTF::Expected
2785         type instead of using an out parameter for the ResourceError in case of
2786         synchronous failure.
2787
2788         * Modules/beacon/NavigatorBeacon.cpp:
2789         (WebCore::NavigatorBeacon::sendBeacon):
2790         * bindings/js/CachedScriptFetcher.cpp:
2791         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
2792         * css/CSSFontFaceSrcValue.cpp:
2793         (WebCore::CSSFontFaceSrcValue::cachedFont):
2794         * css/CSSImageSetValue.cpp:
2795         (WebCore::CSSImageSetValue::loadBestFitImage):
2796         * css/CSSImageValue.cpp:
2797         (WebCore::CSSImageValue::loadImage):
2798         * css/StyleRuleImport.cpp:
2799         (WebCore::StyleRuleImport::requestStyleSheet):
2800         * dom/ProcessingInstruction.cpp:
2801         (WebCore::ProcessingInstruction::checkStyleSheet):
2802         * html/HTMLLinkElement.cpp:
2803         (WebCore::HTMLLinkElement::process):
2804         * loader/CrossOriginPreflightChecker.cpp:
2805         (WebCore::CrossOriginPreflightChecker::startPreflight):
2806         * loader/DocumentLoader.cpp:
2807         (WebCore::DocumentLoader::startLoadingMainResource):
2808         * loader/DocumentThreadableLoader.cpp:
2809         (WebCore::DocumentThreadableLoader::loadRequest):
2810         * loader/FrameLoader.cpp:
2811         (WebCore::FrameLoader::loadedResourceFromMemoryCache):
2812         * loader/FrameLoader.h:
2813         * loader/ImageLoader.cpp:
2814         (WebCore::ImageLoader::updateFromElement):
2815         * loader/LinkLoader.cpp:
2816         (WebCore::LinkLoader::preloadIfNeeded):
2817         * loader/MediaResourceLoader.cpp:
2818         (WebCore::MediaResourceLoader::requestResource):
2819         * loader/TextTrackLoader.cpp:
2820         (WebCore::TextTrackLoader::load):
2821         * loader/cache/CachedResourceLoader.cpp:
2822         (WebCore::castCachedResourceTo):
2823         (WebCore::CachedResourceLoader::requestImage):
2824         (WebCore::CachedResourceLoader::requestFont):
2825         (WebCore::CachedResourceLoader::requestTextTrack):
2826         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
2827         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2828         (WebCore::CachedResourceLoader::requestScript):
2829         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
2830         (WebCore::CachedResourceLoader::requestSVGDocument):
2831         (WebCore::CachedResourceLoader::requestLinkResource):
2832         (WebCore::CachedResourceLoader::requestMedia):
2833         (WebCore::CachedResourceLoader::requestIcon):
2834         (WebCore::CachedResourceLoader::requestRawResource):
2835         (WebCore::CachedResourceLoader::requestBeaconResource):
2836         (WebCore::CachedResourceLoader::requestMainResource):
2837         (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
2838         (WebCore::CachedResourceLoader::requestResource):
2839         (WebCore::CachedResourceLoader::preload):
2840         * loader/cache/CachedResourceLoader.h:
2841         * loader/cache/CachedSVGDocumentReference.cpp:
2842         (WebCore::CachedSVGDocumentReference::load):
2843         * loader/icon/IconLoader.cpp:
2844         (WebCore::IconLoader::startLoading):
2845         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2846         (WebCore::WebCoreAVFResourceLoader::startLoading):
2847         * svg/SVGFEImageElement.cpp:
2848         (WebCore::SVGFEImageElement::requestImageResource):
2849         * svg/SVGFontFaceUriElement.cpp:
2850         (WebCore::SVGFontFaceUriElement::loadFont):
2851         * svg/SVGUseElement.cpp:
2852         (WebCore::SVGUseElement::updateExternalDocument):
2853         * xml/XSLImportRule.cpp:
2854         (WebCore::XSLImportRule::loadSheet):
2855
2856 2017-08-15  Don Olmstead  <don.olmstead@sony.com>
2857
2858         [PAL] Move Sleep classes into PAL
2859         https://bugs.webkit.org/show_bug.cgi?id=175456
2860
2861         Reviewed by Ryosuke Niwa.
2862
2863         No new tests. No change in behavior.
2864
2865         * CMakeLists.txt:
2866         * PlatformMac.cmake:
2867         * WebCore.xcodeproj/project.pbxproj:
2868         * html/HTMLMediaElement.cpp:
2869         * html/HTMLMediaElement.h:
2870         * platform/audio/PlatformMediaSessionManager.cpp:
2871         * platform/audio/PlatformMediaSessionManager.h:
2872         * platform/mac/WebVideoFullscreenController.h:
2873         * platform/mac/WebVideoFullscreenController.mm:
2874
2875 2017-08-15  Youenn Fablet  <youenn@apple.com>
2876
2877         [Cache API] Adding generic support for CacheStorage and Cache methods
2878         https://bugs.webkit.org/show_bug.cgi?id=175455
2879
2880         Reviewed by Chris Dumez.
2881
2882         Covered by existing tests.
2883
2884         Adding a CacheStorageProvider abstraction that creates a CacheStorageConnection.
2885         The CacheStorageProvider is accessed from the page for Document calls.
2886         The CacheStorageConnection is responsible to implement the read/write operations on the cache database.
2887         At the moment, it does nothing but return not implemented errors.
2888
2889         Implementing CacheStorage APIs and Cache APIs based on the CacheStorageConnection except for Cache add and addAll which will be implemented later on.
2890         CacheStoragConnection is responsible to read/write CacheStorage list of caches and each individual cache.
2891         The CacheStorageConnection is a generic connection and not tied to any document/context.
2892         CacheStorage objects are manipulated by providing to the connection the origin of the context.
2893         CacheStorage are global to all contexts with the same origin.
2894         Cache objects are manipulated by an ID that is given initially by the CacheStorageEngine when opening the Cache object.
2895
2896         Adding various accessors and constructors for Fetch constructs as needed by the Cache API implementation.
2897
2898         * Modules/cache/Cache.cpp:
2899         (WebCore::Cache::Cache):
2900         (WebCore::Cache::~Cache):
2901         The CacheStorageConnection is a generic connection and not tied to any document/context.
2902         (WebCore::Cache::match): Implementation of https://www.w3.org/TR/service-workers-1/#cache-match.
2903         Redirect to matchAll as per spec.
2904         (WebCore::Cache::matchAll): Implementation of https://www.w3.org/TR/service-workers-1/#cache-matchAll.
2905         Checks for request as per spec. Then either refresh the request to response map and return all responses.
2906         Or call the query cache algorithm and return copies of the responses (using clone).
2907         (WebCore::Cache::put):
2908         Check the request and response as per spec.
2909         Add temporary rejection cases (being loaded responses, responses with ReadableStream) as there is no support for them right now.
2910         Call the batch put operation.
2911         (WebCore::Cache::remove):
2912         Check the request and response as per spec.
2913         Call the batch delete operation.
2914         (WebCore::Cache::keys):
2915         Refresh the request to response map and return corresponding requests.
2916         Making sure to reuse the same request objects as per spec.
2917         As per spec, the request to response map is ordered. We implement it as a Vector.
2918         (WebCore::Cache::refreshRequestToResponseMap):
2919         Use the cache storage connection to get an up-to-date list of cached records.
2920         (WebCore::Cache::queryCacheMatch):
2921         Implements the match algorithm defined in https://www.w3.org/TR/service-workers-1/#query-cache-algorithm.
2922         This is split for queryCache as cache storage engine will need to use it when implementing the delete operation.
2923         (WebCore::Cache::queryCache):
2924         Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with no targetStorage argument.
2925         (WebCore::Cache::queryCacheWithTargetStorage):
2926         Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with a provided targetStorage argument.
2927         (WebCore::Cache::batchDeleteOperation):
2928         Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm but dedicated to a delete operation.
2929         Delete operation are always done one at a time.
2930         (WebCore::Cache::batchPutOperation):
2931         Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm dedicated to a put operation.
2932         Put operation takes one record for put but can take several records in the case of addAll, hence the current design.
2933         (WebCore::Cache::updateRequestToResponseMap):
2934         Update the cache request to response map based on the records retrieved from the cache storage connection.
2935         * Modules/cache/Cache.h:
2936         (WebCore::Cache::create):
2937         (WebCore::Cache::name const):
2938         * Modules/cache/Cache.idl:
2939         * Modules/cache/CacheStorage.cpp:
2940         (WebCore::CacheStorage::origin const):
2941         Computing the cache origin that is passed to the CacheStorageConnection.
2942         (WebCore::CacheStorage::has):
2943         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-has.
2944         Call the cache storage connection to refresh its cache map.
2945         Then use it to check whether a cache exists.
2946         (WebCore::CacheStorage::refreshCacheMap):
2947         Use the cache storage connection to get the list of existing caches.
2948         (WebCore::CacheStorage::open):
2949         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-open.
2950         Refreshing the cache map so as to return a pre-existing cache if any.
2951         (WebCore::CacheStorage::remove):
2952         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-delete-method.
2953         Refreshing the cache map so as to do nothing if there is no cache to remove.
2954         (WebCore::CacheStorage::keys):
2955         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-keys-method.
2956         Refreshing the cache map and returnin its keys.
2957         As per spec, the cache map is ordered. We implement it as a Vector.
2958         (WebCore::CacheStorage::cacheMap):
2959         Get the list of cache objects, used as a private accessor for JS built-ins.
2960         * Modules/cache/CacheStorage.h:
2961         (WebCore::CacheStorage::create):
2962         (WebCore::CacheStorage::CacheStorage):
2963         * Modules/cache/CacheStorageConnection.cpp: Added.
2964         (WebCore::CacheStorageConnection::exceptionFromError):
2965         * Modules/cache/CacheStorageConnection.h: Added.
2966         Makes the link between Web facing Cache API and the cache storage engine.
2967         Envisioned implementation are:
2968         - One main thread connection used by all documents in the given process.
2969         - One connection per worker that forwards the calls to the main thread and use the main thread connection afterwards.
2970         (WebCore::CacheStorageConnection::create):
2971         (WebCore::CacheStorageConnection::open):
2972         (WebCore::CacheStorageConnection::remove):
2973         (WebCore::CacheStorageConnection::refreshCacheMap):
2974         (WebCore::CacheStorageConnection::refreshRequestToResponseMap):
2975         (WebCore::CacheStorageConnection::batchDeleteOperation):
2976         (WebCore::CacheStorageConnection::batchPutOperation):
2977         * Modules/cache/CacheStorageRecord.h: Added. A fetch record from the Web facing cache API perspective.
2978         * Modules/cache/DOMWindowCaches.cpp:
2979         (WebCore::DOMWindowCaches::caches const):
2980         * Modules/cache/WorkerGlobalScopeCaches.cpp:
2981         (WebCore::WorkerGlobalScopeCaches::from):
2982         (WebCore::WorkerGlobalScopeCaches::caches const):
2983         * Modules/cache/WorkerGlobalScopeCaches.h:
2984         (WebCore::WorkerGlobalScopeCaches::WorkerGlobalScopeCaches):
2985         * Modules/fetch/FetchBodyOwner.h:
2986         (WebCore::FetchBodyOwner::isReadableStreamBody const): Added getter as it is used by cache API.
2987         * Modules/fetch/FetchHeaders.h:
2988         (WebCore::FetchHeaders::create): Add another create as used by the cache API.
2989         (WebCore::FetchHeaders::guard const): Added getter and IPC serializer as this is something that will be stored by the cache engine.
2990         * Modules/fetch/FetchLoader.cpp:
2991         (WebCore::FetchLoader::start):
2992         * Modules/fetch/FetchRequest.cpp:
2993         (WebCore::buildOptions): In case FetchRequest::create is called from C++, there is no need to set init.window to a null value.
2994         Add a check so that no value at all is the same as a null/undefined value.
2995         (WebCore::FetchRequest::resourceRequest const):
2996         * Modules/fetch/FetchRequest.h:
2997         * Modules/fetch/FetchResponse.h:
2998         * WebCore.xcodeproj/project.pbxproj:
2999         * inspector/InspectorOverlay.cpp:
3000         (WebCore::InspectorOverlay::overlayPage):
3001         * page/CacheStorageProvider.h: Added.
3002         Interface to create main thread cache storage connection for the given page.
3003         There will be one provider for each process.
3004         Passing a sessionID so that we will create a connection per session.
3005         * page/Page.cpp:
3006         (WebCore::Page::Page):
3007         * page/Page.h:
3008         (WebCore::Page::cacheStorageProvider):
3009         * page/PageConfiguration.cpp:
3010         (WebCore::PageConfiguration::PageConfiguration):
3011         * page/PageConfiguration.h:
3012         * svg/graphics/SVGImage.cpp:
3013         (WebCore::SVGImage::dataChanged):
3014
3015 2017-08-15  Chris Dumez  <cdumez@apple.com>
3016
3017         Implement quota limitation for keepalive Fetch requests
3018         https://bugs.webkit.org/show_bug.cgi?id=175482
3019
3020         Reviewed by Sam Weinig and Youenn Fablet.
3021
3022         Implement quota limitation for keepalive Fetch requests as per:
3023         - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)
3024
3025         This partly works for Beacon as well, meaning that no Beacon with a body
3026         over 64Kb can be sent. However, we don't keep track about wether or not
3027         beacon loads are inflight or not.
3028
3029         Also update CachedResourceLoader::requestResource() so that the caller
3030         can get a ResourceError when it returns null. This is useful for both
3031         Fetch and Beacon to return better error messages.
3032
3033         Test: http/wpt/beacon/beacon-quota.html
3034
3035         * CMakeLists.txt:
3036         * Modules/beacon/NavigatorBeacon.cpp:
3037         (WebCore::NavigatorBeacon::sendBeacon):
3038         * Modules/fetch/FetchBodyOwner.cpp:
3039         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
3040         (WebCore::FetchBodyOwner::BlobLoader::didFail):
3041         * Modules/fetch/FetchBodyOwner.h:
3042         * Modules/fetch/FetchLoader.cpp:
3043         (WebCore::FetchLoader::start):
3044         (WebCore::FetchLoader::didFail):
3045         * Modules/fetch/FetchLoaderClient.h:
3046         * Modules/fetch/FetchResponse.cpp:
3047         (WebCore::FetchResponse::BodyLoader::didFail):
3048         * Modules/fetch/FetchResponse.h:
3049         * WebCore.xcodeproj/project.pbxproj:
3050         * loader/DocumentThreadableLoader.cpp:
3051         (WebCore::DocumentThreadableLoader::loadRequest):
3052         * loader/cache/CachedResource.cpp:
3053         (WebCore::CachedResource::load):
3054         * loader/cache/CachedResource.h:
3055         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
3056         * loader/cache/CachedResourceLoader.cpp:
3057         (WebCore::createResource):
3058         (WebCore::CachedResourceLoader::requestImage):
3059         (WebCore::CachedResourceLoader::requestFont):
3060         (WebCore::CachedResourceLoader::requestTextTrack):
3061         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
3062         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3063         (WebCore::CachedResourceLoader::requestScript):
3064         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
3065         (WebCore::CachedResourceLoader::requestSVGDocument):
3066         (WebCore::CachedResourceLoader::requestLinkResource):
3067         (WebCore::CachedResourceLoader::requestMedia):
3068         (WebCore::CachedResourceLoader::requestIcon):
3069         (WebCore::CachedResourceLoader::requestRawResource):
3070         (WebCore::CachedResourceLoader::requestBeaconResource):
3071         (WebCore::CachedResourceLoader::requestMainResource):
3072         (WebCore::CachedResourceLoader::requestResource):
3073         (WebCore::CachedResourceLoader::preload):
3074         * loader/cache/CachedResourceLoader.h:
3075         * loader/cache/KeepaliveRequestTracker.cpp: Added.
3076         (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
3077         (WebCore::KeepaliveRequestTracker::canLoadRequest):
3078         (WebCore::KeepaliveRequestTracker::registerRequest):
3079         (WebCore::KeepaliveRequestTracker::responseReceived):
3080         (WebCore::KeepaliveRequestTracker::notifyFinished):
3081         (WebCore::KeepaliveRequestTracker::unregisterRequest):
3082         * loader/cache/KeepaliveRequestTracker.h: Added.
3083         * platform/network/FormData.cpp:
3084         (WebCore::FormDataElement::lengthInBytes const):
3085         (WebCore::FormData::lengthInBytes const):
3086         * platform/network/FormData.h:
3087
3088 2017-08-15  Darin Adler  <darin@apple.com>
3089
3090         REGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer.html is crashing.
3091         https://bugs.webkit.org/show_bug.cgi?id=175107
3092
3093         Reviewed by Alexey Proskuryakov.
3094
3095         * loader/FrameLoader.cpp:
3096         (WebCore::FrameLoader::checkLoadComplete): Moved the assertion to after the null page check.
3097
3098 2017-08-15  Commit Queue  <commit-queue@webkit.org>
3099
3100         Unreviewed, rolling out r219504.
3101         https://bugs.webkit.org/show_bug.cgi?id=175580
3102
3103         Broke Arabic text shaping (Requested by mcatanzaro on
3104         #webkit).
3105
3106         Reverted changeset:
3107
3108         "[HarfBuzz] Decomposed Vietnamese characters are rendered
3109         incorrectly"
3110         https://bugs.webkit.org/show_bug.cgi?id=174418
3111         http://trac.webkit.org/changeset/219504
3112
3113 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3114
3115         WebDriver: handle click events on option elements
3116         https://bugs.webkit.org/show_bug.cgi?id=174710
3117         <rdar://problem/33459305>
3118
3119         Reviewed by Brian Burg.
3120
3121         Export WebCore symbols required by WebKit layer.
3122
3123         * html/HTMLOptGroupElement.h:
3124         * html/HTMLOptionElement.h:
3125
3126 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
3127
3128         Remove Proximity Events and related code
3129         https://bugs.webkit.org/show_bug.cgi?id=175545
3130
3131         Reviewed by Daniel Bates.
3132
3133         No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
3134         and other related code.
3135
3136         * CMakeLists.txt:
3137         * Configurations/FeatureDefines.xcconfig:
3138         * DerivedSources.cpp:
3139         * Modules/proximity/DeviceProximityClient.h: Removed.
3140         * Modules/proximity/DeviceProximityController.cpp: Removed.
3141         * Modules/proximity/DeviceProximityController.h: Removed.
3142         * Modules/proximity/DeviceProximityEvent.cpp: Removed.
3143         * Modules/proximity/DeviceProximityEvent.h: Removed.
3144         * Modules/proximity/DeviceProximityEvent.idl: Removed.
3145         * dom/EventNames.h:
3146         * dom/EventNames.in:
3147         * history/PageCache.cpp:
3148         (WebCore::canCachePage):
3149         * page/DOMWindow.cpp:
3150         (WebCore::DOMWindow::addEventListener):
3151         (WebCore::DOMWindow::removeEventListener):
3152         (WebCore::DOMWindow::removeAllEventListeners):
3153         * page/DOMWindow.idl:
3154         * page/DiagnosticLoggingKeys.cpp:
3155         (WebCore::DiagnosticLoggingKeys::deviceProximityKey): Deleted.
3156         * page/DiagnosticLoggingKeys.h:
3157         * testing/Internals.cpp:
3158         (WebCore::Internals::setDeviceProximity): Deleted.
3159         * testing/Internals.h:
3160         * testing/Internals.idl:
3161
3162 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
3163
3164         Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
3165         https://bugs.webkit.org/show_bug.cgi?id=175504
3166
3167         Reviewed by Sam Weinig.
3168         
3169         REQUEST_AUTOCOMPLETE was added in r133396 then removed in r148731, but brought back in r173596,
3170         however no further work was done, and it was left disabled. So remove the code.
3171
3172         * Configurations/FeatureDefines.xcconfig:
3173         * DerivedSources.make:
3174         * WebCore.xcodeproj/project.pbxproj:
3175         * dom/AutocompleteErrorEvent.h: Removed.
3176         * dom/AutocompleteErrorEvent.idl: Removed.
3177         * dom/EventNames.in:
3178         * dom/GlobalEventHandlers.idl:
3179         * html/HTMLFormElement.cpp:
3180         (WebCore::HTMLFormElement::HTMLFormElement):
3181         (WebCore::HTMLFormElement::requestAutocomplete): Deleted.
3182         (WebCore::HTMLFormElement::finishRequestAutocomplete): Deleted.
3183         (WebCore::HTMLFormElement::requestAutocompleteTimerFired): Deleted.
3184         * html/HTMLFormElement.h:
3185         * html/HTMLFormElement.idl:
3186         * loader/EmptyClients.cpp:
3187         * loader/FrameLoaderClient.h:
3188
3189 2017-08-14  Chris Dumez  <cdumez@apple.com>
3190
3191         XHR should only fire an abort event if the cancellation was requested by the client
3192         https://bugs.webkit.org/show_bug.cgi?id=175546
3193
3194         Reviewed by Youenn Fablet.
3195
3196         XHR should only fire an abort event if the cancellation was requested by the client, otherwise it should fire an error event.
3197         Blink and Gecko already match the specification.
3198
3199         Specification:
3200         - https://xhr.spec.whatwg.org/#handle-errors
3201         - https://xhr.spec.whatwg.org/#the-abort()-method
3202
3203         Test: http/tests/navigation/page-cache-xhr-in-pagehide.html
3204
3205         * xml/XMLHttpRequest.cpp:
3206         (WebCore::XMLHttpRequest::open):
3207         (WebCore::XMLHttpRequest::abort):
3208         (WebCore::XMLHttpRequest::abortError):
3209         (WebCore::XMLHttpRequest::didFail):
3210         * xml/XMLHttpRequest.h:
3211
3212 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
3213
3214         Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
3215         https://bugs.webkit.org/show_bug.cgi?id=175557
3216
3217         Reviewed by Jon Lee.
3218
3219         No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
3220
3221         * Configurations/FeatureDefines.xcconfig:
3222         * css/CSSValueKeywords.in:
3223         * css/MediaFeatureNames.h:
3224         * css/MediaQueryEvaluator.cpp:
3225         (WebCore::viewModeEvaluate): Deleted.
3226         * css/MediaQueryExpression.cpp:
3227         (WebCore::featureWithValidIdent):
3228         (WebCore::isFeatureValidWithoutValue):
3229         * page/Page.cpp:
3230         (WebCore::Page::stringToViewMode): Deleted.
3231         (WebCore::Page::setViewMode): Deleted.
3232         * page/Page.h:
3233         (WebCore::Page::viewMode const): Deleted.
3234
3235 2017-08-14  Myles C. Maxfield  <mmaxfield@apple.com>
3236
3237         Parse font-display
3238         https://bugs.webkit.org/show_bug.cgi?id=175382
3239
3240         Reviewed by Simon Fraser.
3241
3242         The syntax is very simple: font-display: auto | block | swap | fallback | optional.
3243         So, parsing support is quite straightfoward.
3244
3245         Test: fast/text/font-display/parse.html
3246
3247         * css/CSSComputedStyleDeclaration.cpp:
3248         (WebCore::ComputedStyleExtractor::propertyValue):
3249         * css/CSSFontFace.cpp:
3250         (WebCore::CSSFontFace::setLoadingBehavior):
3251         * css/CSSFontFace.h:
3252         * css/CSSFontSelector.cpp:
3253         (WebCore::CSSFontSelector::addFontFaceRule):
3254         * css/CSSPrimitiveValueMappings.h:
3255         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3256         (WebCore::CSSPrimitiveValue::operator FontLoadingBehavior const):
3257         * css/CSSProperties.json:
3258         * css/CSSProperty.cpp:
3259         (WebCore::CSSProperty::isDescriptorOnly):
3260         * css/CSSValueKeywords.in:
3261         * css/parser/CSSPropertyParser.cpp:
3262         (WebCore::consumeFontFaceFontDisplay):
3263         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
3264         * rendering/style/RenderStyleConstants.h:
3265
3266 2017-08-14  Jer Noble  <jer.noble@apple.com>
3267
3268         Obj-C exception crash in AVStreamSession when using EME in Private Browsing mode
3269         https://bugs.webkit.org/show_bug.cgi?id=175547
3270
3271         Reviewed by Eric Carlson.
3272
3273         When the storagePath() is empty, do not use those AVStreamSession APIs which require a valid file path to stored
3274         proof-of-key-release data.
3275
3276         Drive-by fix: return emptyString() from HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory() when in Private
3277         Browsing mode, to match the behavior of WebKitMediaKeySession.
3278
3279         * html/HTMLMediaElement.cpp:
3280         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
3281         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3282         (WebCore::CDMSessionAVStreamSession::releaseKeys):
3283         (WebCore::CDMSessionAVStreamSession::update):
3284         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
3285
3286 2017-08-14  Andy Estes  <aestes@apple.com>
3287
3288         REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
3289         https://bugs.webkit.org/show_bug.cgi?id=175548
3290         <rdar://problem/33866206>
3291
3292         Reviewed by Brady Eidson.
3293
3294         New API test: QuickLook.ShouldCreateForMIMEType
3295
3296         * WebCore.xcodeproj/project.pbxproj:
3297         * loader/ios/PreviewLoader.h:
3298         * loader/ios/PreviewLoader.mm:
3299         (WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before
3300         calling HashSet::contains().
3301
3302 2017-08-14  Andy Estes  <aestes@apple.com>
3303
3304         [Apple Pay] Add support for phonetic contact names
3305         https://bugs.webkit.org/show_bug.cgi?id=175537
3306         <rdar://problem/32002644>
3307
3308         Reviewed by Tim Horton.
3309
3310         * Modules/applepay/ApplePayError.idl: Defined "phoneticName" in ApplePayErrorContactField.
3311         * Modules/applepay/ApplePayPaymentContact.h: Defined phoneticGivenName and phoneticFamilyName
3312         in ApplePayPaymentContact.
3313         * Modules/applepay/ApplePayPaymentContact.idl: Ditto.
3314         * Modules/applepay/ApplePayPaymentRequest.h: Defined PhoneticName in
3315         ApplePayPaymentRequest::ContactField.
3316         * Modules/applepay/ApplePayPaymentRequest.idl: Defined "phoneticName" in ApplePayContactField.
3317         * Modules/applepay/ApplePaySession.cpp:
3318         (WebCore::convertAndValidate): Added a version parameter. Added code to convert
3319         ContactField::PhoneticName, throwing an exception if version is less than 3.
3320         * Modules/applepay/PaymentContact.h: Added a version parameter to fromApplePayPaymentContact().
3321         * Modules/applepay/PaymentRequest.h: Defined phoneticName in PaymentRequest::ContactFields
3322         and defined PhoneticName in PaymentError::ContactField.
3323         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3324         (WebCore::convert): Added a version parameter. Set a phoneticRepresentation on the
3325         PKContact's name if there are non-empty phonetic names and version is 3 or greater.
3326         (WebCore::PaymentContact::fromApplePayPaymentContact): Passed version to convert().
3327
3328 2017-08-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3329
3330         The none smooth stroke applied to an SVG shape breaks its hit testing
3331         https://bugs.webkit.org/show_bug.cgi?id=175506
3332
3333         Reviewed by Simon Fraser.
3334
3335         Clear RenderSVGShape::m_path when calling RenderSVGRect::updateShapeFromElement().
3336         The m_path will be recalculated when RenderSVGShape::updateShapeFromElement()
3337         is called from RenderSVGRect::shapeDependentStrokeContains().
3338
3339         Test: svg/stroke/stroke-linejoin-click.html
3340
3341         * rendering/svg/RenderSVGRect.cpp:
3342         (WebCore::RenderSVGRect::updateShapeFromElement):
3343         * rendering/svg/RenderSVGShape.h:
3344         (WebCore::RenderSVGShape::clearPath):
3345
3346 2017-08-14  Adrian Perez de Castro  <aperez@igalia.com>
3347
3348         [WPE] Implement WebCore::standardUserAgent()
3349         https://bugs.webkit.org/show_bug.cgi?id=175507
3350
3351         Reviewed by Michael Catanzaro.
3352
3353         Remove "_GLIB" from user-agent version macros.
3354
3355         * platform/glib/UserAgentGLib.cpp:
3356         (WebCore::versionForUAString):
3357
3358 2017-08-14  Chris Dumez  <cdumez@apple.com>
3359
3360         Unreviewed, rollout r220622 & r220696
3361         https://bugs.webkit.org/show_bug.cgi?id=175482
3362         <rdar://problem/33860695>
3363
3364         Seems to have caused failures on iOS.
3365
3366         * CMakeLists.txt:
3367         * Modules/beacon/NavigatorBeacon.cpp:
3368         (WebCore::NavigatorBeacon::sendBeacon):
3369         * Modules/fetch/FetchBodyOwner.cpp:
3370         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
3371         (WebCore::FetchBodyOwner::BlobLoader::didFail):
3372         * Modules/fetch/FetchBodyOwner.h:
3373         * Modules/fetch/FetchLoader.cpp:
3374         (WebCore::FetchLoader::start):
3375         (WebCore::FetchLoader::didFail):
3376         * Modules/fetch/FetchLoaderClient.h:
3377         * Modules/fetch/FetchResponse.cpp:
3378         (WebCore::FetchResponse::BodyLoader::didFail):
3379         * Modules/fetch/FetchResponse.h:
3380         * WebCore.xcodeproj/project.pbxproj:
3381         * loader/DocumentThreadableLoader.cpp:
3382         (WebCore::DocumentThreadableLoader::loadRequest):
3383         * loader/cache/CachedRawResource.cpp:
3384         (WebCore::CachedRawResource::finishLoading):
3385         * loader/cache/CachedResource.cpp:
3386         (WebCore::CachedResource::load):
3387         * loader/cache/CachedResource.h:
3388         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
3389         * loader/cache/CachedResourceLoader.cpp:
3390         (WebCore::createResource):
3391         (WebCore::CachedResourceLoader::requestImage):
3392         (WebCore::CachedResourceLoader::requestFont):
3393         (WebCore::CachedResourceLoader::requestTextTrack):
3394         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
3395         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3396         (WebCore::CachedResourceLoader::requestScript):
3397         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
3398         (WebCore::CachedResourceLoader::requestSVGDocument):
3399         (WebCore::CachedResourceLoader::requestLinkResource):
3400         (WebCore::CachedResourceLoader::requestMedia):
3401         (WebCore::CachedResourceLoader::requestIcon):
3402         (WebCore::CachedResourceLoader::requestRawResource):
3403         (WebCore::CachedResourceLoader::requestBeaconResource):
3404         (WebCore::CachedResourceLoader::requestMainResource):
3405         (WebCore::CachedResourceLoader::requestResource):
3406         (WebCore::CachedResourceLoader::preload):
3407         * loader/cache/CachedResourceLoader.h:
3408         * loader/cache/KeepaliveRequestTracker.cpp: Removed.
3409         * loader/cache/KeepaliveRequestTracker.h: Removed.
3410         * platform/network/FormData.cpp:
3411         (WebCore::FormData::appendFile):
3412         (WebCore::FormData::appendFileRange):
3413         (WebCore::FormData::appendBlob):
3414         (WebCore::FormData::expandDataStore):
3415         * platform/network/FormData.h:
3416
3417 2017-08-14  Daniel Bates  <dabates@apple.com>
3418
3419         [css-ui] Implement caret-color support
3420         https://bugs.webkit.org/show_bug.cgi?id=166572
3421         <rdar://problem/33852589>
3422