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