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