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