[WebAuthN] Implement authenticatorMakeCredential
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
2
3         [WebAuthN] Implement authenticatorMakeCredential
4         https://bugs.webkit.org/show_bug.cgi?id=183527
5         <rdar://problem/35275886>
6
7         Reviewed by Brent Fulgham.
8
9         This patch does the following few things:
10         1) It implements the authenticatorMakeCredential logic from the spec: https://www.w3.org/TR/webauthn/#op-make-cred.
11         2) It tweaks enocding and deocding of PublicKeyCredentialCreationOptions between UIProccess and WebProcess.
12         3) It soft links LocalAuthentication.Framework to WebCore, which was linked to WebKit.
13         4) It creates SPI header for DeviceIdentity.Framework, and provides stubs to link it to WebCore.
14
15         Here is a detailed explanantion of 1):
16         1. A helper class called LocalAuthenticator is crafted to represent Apple platform attached authenticator, i.e.
17         the devices themselves. All operations are currently restricted to iOS at this moment as macOS lacks attestation
18         support.
19         2. To do testing, this helper class is then moved from WebKit to WebCore even though all operations can only happens
20         in the UIProcess. We currently lack the ability to pretend a https environment in TestWebKitAPI which is required by
21         the WebAuthN API, and thus it is moved to WebCore to perform unit tesing flavor API tests. This is not enough as it
22         can't test message exchange between the UI and Web processes. We will address this in a subsequent patch.
23         3. More on testing: The attestation process is abstracted into a protected method such that the testing enviroment can
24         override it with self attestation as network access is restricted in the WebKit testing enviroment. Also, swizzlers of
25         LocalAuthentication API are provided to override the behavoir of LAContext.
26         4. More on testing: The actual Apple attestation can only happen in real device and with network access, therefore
27         it can only be covered by manual tests at this moment.
28         5. Back to LocalAuthenticator, it currently has two public methods:
29                 5.1. makeCredential(): This method is the one does all the magic.
30                 + It first checks some parameters.
31                 + It then invokes LAContext to get user consent.
32                 + It then talks to Apple Attestation Privacy CA to do attestations.
33                 + It then stores necessary information into the Keychain.
34                 + Finally it generates the attestation object.
35                 5.2 isAvailable():
36                 To check if a LocalAuthenticator is available or not.
37         6. Even though files are of .mm format, they are written in a way that mixes NS, CF and C++ types. Here is the rule:
38                 6.1 Use CF type only if it is requested by APIs.
39                 6.2 Use NS type to manipulate all Objc objects.
40                 6.3 Use C++ otherwise.
41
42         Covered by API tests.
43
44         * Configurations/WebCore.xcconfig:
45         * Modules/credentialmanagement/CredentialsMessenger.cpp:
46         (WebCore::getIdFromAttestationObject): Deleted.
47         Decoding attestation object is tedious. UIProcess will instead return credential ID and attestation object
48         at the same time. Therefore, this method is removed.
49         * Modules/credentialmanagement/CredentialsMessenger.h:
50         (WebCore::CreationReturnBundle::CreationReturnBundle): Deleted.
51         (WebCore::AssertionReturnBundle::AssertionReturnBundle): Deleted.
52         * Modules/webauthn/COSEConstants.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
53         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
54         (WebCore::PublicKeyCredentialCreationOptions::isolatedPartialCopyPtr const):
55         (WebCore::PublicKeyCredentialCreationOptions::Parameters::encode const):
56         (WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
57         (WebCore::PublicKeyCredentialCreationOptions::encode const):
58         (WebCore::PublicKeyCredentialCreationOptions::decode):
59         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
60         (WebCore::PublicKeyCredentialDescriptor::encode const):
61         (WebCore::PublicKeyCredentialDescriptor::decode):
62         * Modules/webauthn/PublicKeyCredentialType.h:
63         * Modules/webauthn/cocoa/LocalAuthenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
64         * Modules/webauthn/cocoa/LocalAuthenticator.mm: Added.
65         (WebCore::LocalAuthenticatorInternal::freePtrs):
66         (WebCore::LocalAuthenticator::makeCredential const):
67         (WebCore::LocalAuthenticator::isAvailable const):
68         (WebCore::LocalAuthenticator::issueClientCertificate const):
69         * SourcesCocoa.txt:
70         * WebCore.xcodeproj/project.pbxproj:
71         * platform/cocoa/LocalAuthenticationSoftLink.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
72         * platform/cocoa/LocalAuthenticationSoftLink.mm: Added.
73         * testing/MockCredentialsMessenger.cpp:
74         (WebCore::MockCredentialsMessenger::setCreationReturnBundle):
75         (WebCore::MockCredentialsMessenger::makeCredential):
76         (WebCore::MockCredentialsMessenger::makeCredentialReply):
77         (WebCore::MockCredentialsMessenger::setAttestationObject): Deleted.
78         * testing/MockCredentialsMessenger.h:
79         * testing/MockCredentialsMessenger.idl:
80
81 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
82
83         Correct debug assertion in Range::borderAndTextRects
84         https://bugs.webkit.org/show_bug.cgi?id=183710
85         <rdar://problem/38466976>
86
87         Reviewed by Ryosuke Niwa.
88
89         A debug assertion will fire if Range::borderAndTextRects is asked to evaluate a set of selected elements, where one of the elements does not have a parent.
90
91         We should consider a nullptr parent as satisfying the condition of a parent not being present in the selection set.
92
93         Tests: fast/dom/range/range-selection-empty-body.html
94
95         * dom/Range.cpp:
96         (WebCore::Range::borderAndTextRects const):
97
98 2018-03-15  Filip Pizlo  <fpizlo@apple.com>
99
100         Put the DOM in IsoHeaps
101         https://bugs.webkit.org/show_bug.cgi?id=183546
102
103         Reviewed by Daniel Bates.
104
105         No new tests because no change in behavior.
106         
107         This puts all descendants of WebCore::Node in isoheaps, so that UAFs on the DOM cannot be
108         used for RCE attacks. This probably also makes it harder to use UAFs for UXSS, since it means
109         that DOM UAFs cannot be used for universal read gadgets.
110         
111         This looks neutral on Speedometer and membuster, though I did have one round of testing
112         that led me to believe that membuster was regressed - I just wasn't able to reproduce that
113         result on subsequent testing.
114
115         * Sources.txt:
116         * WebCore.xcodeproj/project.pbxproj:
117         * dom/Attr.cpp:
118         * dom/Attr.h:
119         * dom/CDATASection.cpp:
120         * dom/CDATASection.h:
121         * dom/CharacterData.cpp:
122         * dom/CharacterData.h:
123         * dom/Comment.cpp:
124         * dom/Comment.h:
125         * dom/ContainerNode.cpp:
126         * dom/ContainerNode.h:
127         * dom/Document.cpp:
128         * dom/Document.h:
129         * dom/DocumentFragment.cpp:
130         * dom/DocumentFragment.h:
131         * dom/DocumentType.cpp:
132         * dom/DocumentType.h:
133         * dom/Node.cpp:
134         * dom/Node.h:
135         * dom/ProcessingInstruction.cpp:
136         * dom/ProcessingInstruction.h:
137         * dom/PseudoElement.cpp:
138         * dom/PseudoElement.h:
139         * dom/ShadowRoot.cpp:
140         * dom/ShadowRoot.h:
141         * dom/StyledElement.cpp:
142         * dom/StyledElement.h:
143         * dom/TemplateContentDocumentFragment.cpp: Added.
144         * dom/TemplateContentDocumentFragment.h:
145         * dom/Text.cpp:
146         * dom/Text.h:
147         * dom/XMLDocument.cpp: Added.
148         * dom/XMLDocument.h:
149         * html/FTPDirectoryDocument.cpp:
150         * html/FTPDirectoryDocument.h:
151         * html/FileInputType.cpp:
152         * html/HTMLAnchorElement.cpp:
153         * html/HTMLAnchorElement.h:
154         * html/HTMLAppletElement.cpp:
155         * html/HTMLAppletElement.h:
156         * html/HTMLAreaElement.cpp:
157         * html/HTMLAreaElement.h:
158         * html/HTMLAttachmentElement.cpp:
159         * html/HTMLAttachmentElement.h:
160         * html/HTMLBDIElement.cpp: Added.
161         * html/HTMLBDIElement.h:
162         * html/HTMLBRElement.cpp:
163         * html/HTMLBRElement.h:
164         * html/HTMLBaseElement.cpp:
165         * html/HTMLBaseElement.h:
166         * html/HTMLBodyElement.cpp:
167         * html/HTMLBodyElement.h:
168         * html/HTMLButtonElement.cpp:
169         * html/HTMLButtonElement.h:
170         * html/HTMLCanvasElement.cpp:
171         * html/HTMLCanvasElement.h:
172         * html/HTMLDListElement.cpp:
173         * html/HTMLDListElement.h:
174         * html/HTMLDataElement.cpp:
175         * html/HTMLDataElement.h:
176         * html/HTMLDataListElement.cpp:
177         * html/HTMLDataListElement.h:
178         * html/HTMLDetailsElement.cpp:
179         * html/HTMLDetailsElement.h:
180         * html/HTMLDirectoryElement.cpp:
181         * html/HTMLDirectoryElement.h:
182         * html/HTMLDivElement.cpp:
183         * html/HTMLDivElement.h:
184         * html/HTMLDocument.cpp:
185         * html/HTMLDocument.h:
186         * html/HTMLElement.cpp:
187         * html/HTMLElement.h:
188         * html/HTMLEmbedElement.cpp:
189         * html/HTMLEmbedElement.h:
190         * html/HTMLFieldSetElement.cpp:
191         * html/HTMLFieldSetElement.h:
192         * html/HTMLFontElement.cpp:
193         * html/HTMLFontElement.h:
194         * html/HTMLFormControlElement.cpp:
195         * html/HTMLFormControlElement.h:
196         * html/HTMLFormControlElementWithState.cpp:
197         * html/HTMLFormControlElementWithState.h:
198         * html/HTMLFormElement.cpp:
199         * html/HTMLFormElement.h:
200         * html/HTMLFrameElement.cpp:
201         * html/HTMLFrameElement.h:
202         * html/HTMLFrameElementBase.cpp:
203         * html/HTMLFrameElementBase.h:
204         * html/HTMLFrameOwnerElement.cpp:
205         * html/HTMLFrameOwnerElement.h:
206         * html/HTMLFrameSetElement.cpp:
207         * html/HTMLFrameSetElement.h:
208         * html/HTMLHRElement.cpp:
209         * html/HTMLHRElement.h:
210         * html/HTMLHeadElement.cpp:
211         * html/HTMLHeadElement.h:
212         * html/HTMLHeadingElement.cpp:
213         * html/HTMLHeadingElement.h:
214         * html/HTMLHtmlElement.cpp:
215         * html/HTMLHtmlElement.h:
216         * html/HTMLIFrameElement.cpp:
217         * html/HTMLIFrameElement.h:
218         * html/HTMLImageElement.cpp:
219         * html/HTMLImageElement.h:
220         * html/HTMLInputElement.cpp:
221         * html/HTMLInputElement.h:
222         * html/HTMLKeygenElement.cpp:
223         * html/HTMLKeygenElement.h:
224         * html/HTMLLIElement.cpp:
225         * html/HTMLLIElement.h:
226         * html/HTMLLabelElement.cpp:
227         * html/HTMLLabelElement.h:
228         * html/HTMLLegendElement.cpp:
229         * html/HTMLLegendElement.h:
230         * html/HTMLLinkElement.cpp:
231         * html/HTMLLinkElement.h:
232         * html/HTMLMapElement.cpp:
233         * html/HTMLMapElement.h:
234         * html/HTMLMarqueeElement.cpp:
235         * html/HTMLMarqueeElement.h:
236         * html/HTMLMenuElement.cpp:
237         * html/HTMLMenuElement.h:
238         * html/HTMLMenuItemElement.cpp:
239         * html/HTMLMenuItemElement.h:
240         * html/HTMLMetaElement.cpp:
241         * html/HTMLMetaElement.h:
242         * html/HTMLMeterElement.cpp:
243         * html/HTMLMeterElement.h:
244         * html/HTMLModElement.cpp:
245         * html/HTMLModElement.h:
246         * html/HTMLOListElement.cpp:
247         * html/HTMLOListElement.h:
248         * html/HTMLObjectElement.cpp:
249         * html/HTMLObjectElement.h:
250         * html/HTMLOptGroupElement.cpp:
251         * html/HTMLOptGroupElement.h:
252         * html/HTMLOptionElement.cpp:
253         * html/HTMLOptionElement.h:
254         * html/HTMLOutputElement.cpp:
255         * html/HTMLOutputElement.h:
256         * html/HTMLParagraphElement.cpp:
257         * html/HTMLParagraphElement.h:
258         * html/HTMLParamElement.cpp:
259         * html/HTMLParamElement.h:
260         * html/HTMLPictureElement.cpp:
261         * html/HTMLPictureElement.h:
262         * html/HTMLPlugInElement.cpp:
263         * html/HTMLPlugInElement.h:
264         * html/HTMLPlugInImageElement.cpp:
265         * html/HTMLPlugInImageElement.h:
266         * html/HTMLPreElement.cpp:
267         * html/HTMLPreElement.h:
268         * html/HTMLProgressElement.cpp:
269         * html/HTMLProgressElement.h:
270         * html/HTMLQuoteElement.cpp:
271         * html/HTMLQuoteElement.h:
272         * html/HTMLScriptElement.cpp:
273         * html/HTMLScriptElement.h:
274         * html/HTMLSelectElement.cpp:
275         * html/HTMLSelectElement.h:
276         * html/HTMLSlotElement.cpp:
277         * html/HTMLSlotElement.h:
278         * html/HTMLSourceElement.cpp:
279         * html/HTMLSourceElement.h:
280         * html/HTMLSpanElement.cpp:
281         * html/HTMLSpanElement.h:
282         * html/HTMLStyleElement.cpp:
283         * html/HTMLStyleElement.h:
284         * html/HTMLSummaryElement.cpp:
285         * html/HTMLSummaryElement.h:
286         * html/HTMLTableCaptionElement.cpp:
287         * html/HTMLTableCaptionElement.h:
288         * html/HTMLTableCellElement.cpp:
289         * html/HTMLTableCellElement.h:
290         * html/HTMLTableColElement.cpp:
291         * html/HTMLTableColElement.h:
292         * html/HTMLTableElement.cpp:
293         * html/HTMLTableElement.h:
294         * html/HTMLTablePartElement.cpp:
295         * html/HTMLTablePartElement.h:
296         * html/HTMLTableRowElement.cpp:
297         * html/HTMLTableRowElement.h:
298         * html/HTMLTableSectionElement.cpp:
299         * html/HTMLTableSectionElement.h:
300         * html/HTMLTemplateElement.cpp:
301         * html/HTMLTemplateElement.h:
302         * html/HTMLTextAreaElement.cpp:
303         * html/HTMLTextAreaElement.h:
304         * html/HTMLTextFormControlElement.cpp:
305         * html/HTMLTextFormControlElement.h:
306         * html/HTMLTimeElement.cpp:
307         * html/HTMLTimeElement.h:
308         * html/HTMLTitleElement.cpp:
309         * html/HTMLTitleElement.h:
310         * html/HTMLTrackElement.cpp:
311         * html/HTMLTrackElement.h:
312         * html/HTMLUListElement.cpp:
313         * html/HTMLUListElement.h:
314         * html/HTMLUnknownElement.cpp: Added.
315         * html/HTMLUnknownElement.h:
316         * html/HTMLWBRElement.cpp:
317         * html/HTMLWBRElement.h:
318         * html/ImageDocument.cpp:
319         * html/ImageDocument.h:
320         * html/LabelableElement.cpp:
321         * html/LabelableElement.h:
322         * html/MediaController.cpp:
323         (MediaController::create): Deleted.
324         (MediaController::MediaController): Deleted.
325         (MediaController::addMediaElement): Deleted.
326         (MediaController::removeMediaElement): Deleted.
327         (MediaController::containsMediaElement const): Deleted.
328         (MediaController::buffered const): Deleted.
329         (MediaController::seekable const): Deleted.
330         (MediaController::played): Deleted.
331         (MediaController::duration const): Deleted.
332         (MediaController::currentTime const): Deleted.
333         (MediaController::setCurrentTime): Deleted.
334         (MediaController::unpause): Deleted.
335         (MediaController::play): Deleted.
336         (MediaController::pause): Deleted.
337         (MediaController::setDefaultPlaybackRate): Deleted.
338         (MediaController::playbackRate const): Deleted.
339         (MediaController::setPlaybackRate): Deleted.
340         (MediaController::setVolume): Deleted.
341         (MediaController::setMuted): Deleted.
342         (playbackStateWaiting): Deleted.
343         (playbackStatePlaying): Deleted.
344         (playbackStateEnded): Deleted.
345         (MediaController::playbackState const): Deleted.
346         (MediaController::reportControllerState): Deleted.
347         (eventNameForReadyState): Deleted.
348         (MediaController::updateReadyState): Deleted.
349         (MediaController::updatePlaybackState): Deleted.
350         (MediaController::updateMediaElements): Deleted.
351         (MediaController::bringElementUpToSpeed): Deleted.
352         (MediaController::isBlocked const): Deleted.
353         (MediaController::hasEnded const): Deleted.
354         (MediaController::scheduleEvent): Deleted.
355         (MediaController::asyncEventTimerFired): Deleted.
356         (MediaController::clearPositionTimerFired): Deleted.
357         (MediaController::hasAudio const): Deleted.
358         (MediaController::hasVideo const): Deleted.
359         (MediaController::hasClosedCaptions const): Deleted.
360         (MediaController::setClosedCaptionsVisible): Deleted.
361         (MediaController::supportsScanning const): Deleted.
362         (MediaController::beginScrubbing): Deleted.
363         (MediaController::endScrubbing): Deleted.
364         (MediaController::beginScanning): Deleted.
365         (MediaController::endScanning): Deleted.
366         (MediaController::canPlay const): Deleted.
367         (MediaController::isLiveStream const): Deleted.
368         (MediaController::hasCurrentSrc const): Deleted.
369         (MediaController::returnToRealtime): Deleted.
370         (MediaController::startTimeupdateTimer): Deleted.
371         (MediaController::scheduleTimeupdateEvent): Deleted.
372         * html/MediaDocument.cpp:
373         * html/MediaDocument.h:
374         * html/PluginDocument.cpp:
375         * html/PluginDocument.h:
376         * html/RubyElement.cpp:
377         * html/RubyElement.h:
378         * html/RubyTextElement.cpp:
379         * html/RubyTextElement.h:
380         * html/TextDocument.cpp:
381         * html/TextDocument.h:
382         * html/shadow/AutoFillButtonElement.cpp:
383         * html/shadow/AutoFillButtonElement.h:
384         * html/shadow/DetailsMarkerControl.cpp:
385         * html/shadow/DetailsMarkerControl.h:
386         * html/shadow/ImageControlsRootElement.cpp:
387         * html/shadow/ImageControlsRootElement.h:
388         * html/shadow/MediaControlElementTypes.cpp:
389         * html/shadow/MediaControlElementTypes.h:
390         * html/shadow/MediaControlElements.cpp:
391         * html/shadow/MediaControlElements.h:
392         * html/shadow/MediaControls.cpp:
393         * html/shadow/MediaControls.h:
394         * html/shadow/ProgressShadowElement.cpp:
395         * html/shadow/ProgressShadowElement.h:
396         * html/shadow/SliderThumbElement.cpp:
397         * html/shadow/SliderThumbElement.h:
398         * html/shadow/SpinButtonElement.cpp:
399         * html/shadow/SpinButtonElement.h:
400         * html/shadow/TextControlInnerElements.cpp:
401         * html/shadow/TextControlInnerElements.h:
402         * html/shadow/YouTubeEmbedShadowElement.cpp:
403         * html/shadow/YouTubeEmbedShadowElement.h:
404         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
405         * html/shadow/mac/ImageControlsButtonElementMac.h:
406         * html/shadow/mac/ImageControlsRootElementMac.cpp:
407         * html/shadow/mac/ImageControlsRootElementMac.h:
408         * html/track/TextTrackCueGeneric.cpp:
409         * html/track/VTTCue.cpp:
410         * html/track/VTTCue.h:
411         * html/track/WebVTTElement.cpp:
412         * html/track/WebVTTElement.h:
413         * loader/SinkDocument.cpp:
414         * loader/SinkDocument.h:
415         * mathml/MathMLAnnotationElement.cpp:
416         * mathml/MathMLAnnotationElement.h:
417         * mathml/MathMLElement.cpp:
418         * mathml/MathMLElement.h:
419         * mathml/MathMLFractionElement.cpp:
420         * mathml/MathMLFractionElement.h:
421         * mathml/MathMLMathElement.cpp:
422         * mathml/MathMLMathElement.h:
423         * mathml/MathMLMencloseElement.cpp:
424         * mathml/MathMLMencloseElement.h:
425         * mathml/MathMLOperatorElement.cpp:
426         * mathml/MathMLOperatorElement.h:
427         * mathml/MathMLPaddedElement.cpp:
428         * mathml/MathMLPaddedElement.h:
429         * mathml/MathMLPresentationElement.cpp:
430         * mathml/MathMLPresentationElement.h:
431         * mathml/MathMLRootElement.cpp:
432         * mathml/MathMLRootElement.h:
433         * mathml/MathMLRowElement.cpp:
434         * mathml/MathMLRowElement.h:
435         * mathml/MathMLScriptsElement.cpp:
436         * mathml/MathMLScriptsElement.h:
437         * mathml/MathMLSelectElement.cpp:
438         * mathml/MathMLSelectElement.h:
439         * mathml/MathMLSpaceElement.cpp:
440         * mathml/MathMLSpaceElement.h:
441         * mathml/MathMLTokenElement.cpp:
442         * mathml/MathMLTokenElement.h:
443         * mathml/MathMLUnderOverElement.cpp:
444         * mathml/MathMLUnderOverElement.h:
445         * mathml/MathMLUnknownElement.cpp: Added.
446         * mathml/MathMLUnknownElement.h:
447         * svg/SVGAElement.cpp:
448         * svg/SVGAElement.h:
449         * svg/SVGAltGlyphDefElement.cpp:
450         * svg/SVGAltGlyphDefElement.h:
451         * svg/SVGAltGlyphElement.cpp:
452         * svg/SVGAltGlyphElement.h:
453         * svg/SVGAltGlyphItemElement.cpp:
454         * svg/SVGAltGlyphItemElement.h:
455         * svg/SVGAnimateColorElement.cpp:
456         * svg/SVGAnimateColorElement.h:
457         * svg/SVGAnimateElement.cpp:
458         * svg/SVGAnimateElement.h:
459         * svg/SVGAnimateElementBase.cpp:
460         * svg/SVGAnimateElementBase.h:
461         * svg/SVGAnimateMotionElement.cpp:
462         * svg/SVGAnimateMotionElement.h:
463         * svg/SVGAnimateTransformElement.cpp:
464         * svg/SVGAnimateTransformElement.h:
465         * svg/SVGAnimationElement.cpp:
466         * svg/SVGAnimationElement.h:
467         * svg/SVGCircleElement.cpp:
468         * svg/SVGCircleElement.h:
469         * svg/SVGClipPathElement.cpp:
470         * svg/SVGClipPathElement.h:
471         * svg/SVGComponentTransferFunctionElement.cpp:
472         * svg/SVGComponentTransferFunctionElement.h:
473         * svg/SVGCursorElement.cpp:
474         * svg/SVGCursorElement.h:
475         * svg/SVGDefsElement.cpp:
476         * svg/SVGDefsElement.h:
477         * svg/SVGDescElement.cpp:
478         * svg/SVGDescElement.h:
479         * svg/SVGDocument.cpp:
480         * svg/SVGDocument.h:
481         * svg/SVGElement.cpp:
482         * svg/SVGElement.h:
483         * svg/SVGEllipseElement.cpp:
484         * svg/SVGEllipseElement.h:
485         * svg/SVGFEBlendElement.cpp:
486         * svg/SVGFEBlendElement.h:
487         * svg/SVGFEColorMatrixElement.cpp:
488         * svg/SVGFEColorMatrixElement.h:
489         * svg/SVGFEComponentTransferElement.cpp:
490         * svg/SVGFEComponentTransferElement.h:
491         * svg/SVGFECompositeElement.cpp:
492         * svg/SVGFECompositeElement.h:
493         * svg/SVGFEConvolveMatrixElement.cpp:
494         * svg/SVGFEConvolveMatrixElement.h:
495         * svg/SVGFEDiffuseLightingElement.cpp:
496         * svg/SVGFEDiffuseLightingElement.h:
497         * svg/SVGFEDisplacementMapElement.cpp:
498         * svg/SVGFEDisplacementMapElement.h:
499         * svg/SVGFEDropShadowElement.cpp:
500         * svg/SVGFEDropShadowElement.h:
501         * svg/SVGFEFloodElement.cpp:
502         * svg/SVGFEFloodElement.h:
503         * svg/SVGFEGaussianBlurElement.cpp:
504         * svg/SVGFEGaussianBlurElement.h:
505         * svg/SVGFEImageElement.cpp:
506         * svg/SVGFEImageElement.h:
507         * svg/SVGFELightElement.cpp:
508         * svg/SVGFELightElement.h:
509         * svg/SVGFEMergeElement.cpp:
510         * svg/SVGFEMergeElement.h:
511         * svg/SVGFEMergeNodeElement.cpp:
512         * svg/SVGFEMergeNodeElement.h:
513         * svg/SVGFEMorphologyElement.cpp:
514         * svg/SVGFEMorphologyElement.h:
515         * svg/SVGFEOffsetElement.cpp:
516         * svg/SVGFEOffsetElement.h:
517         * svg/SVGFESpecularLightingElement.cpp:
518         * svg/SVGFESpecularLightingElement.h:
519         * svg/SVGFETileElement.cpp:
520         * svg/SVGFETileElement.h:
521         * svg/SVGFETurbulenceElement.cpp:
522         * svg/SVGFETurbulenceElement.h:
523         * svg/SVGFilterElement.cpp:
524         * svg/SVGFilterElement.h:
525         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
526         * svg/SVGFilterPrimitiveStandardAttributes.h:
527         * svg/SVGFontFaceElement.cpp:
528         * svg/SVGFontFaceElement.h:
529         * svg/SVGFontFaceFormatElement.cpp:
530         * svg/SVGFontFaceFormatElement.h:
531         * svg/SVGFontFaceNameElement.cpp:
532         * svg/SVGFontFaceNameElement.h:
533         * svg/SVGFontFaceSrcElement.cpp:
534         * svg/SVGFontFaceSrcElement.h:
535         * svg/SVGFontFaceUriElement.cpp:
536         * svg/SVGFontFaceUriElement.h:
537         * svg/SVGForeignObjectElement.cpp:
538         * svg/SVGForeignObjectElement.h:
539         * svg/SVGGElement.cpp:
540         * svg/SVGGElement.h:
541         * svg/SVGGlyphElement.cpp:
542         * svg/SVGGlyphElement.h:
543         * svg/SVGGlyphRefElement.cpp:
544         * svg/SVGGlyphRefElement.h:
545         * svg/SVGGradientElement.cpp:
546         * svg/SVGGradientElement.h:
547         * svg/SVGGraphicsElement.cpp:
548         * svg/SVGGraphicsElement.h:
549         * svg/SVGHKernElement.cpp:
550         * svg/SVGHKernElement.h:
551         * svg/SVGImageElement.cpp:
552         * svg/SVGImageElement.h:
553         * svg/SVGLineElement.cpp:
554         * svg/SVGLineElement.h:
555         * svg/SVGLinearGradientElement.cpp:
556         * svg/SVGLinearGradientElement.h:
557         * svg/SVGMPathElement.cpp:
558         * svg/SVGMPathElement.h:
559         * svg/SVGMarkerElement.cpp:
560         * svg/SVGMarkerElement.h:
561         * svg/SVGMaskElement.cpp:
562         * svg/SVGMaskElement.h:
563         * svg/SVGMetadataElement.cpp:
564         * svg/SVGMetadataElement.h:
565         * svg/SVGMissingGlyphElement.cpp:
566         * svg/SVGMissingGlyphElement.h:
567         * svg/SVGPathElement.cpp:
568         * svg/SVGPathElement.h:
569         * svg/SVGPatternElement.cpp:
570         * svg/SVGPatternElement.h:
571         * svg/SVGPolyElement.cpp:
572         * svg/SVGPolyElement.h:
573         * svg/SVGPolygonElement.cpp:
574         * svg/SVGPolygonElement.h:
575         * svg/SVGPolylineElement.cpp:
576         * svg/SVGPolylineElement.h:
577         * svg/SVGRadialGradientElement.cpp:
578         * svg/SVGRadialGradientElement.h:
579         * svg/SVGRectElement.cpp:
580         * svg/SVGRectElement.h:
581         * svg/SVGSVGElement.cpp:
582         * svg/SVGSVGElement.h:
583         * svg/SVGScriptElement.cpp:
584         * svg/SVGScriptElement.h:
585         * svg/SVGSetElement.cpp:
586         * svg/SVGSetElement.h:
587         * svg/SVGStopElement.cpp:
588         * svg/SVGStopElement.h:
589         * svg/SVGStyleElement.cpp:
590         * svg/SVGStyleElement.h:
591         * svg/SVGSwitchElement.cpp:
592         * svg/SVGSwitchElement.h:
593         * svg/SVGSymbolElement.cpp:
594         * svg/SVGSymbolElement.h:
595         * svg/SVGTRefElement.cpp:
596         * svg/SVGTRefElement.h:
597         * svg/SVGTSpanElement.cpp:
598         * svg/SVGTSpanElement.h:
599         * svg/SVGTextContentElement.cpp:
600         * svg/SVGTextContentElement.h:
601         * svg/SVGTextElement.cpp:
602         * svg/SVGTextElement.h:
603         * svg/SVGTextPathElement.cpp:
604         * svg/SVGTextPathElement.h:
605         * svg/SVGTextPositioningElement.cpp:
606         * svg/SVGTextPositioningElement.h:
607         * svg/SVGTitleElement.cpp:
608         * svg/SVGTitleElement.h:
609         * svg/SVGUnknownElement.cpp: Added.
610         * svg/SVGUnknownElement.h:
611         * svg/SVGUseElement.cpp:
612         * svg/SVGUseElement.h:
613         * svg/SVGVKernElement.cpp:
614         * svg/SVGVKernElement.h:
615         * svg/SVGViewElement.cpp:
616         * svg/SVGViewElement.h:
617         * svg/animation/SVGSMILElement.cpp:
618         * svg/animation/SVGSMILElement.h:
619
620 2018-03-16  Youenn Fablet  <youenn@apple.com>
621
622         Ensure Document::responseReceived and clearResource are called on the main thread
623         https://bugs.webkit.org/show_bug.cgi?id=183709
624
625         Reviewed by Chris Dumez.
626
627         No change of behavior.
628
629         * loader/DocumentLoader.cpp:
630         (WebCore::DocumentLoader::responseReceived):
631         (WebCore::DocumentLoader::clearMainResource):
632
633 2018-03-16  Chris Dumez  <cdumez@apple.com>
634
635         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
636         https://bugs.webkit.org/show_bug.cgi?id=183702
637
638         Reviewed by Alex Christensen.
639
640         The issue is that the test calls loadHTMLString then loadRequest right after, without
641         waiting for the first load to complete first. loadHTMLString is special as it relies
642         on substitute data and which schedules a timer to commit the data. When doing the
643         navigation policy check for the following loadRequest(), the substitute data timer
644         would fire and commit its data and load. This would in turn cancel the pending
645         navigation policy check for the loadRequest().
646
647         With sync policy delegates, this is not an issue because we take care of stopping
648         all loaders when receiving the policy decision, which happens synchronously. However,
649         when the policy decision happens asynchronously, the pending substitute data load
650         does not get cancelled in time and it gets committed.
651
652         To address the issue, this patch updates loadWithDocumentLoader() to cancel any
653         provisional load when there is an asynchronous navigation policy decision pending.
654
655         Change covered by new API test.
656
657         * loader/FrameLoader.cpp:
658         (WebCore::FrameLoader::loadWithDocumentLoader):
659
660 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
661
662         Set a trap to catch an infrequent form-related nullptr crash
663         https://bugs.webkit.org/show_bug.cgi?id=183704
664         <rdar://problem/37579354>
665
666         Reviewed by Ryosuke Niwa.
667
668         Make FormState a FrameDestructionObserver. We expect all relevant FormState objects to have been
669         cleaned up prior to the frame being destroyed. If we find such a case, we'd like to see the
670         stack trace to see what's going on.
671
672         * loader/FormState.cpp:
673         (WebCore::FormState::FormState):
674         (WebCore::FormState::willDetachPage): RELEASE_ASSERT_NOT_REACHED if we ever get here.
675         * loader/FormState.h:
676
677 2018-03-16  Joanmarie Diggs  <jdiggs@igalia.com>
678
679         AX: AccessibilityNodeObject::textForLabelElement() doesn't follow AccName calculation rules
680         https://bugs.webkit.org/show_bug.cgi?id=183661
681
682         Reviewed by Chris Fleizach.
683
684         Have AccessibilityNodeObject::textForLabelElement() return the value from
685         accessibleNameForNode() instead of innerText(). The former falls back on
686         the latter if there is no author-provided accessible name.
687
688         Tests: accessibility/aria-label-on-label-element.html
689                accessibility/label-with-pseudo-elements.html
690
691         * accessibility/AccessibilityNodeObject.cpp:
692         (WebCore::AccessibilityNodeObject::textForLabelElement const):
693         (WebCore::AccessibilityNodeObject::titleElementText const):
694
695 2018-03-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
696
697         [Curl] Fix crash on websocket with bad handshake message.
698         https://bugs.webkit.org/show_bug.cgi?id=183686
699
700         Reviewed by Youenn Fablet.
701
702         The closing cleanup was called multiple times. Add flag to detect
703         it is already closed or not.
704
705         No new tests because it is covered by existing test:
706         - LayoutTests/http/tests/websocket/tests/hybi/bad-handshake-crash.html
707
708         * platform/network/curl/SocketStreamHandleImpl.h:
709         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
710         (WebCore::SocketStreamHandleImpl::platformClose):
711         (WebCore::SocketStreamHandleImpl::didReceiveData):
712
713 2018-03-16  Jer Noble  <jer.noble@apple.com>
714
715         Make Fullscreen API an Experimental Feature
716         https://bugs.webkit.org/show_bug.cgi?id=183662
717
718         Reviewed by Jon Lee.
719
720         The Fullscreen APIs should be guarded by a Setting, so they are not present in the DOM when the
721         Experimental Feature is disabled.
722
723         * dom/Document.idl:
724         * dom/Element.idl:
725
726 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
727
728         Ensure that style is updated when the effective appearance changes
729         https://bugs.webkit.org/show_bug.cgi?id=183690
730         <rdar://problem/38385900>
731
732         Reviewed by Tim Horton and Wenson Hsieh.
733
734         Only exposing a function to outside WebCore, no tests needed.
735
736         * page/Page.h:
737
738 2018-03-16  Chris Dumez  <cdumez@apple.com>
739
740         WebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing with async policy delegates
741         https://bugs.webkit.org/show_bug.cgi?id=183679
742
743         Reviewed by Alex Christensen.
744
745         Update CachedRawResource::didAddClient() to not send data until we've received
746         the policy decision for the response.
747
748         No new tests, covered by new API test.
749
750         * loader/DocumentLoader.cpp:
751         (WebCore::DocumentLoader::handleSubstituteDataLoadNow):
752         (WebCore::DocumentLoader::responseReceived):
753         * loader/DocumentLoader.h:
754         * loader/DocumentThreadableLoader.cpp:
755         (WebCore::DocumentThreadableLoader::responseReceived):
756         * loader/DocumentThreadableLoader.h:
757         * loader/MediaResourceLoader.cpp:
758         (WebCore::MediaResource::responseReceived):
759         * loader/MediaResourceLoader.h:
760         * loader/appcache/ApplicationCacheResourceLoader.cpp:
761         (WebCore::ApplicationCacheResourceLoader::responseReceived):
762         * loader/appcache/ApplicationCacheResourceLoader.h:
763         * loader/cache/CachedRawResource.cpp:
764         (WebCore::CachedRawResource::didAddClient):
765         (WebCore::CachedRawResource::responseReceived):
766         * loader/cache/CachedRawResourceClient.h:
767         (WebCore::CachedRawResourceClient::responseReceived):
768         * loader/cache/KeepaliveRequestTracker.cpp:
769         (WebCore::KeepaliveRequestTracker::responseReceived):
770         * loader/cache/KeepaliveRequestTracker.h:
771         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
772         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
773         (WebCore::WebCoreAVFResourceLoader::responseReceived):
774
775 2018-03-16  Youenn Fablet  <youenn@apple.com>
776
777         Name Service Worker threads differently from regular Worker threads
778         https://bugs.webkit.org/show_bug.cgi?id=183698
779
780         Reviewed by Chris Dumez.
781
782         No observable change of behavior.
783         For debugging purposes, knowing that a thread is a service worker thread might help give context.
784         It might also identify on a crash log whether the process is a service worker process or a regular web process.
785
786         * workers/WorkerThread.cpp:
787         (WebCore::WorkerThread::start):
788         * workers/WorkerThread.h:
789         (WebCore::WorkerThread::isServiceWorkerThread const):
790         * workers/service/context/ServiceWorkerThread.h:
791
792 2018-03-16  Youenn Fablet  <youenn@apple.com>
793
794         IceCandidates leak on webrtc/datachannel/basic.html and other tests
795         https://bugs.webkit.org/show_bug.cgi?id=183676
796         <rdar://problem/36116228>
797
798         Reviewed by Eric Carlson.
799
800         Covered by manual testing using --leaks option on WK1.
801         WebKit should not release the candidates since libwebrtc is not taking ownership.
802
803         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
804         (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
805         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
806
807 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
808
809         [Nicosia] Add Cairo-specific GraphicsContext operation recorder
810         https://bugs.webkit.org/show_bug.cgi?id=183593
811
812         Reviewed by Carlos Garcia Campos.
813
814         Add Nicosia::CairoOperationRecorder, GraphicsContextImpl implementation
815         that records all GraphicsContext operations for deferred replay on a
816         different thread. Recording here mostly consists of storing all the
817         Cairo resources in a thread-safe manner, which is eased by the atomic
818         reference counting used in Cairo.
819
820         Nicosia::PaintingOperation derivatives are used for operations or state
821         updates that require recording. Instances of these classes are appended
822         to a Vector<> object that is then pushed into a thread pool in
823         Nicosia::PaintingEngineThreaded , replaying all the operations against
824         the Cairo context established from an associated target Nicosia::Buffer.
825
826         This GraphicsContextImpl implementation is now used in the
827         PaintingContextCairo::ForRecording constructor to construct the
828         GraphicsContext implementation that will be used for recording.
829
830         * platform/TextureMapper.cmake:
831         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: Added.
832         (Nicosia::getContext):
833         (Nicosia::OperationData::arg const const):
834         (Nicosia::createCommand):
835         (Nicosia::CairoOperationRecorder::CairoOperationRecorder):
836         (Nicosia::m_commandList):
837         (Nicosia::CairoOperationRecorder::updateState):
838         (Nicosia::CairoOperationRecorder::clearShadow):
839         (Nicosia::CairoOperationRecorder::setLineCap):
840         (Nicosia::CairoOperationRecorder::setLineDash):
841         (Nicosia::CairoOperationRecorder::setLineJoin):
842         (Nicosia::CairoOperationRecorder::setMiterLimit):
843         (Nicosia::CairoOperationRecorder::fillRect):
844         (Nicosia::CairoOperationRecorder::fillRoundedRect):
845         (Nicosia::CairoOperationRecorder::fillRectWithRoundedHole):
846         (Nicosia::CairoOperationRecorder::fillPath):
847         (Nicosia::CairoOperationRecorder::fillEllipse):
848         (Nicosia::CairoOperationRecorder::strokeRect):
849         (Nicosia::CairoOperationRecorder::strokePath):
850         (Nicosia::CairoOperationRecorder::strokeEllipse):
851         (Nicosia::CairoOperationRecorder::clearRect):
852         (Nicosia::CairoOperationRecorder::drawGlyphs):
853         (Nicosia::CairoOperationRecorder::drawImage):
854         (Nicosia::CairoOperationRecorder::drawTiledImage):
855         (Nicosia::CairoOperationRecorder::drawNativeImage):
856         (Nicosia::CairoOperationRecorder::drawPattern):
857         (Nicosia::CairoOperationRecorder::drawRect):
858         (Nicosia::CairoOperationRecorder::drawLine):
859         (Nicosia::CairoOperationRecorder::drawLinesForText):
860         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
861         (Nicosia::CairoOperationRecorder::drawEllipse):
862         (Nicosia::CairoOperationRecorder::drawPath):
863         (Nicosia::CairoOperationRecorder::drawFocusRing):
864         (Nicosia::CairoOperationRecorder::save):
865         (Nicosia::CairoOperationRecorder::restore):
866         (Nicosia::CairoOperationRecorder::translate):
867         (Nicosia::CairoOperationRecorder::rotate):
868         (Nicosia::CairoOperationRecorder::scale):
869         (Nicosia::CairoOperationRecorder::concatCTM):
870         (Nicosia::CairoOperationRecorder::setCTM):
871         (Nicosia::CairoOperationRecorder::getCTM):
872         (Nicosia::CairoOperationRecorder::beginTransparencyLayer):
873         (Nicosia::CairoOperationRecorder::endTransparencyLayer):
874         (Nicosia::CairoOperationRecorder::clip):
875         (Nicosia::CairoOperationRecorder::clipOut):
876         (Nicosia::CairoOperationRecorder::clipPath):
877         (Nicosia::CairoOperationRecorder::clipBounds):
878         (Nicosia::CairoOperationRecorder::applyDeviceScaleFactor):
879         (Nicosia::CairoOperationRecorder::roundToDevicePixels):
880         (Nicosia::CairoOperationRecorder::append):
881         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: Added.
882         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
883         (Nicosia::PaintingContextCairo::ForRecording::ForRecording):
884
885 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
886
887         [TexMap] Clean up TextureMapperLayer constructor
888         https://bugs.webkit.org/show_bug.cgi?id=183634
889
890         Reviewed by Michael Catanzaro.
891
892         In the TextureMapperLayer header, only declare the constructor, and move
893         all the previous member initialization to the point of declaration of
894         these member variables.
895
896         In the TextureMapperLayer implementation file, the constructor and
897         destructor are moved into proper order at the top of the file. The
898         former is defaulted, and the latter remains unchanged.
899
900         No change in behavior.
901
902         * platform/graphics/texmap/TextureMapperLayer.cpp:
903         (WebCore::TextureMapperLayer::~TextureMapperLayer):
904         * platform/graphics/texmap/TextureMapperLayer.h:
905
906 2018-03-16  Miguel Gomez  <magomez@igalia.com>
907
908         [GTK] When using EGL, request an OpenGL core profile when possible
909         https://bugs.webkit.org/show_bug.cgi?id=178719
910
911         Reviewed by Carlos Garcia Campos.
912
913         When using EGL and OpenGL, try to request a context with version >= 3.2 with a core profile
914         whenever possible. In order to to this, we require EGL version 1.5 or version 1.4 with the
915         extension EGL_KHR_create_context. If EGL requirements are not met, or we cannot get a
916         context with version >= 3.2 then use whatever EGL gives us.
917
918         Covered by existent tests.
919
920         * platform/graphics/egl/GLContextEGL.cpp:
921         (WebCore::GLContextEGL::createWindowContext):
922         (WebCore::GLContextEGL::createPbufferContext):
923         (WebCore::GLContextEGL::createSurfacelessContext):
924         (WebCore::GLContextEGL::createContextForEGLVersion):
925         * platform/graphics/egl/GLContextEGL.h:
926         * platform/graphics/egl/GLContextEGLWPE.cpp:
927         (WebCore::GLContextEGL::createWPEContext):
928         * platform/graphics/egl/GLContextEGLWayland.cpp:
929         (WebCore::GLContextEGL::createWaylandContext):
930         * platform/graphics/egl/GLContextEGLX11.cpp:
931         (WebCore::GLContextEGL::createPixmapContext):
932
933 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
934
935         [TexMap] Don't use the TextureMapperAnimation::Client interface to apply animation
936         https://bugs.webkit.org/show_bug.cgi?id=183656
937
938         Reviewed by Carlos Garcia Campos.
939
940         Don't have the TextureMapperLayer class inherit from the
941         TextureMapperAnimation::Client interface just for the purposes of
942         synchronization of animation-affected attributes in syncAnimations().
943         For that purpose it's enough to provide a struct that is passed to that
944         method, and with the TextureMapperAnimation class filling out any of the
945         animated attributes that need to be updated.
946
947         TextureMapperAnimation::ApplicationResult struct is introducted for that
948         purpose. std::optional<> members in it are assigned values during the
949         application process, if an appropriate animation affects them. The
950         relevant member values in TextureMapperLayer are then updated, or value
951         from the default state is used.
952
953         TextureMapperAnimation::Client is removed.
954
955         No new tests -- no change in behavior.
956
957         * platform/graphics/texmap/TextureMapperAnimation.cpp:
958         (WebCore::TextureMapperAnimation::apply):
959         (WebCore::TextureMapperAnimation::applyInternal):
960         (WebCore::TextureMapperAnimations::apply):
961         * platform/graphics/texmap/TextureMapperAnimation.h:
962         * platform/graphics/texmap/TextureMapperLayer.cpp:
963         (WebCore::TextureMapperLayer::syncAnimations):
964         (WebCore::TextureMapperLayer::setAnimatedTransform): Deleted.
965         (WebCore::TextureMapperLayer::setAnimatedOpacity): Deleted.
966         (WebCore::TextureMapperLayer::setAnimatedFilters): Deleted.
967         * platform/graphics/texmap/TextureMapperLayer.h:
968
969 2018-03-16  Devin Rousso  <webkit@devinrousso.com>
970
971         Web Inspector: Canvas Tab: main WebGL canvas on acko.net has no reported size
972         https://bugs.webkit.org/show_bug.cgi?id=178798
973         <rdar://problem/35175740>
974
975         Reviewed by Brian Burg.
976
977         When the main frame navigates, the DOMAgent would recieve two InspectorInstrumentation calls,
978         one when the frame begins its navigation and the other when the document for that frame has
979         loaded. Both of these would discard the DOMAgent's bindings, which included the map of
980         `nodeId`s. This was an issue for canvases, as the frontend would be notified whenever any
981         canvas is created, which would usually occur before the `DOMContentLoaded` event is fired.
982         As a result, the canvases would attempt to retrieve their associated node, only to have the
983         DOMAgent discard those bindings quickly thereafter.
984
985         This patch removes DOMAgent's and DOMDebuggerAgent's (parity) instrumentation hooks for the
986         latter event, ensuring that the bindings are only discarded once.
987
988         * inspector/agents/InspectorDOMAgent.h:
989         * inspector/agents/InspectorDOMAgent.cpp:
990         (WebCore::InspectorDOMAgent::mainFrameDOMContentLoaded): Deleted.
991
992         * inspector/agents/InspectorDOMDebuggerAgent.h:
993         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
994         (WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Added.
995         (WebCore::InspectorDOMDebuggerAgent::mainFrameDOMContentLoaded): Deleted.
996
997         * inspector/InspectorInstrumentation.cpp:
998         (WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl):
999         (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
1000
1001 2018-03-15  Tim Horton  <timothy_horton@apple.com>
1002
1003         Include CADisplayLink explicitly where needed, instead of all of CA
1004         https://bugs.webkit.org/show_bug.cgi?id=183689
1005         <rdar://problem/38528719>
1006
1007         Reviewed by Wenson Hsieh.
1008
1009         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
1010
1011 2018-03-15  Tim Horton  <timothy_horton@apple.com>
1012
1013         Include MobileCoreServices in the WebCore prefix header
1014         https://bugs.webkit.org/show_bug.cgi?id=183688
1015         <rdar://problem/38527621>
1016
1017         Reviewed by Dan Bernstein.
1018
1019         * WebCorePrefix.h:
1020
1021 2018-03-15  Megan Gardner  <megan_gardner@apple.com>
1022
1023         Create MediaQueryParserContext to provide additional context for the evaluation of media queries
1024         https://bugs.webkit.org/show_bug.cgi?id=183677
1025
1026         Reviewed by Tim Horton.
1027
1028         We need additional context for parsing media queries to make sure they are parsed correctly and valid.
1029
1030         Not currently testable, will add tests in a later patch.
1031
1032         * WebCore.xcodeproj/project.pbxproj:
1033         * css/MediaList.cpp:
1034         (WebCore::MediaQuerySet::create):
1035         (WebCore::MediaQuerySet::set):
1036         (WebCore::MediaQuerySet::add):
1037         (WebCore::MediaQuerySet::remove):
1038         * css/MediaList.h:
1039         * css/MediaQueryEvaluator.cpp:
1040         (WebCore::MediaQueryEvaluator::mediaAttributeMatches):
1041         * css/MediaQueryExpression.cpp:
1042         (WebCore::featureWithValidIdent):
1043         (WebCore::featureWithValidDensity):
1044         (WebCore::featureWithValidPositiveLength):
1045         (WebCore::featureWithPositiveInteger):
1046         (WebCore::featureWithPositiveNumber):
1047         (WebCore::featureWithZeroOrOne):
1048         (WebCore::isFeatureValidWithoutValue):
1049         (WebCore::MediaQueryExpression::MediaQueryExpression):
1050         * css/MediaQueryExpression.h:
1051         * css/MediaQueryMatcher.cpp:
1052         (WebCore::MediaQueryMatcher::matchMedia):
1053         * css/MediaQueryParserContext.cpp: Added.
1054         (WebCore::MediaQueryParserContext::MediaQueryParserContext):
1055         * css/MediaQueryParserContext.h: Added.
1056         (WebCore::MediaQueryParserContext::MediaQueryParserContext):
1057         * css/StyleMedia.cpp:
1058         (WebCore::StyleMedia::matchMedium const):
1059         * css/StyleRuleImport.cpp:
1060         (WebCore::StyleRuleImport::StyleRuleImport):
1061         (WebCore::StyleRuleImport::setCSSStyleSheet):
1062         * css/parser/CSSParser.cpp:
1063         (WebCore::CSSParserContext::CSSParserContext):
1064         (WebCore::operator==):
1065         * css/parser/CSSParserImpl.cpp:
1066         (WebCore::CSSParserImpl::consumeImportRule):
1067         (WebCore::CSSParserImpl::consumeMediaRule):
1068         * css/parser/MediaQueryParser.cpp:
1069         (WebCore::MediaQueryParser::parseMediaQuerySet):
1070         (WebCore::MediaQueryParser::parseMediaCondition):
1071         (WebCore::MediaQueryParser::MediaQueryParser):
1072         (WebCore::MediaQueryData::addExpression):
1073         * css/parser/MediaQueryParser.h:
1074         (WebCore::MediaQueryData::setMediaQueryParserContext):
1075         * css/parser/SizesAttributeParser.cpp:
1076         (WebCore::SizesAttributeParser::parse):
1077         * dom/DOMImplementation.cpp:
1078         (WebCore::DOMImplementation::createCSSStyleSheet):
1079         * dom/InlineStyleSheetOwner.cpp:
1080         (WebCore::InlineStyleSheetOwner::createSheet):
1081         * dom/ProcessingInstruction.cpp:
1082         (WebCore::ProcessingInstruction::setCSSStyleSheet):
1083         * html/HTMLImageElement.cpp:
1084         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1085         * html/HTMLLinkElement.cpp:
1086         (WebCore::HTMLLinkElement::process):
1087         (WebCore::HTMLLinkElement::initializeStyleSheet):
1088         (WebCore::HTMLLinkElement::setCSSStyleSheet):
1089         * html/HTMLLinkElement.h:
1090         * html/HTMLMediaElement.cpp:
1091         (WebCore::HTMLMediaElement::selectNextSourceChild):
1092         * html/HTMLSourceElement.cpp:
1093         (WebCore::HTMLSourceElement::parsedMediaAttribute const):
1094         * html/HTMLSourceElement.h:
1095         * html/HTMLStyleElement.cpp:
1096         (WebCore::HTMLStyleElement::parseAttribute):
1097         * html/parser/HTMLPreloadScanner.cpp:
1098         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1099
1100 2018-03-15  Commit Queue  <commit-queue@webkit.org>
1101
1102         Unreviewed, rolling out r229639.
1103         https://bugs.webkit.org/show_bug.cgi?id=183683
1104
1105         it is causing a crash in API tests (Requested by youenn on
1106         #webkit).
1107
1108         Reverted changeset:
1109
1110         "ActiveDOMObject should assert that they are destroyed in the
1111         thread they are created"
1112         https://bugs.webkit.org/show_bug.cgi?id=183671
1113         https://trac.webkit.org/changeset/229639
1114
1115 2018-03-15  Youenn Fablet  <youenn@apple.com>
1116
1117         Bad configuration parameters should make RTCPeerConnection constructor throw
1118         https://bugs.webkit.org/show_bug.cgi?id=183615
1119
1120         Reviewed by Eric Carlson.
1121
1122         Implement more of https://w3c.github.io/webrtc-pc/#set-pc-configuration.
1123         Throw an error whenever underlying libwebrtc set configuration fails.
1124
1125         Covered by rebased test.
1126
1127         * Modules/mediastream/PeerConnectionBackend.h:
1128         * Modules/mediastream/RTCPeerConnection.cpp:
1129         (WebCore::iceServersFromConfiguration):
1130         (WebCore::RTCPeerConnection::initializeConfiguration):
1131         (WebCore::RTCPeerConnection::setConfiguration):
1132         * Modules/mediastream/RTCPeerConnection.js:
1133         (initializeRTCPeerConnection):
1134         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1135
1136 2018-03-15  Youenn Fablet  <youenn@apple.com>
1137
1138         replaceTrack triggers negotiationneeded
1139         https://bugs.webkit.org/show_bug.cgi?id=180342
1140         <rdar://problem/35822426>
1141
1142         Reviewed by Eric Carlson.
1143
1144         Covered by updated test.
1145         Fix the case of replacing a track for which data is already flowing.
1146         We should probably do the same for null tracks when fully implementing transceivers.
1147
1148         * Modules/mediastream/RTCPeerConnection.cpp:
1149         (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
1150
1151 2018-03-15  Keith Rollin  <krollin@apple.com>
1152
1153         Telemetry for stalled webpage loads
1154         https://bugs.webkit.org/show_bug.cgi?id=183221
1155         <rdar://problem/36549013>
1156
1157         Reviewed by Chris Dumez.
1158
1159         Add telemetry for page loads, tracking the pages that succeed, fail,
1160         or are canceled. This information will be used to track the overall
1161         health of our page loading as time goes on.
1162
1163         No new tests -- no new/changed user-level functionality.
1164
1165         * page/DiagnosticLoggingKeys.cpp:
1166         (WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
1167         (WebCore::DiagnosticLoggingKeys::timedOutKey):
1168         (WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
1169         (WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
1170         (WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
1171         (WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
1172         (WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
1173         (WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
1174         (WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
1175         (WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
1176         (WebCore::DiagnosticLoggingKeys::occurredKey):
1177         (WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
1178         (WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
1179         (WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
1180         (WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
1181         * page/DiagnosticLoggingKeys.h:
1182         * platform/network/cf/ResourceError.h:
1183         (WebCore::ResourceError::ResourceError):
1184         * platform/network/mac/ResourceErrorMac.mm:
1185         (WebCore::ResourceError::ResourceError):
1186         (WebCore::ResourceError::getNSURLErrorDomain const):
1187         (WebCore::ResourceError::getCFErrorDomainCFNetwork const):
1188         (WebCore::ResourceError::mapPlatformError):
1189
1190 2018-03-15  Youenn Fablet  <youenn@apple.com>
1191
1192         ActiveDOMObject should assert that they are destroyed in the thread they are created
1193         https://bugs.webkit.org/show_bug.cgi?id=183671
1194
1195         Reviewed by Chris Dumez.
1196
1197         No change of behavior.
1198         Moved MessagePort assertion to ActiveDOMObject.
1199
1200         * dom/ActiveDOMObject.cpp:
1201         (WebCore::ActiveDOMObject::~ActiveDOMObject):
1202         * dom/ActiveDOMObject.h:
1203         * dom/MessagePort.cpp:
1204         (WebCore::MessagePort::~MessagePort):
1205         * dom/MessagePort.h:
1206
1207 2018-03-15  Youenn Fablet  <youenn@apple.com>
1208
1209         MessagePort is not always destroyed on the right thread
1210         https://bugs.webkit.org/show_bug.cgi?id=183619
1211         <rdar://problem/38204711>
1212
1213         Reviewed by Chris Dumez.
1214
1215         Add assertion to ensure MessagePort is destroyed in the right thread.
1216         Modify methods taking a ref in a lambda to rely on weak pointers and refing the WorkerThread if in a worker context.
1217         It is safe to ref the WorkerThread since it is thread safe ref counted and we are passing the ref to the main thread
1218         where the WorkerThread is expected to be destroyed.
1219
1220         Test: http/tests/workers/worker-messageport-2.html
1221
1222         * dom/MessagePort.cpp:
1223         (WebCore::MessagePort::~MessagePort):
1224         (WebCore::MessagePort::dispatchMessages):
1225         (WebCore::MessagePort::updateActivity):
1226         (WebCore::MessagePort::hasPendingActivity const):
1227         * dom/MessagePort.h:
1228
1229 2018-03-15  Jer Noble  <jer.noble@apple.com>
1230
1231         Adopt new AVURLAssetUseClientURLLoadingExclusively AVURLAsset creation option.
1232         https://bugs.webkit.org/show_bug.cgi?id=183660
1233
1234         Reviewed by Jon Lee.
1235
1236         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1237         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1238
1239 2018-03-15  Chris Dumez  <cdumez@apple.com>
1240
1241         Unreviewed, fix tiny mistake in r229615 that caused API tests failures.
1242
1243         * workers/service/server/SWServer.cpp:
1244         (WebCore::SWServer::addRegistrationFromStore):
1245
1246 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
1247
1248         [TexMap] Remove TextureMapperLayer::texture()
1249         https://bugs.webkit.org/show_bug.cgi?id=183635
1250
1251         Reviewed by Michael Catanzaro.
1252
1253         Remove the unused TextureMapperLayer::texture() method. This enables
1254         removing the virtual TextureMapperBackingStore::texture() method, as
1255         well as the implementations of it in TextureMapperTiledBackingStore and
1256         CoordinatedBackingStore classes.
1257
1258         No change in behavior.
1259
1260         * platform/graphics/texmap/TextureMapperBackingStore.h:
1261         * platform/graphics/texmap/TextureMapperLayer.h:
1262         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
1263         (WebCore::TextureMapperTiledBackingStore::texture const): Deleted.
1264         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
1265
1266 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
1267
1268         [TexMap] Don't bother caching pattern transform matrix
1269         https://bugs.webkit.org/show_bug.cgi?id=183633
1270
1271         Reviewed by Michael Catanzaro.
1272
1273         Remove the m_patternTransform and m_patternTransformDirty member
1274         variables from the TextureMapperLayer class. These unnecessarily
1275         complicate the state update methods that need to compare the given
1276         attribute against the current state, and only update it if it has
1277         changed.
1278
1279         Instead, compute the pattern TransformationMatrix value on-the-fly in
1280         the paintSelf() method, if at all necessary.
1281
1282         No change in functionality.
1283
1284         * platform/graphics/texmap/TextureMapperLayer.cpp:
1285         (WebCore::TextureMapperLayer::paintSelf):
1286         (WebCore::TextureMapperLayer::setContentsRect):
1287         (WebCore::TextureMapperLayer::setContentsTileSize):
1288         (WebCore::TextureMapperLayer::setContentsTilePhase):
1289         (WebCore::TextureMapperLayer::computePatternTransformIfNeeded): Deleted.
1290         * platform/graphics/texmap/TextureMapperLayer.h:
1291
1292 2018-03-14  John Wilander  <wilander@apple.com>
1293
1294         Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
1295         https://bugs.webkit.org/show_bug.cgi?id=183641
1296         <rdar://problem/38469497>
1297
1298         Reviewed by Brent Fulgham and Chris Dumez.
1299
1300         No new tests. This change is to stabilize existing layout tests.
1301         See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.
1302
1303         * platform/network/NetworkStorageSession.h:
1304         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1305         (WebCore::NetworkStorageSession::removeAllStorageAccess):
1306             New function to clear out all storage access entries.
1307
1308 2018-03-14  Youenn Fablet  <youenn@apple.com>
1309
1310         imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.worker.html is crashing
1311         https://bugs.webkit.org/show_bug.cgi?id=183602
1312
1313         Reviewed by Chris Dumez.
1314
1315         Introduce a map of ScriptExecutionContext that is read/write protected using a Lock.
1316         This allows introducing postTaskTo taking a ScriptExecutionContext identifier and callable from any thread.
1317         Use that method in Crypto instead of refing/unrefing  the context.
1318         Lock only happens if context does some postTask activity. This is governed by calling or not the new contextIdentifier() getter.
1319
1320         Covered by crypto tests no longer failing m_workerGlobalScope->hasOneRef() assertion.
1321
1322         * crypto/CryptoAlgorithm.cpp:
1323         (WebCore::dispatchAlgorithmOperation):
1324         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
1325         (WebCore::CryptoAlgorithmECDH::deriveBits):
1326         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
1327         (WebCore::CryptoAlgorithmSHA1::digest):
1328         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
1329         (WebCore::CryptoAlgorithmSHA224::digest):
1330         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
1331         (WebCore::CryptoAlgorithmSHA256::digest):
1332         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
1333         (WebCore::CryptoAlgorithmSHA384::digest):
1334         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
1335         (WebCore::CryptoAlgorithmSHA512::digest):
1336         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1337         (WebCore::CryptoKeyRSA::generatePair):
1338         * crypto/mac/CryptoKeyRSAMac.cpp:
1339         (WebCore::CryptoKeyRSA::generatePair):
1340         * dom/Document.cpp:
1341         (WebCore::Document::~Document):
1342         * dom/ScriptExecutionContext.cpp:
1343         (WebCore::allScriptExecutionContextsMapLock):
1344         (WebCore::ScriptExecutionContext::ScriptExecutionContext):
1345         (WebCore::ScriptExecutionContext::removeFromContextsMap):
1346         (WebCore::ScriptExecutionContext::checkConsistency const):
1347         (WebCore::ScriptExecutionContext::postTaskTo):
1348         * dom/ScriptExecutionContext.h:
1349         (WebCore::ScriptExecutionContext::contextIdentifier const):
1350         * workers/WorkerGlobalScope.cpp:
1351         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
1352
1353 2018-03-14  Chris Dumez  <cdumez@apple.com>
1354
1355         Reduce use of SWServerToContextConnection::globalServerToContextConnection()
1356         https://bugs.webkit.org/show_bug.cgi?id=183626
1357
1358         Reviewed by Youenn Fablet.
1359
1360         Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving towards
1361         having multiple context connections.
1362
1363         No new tests, no expected behavior change.
1364
1365         * workers/service/server/SWServer.cpp:
1366         (WebCore::SWServer::matchAll):
1367         (WebCore::SWServer::serverToContextConnectionCreated):
1368         (WebCore::SWServer::runServiceWorkerIfNecessary):
1369         (WebCore::SWServer::runServiceWorker):
1370         (WebCore::SWServer::terminateWorkerInternal):
1371         (WebCore::SWServer::markAllWorkersAsTerminated):
1372         (WebCore::SWServer::workerContextTerminated):
1373         (WebCore::SWServer::fireInstallEvent):
1374         (WebCore::SWServer::fireActivateEvent):
1375         * workers/service/server/SWServer.h:
1376         * workers/service/server/SWServerToContextConnection.cpp:
1377         (WebCore::SWServerToContextConnection::findClientByIdentifier):
1378         (WebCore::SWServerToContextConnection::matchAll):
1379         (WebCore::SWServerToContextConnection::claim):
1380         * workers/service/server/SWServerWorker.cpp:
1381         (WebCore::SWServerWorker::contextConnection):
1382         (WebCore::SWServerWorker::matchAll):
1383         * workers/service/server/SWServerWorker.h:
1384
1385 2018-03-14  Youenn Fablet  <youenn@apple.com>
1386
1387         MessagePort should remove its listeners when being closed
1388         https://bugs.webkit.org/show_bug.cgi?id=183644
1389
1390         Reviewed by Chris Dumez.
1391
1392         Test: http/tests/workers/worker-messageport.html
1393
1394         * dom/MessagePort.cpp:
1395         (WebCore::MessagePort::close):
1396         (WebCore::MessagePort::contextDestroyed):
1397
1398 2018-03-14  Chris Dumez  <cdumez@apple.com>
1399
1400         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
1401         https://bugs.webkit.org/show_bug.cgi?id=183624
1402
1403         Reviewed by Youenn Fablet.
1404
1405         Pass in context connection to SWServer::serverToContextConnectionCreated() to avoid
1406         relying on the deprecated globalServerToContextConnection().
1407
1408         No new tests, no expected behavior change.
1409
1410         * workers/service/server/SWServer.cpp:
1411         (WebCore::SWServer::serverToContextConnectionCreated):
1412         * workers/service/server/SWServer.h:
1413
1414 2018-03-14  Mark Lam  <mark.lam@apple.com>
1415
1416         Enhance the MacroAssembler and LinkBuffer to support pointer profiling.
1417         https://bugs.webkit.org/show_bug.cgi?id=183623
1418         <rdar://problem/38443314>
1419
1420         Reviewed by Michael Saboff.
1421
1422         No new tests.  Just adding PtrTags required by new MacroAssembler API.
1423
1424         * cssjit/FunctionCall.h:
1425         (WebCore::FunctionCall::prepareAndCall):
1426         * cssjit/SelectorCompiler.cpp:
1427         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1428
1429 2018-03-14  Chris Fleizach  <cfleizach@apple.com>
1430
1431         AX: Implement accessible dismiss action on iOS
1432         https://bugs.webkit.org/show_bug.cgi?id=183352
1433         <rdar://problem/38161500>
1434
1435         Reviewed by Zalan Bujtas.
1436
1437         Test: accessibility/ios-simulator/AOM-dismiss-event.html
1438
1439         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1440         (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]):
1441
1442 2018-03-14  Youenn Fablet  <youenn@apple.com>
1443
1444         Update libwebrtc up to 36af4e9614f707f733eb2340fae66d6325aaac5b
1445         https://bugs.webkit.org/show_bug.cgi?id=183481
1446
1447         Reviewed by Eric Carlson.
1448
1449         Covered by existing tests.
1450         Updated libwebrtc binding code.
1451
1452         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1453         (WebCore::fillEncodingParameters):
1454         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
1455
1456 2018-03-14  Tim Horton  <timothy_horton@apple.com>
1457
1458         Fix the build after r229567
1459
1460         * Configurations/FeatureDefines.xcconfig:
1461
1462 2018-03-13  John Wilander  <wilander@apple.com>
1463
1464         Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
1465         https://bugs.webkit.org/show_bug.cgi?id=183620
1466         <rdar://problem/38431469>
1467
1468         Reviewed by Brent Fulgham.
1469
1470         Tests: http/tests/storageAccess/deny-storage-access-under-opener.html
1471                http/tests/storageAccess/grant-storage-access-under-opener.html
1472
1473         It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
1474         wasn't enough to address the compatibility issues with popups. Some of
1475         them just detect their unpartitioned cookies, auto-dismiss themselves,
1476         and expect their unpartitioned cookies to be available under the opener
1477         afterwards. We should grant them access if the popup's domain has had
1478         user interaction _previously_.
1479
1480         Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
1481         because if the popup's domain has not received user interaction
1482         previously, we will not grant it storage access on just the window open.
1483
1484         * dom/Document.cpp:
1485         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
1486         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
1487         (WebCore::Document::hasGrantedPageSpecificStorageAccess): Deleted.
1488         (WebCore::Document::setHasGrantedPageSpecificStorageAccess): Deleted.
1489             Renamed from *Granted* to *Requested* since there is now a case
1490             where access will not be granted, i.e. when the popup domain has
1491             not had user interaction previously.
1492         * dom/Document.h:
1493         * loader/ResourceLoadObserver.cpp:
1494         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
1495             Renamed *Grant* to *Request*.
1496         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1497         (WebCore::ResourceLoadObserver::logWindowCreation):
1498             New function called from DOMWindow::createWindow().
1499         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
1500             New convenience function.
1501         (WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback): Deleted.
1502             Renamed *Grant* to *Request*.
1503         * loader/ResourceLoadObserver.h:
1504         * page/DOMWindow.cpp:
1505         (WebCore::DOMWindow::createWindow):
1506             Now calls ResourceLoadObserver::logWindowCreation() if a window
1507             was created and the opener has a document and a page ID.
1508
1509 2018-03-13  Chris Dumez  <cdumez@apple.com>
1510
1511         fast/loader/javascript-url-iframe-remove-on-navigate.html is a flaky crash on iOS with async delegates
1512         https://bugs.webkit.org/show_bug.cgi?id=183610
1513
1514         Reviewed by Youenn Fablet.
1515
1516         The issue was that in DocumentLoader::loadMainResource(), the call to requestMainResource() which
1517         return null due to the load getting cancelled synchronously. If this load is the parent frame's last
1518         pending load, then the 'load' event gets fired in the parent frame. In the test, the parent frame's
1519         load event handler does a document.write() call which blows away the iframe. As a result, when
1520         we return from the requestMainResource(), m_frame is null and we crash later on dereferencing it.
1521
1522         No new tests, covered by fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate.html
1523         which was crashing flakily.
1524
1525         * loader/DocumentLoader.cpp:
1526         (WebCore::DocumentLoader::loadMainResource):
1527
1528 2018-03-13  Jer Noble  <jer.noble@apple.com>
1529
1530         [iOS] Muted media playback can interrupt out-of-process audio
1531         https://bugs.webkit.org/show_bug.cgi?id=183606
1532         <rdar://problem/37466253>
1533
1534         Reviewed by Eric Carlson.
1535
1536         Test: Updated TestWebKitAPI test to verify the correct AVAudioSession category is set.
1537
1538         A non-playing, non-muted media element will cause the AVAudioSession category to be set to
1539         "playing" when a muted media element begins playback. Ignore these non-playing elements for
1540         the purposes of determining the AVAudioSession category.
1541
1542         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
1543         (PlatformMediaSessionManager::updateSessionState):
1544
1545 2018-03-13  Youenn Fablet  <youenn@apple.com>
1546
1547         Calling removeTrack with RTCRtpSender does not set SenderTrack to null
1548         https://bugs.webkit.org/show_bug.cgi?id=183308
1549
1550         Reviewed by Eric Carlson.
1551
1552         Covered by updated test.
1553
1554         * Modules/mediastream/RTCRtpSender.cpp:
1555         (WebCore::RTCRtpSender::stop): Set track to null when being stopped i.e. removed.
1556         * Modules/mediastream/RTCRtpSender.h:
1557
1558 2018-03-13  Youenn Fablet  <youenn@apple.com>
1559
1560         Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
1561         https://bugs.webkit.org/show_bug.cgi?id=183601
1562         <rdar://problem/38309441>
1563
1564         Reviewed by Antti Koivisto.
1565
1566         Test: http/wpt/preload/change-link-rel-attribute.html
1567
1568         * loader/LinkPreloadResourceClients.h:
1569         (WebCore::LinkPreloadResourceClient::clearResource): Remove the call to CachedResource::cancelLoad.
1570         This call is expected to be called by ResourceLoader when cancelling the load from below CachedResource.
1571         * loader/cache/CachedResource.cpp:
1572         (WebCore::CachedResource::allClientsRemoved): In case of preload,
1573         cancel the load if not finished when there is no more client attached to it.
1574         * loader/cache/CachedResource.h:
1575
1576 2018-03-12  John Wilander  <wilander@apple.com>
1577
1578         Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
1579         https://bugs.webkit.org/show_bug.cgi?id=183577
1580         <rdar://problem/38266987>
1581
1582         Reviewed by Brent Fulgham.
1583
1584         Tested manually on live websites.
1585         No new automated tests because of a bug in WebKitTestRunner:
1586         https://bugs.webkit.org/show_bug.cgi?id=183578
1587         The event sender triggers gestures in the opener rather than
1588         in the popup.
1589
1590         * dom/Document.cpp:
1591         (WebCore::Document::removedLastRef):
1592             Clears the new m_primaryDomainsGrantedPageSpecificStorageAccess.
1593         (WebCore::Document::hasGrantedPageSpecificStorageAccess):
1594         (WebCore::Document::setHasGrantedPageSpecificStorageAccess):
1595         * dom/Document.h:
1596             Added member m_primaryDomainsGrantedPageSpecificStorageAccess
1597             where we store domains that have been granted access.
1598         * loader/ResourceLoadObserver.cpp:
1599         (WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback):
1600         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1601             Now checks if there is a cross-origin opener and if so, immediately
1602             grants cookie access to the popup's domain if it is partitioned or
1603             blocked. 
1604         * loader/ResourceLoadObserver.h:
1605         * platform/network/NetworkStorageSession.h:
1606             Added member m_pagesGrantedStorageAccess.
1607         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1608         (WebCore::NetworkStorageSession::cookieStoragePartition const):
1609         (WebCore::NetworkStorageSession::hasStorageAccess const):
1610             Renamed from hasStorageAccessForFrame since the frameID now is optional.
1611         (WebCore::NetworkStorageSession::grantStorageAccess):
1612             Renamed from grantStorageAccessForFrame since the frameID now is optional.
1613         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
1614             Now removes the pageID entry in m_pagesGrantedStorageAccess.
1615         (WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Deleted.
1616             Renamed since the frameID now is optional.
1617         (WebCore::NetworkStorageSession::grantStorageAccessForFrame): Deleted.
1618             Renamed since the frameID now is optional.
1619
1620 2018-03-12  Tim Horton  <timothy_horton@apple.com>
1621
1622         Stop using SDK conditionals to control feature definitions
1623         https://bugs.webkit.org/show_bug.cgi?id=183430
1624         <rdar://problem/38251619>
1625
1626         Reviewed by Dan Bernstein.
1627
1628         * Configurations/FeatureDefines.xcconfig:
1629         * Configurations/WebKitTargetConditionals.xcconfig: Renamed.
1630
1631 2018-03-12  Chris Dumez  <cdumez@apple.com>
1632
1633         Return boolean from DOMTokenList's replace() method
1634         https://bugs.webkit.org/show_bug.cgi?id=183567
1635
1636         Reviewed by Youenn Fablet.
1637
1638         Have DOMTokenList's replace() method return a boolean indicating if the
1639         token was replaced, as per:
1640         - https://dom.spec.whatwg.org/#dom-domtokenlist-replace
1641
1642         This is a recent addition to the DOM specification:
1643         - https://github.com/whatwg/dom/pull/582
1644
1645         No new tests, rebaselined existing test.
1646
1647         * html/DOMTokenList.cpp:
1648         (WebCore::replaceInOrderedSet):
1649         (WebCore::DOMTokenList::replace):
1650         * html/DOMTokenList.h:
1651         * html/DOMTokenList.idl:
1652
1653 2018-03-12  Brian Burg  <bburg@apple.com>
1654
1655         Ignore some deprecation warnings encountered when compiling with newer versions of ICU
1656         https://bugs.webkit.org/show_bug.cgi?id=183584
1657         <rdar://problem/38395317>
1658
1659         Reviewed by Daniel Bates.
1660
1661         Ignore new deprecation warnings. Where a function has more than one
1662         deprecation warning, mark out the entire function so it remains readable.
1663
1664         * editing/TextIterator.cpp:
1665         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
1666         (WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
1667         * platform/text/TextEncoding.cpp:
1668
1669 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
1670
1671         Runtime flag for link prefetch and remove link subresource.
1672         https://bugs.webkit.org/show_bug.cgi?id=183540
1673
1674         Reviewed by Chris Dumez.
1675
1676         This patch removes the LINK_PREFETCH build time flag, removes
1677         link subresource, adds an off-by-default runtime flag for link
1678         prefetch and makes sure link prefetch only works when this flag is on.
1679
1680         Subresource is removed as it's not a part of any spec, nor supported by any
1681         other browser. It was replaced by link preload.
1682
1683         No new tests as this is not adding any new functionality.
1684
1685         * Configurations/FeatureDefines.xcconfig: Remove the LINK_PREFETCH flag.
1686         * html/LinkRelAttribute.cpp:
1687         (WebCore::LinkRelAttribute::LinkRelAttribute): Put prefetch support behind the runtime flag.
1688         (WebCore::LinkRelAttribute::isSupported): Add prefetch.
1689         * html/LinkRelAttribute.h: Remove the LINK_PREFETCH flag.
1690         * loader/LinkLoader.cpp:
1691         (WebCore::createLinkPreloadResourceClient): Remove the LINK_PREFETCH flag.
1692         (WebCore::LinkLoader::prefetchIfNeeded): Move the prefetch code to `prefetchIfNeeded()`. Remove subresource bits.
1693         (WebCore::LinkLoader::loadLink): Call `prefetchIfNeeded()`.
1694         * loader/LinkLoader.h:
1695         * loader/ResourceLoadInfo.cpp:
1696         (WebCore::toResourceType): Remove the LINK_PREFETCH flag as well as subresource.
1697         * loader/SubresourceLoader.cpp:
1698         (WebCore::logResourceLoaded): Remove the LINK_PREFETCH flag as well as subresource.
1699         * loader/cache/CachedResource.cpp:
1700         (WebCore::CachedResource::defaultPriorityForResourceType): Remove the LINK_PREFETCH flag as well as subresource.
1701         (WebCore::CachedResource::load): Remove the LINK_PREFETCH flag.
1702         * loader/cache/CachedResource.h:
1703         (WebCore::CachedResource::ignoreForRequestCount const): Remove the LINK_PREFETCH flag as well as subresource.
1704         * loader/cache/CachedResourceLoader.cpp:
1705         (WebCore::createResource): Remove the LINK_PREFETCH flag as well as subresource.
1706         (WebCore::CachedResourceLoader::requestLinkResource): Remove subresource.
1707         (WebCore::contentTypeFromResourceType): Remove the LINK_PREFETCH flag as well as subresource.
1708         (WebCore::CachedResourceLoader::checkInsecureContent const): Remove the LINK_PREFETCH flag as well as subresource.
1709         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Remove the LINK_PREFETCH flag as well as subresource.
1710         * loader/cache/CachedResourceLoader.h:
1711         * page/RuntimeEnabledFeatures.h:
1712         (WebCore::RuntimeEnabledFeatures::setLinkPrefetchEnabled): Set the prefetch flag.
1713         (WebCore::RuntimeEnabledFeatures::linkPrefetchEnabled const): Get the prefetch flag.
1714
1715 2018-03-12  Youenn Fablet  <youenn@apple.com>
1716
1717         RTCPeerConnection's close method should update signalingState
1718         https://bugs.webkit.org/show_bug.cgi?id=174314
1719         <rdar://problem/33267977>
1720
1721         Reviewed by Eric Carlson.
1722
1723         Covered by rebased test.
1724         Add closed as signalingState enum value.
1725         Set peer connection signaling state to closed once close is called.
1726
1727         * Modules/mediastream/RTCPeerConnection.cpp:
1728         (WebCore::RTCPeerConnection::doClose):
1729         * Modules/mediastream/RTCSignalingState.idl:
1730         * platform/mediastream/RTCSignalingState.h:
1731
1732 2018-03-12  Mark Lam  <mark.lam@apple.com>
1733
1734         Make a NativeFunction into a class to support pointer profiling.
1735         https://bugs.webkit.org/show_bug.cgi?id=183573
1736         <rdar://problem/38384697>
1737
1738         Reviewed by Filip Pizlo.
1739
1740         No new tests because there's no new behavior.  Only updating bindings.
1741
1742         * bindings/scripts/CodeGeneratorJS.pm:
1743         (GenerateHashTableValueArray):
1744         * bindings/scripts/test/JS/JSMapLike.cpp:
1745         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1746         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1747         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1748         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1749         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1750         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1751         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1752         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1753         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1754         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1755         * bindings/scripts/test/JS/JSTestInterface.cpp:
1756         * bindings/scripts/test/JS/JSTestIterable.cpp:
1757         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1758         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1759         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1760         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1761         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1762         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1763         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1764         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1765         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1766         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1767         * bindings/scripts/test/JS/JSTestNode.cpp:
1768         * bindings/scripts/test/JS/JSTestObj.cpp:
1769         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1770         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1771         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1772         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1773         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1774         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1775         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1776         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1777         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1778         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1779         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1780         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1781         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1782
1783 2018-03-12  Tim Horton  <timothy_horton@apple.com>
1784
1785         Use a different SPI header for some AudioToolbox enums
1786         https://bugs.webkit.org/show_bug.cgi?id=183574
1787         <rdar://problem/38385889>
1788
1789         Reviewed by Anders Carlsson.
1790
1791         * platform/audio/ios/AudioDestinationIOS.cpp:
1792         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1793         Adjust SPI imports.
1794
1795 2018-03-12  Danyao Wang  <danyao@chromium.org>
1796
1797         Add a query and fragment exception to history API's unique origin restriction.
1798         https://bugs.webkit.org/show_bug.cgi?id=183028
1799
1800         Reviewed by Brent Fulgham.
1801
1802         Tests: http/tests/navigation/pushstate-at-unique-origin-denied.php
1803                Tools/TestWebKitAPI/Tests/WebCore/URL.cpp
1804
1805         * page/History.cpp:
1806         (WebCore::History::stateObjectAdded):
1807
1808 2018-03-12  Antti Koivisto  <antti@apple.com>
1809
1810         Don't invalidate descendants for nth pseudo classes unless needed
1811         https://bugs.webkit.org/show_bug.cgi?id=183566
1812
1813         Reviewed by Zalan Bujtas.
1814
1815         We currently invalidate the whole subtrees that may match :nth-child and similar. In many common
1816         cases we know that only the direct siblings may be affected.
1817
1818         * css/SelectorChecker.cpp:
1819         (WebCore::localContextForParent):
1820         (WebCore::SelectorChecker::matchRecursively const):
1821
1822             Track if the context matches the subject element if the selector or its siblings only.
1823
1824         (WebCore::SelectorChecker::checkOne const):
1825
1826             Use different bits of descendant and child invalidation cases.
1827
1828         * cssjit/SelectorCompiler.cpp:
1829         (WebCore::SelectorCompiler::fragmentMatchesRightmostOrAdjacentElement):
1830         (WebCore::SelectorCompiler::constructFragmentsInternal):
1831
1832             Track if the context matches the subject element if the selector or its siblings only.
1833
1834         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1835         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
1836         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
1837
1838             Use different bits of descendant and child invalidation cases.
1839
1840         * dom/Element.cpp:
1841         (WebCore::invalidateForForwardPositionalRules):
1842         (WebCore::invalidateForBackwardPositionalRules):
1843
1844             Invalidate more precisely based on the new bits.
1845
1846         (WebCore::checkForSiblingStyleChanges):
1847         (WebCore::Element::setDescendantsAffectedByForwardPositionalRules):
1848         (WebCore::Element::setDescendantsAffectedByBackwardPositionalRules):
1849         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
1850         (WebCore::Element::rareDataDescendantsAffectedByForwardPositionalRules const):
1851         (WebCore::Element::rareDataDescendantsAffectedByBackwardPositionalRules const):
1852
1853             New bits.
1854
1855         * dom/Element.h:
1856         (WebCore::Element::descendantsAffectedByForwardPositionalRules const):
1857         (WebCore::Element::descendantsAffectedByBackwardPositionalRules const):
1858         * dom/ElementRareData.h:
1859         (WebCore::ElementRareData::descendantsAffectedByForwardPositionalRules const):
1860         (WebCore::ElementRareData::setDescendantsAffectedByForwardPositionalRules):
1861         (WebCore::ElementRareData::descendantsAffectedByBackwardPositionalRules const):
1862         (WebCore::ElementRareData::setDescendantsAffectedByBackwardPositionalRules):
1863         (WebCore::ElementRareData::ElementRareData):
1864         (WebCore::ElementRareData::resetStyleRelations):
1865         * style/StyleRelations.cpp:
1866         (WebCore::Style::commitRelationsToRenderStyle):
1867         (WebCore::Style::commitRelations):
1868         * style/StyleRelations.h:
1869
1870 2018-03-12  Javier Fernandez  <jfernandez@igalia.com>
1871
1872         Remove GridLayout runtime flag
1873         https://bugs.webkit.org/show_bug.cgi?id=183484
1874
1875         Reviewed by Myles C. Maxfield.
1876
1877         The Grid Layout feature has been enabled by default for almost a
1878         year, so I think it's time to remove the runtime flag and the
1879         codepath run when the feature is disabled.
1880
1881         No new tests, because there are no changes in functionality.
1882
1883         * css/CSSComputedStyleDeclaration.cpp:
1884         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1885         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1886         * css/StyleBuilderConverter.h:
1887         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
1888         * css/parser/CSSParser.cpp:
1889         (WebCore::CSSParserContext::CSSParserContext):
1890         (WebCore::operator==):
1891         * css/parser/CSSParserFastPaths.cpp:
1892         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1893         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1894         * css/parser/CSSParserMode.h:
1895         (WebCore::CSSParserContextHash::hash):
1896         * css/parser/CSSPropertyParser.cpp:
1897         (WebCore::CSSPropertyParser::parseSingleValue):
1898         * dom/Document.cpp:
1899         * dom/Document.h:
1900         * page/RuntimeEnabledFeatures.h:
1901         * rendering/RenderFlexibleBox.cpp:
1902         (WebCore::alignmentOffset):
1903         * rendering/style/RenderStyle.cpp:
1904         * rendering/style/RenderStyle.h:
1905         (WebCore::RenderStyle::initialDefaultAlignment):
1906         * testing/InternalSettings.cpp:
1907         (WebCore::InternalSettings::Backup::Backup):
1908         (WebCore::InternalSettings::Backup::restoreTo):
1909         * testing/InternalSettings.h:
1910         * testing/InternalSettings.idl:
1911
1912 2018-03-12  Antoine Quint  <graouts@apple.com>
1913
1914         [Web Animations] Implement CSS Animations and CSS Transitions as Web Animations
1915         https://bugs.webkit.org/show_bug.cgi?id=183504
1916         <rdar://problem/38372965>
1917
1918         Reviewed by Dean Jackson and Jon Lee.
1919
1920         Tests: webanimations/css-animations.html
1921                webanimations/css-transitions.html
1922
1923         This patch implements CSS Animations and CSS Transitions as Web Animations. The main changes are:
1924
1925         * StyleTreeResolver: StyleTreeResolver now has a code path to add CSSAnimation and CSSTransition objects onto the DocumentTimeline
1926         to be picked up by the Web Animations engine. The previous CSSAnimationController code path is preserved if the runtime flag is disabled.
1927
1928         * AnimationTimeline: we add two new methods, updateCSSAnimationsForElement() and updateCSSTransitionsForElement() which are called from
1929         TreeResolver::createAnimatedElementUpdate(). These look at the AnimationList for the old and new RenderStyle objects and create, update
1930         and remove matching CSSAnimation and CSSTransition instances.
1931
1932         * DeclarativeAnimation: a new superclass to both CSSAnimation and CSSTransition which introduces the concept of a backingAnimation(),
1933         which is an Animation held by the RenderStyle objects, and two virtual methods with base implementations, initialize() which is called
1934         upon creating by create() methods in subclasses, and syncPropertiesWithBackingAnimation() which ensures that properties on the
1935         DeclarativeAnimation objects (Web Animations side) match the backing animation (CSS side).
1936
1937         * KeyframeEffectReadOnly: two new important methods to create blending keyframes (KeyframeList) based on backing Animation objects,
1938         computeCSSAnimationBlendingKeyframes() and computeCSSTransitionBlendingKeyframes().
1939
1940         * Sources.txt:
1941         * WebCore.xcodeproj/project.pbxproj:
1942         * animation/AnimationEffectReadOnly.h:
1943         (WebCore::AnimationEffectReadOnly::isKeyframeEffectReadOnly const): We fix this method such that calling it on a KeyframeEffect, which
1944         is a subclass of KeyframeEffectReadOnly, returns true.
1945         * animation/AnimationEffectTimingReadOnly.cpp: In order for DeclarativeAnimation::syncPropertiesWithBackingAnimation() to set the timing
1946         function for a declarative animation's effect, we need a public method to set an effect's timing function outside of just the "easing"
1947         property setter exposed via the JS API. So we introduce a setTimingFunction() method and call it from setEasing().
1948         (WebCore::AnimationEffectTimingReadOnly::setEasing):
1949         (WebCore::AnimationEffectTimingReadOnly::setTimingFunction):
1950         * animation/AnimationEffectTimingReadOnly.h:
1951         * animation/AnimationTimeline.cpp:
1952         (WebCore::AnimationTimeline::~AnimationTimeline): Clear all maps and sets containing WebAnimation references to ensure these get destructed
1953         when the AnimationTimeline is being destructed and should no longer hold a reference to them.
1954         (WebCore::AnimationTimeline::relevantMapForAnimation): We store various subclasses of WebAnimation in dedicated maps so we can composite
1955         animations in the correct order when animating. This function returns the correct map for a given animation such that animationWasAddedToElement()
1956         and animationWasRemovedFromElement() mutate the right map.
1957         (WebCore::AnimationTimeline::animationWasAddedToElement):
1958         (WebCore::AnimationTimeline::animationWasRemovedFromElement):
1959         (WebCore::AnimationTimeline::animationsForElement): Make sure to look for animations in the lists of CSS Animations and CSS Transitions as well
1960         as Web Animations.
1961         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): This method is called by TreeResolver::createAnimatedElementUpdate() during style
1962         resolution. It compares the AnimationList of the previous style and the new style for a given element, checks that animations with a given name
1963         that were not present in the old AnimationList have a new matching CSSAnimation object for them added to the AnimationTimeline, that animations
1964         with a given name that are no longer present in the new AnimationList have their matching CSSAnimation object removed from the AnimationTimeline,
1965         and that animations with a given name that are present in both the old and new AnimationList have their matching CSSAnimation updated to match
1966         the current state of the animation in the AnimationList.
1967         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Similarly to updateCSSAnimationsForElement(), this method is called during style
1968         resolution by TreeResolver::createAnimatedElementUpdate(). Its role is to create or remove CSSTransition objects based on the AnimationList found
1969         in the old and new styles for a given element. It follows a slightly different logic than updateCSSAnimationsForElement() since for CSS Transitions,
1970         there is no need to update CSSTransition objects for a CSS property existing in both the old and new AnimationList, since when a CSS transitions
1971         property is changed, a whole new transition is initiated. However, it's important to check that different Animation objects and styles would actually
1972         result in different timing properties and blending keyframes, so check for this as well before creating new CSSTransition objects.
1973         * animation/AnimationTimeline.h:
1974         (WebCore::AnimationTimeline::animations const): Change the m_animations type from HashSet to ListHashSet to guarantee we preserve the insertion order which is
1975         required by getAnimations().
1976         (WebCore::AnimationTimeline::hasElementAnimations const): Indicates to DocumentTimeline::updateAnimations() that there are animations targeting the provided element.
1977         (WebCore::AnimationTimeline::elementToAnimationsMap):
1978         (WebCore::AnimationTimeline::elementToCSSAnimationsMap):
1979         (WebCore::AnimationTimeline::elementToCSSTransitionsMap):
1980         * animation/CSSAnimation.cpp: CSSAnimation is now a subclass of DeclarativeAnimation and subclasses initialize() and syncPropertiesWithBackingAnimation()
1981         to perform work specific to CSS Animations.
1982         (WebCore::CSSAnimation::create): Set the animationName property based on the provided backing animation.
1983         (WebCore::CSSAnimation::CSSAnimation):
1984         (WebCore::CSSAnimation::initialize): Create the blending keyframes for this CSSAnimation.
1985         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Reflect the animation-fill-mode, animation-direction, animation-iteration-count and
1986         animation-play-state CSS properties on the AnimationEffectTimingReadOnly object associated with this CSSAnimation.
1987         * animation/CSSAnimation.h:
1988         * animation/CSSTransition.cpp: CSSTransition is now a subclass of DeclarativeAnimation.
1989         (WebCore::CSSTransition::create): Set the transitionProperty property based on the provided backing animation.
1990         (WebCore::CSSTransition::CSSTransition):
1991         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const):
1992         (WebCore::CSSTransition::canBeListed const): Subclass this method such that we also check that we have blending keyframes for a CSSTransition to be
1993         listed by calls to getAnimations().
1994         * animation/CSSTransition.h:
1995         * animation/DeclarativeAnimation.cpp: Added. This new WebAnimation subclass now is the common base class for both CSSAnimation and CSSTransition.
1996         It establishes a relationship with a "backing animation", which is an Animation obtained from a style's AnimationList while resolving styles.
1997         These backing animations contain all of the parsed CSS styles related to CSS Animations and CSS Transitions and we use those to set matching properties
1998         of the Web Animations timing model in the new syncPropertiesWithBackingAnimation() virtual method, which subclasses can override to perform further
1999         work that is specific to a given declarative animation type. The initialize() method is called during create() methods to perform common animation
2000         setup work. Note that while both initialize() and syncPropertiesWithBackingAnimation() are called, we suspend invalidation to that animation's effect
2001         since these methods are meant to be called during style invalidation and we would hit an assertion if we followed the usual route of calling
2002         updateStyleIfNeeded() on the target's document during invalidation.
2003         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
2004         (WebCore::DeclarativeAnimation::setBackingAnimation):
2005         (WebCore::DeclarativeAnimation::initialize): Create a KeyframeEffectReadOnly for this animation and set the provided element as its target, set that
2006         element's document's timeline and play the animation if the backing animation's play state is playing.
2007         (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): Reflect the {animation|transition}-delay, {animation|transition}-duration and
2008         {animation|transition}-timing-function properties as set on the backing animation.
2009         * animation/DeclarativeAnimation.h: Added.
2010         (WebCore::DeclarativeAnimation::backingAnimation const):
2011         * animation/DocumentTimeline.cpp:
2012         (WebCore::DocumentTimeline::updateAnimations): Trigger style invalidation for elements targeted not just by WebAnimation instances, but also by any
2013         of the DeclarativeAnimation subclasses. We also remove the call to updateFinishedState() which should have been removed when we implemented correct
2014         support for asynchronous WebAnimation operations.
2015         (WebCore::DocumentTimeline::animatedStyleForRenderer): Declarative animations are backed by KeyframeEffectReadOnly effects, so make sure we check
2016         for KeyframeEffectReadOnly or one of its subclasses and not just KeyframeEffect since there now are animation types that use the ReadOnly variant.
2017         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Same as for animatedStyleForRenderer, check for KeyframeEffectReadOnly
2018         and not simply KeyframeEffect.
2019         * animation/KeyframeEffectReadOnly.cpp:
2020         (WebCore::invalidateElement): Stop forcing a style resolution as we invalidate element, marking them as dirty is sufficient. Calls to getAnimations()
2021         already force a style resolution as needed.
2022         (WebCore::KeyframeEffectReadOnly::create): Add a new create() method that only provides a target and which is used by DeclarativeAnimation::initialize().
2023         (WebCore::KeyframeEffectReadOnly::getKeyframes): The previous implementation of getKeyframes() used the ParsedKeyframe list held as m_parsedKeyframes
2024         to compute keyframes. In the case of declarative animations, there are no ParsedKeyframe since the JS API was not involved, so we use the blending keyframes
2025         to look for keyframe data.
2026         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Called by CSSAnimation::initialize(), this function creates blending keyframes by
2027         looking up the keyframes date obtained from the @keyframes rule with this backing animation's name.
2028         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Called by CSSTransition::create(), this function creates blending keyframes by
2029         creating a 0-offset keyframe with the old style and a 1-offset keyframe with the new style as provided during TreeResolver::createAnimatedElementUpdate().
2030         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Called by AnimationTimeline::updateCSSTransitionsForElement()
2031         to check that a provided backing Animation and a pair of old and new RenderStyles that may be different objects actually would yield different timing
2032         properties and keyframe CSS values for a given CSS transition to avoid the deletion and creation of CSSTransition objects.
2033         (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): We mistakenly assumed we always had blending keyframes, which is not always the case with a
2034         CSSTransition where the transition style itself might be set first, but the target value after. So we should only run accelerated provided there are blending
2035         keyframes at least, the function already returning false if it finds a blending keyframe animating a non-accelerated CSS property.
2036         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Check that there actually is a matching ParsedKeyframe to read the timing function from.
2037         * animation/KeyframeEffectReadOnly.h:
2038         (WebCore::KeyframeEffectReadOnly::hasBlendingKeyframes const):
2039         * animation/WebAnimation.cpp:
2040         (WebCore::WebAnimation::~WebAnimation): We used to do something very wrong when a WebAnimation was destroyed which uncovered crashes when dealing with
2041         declarative animations. In AnimationTimeline's updateCSSAnimationsForElement() and updateCSSTransitionsForElement(), when we identify that a DeclarativeAnimation
2042         no longer matches an Animation from the current style's AnimationList, we set that DeclarativeAnimation's effect to null and call removeAnimation() on
2043         the timeline. This removes all references from AnimationTimeline to this DeclarativeAnimation and leads to ~WebAnimation being called. Calling removeAnimation()
2044         again in the destructor means that we'd hit ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun) in ref(). It was also meaningless to perform this work in
2045         the WebAnimation destructor since an animation could never be destroyed if it were still registered on a timeline.
2046         (WebCore::WebAnimation::suspendEffectInvalidation): DeclarativeAnimation instances have their timing model properties set during style invalidation, so we need
2047         a mechanism to allow the usual effect invalidation to be suspended in this case. We now maintain a simple m_suspendCount count that increases and decreases with
2048         calls to this method and unsuspendEffectInvalidation() and a isEffectInvalidationSuspended() method returning true whenever that count is positive.
2049         (WebCore::WebAnimation::unsuspendEffectInvalidation):
2050         (WebCore::WebAnimation::timingModelDidChange): Check that effect invalidation is not suspended before proceeding with invalidating the effect.
2051         (WebCore::WebAnimation::setEffect): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
2052         (WebCore::WebAnimation::setTimeline): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
2053         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Ensure that the WebAnimation's lifecycle is extended at least to the completion of the scheduled microtask.
2054         This would otherwise cause crashes after declarative animations were destroyed when they were no longer applied.
2055         (WebCore::WebAnimation::runPendingPlayTask): Only fulfill the "ready" promise if it hasn't already been, which might have been the case if multiple calls to play()
2056         are made as a result of updating the animation play state in CSSAnimation::syncPropertiesWithBackingAnimation().
2057         (WebCore::WebAnimation::runPendingPauseTask): Same as above but with multiple pause() calls.
2058         (WebCore::WebAnimation::startOrStopAccelerated): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
2059         (WebCore::WebAnimation::canBeListed const): This new method is called by {Document|Element}::getAnimations() to check that an animation is in the correct state to
2060         be listed. The Web Animations spec explains that only animations "that have an associated target effect which is current or in effect" can be listed. We implement
2061         this behavior as specified.
2062         * animation/WebAnimation.h:
2063         (WebCore::WebAnimation::isDeclarativeAnimation const):
2064         (WebCore::WebAnimation::isEffectInvalidationSuspended):
2065         * dom/Document.cpp:
2066         (WebCore::Document::getAnimations): Ensure that the document's pending styles are resolved before returning animations to ensure that any pending declarative
2067         animations are created. Additionally, we ensure that we only list qualifying animations that have effects targeting elements that are children of thi document.
2068         * dom/Element.cpp:
2069         (WebCore::Element::getAnimations): Same as Document::getAnimations().
2070         * style/StyleTreeResolver.cpp:
2071         (WebCore::Style::TreeResolver::createAnimatedElementUpdate): When resolving styles, call into the AnimationTimeline if the runtime flag to enable CSS Animations and
2072         CSS Transitions as Web Animations is on. Otherwise, use CSSAnimationController.
2073
2074 2018-03-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2075
2076         [GTK] Crash in WebCore::PlatformDisplayWayland::~PlatformDisplayWayland
2077         https://bugs.webkit.org/show_bug.cgi?id=176490
2078
2079         Reviewed by Žan Doberšek.
2080
2081         Destroy the wl_display with wl_display_disconnect() (client process API), not
2082         wl_display_destroy() (server process API). It has to be destroyed last, so explicitly
2083         destroy the wl_registry and wl_compositor first.
2084
2085         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2086         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
2087
2088 2018-03-10  Megan Gardner  <megan_gardner@apple.com>
2089
2090         Media query for default appearance
2091         https://bugs.webkit.org/show_bug.cgi?id=183539
2092         <rdar://problem/38326388>
2093
2094         Reviewed by Tim Horton.
2095
2096         Not currently testable, will add tests in a later patch.
2097
2098         Write a media query to evaluate appearance.
2099
2100         * css/CSSValueKeywords.in:
2101         * css/MediaFeatureNames.h:
2102         * css/MediaQueryEvaluator.cpp:
2103         (WebCore::defaultAppearanceEvaluate):
2104         * css/MediaQueryExpression.cpp:
2105         (WebCore::featureWithValidIdent):
2106         (WebCore::isFeatureValidWithoutValue):
2107         * page/Page.h:
2108         (WebCore::Page::defaultAppearance const):
2109         (WebCore::Page::setDefaultAppearance):
2110
2111 2018-03-10  Daniel Bates  <dabates@apple.com>
2112
2113         InlineTextBox should own shadow data
2114         https://bugs.webkit.org/show_bug.cgi?id=183359
2115         <rdar://problem/38171343>
2116
2117         Reviewed by Darin Adler.
2118
2119         Following r229147 we recompute the selection style, including any shadow data, whenever we
2120         paint the inline text box. Therefore, InlineTextBox needs to take ownership of the shadow
2121         data or it may be deallocated before it can be used.
2122
2123         Covered by existing tests.
2124
2125         * rendering/InlineTextBox.cpp: Changed data type of InlineTextBox::MarkedTextStyle::textShadow
2126         from const ShadowData* to std::optional<ShadowData>. Also removed explicitly deleted equality
2127         and inequality operators as they are unnecessary. Layout tests should catch if these are ever
2128         implemented and used when painting because the painted results will be wrong.
2129         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const): Clone ShadowData.
2130         (WebCore::InlineTextBox::resolveStyleForMarkedText): Simplified logic.
2131         (WebCore::InlineTextBox::paintMarkedTextForeground): Modified code now that MarkedTextStyle
2132         holds a std::optional<ShadowData>.
2133         (WebCore::InlineTextBox::paintMarkedTextDecoration): Ditto.
2134         * rendering/TextPaintStyle.cpp:
2135         (WebCore::computeTextSelectionPaintStyle): Changed the out parameter type from const ShadowData*
2136         to std::optional<ShadowData>& and modified code as needed.
2137         * rendering/TextPaintStyle.h:
2138         * rendering/style/ShadowData.cpp: Removed unncessary #include of header LayoutRect.h.
2139         This header will be included via ShadowData.h.
2140         (WebCore::ShadowData::clone): Convenience method that returns an std::optional to a
2141         cloned ShadowData object.
2142         * rendering/style/ShadowData.h:
2143
2144 2018-03-09  Zalan Bujtas  <zalan@apple.com>
2145
2146         Turn off offset*/scroll* optimization for input elements with shadow content
2147         https://bugs.webkit.org/show_bug.cgi?id=182383
2148         <rdar://problem/37114190>
2149
2150         Reviewed by Antti Koivisto.
2151
2152         We normally ensure clean tree before calling offsetHeight/Width, scrollHeight/Width.
2153         In certain cases (see updateLayoutIfDimensionsOutOfDate() for details), it's okay to return
2154         the previously computed values even when some part of the tree is dirty.
2155         In case of shadow content, updateLayoutIfDimensionsOutOfDate() might return false (no need to layout)
2156         for the root, while true (needs layout) for the shadow content.
2157         This could confuse the caller (Element::scrollWidth/Height etc) and lead to incorrect result.
2158
2159         Test: fast/forms/scrollheight-with-mutation-crash.html
2160
2161         * dom/Document.cpp:
2162         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2163
2164 2018-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2165
2166         [macOS] Copying a table from the Numbers app and pasting into iCloud Numbers fails
2167         https://bugs.webkit.org/show_bug.cgi?id=183485
2168         <rdar://problem/38041984>
2169
2170         Reviewed by Ryosuke Niwa.
2171
2172         After r222656, WebKit now treats raw image data on the pasteboard as files for the purposes of computing
2173         DataTransfer.files and DataTransfer.types. However, this is combined with existing policies that suppress
2174         DataTransfer.getData and DataTransfer.setData when the pasteboard contains files (generalized to copy/paste in
2175         r222688). This means we now don't allow web pages to access "text/plain" in the case where the user copies part
2176         of a table from the native Numbers app since Numbers additionally writes a snapshot of the table to the platform
2177         pasteboard.
2178
2179         This restriction on getData/setData was intended to prevent web pages from extracting users' file paths when
2180         pasting or dropping, so it doesn't make sense to enforce this restriction even when there is only in-memory
2181         image data on the pasteboard. To fix this bug, we make Pasteboard::fileContentState() differentiate between
2182         cases where there are (real) files on the pasteboard, and cases where we've fallen back to treating image data
2183         as files.
2184
2185         Rebaselined existing LayoutTests to match new behavior.
2186         Also covered by 4 new API tests:
2187             - PasteMixedContent.ImageDataAndPlainText
2188             - PasteMixedContent.ImageDataAndPlainTextAndURL
2189             - PasteMixedContent.ImageDataAndPlainTextAndURLAndHTML
2190             - UIPasteboardTests.DataTransferGetDataWhenPastingImageAndText
2191
2192         * dom/DataTransfer.cpp:
2193         (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
2194
2195         If custom pasteboard data is enabled, suppress getData and setData if and only if we might actually expose file
2196         paths (see Pasteboard::fileContentState).
2197
2198         (WebCore::DataTransfer::types const):
2199
2200         Only allow "text/html" or "text/uri-list" in the case where there are actual files in the pasteboard. If there's
2201         only image data, add all of the DOM-safe types back into the list of types.
2202
2203         * platform/Pasteboard.h:
2204         * platform/StaticPasteboard.h:
2205
2206         Add an enum type to represent the result of Pasteboard::fileContentState.
2207         -   NoFileOrImageData indicates that there was nothing on the pasteboard that could be considered a file
2208             from the point of view of the page.
2209         -   InMemoryImage indicates that there are no files on the pasteboard, but there is image data that we consider
2210             to be files, exposed via DataTransfer API.
2211         -   MayContainFilePaths indicates that there might be file paths on the pasteboard. This means that the source
2212             has either written file paths to the pasteboard (for example, through NSFilenamesPboardType) or the source
2213             has written image data along with a URL type of some sort that does not match one of the allowed URL schemes
2214             that are safe to expose (currently, these are http-family, data, or blob).
2215
2216         * platform/cocoa/PasteboardCocoa.mm:
2217         (WebCore::Pasteboard::fileContentState):
2218
2219         Refactor to return one of the three enum types described above.
2220
2221         (WebCore::Pasteboard::containsFiles): Deleted.
2222         * platform/gtk/PasteboardGtk.cpp:
2223         (WebCore::Pasteboard::fileContentState):
2224         (WebCore::Pasteboard::containsFiles): Deleted.
2225         * platform/win/PasteboardWin.cpp:
2226         (WebCore::Pasteboard::fileContentState):
2227         (WebCore::Pasteboard::containsFiles): Deleted.
2228         * platform/wpe/PasteboardWPE.cpp:
2229         (WebCore::Pasteboard::fileContentState):
2230         (WebCore::Pasteboard::containsFiles): Deleted.
2231
2232         Adjust for Pasteboard::fileContentState() tweaks.
2233
2234 2018-03-09  Chris Fleizach  <cfleizach@apple.com>
2235
2236         AX: WebKit seems to be running spell checker even on non-editable content text
2237         https://bugs.webkit.org/show_bug.cgi?id=183456
2238         <rdar://problem/38076042>
2239
2240         Reviewed by Joanmarie Diggs.
2241
2242         Test: accessibility/mac/attributed-string/attributed-string-does-not-includes-misspelled-for-non-editable.html
2243
2244         Only apply misspelled attributes if it's for editable text. It's not useful or performant to do this for static text.
2245
2246         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2247         (AXAttributeStringSetSpelling):
2248
2249 2018-03-09  Nan Wang  <n_wang@apple.com>
2250
2251         AX: AOM: More accessibility events support
2252         https://bugs.webkit.org/show_bug.cgi?id=183023
2253         <rdar://problem/37764380>
2254
2255         Reviewed by Chris Fleizach.
2256
2257         The test is crashing when we call updateBackingStore when 
2258         the AXObjectCache object is gone. Added a check to fix that.
2259
2260         Modified the test by using the right format of setTimeout and extended the delay.
2261
2262         * accessibility/AccessibilityObject.cpp:
2263         (WebCore::AccessibilityObject::updateBackingStore):
2264
2265 2018-03-09  Ross Kirsling  <ross.kirsling@sony.com>
2266
2267         Unreviewed. Fix WinCairo build after r229497.
2268
2269         * platform/MIMETypeRegistry.cpp:
2270         (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
2271
2272 2018-03-09  Ross Kirsling  <ross.kirsling@sony.com>
2273
2274         Clean up MIMETypeRegistry::mimeTypeAssociationMap for Curl
2275         https://bugs.webkit.org/show_bug.cgi?id=170529
2276
2277         Reviewed by Alex Christensen.
2278
2279         * platform/MIMETypeRegistry.cpp:
2280         (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
2281         (WebCore::mimeTypeAssociationMap): Deleted.
2282         Create map with makeNeverDestroyed and a loop instead.
2283
2284 2018-03-09  Brian Burg  <bburg@apple.com>
2285
2286         Web Inspector: there should only be one way for async backend commands to send failure
2287         https://bugs.webkit.org/show_bug.cgi?id=183524
2288
2289         Reviewed by Timothy Hatcher.
2290
2291         Remove some useless ErrorString arguments. Fix some bugs where we
2292         may never call the callback in an early exit situation.
2293
2294         Covered by existing Inspector and protocol generator tests.
2295
2296         * inspector/agents/InspectorDatabaseAgent.cpp:
2297         (WebCore::InspectorDatabaseAgent::executeSQL):
2298         * inspector/agents/InspectorDatabaseAgent.h:
2299         * inspector/agents/InspectorIndexedDBAgent.h:
2300         * inspector/agents/InspectorIndexedDBAgent.cpp:
2301         (WebCore::getDocumentAndIDBFactoryFromFrameOrSendFailure):
2302         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
2303         (WebCore::InspectorIndexedDBAgent::requestDatabase):
2304         (WebCore::InspectorIndexedDBAgent::requestData):
2305         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
2306         (WebCore::assertDocument): Deleted.
2307         (WebCore::assertIDBFactory): Deleted.
2308         Modernize this code a little bit to share the document/idbFactory extraction code.
2309
2310         * inspector/agents/InspectorNetworkAgent.cpp:
2311         (WebCore::InspectorNetworkAgent::loadResource):
2312         * inspector/agents/InspectorNetworkAgent.h:
2313
2314 2018-03-09  Youenn Fablet  <youenn@apple.com>
2315
2316         Crash in ServiceWorkerContainer::ready
2317         https://bugs.webkit.org/show_bug.cgi?id=183380
2318
2319         Reviewed by Chris Dumez.
2320
2321         Not using 'this' through lambdas.
2322         Instead rely on the last lambda that is passed a ScriptExecutionContext& to get back 'this' which is a ServiceWorkerContainer.
2323
2324         Should be covered by imported/w3c/web-platform-tests/service-workers/service-worker/register-default-scope.https.html no longer crashing.
2325         Although it should probably be LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html that should crash
2326         since this is the main test using ready.
2327
2328         * workers/service/ServiceWorkerContainer.cpp:
2329         (WebCore::ServiceWorkerContainer::ready):
2330
2331 2018-03-09  Youenn Fablet  <youenn@apple.com>
2332
2333         RealtimeOutgoingAudioSource and RealtimeOutgoingVideoSource should be destroyed on the main thread
2334         https://bugs.webkit.org/show_bug.cgi?id=183483
2335         <rdar://problem/38214152>
2336
2337         Reviewed by Eric Carlson.
2338
2339         When dereferencing from libwebrtc code path, schedule a call to deref on main thread.
2340         WebCore dereferencing is happening in the main thread so this guarantees destruction on the main thread.
2341
2342         Covered by updated mock libwebrtc peer connection backend.
2343         We make mock senders to keep a reference to their source which are RealtimeOutgoingXXSource.
2344         We then make mock peer connection backend to free the mock senders in a background thread.
2345
2346         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2347         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
2348         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2349         (WebCore::RealtimeOutgoingAudioSource::stop):
2350         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2351         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2352         (WebCore::RealtimeOutgoingVideoSource::stop):
2353         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2354         * testing/MockLibWebRTCPeerConnection.cpp:
2355         (WebCore::ThreadKeeper::create):
2356         (WebCore::ThreadKeeper::setThread):
2357         (WebCore::MockLibWebRTCPeerConnection::~MockLibWebRTCPeerConnection):
2358         * testing/MockLibWebRTCPeerConnection.h:
2359
2360 2018-03-09  Jer Noble  <jer.noble@apple.com>
2361
2362         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
2363         https://bugs.webkit.org/show_bug.cgi?id=183501
2364
2365         Reviewed by Eric Carlson.
2366
2367         No need for these methods to be PLATFORM(MAC) only.
2368
2369         * platform/cocoa/PlaybackSessionModel.h:
2370         (WebCore::PlaybackSessionModelClient::ensureControlsManager):
2371         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2372         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2373         (VideoFullscreenInterfaceAVKit::isPlayingVideoInEnhancedFullscreen const):
2374         * platform/mac/VideoFullscreenInterfaceMac.h:
2375
2376 2018-03-09  Youenn Fablet  <youenn@apple.com>
2377
2378         ServiceWorker should respect IDB and DOMCache partitioning
2379         https://bugs.webkit.org/show_bug.cgi?id=183496
2380
2381         Reviewed by Brady Eidson.
2382
2383         Test: http/wpt/service-workers/third-party-registration.html
2384
2385         Set the correct top origin of service worker ScriptExecutionContext.
2386
2387         * workers/service/context/ServiceWorkerThread.cpp:
2388         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2389
2390 2018-03-09  Youenn Fablet  <youenn@apple.com>
2391
2392         Cannot change audio input source device
2393         https://bugs.webkit.org/show_bug.cgi?id=175975
2394         <rdar://problem/34073589>
2395
2396         Reviewed by Eric Carlson.
2397
2398         Covered by manually testing https://webrtc.github.io/samples/src/content/devices/input-output/ with a USB web cam.
2399
2400         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2401         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID):
2402         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2403
2404 2018-03-09  Jer Noble  <jer.noble@apple.com>
2405
2406         Add new CSS env constants for use with fullscreen
2407         https://bugs.webkit.org/show_bug.cgi?id=183498
2408
2409         Reviewed by Dean Jackson.
2410
2411         Tests: fullscreen/fullscreen-auto-hide-delay.html
2412                fullscreen/fullscreen-inset-top.html
2413
2414         * dom/ConstantPropertyMap.cpp:
2415         (WebCore::ConstantPropertyMap::nameForProperty const):
2416         (WebCore::variableDataForPositiveDuration):
2417         (WebCore::ConstantPropertyMap::setFullscreenInsetTop):
2418         (WebCore::ConstantPropertyMap::setFullscreenAutoHideDelay):
2419         * dom/ConstantPropertyMap.h:
2420         * page/Page.cpp:
2421         (WebCore::Page::setFullscreenInsetTop):
2422         (WebCore::Page::setFullscreenAutoHideDelay):
2423         * page/Page.h:
2424         * testing/Internals.cpp:
2425         (WebCore::Internals::resetToConsistentState):
2426         (WebCore::Internals::setFullscreenInsetTop):
2427         (WebCore::Internals::setFullscreenAutoHideDelay):
2428         * testing/Internals.h:
2429         * testing/Internals.idl:
2430
2431 2018-03-09  Zalan Bujtas  <zalan@apple.com>
2432
2433         RenderTreeBuilder::splitAnonymousBoxesAroundChild should take multicolumn spanners into account.
2434         https://bugs.webkit.org/show_bug.cgi?id=183493
2435         <rdar://problem/38030461>
2436
2437         Reviewed by Antti Koivisto.
2438
2439         Multicolumn spanners are taken out of their original position and placed next
2440         to a RenderMultiColumnSet. splitAnonymousBoxesAroundChild needs to know the original parent (in the render tree context).
2441
2442         Test: fast/multicol/adjust-beforeChild-for-spanner-crash.html
2443
2444         * rendering/updating/RenderTreeBuilder.cpp:
2445         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
2446         * rendering/updating/RenderTreeBuilder.h:
2447         * rendering/updating/RenderTreeBuilderBlock.cpp:
2448         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
2449         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2450         (WebCore::RenderTreeBuilder::MultiColumn::adjustBeforeChildForMultiColumnSpannerIfNeeded):
2451         * rendering/updating/RenderTreeBuilderMultiColumn.h:
2452         * rendering/updating/RenderTreeBuilderRuby.cpp:
2453         (WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
2454         * rendering/updating/RenderTreeBuilderTable.cpp:
2455         (WebCore::RenderTreeBuilder::Table::attach):
2456
2457 2018-03-09  Jer Noble  <jer.noble@apple.com>
2458
2459         Add isPictureInPictureActive messaging across WebKit process boundary
2460         https://bugs.webkit.org/show_bug.cgi?id=183499
2461
2462         Reviewed by Eric Carlson.
2463
2464         * platform/cocoa/PlaybackSessionModel.h:
2465         (WebCore::PlaybackSessionModelClient::pictureInPictureActiveChanged):
2466         * platform/cocoa/PlaybackSessionModelMediaElement.h:
2467         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2468         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
2469         (WebCore::PlaybackSessionModelMediaElement::isPictureInPictureActive const):
2470         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2471         (VideoFullscreenControllerContext::isPictureInPictureActive const):
2472
2473 2018-03-09  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2474
2475         [Curl] Implement connection limit.
2476         https://bugs.webkit.org/show_bug.cgi?id=183016
2477
2478         Implement both connection limit per host and total
2479         connection limit on curl network layer.
2480
2481         Reviewed by Youenn Fablet.
2482
2483         No new tests because there's no behavior change.
2484
2485         * platform/network/curl/CurlContext.cpp:
2486         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>):
2487         (WebCore::CurlContext::CurlContext):
2488         (WebCore::CurlMultiHandle::setMaxConnects):
2489         (WebCore::CurlMultiHandle::setMaxTotalConnections):
2490         (WebCore::CurlMultiHandle::setMaxHostConnections):
2491         * platform/network/curl/CurlContext.h:
2492         (WebCore::CurlContext::scheduler):
2493         * platform/network/curl/CurlRequest.cpp:
2494         (WebCore::CurlRequest::startWithJobManager):
2495         (WebCore::CurlRequest::cancel):
2496         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2497         (WebCore::CurlRequest::completeDidReceiveResponse):
2498         (WebCore::CurlRequest::pausedStatusChanged):
2499         * platform/network/curl/CurlRequestScheduler.cpp:
2500         (WebCore::CurlRequestScheduler::CurlRequestScheduler):
2501         (WebCore::CurlRequestScheduler::workerThread):
2502         (WebCore::CurlRequestScheduler::singleton): Deleted.
2503         * platform/network/curl/CurlRequestScheduler.h:
2504
2505 2018-03-09  Jer Noble  <jer.noble@apple.com>
2506
2507         webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
2508         https://bugs.webkit.org/show_bug.cgi?id=183383
2509
2510         Reviewed by Eric Carlson.
2511
2512         Fire the webkitfullscreenchange event at the same time as the pseudo class selector changes, during the handling
2513         of webkitDidEnterFullScreenForElement. For WebKit2 clients, this is guaranteed to be asynchronous, since the
2514         calling method originates in the UIProcess. For WebKit1 clients (and WKTR and DRT), there's the possibility that
2515         webkitWillEnterFullScreenForElement will be called synchronously from within
2516         Document::requestFullScreenForElement(), so break that synchronousness by starting the
2517         ChromeClient::enterFullScreenForElement(...) process in a async task.
2518
2519         Previously, the firing of the fullscreenchange event was done through a zero-length timer. Use a
2520         GenericTaskQueue instead.
2521
2522         A number of layout tests depend on the behavior that the element will be in fullscreen when the 'playing' event
2523         fires. This was true for DRT (but not WKTR), since its fullscreen implementations were deliberately synchronous, but
2524         won't necessarily be true for all ports. Fix this in a subsequent patch.
2525
2526         * dom/Document.cpp:
2527         (WebCore::Document::requestFullScreenForElement):
2528         (WebCore::Document::webkitExitFullscreen):
2529         (WebCore::Document::webkitWillEnterFullScreenForElement):
2530         (WebCore::Document::webkitDidEnterFullScreenForElement):
2531         (WebCore::Document::webkitDidExitFullScreenForElement):
2532         (WebCore::Document::dispatchFullScreenChangeEvents):
2533         * dom/Document.h:
2534         * html/HTMLMediaElement.cpp:
2535         (WebCore::HTMLMediaElement::setReadyState):
2536         (WebCore::HTMLMediaElement::playInternal):
2537         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
2538         (WebCore::HTMLMediaElement::updatePlayState):
2539         (WebCore::HTMLMediaElement::setPlaying):
2540
2541 2018-03-09  Zan Dobersek  <zdobersek@igalia.com>
2542
2543         [Nicosia] Add threaded PaintingEngine implementation
2544         https://bugs.webkit.org/show_bug.cgi?id=183511
2545
2546         Reviewed by Carlos Garcia Campos.
2547
2548         Add Nicosia::PaintingEngineThreaded, class that internally uses a thread
2549         pool in which painting tasks are executed.
2550
2551         Implementation for now defaults to using GLib's GThreadPool, defaulting
2552         to 4 threads that are exclusive to this pool. These parameters should be
2553         fine-tuned in the future, or even made configurable, but are a solid
2554         basis for testing.
2555
2556         In PaintingEngineThreaded::paint(), PaintingContext implementation is
2557         used to record all the operations, and the gathered Vector is combined
2558         with the Buffer object and dispatched into the thread pool. In the
2559         thread function, the provided buffer and painting operations are run
2560         through the PaintingContext implementation, replaying all the operations
2561         on a painting context that draws into the given buffer.
2562
2563         The recorded operation objects implement the PaintingOperation interface
2564         contain all the data necessary to replay a given operation. They can be
2565         executed against a PaintingOperationReplay object, as is the case during
2566         PaintingContext::replay(), or they can be dumped into a TextStream
2567         object for debugging purposes.
2568
2569         PaintingContext now also provides the record() and replay() static
2570         functions. PaintingContext objects now differ per purpose, which can be
2571         either for painting or for recording. paint() and replay() use a
2572         for-painting PaintingContext, and record() uses a for-recording one.
2573         The for-painting PaintingContext receives a Buffer object, i.e. a memory
2574         area on which it can draw, while the for-recording PaintingContext uses
2575         the passed-in PaintingOperations Vector that should store all the
2576         recorded operations.
2577
2578         The current Cairo implementation of PaintingContext is moved into
2579         PaintingContextCairo::ForPainting. PaintingContextCairo::ForRecording is
2580         added but is currently no-op until a Cairo-specific GraphicsContextImpl
2581         with recording capabilities is added, allowing any call on the
2582         GraphicsContext object used in PaintingContext::record() to be recorded
2583         for later replay. PaintingOperationReplayCairo, inheriting from
2584         PaintingOperationReplay, will be used for replay purposes, providing
2585         only reference to the PlatformContextCairo object that is constructed in
2586         PaintingContextCairo::ForPainting.
2587
2588         The Cairo-specific GraphicsContextImpl implementation will be added in
2589         a separate patch. After that, PaintingEngine::create() will be modified
2590         so that the Nicosia::PaintingEngineThreaded implementation can be used
2591         for testing purposes, probably by setting an environment variable.
2592
2593         * platform/TextureMapper.cmake:
2594         * platform/graphics/nicosia/NicosiaPaintingContext.cpp:
2595         (Nicosia::PaintingContext::createForPainting):
2596         (Nicosia::PaintingContext::createForRecording):
2597         (Nicosia::PaintingContext::create): Deleted.
2598         * platform/graphics/nicosia/NicosiaPaintingContext.h:
2599         (Nicosia::PaintingContext::paint):
2600         (Nicosia::PaintingContext::record):
2601         (Nicosia::PaintingContext::replay):
2602         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp: Added.
2603         (Nicosia::s_threadFunc):
2604         (Nicosia::paintLayer):
2605         (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
2606         (Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
2607         (Nicosia::PaintingEngineThreaded::paint):
2608         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
2609         * platform/graphics/nicosia/NicosiaPaintingOperation.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
2610         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
2611         (Nicosia::PaintingContextCairo::ForPainting::ForPainting):
2612         (Nicosia::PaintingContextCairo::ForPainting::~ForPainting):
2613         (Nicosia::PaintingContextCairo::ForPainting::graphicsContext):
2614         (Nicosia::PaintingContextCairo::ForPainting::replay):
2615         (Nicosia::PaintingContextCairo::ForRecording::ForRecording):
2616         (Nicosia::PaintingContextCairo::ForRecording::graphicsContext):
2617         (Nicosia::PaintingContextCairo::ForRecording::replay):
2618         (Nicosia::PaintingContextCairo::PaintingContextCairo): Deleted.
2619         (Nicosia::PaintingContextCairo::~PaintingContextCairo): Deleted.
2620         (Nicosia::PaintingContextCairo::graphicsContext): Deleted.
2621         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h:
2622         * platform/graphics/nicosia/cairo/NicosiaPaintingOperationReplayCairo.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
2623         (Nicosia::PaintingOperationReplayCairo::PaintingOperationReplayCairo):
2624
2625 2018-03-09  Zan Dobersek  <zdobersek@igalia.com>
2626
2627         Remove some unused cruft in TextureMapperLayer.
2628
2629         The ScrollingClient class is not used anymore since r229318.
2630         findScrollableContentsLayerAt() is similarly unused, but also lacking
2631         an actual definition. ContentsLayerCount enum can also be purged.
2632
2633         Rubber-stamped by Carlos Garcia Campos.
2634
2635         * platform/graphics/texmap/TextureMapperLayer.h:
2636
2637 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
2638
2639         Add basic synchronization capability to Nicosia::Buffer
2640         https://bugs.webkit.org/show_bug.cgi?id=183500
2641
2642         Reviewed by Carlos Garcia Campos.
2643
2644         Have Nicosia::Buffer track a painting state, and allow that state to be
2645         modified and accessed from different threads. The PaintingState enum
2646         value is protected by a Lock object, and can be modified via the
2647         beginPainting() and completePainting() methods. Additionally, the
2648         waitUntilPaintingComplete() method allows the caller to wait until the
2649         painting is complete for the given Nicosia::Buffer object.
2650
2651         This added state doesn't affect a Nicosia::Buffer object internally, and
2652         doesn't have any effect on  existing usages of Nicosia::Buffer (which
2653         are not multi-threaded).
2654
2655         * platform/graphics/nicosia/NicosiaBuffer.cpp:
2656         (Nicosia::Buffer::beginPainting):
2657         (Nicosia::Buffer::completePainting):
2658         (Nicosia::Buffer::waitUntilPaintingComplete):
2659         * platform/graphics/nicosia/NicosiaBuffer.h:
2660
2661 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
2662
2663         Move NicosiaPaintingContextCairo files under Cairo-specific directory
2664         https://bugs.webkit.org/show_bug.cgi?id=183497
2665
2666         Reviewed by Carlos Garcia Campos.
2667
2668         Pack Cairo-specific files in the Nicosia subsystem under cairo/.
2669
2670         * platform/TextureMapper.cmake:
2671         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp.
2672         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.h.
2673
2674 2018-03-08  Nan Wang  <n_wang@apple.com>
2675
2676         AX: AOM: More accessibility events support
2677         https://bugs.webkit.org/show_bug.cgi?id=183023
2678         <rdar://problem/37764380>
2679
2680         Reviewed by Chris Fleizach.
2681
2682         Fixed the crash that we shouldn't dispatch the accessibility events if the
2683         event path is empty.
2684
2685         Also added a check to not dispatch events if the runtime flag is not enabled.
2686
2687         Test: accessibility/mac/AOM-events-webarea-crash.html
2688
2689         * accessibility/AccessibilityObject.cpp:
2690         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
2691         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
2692         * accessibility/AccessibilityObject.h:
2693
2694 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
2695
2696         Allow WebViews to disable system appearance
2697         https://bugs.webkit.org/show_bug.cgi?id=183418
2698         <rdar://problem/36975642>
2699
2700         Reviewed by Tim Horton.
2701
2702         Not currently testable, tests will be added in a later patch.
2703
2704         Allow webviews to choose whether or not to follow the default system appearance.
2705
2706         * css/StyleColor.cpp:
2707         (WebCore::StyleColor::colorFromKeyword):
2708         * css/StyleColor.h:
2709         * css/StyleResolver.cpp:
2710         (WebCore::StyleResolver::colorFromPrimitiveValue const):
2711         * css/parser/CSSParser.cpp:
2712         (WebCore::CSSParser::parseSystemColor):
2713         * css/parser/CSSParser.h:
2714         * css/parser/CSSParserMode.h:
2715         * html/canvas/CanvasRenderingContext2D.cpp:
2716         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
2717         * html/canvas/CanvasRenderingContext2DBase.cpp:
2718         (WebCore::CanvasRenderingContext2DBase::setStrokeColor):
2719         (WebCore::CanvasRenderingContext2DBase::setFillColor):
2720         * html/canvas/CanvasStyle.cpp:
2721         (WebCore::parseColor):
2722         (WebCore::parseColorOrCurrentColor):
2723         (WebCore::CanvasStyle::createFromString):
2724         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
2725         * html/canvas/CanvasStyle.h:
2726         * page/Page.h:
2727         (WebCore::Page::useSystemAppearance const):
2728         (WebCore::Page::setUseSystemAppearance):
2729         * platform/Theme.cpp:
2730         (WebCore::Theme::paint):
2731         * platform/Theme.h:
2732         * platform/mac/LocalDefaultSystemAppearance.h:
2733         * platform/mac/LocalDefaultSystemAppearance.mm:
2734         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2735         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
2736         * platform/mac/ThemeMac.h:
2737         * platform/mac/ThemeMac.mm:
2738         (-[WebCoreThemeView initWithUseSystemAppearance:]):
2739         (WebCore::paintToggleButton):
2740         (WebCore::paintButton):
2741         (WebCore::ThemeMac::ensuredView):
2742         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2743         (WebCore::ThemeMac::paint):
2744         (-[WebCoreThemeView init]): Deleted.
2745         * rendering/RenderTheme.cpp:
2746         (WebCore::RenderTheme::paint):
2747         (WebCore::RenderTheme::systemColor const):
2748         (WebCore::RenderTheme::focusRingColor):
2749         * rendering/RenderTheme.h:
2750         (WebCore::RenderTheme::platformFocusRingColor const):
2751         * rendering/RenderThemeIOS.mm:
2752         (WebCore::RenderThemeIOS::systemColor const):
2753         * rendering/RenderThemeMac.h:
2754         * rendering/RenderThemeMac.mm:
2755         (WebCore::RenderThemeMac::documentViewFor const):
2756         (WebCore::RenderThemeMac::platformFocusRingColor const):
2757         (WebCore::RenderThemeMac::systemColor const):
2758         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
2759         (WebCore::RenderThemeMac::paintSliderThumb):
2760         * rendering/TextPaintStyle.cpp:
2761         (WebCore::computeTextPaintStyle):
2762
2763 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
2764
2765         Ensure default appearance for selection form control
2766         https://bugs.webkit.org/show_bug.cgi?id=183482
2767         <rdar://problem/38274894>
2768
2769         Reviewed by Tim Horton.
2770   
2771         The appearance for selection form controls was not set to default.
2772
2773         Not currently testable, will add tests in a later patch.
2774
2775         * rendering/RenderThemeMac.mm:
2776         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
2777
2778 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
2779
2780         [Win] Compile error: pal/ExportMacros.h not found.
2781         https://bugs.webkit.org/show_bug.cgi?id=183467
2782
2783         Reviewed by Brent Fulgham.
2784
2785         PAL header files are no longer located under the WebCore folder in forwarding headers. An additional
2786         build step is required to copy the PAL header files to the internal include folder.
2787
2788         No new tests, no change in functionality. 
2789
2790         * PlatformWin.cmake:
2791         * WebCore.vcxproj/WebCore.proj:
2792
2793 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
2794
2795         Ensure system appearance is default for legacy webkit
2796         https://bugs.webkit.org/show_bug.cgi?id=183473
2797         <rdar://problem/38210306>
2798
2799         Reviewed by Tim Horton.
2800
2801         Need to set the appearance on the window for legacy webkit due to differences in drawing.
2802
2803         Not currently testable, will add tests in a later patch.
2804
2805         * platform/mac/ThemeMac.mm:
2806         (WebCore::paintButton):
2807
2808 2018-03-08  Youenn Fablet  <youenn@apple.com>
2809
2810         libwebrtc update broke internal builds
2811         https://bugs.webkit.org/show_bug.cgi?id=183454
2812
2813         Reviewed by Eric Carlson.
2814
2815         No change of behavior.
2816         Fixed header search paths.
2817         Removed deleted file from XCode project as an additional clean-up.
2818
2819         * Configurations/WebCore.xcconfig:
2820         * WebCore.xcodeproj/project.pbxproj:
2821
2822 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
2823
2824         NSAnimation is not working in the WebContent process when WindowServer access is blocked.
2825         https://bugs.webkit.org/show_bug.cgi?id=183291
2826
2827         Reviewed by Dean Jackson.
2828
2829         The animation can be implemented by using an NSTimer instead. Use the existing Bezier timing
2830         function to create a smooth animation.
2831
2832         No new tests. This code is used to fade scrollbars in and out by animating the alpha value.
2833         This scrollbar setting is not the default in macOS, which makes it non trivial to create
2834         layout tests for this.
2835
2836         * platform/mac/ScrollAnimatorMac.mm:
2837         (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
2838         (-[WebScrollbarPartAnimation startAnimation]):
2839         (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
2840         (-[WebScrollbarPartAnimation invalidate]):
2841         (-[WebScrollbarPartAnimation setDuration:]):
2842         (-[WebScrollbarPartAnimation stopAnimation]):
2843         (-[WebScrollbarPartAnimation setCurrentProgress:]): Deleted.
2844
2845 2018-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2846
2847         Templatize SVGAnimatedType
2848         https://bugs.webkit.org/show_bug.cgi?id=183017
2849
2850         Reviewed by Dean Jackson.
2851
2852         This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
2853         goal to have SVGAnimatedType be type independent. The appropriate method
2854         of this template will be implicitly instantiated based to the type of the
2855         animated attribute(s).
2856
2857         * Sources.txt: Delete SVGAnimatedType.cpp since its function became template
2858         functions or short enough to be inline functions.
2859         * WebCore.xcodeproj/project.pbxproj:
2860         * svg/SVGAnimatedAngle.cpp:
2861         (WebCore::SVGAnimatedAngleAnimator::constructFromString):
2862         (WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
2863         (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
2864         (WebCore::SVGAnimatedAngleAnimator::addAnimatedTypes):
2865         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
2866         Use the template functions SVGAnimatedType::create<>() and SVGAnimatedType::as<>().
2867
2868         * svg/SVGAnimatedBoolean.cpp:
2869         (WebCore::SVGAnimatedBooleanAnimator::constructFromString):
2870         (WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
2871         (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
2872         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
2873         Ditto.
2874
2875         * svg/SVGAnimatedColor.cpp:
2876         (WebCore::SVGAnimatedColorAnimator::constructFromString):
2877         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes):
2878         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
2879         Ditto.
2880
2881         * svg/SVGAnimatedEnumeration.cpp:
2882         (WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
2883         (WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
2884         (WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
2885         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
2886         Ditto.
2887
2888         * svg/SVGAnimatedInteger.cpp:
2889         (WebCore::SVGAnimatedIntegerAnimator::constructFromString):
2890         (WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
2891         (WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
2892         (WebCore::SVGAnimatedIntegerAnimator::addAnimatedTypes):
2893         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
2894         Ditto.
2895
2896         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
2897         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString):
2898         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
2899         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
2900         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes):
2901         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
2902         Ditto.
2903
2904         * svg/SVGAnimatedLength.cpp:
2905         (WebCore::SVGAnimatedLengthAnimator::constructFromString):
2906         (WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
2907         (WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
2908         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
2909         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
2910         Ditto.
2911
2912         * svg/SVGAnimatedLengthList.cpp:
2913         (WebCore::SVGAnimatedLengthListAnimator::constructFromString):
2914         (WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
2915         (WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
2916         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
2917         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
2918         Ditto.
2919
2920         * svg/SVGAnimatedNumber.cpp:
2921         (WebCore::SVGAnimatedNumberAnimator::constructFromString):
2922         (WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
2923         (WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
2924         (WebCore::SVGAnimatedNumberAnimator::addAnimatedTypes):
2925         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
2926         Ditto.
2927
2928         * svg/SVGAnimatedNumberList.cpp:
2929         (WebCore::SVGAnimatedNumberListAnimator::constructFromString):
2930         (WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
2931         (WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
2932         (WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
2933         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
2934         Ditto.
2935
2936         * svg/SVGAnimatedNumberOptionalNumber.cpp:
2937         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString):
2938         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
2939         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
2940         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes):
2941         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
2942         Ditto.
2943
2944         * svg/SVGAnimatedPath.cpp:
2945         (WebCore::SVGAnimatedPathAnimator::constructFromString):
2946         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
2947         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
2948         (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes):
2949         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
2950         Ditto.
2951
2952         * svg/SVGAnimatedPointList.cpp:
2953         (WebCore::SVGAnimatedPointListAnimator::constructFromString):
2954         (WebCore::SVGAnimatedPointListAnimator::startAnimValAnimation):
2955         (WebCore::SVGAnimatedPointListAnimator::resetAnimValToBaseVal):
2956         (WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
2957         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
2958         Ditto.
2959
2960         * svg/SVGAnimatedPreserveAspectRatio.cpp:
2961         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
2962         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
2963         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
2964         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
2965         Ditto.
2966
2967         * svg/SVGAnimatedRect.cpp:
2968         (WebCore::SVGAnimatedRectAnimator::constructFromString):
2969         (WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
2970         (WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
2971         (WebCore::SVGAnimatedRectAnimator::addAnimatedTypes):
2972         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
2973         Ditto.
2974
2975         * svg/SVGAnimatedString.cpp:
2976         (WebCore::SVGAnimatedStringAnimator::constructFromString):
2977         (WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
2978         (WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
2979         (WebCore::SVGAnimatedStringAnimator::calculateAnimatedValue):
2980         Ditto.
2981
2982         * svg/SVGAnimatedTransformList.cpp:
2983         (WebCore::SVGAnimatedTransformListAnimator::constructFromString):
2984         (WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
2985         (WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
2986         (WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
2987         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
2988         (WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
2989         Ditto.
2990
2991         * svg/SVGAnimatedType.cpp: Removed.
2992         * svg/SVGAnimatedType.h:
2993         (WebCore::SVGAnimatedType::create):
2994         (WebCore::SVGAnimatedType::SVGAnimatedType):
2995         (WebCore::SVGAnimatedType::~SVGAnimatedType):
2996         (WebCore::SVGAnimatedType::as const):
2997         (WebCore::SVGAnimatedType::as):
2998         (WebCore::SVGAnimatedType::type const):
2999         (WebCore::SVGAnimatedType::valueAsString const):
3000         (WebCore::SVGAnimatedType::setValueAsString):
3001         (WebCore::SVGAnimatedType::supportsAnimVal):
3002         (WebCore::SVGAnimatedType::angleAndEnumeration const): Deleted.
3003         (WebCore::SVGAnimatedType::boolean const): Deleted.
3004         (WebCore::SVGAnimatedType::color const): Deleted.
3005         (WebCore::SVGAnimatedType::enumeration const): Deleted.
3006         (WebCore::SVGAnimatedType::integer const): Deleted.
3007         (WebCore::SVGAnimatedType::integerOptionalInteger const): Deleted.
3008         (WebCore::SVGAnimatedType::length const): Deleted.
3009         (WebCore::SVGAnimatedType::lengthList const): Deleted.
3010         (WebCore::SVGAnimatedType::number const): Deleted.
3011         (WebCore::SVGAnimatedType::numberList const): Deleted.
3012         (WebCore::SVGAnimatedType::numberOptionalNumber const): Deleted.
3013         (WebCore::SVGAnimatedType::path const): Deleted.
3014         (WebCore::SVGAnimatedType::pointList const): Deleted.
3015         (WebCore::SVGAnimatedType::preserveAspectRatio const): Deleted.
3016         (WebCore::SVGAnimatedType::rect const): Deleted.
3017         (WebCore::SVGAnimatedType::string const): Deleted.
3018         (WebCore::SVGAnimatedType::transformList const): Deleted.
3019         (WebCore::SVGAnimatedType::angleAndEnumeration): Deleted.
3020         (WebCore::SVGAnimatedType::boolean): Deleted.
3021         (WebCore::SVGAnimatedType::color): Deleted.
3022         (WebCore::SVGAnimatedType::enumeration): Deleted.
3023         (WebCore::SVGAnimatedType::integer): Deleted.
3024         (WebCore::SVGAnimatedType::integerOptionalInteger): Deleted.
3025         (WebCore::SVGAnimatedType::length): Deleted.
3026         (WebCore::SVGAnimatedType::lengthList): Deleted.
3027         (WebCore::SVGAnimatedType::number): Deleted.
3028         (WebCore::SVGAnimatedType::numberList): Deleted.
3029         (WebCore::SVGAnimatedType::numberOptionalNumber): Deleted.
3030         (WebCore::SVGAnimatedType::path): Deleted.
3031         (WebCore::SVGAnimatedType::pointList): Deleted.
3032         (WebCore::SVGAnimatedType::preserveAspectRatio): Deleted.
3033         (WebCore::SVGAnimatedType::rect): Deleted.
3034         (WebCore::SVGAnimatedType::string): Deleted.
3035         (WebCore::SVGAnimatedType::transformList): Deleted.
3036         Replace the union by a Variant. Replace all the type specific functions
3037         by the template functions create() and as(). Use WTF::visit to get the
3038         value stored in the variant. Use the SVGPropertyTraits to perform the
3039         required operation.
3040
3041         * svg/SVGAnimatedTypeAnimator.h:
3042         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
3043         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
3044         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
3045         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
3046         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
3047         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
3048         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
3049         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
3050         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
3051         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
3052         (WebCore::SVGAnimatedTypeAnimator::executeAction):
3053         Rename the parameters and the local variables to match their types. Use
3054         the SVGAnimatedType template functions create() and as().
3055
3056         * svg/SVGLengthValue.h:
3057         (WebCore::SVGPropertyTraits<SVGLengthValue>::parse): This was moved from
3058         SVGAnimatedType::setValueAsString()
3059         (WebCore::SVGPropertyTraits<SVGLengthValue>::toString): This was moved from
3060         SVGAnimatedType::valueAsString().
3061
3062         * svg/SVGMarkerTypes.h: Add placeholders for parse() and toString() so
3063         SVGAnimatedType::valueAsString() and setValueAsString() can compile for 
3064         all types.
3065
3066         * svg/SVGNumberListValues.h:
3067         (WebCore::SVGPropertyTraits<SVGNumberListValues>::parse):
3068         * svg/SVGPathByteStream.h:
3069         (WebCore::SVGPropertyTraits<SVGPathByteStream>::parse):
3070         (WebCore::SVGPropertyTraits<SVGPathByteStream>::toString):
3071         * svg/SVGPointListValues.h:
3072         (WebCore::SVGPropertyTraits<SVGPointListValues>::parse):
3073         (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
3074         * svg/SVGPreserveAspectRatioValue.h:
3075         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString):
3076         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::parse):
3077         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString):
3078         Ditto.
3079
3080         * svg/SVGTransformListValues.h:
3081         (WebCore::SVGPropertyTraits<SVGTransformListValues>::parse):
3082         Ditto.
3083
3084         * svg/SVGValue.h: Added. SVGValueVariant is the replacement of the union
3085         SVGAnimatedType::DataUnion.
3086
3087         * svg/properties/SVGPropertyInfo.h:
3088         Add a minimum and maximum AnimatedPropertyType so, SVGAnimatedType::type()
3089         can assert that the index of the variant is in the range of this enum.
3090
3091         * svg/properties/SVGPropertyTraits.h:
3092         (WebCore::SVGPropertyTraits<bool>::parse):
3093         (WebCore::SVGPropertyTraits<unsigned>::parse):
3094         (WebCore::SVGPropertyTraits<int>::parse):
3095         Ditto.
3096
3097 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3098
3099         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
3100         https://bugs.webkit.org/show_bug.cgi?id=183449
3101
3102         Reviewed by Mark Lam.
3103
3104         This patch removes jsDynamicDowncast. Our JSC::jsDynamicCast can have a way to inject a fast
3105         path that is similar to jsDynamicDowncast. WebCore can leverage this functionality to add
3106         a fast path for WebCore's extended JS object types (JSEvent, JSElement, JSNode, and JSDocument).
3107
3108         No behavior change.
3109
3110         * WebCore.xcodeproj/project.pbxproj:
3111         * bindings/js/CommonVM.cpp:
3112         (WebCore::lexicalFrameFromCommonVM):
3113         * bindings/js/JSDOMConvertBufferSource.h:
3114         (WebCore::toPossiblySharedArrayBufferView):
3115         * bindings/js/JSDOMConvertPromise.h:
3116         (WebCore::Converter<IDLPromise<T>>::convert):
3117         * bindings/js/JSDOMExceptionHandling.cpp:
3118         (WebCore::reportException):
3119         (WebCore::retrieveErrorMessage):
3120         * bindings/js/JSDOMIterator.h:
3121         (WebCore::IteratorTraits>::next):
3122         * bindings/js/JSDOMWindowProxy.cpp:
3123         (WebCore::JSDOMWindowProxy::toWrapped):
3124         * bindings/js/JSDOMWrapperCache.h:
3125         * bindings/js/JSDocumentCustom.h:
3126         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits):
3127         (WebCore::jsDocumentCast): Deleted.
3128         * bindings/js/JSDynamicDowncast.h: Removed.
3129         * bindings/js/JSElementCustom.h:
3130         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits):
3131         (WebCore::jsElementCast): Deleted.
3132         * bindings/js/JSEventCustom.h:
3133         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits):
3134         (WebCore::jsEventCast): Deleted.
3135         * bindings/js/JSEventTargetCustom.cpp:
3136         (WebCore::jsEventTargetCast):
3137         * bindings/js/JSNodeCustom.h:
3138         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits):
3139         (WebCore::jsNodeCast): Deleted.
3140         * bindings/js/JSPluginElementFunctions.cpp:
3141         (WebCore::pluginElementPropertyGetter):
3142         * bindings/js/JSReadableStreamSourceCustom.cpp:
3143         (WebCore::JSReadableStreamSource::start):
3144         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3145         (WebCore::toJSDedicatedWorkerGlobalScope):
3146         (WebCore::toJSWorkerGlobalScope):
3147         (WebCore::toJSServiceWorkerGlobalScope):
3148         * bindings/js/ReadableStream.cpp:
3149         (WebCore::ReadableStream::create):
3150         (WebCore::ReadableStream::isDisturbed):
3151         * bindings/js/ReadableStream.h:
3152         (WebCore::JSReadableStreamWrapperConverter::toWrapped):
3153         * bindings/js/ScriptModuleLoader.cpp:
3154         (WebCore::ScriptModuleLoader::evaluate):
3155         * bindings/js/SerializedScriptValue.cpp:
3156         (WebCore::CloneSerializer::dumpIfTerminal):
3157         (WebCore::CloneSerializer::serialize):
3158         * bindings/js/StructuredClone.cpp:
3159         (WebCore::structuredCloneArrayBufferView):
3160         * bindings/scripts/CodeGeneratorJS.pm:
3161         (GetCastingHelperForThisObject):
3162         (GenerateImplementation):
3163         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3164         (WebCore::jsInterfaceNameConstructor):
3165         (WebCore::setJSInterfaceNameConstructor):
3166         (WebCore::JSInterfaceName::toWrapped):
3167         * bindings/scripts/test/JS/JSMapLike.cpp:
3168         (WebCore::IDLAttribute<JSMapLike>::cast):
3169         (WebCore::IDLOperation<JSMapLike>::cast):
3170         (WebCore::jsMapLikeConstructor):
3171         (WebCore::setJSMapLikeConstructor):
3172         (WebCore::JSMapLike::toWrapped):
3173         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3174         (WebCore::IDLAttribute<JSReadOnlyMapLike>::cast):
3175         (WebCore::IDLOperation<JSReadOnlyMapLike>::cast):
3176         (WebCore::jsReadOnlyMapLikeConstructor):
3177         (WebCore::setJSReadOnlyMapLikeConstructor):
3178         (WebCore::JSReadOnlyMapLike::toWrapped):
3179         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3180         (WebCore::IDLAttribute<JSTestActiveDOMObject>::cast):
3181         (WebCore::IDLOperation<JSTestActiveDOMObject>::cast):
3182         (WebCore::jsTestActiveDOMObjectConstructor):
3183         (WebCore::setJSTestActiveDOMObjectConstructor):
3184         (WebCore::JSTestActiveDOMObject::toWrapped):
3185         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3186         (WebCore::IDLAttribute<JSTestCEReactions>::cast):
3187         (WebCore::IDLOperation<JSTestCEReactions>::cast):
3188         (WebCore::jsTestCEReactionsConstructor):
3189         (WebCore::setJSTestCEReactionsConstructor):
3190         (WebCore::JSTestCEReactions::toWrapped):
3191         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3192         (WebCore::IDLAttribute<JSTestCEReactionsStringifier>::cast):
3193         (WebCore::IDLOperation<JSTestCEReactionsStringifier>::cast):
3194         (WebCore::jsTestCEReactionsStringifierConstructor):
3195         (WebCore::setJSTestCEReactionsStringifierConstructor):
3196         (WebCore::JSTestCEReactionsStringifier::toWrapped):
3197         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3198         (WebCore::IDLAttribute<JSTestCallTracer>::cast):
3199         (WebCore::IDLOperation<JSTestCallTracer>::cast):
3200         (WebCore::jsTestCallTracerConstructor):
3201         (WebCore::setJSTestCallTracerConstructor):
3202         (WebCore::JSTestCallTracer::toWrapped):
3203         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3204         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
3205         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
3206         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
3207         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3208         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
3209         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
3210         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
3211         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3212         (WebCore::IDLAttribute<JSTestDOMJIT>::cast):
3213         (WebCore::IDLOperation<JSTestDOMJIT>::cast):
3214         (WebCore::jsTestDOMJITConstructor):
3215         (WebCore::setJSTestDOMJITConstructor):
3216         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3217         (WebCore::IDLAttribute<JSTestEnabledBySetting>::cast):
3218         (WebCore::IDLOperation<JSTestEnabledBySetting>::cast):
3219         (WebCore::jsTestEnabledBySettingConstructor):
3220         (WebCore::setJSTestEnabledBySettingConstructor):
3221         (WebCore::JSTestEnabledBySetting::toWrapped):
3222         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3223         (WebCore::IDLAttribute<JSTestEventConstructor>::cast):
3224         (WebCore::jsTestEventConstructorConstructor):
3225         (WebCore::setJSTestEventConstructorConstructor):
3226         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3227         (WebCore::IDLOperation<JSTestEventTarget>::cast):
3228         (WebCore::jsTestEventTargetConstructor):
3229         (WebCore::setJSTestEventTargetConstructor):
3230         (WebCore::JSTestEventTarget::toWrapped):
3231         * bindings/scripts/test/JS/JSTestException.cpp:
3232         (WebCore::IDLAttribute<JSTestException>::cast):
3233         (WebCore::jsTestExceptionConstructor):
3234         (WebCore::setJSTestExceptionConstructor):
3235         (WebCore::JSTestException::toWrapped):
3236         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3237         (WebCore::IDLAttribute<JSTestGenerateIsReachable>::cast):
3238         (WebCore::jsTestGenerateIsReachableConstructor):
3239         (WebCore::setJSTestGenerateIsReachableConstructor):
3240         (WebCore::JSTestGenerateIsReachable::toWrapped):
3241         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3242         (WebCore::IDLAttribute<JSTestGlobalObject>::cast):
3243         (WebCore::IDLOperation<JSTestGlobalObject>::cast):
3244         (WebCore::jsTestGlobalObjectConstructor):
3245         (WebCore::setJSTestGlobalObjectConstructor):
3246         (WebCore::JSTestGlobalObject::toWrapped):
3247         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3248         (WebCore::jsTestIndexedSetterNoIdentifierConstructor):
3249         (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
3250         (WebCore::JSTestIndexedSetterNoIdentifier::toWrapped):
3251         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3252         (WebCore::jsTestIndexedSetterThrowingExceptionConstructor):
3253         (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
3254         (WebCore::JSTestIndexedSetterThrowingException::toWrapped):
3255         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3256         (WebCore::IDLOperation<JSTestIndexedSetterWithIdentifier>::cast):
3257         (WebCore::jsTestIndexedSetterWithIdentifierConstructor):
3258         (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
3259         (WebCore::JSTestIndexedSetterWithIdentifier::toWrapped):
3260         * bindings/scripts/test/JS/JSTestInterface.cpp:
3261         (WebCore::IDLAttribute<JSTestInterface>::cast):
3262         (WebCore::IDLOperation<JSTestInterface>::cast):
3263         (WebCore::jsTestInterfaceConstructor):
3264         (WebCore::setJSTestInterfaceConstructor):
3265         (WebCore::JSTestInterface::toWrapped):
3266         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3267         (WebCore::IDLAttribute<JSTestInterfaceLeadingUnderscore>::cast):
3268         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
3269         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
3270         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
3271         * bindings/scripts/test/JS/JSTestIterable.cpp:
3272         (WebCore::IDLOperation<JSTestIterable>::cast):
3273         (WebCore::jsTestIterableConstructor):
3274         (WebCore::setJSTestIterableConstructor):
3275         (WebCore::JSTestIterable::toWrapped):
3276         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3277         (WebCore::IDLAttribute<JSTestJSBuiltinConstructor>::cast):
3278         (WebCore::IDLOperation<JSTestJSBuiltinConstructor>::cast):
3279         (WebCore::jsTestJSBuiltinConstructorConstructor):
3280         (WebCore::setJSTestJSBuiltinConstructorConstructor):
3281         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3282         (WebCore::IDLOperation<JSTestMediaQueryListListener>::cast):
3283         (WebCore::jsTestMediaQueryListListenerConstructor):
3284         (WebCore::setJSTestMediaQueryListListenerConstructor):
3285         (WebCore::JSTestMediaQueryListListener::toWrapped):
3286         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3287         (WebCore::jsTestNamedAndIndexedSetterNoIdentifierConstructor):
3288         (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
3289         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::toWrapped):
3290         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3291         (WebCore::jsTestNamedAndIndexedSetterThrowingExceptionConstructor):
3292         (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
3293         (WebCore::JSTestNamedAndIndexedSetterThrowingException::toWrapped):
3294         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3295         (WebCore::IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::cast):
3296         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierConstructor):
3297         (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
3298         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::toWrapped):
3299         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3300         (WebCore::jsTestNamedConstructorConstructor):
3301         (WebCore::setJSTestNamedConstructorConstructor):
3302         (WebCore::JSTestNamedConstructor::toWrapped):
3303         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3304         (WebCore::jsTestNamedDeleterNoIdentifierConstructor):
3305         (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
3306         (WebCore::JSTestNamedDeleterNoIdentifier::toWrapped):
3307         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3308         (WebCore::jsTestNamedDeleterThrowingExceptionConstructor):
3309         (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
3310         (WebCore::JSTestNamedDeleterThrowingException::toWrapped):
3311         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3312         (WebCore::IDLOperation<JSTestNamedDeleterWithIdentifier>::cast):
3313         (WebCore::jsTestNamedDeleterWithIdentifierConstructor):
3314         (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
3315         (WebCore::JSTestNamedDeleterWithIdentifier::toWrapped):
3316         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3317         (WebCore::jsTestNamedDeleterWithIndexedGetterConstructor):
3318         (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
3319         (WebCore::JSTestNamedDeleterWithIndexedGetter::toWrapped):
3320         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3321         (WebCore::jsTestNamedGetterCallWithConstructor):
3322         (WebCore::setJSTestNamedGetterCallWithConstructor):
3323         (WebCore::JSTestNamedGetterCallWith::toWrapped):
3324         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3325         (WebCore::jsTestNamedGetterNoIdentifierConstructor):
3326         (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
3327         (WebCore::JSTestNamedGetterNoIdentifier::toWrapped):
3328         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3329         (WebCore::IDLOperation<JSTestNamedGetterWithIdentifier>::cast):
3330         (WebCore::jsTestNamedGetterWithIdentifierConstructor):
3331         (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
3332         (WebCore::JSTestNamedGetterWithIdentifier::toWrapped):
3333         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3334         (WebCore::jsTestNamedSetterNoIdentifierConstructor):
3335         (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
3336         (WebCore::JSTestNamedSetterNoIdentifier::toWrapped):
3337         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3338         (WebCore::jsTestNamedSetterThrowingExceptionConstructor):
3339         (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
3340         (WebCore::JSTestNamedSetterThrowingException::toWrapped):
3341         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3342         (WebCore::IDLOperation<JSTestNamedSetterWithIdentifier>::cast):
3343         (WebCore::jsTestNamedSetterWithIdentifierConstructor):
3344         (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
3345         (WebCore::JSTestNamedSetterWithIdentifier::toWrapped):
3346         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3347         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetter>::cast):
3348         (WebCore::jsTestNamedSetterWithIndexedGetterConstructor):
3349         (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
3350         (WebCore::JSTestNamedSetterWithIndexedGetter::toWrapped):
3351         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3352         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetterAndSetter>::cast):
3353         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterConstructor):
3354         (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
3355         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::toWrapped):
3356         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3357         (WebCore::jsTestNamedSetterWithOverrideBuiltinsConstructor):
3358         (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
3359         (WebCore::JSTestNamedSetterWithOverrideBuiltins::toWrapped):
3360         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3361         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgableProperties>::cast):
3362         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgableProperties>::cast):
3363         (WebCore::jsTestNamedSetterWithUnforgablePropertiesConstructor):
3364         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):