Unreviewed. Removing redundant NotImplemented.h header inclusions
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
2
3         Unreviewed. Removing redundant NotImplemented.h header inclusions
4         and cleaning up whitespace issues in libgcrypt-specific CryptoKeyEC
5         and CryptoKeyRSA implementation files.
6
7         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
8         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
9
10 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
11
12         Remove unnecesary call to status bar SPI.
13         https://bugs.webkit.org/show_bug.cgi?id=175176
14         rdar://problem/20887306
15
16         Reviewed by Darin Adler.
17
18         No new tests because no behavior change.
19
20         This removes an obsolete call to SPI.
21
22         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
23         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
24
25 2017-08-03  Zan Dobersek  <zdobersek@igalia.com>
26
27         [GCrypt] Implement CryptoKeyEC PKCS#8 imports
28         https://bugs.webkit.org/show_bug.cgi?id=173647
29
30         Reviewed by Jiewen Tan.
31
32         No new tests -- affected tests are now passing and are unskipped.
33
34         Implement libgcrypt-based support for PKCS#8 imports of EC keys.
35
36         Existing libtasn1 utilities are used to achieve this. First, the provided key data
37         is decoded against the PrivateKeyInfo ASN.1 definition. First, the version member
38         of that structure is validated, followed by the algorithm member. The latter is
39         also properly tested depending on this being an import of an ECDSA or ECDH key.
40
41         Data of the parameters member is decoded against the ECParameters ASN.1 definition,
42         and the namedCurve object identifier is validated, making sure it represents a
43         valid EC curve and that this curve maches the one specified for the import
44         operation.
45
46         Data of the privateKey member is decoded against the ECPrivateKey ASN.1 definition.
47         The version member of that structure is properly validated. The optional parameters
48         member of that structure is already decoded against the ECParameters ASN.1
49         definition. If present, it is checked to contain a valid EC curve identifier that
50         matches the specified curve.
51
52         The optional publicKey member of the ECPrivateKey structure is validated, testing
53         that its data matches in size an uncompressed EC point, and that the first byte
54         of this data is 0x04, as expected for an uncompressed EC point.
55
56         What's left is the private key data on the initial ECPrivateKey structure. That
57         data is retrieved and validated, making sure its size matches the size of the
58         specified curve. The `private-key` s-expression is then constructed, embedding
59         the curve name and the validated private key data. This s-expression is then used
60         to construct an EC context.
61
62         If the optional publicKey data was provided, it's used to set the `q` parameter
63         for this EC context. Otherwise, the value for `q` is computed on-the-fly for the
64         specified EC and the provided private key. The `q` point is then tested through
65         the gcry_mpi_ec_curve_point() function, making sure that the derived point is
66         indeed located on the given EC.
67
68         Finally, with the private key properly validated, a new CryptoKeyEC object is
69         constructed, using the `private-key` s-expression and the parameters that were
70         specified for this import operation.
71
72         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
73         (WebCore::CryptoKeyEC::platformImportPkcs8):
74         * crypto/gcrypt/GCryptUtilities.h:
75
76 2017-08-03  Chris Dumez  <cdumez@apple.com>
77
78         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
79         https://bugs.webkit.org/show_bug.cgi?id=175132
80
81         Reviewed by Darin Adler.
82
83         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.', without
84         a leading 0. This is as per https://github.com/whatwg/html/pull/2852.
85
86         The latest spec is at:
87         - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
88
89         Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
90
91         * html/parser/HTMLParserIdioms.cpp:
92         (WebCore::parseHTTPRefreshInternal):
93
94 2017-08-03  Brian Burg  <bburg@apple.com>
95
96         Remove ENABLE(WEB_SOCKET) guards
97         https://bugs.webkit.org/show_bug.cgi?id=167044
98
99         Reviewed by Joseph Pecoraro.
100
101         * Configurations/FeatureDefines.xcconfig:
102         * Modules/websockets/ThreadableWebSocketChannel.cpp:
103         * Modules/websockets/ThreadableWebSocketChannel.h:
104         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
105         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
106         * Modules/websockets/WebSocket.cpp:
107         * Modules/websockets/WebSocket.h:
108         * Modules/websockets/WebSocket.idl:
109         * Modules/websockets/WebSocketChannel.cpp:
110         * Modules/websockets/WebSocketChannel.h:
111         * Modules/websockets/WebSocketChannelClient.h:
112         * Modules/websockets/WebSocketDeflateFramer.cpp:
113         * Modules/websockets/WebSocketDeflateFramer.h:
114         * Modules/websockets/WebSocketDeflater.cpp:
115         * Modules/websockets/WebSocketDeflater.h:
116         * Modules/websockets/WebSocketExtensionDispatcher.cpp:
117         * Modules/websockets/WebSocketExtensionDispatcher.h:
118         * Modules/websockets/WebSocketExtensionParser.cpp:
119         * Modules/websockets/WebSocketExtensionParser.h:
120         * Modules/websockets/WebSocketExtensionProcessor.h:
121         * Modules/websockets/WebSocketFrame.cpp:
122         * Modules/websockets/WebSocketFrame.h:
123         * Modules/websockets/WebSocketHandshake.cpp:
124         * Modules/websockets/WebSocketHandshake.h:
125         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
126         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
127         * dom/Document.cpp:
128         (WebCore::Document::Document):
129         (WebCore::Document::idbConnectionProxy):
130         (WebCore::Document::socketProvider):
131         * dom/Document.h:
132         * dom/ScriptExecutionContext.h:
133         * inspector/InspectorInstrumentation.cpp:
134         (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl):
135         * inspector/InspectorInstrumentation.h:
136         (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
137         * inspector/InspectorNetworkAgent.cpp:
138         * inspector/InspectorNetworkAgent.h:
139         * page/RuntimeEnabledFeatures.cpp:
140         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const):
141         * page/RuntimeEnabledFeatures.h:
142         * page/SocketProvider.cpp:
143         * page/SocketProvider.h:
144         * workers/WorkerGlobalScope.cpp:
145         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
146         * workers/WorkerGlobalScope.h:
147         * workers/WorkerMessagingProxy.cpp:
148         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
149         * workers/WorkerThread.cpp:
150         (WebCore::WorkerThread::WorkerThread):
151         (WebCore::WorkerThread::socketProvider):
152         * workers/WorkerThread.h:
153
154 2017-08-03  Don Olmstead  <don.olmstead@sony.com>
155
156         Remove LayoutUnit dependency in TextStream
157         https://bugs.webkit.org/show_bug.cgi?id=175110
158
159         Reviewed by Zalan Bujtas.
160
161         No new tests. No change in behavior.
162
163         * CMakeLists.txt:
164         * WebCore.xcodeproj/project.pbxproj:
165         * platform/LayoutUnit.cpp: Added.
166         (WebCore::operator<<):
167         * platform/LayoutUnit.h:
168         * platform/text/TextStream.cpp:
169         * platform/text/TextStream.h:
170
171 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
172
173         Improve WebKitLegacy video fullscreen animation begin and end rects.
174         https://bugs.webkit.org/show_bug.cgi?id=175152
175         rdar://problem/32840576
176
177         Reviewed by Eric Carlson.
178
179         No new tests, becuase this change has no effect on the DOM.
180
181         This change uses different rects for fullscreen animation to prevent the animation
182         from failing, and to improve the aesthetics of the animation.
183
184         * platform/mac/WebVideoFullscreenController.mm:
185         (frameExpandedToRatioOfFrame):
186         (-[WebVideoFullscreenController enterFullscreen:]):
187         (-[WebVideoFullscreenController exitFullscreen]):
188         (-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]):
189         (constrainFrameToRatioOfFrame): Deleted.
190
191 2017-08-03  Jer Noble  <jer.noble@apple.com>
192
193         [EME][Mac] SecureStop left on disk in Private Browsing mode.
194         https://bugs.webkit.org/show_bug.cgi?id=175162
195
196         Reviewed by Eric Carlson.
197
198         Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should
199         be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat
200         an empty string as valid, and do not try to store or retrieve session information to disk in that case.
201
202         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
203         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
204         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
205         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
206         (WebCore::CDMSessionAVContentKeySession::update):
207         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
208         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
209         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
210         (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const):
211
212 2017-08-03  Youenn Fablet  <youenn@apple.com>
213
214         [Fetch API] Add support for Request keepalive getter
215         https://bugs.webkit.org/show_bug.cgi?id=175151
216
217         Reviewed by Chris Dumez.
218
219         Test: imported/w3c/web-platform-tests/fetch/api/request/request-keepalive.html
220
221         Adding keepalive as a fetch option.
222         Adding initialization and getter of keepalive into FetchRequest.
223
224         * Modules/fetch/FetchRequest.cpp:
225         (WebCore::buildOptions):
226         * Modules/fetch/FetchRequest.h:
227         * Modules/fetch/FetchRequest.idl:
228         * loader/FetchOptions.h:
229
230 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
231
232         [PAL] Move spi/cf directory into PAL
233         https://bugs.webkit.org/show_bug.cgi?id=175057
234
235         Reviewed by Antti Koivisto.
236
237         * WebCore.xcodeproj/project.pbxproj:
238         * loader/cocoa/DiskCacheMonitorCocoa.mm:
239         * loader/cocoa/SubresourceLoaderCocoa.mm:
240         * loader/mac/ResourceLoaderMac.mm:
241         * platform/cf/CoreMediaSoftLink.cpp:
242         * platform/cf/CoreMediaSoftLink.h:
243         * platform/mac/PluginBlacklist.mm:
244         * platform/mac/WebCoreNSStringExtras.mm:
245         * platform/mac/WebGLBlacklist.mm:
246         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
247         * platform/network/NetworkStorageSession.h:
248         * platform/network/cf/CookieJarCFNet.cpp:
249         * platform/network/cf/CredentialStorageCFNet.cpp:
250         * platform/network/cf/ResourceHandleCFNet.cpp:
251         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
252         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
253         * platform/network/cf/ResourceRequestCFNet.cpp:
254         * platform/network/cf/ResourceRequestCFNet.h:
255         * platform/network/cf/ResourceResponse.h:
256         * platform/network/cf/ResourceResponseCFNet.cpp:
257         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
258         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
259         * platform/network/cocoa/CookieStorageObserver.h:
260         * platform/network/cocoa/CredentialCocoa.h:
261         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
262         * platform/network/cocoa/ResourceRequestCocoa.mm:
263         * platform/network/cocoa/ResourceResponseCocoa.mm:
264         * platform/network/ios/ResourceRequestIOS.mm:
265         * platform/network/mac/CookieJarMac.mm:
266         * platform/network/mac/FormDataStreamMac.mm:
267         * platform/network/mac/ResourceHandleMac.mm:
268         * platform/network/mac/ResourceRequestMac.mm:
269         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
270         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
271         * platform/network/mac/WebCoreURLResponse.h:
272         * testing/cocoa/WebArchiveDumpSupport.mm:
273
274 2017-08-03  Youenn Fablet  <youenn@apple.com>
275
276         Remove FETCH_API compilation guard
277         https://bugs.webkit.org/show_bug.cgi?id=175154
278
279         Reviewed by Chris Dumez.
280
281         No change of behavior.
282
283         * Configurations/FeatureDefines.xcconfig:
284         * Modules/fetch/DOMWindowFetch.cpp:
285         * Modules/fetch/DOMWindowFetch.h:
286         * Modules/fetch/DOMWindowFetch.idl:
287         * Modules/fetch/FetchBody.cpp:
288         * Modules/fetch/FetchBody.h:
289         * Modules/fetch/FetchBody.idl:
290         * Modules/fetch/FetchBodyConsumer.cpp:
291         * Modules/fetch/FetchBodyConsumer.h:
292         * Modules/fetch/FetchBodyOwner.cpp:
293         * Modules/fetch/FetchBodyOwner.h:
294         * Modules/fetch/FetchHeaders.cpp:
295         * Modules/fetch/FetchHeaders.h:
296         * Modules/fetch/FetchHeaders.idl:
297         * Modules/fetch/FetchInternals.js:
298         * Modules/fetch/FetchLoader.cpp:
299         * Modules/fetch/FetchLoader.h:
300         * Modules/fetch/FetchLoaderClient.h:
301         * Modules/fetch/FetchRequest.cpp:
302         * Modules/fetch/FetchRequest.h:
303         * Modules/fetch/FetchRequest.idl:
304         * Modules/fetch/FetchResponse.cpp:
305         * Modules/fetch/FetchResponse.h:
306         * Modules/fetch/FetchResponse.idl:
307         * Modules/fetch/FetchResponse.js:
308         * Modules/fetch/FetchResponseSource.cpp:
309         * Modules/fetch/FetchResponseSource.h:
310         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
311         * Modules/fetch/WorkerGlobalScopeFetch.h:
312         * Modules/fetch/WorkerGlobalScopeFetch.idl:
313         * page/RuntimeEnabledFeatures.h:
314         (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const):
315
316 2017-08-03  Devin Rousso  <drousso@apple.com>
317
318         Web Inspector: add button to open Inspector^2
319         https://bugs.webkit.org/show_bug.cgi?id=175108
320
321         Reviewed by Brian Burg.
322
323         This patch just exposes a function to the inspector page. No new functionality was added.
324
325         * inspector/InspectorFrontendHost.idl:
326         * inspector/InspectorFrontendHost.h:
327         * inspector/InspectorFrontendHost.cpp:
328         (WebCore::InspectorFrontendHost::inspectInspector):
329
330 2017-08-03  Matt Baker  <mattbaker@apple.com>
331
332         Web Inspector: Instrument WebGLProgram created/deleted
333         https://bugs.webkit.org/show_bug.cgi?id=175059
334
335         Reviewed by Devin Rousso.
336
337         Tests: inspector/canvas/shaderProgram-add-remove-webgl.html
338                inspector/canvas/shaderProgram-add-remove-webgl2.html
339
340         This patch adds instrumentation to WebGLRenderingContextBase for tracking
341         WebGLPrograms. A new helper class, InspectorShaderProgram, is used by
342         the CanvasAgent to hold related data.
343
344         * CMakeLists.txt:
345         * WebCore.xcodeproj/project.pbxproj:
346
347         * html/canvas/WebGLRenderingContextBase.cpp:
348         (WebCore::WebGLRenderingContextBase::createProgram):
349         (WebCore::WebGLRenderingContextBase::deleteProgram):
350
351         * inspector/InspectorCanvasAgent.cpp:
352         (WebCore::InspectorCanvasAgent::enable):
353         (WebCore::InspectorCanvasAgent::frameNavigated):
354         (WebCore::InspectorCanvasAgent::didCreateProgram):
355         (WebCore::InspectorCanvasAgent::willDeleteProgram):
356         (WebCore::InspectorCanvasAgent::clearCanvasData):
357         (WebCore::InspectorCanvasAgent::unbindCanvas):
358         (WebCore::InspectorCanvasAgent::unbindProgram):
359         (WebCore::InspectorCanvasAgent::assertInspectorProgram):
360         (WebCore::InspectorCanvasAgent::findInspectorProgram):
361         * inspector/InspectorCanvasAgent.h:
362
363         * inspector/InspectorInstrumentation.cpp:
364         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
365         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
366         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
367         (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
368         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
369         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
370         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
371         (WebCore::InspectorInstrumentation::willDeleteProgramImpl):
372
373         * inspector/InspectorInstrumentation.h:
374         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
375         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
376         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
377         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
378         (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
379         (WebCore::InspectorInstrumentation::recordCanvasAction):
380         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
381         (WebCore::InspectorInstrumentation::didCreateProgram):
382         (WebCore::InspectorInstrumentation::willDeleteProgram):
383
384         * inspector/InspectorShaderProgram.cpp: Added.
385         (WebCore::InspectorShaderProgram::create):
386         (WebCore::InspectorShaderProgram::InspectorShaderProgram):
387         (WebCore::InspectorShaderProgram::context const):
388         * inspector/InspectorShaderProgram.h: Added.
389
390 2017-08-03  Matt Lewis  <jlewis3@apple.com>
391
392         Unreviewed, rolling out r220209.
393
394         This caused internal build failures.
395
396         Reverted changeset:
397
398         "Use MPAVRoutingController instead of deprecated versions."
399         https://bugs.webkit.org/show_bug.cgi?id=175063
400         http://trac.webkit.org/changeset/220209
401
402 2017-08-03  Brady Eidson  <beidson@apple.com>
403
404         Add SW IDLs and stub out basic functionality.
405         https://bugs.webkit.org/show_bug.cgi?id=175115
406
407         Reviewed by Chris Dumez.
408
409         No new tests (Currently no behavior change).
410
411         Overall note: This feature is EnabledAtRuntime as opposed to EnabledBySetting because
412         the Settings-based code generation is completely broken for non-Document contexts,
413         whereas the RuntimeEnabledFeatures-based generation is not.
414     
415         * CMakeLists.txt:
416         * Configurations/FeatureDefines.xcconfig:
417         * DerivedSources.make:
418         * WebCore.xcodeproj/project.pbxproj:
419
420         * bindings/scripts/preprocess-idls.pl: Handle the new global scope c'tor file.
421
422         * bindings/js/JSServiceWorkerContainerCustom.cpp: Added.
423         (WebCore::JSServiceWorkerContainer::ready const):
424
425         * bindings/js/JSWorkerGlobalScopeBase.cpp:
426         (WebCore::toJSWorkerGlobalScope): Refactor to handle both types of derived workers.
427         (WebCore::toJSServiceWorkerGlobalScope):
428         * bindings/js/JSWorkerGlobalScopeBase.h:
429
430         * dom/EventNames.h:
431         * dom/EventTargetFactory.in:
432
433         * features.json: Change status of feature.
434
435         * page/Navigator.idl:
436         * page/NavigatorBase.cpp:
437         (WebCore::NavigatorBase::serviceWorker):
438         * page/NavigatorBase.h:
439         * page/NavigatorServiceWorker.idl: Added.
440
441         * page/RuntimeEnabledFeatures.h:
442         (WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const):
443         (WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled):
444
445         * workers/ServiceWorker.cpp: Added.
446         (WebCore::ServiceWorker::postMessage):
447         (WebCore::ServiceWorker::~ServiceWorker):
448         (WebCore::ServiceWorker::scriptURL const):
449         (WebCore::ServiceWorker::state const):
450         (WebCore::ServiceWorker::eventTargetInterface const):
451         (WebCore::ServiceWorker::scriptExecutionContext const):
452         * workers/ServiceWorker.h: Added.
453         * workers/ServiceWorker.idl: Added.
454
455         * workers/ServiceWorkerContainer.cpp: Added.
456         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
457         (WebCore::ServiceWorkerContainer::controller const):
458         (WebCore::ServiceWorkerContainer::ready):
459         (WebCore::ServiceWorkerContainer::addRegistration):
460         (WebCore::ServiceWorkerContainer::getRegistration):
461         (WebCore::ServiceWorkerContainer::getRegistrations):
462         (WebCore::ServiceWorkerContainer::startMessages):
463         (WebCore::ServiceWorkerContainer::eventTargetInterface const):
464         (WebCore::ServiceWorkerContainer::scriptExecutionContext const):
465         * workers/ServiceWorkerContainer.h: Added.
466         * workers/ServiceWorkerContainer.idl: Added.
467
468         * workers/ServiceWorkerGlobalScope.cpp: Added.
469         (WebCore::ServiceWorkerGlobalScope::registration):
470         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
471         * workers/ServiceWorkerGlobalScope.h: Added.
472         * workers/ServiceWorkerGlobalScope.idl: Added.
473
474         * workers/ServiceWorkerRegistration.cpp: Added.
475         (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
476         (WebCore::ServiceWorkerRegistration::installing):
477         (WebCore::ServiceWorkerRegistration::waiting):
478         (WebCore::ServiceWorkerRegistration::active):
479         (WebCore::ServiceWorkerRegistration::scope const):
480         (WebCore::ServiceWorkerRegistration::update):
481         (WebCore::ServiceWorkerRegistration::unregister):
482         (WebCore::ServiceWorkerRegistration::eventTargetInterface const):
483         (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
484         * workers/ServiceWorkerRegistration.h: Added.
485         * workers/ServiceWorkerRegistration.idl: Added.
486
487 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
488
489         [WebCore] Sort Xcode project files
490         https://bugs.webkit.org/show_bug.cgi?id=175121
491
492         Reviewed by Antti Koivisto.
493
494         * WebCore.xcodeproj/project.pbxproj:
495
496 2017-08-02  Sam Weinig  <sam@webkit.org>
497
498         [WebIDL] Convert MutationCallback to be a normal generated callback
499         https://bugs.webkit.org/show_bug.cgi?id=174140
500
501         Reviewed by Darin Adler.
502
503         To make this work more nicely, I:
504         - Added the ability to for non-nullable interfaces in sequences to be passed
505           via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
506           (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
507           signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
508           than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
509         - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
510           which allows you to specify that the callback needs a this object in addition
511           to its arguments. When specified, the first argument of the C++ implementation
512           function will now correspond to the this object, with the remaining arguments
513           shifted over one.
514         - Converted callback objects to all inherit directly from ActiveDOMCallback rather
515           than having the generated JS callback derived class inherit from it. This allows
516           us to have access to a callback's canInvokeCallback() function anywhere (needed
517           for MutationCallback) as well as giving a place to put an optional virtual 
518           visitJSFunction to allow marking weak callbacks (while not an ideal layering, 
519           this matches what we do in EventListener). This change requires each callback to
520           have a bit more code to import the ActiveDOMCallback's constructor and requires
521           non-JS derived callbacks to pass a ScriptExecutionContext (e.g. the Document).
522
523         * CMakeLists.txt:
524         * DerivedSources.make:
525         * WebCore.xcodeproj/project.pbxproj:
526         * bindings/js/JSMutationCallback.cpp: Removed.
527         * bindings/js/JSMutationCallback.h: Removed.
528         Remove custom JSMutationCallback.h/cpp
529
530         * Modules/geolocation/PositionCallback.h:
531         * Modules/geolocation/PositionErrorCallback.h:
532         * Modules/notifications/NotificationPermissionCallback.h:
533         * Modules/webaudio/AudioBufferCallback.h:
534         * Modules/webdatabase/DatabaseCallback.h:
535         * Modules/webdatabase/SQLStatementCallback.h:
536         * Modules/webdatabase/SQLStatementErrorCallback.h:
537         * Modules/webdatabase/SQLTransactionCallback.h:
538         * Modules/webdatabase/SQLTransactionErrorCallback.h:
539         * css/MediaQueryListListener.h:
540         * dom/NodeFilter.h:
541         * dom/RequestAnimationFrameCallback.h:
542         * dom/StringCallback.h:
543         * fileapi/BlobCallback.h:
544         * html/VoidCallback.h:
545         * page/IntersectionObserverCallback.h:
546         * page/PerformanceObserverCallback.h:
547         Add ActiveDOMCallback as a base class. Import the ActiveDOMCallback constructor.
548
549         * Modules/mediastream/MediaDevicesRequest.cpp:
550         (WebCore::MediaDevicesRequest::filterDeviceList):
551         (WebCore::MediaDevicesRequest::start):
552         * Modules/mediastream/MediaDevicesRequest.h:
553         Change filterDeviceList to take a Vector of Refs.
554
555         * bindings/IDLTypes.h:
556         Add InnerParameterType and NullableInnerParameterType type hooks
557         and specialize wrappers to use Ref for InnerParameterType, and RefPtr
558         for NullableInnerParameterType.
559
560         * bindings/js/JSCallbackData.cpp:
561         * bindings/js/JSCallbackData.h:
562         Add support for passing a this object and give JSCallbackDataWeak a visitJSFunction
563         to allow marking the underlying function.
564
565         * bindings/js/JSMutationObserverCustom.cpp:
566         (WebCore::JSMutationObserver::visitAdditionalChildren):
567         (WebCore::constructJSMutationObserver): Deleted.
568         Remove the custom constructor and replace it with a custom visitAdditionalChildren
569         that calls the new ActiveDOMObject's visitJSFunction.
570
571         * bindings/scripts/CodeGenerator.pm:
572         (ParseType):
573         Add helper to parse a type and cache the result.
574
575         * bindings/scripts/CodeGeneratorJS.pm:
576         (GenerateCallbackHeaderContent):
577         (GenerateCallbackImplementationContent):
578         (GetJSCallbackDataType): Deleted.
579         - Add support for [CallbackThisObject]. When [CallbackThisObject] is not specified, use jsUndefined() 
580           as the this object as specified by WebIDL.
581         - Stop inheriting from ActiveDOMCallback now that callbacks need to do this themselves.
582         - Add a visitJSFunction override for weak callback functions which calls into the callback data.
583
584         * bindings/scripts/IDLAttributes.json:
585         Add [CallbackThisObject].
586
587         * bindings/scripts/IDLParser.pm:
588         (ParseType):
589         Add entry point to parse a single type.
590
591         * css/FontFaceSet.h:
592         Use Ref rather than RefPtr for the faces sequence.
593
594         * dom/ActiveDOMCallback.h:
595         (WebCore::ActiveDOMCallback::visitJSFunction):
596         Add an optional visitJSFunction virtual function so that derived classes
597         have a way of marking underlying function objects.
598
599         * dom/MutationCallback.h:
600         Convert to support generation (return a CallbackResult, inherit from ActiveDOMObject).
601
602         * dom/MutationCallback.idl: Added.
603         Added to generate the callback. Uses the new [CallbackThisObject].
604
605         * dom/MutationObserver.cpp:
606         (WebCore::MutationObserver::deliver):
607         Switch to call idiomatic handleEvent, and pass *this as the first parameter
608         which will be translated into the this object.
609
610         * dom/MutationObserver.h:
611         (WebCore::MutationObserver::callback):
612         Expose the callback so it can marked during GC.
613
614         * dom/MutationObserver.idl:
615         Remove CustomConstructor and replace it with a custom mark function.
616
617         * dom/NativeNodeFilter.cpp:
618         * dom/NativeNodeFilter.h:
619         * inspector/InspectorDatabaseAgent.cpp:
620         Pass now needed ScriptExecutionContext to non-js based callbacks.
621
622         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
623         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
624         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
625         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
626         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
627         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
628         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
629         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
630         * bindings/scripts/test/TestCallbackFunctionWithThisObject.idl: Added.
631         * bindings/scripts/test/TestCallbackInterface.idl:
632         Add/update tests.
633
634 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
635
636         Use MPAVRoutingController instead of deprecated versions.
637         https://bugs.webkit.org/show_bug.cgi?id=175063
638
639         Reviewed by Tim Horton.
640
641         No new tests because no behavior change. This uses a different platform class to present
642         an interface.
643
644         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
645         Add MPMediaControlsViewController.
646
647         * platform/spi/ios/MediaPlayerSPI.h:
648
649 2017-08-03  Chris Dumez  <cdumez@apple.com>
650
651         Improve our support for referrer policies
652         https://bugs.webkit.org/show_bug.cgi?id=175069
653         <rdar://problem/33677313>
654
655         Reviewed by Darin Adler.
656
657         Improve our support for referrer policies. In particular, we now support the
658         additional following ones: "same-origin", "origin-when-cross-origin" and
659         "strict-origin-when-cross-origin".
660
661         This is as per the following specification:
662         - https://www.w3.org/TR/referrer-policy/#referrer-policies
663
664         Also refactor the code a bit for clarity: I merged the ReferrerPolicy enum and the
665         FetchOptions::ReferrerPolicy one.
666
667         Tests: http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http.html
668                http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https.html
669                http/tests/referrer-policy/origin-when-cross-origin/same-origin.html
670                http/tests/referrer-policy/same-origin/cross-origin-http-http.html
671                http/tests/referrer-policy/same-origin/cross-origin-http.https.html
672                http/tests/referrer-policy/same-origin/same-origin.html
673                http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http.html
674                http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https.html
675                http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin.html
676                http/tests/referrer-policy/strict-origin/cross-origin-http-http.html
677                http/tests/referrer-policy/strict-origin/cross-origin-http.https.html
678                http/tests/referrer-policy/strict-origin/same-origin.html
679
680         * Modules/fetch/FetchLoader.cpp:
681         (WebCore::FetchLoader::start):
682         * Modules/fetch/FetchReferrerPolicy.h:
683         * Modules/fetch/FetchReferrerPolicy.idl:
684         * Modules/fetch/FetchRequest.h:
685         * Modules/fetch/FetchRequestInit.h:
686         * dom/Document.cpp:
687         (WebCore::Document::processReferrerPolicy):
688         (WebCore::Document::applyQuickLookSandbox):
689         (WebCore::Document::applyContentDispositionAttachmentSandbox):
690         * dom/Document.h:
691         * loader/FetchOptions.h:
692         * loader/FrameNetworkingContext.h:
693         * loader/PingLoader.cpp:
694         (WebCore::PingLoader::sendBeacon):
695         Drop explicit call to SecurityPolicy::shouldHideReferrer(). This is already called inside
696         SecurityPolicy::generateReferrerHeader() and used only when needed, depending on the
697         actual referrer policy.
698
699         * loader/cache/CachedResourceLoader.cpp:
700         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
701         * loader/cache/CachedResourceRequest.cpp:
702         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
703         * page/SecurityPolicy.cpp:
704         (WebCore::referrerToOriginString):
705         (WebCore::SecurityPolicy::generateReferrerHeader):
706         * page/SecurityPolicy.h:
707         * platform/ReferrerPolicy.h:
708
709 2017-08-03  Daniel Bates  <dabates@apple.com>
710
711         Support ::marker pseudo-element
712         https://bugs.webkit.org/show_bug.cgi?id=141477
713
714         Reviewed by David Hyatt.
715
716         Implements the ::marker pseudo element as per the CSS Pseudo-Element Module Level 4
717         spec., <https://drafts.csswg.org/css-pseudo-4> (Editor's Draft, 24 July 2017).
718
719         The ::marker pseudo element is a convenience pseudo element that allows a person to
720         style the appearance of a list item marker. For example, to render all list item
721         markers in bolded, blue text you would define a stylesheet with the following content:
722
723         li::marker {
724             color: blue;
725             font-weight: bold;
726         }
727
728         and this could be applied to a page that contains markup of the form:
729
730         <ol>
731             <li>Item 1</li>
732             <li>Item 2</li>
733             ...
734             <li>Item N-1</li>
735             <li>Item N</li>
736         </ol>
737
738         Formerly to the achieve the same effect you would need to use a stylesheet of the form:
739
740         li {
741             color: blue;
742             font-weight: bold;
743         }
744
745         .list-item-content {
746             all: initial;
747         }
748
749         and then write your markup to have the form:
750
751         <ol>
752             <li><span class="list-item-content">Item 1</span></li>
753             <li><span class="list-item-content">Item 2</span></li>
754             ...
755             <li><span class="list-item-content">Item N-1</span></li>
756             <li><span class="list-item-content">Item N</span></li>
757         </ol>
758
759         The ::marker pseudo element only supports stylizing all font properties and the color property
760         of a list item marker.
761
762         Tests: fast/lists/list-marker-with-display.html
763                http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements.html
764                http/wpt/css/css-pseudo-4/marker-color.html
765                http/wpt/css/css-pseudo-4/marker-font-properties.html
766                http/wpt/css/css-pseudo-4/marker-inherit-values.html
767
768         * css/CSSSelector.cpp:
769         (WebCore::CSSSelector::pseudoId): Return the pseudo id for the ::marker pseudo element.
770         * css/CSSSelector.h: Add enumerator PseudoElementMarker to the pseudo element enum.
771         * css/RuleSet.cpp:
772         (WebCore::determinePropertyWhitelistType): Return whitelist type PropertyWhitelistMarker for ::marker
773         so that we match rules against the acceptable rules for ::marker.
774         * css/RuleSet.h: Add enumerator PropertyWhitelistMarker to the property whitelist type enum.
775         * css/SelectorPseudoElementTypeMap.in: Add "marker" to the list of pseudo element types.
776         * css/StyleResolver.cpp:
777         (WebCore::isValidMarkerStyleProperty): Determines if the specified CSS property is valid inside ::marker.
778         (WebCore::StyleResolver::CascadedProperties::addMatch): Only recognize CSS properties in the content block
779         of ::marker that match the ::marker whitelist policy.
780         * rendering/RenderListItem.cpp:
781         (WebCore::RenderListItem::computeMarkerStyle): Computes the style object for the list item marker. We
782         apply the user-agent style to the marker here as opposed to defining ::marker in the UA sheet as per
783         the spec. as an optimization to avoid having the style resolver apply the pseudo element to all elements.
784         For now, we always inherit style from the originating element (list item). Added FIXME to selectively
785         inherit styles.
786         (WebCore::RenderListItem::styleDidChange): Always apply the list marker style to the list marker renderer.
787         * rendering/RenderListItem.h:
788         * rendering/style/RenderStyleConstants.h: Add pseudo ID for the ::marker pseudo element.
789
790 2017-08-03  Antti Koivisto  <antti@apple.com>
791
792         Factor common code in Style::*ChangeInvalidation into helper functions
793         https://bugs.webkit.org/show_bug.cgi?id=174312
794
795         Reviewed by Andreas Kling.
796
797         There is a lot of copy code here.
798
799         * Style/StyleInvalidationFunctions.h: Added.
800         (WebCore::Style::traverseRuleFeaturesInShadowTree):
801         (WebCore::Style::traverseRuleFeaturesForSlotted):
802         (WebCore::Style::traverseRuleFeatures):
803
804             Add functions for traversing rule features that may affect style of an element.
805             Use lambdas to implement client-specific behavior.
806
807         * WebCore.xcodeproj/project.pbxproj:
808         * style/AttributeChangeInvalidation.cpp:
809         (WebCore::Style::mayBeAffectedByAttributeChange):
810         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
811         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
812         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
813         * style/ClassChangeInvalidation.cpp:
814         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
815         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
816         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
817         * style/IdChangeInvalidation.cpp:
818         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
819         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
820         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
821
822 2017-08-03  Zan Dobersek  <zdobersek@igalia.com>
823
824         [EME] CDM constructor assigns CDMPrivate member multiple times
825         https://bugs.webkit.org/show_bug.cgi?id=175128
826
827         Reviewed by Xabier Rodriguez-Calvar.
828
829         In the CDM class constructor, iterate over the registered CDM
830         factories, finding one that supports the specified key system.
831         A CDMPrivate object is created through that factory, and the
832         iteration is now stopped at that point, while previously it
833         contined to potentially create CDMPrivate objects through
834         other factories.
835
836         Helper createCDMPrivateForKeySystem() function is removed.
837
838         * Modules/encryptedmedia/CDM.cpp:
839         (WebCore::CDM::CDM):
840         (WebCore::createCDMPrivateForKeySystem): Deleted.
841
842 2017-08-03  Emilio Cobos Álvarez  <ecobos@igalia.com>
843
844         Don't always recalc the style of display: contents elements.
845         https://bugs.webkit.org/show_bug.cgi?id=172753
846
847         Reviewed by Antti Koivisto.
848
849         No new tests (no functionality change). This only removes an
850         inefficiency.
851
852         * dom/Element.cpp:
853         (WebCore::Element::existingComputedStyle):
854         * dom/Element.h:
855         * style/RenderTreeUpdater.cpp:
856         (WebCore::RenderTreeUpdater::updateRenderTree):
857         (WebCore::RenderTreeUpdater::updateElementRenderer):
858         * style/StyleTreeResolver.cpp:
859         (WebCore::Style::renderOrDisplayContentsStyle):
860         (WebCore::Style::TreeResolver::resolveElement):
861         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
862         (WebCore::Style::shouldResolveElement):
863         (WebCore::Style::TreeResolver::resolveComposedTree):
864
865 2017-08-02  Devin Rousso  <drousso@apple.com>
866
867         Web Inspector: add stack trace information for each RecordingAction
868         https://bugs.webkit.org/show_bug.cgi?id=174663
869
870         Reviewed by Joseph Pecoraro.
871
872         Tests: inspector/canvas/recording-2d.html
873                inspector/model/recording.html
874
875         * inspector/InspectorCanvas.h:
876         * inspector/InspectorCanvas.cpp:
877         (WebCore::InspectorCanvas::indexForData):
878         (WebCore::InspectorCanvas::buildAction):
879
880 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
881
882         Merge WTFThreadData to Thread::current
883         https://bugs.webkit.org/show_bug.cgi?id=174716
884
885         Reviewed by Mark Lam.
886
887         Use Thread::current() instead.
888
889         * fileapi/AsyncFileStream.cpp:
890         * platform/ThreadGlobalData.cpp:
891         (WebCore::ThreadGlobalData::ThreadGlobalData):
892         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
893         * platform/ios/wak/WebCoreThread.mm:
894         (StartWebThread):
895         * workers/WorkerThread.cpp:
896         (WebCore::WorkerThread::workerThread):
897
898 2017-08-02  Sam Weinig  <sam@webkit.org>
899
900         Fix crashes in GC creating a document fragment on a background thread
901         https://bugs.webkit.org/show_bug.cgi?id=175111
902
903         Reviewed by Chris Dumez.
904
905         r220095 (https://webkit.org/b/175006) change JSHTMLTemplateElement from using a
906         private name + property to manager the lifetime of the reference DocumentFragment
907         to using the idiomatic visitAdditionalChildren. Unfortunately, the function to access
908         the DocumentFragment lazily creates it. If this lazy creation happens on a GC thread,
909         badness ensues. This introduces an accessor that returns the DocumentFragment if it
910         has been created or null if it has not.
911
912         * bindings/js/JSHTMLTemplateElementCustom.cpp:
913         (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
914         * html/HTMLTemplateElement.cpp:
915         (WebCore::HTMLTemplateElement::contentIfAvailable):
916         * html/HTMLTemplateElement.h:
917
918 2017-08-02  Sam Weinig  <sam@webkit.org>
919
920         [WebIDL] Simplify [EnabledBySettings] extended attribute code to not require passing a global object to finishCreation
921         https://bugs.webkit.org/show_bug.cgi?id=175087
922
923         Reviewed by Chris Dumez.
924
925         * bindings/scripts/CodeGeneratorJS.pm:
926         (GenerateImplementation):
927         (GeneratePrototypeDeclaration):
928         Remove unnecessary passing of the global object to finishCreation for [EnabledBySettings].
929
930         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
931         * bindings/scripts/test/JS/JSTestNode.cpp:
932         * bindings/scripts/test/JS/JSTestObj.cpp:
933         Update tests.
934
935 2017-08-02  Andy Estes  <aestes@apple.com>
936
937         REGRESSION (r207155): Unable to switch sheets when previewing Numbers '09 spreadsheets
938         https://bugs.webkit.org/show_bug.cgi?id=175098
939         <rdar://problem/31416763>
940
941         Reviewed by Daniel Bates.
942
943         r207155 enabled sandboxing on the frame displaying a QuickLook preview. This restricted
944         frames within the sandbox from navigating their sandboxed siblings or ancestors, which
945         breaks the functionality of multi-sheet Numbers '09 spreadsheet previews. These previews
946         contain a frameset with a table of contents frame and a content frame, and the table of
947         contents frame needs to be able to navigate the content frame when the sheet selection
948         changes.
949
950         Fix this by disabling the SandboxNavigation flag in the QuickLook sandbox. Frames within the
951         sandbox will be able to navigate each other, but will not be able to navigate the top frame
952         (due to SandboxTopNavigation still being enabled), nor will they be able to navigate any
953         other ancestor frame outside the sandbox (due to QuickLook previews being in a different
954         origin than the hosting frame). These two cases are covered by existing tests.
955
956         Test: quicklook/multi-sheet-numbers-09.html
957
958         * dom/Document.cpp:
959         (WebCore::Document::applyQuickLookSandbox): Added a call to
960         disableSandboxFlags(SandboxNavigation) after applying the content security policy.
961         * dom/SecurityContext.h:
962         (WebCore::SecurityContext::disableSandboxFlags): Defined disableSandboxFlags().
963
964 2017-08-02  Jer Noble  <jer.noble@apple.com>
965
966         [MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
967         https://bugs.webkit.org/show_bug.cgi?id=175091
968
969         Reviewed by Eric Carlson.
970
971         Address follow-up comments to r219519.
972
973         * Modules/mediasource/SourceBuffer.cpp:
974         (WebCore::SourceBuffer::removeCodedFrames):
975
976 2017-08-02  Jeremy Jones  <jeremyj@apple.com>
977
978         Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically
979         https://bugs.webkit.org/show_bug.cgi?id=175080
980
981         Reviewed by Jon Lee.
982
983         No new tests because this only removes unused code.
984
985         This is obsolete because of the alternate solution in
986         https://bugs.webkit.org/show_bug.cgi?id=174850
987
988         * page/Settings.in:
989
990 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
991
992         GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length
993         https://bugs.webkit.org/show_bug.cgi?id=175079
994
995         Reviewed by Simon Fraser.
996
997         This fixes a failure in the GPU.BufferCreate unit test.
998         
999         The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal
1000         that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size,
1001         which is different than what the test expected.
1002         
1003         It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather
1004         than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer
1005         rather than the Metal buffer.
1006         
1007         This fixes the unit test and is probably more sensible for actual users of this class, since the page
1008         alignment of the length is a goofy implementation detail.
1009
1010         * platform/graphics/cocoa/GPUBufferMetal.mm:
1011         (WebCore::GPUBuffer::length const):
1012
1013 2017-08-01  Brian Burg  <bburg@apple.com>
1014
1015         HTML file input elements do not support file extensions in the "accept" attribute
1016         https://bugs.webkit.org/show_bug.cgi?id=95698
1017         <rdar://problem/12231850>
1018
1019         Reviewed by Darin Adler.
1020
1021         Serialize the accepted file extensions so they can be accessed in the UI process.
1022
1023         * platform/FileChooser.h:
1024         * platform/FileChooser.cpp:
1025         (WebCore::FileChooser::invalidate): Modernize.
1026         (WebCore::FileChooserSettings::acceptTypes const): Deleted.
1027         This is dead code, it was only used by Chromium.
1028
1029 2017-08-02  Fujii Hironori  <Hironori.Fujii@sony.com>
1030
1031         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
1032         https://bugs.webkit.org/show_bug.cgi?id=175010
1033         <rdar://problem/33647818>
1034
1035         Reviewed by Alex Christensen.
1036
1037         No new tests because no behavior change.
1038
1039         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
1040
1041         * contentextensions/ContentExtensionParser.cpp:
1042         (WebCore::ContentExtensions::isValidCSSSelector):
1043         Call QualifiedName::init().
1044         * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
1045         * dom/QualifiedName.cpp:
1046         (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
1047         instead of placement new.
1048         * dom/QualifiedName.h: Use LazyNeverDestroyed.
1049
1050 2017-08-01  Joseph Pecoraro  <pecoraro@apple.com>
1051
1052         CFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRepresentations
1053         https://bugs.webkit.org/show_bug.cgi?id=175064
1054
1055         Reviewed by Tim Horton.
1056
1057         * platform/ios/PlatformPasteboardIOS.mm:
1058         (WebCore::PlatformPasteboard::writeObjectRepresentations):
1059         Adopt a created string into the RetainPtr.
1060
1061         * platform/ios/WebItemProviderPasteboard.h:
1062         * platform/ios/WebItemProviderPasteboard.mm:
1063         (-[WebItemProviderRegistrationInfoList dealloc]):
1064         Release suggestedName and switch from -strong to -copy.
1065
1066 2017-08-01  Chris Dumez  <cdumez@apple.com>
1067
1068         Unreviewed, update Beacon API status to "In Development".
1069
1070         * features.json:
1071
1072 2017-08-01  Chris Dumez  <cdumez@apple.com>
1073
1074         Add initial support for navigator.sendBeacon
1075         https://bugs.webkit.org/show_bug.cgi?id=175007
1076         <rdar://problem/33547728>
1077
1078         Reviewed by Sam Weinig.
1079
1080         Add initial support for navigator.sendBeacon behind an experimental
1081         feature runtime flag. The specification is available at:
1082         - https://w3c.github.io/beacon/
1083
1084         The current implementation supports sending beacons with all types of
1085         payloads except for ReadableStream. Some functionality is incomplete
1086         and will be taken care of in follow-up patches:
1087         - Support for CORS preflight for the cases where it is required. We currently
1088           return false and do not send the beacon in such cases.
1089         - Better support for redirects.
1090         - Use a more power-friendly network priority for beacon requests.
1091
1092         Tests: http/tests/blink/sendbeacon/*
1093                http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html
1094                http/wpt/beacon/*
1095                imported/blink/fast/beacon/*
1096                imported/w3c/web-platform-tests/beacon/*
1097
1098         * CMakeLists.txt:
1099         * DerivedSources.make:
1100         * Modules/beacon/NavigatorBeacon.cpp: Added.
1101         (WebCore::NavigatorBeacon::sendBeacon):
1102         * Modules/beacon/NavigatorBeacon.h: Added.
1103         * Modules/beacon/NavigatorBeacon.idl: Added.
1104         * WebCore.xcodeproj/project.pbxproj:
1105         * loader/PingLoader.cpp:
1106         (WebCore::PingLoader::sendBeacon):
1107         * loader/PingLoader.h:
1108
1109 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
1110
1111         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
1112         https://bugs.webkit.org/show_bug.cgi?id=174727
1113
1114         Reviewed by Mark Lam.
1115
1116         No new tests because no change in behavior.
1117         
1118         Needed to teach Metal how to allocate in the Gigacage.
1119
1120         * platform/graphics/cocoa/GPUBufferMetal.mm:
1121         (WebCore::GPUBuffer::GPUBuffer):
1122         (WebCore::GPUBuffer::contents):
1123
1124 2017-08-01  Fujii Hironori  <Hironori.Fujii@sony.com>
1125
1126         [WinCairo] Implement Font::platformBoundsForGlyph
1127         https://bugs.webkit.org/show_bug.cgi?id=174813
1128
1129         Reviewed by Alex Christensen.
1130
1131         Test: fast/text/emphasis.html
1132
1133         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
1134         (WebCore::Font::platformBoundsForGlyph): Implemented by copying
1135         the code from Font::boundsForGDIGlyph().
1136
1137 2017-08-01  Zalan Bujtas  <zalan@apple.com>
1138
1139         REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles
1140         https://bugs.webkit.org/show_bug.cgi?id=175009
1141         <rdar://problem/33505791>
1142
1143         Reviewed by Simon Fraser.
1144
1145         This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes.
1146         Some websites don't expect the iframes to be expanded to the size of the content and when the media query
1147         callback mutates the content (triggering frame resize), they might end up getting into a never ending layout.
1148
1149         Test: fast/frames/flattening/media-query-growing-content.html
1150
1151         * css/MediaQueryEvaluator.cpp:
1152         (WebCore::orientationEvaluate):
1153         (WebCore::aspectRatioEvaluate):
1154         (WebCore::heightEvaluate):
1155         (WebCore::widthEvaluate):
1156         * page/FrameView.cpp:
1157         (WebCore::FrameView::layout):
1158         (WebCore::FrameView::layoutSizeForMediaQuery const):
1159         (WebCore::FrameView::evaluateMediaQueryList):
1160         * page/FrameView.h:
1161
1162 2017-07-26  Jiewen Tan  <jiewen_tan@apple.com>
1163
1164         Add tests to detect mistakes in backward compatibility when the structured clone algorithm is changed in the future
1165         https://bugs.webkit.org/show_bug.cgi?id=173998
1166
1167         Reviewed by Darin Adler.
1168
1169         * bindings/js/SerializedScriptValue.cpp:
1170         Add a comment.
1171
1172 2017-08-01  Matt Lewis  <jlewis3@apple.com>
1173
1174         Unreviewed, rolling out r220089.
1175
1176         This caused multiple crashes on macOS Debug testers.
1177
1178         Reverted changeset:
1179
1180         "Use LazyNeverDestroyed instead of DEFINE_GLOBAL for
1181         QualifiedName"
1182         https://bugs.webkit.org/show_bug.cgi?id=175010
1183         http://trac.webkit.org/changeset/220089
1184
1185 2017-08-01  Sam Weinig  <sam@webkit.org>
1186
1187         [WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
1188         https://bugs.webkit.org/show_bug.cgi?id=175006
1189
1190         Reviewed by Chris Dumez.
1191
1192         Use the standard way of augmenting GC, visitAdditionalChildren, rather
1193         than using a private name to create ownership.
1194
1195         * bindings/js/JSHTMLTemplateElementCustom.cpp:
1196         (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
1197         (WebCore::JSHTMLTemplateElement::content const): Deleted.
1198         * html/HTMLTemplateElement.idl:
1199
1200 2017-08-01  Zan Dobersek  <zdobersek@igalia.com>
1201
1202         [GCrypt] Gather crypto constants in a single location
1203         https://bugs.webkit.org/show_bug.cgi?id=174091
1204
1205         Reviewed by Jiewen Tan.
1206
1207         Gather common constants used across the libgcrypt-specific Web Crypto
1208         implementations in a single place -- in the GCryptUtilities.h header,
1209         inside the CryptoConstants namespace. The various ASN.1 object identifiers
1210         and other helper values are placed inside, in the std::array<uint8_t, N>
1211         container.
1212
1213         Additionally, CryptoConstants::matches() helper function is provided. It
1214         compares the provided data-and-size pair with the given std::array
1215         container and returns true if the std::memcmp() call returns 0.
1216
1217         Changes in CryptoKeyEC and CryptoKeyRSA consist mostly of switching to the
1218         use of CryptoConstants::matches() and the CryptoConstants data arrays, as
1219         well as some whitespace cleanup.
1220
1221         Additionallity in CryptoKeyEC, the helper functions covering various curve
1222         attributes are reordered, renamed and reorganized for simplicity.
1223
1224         No new tests -- no changes in behavior.
1225
1226         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1227         (WebCore::curveIdentifier):
1228         (WebCore::curveSize):
1229         (WebCore::curveUncompressedFieldElementSize):
1230         (WebCore::curveUncompressedPointSize):
1231         (WebCore::CryptoKeyEC::platformImportRaw):
1232         (WebCore::CryptoKeyEC::platformImportJWKPublic):
1233         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
1234         (WebCore::supportedAlgorithmIdentifier):
1235         (WebCore::curveForIdentifier):
1236         (WebCore::CryptoKeyEC::platformImportSpki):
1237         (WebCore::CryptoKeyEC::platformExportRaw):
1238         (WebCore::CryptoKeyEC::platformAddFieldElements):
1239         (WebCore::CryptoKeyEC::platformExportSpki):
1240         (WebCore::CryptoKeyEC::platformExportPkcs8):
1241         (WebCore::uncompressedPointSizeForCurve): Deleted.
1242         (WebCore::uncompressedFieldElementSizeForCurve): Deleted.
1243         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1244         (WebCore::supportedAlgorithmIdentifier):
1245         (WebCore::CryptoKeyRSA::importPkcs8):
1246         (WebCore::CryptoKeyRSA::exportSpki):
1247         (WebCore::CryptoKeyRSA::exportPkcs8):
1248         * crypto/gcrypt/GCryptUtilities.h:
1249         (WebCore::CryptoConstants::matches):
1250
1251 2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>
1252
1253         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames
1254         https://bugs.webkit.org/show_bug.cgi?id=175008
1255
1256         Reviewed by Alex Christensen.
1257
1258         No new tests because no behavior change.
1259
1260         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
1261
1262         * css/MediaFeatureNames.cpp:
1263         (WebCore::MediaFeatureNames::init): Do not include
1264         <wtf/StaticConstructors.h>. Use LazyNeverDestroyed instead of
1265         DEFINE_GLOBAL. Call LazyNeverDestroyed::construct instead of
1266         placement new.
1267         * css/MediaFeatureNames.h: Use LazyNeverDestroyed.
1268         * css/MediaQueryEvaluator.cpp:
1269         (WebCore::MediaQueryEvaluator::evaluate const): Dereference with ->.
1270
1271 2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>
1272
1273         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
1274         https://bugs.webkit.org/show_bug.cgi?id=175010
1275
1276         Reviewed by Alex Christensen.
1277
1278         No new tests because no behavior change.
1279
1280         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
1281
1282         * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
1283         * dom/QualifiedName.cpp:
1284         (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
1285         instead of placement new.
1286         * dom/QualifiedName.h: Use LazyNeverDestroyed.
1287
1288 2017-07-31  Matt Rajca  <mrajca@apple.com>
1289
1290         Support quirk for letting media autoplay if the user interacted with at least one media element.
1291         https://bugs.webkit.org/show_bug.cgi?id=175005
1292         <rdar://problem/33476038>
1293
1294         Reviewed by Eric Carlson.
1295
1296         If the user has interacted with at least one media element, let other media elements auto-play
1297         as a quirk.
1298
1299         * dom/Document.cpp:
1300         (WebCore::Document::updateIsPlayingMedia):
1301         * dom/Document.h:
1302         (WebCore::Document::noteUserInteractionWithMediaElement):
1303         * html/HTMLMediaElement.cpp:
1304         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
1305         * html/MediaElementSession.cpp:
1306         (WebCore::needsDocumentLevelMediaUserGestureQuirk):
1307         (WebCore::MediaElementSession::playbackPermitted const):
1308         * page/MediaProducer.h:
1309
1310 2017-07-31  Nan Wang  <n_wang@apple.com>
1311
1312         AX: CFEqual is failing on text markers with exact same data
1313         https://bugs.webkit.org/show_bug.cgi?id=175002
1314         <rdar://problem/33636985>
1315
1316         Reviewed by Chris Fleizach.
1317
1318         We should zero the memory of the TextMarkerData instance so that it
1319         can be tested for byte-equivalence.
1320
1321         Made sure this change won't break any of the existing tests.
1322
1323         * accessibility/AXObjectCache.cpp:
1324         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
1325         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
1326
1327 2017-07-28  Matt Rajca  <mrajca@apple.com>
1328
1329         Propagate user gesture tokens when script elements are loaded.
1330         https://bugs.webkit.org/show_bug.cgi?id=174959
1331
1332         Reviewed by Eric Carlson.
1333
1334         Propagate user gesture tokens when script elements are loaded (i.e. between the time an
1335         element is created and its onload handler is invoked).
1336
1337         * dom/ScriptElement.cpp:
1338         (WebCore::ScriptElement::ScriptElement):
1339         (WebCore::ScriptElement::dispatchLoadEventRespectingUserGestureIndicator):
1340         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
1341         (WebCore::ScriptElement::executePendingScript):
1342         * dom/ScriptElement.h:
1343
1344 2017-07-31  Matt Lewis  <jlewis3@apple.com>
1345
1346         Unreviewed, rolling out r220048.
1347
1348         This revision caused multiple crashes in fast/images. See
1349         webkit.org/b/174990
1350
1351         Reverted changeset:
1352
1353         "RenderImageResourceStyleImage::image() should return the
1354         nullImage() if the image is not available"
1355         https://bugs.webkit.org/show_bug.cgi?id=174874
1356         http://trac.webkit.org/changeset/220048
1357
1358 2017-07-31  Sam Weinig  <sam@webkit.org>
1359
1360         Remove unnecessary exceptions from storage code
1361         https://bugs.webkit.org/show_bug.cgi?id=174572
1362
1363         Reviewed by Chris Dumez.
1364
1365         Remove checks for canAccessStorage() and the exceptions they would cause.
1366         These were used for Storage in ephemeral sessions, but they are now supported.
1367         Add checks for a null frame to functions that can mutate the storage, as the
1368         frame is needed for that, and it retains our existing behavior for disconnected
1369         frames. By removing these checks / exceptions, we can fully generate Storage.idl.
1370
1371         * CMakeLists.txt:
1372         * WebCore.xcodeproj/project.pbxproj:
1373         * bindings/js/JSBindingsAllInOne.cpp:
1374         * bindings/js/JSStorageCustom.cpp: Removed.
1375         Remove JSStorageCustom.cpp
1376
1377         * loader/EmptyClients.cpp:
1378         * page/DOMWindow.cpp:
1379         (WebCore::DOMWindow::sessionStorage):
1380         (WebCore::DOMWindow::localStorage):
1381         * storage/StorageArea.h:
1382         Remove canAccessStorage.
1383
1384         * storage/Storage.cpp:
1385         (WebCore::Storage::length):
1386         (WebCore::Storage::key):
1387         (WebCore::Storage::getItem):
1388         (WebCore::Storage::setItem):
1389         (WebCore::Storage::removeItem):
1390         (WebCore::Storage::clear):
1391         (WebCore::Storage::contains):
1392         (WebCore::Storage::isSupportedPropertyName):
1393         (WebCore::Storage::supportedPropertyNames):
1394         * storage/Storage.h:
1395         * storage/Storage.idl:
1396         Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames
1397         to allow the removal of the [CustomGetOwnPropertyNames].
1398
1399 2017-07-31  Matt Lewis  <jlewis3@apple.com>
1400
1401         Unreviewed, rolling out r220060.
1402
1403         This broke our internal builds. Contact reviewer of patch for
1404         more information.
1405
1406         Reverted changeset:
1407
1408         "Merge WTFThreadData to Thread::current"
1409         https://bugs.webkit.org/show_bug.cgi?id=174716
1410         http://trac.webkit.org/changeset/220060
1411
1412 2017-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1413
1414         Merge WTFThreadData to Thread::current
1415         https://bugs.webkit.org/show_bug.cgi?id=174716
1416
1417         Reviewed by Sam Weinig.
1418
1419         Use Thread::current() instead.
1420
1421         * fileapi/AsyncFileStream.cpp:
1422         * platform/ThreadGlobalData.cpp:
1423         (WebCore::ThreadGlobalData::ThreadGlobalData):
1424         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
1425         * platform/ios/wak/WebCoreThread.mm:
1426         (StartWebThread):
1427         * workers/WorkerThread.cpp:
1428         (WebCore::WorkerThread::workerThread):
1429
1430 2017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1431
1432         Created a bool pretty printer at WTF for debugging purposes
1433         https://bugs.webkit.org/show_bug.cgi?id=174893
1434
1435         Reviewed by Darin Adler.
1436
1437         Use WTF::boolPrettyPrinter in debugging messages.
1438
1439         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1440         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
1441         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1442         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
1443
1444 2017-07-30  Zan Dobersek  <zdobersek@igalia.com>
1445
1446         Unreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0,
1447         explicitly initializing the RefCounted<> base class in the
1448         FetchHeaders(const FetchHeaders&) constructor.
1449
1450         Note that while that's the signature of the copy constructor for the FetchHeaders
1451         class, the base RefCounted<> class is not copyable, so the default RefCounted<>
1452         constructor is used, but the FetchHeaders resources are normally copied into the
1453         new object from the one that's passed in.
1454
1455         * Modules/fetch/FetchHeaders.h:
1456         (WebCore::FetchHeaders::FetchHeaders):
1457
1458 2017-07-30  Darin Adler  <darin@apple.com>
1459
1460         Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
1461         https://bugs.webkit.org/show_bug.cgi?id=130653
1462
1463         Reviewed by Antti Koivisto.
1464
1465         Also fixes a bug where load events are delivered prematurely in some cases
1466         when an object, embed, frame, or iframe element is still loading.
1467
1468         * dom/Document.cpp:
1469         (WebCore::Document::loadEventDelayTimerFired): Added a call to
1470         FrameLoader::checkLoadComplete. Goes along with the change to
1471         FrameLoader::checkLoadCompleteForThisFrame, which now respects the
1472         isDelayingLoadEvent flag.
1473
1474         * html/HTMLAppletElement.cpp:
1475         (WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument,
1476         no longer needed by the base class.
1477         (WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of
1478         the process of creating any object in a class derived from HTMLPlugInImageElement.
1479         (WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
1480         is only called when it's becoming false; avoids a false/true/false round trip that can
1481         cause trouble.
1482         * html/HTMLAppletElement.h: Updated for the above.
1483
1484         * html/HTMLEmbedElement.cpp:
1485         (WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument,
1486         no longer needed by the base class.
1487         (WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of
1488         the process of creating any object in a class derived from HTMLPlugInImageElement.
1489         (WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call
1490         updateImageLoaderWithNewURLSoon to do the image loading logic.
1491         (WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
1492         is only called when it's becoming false; avoids a false/true/false round trip that can
1493         cause trouble.
1494         * html/HTMLEmbedElement.h: Updated for the above.
1495
1496         * html/HTMLMediaElement.cpp:
1497         (WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when
1498         transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata
1499         event in the past. This matches what the HTML specification calls for, but only if you
1500         read it carefully. Without this change, and with the more complete implementation of
1501         load event delay below, one of the regression tests hangs because are permanently stuck
1502         dealying load events. Also added a FIXME about other code that likely has a similar
1503         problem; the symptom is likely to be subtle and minor, though.
1504
1505         * html/HTMLObjectElement.cpp:
1506         (WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument,
1507         no longer needed by the base class.
1508         (WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of
1509         the process of creating any object in a class derived from HTMLPlugInImageElement.
1510         (WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use
1511         updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution
1512         since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient.
1513         (WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
1514         is only called when it's becoming false; avoids a false/true/false round trip that can
1515         cause trouble.
1516         (WebCore::HTMLObjectElement::childrenChanged): Added calls to the new
1517         scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
1518         (WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to
1519         updateStyleIfNeeded. This is the main change that the title of this bug refers to.
1520         * html/HTMLObjectElement.h: Updated for the above. Also removed the
1521         clearUseFallbackContent function because it's clearer to set the data member in
1522         line at the single call site in HTMLObjectElement::parseAttribute.
1523
1524         * html/HTMLPlugInImageElement.cpp:
1525         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser
1526         argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now.
1527         (WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating
1528         an element to do work that can't be done in a constructor.
1529         (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new
1530         scheduleUpdateForAfterStyleResolution function.
1531         (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this
1532         function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base
1533         class; cleans things up, even though it's just an assertion.
1534         (WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to
1535         setNeedsWidgetUpdate(true) here; no longer needed because the new logic already
1536         does the right thing in this case.
1537         (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by
1538         updateAfterStyleResolution instead.
1539         (WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates
1540         after parsing all the children now comes naturally out of the new implementation.
1541         (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added.
1542         Schedules a call to updateAfterStyleResolution when needed, and equally importantly,
1543         increments the load event delay count to make sure that loads that are part of that
1544         update can participate in decision about whether it's time for the load event.
1545         (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added.
1546         Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new
1547         m_needsImageReload boolean in cases where no actual loading is done.
1548         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay
1549         count when moving an element that is in the middle of loading. This lets the
1550         updateAfterStyleResolution function do the right thing even when the element is
1551         moved without leaving anything stuck in a strange state.
1552         (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new
1553         scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
1554         (WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by
1555         updateAfterStyleResolution instead.
1556         (WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all
1557         the right things for when an image URL is changed; for use by the concrete derived classes.
1558         * html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader
1559         private rather than protected, and added the two new boolean data members.
1560
1561         * html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for
1562         applet, embed, and object.
1563
1564         * loader/DocumentLoader.cpp:
1565         (WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is
1566         delaying a load event.
1567
1568         * loader/FrameLoader.cpp:
1569         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if
1570         isDelayingLoadEvent is true; otherwise this function can have a side effect of
1571         triggering the load event.
1572         (WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not
1573         just a checkCompleted. This is relevant if the frame we are detaching was delaying
1574         a load event because it no longer will be and so the load might be complete.
1575
1576 2017-07-30  Sam Weinig  <sam@webkit.org>
1577
1578         [WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobalScopeFetch
1579         https://bugs.webkit.org/show_bug.cgi?id=174974
1580
1581         Reviewed by Darin Adler.
1582
1583         * CMakeLists.txt:
1584         * DerivedSources.make:
1585         * WebCore.xcodeproj/project.pbxproj:
1586         * Modules/fetch/DOMWindowFetch.js: Removed.
1587         * Modules/fetch/FetchRequest.js: Removed.
1588         * Modules/fetch/WorkerGlobalScopeFetch.js: Removed.
1589         Remove builtin files.
1590
1591         * Modules/fetch/DOMWindowFetch.cpp:
1592         (WebCore::DOMWindowFetch::fetch):
1593         * Modules/fetch/DOMWindowFetch.h:
1594         * Modules/fetch/DOMWindowFetch.idl:
1595         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
1596         (WebCore::WorkerGlobalScopeFetch::fetch):
1597         * Modules/fetch/WorkerGlobalScopeFetch.h:
1598         * Modules/fetch/WorkerGlobalScopeFetch.idl:
1599         Remove builtin and instead create FetchRequest in the implementation.
1600
1601         * Modules/fetch/FetchBody.cpp:
1602         (WebCore::FetchBody::extract):
1603         * Modules/fetch/FetchBody.h:
1604         * Modules/fetch/FetchBodyOwner.cpp:
1605         (WebCore::FetchBodyOwner::extractBody):
1606         * Modules/fetch/FetchBodyOwner.h:
1607         * Modules/fetch/FetchResponse.cpp:
1608         * Modules/fetch/FetchResponse.h:
1609         Rename FetchBody::BindingDataType to FetchBody::Init to match its IDL naming.
1610
1611         * Modules/fetch/FetchHeaders.cpp:
1612         (WebCore::appendToHeaderMap):
1613         (WebCore::fillHeaderMap):
1614         (WebCore::FetchHeaders::create):
1615         (WebCore::FetchHeaders::fill):
1616         * Modules/fetch/FetchHeaders.h:
1617         Add helpers to implement the fill algorithm for various input types.
1618         Leave the existing fill for now, as it is still used by the FetchResponse
1619         builtin, but will eventually be removed.
1620
1621         * Modules/fetch/FetchRequest.cpp:
1622         (WebCore::FetchRequest::initializeOptions):
1623         (WebCore::FetchRequest::initializeWith):
1624         (WebCore::FetchRequest::setBody):
1625         (WebCore::FetchRequest::create):
1626         (WebCore::FetchRequest::setBodyFromInputRequest): Deleted.
1627         * Modules/fetch/FetchRequest.h:
1628         Migrate builtin code to the implementation. This is 1-to-1 re-implementation,
1629         so I did not attempt to fix any conformance issues. That will come in follow up.
1630
1631         * Modules/fetch/FetchRequest.idl:
1632         Replace builtins with an IDL constructor.
1633
1634         * Modules/fetch/FetchRequestInit.h:
1635         * Modules/fetch/FetchRequestInit.idl:
1636         Add missing headers and body to FetchRequestInit.
1637
1638 2017-07-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1639
1640         RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
1641         https://bugs.webkit.org/show_bug.cgi?id=174874
1642         <rdar://problem/33530130>
1643
1644         Reviewed by Darin Adler.
1645
1646         If an <img> element has image content data for a none cached image, e.g.
1647         -webkit-named-image, RenderImageResourceStyleImage will be created and 
1648         attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage
1649         will be set to null because the m_styleImage->isCachedImage() is false in
1650         this case. When ImageLoader finishes loading the url of the src attribute, 
1651         RenderImageResource::setCachedImage() will be called to set m_cachedImage.
1652
1653         A crash will happen when the RenderImage is destroyed. Destroying the 
1654         RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
1655         m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
1656         which ends up calling CSSNamedImageValue::image() which returns a null pointer
1657         because the size is empty. RenderImageResourceStyleImage::shutdown() calls
1658         image()->stopAnimation() without checking the return value of image().
1659
1660         Like the base class virtual method RenderImageResource::image(), 
1661         RenderImageResourceStyleImage::image() should return the nullImage() if
1662         the image is not available.
1663
1664         Test: fast/images/image-element-image-content-data.html
1665
1666         * css/CSSCrossfadeValue.cpp:
1667         * css/CSSFilterImageValue.cpp:
1668         * page/EventHandler.cpp:
1669         * page/PageSerializer.cpp:
1670         * rendering/RenderElement.cpp:
1671         * rendering/RenderImageResource.cpp:
1672         * rendering/RenderImageResourceStyleImage.cpp:
1673         (WebCore::RenderImageResourceStyleImage::initialize):
1674
1675         (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes
1676         of r208511 in this function. Add a call to image()->stopAnimation() without
1677         checking the return of image() since it will return the nullImage() if
1678         the image not available. There is no need to check m_cachedImage before 
1679         calling image() because image() does not check or access m_cachedImage.
1680
1681         (WebCore::RenderImageResourceStyleImage::image): The base class method
1682         RenderImageResource::image() returns the nullImage() if the image not
1683         available. This is because CachedImage::imageForRenderer() returns
1684         the nullImage() if the image is not available; see CachedImage.h. We should
1685         do the same for the derived class for consistency.
1686
1687         * rendering/style/ContentData.cpp:
1688         * rendering/style/StyleCachedImage.cpp:
1689         * style/StylePendingResources.cpp:
1690
1691 2017-07-29  Filip Pizlo  <fpizlo@apple.com>
1692
1693         Unreviewed, rollout r220044 because it set the bots on fire.
1694         
1695         It seems that the "-Wunguarded-availability-new" pragma is not widely supported. So, a bunch of the
1696         Mac bots are now unable to build and that includes EWS.
1697         
1698         Fixing by rolling it out.
1699
1700         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1701         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1702         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1703         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
1704         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
1705         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
1706         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1707         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1708         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
1709         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
1710         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1711         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1712         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
1713         (WebCore::SourceBufferPrivateAVFObjC::flush):
1714
1715 2017-07-29  Dan Bernstein  <mitz@apple.com>
1716
1717         Fixed building for macOS 10.12 with the macOS 10.13 SDK.
1718
1719         Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
1720         and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
1721         starting in that release, they have been available as SPI earlier.
1722
1723         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1724         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1725         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1726         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
1727         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
1728         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
1729         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1730         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1731         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
1732         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
1733         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1734         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1735         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
1736         (WebCore::SourceBufferPrivateAVFObjC::flush):
1737
1738 2017-07-29  Nan Wang  <n_wang@apple.com>
1739
1740         AX: findMatchingObjects doesn't work when the startObject is ignored
1741         https://bugs.webkit.org/show_bug.cgi?id=174965
1742
1743         Reviewed by Chris Fleizach.
1744
1745         findMatchingObjects would return a wrong element if we pass in an ignored
1746         start object. To fix this, we should use the closest accessible sibling as 
1747         the start object.
1748
1749         Test: accessibility/mac/search-predicate-from-ignored-element.html
1750
1751         * accessibility/AccessibilityObject.cpp:
1752         (WebCore::appendChildrenToArray):
1753
1754 2017-07-29  Aaron Chu  <aaron_chu@apple.com>
1755
1756         AX: FKA: Buttons need a visible focus indicator
1757         https://bugs.webkit.org/show_bug.cgi?id=171040
1758         <rdar://problem/30922548>
1759
1760         Reviewed by Antoine Quint.
1761
1762         Added a background color for the focus state of the icon buttons in modern media controls.
1763
1764         Test: media/modern-media-controls/button/button-focus-state.html
1765
1766         * Modules/modern-media-controls/controls/button.css:
1767         (button:focus):
1768         (button:focus > picture):
1769         * Modules/modern-media-controls/controls/slider.css:
1770         (.slider > input):
1771
1772 2017-07-28  Sam Weinig  <sam@webkit.org>
1773
1774         [WebIDL] Remove JS builtin bindings for FetchHeaders
1775         https://bugs.webkit.org/show_bug.cgi?id=174905
1776
1777         Reviewed by Alex Christensen.
1778
1779         * CMakeLists.txt:
1780         * DerivedSources.make:
1781         * WebCore.xcodeproj/project.pbxproj:
1782         * Modules/fetch/FetchHeaders.js: Removed.
1783         Remove FetchHeaders.js
1784
1785         * Modules/fetch/FetchHeaders.cpp:
1786         (WebCore::appendToHeaderMap):
1787         (WebCore::FetchHeaders::create):
1788         (WebCore::FetchHeaders::append):
1789         * Modules/fetch/FetchHeaders.h:
1790         (WebCore::FetchHeaders::FetchHeaders):
1791         Add create function for generated constructor.
1792         Add appendToHeaderMap static function which takes the functionality
1793         from the existing append function, and makes it useable in create.
1794
1795         * Modules/fetch/FetchHeaders.idl:
1796         Replace [JSBuiltinConstructor] with real constructor. Keep other builtin
1797         attributes as they are still used by other Fetch code.
1798
1799         * bindings/js/JSDOMConvertRecord.h:
1800         Fix record conversion to work with proxies by changing to use the method table
1801         for getOwnPropertyNames, and undefined values by not excluding undefined values. 
1802
1803 2017-07-28  Matt Baker  <mattbaker@apple.com>
1804
1805         Web Inspector: capture an async stack trace when web content calls addEventListener
1806         https://bugs.webkit.org/show_bug.cgi?id=174739
1807         <rdar://problem/33468197>
1808
1809         Reviewed by Brian Burg.
1810
1811         Test: inspector/debugger/async-stack-trace.html
1812
1813         Add instrumentation to EventTarget to support showing asynchronous
1814         stack traces when the debugger breaks in a script event listener.
1815
1816         * dom/EventTarget.cpp:
1817         (WebCore::EventTarget::addEventListener):
1818         (WebCore::EventTarget::removeEventListener):
1819         (WebCore::EventTarget::fireEventListeners):
1820         * inspector/InspectorInstrumentation.cpp:
1821         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
1822         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
1823         (WebCore::InspectorInstrumentation::willHandleEventImpl):
1824         (WebCore::InspectorInstrumentation::didHandleEventImpl):
1825         * inspector/InspectorInstrumentation.h:
1826         (WebCore::InspectorInstrumentation::didAddEventListener):
1827         (WebCore::InspectorInstrumentation::willRemoveEventListener):
1828         (WebCore::InspectorInstrumentation::willHandleEvent):
1829         (WebCore::InspectorInstrumentation::didHandleEvent):
1830         * inspector/PageDebuggerAgent.cpp:
1831         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
1832         (WebCore::PageDebuggerAgent::didAddEventListener):
1833         (WebCore::PageDebuggerAgent::willRemoveEventListener):
1834         (WebCore::PageDebuggerAgent::willHandleEvent):
1835         * inspector/PageDebuggerAgent.h:
1836
1837 2017-07-28  Matt Rajca  <mrajca@apple.com>
1838
1839         Don't add autoplay restrictions to media elements created in response to user gestures.
1840         https://bugs.webkit.org/show_bug.cgi?id=174947
1841
1842         Reviewed by Eric Carlson.
1843
1844         Test: media/video-create-with-user-gesture.html
1845
1846         * html/HTMLMediaElement.cpp:
1847         (WebCore::HTMLMediaElement::HTMLMediaElement):
1848
1849 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
1850
1851         WebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from WebThread
1852         https://bugs.webkit.org/show_bug.cgi?id=174934
1853         rdar://problem/33586772
1854
1855         Reviewed by Eric Carlson.
1856
1857         No new tests because no effect on DOM.
1858
1859         This dispatches a UIKit call to the main thread since it might happen on WebThread in WK1.
1860
1861         * platform/audio/ios/MediaSessionManagerIOS.mm:
1862         (-[WebMediaSessionHelper initWithCallback:]):
1863
1864 2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
1865
1866         [macOS] Reeder's defaults font is Times instead of San Francisco
1867         https://bugs.webkit.org/show_bug.cgi?id=174885
1868         <rdar://problem/33462483>
1869
1870         Reviewed by Simon Fraser.
1871
1872         Reeder uses explicit dot-prefixed names in its source code. Within Core Text,
1873         dot-prefixed names cannot be matched case insensitively. The solution is to
1874         not case-fold these family names, and to make our caches case sensitive for
1875         these special names.
1876
1877         Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html
1878                fast/text/font-lookup-dot-prefix-case-sensitive.html
1879
1880         * platform/graphics/FontCache.cpp:
1881         (WebCore::FontPlatformDataCacheKey::operator==):
1882         (WebCore::FontPlatformDataCacheKeyHash::hash):
1883         * platform/graphics/FontCascade.cpp:
1884         (WebCore::keysMatch):
1885         (WebCore::computeFontCascadeCacheHash):
1886         * platform/graphics/FontDescription.cpp:
1887         (WebCore::FontCascadeDescription::familyNamesAreEqual):
1888         (WebCore::FontCascadeDescription::familyNameHash):
1889         (WebCore::FontCascadeDescription::foldedFamilyName):
1890         * platform/graphics/FontDescription.h:
1891         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1892         (WebCore::FontDatabase::fontForPostScriptName):
1893
1894 2017-07-28  Devin Rousso  <drousso@apple.com>
1895
1896         Web Inspector: Record actions performed on CanvasRenderingContext2D
1897         https://bugs.webkit.org/show_bug.cgi?id=174482
1898
1899         Reviewed by Joseph Pecoraro.
1900
1901         Tests: inspector/canvas/recording-2d.html
1902                inspector/canvas/recording.html
1903
1904         * html/canvas/CanvasRenderingContext2D.idl:
1905         Add CallTracingCallback to interface to record all API calls.
1906
1907         * html/HTMLCanvasElement.cpp:
1908         (WebCore::HTMLCanvasElement::paint):
1909         If a recording is active, mark the current frame as completed.
1910
1911         * bindings/scripts/CodeGeneratorJS.pm:
1912         (GenerateAttributeGetterBodyDefinition):
1913         (GenerateAttributeSetterBodyDefinition):
1914         (GenerateImplementationFunctionCall):
1915         (GenerateCallTracerParameter):
1916         (GenerateCallTracer):
1917         * bindings/scripts/test/TestCallTracer.idl:
1918         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1919         (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
1920         (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
1921         (WebCore::jsTestCallTracerTestAttributeWithVariantGetter):
1922         (WebCore::jsTestCallTracerTestAttributeWithVariant):
1923         (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
1924         (WebCore::setJSTestCallTracerTestAttributeWithVariant):
1925         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody):
1926         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody):
1927         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody):
1928         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
1929         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody):
1930         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument):
1931         * inspector/InspectorCanvas.h:
1932         * inspector/InspectorCanvas.cpp:
1933         (WebCore::InspectorCanvas::recordAction):
1934         (WebCore::InspectorCanvas::buildAction):
1935         Change CallTracer IDL generation to flatten any variants so that all types for the
1936         parameters of an action are able to be listed in a single variant. This prevents possible
1937         ambiguity when constructing the variant, as they require that exactly one type be
1938         constructible and a sub-variant might not satisfy that condition. This was only an issue for
1939         older mac SDKs.
1940
1941         * bindings/js/CallTracer.h:
1942         * bindings/js/CallTracer.cpp:
1943         (WebCore::CallTracer::recordCanvasAction):
1944         * bindings/js/CallTracerTypes.h:
1945         * inspector/InspectorCanvasAgent.h:
1946         * inspector/InspectorCanvasAgent.cpp:
1947         (WebCore::InspectorCanvasAgent::recordCanvasAction):
1948         * inspector/InspectorInstrumentation.h:
1949         * inspector/InspectorInstrumentation.cpp:
1950         (WebCore::InspectorInstrumentation::recordCanvasAction):
1951         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
1952         Rename CanvasActionParameterVariant to RecordCanvasActionVariant to match what is expected by
1953         the IDL generator. Also remove unnecessary includes now that they are in CallTracerTypes.h.
1954
1955         * CMakeLists.txt:
1956         * bindings/js/JSBindingsAllInOne.cpp:
1957         Add CallTracer for CMake builds.
1958
1959 2017-07-28  Sam Weinig  <sam@webkit.org>
1960
1961         [WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary js builtins
1962         https://bugs.webkit.org/show_bug.cgi?id=174915
1963
1964         Reviewed by Alex Christensen.
1965
1966         - Split FetchRequest enums and Init dictionary out of FetchRequest so they
1967           can be used from other files like WorkerGlobalScopeFetch and DOMWindowFetch.
1968         - Add missing FetchResponseInit. Currently unused but will be in a subsequent patch.
1969         - Add and update comments about missing properties and functions.
1970
1971         * CMakeLists.txt:
1972         * DerivedSources.make:
1973         * WebCore.xcodeproj/project.pbxproj:
1974         * Modules/fetch/DOMWindowFetch.idl:
1975         * Modules/fetch/FetchBody.idl:
1976         * Modules/fetch/FetchBodyOwner.h:
1977         * Modules/fetch/FetchHeaders.h:
1978         * Modules/fetch/FetchHeaders.idl:
1979         * Modules/fetch/FetchReferrerPolicy.h: Added.
1980         * Modules/fetch/FetchReferrerPolicy.idl: Added.
1981         * Modules/fetch/FetchRequest.h:
1982         * Modules/fetch/FetchRequest.idl:
1983         * Modules/fetch/FetchRequestCache.h: Added.
1984         * Modules/fetch/FetchRequestCache.idl: Added.
1985         * Modules/fetch/FetchRequestCredentials.h: Added.
1986         * Modules/fetch/FetchRequestCredentials.idl: Added.
1987         * Modules/fetch/FetchRequestInit.h: Added.
1988         * Modules/fetch/FetchRequestInit.idl: Added.
1989         * Modules/fetch/FetchRequestMode.h: Added.
1990         * Modules/fetch/FetchRequestMode.idl: Added.
1991         * Modules/fetch/FetchRequestRedirect.h: Added.
1992         * Modules/fetch/FetchRequestRedirect.idl: Added.
1993         * Modules/fetch/FetchResponse.h:
1994         * Modules/fetch/FetchResponse.idl:
1995         * Modules/fetch/WorkerGlobalScopeFetch.idl:
1996
1997 2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
1998
1999         REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
2000         https://bugs.webkit.org/show_bug.cgi?id=174772
2001         <rdar://problem/33267643>
2002
2003         Reviewed by Simon Fraser.
2004
2005         During a font load, we try pretty hard to find a font to use that isn't the
2006         last resort font (which happens to be Times). We do this by iterating through
2007         all the fonts in the font-family list, as well as through all the relevant
2008         @font-face blocks which share the requested font family name. 
2009
2010         Unfortunately, if we find one of these fallback fonts, we were simply using it
2011         directly, which means that it was being drawn as visible (because the
2012         visibility setting lives inside the Font object). Instead, we should carry the
2013         invisibility setting from the interstitial font to this used fallback font.
2014
2015         This patch is an extension of r219221, which fixed the problem only for system
2016         fallback fonts. This patch adopts the same methodology to all fallback fonts.
2017
2018         Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html
2019
2020         * platform/graphics/FontCascadeFonts.cpp:
2021         (WebCore::FontCascadeFonts::glyphDataForVariant):
2022         (WebCore::glyphPageFromFontRanges):
2023         * platform/graphics/FontRanges.cpp:
2024         (WebCore::FontRanges::glyphDataForCharacter):
2025
2026 2017-07-28  Frederic Wang  <fwang@igalia.cpm>
2027
2028         Fix typo in scrollPositionChangedViaDelegatedScrolling
2029         https://bugs.webkit.org/show_bug.cgi?id=174937
2030
2031         Reviewed by Wenson Hsieh.
2032
2033         No new tests, fix typo in the inUserInteraction parameter.
2034
2035         * page/scrolling/ScrollingTree.cpp:
2036         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
2037         * page/scrolling/ScrollingTree.h:
2038
2039 2017-07-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2040
2041         [iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down
2042         https://bugs.webkit.org/show_bug.cgi?id=174928
2043         <rdar://problem/33584280>
2044
2045         Reviewed by Tim Horton.
2046
2047         Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a
2048         snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same
2049         way as snapshotting a dragged selection.
2050
2051         No way of testing TextIndicator-based snapshotting yet.
2052
2053         * platform/DragImage.cpp:
2054
2055         Guard createDragImageForRange for !PLATFORM(IOS).
2056
2057         * platform/ios/DragImageIOS.mm:
2058         (WebCore::createDragImageForSelection):
2059
2060         Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results
2061         in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere
2062         in drag initiation code, which eventually results in the correct orientation; we'll need further investigation
2063         to remove this extraneous flip.
2064
2065         (WebCore::createDragImageForRange):
2066
2067 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
2068
2069         Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
2070         https://bugs.webkit.org/show_bug.cgi?id=174437
2071
2072         Reviewed by Darin Adler.
2073
2074         No new tests because no behavior change.
2075
2076         Remove redundant Web- prefix from classes in WebCore namespace.
2077
2078         * WebCore.xcodeproj/project.pbxproj:
2079         * html/HTMLMediaElement.cpp:
2080         * html/HTMLVideoElement.cpp:
2081         * platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h.
2082         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
2083         * platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h.
2084         (WebCore::PlaybackSessionModel::~PlaybackSessionModel):
2085         (WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient):
2086         (WebCore::PlaybackSessionModelClient::externalPlaybackChanged):
2087         * platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h.
2088         * platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm.
2089         * platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h.
2090         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver):
2091         * platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h.
2092         (WebCore::VideoFullscreenModel::~VideoFullscreenModel):
2093         (WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient):
2094         * platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h.
2095         (WebCore::VideoFullscreenModelVideoElement::create):
2096         * platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
2097         * platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h.
2098         * platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm.
2099         * platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h.
2100         * platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm.
2101         * platform/ios/WebAVPlayerController.h:
2102         * platform/ios/WebAVPlayerController.mm:
2103         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2104         * platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h.
2105         * platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm.
2106         * platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h.
2107         * platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
2108         * platform/mac/WebPlaybackControlsManager.h:
2109         * platform/mac/WebPlaybackControlsManager.mm:
2110
2111 2017-07-27  Jeremy Jones  <jeremyj@apple.com>
2112
2113         Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
2114         https://bugs.webkit.org/show_bug.cgi?id=174850
2115         rdar://problem/33449903
2116
2117         Reviewed by Jon Lee.
2118
2119         This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting
2120         from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback
2121         that implements the details of exactly which media documents are still allowed to play inlne.
2122
2123         Media documents always use a video element; but when there are no video tracks, it has behavior like 
2124         an audio element. See media-controller.js isAudio().
2125
2126         This change preserves this behavior with respect to fullscreen requirements for media document by
2127         mirroring the isAudio() check in requiresFullscreenForVideoPlayback.
2128
2129         * html/MediaDocument.cpp:
2130         (WebCore::MediaDocumentParser::createDocumentStructure):
2131         * html/MediaElementSession.cpp:
2132         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2133
2134 2017-07-27  Jeremy Jones  <jeremyj@apple.com>
2135
2136         MediaDocument fullscreen pinch gesture should trigger navigate back.
2137         https://bugs.webkit.org/show_bug.cgi?id=174914
2138
2139         Reviewed by Jon Lee.
2140
2141         No new tests because only effect is from interaction with platform.
2142
2143         For media documents, pressing the "done" button on fullscreen video navigates back
2144         to the previous page. The same should happen for other gestures that pause playback
2145         when returning to inline. This allows the gesture to have the same behavior as the
2146         button.
2147
2148         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2149         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2150
2151 2017-07-27  Aaron Chu  <aaron_chu@apple.com>
2152
2153         AX: VoiceOver silent or skipping over time values on media player.
2154         https://bugs.webkit.org/show_bug.cgi?id=174324
2155         <rdar://problem/32021784>
2156
2157         Reviewed by Antoine Quint.
2158
2159         Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.
2160
2161         Test Updated: media/modern-media-controls/time-label/time-label.html
2162         Test Added: media/modern-media-controls/time-label/ios-time-label.html
2163         
2164         * Modules/modern-media-controls/controls/time-label.js:
2165
2166 2017-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
2167
2168         Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass
2169         https://bugs.webkit.org/show_bug.cgi?id=171637
2170
2171         Reviewed by Darin Adler.
2172
2173         We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side.
2174         So, we can drop ClassInfo check from the actual function.
2175
2176         We also simplify DOMJIT::GetterSetter to make it smaller size.
2177
2178         WebCore size comparison
2179             Before: 48443292
2180             After:  48087800 (0.7% reduction)
2181
2182         Speedometer Scores show 0.8% improvement.
2183             Before: 158.9 +- 0.46
2184             After:  160.2 +- 0.36
2185
2186         Dromaeo DOM core Scores show 5.8% improvement.
2187                                         Before                   After
2188             Total Score:         8424.12runs/s ±1.38%     8911.60runs/s ±1.47%
2189               DOM Attributes    12627.27runs/s ±1.87%    14023.17runs/s ±1.87%
2190               DOM Modification   1207.82runs/s ±2.48%     1204.21runs/s ±3.05%
2191               DOM Query         68068.82runs/s ±0.63%    74273.38runs/s ±0.69%
2192               DOM Traversal      1240.07runs/s ±1.96%     1256.64runs/s ±1.77%
2193
2194         Performance improvement can be explained by the following optimizations.
2195
2196         1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can
2197            drop type checks since get_by_id operation already performs a structure check
2198            which subsumes this type check.
2199         2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL.
2200
2201         * bindings/js/JSDOMAttribute.h:
2202         (WebCore::IDLAttribute::get):
2203         Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast.
2204
2205         * bindings/scripts/CodeGeneratorJS.pm:
2206         (IsAcceleratedDOMAttribute):
2207         (GetJSCAttributesForAttribute):
2208         (GenerateHeader):
2209         (GeneratePropertiesHashTable):
2210         (GenerateImplementation):
2211         (GenerateAttributeGetterTrampolineDefinition):
2212         (GenerateAttributeGetterDefinition):
2213         (GenerateCallbackImplementationContent):
2214         (GenerateHashTableValueArray):
2215         (GenerateHashTable):
2216         (GenerateConstructorHelperMethods):
2217         Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size.
2218
2219         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2220         (WebCore::JSInterfaceNamePrototype::finishCreation):
2221         * bindings/scripts/test/JS/JSMapLike.cpp:
2222         (WebCore::JSMapLikePrototype::finishCreation):
2223         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2224         (WebCore::JSReadOnlyMapLikePrototype::finishCreation):
2225         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2226         (WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
2227         (WebCore::jsTestActiveDOMObjectExcitingAttr):
2228         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2229         (WebCore::JSTestCEReactionsPrototype::finishCreation):
2230         (WebCore::jsTestCEReactionsAttributeWithCEReactions):
2231         (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions):
2232         (WebCore::jsTestCEReactionsStringifierAttribute):
2233         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2234         (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation):
2235         (WebCore::jsTestCEReactionsStringifierValue):
2236         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2237         (WebCore::JSTestCallTracerPrototype::finishCreation):
2238         (WebCore::jsTestCallTracerTestAttributeInterface):
2239         (WebCore::jsTestCallTracerTestAttributeSpecified):
2240         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2241         (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
2242         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2243         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
2244         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2245         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
2246         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2247         (WebCore::JSTestDOMJITPrototype::finishCreation):
2248         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted.
2249         (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted.
2250         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted.
2251         (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted.
2252         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted.
2253         (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted.
2254         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted.
2255         (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted.
2256         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted.
2257         (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted.
2258         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted.
2259         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted.
2260         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted.
2261         (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted.
2262         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted.
2263         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted.
2264         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted.
2265         (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted.
2266         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted.
2267         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted.
2268         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted.
2269         (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted.
2270         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted.
2271         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted.
2272         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted.
2273         (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted.
2274         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted.
2275         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted.
2276         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted.
2277         (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted.
2278         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted.
2279         (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted.
2280         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted.
2281         (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted.
2282         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted.
2283         (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted.
2284         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted.
2285         (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted.
2286         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted.
2287         (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted.
2288         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted.
2289         (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted.
2290         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted.
2291         (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted.
2292         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted.
2293         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted.
2294         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted.
2295         (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted.
2296         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted.
2297         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted.
2298         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted.
2299         (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted.
2300         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted.
2301         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted.
2302         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted.
2303         (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted.
2304         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted.
2305         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted.
2306         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted.
2307         (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted.
2308         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted.
2309         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted.
2310         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted.
2311         (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted.
2312         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted.
2313         (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted.
2314         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted.
2315         (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted.
2316         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted.
2317         (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted.
2318         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2319         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2320         (WebCore::JSTestEventConstructorPrototype::finishCreation):
2321         (WebCore::jsTestEventConstructorAttr1):
2322         (WebCore::jsTestEventConstructorAttr2):
2323         (WebCore::jsTestEventConstructorAttr3):
2324         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2325         (WebCore::JSTestEventTargetPrototype::finishCreation):
2326         * bindings/scripts/test/JS/JSTestException.cpp:
2327         (WebCore::JSTestExceptionPrototype::finishCreation):
2328         (WebCore::jsTestExceptionName):
2329         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2330         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
2331         (WebCore::jsTestGenerateIsReachableASecretAttribute):
2332         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2333         (WebCore::jsTestGlobalObjectRegularAttribute):
2334         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2335         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation):
2336         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2337         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation):
2338         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2339         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation):
2340         * bindings/scripts/test/JS/JSTestInterface.cpp:
2341         (WebCore::JSTestInterfaceConstructor::initializeProperties):
2342         (WebCore::JSTestInterfacePrototype::finishCreation):
2343         (WebCore::jsTestInterfaceImplementsStr1):
2344         (WebCore::jsTestInterfaceImplementsStr2):
2345         (WebCore::jsTestInterfaceImplementsStr3):
2346         (WebCore::jsTestInterfaceImplementsNode):
2347         (WebCore::jsTestInterfaceSupplementalStr1):
2348         (WebCore::jsTestInterfaceSupplementalStr2):
2349         (WebCore::jsTestInterfaceSupplementalStr3):
2350         (WebCore::jsTestInterfaceSupplementalNode):
2351         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2352         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
2353         (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
2354         * bindings/scripts/test/JS/JSTestIterable.cpp:
2355         (WebCore::JSTestIterablePrototype::finishCreation):
2356         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2357         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
2358         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
2359         (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
2360         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2361         (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
2362         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2363         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation):
2364         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2365         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation):
2366         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2367         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation):
2368         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2369         (WebCore::JSTestNamedConstructorPrototype::finishCreation):
2370         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2371         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation):
2372         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2373         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation):
2374         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2375         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation):
2376         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2377         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation):
2378         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2379         (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation):
2380         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2381         (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation):
2382         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2383         (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation):
2384         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2385         (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation):
2386         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2387         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation):
2388         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2389         (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation):
2390         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2391         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation):
2392         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2393         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation):
2394         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2395         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation):
2396         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2397         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation):
2398         (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute):
2399         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2400         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation):
2401         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute):
2402         * bindings/scripts/test/JS/JSTestNode.cpp:
2403         (WebCore::JSTestNodePrototype::finishCreation):
2404         (WebCore::jsTestNodeName):
2405         * bindings/scripts/test/JS/JSTestObj.cpp:
2406         (WebCore::JSTestObjConstructor::initializeProperties):
2407         (WebCore::JSTestObjPrototype::finishCreation):
2408         (WebCore::jsTestObjReadOnlyLongAttr):
2409         (WebCore::jsTestObjReadOnlyStringAttr):
2410         (WebCore::jsTestObjReadOnlyTestObjAttr):
2411         (WebCore::jsTestObjEnumAttr):
2412         (WebCore::jsTestObjByteAttr):
2413         (WebCore::jsTestObjOctetAttr):
2414         (WebCore::jsTestObjShortAttr):
2415         (WebCore::jsTestObjClampedShortAttr):
2416         (WebCore::jsTestObjEnforceRangeShortAttr):
2417         (WebCore::jsTestObjUnsignedShortAttr):
2418         (WebCore::jsTestObjLongAttr):
2419         (WebCore::jsTestObjLongLongAttr):
2420         (WebCore::jsTestObjUnsignedLongLongAttr):
2421         (WebCore::jsTestObjStringAttr):
2422         (WebCore::jsTestObjUsvstringAttr):
2423         (WebCore::jsTestObjTestObjAttr):
2424         (WebCore::jsTestObjTestNullableObjAttr):
2425         (WebCore::jsTestObjUnforgeableAttr):
2426         (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
2427         (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
2428         (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString):
2429         (WebCore::jsTestObjStringLongRecordAttr):
2430         (WebCore::jsTestObjUsvstringLongRecordAttr):
2431         (WebCore::jsTestObjStringObjRecordAttr):
2432         (WebCore::jsTestObjStringNullableObjRecordAttr):
2433         (WebCore::jsTestObjDictionaryAttr):
2434         (WebCore::jsTestObjNullableDictionaryAttr):
2435         (WebCore::jsTestObjAnnotatedTypeInUnionAttr):
2436         (WebCore::jsTestObjAnnotatedTypeInSequenceAttr):
2437         (WebCore::jsTestObjImplementationEnumAttr):
2438         (WebCore::jsTestObjXMLObjAttr):
2439         (WebCore::jsTestObjCreate):
2440         (WebCore::jsTestObjReflectedStringAttr):
2441         (WebCore::jsTestObjReflectedUSVStringAttr):
2442         (WebCore::jsTestObjReflectedIntegralAttr):
2443         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
2444         (WebCore::jsTestObjReflectedBooleanAttr):
2445         (WebCore::jsTestObjReflectedURLAttr):
2446         (WebCore::jsTestObjReflectedUSVURLAttr):
2447         (WebCore::jsTestObjReflectedCustomIntegralAttr):
2448         (WebCore::jsTestObjReflectedCustomBooleanAttr):
2449         (WebCore::jsTestObjReflectedCustomURLAttr):
2450         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
2451         (WebCore::jsTestObjEnabledBySettingAttribute):
2452         (WebCore::jsTestObjTypedArrayAttr):
2453         (WebCore::jsTestObjAttributeWithGetterException):
2454         (WebCore::jsTestObjAttributeWithSetterException):
2455         (WebCore::jsTestObjStringAttrWithGetterException):
2456         (WebCore::jsTestObjStringAttrWithSetterException):
2457         (WebCore::jsTestObjCustomAttr):
2458         (WebCore::jsTestObjOnfoo):
2459         (WebCore::jsTestObjOnwebkitfoo):
2460         (WebCore::jsTestObjWithScriptStateAttribute):
2461         (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
2462         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
2463         (WebCore::jsTestObjWithScriptStateAttributeRaises):
2464         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
2465         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
2466         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2467         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2468         (WebCore::jsTestObjConditionalAttr1):
2469         (WebCore::jsTestObjConditionalAttr2):
2470         (WebCore::jsTestObjConditionalAttr3):
2471         (WebCore::jsTestObjCachedAttribute1):
2472         (WebCore::jsTestObjCachedAttribute2):
2473         (WebCore::jsTestObjAnyAttribute):
2474         (WebCore::jsTestObjObjectAttribute):
2475         (WebCore::jsTestObjContentDocument):
2476         (WebCore::jsTestObjMutablePoint):
2477         (WebCore::jsTestObjStrawberry):
2478         (WebCore::jsTestObjDescription):
2479         (WebCore::jsTestObjId):
2480         (WebCore::jsTestObjHash):
2481         (WebCore::jsTestObjReplaceableAttribute):
2482         (WebCore::jsTestObjNullableDoubleAttribute):
2483         (WebCore::jsTestObjNullableLongAttribute):
2484         (WebCore::jsTestObjNullableBooleanAttribute):
2485         (WebCore::jsTestObjNullableStringAttribute):
2486         (WebCore::jsTestObjNullableLongSettableAttribute):
2487         (WebCore::jsTestObjNullableStringSettableAttribute):
2488         (WebCore::jsTestObjNullableUSVStringSettableAttribute):
2489         (WebCore::jsTestObjNullableByteStringSettableAttribute):
2490         (WebCore::jsTestObjNullableStringValue):
2491         (WebCore::jsTestObjAttribute):
2492         (WebCore::jsTestObjAttributeWithReservedEnumType):
2493         (WebCore::jsTestObjPutForwardsAttribute):
2494         (WebCore::jsTestObjPutForwardsNullableAttribute):
2495         (WebCore::jsTestObjStringifierAttribute):
2496         (WebCore::jsTestObjConditionallyReadWriteAttribute):
2497         (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute):
2498         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2499         (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
2500         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2501         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation):
2502         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2503         (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
2504         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2505         (WebCore::JSTestPluginInterfacePrototype::finishCreation):
2506         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2507         (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
2508         (WebCore::jsTestPromiseRejectionEventReason):
2509         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2510         (WebCore::JSTestSerializationPrototype::finishCreation):
2511         (WebCore::jsTestSerializationFirstStringAttribute):
2512         (WebCore::jsTestSerializationSecondLongAttribute):
2513         (WebCore::jsTestSerializationThirdUnserializableAttribute):
2514         (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute):
2515         (WebCore::jsTestSerializationFifthLongAttribute):
2516         (WebCore::jsTestSerializationSixthTypedefAttribute):
2517         (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute):
2518         (WebCore::jsTestSerializationEighthIndirectlyAttribute):
2519         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2520         (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation):
2521         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2522         (WebCore::JSTestSerializationInheritPrototype::finishCreation):
2523         (WebCore::jsTestSerializationInheritInheritLongAttribute):
2524         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2525         (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation):
2526         (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo):
2527         (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar):
2528         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2529         (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
2530         (WebCore::jsTestSerializedScriptValueInterfaceValue):
2531         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
2532         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
2533         (WebCore::jsTestSerializedScriptValueInterfacePorts):
2534         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
2535         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2536         (WebCore::JSTestStringifierPrototype::finishCreation):
2537         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2538         (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation):
2539         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2540         (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation):
2541         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2542         (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation):
2543         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2544         (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation):
2545         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2546         (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation):
2547         (WebCore::jsTestStringifierReadOnlyAttributeIdentifier):
2548         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2549         (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation):
2550         (WebCore::jsTestStringifierReadWriteAttributeIdentifier):
2551         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2552         (WebCore::JSTestTypedefsConstructor::initializeProperties):
2553         (WebCore::JSTestTypedefsPrototype::finishCreation):
2554         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
2555         (WebCore::jsTestTypedefsSerializedScriptValue):
2556         (WebCore::jsTestTypedefsAttributeWithClamp):
2557         (WebCore::jsTestTypedefsAttributeWithClampInTypedef):
2558         (WebCore::jsTestTypedefsAttrWithGetterException):
2559         (WebCore::jsTestTypedefsAttrWithSetterException):
2560         (WebCore::jsTestTypedefsStringAttrWithGetterException):
2561         (WebCore::jsTestTypedefsStringAttrWithSetterException):
2562         (WebCore::jsTestTypedefsBufferSourceAttr):
2563         (WebCore::jsTestTypedefsDomTimeStampAttr):
2564         They are binding test rebaselines.
2565
2566         * domjit/DOMJITIDLTypeFilter.h:
2567         * domjit/JSDocumentDOMJIT.cpp:
2568         (WebCore::compileDocumentDocumentElementAttribute):
2569         (WebCore::compileDocumentBodyAttribute):
2570         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted.
2571         (WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted.
2572         * domjit/JSNodeDOMJIT.cpp:
2573         (WebCore::compileNodeFirstChildAttribute):
2574         (WebCore::compileNodeLastChildAttribute):
2575         (WebCore::compileNodeNextSiblingAttribute):
2576         (WebCore::compileNodePreviousSiblingAttribute):
2577         (WebCore::compileNodeParentNodeAttribute):
2578         (WebCore::compileNodeNodeTypeAttribute):
2579         (WebCore::compileNodeOwnerDocumentAttribute):
2580         (WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted.
2581         (WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted.
2582         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted.
2583         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted.
2584         (WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted.
2585         (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted.
2586         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
2587         DOMJIT::GetterSetter becomes smaller constexpr data.
2588
2589 2017-07-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2590
2591         [GStreamer][EME] Not having a key id buffer should not always error
2592         https://bugs.webkit.org/show_bug.cgi?id=174889
2593
2594         Reviewed by Žan Doberšek.
2595
2596         In r219946 we introduced a hard requirement for a key id buffer
2597         that does not happen for all CDMs.
2598
2599         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2600         (webKitMediaClearKeyDecryptorSetupCipher): Check for key id buffer
2601         and error if we didn't get it.
2602         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2603         (webkitMediaCommonEncryptionDecryptTransformInPlace): Soften the
2604         requirement for key id buffer.
2605
2606 2017-07-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2607
2608         [GStreamer][EME] Fix phony debug output in player base for supported key system
2609         https://bugs.webkit.org/show_bug.cgi?id=174888
2610
2611         Reviewed by Žan Doberšek.
2612
2613         The debug output was returning always false because that method
2614         was not checking anything before. Now it is and should reflect it.
2615
2616         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2617         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
2618
2619 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
2620
2621         [EME][GStreamer] Add barebones CDM interface implementations for ClearKey
2622         https://bugs.webkit.org/show_bug.cgi?id=174887
2623
2624         Reviewed by Xabier Rodriguez-Calvar.
2625
2626         Add empty ClearKey derivations of CDMFactory, CDMPrivate and CDMInstance
2627         classes. These will be enhanced as the implementation progresses.
2628
2629         ClearKey is added to CDMInstance::ImplementationType, and the
2630         CDMInstanceClearKey::implementationType() override returns that value.
2631         Type traits specialization for the CDMInstanceClearKey class is also
2632         added, utilizing the CDMInstance::ImplementationType::ClearKey value.
2633
2634         The implementation file is added to the WPE build, along with the
2635         necessary inclusion directory.
2636
2637         * PlatformWPE.cmake:
2638         * platform/encryptedmedia/CDMInstance.h:
2639         * platform/encryptedmedia/clearkey/CDMClearKey.cpp: Added.
2640         (WebCore::CDMFactoryClearKey::createCDM):
2641         (WebCore::CDMFactoryClearKey::supportsKeySystem):
2642         (WebCore::CDMPrivateClearKey::supportsInitDataType):
2643         (WebCore::CDMPrivateClearKey::supportsConfiguration):
2644         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions):
2645         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration):
2646         (WebCore::CDMPrivateClearKey::supportsRobustness):
2647         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement):
2648         (WebCore::CDMPrivateClearKey::persistentStateRequirement):
2649         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersAreUniquePerOriginAndClearable):
2650         (WebCore::CDMPrivateClearKey::createInstance):
2651         (WebCore::CDMPrivateClearKey::loadAndInitialize):
2652         (WebCore::CDMPrivateClearKey::supportsServerCertificates):
2653         (WebCore::CDMPrivateClearKey::supportsSessions):
2654         (WebCore::CDMPrivateClearKey::supportsInitData):
2655         (WebCore::CDMPrivateClearKey::sanitizeResponse):
2656         (WebCore::CDMPrivateClearKey::sanitizeSessionId):
2657         (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
2658         (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
2659         (WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
2660         (WebCore::CDMInstanceClearKey::setServerCertificate):
2661         (WebCore::CDMInstanceClearKey::requestLicense):
2662         (WebCore::CDMInstanceClearKey::updateLicense):
2663         (WebCore::CDMInstanceClearKey::loadSession):
2664         (WebCore::CDMInstanceClearKey::closeSession):
2665         (WebCore::CDMInstanceClearKey::removeSessionData):
2666         (WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage):
2667         * platform/encryptedmedia/clearkey/CDMClearKey.h: Added.
2668
2669 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
2670
2671         [EME] Allow CDMInstance type traits specialization
2672         https://bugs.webkit.org/show_bug.cgi?id=174886
2673
2674         Reviewed by Xabier Rodriguez-Calvar.
2675
2676         Allow using the trait-based type casting for the CDMInstance class and its
2677         derivatives. ImplementationType enumeration values are to be used and
2678         returned from the new implementationType() virtual method. This method is
2679         leveraged in the type trait specialization that enables using is<>() and
2680         downcast<>() helpers for CDMInstance objects.
2681
2682         This will allow differentiating between CDMInstance implementations once
2683         the media playback pipeline has to retrieve any key information that's
2684         necessary for playback of encrypted content.
2685
2686         MockCDMInstance class overrides the implementationType() method, returning
2687         the ImplementationType::Mock value. Type trait specializations for this
2688         class aren't added since they're not needed anywhere at this point.
2689
2690         * platform/encryptedmedia/CDMInstance.h:
2691         * testing/MockCDMFactory.h:
2692
2693 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
2694
2695         [GCrypt] Key serialization support
2696         https://bugs.webkit.org/show_bug.cgi?id=173883
2697
2698         Reviewed by Jiewen Tan.
2699
2700         Implement crypto key serialization for platforms that use libgcrypt.
2701
2702         Despite the function names and the existing implementation for the Mac port,
2703         we don't perform the KEK wrapping and unwrapping due to the review feedback
2704         advising against it.
2705
2706         Instead the passed-in key data is simply copied and returned as the result of
2707         the 'wrapping' operation, and similarly the passed-in serialized data is simply
2708         copied and returned as the result of the 'unwrapping' operation.
2709
2710         No new tests -- related tests are now passing and are unskipped.
2711
2712         * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
2713         (WebCore::getDefaultWebCryptoMasterKey):
2714         (WebCore::wrapSerializedCryptoKey):
2715         (WebCore::unwrapSerializedCryptoKey):
2716
2717 2017-07-26  Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
2718
2719         Implement new TextMetrics, returned by canvas measureText()
2720         https://bugs.webkit.org/show_bug.cgi?id=82798
2721         <rdar://problem/11159332>
2722
2723         Reviewed by Dean Jackson.
2724
2725         The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext
2726
2727         Add new attributes to TextMetrics.
2728
2729         Add a new method textOffset() of CanvasRenderingContext2D by
2730         extracting from drawTextInternal() to use the same horizontal and
2731         vertical offsets of a text in both drawTextInternal() and
2732         measureText().
2733
2734         Test: fast/canvas/canvas-measureText-2.html
2735
2736         * html/TextMetrics.h:
2737         (WebCore::TextMetrics::actualBoundingBoxLeft):
2738         (WebCore::TextMetrics::setActualBoundingBoxLeft):
2739         (WebCore::TextMetrics::actualBoundingBoxRight):
2740         (WebCore::TextMetrics::setActualBoundingBoxRight):
2741         (WebCore::TextMetrics::fontBoundingBoxAscent):
2742         (WebCore::TextMetrics::setFontBoundingBoxAscent):
2743         (WebCore::TextMetrics::fontBoundingBoxDescent):
2744         (WebCore::TextMetrics::setFontBoundingBoxDescent):
2745         (WebCore::TextMetrics::actualBoundingBoxAscent):
2746         (WebCore::TextMetrics::setActualBoundingBoxAscent):
2747         (WebCore::TextMetrics::actualBoundingBoxDescent):
2748         (WebCore::TextMetrics::setActualBoundingBoxDescent):
2749         (WebCore::TextMetrics::emHeightAscent):
2750         (WebCore::TextMetrics::setEmHeightAscent):
2751         (WebCore::TextMetrics::emHeightDescent):
2752         (WebCore::TextMetrics::setEmHeightDescent):
2753         (WebCore::TextMetrics::hangingBaseline):
2754         (WebCore::TextMetrics::setHangingBaseline):
2755         (WebCore::TextMetrics::alphabeticBaseline):
2756         (WebCore::TextMetrics::setAlphabeticBaseline):
2757         (WebCore::TextMetrics::ideographicBaseline):
2758         (WebCore::TextMetrics::setIdeographicBaseline):
2759         Added getters and setters.
2760         (WebCore::TextMetrics::TextMetrics): Deleted.
2761         * html/TextMetrics.idl: Added new attributes.
2762         * html/canvas/CanvasRenderingContext2D.cpp:
2763         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
2764         Changed the return value type to a const reference of FontMetrics
2765         not to copy it.
2766         (WebCore::CanvasRenderingContext2D::FontProxy::width):
2767         Added the second arguemnt of GlyphOverflow type.
2768         (WebCore::CanvasRenderingContext2D::measureText): Calculate and
2769         set the new attributes of TextMetrics.
2770         (WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal.
2771         (WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the
2772         offset calculation code and call textOffset.
2773         * html/canvas/CanvasRenderingContext2D.h: Added the method
2774         declaration of textOffset. Change types of fontMetrics and width
2775         methods.
2776         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2777         (WebCore::FontCascade::floatWidthForComplexText): Added a dummy
2778         implementation of calculating GlyphOverflow.
2779
2780 2017-07-26  Devin Rousso  <drousso@apple.com>
2781
2782         Web Inspector: create protocol for recording Canvas contexts
2783         https://bugs.webkit.org/show_bug.cgi?id=174481
2784
2785         Reviewed by Joseph Pecoraro.
2786
2787         Currently, a recording doesn't actually "start" until an action is performed on the context.
2788         This change adds the recording logic, but it does not use it anywhere. Additonal tests will
2789         be added in the patches that add uses:
2790          - <https://webkit.org/b/174482> Web Inspector: Record actions performed on CanvasRenderingContext2D
2791          - <https://webkit.org/b/174483> Web Inspector: Record actions performed on WebGLRenderingContext
2792
2793         Test: inspector/model/recording.html
2794
2795         * bindings/scripts/IDLAttributes.json:
2796         * bindings/scripts/CodeGeneratorJS.pm:
2797         (GenerateAttributeGetterBodyDefinition):
2798         (GenerateAttributeSetterBodyDefinition):
2799         (GenerateImplementationFunctionCall):
2800         * WebCore.xcodeproj/project.pbxproj:
2801         * bindings/js/CallTracer.h: Added.
2802         * bindings/js/CallTracer.cpp: Added.
2803         (WebCore::CallTracer::recordCanvasAction):
2804         * bindings/js/CallTracerTypes.h: Added.
2805         * bindings/scripts/test/TestCallTracer.idl: Added.
2806         * bindings/scripts/test/JS/JSTestCallTracer.h: Added.
2807         * bindings/scripts/test/JS/JSTestCallTracer.cpp: Added.
2808
2809         Create new IDL extended attribute called "CallTracingCallback" that will add code to call a
2810         static function on CallTracer with the given extended attribute value as the function name,
2811         the `impl` object as the first parameter, the name of the attribute/operation as the second,
2812         and an optional object that accepts an initializer list of all the parameters as the third.
2813
2814         This function will not be called, however, unless a `callTracingActive` function on the
2815         `impl` object returns true, and this is marked as UNLIKELY.
2816
2817         "CallTracingCallback" can be added to an Interface, in which case it will apply to all
2818         attributes/operations of the generated class, or an individual Attribute/Operation.
2819
2820         * html/canvas/CanvasRenderingContext.h:
2821         (WebCore::CanvasRenderingContext::callTracingActive):
2822         (WebCore::CanvasRenderingContext::setCallTracingActive):
2823
2824         * inspector/InspectorCanvas.h:
2825         * inspector/InspectorCanvas.cpp:
2826         (WebCore::InspectorCanvas::~InspectorCanvas):
2827         (WebCore::InspectorCanvas::resetRecordingData):
2828         (WebCore::InspectorCanvas::hasRecordingData):
2829         (WebCore::InspectorCanvas::recordAction):
2830         (WebCore::InspectorCanvas::releaseInitialState):
2831         (WebCore::InspectorCanvas::releaseFrames):
2832         (WebCore::InspectorCanvas::releaseData):
2833         (WebCore::InspectorCanvas::markNewFrame):
2834         (WebCore::InspectorCanvas::markCurrentFrameIncomplete):
2835         (WebCore::InspectorCanvas::setBufferLimit):
2836         (WebCore::InspectorCanvas::hasBufferSpace):
2837         (WebCore::InspectorCanvas::singleFrame):
2838         (WebCore::InspectorCanvas::setSingleFrame):
2839         (WebCore::InspectorCanvas::indexForData):
2840         (WebCore::buildArrayForAffineTransform):
2841         (WebCore::buildArrayForVector):
2842         (WebCore::InspectorCanvas::buildInitialState):
2843         (WebCore::InspectorCanvas::buildAction):
2844         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
2845         (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
2846         (WebCore::InspectorCanvas::buildArrayForImageData):
2847
2848         Hold the recording data on the corresponding InspectorCanvas. Recording Frames are
2849         completed when the HTMLCanvasElement paints or a  0_s timer is fired. A recording is not
2850         considered valid until at least one action is performed on the canvas context. Once that
2851         condition is satisfied, canceling the recording will flush the data.
2852
2853         * inspector/InspectorCanvasAgent.h:
2854         * inspector/InspectorCanvasAgent.cpp:
2855         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
2856         (WebCore::InspectorCanvasAgent::disable):
2857         (WebCore::InspectorCanvasAgent::requestRecording):
2858         (WebCore::InspectorCanvasAgent::cancelRecording):
2859         (WebCore::InspectorCanvasAgent::recordCanvasAction):
2860         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2861         (WebCore::InspectorCanvasAgent::canvasDestroyed):
2862         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
2863         (WebCore::InspectorCanvasAgent::clearCanvasData):
2864
2865         * inspector/InspectorInstrumentation.h:
2866         * inspector/InspectorInstrumentation.cpp:
2867         (WebCore::InspectorInstrumentation::recordCanvasAction):
2868         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
2869         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
2870
2871         * html/canvas/CanvasRenderingContext2D.h:
2872         * html/canvas/CanvasRenderingContext2D.cpp:
2873         (WebCore::CanvasRenderingContext2D::stringForWindingRule):
2874         (WebCore::CanvasRenderingContext2D::stringForImageSmoothingQuality):
2875
2876         * platform/graphics/Gradient.h:
2877         (WebCore::Gradient::stops):
2878
2879         * svg/SVGPathUtilities.h:
2880         * svg/SVGPathUtilities.cpp:
2881         (WebCore::buildStringFromPath):
2882
2883 2017-07-26  Ali Juma  <ajuma@chromium.org>
2884
2885         Implement document.elementsFromPoint
2886         https://bugs.webkit.org/show_bug.cgi?id=153137
2887
2888         Reviewed by Simon Fraser.
2889
2890         This ports Blink's implementation of elementsFromPoint, from the
2891         following patches by Philip Rogers (pdr@chromium.org):
2892         -https://src.chromium.org/viewvc/blink?revision=190686&view=revision
2893         -https://src.chromium.org/viewvc/blink?revision=191240&view=revision
2894         -https://src.chromium.org/viewvc/blink?revision=199214&view=revision
2895
2896         Tests: imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-iframes.html
2897                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html
2898                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html
2899                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-simple.html
2900                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-svg.html
2901                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-table.html
2902
2903         * dom/DocumentOrShadowRoot.idl:
2904         * dom/TreeScope.cpp:
2905         (WebCore::absolutePointIfNotClipped):
2906         (WebCore::TreeScope::nodeFromPoint):
2907         (WebCore::TreeScope::elementFromPoint):
2908         (WebCore::TreeScope::elementsFromPoint):
2909         * dom/TreeScope.h:
2910         * page/EventHandler.cpp:
2911         (WebCore::EventHandler::hitTestResultAtPoint):
2912         * rendering/EllipsisBox.cpp:
2913         (WebCore::EllipsisBox::nodeAtPoint):
2914         * rendering/HitTestRequest.h:
2915         (WebCore::HitTestRequest::HitTestRequest):
2916         (WebCore::HitTestRequest::resultIsElementList):
2917         (WebCore::HitTestRequest::includesAllElementsUnderPoint):
2918         * rendering/HitTestResult.cpp:
2919         (WebCore::HitTestResult::HitTestResult):
2920         (WebCore::HitTestResult::operator=):
2921         (WebCore::HitTestResult::addNodeToListBasedTestResult):
2922         (WebCore::HitTestResult::append):
2923         (WebCore::HitTestResult::listBasedTestResult):
2924         (WebCore::HitTestResult::mutableListBasedTestResult):
2925         (WebCore::HitTestResult::addNodeToRectBasedTestResult): Deleted.
2926         (WebCore::HitTestResult::rectBasedTestResult): Deleted.
2927         (WebCore::HitTestResult::mutableRectBasedTestResult): Deleted.
2928         * rendering/HitTestResult.h:
2929         * rendering/InlineFlowBox.cpp:
2930         (WebCore::InlineFlowBox::nodeAtPoint):
2931         * rendering/InlineTextBox.cpp:
2932         (WebCore::InlineTextBox::nodeAtPoint):
2933         * rendering/RenderBlock.cpp:
2934         (WebCore::RenderBlock::nodeAtPoint):
2935         * rendering/RenderBox.cpp:
2936         (WebCore::RenderBox::nodeAtPoint):
2937         * rendering/RenderImage.cpp:
2938         (WebCore::RenderImage::nodeAtPoint):
2939         * rendering/RenderInline.cpp:
2940         (WebCore::RenderInline::hitTestCulledInline):
2941         * rendering/RenderLayer.cpp:
2942         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
2943         (WebCore::RenderLayer::hitTestLayer):
2944         (WebCore::RenderLayer::hitTestContents):
2945         (WebCore::RenderLayer::hitTestList):
2946         (WebCore::RenderLayer::calculateClipRects):
2947         * rendering/RenderTable.cpp:
2948         (WebCore::RenderTable::nodeAtPoint):
2949         * rendering/RenderTableSection.cpp:
2950         (WebCore::RenderTableSection::nodeAtPoint):
2951         * rendering/RenderWidget.cpp:
2952         (WebCore::RenderWidget::nodeAtPoint):
2953         * rendering/SimpleLineLayoutFunctions.cpp:
2954         (WebCore::SimpleLineLayout::hitTestFlow):
2955         * rendering/svg/RenderSVGContainer.cpp:
2956         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
2957         * rendering/svg/RenderSVGImage.cpp:
2958         (WebCore::RenderSVGImage::nodeAtFloatPoint):
2959         * rendering/svg/RenderSVGRoot.cpp:
2960         (WebCore::RenderSVGRoot::nodeAtPoint):
2961         * rendering/svg/RenderSVGShape.cpp:
2962         (WebCore::RenderSVGShape::nodeAtFloatPoint):
2963         * rendering/svg/SVGInlineTextBox.cpp:
2964         (WebCore::SVGInlineTextBox::nodeAtPoint):
2965         * testing/Internals.cpp:
2966         (WebCore::Internals::nodesFromRect):
2967
2968 2017-07-26  Charlie Turner  <cturner@igalia.com>
2969
2970         [GStreamer] Review WebKitWebSource after r219252.
2971         https://bugs.webkit.org/show_bug.cgi?id=174415
2972
2973         Reviewed by Carlos Garcia Campos.
2974
2975         Remove ResourceHandleStreamingClient, and flatten the StreamingClient
2976         into CachedResourceStreamingClient (the only implemetation left). They
2977         are no longer required after r219252.
2978
2979         Also remove the locking code. It's not needed now, and what existed
2980         was heavy-handed and missed several cases it was supposed to protect
2981
2982         Covered by existing tests.
2983
2984         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2985         (webkit_web_src_init):
2986         (webKitWebSrcDispose):
2987         (webKitWebSrcStop):
2988         (webKitWebSrcStart):
2989         (webKitWebSrcNeedData):
2990         (webKitWebSrcEnoughData):
2991         (webKitWebSrcSeek):
2992         (webKitWebSrcSetMediaPlayer):
2993         (CachedResourceStreamingClient::CachedResourceStreamingClient):
2994         (CachedResourceStreamingClient::~CachedResourceStreamingClient):
2995         (CachedResourceStreamingClient::getOrCreateReadBuffer):
2996         (CachedResourceStreamingClient::responseReceived):
2997         (CachedResourceStreamingClient::dataReceived):
2998         (CachedResourceStreamingClient::loadFinished):
2999         (ResourceHandleStreamingClient::create): Deleted.
3000         (): Deleted.
3001         (StreamingClient::StreamingClient): Deleted.
3002         (StreamingClient::~StreamingClient): Deleted.
3003         (StreamingClient::createReadBuffer): Deleted.
3004         (StreamingClient::handleResponseReceived): Deleted.
3005         (StreamingClient::handleDataReceived): Deleted.
3006         (StreamingClient::handleNotifyFinished): Deleted.
3007         (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Deleted.
3008         (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Deleted.
3009         (ResourceHandleStreamingClient::cleanupAndStopRunLoop): Deleted.
3010         (ResourceHandleStreamingClient::invalidate): Deleted.
3011         (ResourceHandleStreamingClient::loadFailed): Deleted.
3012         (ResourceHandleStreamingClient::setDefersLoading): Deleted.
3013         (ResourceHandleStreamingClient::getOrCreateReadBuffer): Deleted.
3014         (ResourceHandleStreamingClient::willSendRequest): Deleted.
3015         (ResourceHandleStreamingClient::didReceiveResponse): Deleted.
3016         (ResourceHandleStreamingClient::didReceiveData): Deleted.
3017         (ResourceHandleStreamingClient::didReceiveBuffer): Deleted.
3018         (ResourceHandleStreamingClient::didFinishLoading): Deleted.
3019         (ResourceHandleStreamingClient::didFail): Deleted.
3020         (ResourceHandleStreamingClient::wasBlocked): Deleted.
3021         (ResourceHandleStreamingClient::cannotShowURL): Deleted.
3022
3023 2017-07-26  Brian Burg  <bburg@apple.com>
3024
3025         Remove WEB_TIMING feature flag
3026         https://bugs.webkit.org/show_bug.cgi?id=174795
3027
3028         Reviewed by Alex Christensen.
3029
3030         * Configurations/FeatureDefines.xcconfig:
3031         * bindings/js/JSPerformanceEntryCustom.cpp:
3032         * dom/Document.cpp:
3033         (WebCore::Document::setReadyState):
3034         (WebCore::Document::finishedParsing):
3035         * dom/Document.h:
3036         (WebCore::Document::timing):
3037         * dom/DocumentTiming.h:
3038         * dom/EventTargetFactory.in:
3039         * loader/DocumentThreadableLoader.cpp:
3040         (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
3041         (WebCore::DocumentThreadableLoader::loadRequest):
3042         * loader/DocumentThreadableLoader.h:
3043         * loader/ResourceTimingInformation.cpp:
3044         * loader/ResourceTimingInformation.h:
3045         * loader/SubresourceLoader.cpp:
3046         (WebCore::SubresourceLoader::didFinishLoading):
3047         (WebCore::SubresourceLoader::reportResourceTiming):
3048         * loader/SubresourceLoader.h:
3049         * loader/ThreadableLoaderClient.h:
3050         (WebCore::ThreadableLoaderClient::didFail):
3051         (WebCore::ThreadableLoaderClient::didFinishTiming):
3052         * loader/WorkerThreadableLoader.cpp:
3053         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
3054         * loader/WorkerThreadableLoader.h:
3055         * loader/cache/CachedResourceLoader.cpp:
3056         (WebCore::CachedResourceLoader::requestResource):
3057         (WebCore::CachedResourceLoader::revalidateResource):
3058         (WebCore::CachedResourceLoader::loadResource):
3059         * loader/cache/CachedResourceLoader.h:
3060         (WebCore::CachedResourceLoader::resourceTimingInformation):
3061         * page/DOMWindow.cpp:
3062         (WebCore::DOMWindow::~DOMWindow):
3063         (WebCore::DOMWindow::resetDOMWindowProperties):
3064         (WebCore::DOMWindow::nowTimestamp):
3065         (WebCore::DOMWindow::removeAllEventListeners):
3066         * page/DOMWindow.h:
3067         * page/GlobalPerformance.idl:
3068         * page/Performance.cpp:
3069         * page/Performance.h:
3070         * page/Performance.idl:
3071         * page/PerformanceEntry.cpp:
3072         * page/PerformanceEntry.h:
3073         * page/PerformanceEntry.idl:
3074         * page/PerformanceMark.h:
3075         * page/PerformanceMark.idl:
3076         * page/PerformanceMeasure.h:
3077         * page/PerformanceMeasure.idl:
3078         * page/PerformanceNavigation.cpp:
3079         * page/PerformanceNavigation.h:
3080         * page/PerformanceNavigation.idl:
3081         * page/PerformanceObserver.cpp:
3082         * page/PerformanceObserver.h:
3083         * page/PerformanceObserver.idl:
3084         * page/PerformanceObserverCallback.h:
3085         * page/PerformanceObserverCallback.idl:
3086         * page/PerformanceObserverEntryList.cpp:
3087         * page/PerformanceObserverEntryList.h:
3088         * page/PerformanceObserverEntryList.idl:
3089         * page/PerformanceResourceTiming.cpp:
3090         * page/PerformanceResourceTiming.h:
3091         * page/PerformanceResourceTiming.idl:
3092         * page/PerformanceTiming.cpp:
3093         * page/PerformanceTiming.h:
3094         * page/PerformanceTiming.idl:
3095         * page/PerformanceUserTiming.cpp:
3096         * page/PerformanceUserTiming.h:
3097         * platform/network/ResourceHandle.h:
3098         * platform/network/ResourceHandleInternal.h:
3099         * platform/network/cf/ResourceHandleCFNet.cpp:
3100         (WebCore::ResourceHandle::start):
3101         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3102         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3103         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3104         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
3105         * platform/network/curl/ResourceHandleCurl.cpp:
3106         (WebCore::ResourceHandleInternal::didFinish):
3107         (WebCore::ResourceHandleInternal::calculateWebTimingInformations):
3108         (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
3109         * platform/network/mac/ResourceHandleMac.mm:
3110         (WebCore::ResourceHandle::createNSURLConnection):
3111         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3112         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
3113         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3114         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3115         * platform/network/soup/ResourceHandleSoup.cpp:
3116         (WebCore::restartedCallback):
3117         (WebCore::sendRequestCallback):
3118         (WebCore::createSoupMessageForHandleAndRequest):
3119         (WebCore::ResourceHandle::sendPendingRequest):
3120         * platform/network/soup/SoupNetworkSession.cpp:
3121         (WebCore::SoupNetworkSession::SoupNetworkSession):
3122         * workers/WorkerGlobalScope.cpp:
3123         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3124         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
3125         (WebCore::WorkerGlobalScope::removeAllEventListeners):
3126         * workers/WorkerGlobalScope.h:
3127
3128 2017-07-26  Chris Dumez  <cdumez@apple.com>
3129
3130         Pressing the Escape key should not be a valid user gesture to enter fullscreen
3131         https://bugs.webkit.org/show_bug.cgi?id=174864
3132         <rdar://problem/33009088>
3133
3134         Reviewed by Geoffrey Garen.
3135
3136         Pressing the Escape key should not be a valid user gesture to enter fullscreen since this
3137         is the gesture to exit fullscreen already.
3138
3139         Test: fullscreen/requestFullscreen-escape-key.html
3140
3141         * dom/Document.cpp:
3142         (WebCore::Document::requestFullScreenForElement):
3143         * dom/UserGestureIndicator.cpp:
3144         (WebCore::UserGestureIndicator::UserGestureIndicator):
3145         * dom/UserGestureIndicator.h:
3146         (WebCore::UserGestureToken::create):
3147         (WebCore::UserGestureToken::gestureType):
3148         (WebCore::UserGestureToken::UserGestureToken):
3149         * page/EventHandler.cpp:
3150         (WebCore::EventHandler::internalKeyEvent):
3151
3152 2017-07-26  Nan Wang  <n_wang@apple.com>
3153
3154         AX: Incorrect range from index and length in contenteditable with <p> tags
3155         https://bugs.webkit.org/show_bug.cgi?id=174856
3156
3157         Reviewed by Chris Fleizach.
3158
3159         When asking for the string inside a text control with a given range, we sometimes get
3160         a wrong string at the line boundary due to a bad plain range to text marker conversion.
3161         To fix this, we should use the exsisting method on text controls to avoid this issue. 
3162
3163         Updated the test to test the problematic case.
3164
3165         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3166         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3167
3168 2017-07-26  Daewoong Jang  <daewoong.jang@navercorp.com>
3169
3170         [Curl] Bug fix after r219606
3171         https://bugs.webkit.org/show_bug.cgi?id=174845
3172
3173         Reviewed by Alex Christensen.
3174
3175         * platform/network/curl/CurlContext.h:
3176         (WebCore::CurlSList::isEmpty):
3177         * platform/network/curl/ResourceHandleCurl.cpp:
3178         (WebCore::ResourceHandleInternal::didReceiveHeaderLine):
3179         (WebCore::ResourceHandleInternal::headerCallback):
3180
3181 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
3182
3183         [EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
3184         https://bugs.webkit.org/show_bug.cgi?id=174779
3185
3186         Reviewed by Xabier Rodriguez-Calvar.
3187
3188         In the CENC decryptor, the key ID value is retrieved from the info structure
3189         on the GstProtectionMeta object. GstBuffer for that value is retrieved and
3190         passed to the setupCipher() function.
3191
3192         In the ClearKey decryptor (which extends the CENC decryptor), the single
3193         GstBuffer object on the private instance that holds the key value is replaced
3194         with a Vector object that holds pairs of key ID and value GstBuffers. In the
3195         handleKeyResponse() implementation that Vector is emptied and then refilled
3196         with key ID and value pairs that are passed in through the drm-cipher-clearkey
3197         structure that's attached to the GstEvent that signalled new key information.
3198
3199         In the ClearKey decryptor's setupCipher() implementation the passed-in key ID
3200         buffer is used to find a matching key ID and value pair stored on the private
3201         instance. If not found, an error is thrown. If found, the matching key value
3202         is used for decryption.
3203
3204         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3205         (webKitMediaClearKeyDecryptorHandleKeyResponse):
3206         (webKitMediaClearKeyDecryptorSetupCipher):
3207         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3208         (webkitMediaCommonEncryptionDecryptTransformInPlace):
3209         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
3210         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
3211
3212 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
3213
3214         [EME][GStreamer] Handle ClearKey as a supported key system
3215         https://bugs.webkit.org/show_bug.cgi?id=174778
3216
3217         Reviewed by Xabier Rodriguez-Calvar.
3218
3219         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3220         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
3221         Return true for the 'org.w3.clearkey' key system when building with
3222         ENCRYPTED_MEDIA enabled. The underlying implementation will follow.
3223
3224 2017-07-26  Claudio Saavedra  <csaavedra@igalia.com>
3225
3226         [WPE] Fix a potential crash in the platform pasteboard when reading a string
3227         https://bugs.webkit.org/show_bug.cgi?id=174859
3228
3229         Reviewed by Žan Doberšek.
3230
3231         We shouldn't assume that the wpe_pasteboard_string struct will be
3232         filled in, so initialize it.
3233
3234         * platform/wpe/PlatformPasteboardWPE.cpp:
3235         (WebCore::PlatformPasteboard::readString): Initialize the struct
3236         before passing it to wpe and early return if it's still empty.
3237
3238 2017-07-26  Javier Fernandez  <jfernandez@igalia.com>
3239
3240         InsertOrderedList command applied to table cells inserts an extra BR before the table
3241         https://bugs.webkit.org/show_bug.cgi?id=174593
3242
3243         Reviewed by Darin Adler.
3244
3245         Don't add BR when pruning empty blocks if it's the start of a paragraph.
3246
3247         The function MoveParagraph is used for several operations and editing
3248         commands, like 'insertOrderedList'. When moving paragraphs we check out
3249         whether we should add a 'br' element to avoid undesired block collapse.
3250
3251         However, we shouldn't do this when destination is the start of a
3252         paragraph.
3253
3254         Tests: editing/inserting/insert-list-in-table-cell-01.html
3255                editing/inserting/insert-list-in-table-cell-02.html
3256                editing/inserting/insert-list-in-table-cell-03.html
3257                editing/inserting/insert-list-in-table-cell-04.html
3258                editing/inserting/insert-list-in-table-cell-05.html
3259                editing/inserting/insert-list-in-table-cell-06.html
3260                editing/inserting/insert-list-in-table-cell-07.html
3261                editing/inserting/insert-list-in-table-cell-08.html
3262
3263         * editing/CompositeEditCommand.cpp:
3264         (WebCore::CompositeEditCommand::moveParagraphs):
3265
3266 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
3267
3268         [WPE] WebGL2 support
3269         https://bugs.webkit.org/show_bug.cgi?id=174249
3270
3271         Reviewed by Alex Christensen.
3272
3273         Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep
3274         the implementation specific to libepoxy (which WPE leverages by default).
3275
3276         In the GraphicsContext3D::create() method, we first construct the
3277         GraphicsContext3D object that also ensures a current GL context on this thread.
3278         Only then can we determine through libepoxy whether the underlying GL library
3279         is able to support WebGL2.
3280
3281         For WebGL2, the GLES3 support is required. The initial libepoxy implementation
3282         ensures this only in case of 'non-desktop GL' library of minimum version 3.0.
3283         This effectively translates to the only supported configuration being the
3284         EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we
3285         discard the existing GraphicsContext3D object and return null.
3286
3287         WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't
3288         been tested yet. Implementation will in the future be extended to support that
3289         as required.
3290
3291         In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor
3292         has to now receive the second argument, the desired shader specification that's
3293         used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1,
3294         and SH_WEBGL2_SPEC for WebGL2.
3295
3296         No new tests -- a small set of existing WebGL2 tests is unskipped and passing.
3297
3298         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3299         (WebCore::GraphicsContext3D::create):
3300         (WebCore::GraphicsContext3D::GraphicsContext3D):
3301         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3302         Add WebGL2-specific methods to the build.
3303
3304 2017-07-26  Nan Wang  <n_wang@apple.com>
3305
3306         AX: should dispatch accessibilityPerformPressAction async on MacOS
3307         https://bugs.webkit.org/show_bug.cgi?id=174849
3308
3309         Reviewed by Chris Fleizach.
3310
3311         If performing the accessibility press action results in a modal alert being displayed,
3312         it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously.
3313
3314         Updated tests to adapt to this change.
3315
3316         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3317         (-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]):
3318         (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
3319
3320 2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3321
3322         Icon loader error on startup
3323         https://bugs.webkit.org/show_bug.cgi?id=174787
3324
3325         Reviewed by Brady Eidson.
3326
3327         This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about
3328         pages. IconController::startLoader() did several checks before starting the load that
3329         DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have
3330         an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the
3331         same checks now before starting to load icons.
3332
3333         * loader/DocumentLoader.cpp:
3334         (WebCore::DocumentLoader::startIconLoading):
3335
3336 2017-07-25  Sam Weinig  <sam@webkit.org>
3337
3338         [WebIDL] Remove custom bindings for HTMLCanvasElement
3339         https://bugs.webkit.org/show_bug.cgi?id=174847
3340
3341         Reviewed by Darin Adler.
3342
3343         * CMakeLists.txt:
3344         * WebCore.xcodeproj/project.pbxproj:
3345         * bindings/js/JSBindingsAllInOne.cpp:
3346         * bindings/js/JSHTMLCanvasElementCustom.cpp: Removed.
3347         Remove JSHTMLCanvasElementCustom.
3348
3349         * html/HTMLCanvasElement.cpp:
3350         (WebCore::HTMLCanvasElement::getContext):
3351         (WebCore::HTMLCanvasElement::getContext2d):
3352         (WebCore::HTMLCanvasElement::getContextWebGL):
3353         (WebCore::HTMLCanvasElement::getContextWebGPU):
3354         * html/HTMLCanvasElement.h:
3355         * html/HTMLCanvasElement.idl:
3356         Move context picking code to HTMLCanvasElement. Give more
3357         exact types to remaining context getters.
3358
3359 2017-07-25  Chris Dumez  <cdumez@apple.com>
3360
3361         Clean up ExceptionCode enumeration
3362         https://bugs.webkit.org/show_bug.cgi?id=174812
3363
3364         Reviewed by Darin Adler.
3365
3366         Clean up ExceptionCode enumeration:
3367         - Updated comments to reflect the latest WebIDL specification
3368         - Drop special values given to some exception codes. Those legacy codes are already in the
3369           table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException
3370           table
3371         - Drop NoException value in the enumeration and use std::optional<ExceptionCode> when needed
3372           instead.
3373
3374         * Modules/indexeddb/shared/IDBError.cpp:
3375         (WebCore::IDBError::IDBError):
3376         (WebCore::IDBError::name):
3377         (WebCore::IDBError::message):
3378         * Modules/indexeddb/shared/IDBError.h:
3379         (WebCore::IDBError::code):
3380         (WebCore::IDBError::encode):
3381         (WebCore::IDBError::decode):
3382         * dom/DOMException.cpp:
3383         * dom/ExceptionCode.h:
3384         * fileapi/FileReaderSync.cpp:
3385         (WebCore::errorCodeToException):
3386         (WebCore::FileReaderSync::startLoading):
3387         * xml/XMLHttpRequest.cpp:
3388         (WebCore::XMLHttpRequest::createRequest):
3389         * xml/XMLHttpRequest.h:
3390
3391 2017-07-25  Andy Estes  <