Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
[WebKit-https.git] / Tools / ChangeLog
1 2018-09-08  Darin Adler  <darin@apple.com>
2
3         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
4         https://bugs.webkit.org/show_bug.cgi?id=189455
5
6         Reviewed by Keith Miller.
7
8         There is a lot of copied and pasted code for WebKit vs. Legacy WebKit
9         testing and even for macOS vs. iOS vs. Windows platform-specific code.
10         For now, this patch just makes corresponding changes to the copied code.
11         Later we might get better results by merging more code instead of having
12         all these separate copies.
13
14         * DumpRenderTree/AccessibilityController.cpp:
15         (AccessibilityController::makeWindowObject): Use the adopt function
16         instead of the special Adopt constructor of JSRetainPtr.
17
18         * DumpRenderTree/AccessibilityTextMarker.cpp: Removed unneeded include.
19
20         * DumpRenderTree/AccessibilityUIElement.cpp: Ditto.
21         (allAttributesCallback): Don't adopt at this level; changed the
22         underlying function to return a JSRetainPtr so the adopt is right next
23         to the call to the create or copy function.
24         (attributesOfLinkedUIElementsCallback): Ditto.
25         (attributesOfDocumentLinksCallback): Ditto.
26         (attributesOfChildrenCallback): Ditto.
27         (parameterizedAttributeNamesCallback): Ditto.
28         (attributesOfColumnHeadersCallback): Ditto.
29         (attributesOfRowHeadersCallback): Ditto.
30         (attributesOfColumnsCallback): Ditto.
31         (attributesOfRowsCallback): Ditto.
32         (attributesOfVisibleCellsCallback): Ditto.
33         (attributesOfHeaderCallback): Ditto.
34         (rowIndexRangeCallback): Ditto.
35         (columnIndexRangeCallback): Ditto.
36         (rangeForLineCallback): Ditto.
37         (boundsForRangeCallback): Ditto.
38         (rangeForPositionCallback): Ditto.
39         (stringForRangeCallback): Ditto.
40         (attributedStringForRangeCallback): Ditto.
41         (uiElementCountForSearchPredicateCallback): Use the free adopt
42         function instead of the adopt member function.
43         (uiElementForSearchPredicateCallback): Ditto.
44         (selectTextWithCriteriaCallback): Don't adopt at this level.
45         (attributedStringForElementCallback): Ditto.
46         (setValueCallback): Use free adopt.
47         (stringAttributeValueCallback): Don't adopt at this level.
48         (uiElementArrayAttributeValueCallback): Ditto.
49         (uiElementAttributeValueCallback): Ditto.
50         (stringForTextMarkerRangeCallback): Ditto.
51         (attributedStringForTextMarkerRangeCallback): Ditto.
52         (attributedStringForTextMarkerRangeWithOptionsCallback): Ditto.
53         (getARIADropEffectsCallback): Ditto.
54         (getClassListCallback): Ditto.
55         (getRoleCallback): Ditto.
56         (getSubroleCallback): Ditto.
57         (getRoleDescriptionCallback): Ditto.
58         (getComputedRoleStringCallback): Ditto.
59         (getTitleCallback): Ditto.
60         (getDescriptionCallback): Ditto.
61         (getStringValueCallback): Ditto.
62         (getLanguageCallback): Ditto.
63         (getHelpTextCallback): Ditto.
64         (getOrientationCallback): Ditto.
65         (getPathDescriptionCallback): Ditto.
66         (getSelectedTextRangeCallback): Ditto.
67         (speakAsCallback): Ditto.
68         (getValueDescriptionCallback): Ditto.
69         (getAccessibilityValueCallback): Ditto.
70         (getDocumentEncodingCallback): Ditto.
71         (getDocumentURICallback): Ditto.
72         (getURLCallback): Ditto.
73         (characterAtOffsetCallback): Ditto.
74         (wordAtOffsetCallback): Ditto.
75         (lineAtOffsetCallback): Ditto.
76         (sentenceAtOffsetCallback): Ditto.
77         (stringForSelectionCallback): Ditto.
78         (getIdentifierCallback): Ditto.
79         (getTraitsCallback): Ditto.
80         (supportedActionsCallback): Ditto.
81         (mathPostscriptsDescriptionCallback): Ditto.
82         (mathPrescriptsDescriptionCallback): Ditto.
83         (AccessibilityUIElement::rangeForLine): Updated to return JSRetainPtr.
84         (AccessibilityUIElement::rangeForPosition): Ditto.
85         (AccessibilityUIElement::speakAs): Ditto.
86         (AccessibilityUIElement::pathDescription const): Ditto.
87         (AccessibilityUIElement::stringForTextMarkerRange): Ditto.
88         (AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
89         (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
90
91         * DumpRenderTree/AccessibilityUIElement.h: Use JSRetainPtr instead of
92         raw pointers for the results of the functions that create strings.
93         The old way was difficult to get right; the functions didn't even follow
94         the create/copy naming rule.
95
96         * DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
97         (_platformTypeConstructor): Use the adopt function instead of the
98         JSRetainPtr adopt constructor. Also nullptr instead of 0.
99
100         * DumpRenderTree/GCController.cpp:
101         (GCController::makeWindowObject): Use adopt function instead of constructor.
102
103         * DumpRenderTree/TestRunner.cpp:
104         (pathToLocalResourceCallback): Use adopt function instead of constructor.
105         (addDisallowedURLCallback): Ditto.
106         (addURLToRedirectCallback): Ditto.
107         (clearApplicationCacheForOriginCallback): Ditto.
108         (applicationCacheDiskUsageForOriginCallback): Ditto.
109         (decodeHostNameCallback): Don't adopt at this level.
110         (encodeHostNameCallback): Ditto.
111         (execCommandCallback): Use adopt instead of JSRetainPtr::adopt.
112         (findStringCallback): Use adopt function instead of constructor.
113         (isCommandEnabledCallback): Ditto.
114         (overridePreferenceCallback): Ditto.
115         (queueLoadCallback): Ditto.
116         (queueLoadHTMLStringCallback): Ditto.
117         (queueLoadingScriptCallback): Ditto.
118         (queueNonLoadingScriptCallback): Ditto.
119         (setAuthenticationPasswordCallback): Ditto.
120         (setAuthenticationUsernameCallback): Ditto.
121         (setDomainRelaxationForbiddenForURLSchemeCallback): Ditto.
122         (setMockGeolocationPositionUnavailableErrorCallback): Ditto.
123         (setPOSIXLocaleCallback): Ditto.
124         (setPersistentUserStyleSheetLocationCallback): Ditto.
125         (setUserStyleSheetLocationCallback): Ditto.
126         (setValueForUserCallback): Ditto.
127         (setWillSendRequestClearHeaderCallback): Ditto.
128         (setPageVisibilityCallback): Ditto.
129         (evaluateInWebInspectorCallback): Ditto.
130         (evaluateScriptInIsolatedWorldCallback): Ditto.
131         (evaluateScriptInIsolatedWorldAndReturnValueCallback): Ditto.
132         (addOriginAccessWhitelistEntryCallback): Ditto.
133         (removeOriginAccessWhitelistEntryCallback): Ditto.
134         (setScrollbarPolicyCallback): Ditto.
135         (addUserScriptCallback): Ditto.
136         (addUserStyleSheetCallback): Ditto.
137         (apiTestNewWindowDataLoadBaseURLCallback): Ditto.
138         (authenticateSessionCallback): Ditto.
139         (getTitleTextDirectionCallback): Ditto.
140         (getInspectorTestStubURLCallback): Ditto.
141         (simulateLegacyWebNotificationClickCallback): Ditto.
142         (setTextDirectionCallback): Ditto.
143         (grantWebNotificationPermissionCallback): Ditto.
144         (denyWebNotificationPermissionCallback): Ditto.
145         (accummulateLogsForChannel): Ditto.
146         (runUIScriptCallback): Ditto.
147         (TestRunner::makeWindowObject): Ditto.
148         (TestRunner::uiScriptDidComplete): Ditto.
149         (TestRunner::setOpenPanelFiles): Ditto.
150
151         * DumpRenderTree/TestRunner.h: Use JSRetainPtr instead of
152         raw pointers for the results of the functions that create strings.
153
154         * DumpRenderTree/ios/AccessibilityControllerIOS.mm:
155         (AccessibilityController::platformName const): Use the adopt
156         function instead of the adopt constructor.
157
158         * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
159         (createEmptyJSString): Added. This helper function makes reduces the
160         repetitive code to create empty strings.
161         (concatenateAttributeAndValue): Changed to return a JSRetainPtr.
162         (AccessibilityUIElement::identifier): Ditto.
163         (AccessibilityUIElement::traits): Ditto.
164         (AccessibilityUIElement::url): Ditto.
165         (AccessibilityUIElement::speakAs): Ditto.
166         (AccessibilityUIElement::stringForSelection): Ditto.
167         (AccessibilityUIElement::stringForRange): Ditto.
168         (AccessibilityUIElement::attributedStringForRange): Ditto.
169         (AccessibilityUIElement::attributedStringForElement): Ditto.
170         (AccessibilityUIElement::pathDescription const): Ditto.
171         (AccessibilityUIElement::stringForTextMarkerRange): Ditto.
172         (AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
173         (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
174         (AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
175         (AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
176         (AccessibilityUIElement::attributesOfChildren): Ditto.
177         (AccessibilityUIElement::allAttributes): Ditto.
178         (AccessibilityUIElement::stringAttributeValue): Ditto.
179         (AccessibilityUIElement::parameterizedAttributeNames): Ditto.
180         (AccessibilityUIElement::role): Ditto.
181         (AccessibilityUIElement::subrole): Ditto.
182         (AccessibilityUIElement::roleDescription): Ditto.
183         (AccessibilityUIElement::computedRoleString): Ditto.
184         (AccessibilityUIElement::title): Ditto.
185         (AccessibilityUIElement::description): Ditto.
186         (AccessibilityUIElement::orientation const): Ditto.
187         (AccessibilityUIElement::stringValue): Ditto.
188         (AccessibilityUIElement::language): Ditto.
189         (AccessibilityUIElement::helpText const): Ditto.
190         (AccessibilityUIElement::valueDescription): Ditto.
191         (AccessibilityUIElement::ariaDropEffects const): Ditto.
192         (AccessibilityUIElement::boundsForRange): Ditto.
193         (AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
194         (AccessibilityUIElement::attributesOfRowHeaders): Ditto.
195         (AccessibilityUIElement::attributesOfColumns): Ditto.
196         (AccessibilityUIElement::attributesOfRows): Ditto.
197         (AccessibilityUIElement::attributesOfVisibleCells): Ditto.
198         (AccessibilityUIElement::attributesOfHeader): Ditto.
199         (AccessibilityUIElement::rowIndexRange): Ditto.
200         (AccessibilityUIElement::columnIndexRange): Ditto.
201         (AccessibilityUIElement::selectedTextRange): Ditto.
202         (AccessibilityUIElement::accessibilityValue const): Ditto.
203         (AccessibilityUIElement::documentEncoding): Ditto.
204         (AccessibilityUIElement::documentURI): Ditto.
205         (AccessibilityUIElement::selectTextWithCriteria): Ditto.
206         (AccessibilityUIElement::classList const): Ditto.
207
208         * DumpRenderTree/mac/AccessibilityCommonMac.h: Changed the
209         createJSStringRef method to return a JSRetainPtr.
210         * DumpRenderTree/mac/AccessibilityCommonMac.mm:
211         (-[NSString createJSStringRef]): Ditto.
212         (searchPredicateParameterizedAttributeForSearchCriteria): Use the
213         adopt function instead of the adopt constructor.
214         * DumpRenderTree/mac/AccessibilityControllerMac.mm:
215         (AccessibilityController::platformName const): Ditto.
216
217         * DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
218         (-[NSString createJSStringRef]): Return a JSRetainPtr.
219         (makeValueRefForValue): Updated for the above, no adopt needed here now.
220         (makeObjectRefForDictionary): Ditto.
221         (-[AccessibilityNotificationHandler _notificationReceived:]): Ditto.
222
223         * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
224         (createEmptyJSString): Added. This helper function makes reduces the
225         repetitive code to create empty strings.
226         (concatenateAttributeAndValue): Changed to return a JSRetainPtr.
227         (descriptionOfElements): Ditto.
228         (selectTextParameterizedAttributeForCriteria): Ditto.
229         (AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
230         (AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
231         (AccessibilityUIElement::attributesOfChildren): Ditto.
232         (AccessibilityUIElement::allAttributes): Ditto.
233         (AccessibilityUIElement::stringAttributeValue): Ditto.
234         (AccessibilityUIElement::parameterizedAttributeNames): Ditto.
235         (AccessibilityUIElement::role): Ditto.
236         (AccessibilityUIElement::subrole): Ditto.
237         (AccessibilityUIElement::roleDescription): Ditto.
238         (AccessibilityUIElement::computedRoleString): Ditto.
239         (AccessibilityUIElement::title): Ditto.
240         (AccessibilityUIElement::description): Ditto.
241         (AccessibilityUIElement::orientation const): Ditto.
242         (AccessibilityUIElement::stringValue): Ditto.
243         (AccessibilityUIElement::language): Ditto.
244         (AccessibilityUIElement::helpText const): Ditto.
245         (AccessibilityUIElement::valueDescription): Ditto.
246         (AccessibilityUIElement::speakAs): Ditto.
247         (AccessibilityUIElement::classList const): Ditto.
248         (AccessibilityUIElement::ariaDropEffects const): Ditto.
249         (AccessibilityUIElement::rangeForLine): Ditto.
250         (AccessibilityUIElement::rangeForPosition): Ditto.
251         (AccessibilityUIElement::boundsForRange): Ditto.
252         (AccessibilityUIElement::stringForRange): Ditto.
253         (AccessibilityUIElement::attributedStringForRange): Ditto.
254         (AccessibilityUIElement::selectTextWithCriteria): Ditto.
255         (AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
256         (AccessibilityUIElement::attributesOfRowHeaders): Ditto.
257         (AccessibilityUIElement::attributesOfColumns): Ditto.
258         (AccessibilityUIElement::attributesOfRows): Ditto.
259         (AccessibilityUIElement::attributesOfVisibleCells): Ditto.
260         (AccessibilityUIElement::attributesOfHeader): Ditto.
261         (AccessibilityUIElement::rowIndexRange): Ditto.
262         (AccessibilityUIElement::columnIndexRange): Ditto.
263         (AccessibilityUIElement::pathDescription const): Ditto.
264         (AccessibilityUIElement::selectedTextRange): Ditto.
265         (AccessibilityUIElement::accessibilityValue const): Ditto.
266         (AccessibilityUIElement::documentEncoding): Ditto.
267         (AccessibilityUIElement::documentURI): Ditto.
268         (AccessibilityUIElement::url): Ditto.
269         (AccessibilityUIElement::stringForTextMarkerRange): Ditto.
270         (createJSStringRef): Ditto.
271         (AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
272         (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
273         (AccessibilityUIElement::supportedActions): Ditto.
274         (AccessibilityUIElement::mathPostscriptsDescription const): Ditto.
275         (AccessibilityUIElement::mathPrescriptsDescription const): Ditto.
276
277         * DumpRenderTree/mac/FrameLoadDelegate.mm:
278         (-[FrameLoadDelegate didClearWindowObjectForFrame:inIsolatedWorld:]):
279         Use the adopt function instead of the adopt constructor.
280         * DumpRenderTree/mac/TestRunnerMac.mm:
281         (originsArrayToJS): Ditto.
282         (TestRunner::copyDecodedHostName): Return a JSRetainPtr.
283         (TestRunner::copyEncodedHostName): Ditto.
284         (TestRunner::pathToLocalResource): Ditto.
285         (TestRunner::queueLoad): Use adopt function instead of constructor.
286         (TestRunner::findString): Ditto.
287         (TestRunner::inspectorTestStubURL): Return a JSRetainPtr.
288
289         * DumpRenderTree/win/AccessibilityControllerWin.cpp:
290         (AccessibilityController::winNotificationReceived): Use adopt function
291         instead of adopt constructor.
292         (AccessibilityController::platformName const): Ditto.
293
294         * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
295         (createEmptyJSString): Added. This helper function makes reduces the
296         repetitive code to create empty strings.
297         (AccessibilityUIElement::allAttributes): Changed to return a JSRetainPtr.
298         (AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
299         (AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
300         (AccessibilityUIElement::attributesOfChildren): Ditto.
301         (AccessibilityUIElement::parameterizedAttributeNames): Ditto.
302         (AccessibilityUIElement::role): Ditto.
303         (AccessibilityUIElement::subrole): Ditto.
304         (AccessibilityUIElement::roleDescription): Ditto.
305         (AccessibilityUIElement::computedRoleString): Ditto.
306         (AccessibilityUIElement::title): Ditto.
307         (AccessibilityUIElement::description): Ditto.
308         (AccessibilityUIElement::stringValue): Ditto.
309         (AccessibilityUIElement::language): Ditto.
310         (AccessibilityUIElement::helpText const): Ditto.
311         (AccessibilityUIElement::valueDescription): Ditto.
312         (AccessibilityUIElement::ariaDropEffects const): Ditto.
313         (AccessibilityUIElement::orientation const): Ditto.
314         (AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
315         (AccessibilityUIElement::attributesOfRowHeaders): Ditto.
316         (AccessibilityUIElement::attributesOfColumns): Ditto.
317         (AccessibilityUIElement::attributesOfRows): Ditto.
318         (AccessibilityUIElement::attributesOfVisibleCells): Ditto.
319         (AccessibilityUIElement::attributesOfHeader): Ditto.
320         (AccessibilityUIElement::rowIndexRange): Ditto.
321         (AccessibilityUIElement::columnIndexRange): Ditto.
322         (AccessibilityUIElement::boundsForRange): Ditto.
323         (AccessibilityUIElement::stringForRange): Ditto.
324         (AccessibilityUIElement::attributedStringForRange): Ditto.
325         (AccessibilityUIElement::selectTextWithCriteria): Ditto.
326         (AccessibilityUIElement::selectedTextRange): Ditto.
327         (AccessibilityUIElement::stringAttributeValue): Ditto.
328         (AccessibilityUIElement::accessibilityValue const): Ditto.
329         (AccessibilityUIElement::documentEncoding): Ditto.
330         (AccessibilityUIElement::documentURI): Ditto.
331         (AccessibilityUIElement::url): Ditto.
332         (AccessibilityUIElement::classList const): Ditto.
333
334         * DumpRenderTree/win/TestRunnerWin.cpp:
335         (TestRunner::copyDecodedHostName): Changed to return a JSRetainPtr.
336         (TestRunner::copyEncodedHostName): Ditto.
337         (TestRunner::pathToLocalResource): Ditto.
338         (TestRunner::queueLoad): Ditto.
339         (TestRunner::findString): Ditto.
340         (TestRunner::inspectorTestStubURL): Ditto.
341
342         * TestRunnerShared/Bindings/JSWrapper.h:
343         (WTR::setProperty): Use adopt function instead of constructor.
344         * TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
345         (UIScriptContext::UIScriptContext): Ditto.
346         (UIScriptContext::runUIScript): Ditto.
347         * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
348         (WTR::toDeviceOrientation): Ditto.
349
350         * TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
351         (nsTextCheckingType): Changed this function to not take an rvalue
352         reference to a JSRetainPtr since it doesn't take ownership.
353         (-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Updated
354         for the above change.
355
356         * TestWebKitAPI/JavaScriptTest.cpp:
357         (TestWebKitAPI::javaScriptCallback): Use adopt function instead of
358         adopt member function.
359
360         * TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp: Removed unneeded include.
361         * TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm: Ditto.
362         * TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm: Use adopt function instead of
363         adopt constructor.
364         * TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm: Ditto.
365
366         * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
367         Removed unneeded includes.
368         * WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp: Ditto.
369         * WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp: Ditto.
370         * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: Ditto.
371
372         * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
373         (_platformTypeConstructor): Use the adopt function instead of the
374         JSRetainPtr adopt constructor. Also nullptr instead of 0.
375
376         * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
377         (WTR::arrayLength): Use adopt function instead of constructor.
378         (WTR::parseModifierArray): Ditto.
379         * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
380         (WTR::propertyValue): Ditto.
381         (WTR::dumpPath): Ditto.
382         (WTR::toJS): Ditto.
383         * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
384         (WTR::TestRunner::findString): Ditto.
385         (WTR::TestRunner::statisticsDidRunTelemetryCallback): Ditto.
386         (WTR::TestRunner::callDidReceiveAllStorageAccessEntriesCallback): Ditto.
387         (WTR::TestRunner::setOpenPanelFiles): Ditto.
388         * WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm:
389         (WTR::AccessibilityController::platformName): Ditto.
390
391         * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
392         (-[NSString createJSStringRef]): Return a JSRetainPtr.
393         This fixes storage leaks in many functions below, which were using
394         the create function and putting the value right into a JSRetainPtr
395         without adoption.
396         (WTR::createEmptyJSString): Added. This helper function reduces the
397         repetitive code to create empty strings.
398         (WTR::concatenateAttributeAndValue): Return a JSRetainPtr.
399         (WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
400         Use createEmptyJSString, fixing a storage leak due to missing adoption.
401         (WTR::AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
402         (WTR::AccessibilityUIElement::attributesOfChildren): Ditto.
403         (WTR::AccessibilityUIElement::allAttributes): Ditto.
404         (WTR::AccessibilityUIElement::stringAttributeValue): Ditto.
405         (WTR::AccessibilityUIElement::parameterizedAttributeNames): Ditto.
406         (WTR::AccessibilityUIElement::role): Ditto.
407         (WTR::AccessibilityUIElement::subrole): Ditto.
408         (WTR::AccessibilityUIElement::roleDescription): Ditto.
409         (WTR::AccessibilityUIElement::computedRoleString): Ditto.
410         (WTR::AccessibilityUIElement::title): Ditto.
411         (WTR::AccessibilityUIElement::orientation const): Ditto.
412         (WTR::AccessibilityUIElement::language): Ditto.
413         (WTR::AccessibilityUIElement::valueDescription): Ditto.
414         (WTR::AccessibilityUIElement::ariaDropEffects const): Ditto.
415         (WTR::AccessibilityUIElement::boundsForRange): Ditto.
416         (WTR::AccessibilityUIElement::stringForRange): Removed unneeded null check.
417         (WTR::AccessibilityUIElement::attributedStringForRange): Ditto.
418         (WTR::AccessibilityUIElement::attributesOfColumnHeaders):
419         Use createEmptyJSString, fixing a storage leak due to missing adoption.
420         (WTR::AccessibilityUIElement::attributesOfRowHeaders): Ditto.
421         (WTR::AccessibilityUIElement::attributesOfColumns): Ditto.
422         (WTR::AccessibilityUIElement::attributesOfRows): Ditto.
423         (WTR::AccessibilityUIElement::attributesOfVisibleCells): Ditto.
424         (WTR::AccessibilityUIElement::attributesOfHeader): Ditto.
425         (WTR::AccessibilityUIElement::selectedTextRange): Ditto.
426         (WTR::AccessibilityUIElement::accessibilityValue const): Ditto.
427         (WTR::AccessibilityUIElement::documentEncoding): Ditto.
428         (WTR::AccessibilityUIElement::documentURI): Ditto.
429         (WTR::AccessibilityUIElement::stringForSelection): Removed unneeded
430         null check.
431         (WTR::AccessibilityUIElement::stringForTextMarkerRange):
432         Use createEmptyJSString, fixing a storage leak due to missing adoption.
433
434         * WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h:
435         Use JSRetainPtr for the return value of createJSStringRef.
436         * WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm:
437         (-[NSString createJSStringRef]): Ditto.
438         (WTR::searchPredicateParameterizedAttributeForSearchCriteria): Use the
439         adopt function instead of the adopt constructor.
440         * WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
441         (WTR::AccessibilityController::platformName): Ditto
442
443         * WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
444         (-[NSString createJSStringRef]): Return a JSRetainPtr.
445         (makeValueRefForValue): Updated for above by removing adopt.
446         (makeObjectRefForDictionary): Ditto.
447         (-[AccessibilityNotificationHandler _notificationReceived:]): Ditto.
448
449         * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
450         (WTR::createEmptyJSString): Added. This helper function makes reduces the
451         repetitive code to create empty strings.
452         (WTR::concatenateAttributeAndValue): Return a JSRetainPtr.
453         (WTR::descriptionOfElements): Ditto.
454         (WTR::selectTextParameterizedAttributeForCriteria): Ditto.
455         (WTR::AccessibilityUIElement::accessibilityValue const): Use createEmptyJSString,
456         fixing a storage leak due to missing adoption.
457         (WTR::AccessibilityUIElement::documentEncoding): Ditto.
458         (WTR::AccessibilityUIElement::documentURI): Ditto.
459         (WTR::createJSStringRef): Return a JSRetainPtr.
460
461         * WebKitTestRunner/StringFunctions.h:
462         (WTR::toWK): Take a const& to eliminate a little bit of reference count churn.
463         (WTR::toJS): Use the adopt function instead of the constructor.
464
465 2018-09-14  Dean Jackson  <dino@grorg.org>
466
467         Add Justin Michaud.
468
469         * Scripts/webkitpy/common/config/contributors.json:
470
471 2018-09-14  Ryan Haddad  <ryanhaddad@apple.com>
472
473         bots should pass --clobber-old-results to run-webkit-tests
474         https://bugs.webkit.org/show_bug.cgi?id=189623
475
476         Reviewed by Aakash Jain.
477
478         In order to ensure that bots to not produce confusing results due to transient execptions,
479         or run out of space if they continually hit an exception, old layout test results should be clobbered.
480
481         * BuildSlaveSupport/build.webkit.org-config/steps.py:
482         (RunWebKitTests):
483
484 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
485
486         Unreviewed, rolling out r235954.
487
488         Breaks the watchOS build.
489
490         Reverted changeset:
491
492         "Move IndexedDB to Network Process"
493         https://bugs.webkit.org/show_bug.cgi?id=189415
494         https://trac.webkit.org/changeset/235954
495
496 2018-09-13  Daniel Bates  <dabates@apple.com>
497
498         Add Copy WebKit Permalink plugin for Sublime Text
499         https://bugs.webkit.org/show_bug.cgi?id=189589
500
501         Rubber-stamped by Joseph Pecoraro.
502
503         Port the Copy WebKit Permalink Automator service to a Sublime Text plugin. Once installed you can
504         use the plugin to copy to the Clipboard a trac.webkit.org hyperlink to the selected line in the
505         active document with or without blame annotations.
506
507         Once installed, you can Control-click (on Mac) or right-click (on Windows and Linux) on a line and
508         choose Copy WebKit Permalink or Copy WebKit Permalink to Blame from the context menu to copy to the
509         Clipboard a permanent hyperlink to the selected line without or with blame annotations, respectively.
510         On Mac you can also invoke the same functionality using the keyboard shortcuts Command + Shift + Control + C
511         and Command + Shift + Control + Option + C, respectively.
512
513         * CopyPermalink/Sublime Text/CopyWebKitPermalink/Context.sublime-menu: Added.
514         * CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py: Added.
515         * CopyPermalink/Sublime Text/CopyWebKitPermalink/Default (OSX).sublime-keymap: Added.
516         * CopyPermalink/Sublime Text/INSTALL: Added.
517         * CopyPermalink/Xcode/Copy WebKit Permalink.workflow/Contents/Info.plist: Renamed from Tools/CopyPermalink/Copy WebKit Permalink.workflow/Contents/Info.plist.
518         * CopyPermalink/Xcode/Copy WebKit Permalink.workflow/Contents/document.wflow: Renamed from Tools/CopyPermalink/Copy WebKit Permalink.workflow/Contents/document.wflow.
519         * CopyPermalink/Xcode/INSTALL: Renamed from Tools/CopyPermalink/README.
520
521 2018-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
522
523         Unreviewed. Fix WebDriver tests after r235225.
524
525         Use wpt serve command to run the http server.
526
527         * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py:
528         (WebDriverW3CWebServer.__init__):
529         (WebDriverW3CWebServer.start):
530         (WebDriverW3CWebServer.stop):
531
532 2018-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
533
534         [GTK][WPE] Allow to run script dialogs asynchronously in the UI process
535         https://bugs.webkit.org/show_bug.cgi?id=189544
536
537         Reviewed by Michael Catanzaro.
538
539         Add test cases for the new API.
540
541         * TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
542         (testWebViewJavaScriptDialogs):
543
544 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
545
546         [Win][Clang][ImageDiff] Fix compilation error and warning of PlatformImageCairo.cpp
547         https://bugs.webkit.org/show_bug.cgi?id=189496
548         <rdar://problem/44370981>
549
550         Unreviewed warning fix.
551
552         r235929 has introduced a new compilation warning:
553         > Tools/ImageDiff/cairo/PlatformImageCairo.cpp:34:70: warning: unused parameter ‘imageSize’ [-Wunused-parameter]
554
555         * ImageDiff/cairo/PlatformImageCairo.cpp:
556         (ImageDiff::PlatformImage::createFromStdin): Removed the variable name.
557
558 2018-09-12  Dan Bernstein  <mitz@apple.com>
559
560         [Cocoa] Complete support for Paste as Quotation
561         https://bugs.webkit.org/show_bug.cgi?id=189504
562
563         Reviewed by Wenson Hsieh.
564
565         * MiniBrowser/mac/MainMenu.xib: Added a Paste as Quotation command in the Edit menu.
566
567 2018-09-12  Sihui Liu  <sihui_liu@apple.com>
568
569         Move IndexedDB to Network Process
570         https://bugs.webkit.org/show_bug.cgi?id=189415
571
572         Reviewed by Geoffrey Garen.
573
574         * TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm:
575         (TEST):
576         * TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm:
577         (TEST):
578         * TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm:
579         (TEST):
580         * TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm:
581         (TEST):
582         * TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm:
583         (TEST):
584
585 2018-09-12  Chris Dumez  <cdumez@apple.com>
586
587         PSON: No process swap on back navigation after URL bar navigation
588         https://bugs.webkit.org/show_bug.cgi?id=189557
589         <rdar://problem/44353108>
590
591         Reviewed by Alex Christensen.
592
593         Add API test coverage.
594
595         * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
596
597 2018-09-11  Dean Jackson  <dino@apple.com>
598
599         Header parsing for experimental and internal debug features
600         https://bugs.webkit.org/show_bug.cgi?id=189486
601         <rdar://problem/44320618>
602
603         Reviewed by Tim Horton.
604
605         Keep track of experimental and internal debug features in TestOptions, and
606         allow webkit-test-runner headers to toggle them by name.
607
608         * DumpRenderTree/TestOptions.cpp:
609         (TestOptions::TestOptions):
610         * WebKitTestRunner/TestController.cpp:
611         (WTR::TestController::resetPreferencesToConsistentValues):
612         (WTR::updateTestOptionsFromTestHeader):
613         * WebKitTestRunner/TestOptions.h:
614         (WTR::TestOptions::hasSameInitializationOptions const):
615
616 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
617
618         [Win][Clang][DumpRenderTree] 0 and nullptr can't be implicitly converted to AccessibilityUIElement
619         https://bugs.webkit.org/show_bug.cgi?id=189492
620
621         Reviewed by Alex Christensen.
622
623         0 and nullptr can't be implicitly converted to
624         AccessibilityUIElement because only Windows port typedefs
625         PlatformUIElement as COMPtr<IAccessible> not a pointer.
626
627         Replaced "return 0" and "return nullptr" with "return { nullptr }".
628
629         * DumpRenderTree/AccessibilityUIElement.cpp:
630         (AccessibilityUIElement::horizontalScrollbar const):
631         (AccessibilityUIElement::verticalScrollbar const):
632         (AccessibilityUIElement::uiElementAttributeValue const):
633         (AccessibilityUIElement::accessibilityElementForTextMarker):
634         * DumpRenderTree/win/AccessibilityControllerWin.cpp:
635         (AccessibilityController::elementAtPoint):
636         (AccessibilityController::accessibleElementById):
637         (AccessibilityController::focusedElement):
638         (AccessibilityController::rootElement):
639         * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
640         (AccessibilityUIElement::elementAtPoint):
641         (AccessibilityUIElement::linkedUIElementAtIndex):
642         (AccessibilityUIElement::getChildAtIndex):
643         (AccessibilityUIElement::titleUIElement):
644         (AccessibilityUIElement::parentElement):
645         (AccessibilityUIElement::uiElementForSearchPredicate):
646         (AccessibilityUIElement::cellForColumnAndRow):
647         (AccessibilityUIElement::disclosedRowAtIndex):
648         (AccessibilityUIElement::ariaOwnsElementAtIndex):
649         (AccessibilityUIElement::ariaFlowToElementAtIndex):
650         (AccessibilityUIElement::ariaControlsElementAtIndex):
651         (AccessibilityUIElement::selectedRowAtIndex):
652         (AccessibilityUIElement::rowAtIndex):
653         (AccessibilityUIElement::disclosedByRow):
654         (AccessibilityUIElement::selectedChildAtIndex const):
655
656 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
657
658         FontManagerTests.ChangeFontColorWithColorPanel fails on macOS Sierra
659         https://bugs.webkit.org/show_bug.cgi?id=189382
660
661         Reviewed by Ryosuke Niwa.
662
663         Fix the test by specifying colors in RGB colorspace.
664
665         * TestWebKitAPI/Tests/mac/FontManagerTests.mm:
666         (TestWebKitAPI::TEST):
667
668 2018-09-11  Fujii Hironori  <Hironori.Fujii@sony.com>
669
670         [Win][Clang][ImageDiff] Fix compilation error and warning of PlatformImageCairo.cpp
671         https://bugs.webkit.org/show_bug.cgi?id=189496
672
673         Reviewed by Alex Christensen.
674
675         * ImageDiff/cairo/PlatformImageCairo.cpp:
676         (ImageDiff::PlatformImage::createFromStdin): Removed unnecessary ReadContext struct.
677         (ImageDiff::PlatformImage::writeAsPNGToStdout): Use '%lu' format type specifier for unsigned long.
678
679 2018-09-07  Dean Jackson  <dino@apple.com>
680
681         Add and expose Internal features from WebKit
682         https://bugs.webkit.org/show_bug.cgi?id=189442
683         <rdar://problem/44243404>
684
685         Reviewed by Simon Fraser.
686
687         Update MiniBrowser to expose an Internal feature menu.
688
689         * MiniBrowser/mac/AppDelegate.m:
690         (defaultConfiguration):
691         * MiniBrowser/mac/SettingsController.m:
692         (-[SettingsController _populateMenu]):
693         (-[SettingsController validateMenuItem:]):
694         (-[SettingsController toggleExperimentalFeature:]):
695         (-[SettingsController toggleInternalDebugFeature:]):
696
697 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
698
699         [macOS] [WK2] Support changing foreground colors via color panel
700         https://bugs.webkit.org/show_bug.cgi?id=189382
701         <rdar://problem/44227311>
702
703         Reviewed by Ryosuke Niwa.
704
705         Add an API test that uses NSColorPanel to change the color of selected text, and also apply typing styles when
706         the selection is collapsed. The test also exercises switching between opaque colors (alpha = 1) and transparent
707         colors, as well as making different parts of a word different colors.
708
709         * TestWebKitAPI/Tests/mac/FontManagerTests.mm:
710         (-[TestWKWebView collapseToEnd]):
711         (webViewForFontManagerTesting):
712         (TestWebKitAPI::TEST):
713         * TestWebKitAPI/cocoa/TestWKWebView.h:
714
715 == Rolled over to ChangeLog-2018-09-11 ==