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