Diff
Modified: trunk/Tools/ChangeLog (235831 => 235832)
--- trunk/Tools/ChangeLog 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/ChangeLog 2018-09-08 21:29:49 UTC (rev 235832)
@@ -1,3 +1,125 @@
+2018-09-02 Darin Adler <[email protected]>
+
+ [Cocoa] Turn on ARC for WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=189228
+
+ Reviewed by Sam Weinig.
+
+ * TestRunnerShared/EventSerialization/mac/EventSerializerMac.mm:
+ (+[EventSerializer dictionaryForEvent:relativeToTime:]): Removed autorelease.
+
+ * TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
+ (-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Removed autorelease.
+
+ * WebKitTestRunner/Configurations/Base.xcconfig: Added CLANG_ENABLE_OBJC_ARC.
+
+ * WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm:
+ (WTR::AccessibilityController::accessibleElementById): Use a __bridge cast.
+ * WebKitTestRunner/InjectedBundle/ios/AccessibilityTextMarkerIOS.mm:
+ (WTR::AccessibilityTextMarker::isEqual): Ditto.
+
+ * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+ (WTR::AccessibilityUIElement::AccessibilityUIElement): Removed retain.
+ (WTR::AccessibilityUIElement::~AccessibilityUIElement): Removed release.
+ (WTR::AccessibilityUIElement::removeNotificationListener): Removed release.
+ (WTR::AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Use a __bridge cast.
+ (WTR::AccessibilityUIElement::textMarkerRangeForElement): Ditto.
+ (WTR::AccessibilityUIElement::textMarkerRangeLength): Ditto.
+ (WTR::AccessibilityUIElement::previousTextMarker): Ditto.
+ (WTR::AccessibilityUIElement::nextTextMarker): Ditto.
+ (WTR::AccessibilityUIElement::stringForTextMarkerRange): Ditto.
+ (WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Ditto.
+ (WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange): Ditto.
+ (WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange): Ditto.
+ (WTR::AccessibilityUIElement::accessibilityElementForTextMarker): Ditto.
+ (WTR::AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers): Ditto.
+ (WTR::_CGPathEnumerationIteration): Ditto.
+ (WTR::AccessibilityUIElement::pathDescription const): Ditto.
+
+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
+ (-[AccessibilityNotificationHandler dealloc]): Removed [super dealloc].
+
+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+ (WTR::AccessibilityUIElement::AccessibilityUIElement): Removed retain.
+ (WTR::AccessibilityUIElement::~AccessibilityUIElement): Removed release.
+ (WTR::AccessibilityUIElement::removeNotificationListener): Removed release.
+ (WTR::createJSStringRef): Removed autorelease.
+
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::initializeWebViewConfiguration): Removed release.
+ (WTR::TestController::cocoaPlatformInitialize): Removed release.
+ (WTR::TestController::platformCreateOtherPage): Removed autorelease.
+
+ * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
+ (-[TestRunnerWKWebView dealloc]): Removed [super dealloc] and also many
+ cases of setting properties to nil that were only present for memory
+ management reasons.
+
+ * WebKitTestRunner/ios/GeneratedTouchesDebugWindow.mm:
+ (-[GeneratedTouchesDebugWindow dealloc]): Removed release and [super dealloc].
+
+ * WebKitTestRunner/ios/HIDEventGenerator.mm:
+ (-[HIDEventGenerator dealloc]): Deleted.
+ (-[HIDEventGenerator _sendMarkerHIDEventWithCompletionBlock:]): Removed
+ Block_copy.
+ (-[HIDEventGenerator markerEventReceived:]): Removed Block_release.
+ (-[HIDEventGenerator interpolatedEvents:]): Removed release.
+ (-[HIDEventGenerator sendEventStream:completionBlock:]): Removed autorelease.
+
+ * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+ (-[WebKitTestRunnerWindow dealloc]): Removed [super dealloc].
+ (WTR::PlatformWebView::PlatformWebView): Removed release.
+ (WTR::PlatformWebView::~PlatformWebView): Removed release.
+ (WTR::PlatformWebView::addChromeInputField): Removed release.
+ (WTR::PlatformWebView::removeChromeInputField): Removed release.
+
+ * WebKitTestRunner/ios/TestControllerIOS.mm:
+ (WTR::TestController::initializeInjectedBundlePath): Use __bridge cast.
+ (WTR::TestController::initializeTestPluginDirectory): Ditto.
+
+ * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+ (WTR::UIScriptController::accessibilitySpeakSelectionContent const):
+ Use __bridge cast.
+ (WTR::UIScriptController::enterText): Ditto.
+ (WTR::UIScriptController::selectFormPopoverTitle const): Ditto.
+ (WTR::UIScriptController::textContentType const): Ditto.
+ (WTR::UIScriptController::formInputLabel const): Ditto.
+ (WTR::UIScriptController::scrollingTreeAsText const): Ditto.
+
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+ (WTR::PlatformWebView::~PlatformWebView): Removed release.
+ (WTR::PlatformWebView::addChromeInputField): Removed release.
+
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::allowedFontFamilySet): Removed retain.
+ (WTR::systemHiddenFontFamilySet): Removed retain.
+
+ * WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm:
+ (-[WebKitTestRunnerDraggingInfo draggingDestinationWindow]): Removed retain.
+ (-[WebKitTestRunnerDraggingInfo dealloc]): Deleted.
+
+ * WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm:
+ (+[WebKitTestRunnerPasteboard _pasteboardWithName:]): Removed release.
+ (+[WebKitTestRunnerPasteboard releaseLocalPasteboards]): Removed release.
+ Method name is still OK because setting localPasteboards to nil will
+ still release them.
+ (+[NSPasteboard superAlloc]): Added. Helper so that LocalPasteboard can
+ bypass +[NSPasteboard alloc].
+ (+[NSPasteboard superAllocWithZone:]): Ditto.
+ (+[LocalPasteboard alloc]): Call superAlloc instead of class_createInstance.
+ This is a different way to achieve the "bypass NSPasteboard" behavior we need.
+ (+[LocalPasteboard allocWithZone:]): Added. Calls superAllocWithZone: for the
+ same reason as above. Needed because, at least at this time, +[NSObject alloc]
+ calls +allocWithZone: so we have to override both.
+ (-[LocalPasteboard dealloc]): Deleted.
+ (-[LocalPasteboard addTypes:owner:]): Removed release.
+
+ * WebKitTestRunner/mac/WebKitTestRunnerWindow.mm:
+ (-[WebKitTestRunnerWindow dealloc]): Removed [super dealloc].
+
+ * WebKitTestRunner/mac/main.mm:
+ (disableAppNapInUIProcess): Removed retain.
+
2018-09-07 Fujii Hironori <[email protected]>
[WinCairo][MiniBrowser][WebKit] REGRESSION(r235398): ASSERTION FAILED: !m_client.didReceiveTitleForFrame
Modified: trunk/Tools/TestRunnerShared/EventSerialization/mac/EventSerializerMac.mm (235831 => 235832)
--- trunk/Tools/TestRunnerShared/EventSerialization/mac/EventSerializerMac.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/TestRunnerShared/EventSerialization/mac/EventSerializerMac.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -198,7 +198,7 @@
RetainPtr<CGEventRef> plainEvent = adoptCF(CGEventCreate(NULL));
CGEventRef rawPlainEvent = plainEvent.get();
- NSMutableDictionary *dict = [[[NSMutableDictionary alloc] init] autorelease];
+ NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
FOR_EACH_CGEVENT_INTEGER_FIELD(LOAD_INTEGER_FIELD_FROM_EVENT);
FOR_EACH_CGEVENT_DOUBLE_FIELD(LOAD_DOUBLE_FIELD_FROM_EVENT);
Modified: trunk/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm (235831 => 235832)
--- trunk/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -251,7 +251,7 @@
}
JSPropertyNameArrayRelease(detailsObjectProperties);
}
- [resultsForWord addObject:[[[LayoutTestTextCheckingResult alloc] initWithType:nsTextCheckingType(WTFMove(typeValue)) range:NSMakeRange(fromValue, toValue - fromValue) replacement:(__bridge NSString *)replacementText.get() details:details.get()] autorelease]];
+ [resultsForWord addObject:[[LayoutTestTextCheckingResult alloc] initWithType:nsTextCheckingType(WTFMove(typeValue)) range:NSMakeRange(fromValue, toValue - fromValue) replacement:(__bridge NSString *)replacementText.get() details:details.get()]];
}
auto cfTextToCheck = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, textToCheck));
[results setObject:resultsForWord.get() forKey:(__bridge NSString *)cfTextToCheck.get()];
Modified: trunk/Tools/WebKitTestRunner/Configurations/Base.xcconfig (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/Configurations/Base.xcconfig 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/Configurations/Base.xcconfig 2018-09-08 21:29:49 UTC (rev 235832)
@@ -30,6 +30,7 @@
CLANG_CXX_LANGUAGE_STANDARD = gnu++14;
CLANG_CXX_LIBRARY = libc++;
+CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_CXX0X_EXTENSIONS = NO;
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -93,7 +93,7 @@
RefPtr<AccessibilityUIElement> AccessibilityController::accessibleElementById(JSStringRef idAttribute)
{
WKBundlePageRef page = InjectedBundle::singleton().page()->page();
- id root = static_cast<PlatformUIElement>(WKAccessibilityRootObject(page));
+ id root = (__bridge PlatformUIElement)WKAccessibilityRootObject(page);
id result = findAccessibleObjectById(root, [NSString stringWithJSStringRef:idAttribute]);
if (result)
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityTextMarkerIOS.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityTextMarkerIOS.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityTextMarkerIOS.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -29,7 +29,7 @@
bool AccessibilityTextMarker::isEqual(AccessibilityTextMarker* other)
{
- return [(id)platformTextMarker() isEqual:(id)other->platformTextMarker()];
+ return [(__bridge id)platformTextMarker() isEqual:(__bridge id)other->platformTextMarker()];
}
} // namespace WTR
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -146,8 +146,6 @@
: m_element(element)
, m_notificationHandler(0)
{
- // FIXME: [email protected] says ObjC objects need to be CFRetained/CFRelease to be GC-compliant on the mac.
- [m_element retain];
}
AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
@@ -155,12 +153,10 @@
, m_element(other.m_element)
, m_notificationHandler(0)
{
- [m_element retain];
}
AccessibilityUIElement::~AccessibilityUIElement()
{
- [m_element release];
}
bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement)
@@ -976,7 +972,6 @@
ASSERT(m_notificationHandler);
[m_notificationHandler stopObserving];
- [m_notificationHandler release];
m_notificationHandler = nil;
return true;
@@ -1063,41 +1058,41 @@
// Text markers
RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::lineTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker)
{
- id startTextMarker = [m_element lineStartMarkerForMarker:(id)textMarker->platformTextMarker()];
- id endTextMarker = [m_element lineEndMarkerForMarker:(id)textMarker->platformTextMarker()];
+ id startTextMarker = [m_element lineStartMarkerForMarker:(__bridge id)textMarker->platformTextMarker()];
+ id endTextMarker = [m_element lineEndMarkerForMarker:(__bridge id)textMarker->platformTextMarker()];
NSArray *textMarkers = [NSArray arrayWithObjects:startTextMarker, endTextMarker, nil];
id textMarkerRange = [m_element textMarkerRangeForMarkers:textMarkers];
- return AccessibilityTextMarkerRange::create(textMarkerRange);
+ return AccessibilityTextMarkerRange::create((__bridge PlatformTextMarkerRange)textMarkerRange);
}
RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement* element)
{
id textMarkerRange = [element->platformUIElement() textMarkerRange];
- return AccessibilityTextMarkerRange::create(textMarkerRange);
+ return AccessibilityTextMarkerRange::create((__bridge PlatformTextMarkerRange)textMarkerRange);
}
int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range)
{
- id textMarkers = (id)range->platformTextMarkerRange();
+ id textMarkers = (__bridge id)range->platformTextMarkerRange();
return [m_element lengthForTextMarkers:textMarkers];
}
RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker)
{
- id previousMarker = [m_element previousMarkerForMarker:(id)textMarker->platformTextMarker()];
- return AccessibilityTextMarker::create(previousMarker);
+ id previousMarker = [m_element previousMarkerForMarker:(__bridge id)textMarker->platformTextMarker()];
+ return AccessibilityTextMarker::create((__bridge PlatformTextMarker)previousMarker);
}
RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker)
{
- id nextMarker = [m_element nextMarkerForMarker:(id)textMarker->platformTextMarker()];
- return AccessibilityTextMarker::create(nextMarker);
+ id nextMarker = [m_element nextMarkerForMarker:(__bridge id)textMarker->platformTextMarker()];
+ return AccessibilityTextMarker::create((__bridge PlatformTextMarker)nextMarker);
}
JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
{
- id textMarkers = (id)markerRange->platformTextMarkerRange();
+ id textMarkers = (__bridge id)markerRange->platformTextMarkerRange();
if (!textMarkers || ![textMarkers isKindOfClass:[NSArray class]])
return JSStringCreateWithCharacters(0, 0);
return [[m_element stringForTextMarkers:textMarkers] createJSStringRef];
@@ -1105,23 +1100,23 @@
RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
{
- NSArray *textMarkers = [NSArray arrayWithObjects:(id)startMarker->platformTextMarker(), (id)endMarker->platformTextMarker(), nil];
+ NSArray *textMarkers = [NSArray arrayWithObjects:(__bridge id)startMarker->platformTextMarker(), (__bridge id)endMarker->platformTextMarker(), nil];
id textMarkerRange = [m_element textMarkerRangeForMarkers:textMarkers];
- return AccessibilityTextMarkerRange::create(textMarkerRange);
+ return AccessibilityTextMarkerRange::create((__bridge PlatformTextMarkerRange)textMarkerRange);
}
RefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
{
- id textMarkers = (id)range->platformTextMarkerRange();
+ id textMarkers = (__bridge id)range->platformTextMarkerRange();
id textMarker = [m_element startOrEndTextMarkerForTextMarkers:textMarkers isStart:YES];
- return AccessibilityTextMarker::create(textMarker);
+ return AccessibilityTextMarker::create((__bridge PlatformTextMarker)textMarker);
}
RefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
{
- id textMarkers = (id)range->platformTextMarkerRange();
+ id textMarkers = (__bridge id)range->platformTextMarkerRange();
id textMarker = [m_element startOrEndTextMarkerForTextMarkers:textMarkers isStart:NO];
- return AccessibilityTextMarker::create(textMarker);
+ return AccessibilityTextMarker::create((__bridge PlatformTextMarker)textMarker);
}
RefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
@@ -1141,7 +1136,7 @@
RefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
{
- id obj = [m_element accessibilityObjectForTextMarker:(id)marker->platformTextMarker()];
+ id obj = [m_element accessibilityObjectForTextMarker:(__bridge id)marker->platformTextMarker()];
if (obj)
return AccessibilityUIElement::create(obj);
return nullptr;
@@ -1241,9 +1236,9 @@
{
NSArray *textMarkers = nil;
if (startMarker->platformTextMarker() && endMarker->platformTextMarker())
- textMarkers = [NSArray arrayWithObjects:(id)startMarker->platformTextMarker(), (id)endMarker->platformTextMarker(), nil];
+ textMarkers = [NSArray arrayWithObjects:(__bridge id)startMarker->platformTextMarker(), (__bridge id)endMarker->platformTextMarker(), nil];
id textMarkerRange = [m_element textMarkerRangeFromMarkers:textMarkers withText:[NSString stringWithJSStringRef:text]];
- return AccessibilityTextMarkerRange::create(textMarkerRange);
+ return AccessibilityTextMarkerRange::create((__bridge PlatformTextMarkerRange)textMarkerRange);
}
JSRetainPtr<JSStringRef> AccessibilityUIElement::mathPostscriptsDescription() const
@@ -1258,7 +1253,7 @@
static void _CGPathEnumerationIteration(void *info, const CGPathElement *element)
{
- NSMutableString *result = (NSMutableString *)info;
+ NSMutableString *result = (__bridge NSMutableString *)info;
switch (element->type) {
case kCGPathElementMoveToPoint:
[result appendString:@"\tMove to point\n"];
@@ -1282,9 +1277,7 @@
{
NSMutableString *result = [NSMutableString stringWithString:@"\nStart Path\n"];
CGPathRef pathRef = [m_element _accessibilityPath];
-
- CGPathApply(pathRef, result, _CGPathEnumerationIteration);
-
+ CGPathApply(pathRef, (__bridge void*)result, _CGPathEnumerationIteration);
return [result createJSStringRef];
}
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -83,8 +83,6 @@
JSValueUnprotect(context, m_notificationFunctionCallback);
m_notificationFunctionCallback = 0;
-
- [super dealloc];
}
- (void)setCallback:(JSValueRef)callback
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -91,8 +91,6 @@
: m_element(element)
, m_notificationHandler(0)
{
- // FIXME: [email protected] says ObjC objects need to be CFRetained/CFRelease to be GC-compliant on the mac.
- [m_element retain];
}
AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
@@ -100,7 +98,6 @@
, m_element(other.m_element)
, m_notificationHandler(0)
{
- [m_element retain];
}
AccessibilityUIElement::~AccessibilityUIElement()
@@ -107,7 +104,6 @@
{
// The notification handler should be nil because removeNotificationListener() should have been called in the test.
ASSERT(!m_notificationHandler);
- [m_element release];
}
bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement)
@@ -1558,7 +1554,6 @@
ASSERT(m_notificationHandler);
[m_notificationHandler stopObserving];
- [m_notificationHandler release];
m_notificationHandler = nil;
return true;
@@ -1827,16 +1822,15 @@
static JSStringRef createJSStringRef(id string)
{
- id mutableString = [[[NSMutableString alloc] init] autorelease];
- id attributes = [string attributesAtIndex:0 effectiveRange:nil];
- id attributeEnumerationBlock = ^(NSDictionary<NSString *, id> *attrs, NSRange range, BOOL *stop) {
+ auto mutableString = [[NSMutableString alloc] init];
+ auto attributes = [string attributesAtIndex:0 effectiveRange:nil];
+ auto attributeEnumerationBlock = ^(NSDictionary<NSString *, id> *attrs, NSRange range, BOOL *stop) {
BOOL misspelled = [[attrs objectForKey:NSAccessibilityMisspelledTextAttribute] boolValue];
if (misspelled)
misspelled = [[attrs objectForKey:NSAccessibilityMarkedMisspelledTextAttribute] boolValue];
if (misspelled)
[mutableString appendString:@"Misspelled, "];
- id font = [attributes objectForKey:(__bridge id)kAXFontTextAttribute];
- if (font)
+ if (id font = [attributes objectForKey:(__bridge id)kAXFontTextAttribute])
[mutableString appendFormat:@"%@ - %@, ", (__bridge id)kAXFontTextAttribute, font];
};
[string enumerateAttributesInRange:NSMakeRange(0, [string length]) options:(NSAttributedStringEnumerationOptions)0 usingBlock:attributeEnumerationBlock];
Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -57,7 +57,6 @@
void initializeWebViewConfiguration(const char* libraryPath, WKStringRef injectedBundlePath, WKContextRef context, WKContextConfigurationRef contextConfiguration)
{
#if WK_API_ENABLED
- [globalWebViewConfiguration release];
globalWebViewConfiguration = [[WKWebViewConfiguration alloc] init];
globalWebViewConfiguration.processPool = (__bridge WKProcessPool *)context;
@@ -109,7 +108,6 @@
NSDictionary *resourceLogPlist = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:1], @"version", nil];
if (![resourceLogPlist writeToFile:fullBrowsingSessionResourceLog atomically:YES])
WTFCrash();
- [resourceLogPlist release];
}
WKContextRef TestController::platformContext()
@@ -178,7 +176,7 @@
PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const TestOptions& options)
{
#if WK_API_ENABLED
- WKWebViewConfiguration *newConfiguration = [[globalWebViewConfiguration copy] autorelease];
+ WKWebViewConfiguration *newConfiguration = [globalWebViewConfiguration copy];
newConfiguration._relatedWebView = static_cast<WKWebView*>(parentView->platformView());
return new PlatformWebView(newConfiguration, options);
#else
Modified: trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -84,22 +84,6 @@
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
-
- self.didStartFormControlInteractionCallback = nil;
- self.didEndFormControlInteractionCallback = nil;
- self.didShowForcePressPreviewCallback = nil;
- self.didDismissForcePressPreviewCallback = nil;
- self.willBeginZoomingCallback = nil;
- self.didEndZoomingCallback = nil;
- self.didShowKeyboardCallback = nil;
- self.didHideKeyboardCallback = nil;
- self.didEndScrollingCallback = nil;
- self.rotationDidEndCallback = nil;
-
- self.zoomToScaleCompletionHandler = nil;
- self.retrieveSpeakSelectionContentCompletionHandler = nil;
-
- [super dealloc];
}
- (void)didStartFormControlInteraction
Modified: trunk/Tools/WebKitTestRunner/ios/GeneratedTouchesDebugWindow.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/ios/GeneratedTouchesDebugWindow.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/ios/GeneratedTouchesDebugWindow.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -53,10 +53,6 @@
- (void)dealloc
{
_debugTouchWindow.hidden = YES;
- [_debugTouchWindow release];
- [_debugTouchViews release];
-
- [super dealloc];
}
- (void)updateDebugIndicatorForTouch:(NSUInteger)index withPointInWindowCoordinates:(CGPoint)point isTouching:(BOOL)isTouching
Modified: trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -191,15 +191,6 @@
return self;
}
-- (void)dealloc
-{
- [_eventCallbacks release];
- [_debugTouchViews release];
- [super dealloc];
-}
-
-
-
- (void)_sendIOHIDKeyboardEvent:(uint64_t)timestamp usage:(uint32_t)usage isKeyDown:(bool)isKeyDown
{
RetainPtr<IOHIDEventRef> eventRef = adoptCF(IOHIDEventCreateKeyboardEvent(kCFAllocatorDefault,
@@ -480,7 +471,7 @@
- (BOOL)_sendMarkerHIDEventWithCompletionBlock:(void (^)(void))completionBlock
{
auto callbackID = [HIDEventGenerator nextEventCallbackID];
- [_eventCallbacks setObject:Block_copy(completionBlock) forKey:@(callbackID)];
+ [_eventCallbacks setObject:completionBlock forKey:@(callbackID)];
auto markerEvent = adoptCF(IOHIDEventCreateVendorDefinedEvent(kCFAllocatorDefault,
mach_absolute_time(),
@@ -782,7 +773,6 @@
if (completionBlock) {
[_eventCallbacks removeObjectForKey:@(callbackID)];
completionBlock();
- Block_release(completionBlock);
}
}
@@ -1036,7 +1026,6 @@
newTouch[HIDEventPressureKey] = @(interpolations[interpolationType]([startTouch[HIDEventPressureKey] doubleValue], [endTouch[HIDEventPressureKey] doubleValue], timeRatio));
[newTouches addObject:newTouch];
- [newTouch release];
} else
NSLog(@"Missing End Touch with ID: %ld", (long)startTouchID);
}
@@ -1044,7 +1033,6 @@
newEvent[HIDEventTouchesKey] = newTouches;
[interpolatedEvents addObject:newEvent];
- [newEvent release];
time += timeStep;
}
@@ -1112,10 +1100,10 @@
NSDictionary* threadData = @{
@"eventInfo": [eventInfo copy],
- @"completionBlock": [[completionBlock copy] autorelease]
+ @"completionBlock": [completionBlock copy]
};
- NSThread *eventDispatchThread = [[[NSThread alloc] initWithTarget:self selector:@selector(eventDispatchThreadEntry:) object:threadData] autorelease];
+ NSThread *eventDispatchThread = [[NSThread alloc] initWithTarget:self selector:@selector(eventDispatchThreadEntry:) object:threadData];
eventDispatchThread.qualityOfService = NSQualityOfServiceUserInteractive;
[eventDispatchThread start];
}
Modified: trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -69,7 +69,6 @@
{
allWindows.removeFirst(self);
ASSERT(!allWindows.contains(self));
- [super dealloc];
}
- (BOOL)isKeyWindow
@@ -176,7 +175,6 @@
UIViewController *viewController = [[PlatformWebViewController alloc] init];
[m_window setRootViewController:viewController];
- [viewController release];
m_view = [[TestRunnerWKWebView alloc] initWithFrame:viewRectForWindowRect(rect, WebViewSizingMode::Default) configuration:configuration];
@@ -187,8 +185,6 @@
PlatformWebView::~PlatformWebView()
{
m_window.platformWebView = nil;
- [m_view release];
- [m_window release];
}
PlatformWindow PlatformWebView::keyWindow()
@@ -270,7 +266,6 @@
UITextField* textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 100, 20)];
textField.tag = 1;
[m_window addSubview:textField];
- [textField release];
}
void PlatformWebView::removeChromeInputField()
@@ -279,7 +274,6 @@
if (textField) {
[textField removeFromSuperview];
makeWebViewFirstResponder();
- [textField release];
}
}
Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -86,12 +86,12 @@
void TestController::initializeInjectedBundlePath()
{
NSString *nsBundlePath = [[NSBundle mainBundle].builtInPlugInsPath stringByAppendingPathComponent:@"WebKitTestRunnerInjectedBundle.bundle"];
- m_injectedBundlePath.adopt(WKStringCreateWithCFString((CFStringRef)nsBundlePath));
+ m_injectedBundlePath.adopt(WKStringCreateWithCFString((__bridge CFStringRef)nsBundlePath));
}
void TestController::initializeTestPluginDirectory()
{
- m_testPluginDirectory.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
+ m_testPluginDirectory.adopt(WKStringCreateWithCFString((__bridge CFStringRef)[[NSBundle mainBundle] bundlePath]));
}
void TestController::platformResetPreferencesToConsistentValues()
Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -135,7 +135,7 @@
JSRetainPtr<JSStringRef> UIScriptController::accessibilitySpeakSelectionContent() const
{
TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
- return JSStringCreateWithCFString((CFStringRef)webView.accessibilitySpeakSelectionContent);
+ return adopt(JSStringCreateWithCFString((__bridge CFStringRef)webView.accessibilitySpeakSelectionContent));
}
void UIScriptController::simulateAccessibilitySettingsChangeNotification(JSValueRef callback)
@@ -335,7 +335,7 @@
{
TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
auto textAsCFString = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, text));
- [webView _simulateTextEntered:(NSString *)textAsCFString.get()];
+ [webView _simulateTextEntered:(__bridge NSString *)textAsCFString.get()];
}
void UIScriptController::typeCharacterUsingHardwareKeyboard(JSStringRef character, JSValueRef callback)
@@ -383,19 +383,19 @@
JSRetainPtr<JSStringRef> UIScriptController::selectFormPopoverTitle() const
{
TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
- return JSStringCreateWithCFString((CFStringRef)webView.selectFormPopoverTitle);
+ return adopt(JSStringCreateWithCFString((__bridge CFStringRef)webView.selectFormPopoverTitle));
}
JSRetainPtr<JSStringRef> UIScriptController::textContentType() const
{
TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
- return JSStringCreateWithCFString((CFStringRef)(webView.textContentTypeForTesting ?: @""));
+ return adopt(JSStringCreateWithCFString((__bridge CFStringRef)(webView.textContentTypeForTesting ?: @"")));
}
JSRetainPtr<JSStringRef> UIScriptController::formInputLabel() const
{
TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
- return JSStringCreateWithCFString((CFStringRef)webView.formInputLabel);
+ return adopt(JSStringCreateWithCFString((__bridge CFStringRef)webView.formInputLabel));
}
void UIScriptController::selectFormAccessoryPickerRow(long rowIndex)
@@ -573,7 +573,7 @@
JSRetainPtr<JSStringRef> UIScriptController::scrollingTreeAsText() const
{
TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
- return JSStringCreateWithCFString((CFStringRef)[webView _scrollingTreeAsText]);
+ return adopt(JSStringCreateWithCFString((__bridge CFStringRef)[webView _scrollingTreeAsText]));
}
JSObjectRef UIScriptController::propertiesOfLayerWithID(uint64_t layerID) const
Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -110,8 +110,6 @@
{
m_window.platformWebView = nullptr;
[m_window close];
- [m_window release];
- [m_view release];
}
PlatformWindow PlatformWebView::keyWindow()
@@ -163,7 +161,6 @@
NSTextField *textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
textField.tag = 1;
[[m_window contentView] addSubview:textField];
- [textField release];
NSView *view = platformView();
[textField setNextKeyView:view];
Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -155,7 +155,7 @@
static NSSet *allowedFontFamilySet()
{
- static NSSet *fontFamilySet = [[NSSet setWithObjects:
+ static NSSet *fontFamilySet = [NSSet setWithObjects:
@"Ahem",
@"Al Bayan",
@"American Typewriter",
@@ -277,7 +277,7 @@
@"Wingdings",
@"Zapf Dingbats",
@"Zapfino",
- nil] retain];
+ nil];
return fontFamilySet;
}
@@ -284,9 +284,9 @@
static NSSet *systemHiddenFontFamilySet()
{
- static NSSet *fontFamilySet = [[NSSet setWithObjects:
+ static NSSet *fontFamilySet = [NSSet setWithObjects:
@".LucidaGrandeUI",
- nil] retain];
+ nil];
return fontFamilySet;
}
Modified: trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -41,24 +41,16 @@
if (!self)
return nil;
- _draggedImage = [image retain];
- _draggingPasteboard = [pasteboard retain];
- _draggingSource = [source retain];
+ _draggedImage = image;
+ _draggingPasteboard = pasteboard;
+ _draggingSource = source;
_offset = offset;
return self;
}
-- (void)dealloc
+- (NSWindow *)draggingDestinationWindow
{
- [_draggedImage release];
- [_draggingPasteboard release];
- [_draggingSource release];
- [super dealloc];
-}
-
-- (NSWindow *)draggingDestinationWindow
-{
return [TestController::singleton().mainWebView()->platformView() window];
}
Modified: trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2018 Apple, Inc. All rights reserved.
+ * Copyright (C) 2005-2018 Apple, Inc. All rights reserved.
* Copyright (C) 2007 Graham Dennis ([email protected])
* Copyright (C) 2007 Eric Seidel <[email protected]>
*
@@ -28,7 +28,6 @@
#include "config.h"
#include "WebKitTestRunnerPasteboard.h"
-#include <objc/runtime.h>
#include <wtf/RetainPtr.h>
@interface LocalPasteboard : NSPasteboard
@@ -43,6 +42,11 @@
-(id)initWithName:(NSString *)name;
@end
+@interface NSPasteboard (SuperHelpers)
++ (instancetype)superAlloc;
++ (instancetype)superAllocWithZone:(NSZone *)zone;
+@end
+
static NSMutableDictionary *localPasteboards;
@implementation WebKitTestRunnerPasteboard
@@ -60,7 +64,6 @@
return pasteboard;
pasteboard = [[LocalPasteboard alloc] initWithName:name];
[localPasteboards setObject:pasteboard forKey:name];
- [pasteboard release];
return pasteboard;
}
@@ -72,7 +75,6 @@
+ (void)releaseLocalPasteboards
{
- [localPasteboards release];
localPasteboards = nil;
}
@@ -85,14 +87,34 @@
@end
+@implementation NSPasteboard (SuperHelpers)
+
++ (instancetype)superAlloc
+{
+ return [super alloc];
+}
+
++ (instancetype)superAllocWithZone:(NSZone *)zone
+{
+ return [super allocWithZone:zone];
+}
+
+@end
+
@implementation LocalPasteboard
+ (id)alloc
{
// Need to skip over [NSPasteboard alloc], which won't allocate a new object.
- return class_createInstance(self, 0);
+ return [self superAlloc];
}
++ (id)allocWithZone:(NSZone *)zone
+{
+ // Need to skip over [NSPasteboard allocWithZone:], which won't allocate a new object.
+ return [self superAllocWithZone:zone];
+}
+
- (id)initWithName:(NSString *)name
{
self = [super init];
@@ -105,15 +127,6 @@
return self;
}
-- (void)dealloc
-{
- [typesArray release];
- [typesSet release];
- [dataByType release];
- [pasteboardName release];
- [super dealloc];
-}
-
- (NSString *)name
{
return pasteboardName;
@@ -142,7 +155,6 @@
setType = [type copy];
[typesArray addObject:setType];
[typesSet addObject:setType];
- [setType release];
}
if (newOwner && [newOwner respondsToSelector:@selector(pasteboard:provideDataForType:)])
[newOwner pasteboard:self provideDataForType:setType];
Modified: trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -54,7 +54,6 @@
{
allWindows.removeFirst(self);
ASSERT(!allWindows.contains(self));
- [super dealloc];
}
- (BOOL)isKeyWindow
Modified: trunk/Tools/WebKitTestRunner/mac/main.mm (235831 => 235832)
--- trunk/Tools/WebKitTestRunner/mac/main.mm 2018-09-08 20:51:22 UTC (rev 235831)
+++ trunk/Tools/WebKitTestRunner/mac/main.mm 2018-09-08 21:29:49 UTC (rev 235832)
@@ -53,7 +53,7 @@
static void disableAppNapInUIProcess()
{
NSActivityOptions options = (NSActivityUserInitiatedAllowingIdleSystemSleep | NSActivityLatencyCritical) & ~(NSActivitySuddenTerminationDisabled | NSActivityAutomaticTerminationDisabled);
- static id assertion = [[[NSProcessInfo processInfo] beginActivityWithOptions:options reason:@"WebKitTestRunner should not be subject to process suppression"] retain];
+ static id assertion = [[NSProcessInfo processInfo] beginActivityWithOptions:options reason:@"WebKitTestRunner should not be subject to process suppression"];
ASSERT_UNUSED(assertion, assertion);
}