WebKit Bugzilla
Attachment 346483 Details for
Bug 188245
: [Cocoa] More tweaks and refactoring to prepare for ARC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188245-20180803075634.patch (text/plain), 169.36 KB, created by
Darin Adler
on 2018-08-03 07:56:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2018-08-03 07:56:35 PDT
Size:
169.36 KB
patch
obsolete
>Subversion Revision: 234543 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 4ce72a21d3fb58b8b43606eb20ee064f7650a472..a1c1a6764b3e604f66f8b3c739567718fbbfb7d0 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-08-01 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * API/JSValue.mm: >+ (JSContainerConvertor::convert): Use CFTypeRef instead of id for objects in a HashMap. >+ (JSContainerConvertor::add): Ditto. >+ (ObjcContainerConvertor::convert): Ditto. >+ (ObjcContainerConvertor::add): Ditto. >+ * API/JSWrapperMap.mm: >+ (allocateConstructorForCustomClass): Ditto. >+ (-[JSWrapperMap initWithGlobalContextRef:]): Ditto. >+ (-[JSWrapperMap jsWrapperForObject:inContext:]): Ditto. >+ > 2018-08-02 Saam Barati <sbarati@apple.com> > > Reading instructionPointer from PlatformRegisters may fail when using pointer profiling >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index bdfe9bed7a84f86c0d39a34ea27eb536f3f16f56..d1d71af1e8a63d524f1096678828544f70c21fe2 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,16 @@ >+2018-08-01 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/BlockPtr.h: Added missing include of "StdLibExtras.h". >+ Also re-sorted includes. >+ >+ * wtf/WeakObjCPtr.h: Use mutable instead of const_cast, and use >+ __weak explicitly under ARC. >+ > 2018-08-02 Saam Barati <sbarati@apple.com> > > Reading instructionPointer from PlatformRegisters may fail when using pointer tagging >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 18556bcad14e53165296b4b09681cfe6719bea56..12bed1034f725c7f2aa48bafcd7d7c644845b8a7 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,26 @@ >+2018-08-01 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Platform/cocoa/WKCrashReporter.mm: >+ (WebKit::setCrashLogMessage): Refactor into a separate function for clarity. >+ (WebKit::setCrashReportApplicationSpecificInformation): Use a bridging cast. >+ >+ * Shared/mac/PasteboardTypes.mm: >+ (WebKit::PasteboardTypes::forEditing): Use a bridging cast. >+ >+ * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: >+ (WebKit::convertToNPNNString): Added. Uses CFStringRef rather than NSString so we can >+ manually manage the autoreleasing. >+ (WebKit::initializeKeyboardEvent): Use convertToNPNNString. >+ (WebKit::NetscapePlugin::sendComplexTextInput): Ditto. >+ >+ * WebProcess/Plugins/PDF/PDFPlugin.mm: Use __unsafe_unretained explicitly >+ for a parent pointer. We could consider moving to __weak after switching to ARC. >+ > 2018-08-03 Carlos Garcia Campos <cgarcia@igalia.com> > > [WPE] WebDriver: add support for action commands >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 6a4842ae9fe4f42ea7446d65381080b1b4c59b67..aa2b4150df556947f0a22049b81a3e2afb67425e 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,154 @@ >+2018-08-01 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Carbon/CarbonWindowFrame.m: >+ (-[CarbonWindowFrame dealloc]): Deleted. It was empty. >+ >+ * DOM/DOM.mm: >+ (-[DOMElement _imageTIFFRepresentation]): Use a bridging cast. >+ (-[DOMNodeFilter finalize]): Deleted. WebKit no longer supports Objective-C >+ garbage collection so this method isn't useful. >+ >+ * DOM/DOMXPath.mm: >+ (-[DOMNativeXPathNSResolver finalize]): Deleted. WebKit no longer supports >+ Objective-C garbage collection so this method isn't useful. >+ >+ * History/WebHistory.mm: >+ (-[WebHistoryPrivate data]): Allocate an NSData instead of casting from a CFData. >+ >+ * Misc/WebElementDictionary.mm: >+ (addLookupKey): Use a bridging cast. >+ (cacheValueForKey): Ditto. >+ (-[WebElementDictionary _fillCache]): Ditto. >+ (-[WebElementDictionary objectForKey:]): Ditto. >+ >+ * Misc/WebKitNSStringExtras.mm: >+ (-[NSString _web_drawAtPoint:font:textColor:]): Use a bridging cast. >+ (-[NSString _web_widthWithFont:]): Ditto. >+ (-[NSString _webkit_stringByTrimmingWhitespace]): Ditto. >+ >+ * Misc/WebLocalizableStrings.mm: >+ (WebLocalizedString): Use a bridging cast. >+ >+ * Misc/WebNSDataExtras.mm: >+ (-[NSString _web_capitalizeRFC822HeaderFieldName]): Use a bridging cast >+ and use CFBridgingRelease instead of calling autorelease directly. >+ (-[NSData _webkit_parseRFC822HeaderFields]): Use NSString methods instead >+ of a mix of CFString and NSString. Also simplified logic a bit, and cut down >+ on the amount of explicit release and autorelease. >+ >+ * Misc/WebNSDictionaryExtras.h: Deleted unused methods. >+ * Misc/WebNSDictionaryExtras.m: >+ (-[NSDictionary _webkit_intForKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setInt:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setFloat:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setBool:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setLongLong:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setUnsignedLongLong:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setUnsignedInt:forKey:]): Deleted. >+ >+ * Misc/WebStringTruncator.mm: >+ (fontFromNSFont): Use a bridging cast. >+ >+ * Plugins/Hosted/NetscapePluginHostManager.mm: >+ (WebKit::preferredBundleLocalizationName): Use a bridging cast and CFBridgingRelease. >+ >+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm: >+ (WebKit::NetscapePluginInstanceProxy::cleanup): Use a bridging cast. >+ (WebKit::NetscapePluginInstanceProxy::status): Ditto. >+ (WebKit::NetscapePluginInstanceProxy::loadURL): Ditto. >+ (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): Ditto. >+ * Plugins/Hosted/ProxyInstance.mm: >+ (WebKit::ProxyInstance::getPropertyNames): Ditto. >+ * Plugins/WebBasePluginPackage.mm: >+ (-[WebBasePluginPackage _objectForInfoDictionaryKey:]): Ditto. >+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm: >+ (WebNetscapePluginEventHandlerCocoa::platformWindow): Ditto. >+ * Plugins/WebNetscapePluginPackage.mm: >+ (-[WebNetscapePluginPackage _initWithPath:]): Ditto. >+ >+ * Plugins/WebNetscapePluginView.mm: >+ (-[WebNetscapePluginView _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]): >+ Use bridging casts and use RetainPtr insteead of an explicit CFRelease. >+ (-[WebNetscapePluginView status:]): Use a bridging cast. >+ (-[WebNetscapePluginView popUpContextMenu:]): Ditto. >+ >+ * Plugins/WebPluginController.mm: >+ (-[WebPluginController _cancelOutstandingChecks]): Use a bridging cast. >+ >+ * Plugins/WebPluginDatabase.mm: >+ (checkCandidate): Use explicit __strong for out argument types. >+ >+ * Plugins/npapi.mm: >+ (pluginViewForInstance): Use a bridging cast. >+ >+ * Storage/WebDatabaseManager.mm: >+ (-[WebDatabaseManager detailsForDatabase:withOrigin:]): Use modern boxing instead of >+ explicit NSNumber and NSDictionary calls. >+ >+ * WebCoreSupport/WebContextMenuClient.mm: >+ (WebContextMenuClient::speak): Remove an unnecessary copy/autorelease pair. >+ >+ * WebCoreSupport/WebEditorClient.mm: >+ (WebEditorClient::handleKeyboardEvent): Added a missing typecast. >+ (WebEditorClient::handleInputMethodKeydown): Ditto. >+ >+ * WebCoreSupport/WebFrameNetworkingContext.mm: >+ (WebFrameNetworkingContext::sourceApplicationAuditData const): Use a bridging cast. >+ >+ * WebCoreSupport/WebSecurityOriginPrivate.h: Forward declare WebSecurityOriginPrivate >+ as a struct rather than an Objective-C class, since that's how it's defined. >+ >+ * WebInspector/WebNodeHighlighter.mm: Added missing includes. >+ >+ * WebView/WebFullScreenController.mm: >+ (-[WebFullScreenController enterFullScreen:]): Use a bridging cast. >+ * WebView/WebHTMLView.mm: >+ (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]): >+ Ditto. >+ (-[WebHTMLView pasteboard:provideDataForType:]): Ditto. >+ >+ * WebView/WebImmediateActionController.mm: >+ (-[WebImmediateActionController performHitTestAtPoint:]): Removed redundant code to >+ go down to the document and then back to the frame. >+ (-[WebImmediateActionController immediateActionRecognizerDidUpdateAnimation:]): Ditto. >+ (-[WebImmediateActionController immediateActionRecognizerDidCancelAnimation:]): Ditto. >+ (-[WebImmediateActionController immediateActionRecognizerDidCompleteAnimation:]): Ditto. >+ >+ * WebView/WebJSPDFDoc.mm: >+ (jsPDFDocInitialize): Removed some unneeded type casting. >+ (jsPDFDocFinalize): Ditto. >+ (jsPDFDocPrint): Use a bridging cast. >+ >+ * WebView/WebPDFView.mm: >+ (_applicationInfoForMIMEType): Use bridging casts. >+ >+ * WebView/WebPreferences.mm: >+ (-[WebPreferences _setIntegerValue:forKey:]): Use boxing and setObject directly >+ instead of methods from WebNSDictionaryExtras. >+ (-[WebPreferences _setUnsignedIntValue:forKey:]): Ditto. >+ (-[WebPreferences _setFloatValue:forKey:]): Ditto. >+ (-[WebPreferences _setBoolValue:forKey:]): Ditto. >+ (-[WebPreferences _setLongLongValue:forKey:]): Ditto. >+ (-[WebPreferences _setUnsignedLongLongValue:forKey:]): Ditto. >+ >+ * WebView/WebView.mm: >+ (-[WebView _removeFromAllWebViewsSet]): Use bridging cast. >+ (-[WebView _addToAllWebViewsSet]): Ditto. >+ (+[WebView closeAllWebViews]): Use a modern for loop instead of NSEnumerator. >+ (-[WebView _windowVisibilityChanged:]): Moved this into the internal category >+ so it can be called from WebViewData methods. >+ >+ * WebView/WebViewData.mm: Added an import so we can call an internal WebView >+ method, _windowVisibilityChanged:. >+ >+ * WebView/WebViewInternal.h: Declared _windowVisibilityChanged: so it can be >+ called from WebViewData methods. >+ > 2018-08-01 Nan Wang <n_wang@apple.com> > > AX: AOM: Add ARIA IDL Attribute Reflection >diff --git a/Source/JavaScriptCore/API/JSValue.mm b/Source/JavaScriptCore/API/JSValue.mm >index 543531ba4b8bf6280e63210f9e76c10afe7ccbb8..c69e8f4fa80fff80b864cc425ea7d849867fff6c 100644 >--- a/Source/JavaScriptCore/API/JSValue.mm >+++ b/Source/JavaScriptCore/API/JSValue.mm >@@ -636,16 +636,16 @@ public: > > private: > JSGlobalContextRef m_context; >- HashMap<JSValueRef, id> m_objectMap; >+ HashMap<JSValueRef, CFTypeRef> m_objectMap; > Vector<Task> m_worklist; > Vector<JSC::Strong<JSC::Unknown>> m_jsValues; > }; > > inline id JSContainerConvertor::convert(JSValueRef value) > { >- HashMap<JSValueRef, id>::iterator iter = m_objectMap.find(value); >+ auto iter = m_objectMap.find(value); > if (iter != m_objectMap.end()) >- return iter->value; >+ return (__bridge id)iter->value; > > Task result = valueToObjectWithoutCopy(m_context, value); > if (result.js) >@@ -657,7 +657,7 @@ void JSContainerConvertor::add(Task task) > { > JSC::ExecState* exec = toJS(m_context); > m_jsValues.append(JSC::Strong<JSC::Unknown>(exec->vm(), toJSForGC(exec, task.js))); >- m_objectMap.add(task.js, task.objc); >+ m_objectMap.add(task.js, (__bridge CFTypeRef)task.objc); > if (task.type != ContainerNone) > m_worklist.append(task); > } >@@ -887,7 +887,7 @@ public: > > private: > JSContext *m_context; >- HashMap<id, JSValueRef> m_objectMap; >+ HashMap<CFTypeRef, JSValueRef> m_objectMap; > Vector<Task> m_worklist; > Vector<JSC::Strong<JSC::Unknown>> m_jsValues; > }; >@@ -896,7 +896,7 @@ JSValueRef ObjcContainerConvertor::convert(id object) > { > ASSERT(object); > >- auto it = m_objectMap.find(object); >+ auto it = m_objectMap.find((__bridge CFTypeRef)object); > if (it != m_objectMap.end()) > return it->value; > >@@ -909,7 +909,7 @@ void ObjcContainerConvertor::add(ObjcContainerConvertor::Task task) > { > JSC::ExecState* exec = toJS(m_context.JSGlobalContextRef); > m_jsValues.append(JSC::Strong<JSC::Unknown>(exec->vm(), toJSForGC(exec, task.js))); >- m_objectMap.add(task.objc, task.js); >+ m_objectMap.add((__bridge CFTypeRef)task.objc, task.js); > if (task.type != ContainerNone) > m_worklist.append(task); > } >diff --git a/Source/JavaScriptCore/API/JSWrapperMap.mm b/Source/JavaScriptCore/API/JSWrapperMap.mm >index 91a2129c6bf5aaae1d2a06435f955f91b8a164e1..c6c973ebdea116f669a77a90a8478c469c5d62a4 100644 >--- a/Source/JavaScriptCore/API/JSWrapperMap.mm >+++ b/Source/JavaScriptCore/API/JSWrapperMap.mm >@@ -408,7 +408,7 @@ static JSC::JSObject* allocateConstructorForCustomClass(JSContext *context, cons > return constructorWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls); > > // For each protocol that the class implements, gather all of the init family methods into a hash table. >- __block HashMap<String, Protocol *> initTable; >+ __block HashMap<String, CFTypeRef> initTable; > Protocol *exportProtocol = getJSExportProtocol(); > for (Class currentClass = cls; currentClass; currentClass = class_getSuperclass(currentClass)) { > forEachProtocolImplementingProtocol(currentClass, exportProtocol, ^(Protocol *protocol, bool&) { >@@ -416,7 +416,7 @@ static JSC::JSObject* allocateConstructorForCustomClass(JSContext *context, cons > const char* name = sel_getName(selector); > if (!isInitFamilyMethod(@(name))) > return; >- initTable.set(name, protocol); >+ initTable.set(name, (__bridge CFTypeRef)protocol); > }); > }); > } >@@ -436,7 +436,7 @@ static JSC::JSObject* allocateConstructorForCustomClass(JSContext *context, cons > > numberOfInitsFound++; > initMethod = selector; >- initProtocol = iter->value; >+ initProtocol = (__bridge Protocol *)iter->value; > types = method_getTypeEncoding(method); > }); > >@@ -565,7 +565,7 @@ @end > > @implementation JSWrapperMap { > NSMutableDictionary *m_classMap; >- std::unique_ptr<JSC::WeakGCMap<id, JSC::JSObject>> m_cachedJSWrappers; >+ std::unique_ptr<JSC::WeakGCMap<CFTypeRef, JSC::JSObject>> m_cachedJSWrappers; > NSMapTable *m_cachedObjCWrappers; > } > >@@ -579,7 +579,7 @@ - (instancetype)initWithGlobalContextRef:(JSGlobalContextRef)context > NSPointerFunctionsOptions valueOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality; > m_cachedObjCWrappers = [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0]; > >- m_cachedJSWrappers = std::make_unique<JSC::WeakGCMap<id, JSC::JSObject>>(toJS(context)->vm()); >+ m_cachedJSWrappers = std::make_unique<JSC::WeakGCMap<CFTypeRef, JSC::JSObject>>(toJS(context)->vm()); > > ASSERT(!toJSGlobalObject(context)->wrapperMap()); > toJSGlobalObject(context)->setWrapperMap(self); >@@ -621,7 +621,7 @@ - (JSObjCClassInfo*)classInfoForClass:(Class)cls > - (JSValue *)jsWrapperForObject:(id)object inContext:(JSContext *)context > { > ASSERT(toJSGlobalObject([context JSGlobalContextRef])->wrapperMap() == self); >- JSC::JSObject* jsWrapper = m_cachedJSWrappers->get(object); >+ JSC::JSObject* jsWrapper = m_cachedJSWrappers->get((__bridge CFTypeRef)object); > if (jsWrapper) > return [JSValue valueWithJSValueRef:toRef(jsWrapper) inContext:context]; > >@@ -637,7 +637,7 @@ - (JSValue *)jsWrapperForObject:(id)object inContext:(JSContext *)context > // (1) For immortal objects JSValues will effectively leak and this results in error output being logged - we should avoid adding associated objects to immortal objects. > // (2) A long lived object may rack up many JSValues. When the contexts are released these will unprotect the associated JavaScript objects, > // but still, would probably nicer if we made it so that only one associated object was required, broadcasting object dealloc. >- m_cachedJSWrappers->set(object, jsWrapper); >+ m_cachedJSWrappers->set((__bridge CFTypeRef)object, jsWrapper); > return [JSValue valueWithJSValueRef:toRef(jsWrapper) inContext:context]; > } > >diff --git a/Source/WTF/wtf/BlockPtr.h b/Source/WTF/wtf/BlockPtr.h >index ac3e12c36b7c2fce16918c461e2a835b34b33bef..753fe369e92803490695e0e16c14e782b4c637f2 100644 >--- a/Source/WTF/wtf/BlockPtr.h >+++ b/Source/WTF/wtf/BlockPtr.h >@@ -25,7 +25,11 @@ > > #pragma once > >+#include "StdLibExtras.h" > #include <Block.h> >+#include <utility> >+#include <wtf/Assertions.h> >+ > #if CPU(ARM64E) > #include <WebKitAdditions/BlockQualifiers.h> > #else >@@ -33,8 +37,6 @@ > #define WTF_DISPOSE_FUNCTION_POINTER_QUALIFIER > #define WTF_INVOKE_FUNCTION_POINTER_QUALIFIER > #endif >-#include <utility> >-#include <wtf/Assertions.h> > > namespace WTF { > >diff --git a/Source/WTF/wtf/WeakObjCPtr.h b/Source/WTF/wtf/WeakObjCPtr.h >index f910830b85a18d9f85ecaf1ee35b197255f69ecc..6494a6d29b2e5b84f6f8f1739e76a92fd4679b67 100644 >--- a/Source/WTF/wtf/WeakObjCPtr.h >+++ b/Source/WTF/wtf/WeakObjCPtr.h >@@ -59,7 +59,7 @@ public: > > WeakObjCPtr(const WeakObjCPtr& other) > { >- objc_copyWeak(&m_weakReference, const_cast<id*>(&other.m_weakReference)); >+ objc_copyWeak(&m_weakReference, &other.m_weakReference); > } > > WeakObjCPtr(WeakObjCPtr&& other) >@@ -86,18 +86,22 @@ public: > > RetainPtr<ValueType> get() const > { >- return adoptNS(objc_loadWeakRetained(const_cast<id*>(&m_weakReference))); >+ return adoptNS(objc_loadWeakRetained(&m_weakReference)); > } > > ValueType *getAutoreleased() const > { >- return static_cast<ValueType *>(objc_loadWeak(const_cast<id*>(&m_weakReference))); >+ return static_cast<ValueType *>(objc_loadWeak(&m_weakReference)); > } > > explicit operator ValueType *() const { return getAutoreleased(); } > > private: >- id m_weakReference; >+#if defined(__OBJC__) && __has_feature(objc_arc) >+ mutable __weak id m_weakReference; >+#else >+ mutable id m_weakReference; >+#endif > }; > > } // namespace WTF >diff --git a/Source/WebKit/Platform/cocoa/WKCrashReporter.mm b/Source/WebKit/Platform/cocoa/WKCrashReporter.mm >index a4e6dee705f8e4edd7b54b74ca1652142f94744f..923d3ba94c889303d9c3338502fbd68997a1c62f 100644 >--- a/Source/WebKit/Platform/cocoa/WKCrashReporter.mm >+++ b/Source/WebKit/Platform/cocoa/WKCrashReporter.mm >@@ -26,6 +26,7 @@ > #import "config.h" > #import "WKCrashReporter.h" > >+#import <cstdlib> > #import "CrashReporterClientSPI.h" > > // Avoid having to link with libCrashReporterClient.a >@@ -36,19 +37,21 @@ __attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION))) > > namespace WebKit { > >-void setCrashReportApplicationSpecificInformation(CFStringRef infoString) >+static void setCrashLogMessage(const char* message) > { >- if (char* oldMessage = const_cast<char*>(CRGetCrashLogMessage())) >- free(oldMessage); >+ // We have to copy the string because CRSetCrashLogMessage doesn't. >+ char* copiedMessage = message ? strdup(message) : nullptr; >+ >+ CRSetCrashLogMessage(copiedMessage); > >- if (!infoString) { >- CRSetCrashLogMessage(nullptr); >- return; >- } >+ // Delete the message from last time, so we don't keep leaking messages. >+ static char* previousCopiedCrashLogMessage; >+ std::free(std::exchange(previousCopiedCrashLogMessage, copiedMessage)); >+} > >- // We have to copy the string, because CRSetCrashLogMessage doesn't copy the data. >- char* lastInfoChars = strdup([(NSString *)infoString UTF8String]); >- CRSetCrashLogMessage(lastInfoChars); >+void setCrashReportApplicationSpecificInformation(CFStringRef infoString) >+{ >+ setCrashLogMessage([(__bridge NSString *)infoString UTF8String]); > } > > } >diff --git a/Source/WebKit/Shared/mac/PasteboardTypes.mm b/Source/WebKit/Shared/mac/PasteboardTypes.mm >index d47b12d0b67d86175402bd58214c764aabda243b..712f9d785a34223a2fa541baf78e20b7a30da81f 100644 >--- a/Source/WebKit/Shared/mac/PasteboardTypes.mm >+++ b/Source/WebKit/Shared/mac/PasteboardTypes.mm >@@ -47,7 +47,7 @@ static inline NSArray *retain(NSArray *array) > NSArray* PasteboardTypes::forEditing() > { > static NSArray *types = retain([NSArray arrayWithObjects:WebArchivePboardType, WebCore::legacyHTMLPasteboardType(), WebCore::legacyFilenamesPasteboardType(), WebCore::legacyTIFFPasteboardType(), WebCore::legacyPDFPasteboardType(), >- WebCore::legacyURLPasteboardType(), WebCore::legacyRTFDPasteboardType(), WebCore::legacyRTFPasteboardType(), WebCore::legacyStringPasteboardType(), WebCore::legacyColorPasteboardType(), kUTTypePNG, nil]); >+ WebCore::legacyURLPasteboardType(), WebCore::legacyRTFDPasteboardType(), WebCore::legacyRTFPasteboardType(), WebCore::legacyStringPasteboardType(), WebCore::legacyColorPasteboardType(), (__bridge NSString *)kUTTypePNG, nil]); > return types; > } > >diff --git a/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm >index 8bbed6bedc9517ea7f7e5ab4f7b9092f577bc1c2..55590c1d38c393bdcd4b49e9c099fc3b23d8d104 100644 >--- a/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm >+++ b/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm >@@ -741,6 +741,12 @@ static bool isFlagsChangedEvent(const WebKeyboardEvent& keyboardEvent) > return false; > } > >+static NPNSString *convertToNPNNString(const String& string) >+{ >+ CFTypeRef releasedString = string.createCFString().autorelease(); >+ return static_cast<NPNSString*>(const_cast<void*>(releasedString)); >+} >+ > static NPCocoaEvent initializeKeyboardEvent(const WebKeyboardEvent& keyboardEvent) > { > NPCocoaEventType eventType; >@@ -763,8 +769,8 @@ static NPCocoaEvent initializeKeyboardEvent(const WebKeyboardEvent& keyboardEven > > NPCocoaEvent event = initializeEvent(eventType); > event.data.key.modifierFlags = modifierFlags(keyboardEvent); >- event.data.key.characters = reinterpret_cast<NPNSString*>(static_cast<NSString*>(keyboardEvent.text())); >- event.data.key.charactersIgnoringModifiers = reinterpret_cast<NPNSString*>(static_cast<NSString*>(keyboardEvent.unmodifiedText())); >+ event.data.key.characters = convertToNPNNString(keyboardEvent.text()); >+ event.data.key.charactersIgnoringModifiers = convertToNPNNString(keyboardEvent.unmodifiedText()); > event.data.key.isARepeat = keyboardEvent.isAutoRepeat(); > event.data.key.keyCode = keyboardEvent.nativeVirtualKeyCode(); > >@@ -1020,7 +1026,7 @@ void NetscapePlugin::sendComplexTextInput(const String& textInput) > switch (m_eventModel) { > case NPEventModelCocoa: { > NPCocoaEvent event = initializeEvent(NPCocoaEventTextInput); >- event.data.text.text = reinterpret_cast<NPNSString*>(static_cast<NSString*>(textInput)); >+ event.data.text.text = convertToNPNNString(textInput); > NPP_HandleEvent(&event); > break; > } >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >index 3c895bcb1c3f98956fce1b16b5a04a5a2fa68a71..a2eb402d0748174a866c4acc382ceefb43f320e7 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >@@ -127,7 +127,7 @@ static const int defaultScrollMagnitudeThresholdForPageFlip = 20; > > @interface WKPDFPluginAccessibilityObject : NSObject { > PDFLayerController *_pdfLayerController; >- NSObject *_parent; >+ __unsafe_unretained NSObject *_parent; > WebKit::PDFPlugin* _pdfPlugin; > } > >diff --git a/Source/WebKitLegacy/mac/Carbon/CarbonWindowFrame.m b/Source/WebKitLegacy/mac/Carbon/CarbonWindowFrame.m >index ac2a5f7c44119251b9c89c0ab1cb6a7a7cbf1fe6..e926eb6c21e0fa88f28dc4a061c390225325eb97 100644 >--- a/Source/WebKitLegacy/mac/Carbon/CarbonWindowFrame.m >+++ b/Source/WebKitLegacy/mac/Carbon/CarbonWindowFrame.m >@@ -128,15 +128,6 @@ - (id)initWithFrame:(NSRect)inFrameRect styleMask:(unsigned int)inStyleMask owne > } > > >-// Deallocate. >-- (void)dealloc { >- >- // Simple. >- [super dealloc]; >- >-} >- >- > // Sink a method invocation. > - (void)_setFrameNeedsDisplay:(BOOL)needsDisplay { > >diff --git a/Source/WebKitLegacy/mac/DOM/DOM.mm b/Source/WebKitLegacy/mac/DOM/DOM.mm >index 83d56d0448655f76a8c76b9b93ceeefb8a7dd81a..8ebb8a0daf6345f21903d6fecb24d8f14e06c2a1 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOM.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOM.mm >@@ -694,7 +694,7 @@ - (NSData *)_imageTIFFRepresentation > auto* cachedImage = downcast<RenderImage>(*renderer).cachedImage(); > if (!cachedImage || cachedImage->errorOccurred()) > return nil; >- return (NSData *)cachedImage->imageForRenderer(renderer)->tiffRepresentation(); >+ return (__bridge NSData *)cachedImage->imageForRenderer(renderer)->tiffRepresentation(); > } > > #endif >@@ -843,13 +843,6 @@ - (void)dealloc > [super dealloc]; > } > >-- (void)finalize >-{ >- if (_internal) >- reinterpret_cast<WebCore::NodeFilter*>(_internal)->deref(); >- [super finalize]; >-} >- > - (short)acceptNode:(DOMNode *)node > { > if (!node) >diff --git a/Source/WebKitLegacy/mac/DOM/DOMXPath.mm b/Source/WebKitLegacy/mac/DOM/DOMXPath.mm >index 53dc22de1ea99b018716d5a7d782664614f24002..cda837ac7d9229dca4bda63f368c3dfb949118d3 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMXPath.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMXPath.mm >@@ -45,13 +45,6 @@ - (void)dealloc > [super dealloc]; > } > >-- (void)finalize >-{ >- if (_internal) >- IMPL->deref(); >- [super finalize]; >-} >- > - (NSString *)lookupNamespaceURI:(NSString *)prefix > { > return IMPL->lookupNamespaceURI(prefix); >diff --git a/Source/WebKitLegacy/mac/History/WebHistory.mm b/Source/WebKitLegacy/mac/History/WebHistory.mm >index 13832e1a527feb0699bf0580ca8a7f99da52aeb8..12c9006d42b282add01231e993ebb42c41b2ae25 100644 >--- a/Source/WebKitLegacy/mac/History/WebHistory.mm >+++ b/Source/WebKitLegacy/mac/History/WebHistory.mm >@@ -644,10 +644,10 @@ - (BOOL)loadFromURL:(NSURL *)URL collectDiscardedItemsInto:(NSMutableArray *)dis > - (NSData *)data > { > if (_entriesByDate->isEmpty()) { >- static NSData *emptyHistoryData = (NSData *)CFDataCreate(0, 0, 0); >+ static NSData *emptyHistoryData = [[NSData alloc] initWithBytes:nullptr length:0]; > return emptyHistoryData; > } >- >+ > // Ignores the date and item count limits; these are respected when loading instead of when saving, so > // that clients can learn of discarded items by listening to WebHistoryItemsDiscardedWhileLoadingNotification. > WebHistoryWriter writer(_entriesByDate.get()); >diff --git a/Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm b/Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm >index c3cb9aa5041a8025665cc7e7e02e26feea8fbf5c..b7f7b2824a9dc66788f0283aab971199f60a2397 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm >@@ -53,13 +53,13 @@ static CFMutableDictionaryRef lookupTable = NULL; > > static void addLookupKey(NSString *key, SEL selector) > { >- CFDictionaryAddValue(lookupTable, key, selector); >+ CFDictionaryAddValue(lookupTable, (__bridge CFStringRef)key, selector); > } > > static void cacheValueForKey(const void *key, const void *value, void *self) > { > // calling objectForKey will cache the value in our _cache dictionary >- [(WebElementDictionary *)self objectForKey:(NSString *)key]; >+ [(__bridge WebElementDictionary *)self objectForKey:(__bridge NSString *)key]; > } > > @implementation WebElementDictionary >@@ -124,7 +124,7 @@ - (void)dealloc > > - (void)_fillCache > { >- CFDictionaryApplyFunction(lookupTable, cacheValueForKey, self); >+ CFDictionaryApplyFunction(lookupTable, cacheValueForKey, (__bridge void*)self); > _cacheComplete = YES; > } > >@@ -148,7 +148,7 @@ - (id)objectForKey:(id)key > if (value || _cacheComplete || [_nilValues containsObject:key]) > return value; > >- SEL selector = static_cast<SEL>(const_cast<void*>(CFDictionaryGetValue(lookupTable, key))); >+ SEL selector = static_cast<SEL>(const_cast<void*>(CFDictionaryGetValue(lookupTable, (__bridge CFTypeRef)key))); > if (!selector) > return nil; > value = [self performSelector:selector]; >diff --git a/Source/WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm b/Source/WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm >index ac436617c28e87782cfc1ac1f0c68798b051e22a..7f99502f36b74923f311e0061aebe14d76646cce 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm >@@ -68,7 +68,7 @@ - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor * > [self getCharacters:buffer.data()]; > > if (canUseFastRenderer(buffer.data(), length)) { >- FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize])); >+ FontCascade webCoreFont(FontPlatformData((__bridge CTFontRef)font, [font pointSize])); > TextRun run(StringView(buffer.data(), length)); > > // The following is a half-assed attempt to match AppKit's rounding rules for drawAtPoint. >@@ -111,7 +111,7 @@ - (float)_web_widthWithFont:(NSFont *)font > [self getCharacters:buffer.data()]; > > if (canUseFastRenderer(buffer.data(), length)) { >- FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize])); >+ FontCascade webCoreFont(FontPlatformData((__bridge CTFontRef)font, [font pointSize])); > TextRun run(StringView(buffer.data(), length)); > return webCoreFont.width(run); > } >@@ -162,7 +162,7 @@ -(NSString *)_webkit_filenameByFixingIllegalCharacters > -(NSString *)_webkit_stringByTrimmingWhitespace > { > NSMutableString *trimmed = [[self mutableCopy] autorelease]; >- CFStringTrimWhitespace((CFMutableStringRef)trimmed); >+ CFStringTrimWhitespace((__bridge CFMutableStringRef)trimmed); > return trimmed; > } > >diff --git a/Source/WebKitLegacy/mac/Misc/WebLocalizableStrings.mm b/Source/WebKitLegacy/mac/Misc/WebLocalizableStrings.mm >index 2a8a837619fa68483e5f03d1f5dba7dfa6ac4cd0..2c480dbaf0eb20bbe9b5d5db84ff40a961c318c9 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebLocalizableStrings.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebLocalizableStrings.mm >@@ -62,7 +62,7 @@ NSString *WebLocalizedString(WebLocalizableStringsBundle *stringsBundle, const c > } > NSString *notFound = @"localized string not found"; > CFStringRef keyString = CFStringCreateWithCStringNoCopy(NULL, key, kCFStringEncodingUTF8, kCFAllocatorNull); >- NSString *result = [bundle localizedStringForKey:(NSString *)keyString value:notFound table:nil]; >+ NSString *result = [bundle localizedStringForKey:(__bridge NSString *)keyString value:notFound table:nil]; > CFRelease(keyString); > ASSERT_WITH_MESSAGE(result != notFound, "could not find localizable string %s in bundle", key); > return result; >diff --git a/Source/WebKitLegacy/mac/Misc/WebNSDataExtras.mm b/Source/WebKitLegacy/mac/Misc/WebNSDataExtras.mm >index b01ffb7e0cfd260507549a525abddd9952c82d76..a1394a80a92a4553ea1e7d90b5721dd921819f3d 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebNSDataExtras.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebNSDataExtras.mm >@@ -36,7 +36,7 @@ @implementation NSString (WebNSDataExtrasInternal) > > - (NSString *)_web_capitalizeRFC822HeaderFieldName > { >- CFStringRef name = (CFStringRef)self; >+ CFStringRef name = (__bridge CFStringRef)self; > NSString *result = nil; > > CFIndex len = CFStringGetLength(name); >@@ -82,13 +82,13 @@ - (NSString *)_web_capitalizeRFC822HeaderFieldName > } > if (somethingChanged) { > if (useUniCharPtr) >- result = (NSString *)CFStringCreateWithCharactersNoCopy(NULL, uniCharPtr, len, NULL); >+ result = CFBridgingRelease(CFStringCreateWithCharactersNoCopy(nullptr, uniCharPtr, len, nullptr)); > else >- result = (NSString *)CFStringCreateWithCStringNoCopy(NULL, charPtr, kCFStringEncodingISOLatin1, NULL); >+ result = CFBridgingRelease(CFStringCreateWithCStringNoCopy(nullptr, charPtr, kCFStringEncodingISOLatin1, nullptr)); > } else >- result = [self retain]; >+ result = self; > >- return [result autorelease]; >+ return result; > } > > @end >@@ -311,44 +311,33 @@ - (NSMutableDictionary *)_webkit_parseRFC822HeaderFields > } > // Merge the continuation of the previous header > NSString *currentValue = [headerFields objectForKey:lastKey]; >- NSString *newValue = (NSString *)CFStringCreateWithBytes(NULL, line, lineLength, kCFStringEncodingISOLatin1, FALSE); >+ NSString *newValue = [[NSString alloc] initWithBytes:line length:lineLength encoding:NSISOLatin1StringEncoding]; > ASSERT(currentValue); > ASSERT(newValue); >- NSString *mergedValue = [[NSString alloc] initWithFormat:@"%@%@", currentValue, newValue]; >- [headerFields setObject:(NSString *)mergedValue forKey:lastKey]; >+ [headerFields setObject:[currentValue stringByAppendingString:newValue] forKey:lastKey]; > [newValue release]; >- [mergedValue release]; >- // Note: currentValue is autoreleased > } else { > // Brand new header >- const UInt8 *colon; >+ const UInt8* colon; > for (colon = line; *colon != ':' && colon != eol; colon++) { } > if (colon == eol) { > // malformed header; ignore it and continue > continue; > } >- lastKey = (NSString *)CFStringCreateWithBytes(NULL, line, colon - line, kCFStringEncodingISOLatin1, FALSE); >+ lastKey = [[NSString alloc] initWithBytes:line length:colon - line encoding:NSISOLatin1StringEncoding]; > [lastKey autorelease]; >- NSString *value = [lastKey _web_capitalizeRFC822HeaderFieldName]; >- lastKey = value; >+ lastKey = [lastKey _web_capitalizeRFC822HeaderFieldName]; > for (colon++; colon != eol; colon++) { > if (*colon != ' ' && *colon != '\t') > break; > } >- if (colon == eol) { >- value = [[NSString alloc] initWithString:@""]; >- [value autorelease]; >- } else { >- value = (NSString *)CFStringCreateWithBytes(NULL, colon, eol-colon, kCFStringEncodingISOLatin1, FALSE); >+ NSString *value = [[NSString alloc] initWithBytes:colon length:eol - colon encoding:NSISOLatin1StringEncoding]; >+ if (NSString *oldValue = [headerFields objectForKey:lastKey]) { > [value autorelease]; >+ value = [[NSString alloc] initWithFormat:@"%@, %@", oldValue, value]; > } >- NSString *oldValue = [headerFields objectForKey:lastKey]; >- if (oldValue) { >- NSString *newValue = [[NSString alloc] initWithFormat:@"%@, %@", oldValue, value]; >- value = newValue; >- [newValue autorelease]; >- } >- [headerFields setObject:(NSString *)value forKey:lastKey]; >+ [headerFields setObject:value forKey:lastKey]; >+ [value release]; > } > } > >diff --git a/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.h b/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.h >index 05732024a87ad8f649cb81b37469abfe24c794fd..b4a4cec66f38198feaf9a7f0ebe09dd2b511ebbb 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.h >+++ b/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.h >@@ -29,20 +29,12 @@ > #import <Foundation/Foundation.h> > > @interface NSDictionary (WebNSDictionaryExtras) >+ > - (BOOL)_webkit_boolForKey:(id)key; >-- (int)_webkit_intForKey:(id)key; > - (NSString *)_webkit_stringForKey:(id)key; // Returns nil if the value is not an NSString. > - (NSArray *)_webkit_arrayForKey:(id)key; // Returns nil if the value is not an NSArray. > > // Searches for the full MIME type, then the prefix (e.g., "text/" for "text/html") > - (id)_webkit_objectForMIMEType:(NSString *)MIMEType; >-@end > >-@interface NSMutableDictionary (WebNSDictionaryExtras) >-- (void)_webkit_setInt:(int)value forKey:(id)key; >-- (void)_webkit_setFloat:(float)value forKey:(id)key; >-- (void)_webkit_setBool:(BOOL)value forKey:(id)key; >-- (void)_webkit_setLongLong:(long long)value forKey:(id)key; >-- (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key; >-- (void)_webkit_setUnsignedInt:(unsigned)value forKey:(id)key; > @end >diff --git a/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.m b/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.m >index f1a1b031c00782df88b5a84b37afdc3c4c308301..d8b6900b19e6b328c82ec38e75a21bdc5be15207 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.m >+++ b/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.m >@@ -31,18 +31,13 @@ > #import <wtf/Assertions.h> > > @implementation NSDictionary (WebNSDictionaryExtras) >+ > -(NSNumber *)_webkit_numberForKey:(id)key > { > id object = [self objectForKey:key]; > return [object isKindOfClass:[NSNumber class]] ? object : nil; > } > >--(int)_webkit_intForKey:(NSString *)key >-{ >- NSNumber *number = [self _webkit_numberForKey:key]; >- return number == nil ? 0 : [number intValue]; >-} >- > -(NSString *)_webkit_stringForKey:(id)key > { > id object = [self objectForKey:key]; >@@ -80,50 +75,3 @@ - (BOOL)_webkit_boolForKey:(id)key > } > > @end >- >-@implementation NSMutableDictionary (WebNSDictionaryExtras) >- >--(void)_webkit_setInt:(int)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithInt:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >--(void)_webkit_setFloat:(float)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithFloat:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >--(void)_webkit_setBool:(BOOL)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithBool:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >-- (void)_webkit_setLongLong:(long long)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithLongLong:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >-- (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithUnsignedLongLong:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >-- (void)_webkit_setUnsignedInt:(unsigned)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithUnsignedInt:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >-@end >- >diff --git a/Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm b/Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm >index 1baef389d146e250760fd4035701a3f1ef4517cc..2685579d4b1d7a07570b413d45aeb95517705d79 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm >@@ -42,7 +42,7 @@ static WebCore::FontCascade& fontFromNSFont(NSFont *font) > if ([font isEqual:currentNSFont.get().get()]) > return currentFont; > currentNSFont.get() = font; >- currentFont.get() = WebCore::FontCascade(WebCore::FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize])); >+ currentFont.get() = WebCore::FontCascade(WebCore::FontPlatformData((__bridge CTFontRef)font, [font pointSize])); > return currentFont; > } > >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >index 703c5462c8ef22a37b1dd86048e3ba161ab5f5b2..0210b066baad2697e09f28e089ad35fa74f369df 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >@@ -117,11 +117,11 @@ static NSString *preferredBundleLocalizationName() > LangCode languageCode; > RegionCode regionCode; > >- Boolean success = CFLocaleGetLanguageRegionEncodingForLocaleIdentifier((CFStringRef)language, &languageCode, ®ionCode, nullptr, nullptr); >+ Boolean success = CFLocaleGetLanguageRegionEncodingForLocaleIdentifier((__bridge CFStringRef)language, &languageCode, ®ionCode, nullptr, nullptr); > if (!success) > return @"en_US"; > >- return adoptCF(CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(0, languageCode, regionCode)).bridgingAutorelease(); >+ return CFBridgingRelease(CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(0, languageCode, regionCode)); > } > > bool NetscapePluginHostManager::spawnPluginHost(const String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN) >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >index 1c8d5326f14a90e76dd9a5aba821bdf79fd4d8e9..e93fb506e5de0a5dae3afa5658cbaf4178e26aa1 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >@@ -307,7 +307,7 @@ void NetscapePluginInstanceProxy::cleanup() > m_localObjects.clear(); > > if (Frame* frame = core([m_pluginView webFrame])) >- frame->script().cleanupScriptObjectsForPlugin(m_pluginView); >+ frame->script().cleanupScriptObjectsForPlugin((__bridge void*)m_pluginView); > > ProxyInstanceSet instances; > instances.swap(m_instances); >@@ -551,7 +551,7 @@ void NetscapePluginInstanceProxy::status(const char* message) > return; > > WebView *wv = [m_pluginView webView]; >- [[wv _UIDelegateForwarder] webView:wv setStatusText:(NSString *)status.get()]; >+ [[wv _UIDelegateForwarder] webView:wv setStatusText:(__bridge NSString *)status.get()]; > } > > NPError NetscapePluginInstanceProxy::loadURL(const char* url, const char* target, const char* postData, uint32_t postLen, LoadURLFlags flags, uint32_t& streamID) >@@ -572,12 +572,12 @@ NPError NetscapePluginInstanceProxy::loadURL(const char* url, const char* target > if (!bufString) > return NPERR_INVALID_PARAM; > >- NSURL *fileURL = [NSURL _web_URLWithDataAsString:(NSString *)bufString.get()]; >+ NSURL *fileURL = [NSURL _web_URLWithDataAsString:(__bridge NSString *)bufString.get()]; > NSString *path; > if ([fileURL isFileURL]) > path = [fileURL path]; > else >- path = (NSString *)bufString.get(); >+ path = (__bridge NSString *)bufString.get(); > httpBody = [NSData dataWithContentsOfFile:path]; > if (!httpBody) > return NPERR_FILE_NOT_FOUND; >@@ -1415,7 +1415,7 @@ bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArr > if (!frame->script().canExecuteScripts(NotAboutToExecuteScript)) > return false; > >- auto rootObject = frame->script().createRootObject(m_pluginView); >+ auto rootObject = frame->script().createRootObject((__bridge void*)m_pluginView); > result = ProxyInstance::create(WTFMove(rootObject), this, objectID)->createRuntimeObject(exec); > return true; > } >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/ProxyInstance.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/ProxyInstance.mm >index 0d326c256676739ba7f12273c7b7b0ddbd4ac42c..fe508860ec7979dd6d006510a58d80ed6e4cc169 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/ProxyInstance.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/ProxyInstance.mm >@@ -317,7 +317,7 @@ void ProxyInstance::getPropertyNames(ExecState* exec, PropertyNameArray& nameArr > if (!reply || !reply->m_returnValue) > return; > >- NSArray *array = [NSPropertyListSerialization propertyListWithData:(NSData *)reply->m_result.get() options:NSPropertyListImmutable format:nullptr error:nullptr]; >+ NSArray *array = [NSPropertyListSerialization propertyListWithData:(__bridge NSData *)reply->m_result.get() options:NSPropertyListImmutable format:nullptr error:nullptr]; > > for (NSNumber *number in array) { > IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>([number longLongValue]); >diff --git a/Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm b/Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm >index 93ecb296578ffd72b679d9f1b1b42d7dba1da7f0..dd11355e9821a2efe574aecfb6d49c9533795731 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm >@@ -131,7 +131,7 @@ - (id)_objectForInfoDictionaryKey:(NSString *)key > if (!bundleInfoDictionary) > return nil; > >- return (id)CFDictionaryGetValue(bundleInfoDictionary, key); >+ return (__bridge id)CFDictionaryGetValue(bundleInfoDictionary, (__bridge CFStringRef)key); > } > > - (BOOL)getPluginInfoFromPLists >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm >index f575893d1a570bf33243f1413a797ac19deb3259..d58181a0d7802349a5594ea5ad60dd5c36291a83 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm >@@ -210,9 +210,9 @@ void WebNetscapePluginEventHandlerCocoa::focusChanged(bool hasFocus) > removeKeyEventHandler(); > } > >-void* WebNetscapePluginEventHandlerCocoa::platformWindow(NSWindow* window) >+void* WebNetscapePluginEventHandlerCocoa::platformWindow(NSWindow *window) > { >- return window; >+ return (__bridge void*)window; > } > > bool WebNetscapePluginEventHandlerCocoa::sendEvent(NPCocoaEvent* event) >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginPackage.mm b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginPackage.mm >index f6213f377df76d1231e2e8cfd192cf2158dfaf9f..f2289347421904bee3c88666c4e30092fc1050de 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginPackage.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginPackage.mm >@@ -76,11 +76,10 @@ - (BOOL)_initWithPath:(NSString *)pluginPath > return NO; > > #if USE(PLUGIN_HOST_PROCESS) >- RetainPtr<CFArrayRef> archs = adoptCF(CFBundleCopyExecutableArchitectures(cfBundle.get())); >- >- if ([(NSArray *)archs.get() containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureX86_64]]) >+ auto archs = adoptCF(CFBundleCopyExecutableArchitectures(cfBundle.get())); >+ if ([(__bridge NSArray *)archs.get() containsObject:@(NSBundleExecutableArchitectureX86_64)]) > pluginHostArchitecture = CPU_TYPE_X86_64; >- else if ([(NSArray *)archs.get() containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureI386]]) >+ else if ([(__bridge NSArray *)archs.get() containsObject:@(NSBundleExecutableArchitectureI386)]) > pluginHostArchitecture = CPU_TYPE_X86; > else > return NO; >@@ -94,7 +93,6 @@ - (BOOL)_initWithPath:(NSString *)pluginPath > > if (![self isNativeLibraryData:data]) > return NO; >- > #endif > > if (![self getPluginInfoFromPLists]) >@@ -120,6 +118,7 @@ - (id)initWithPath:(NSString *)pluginPath > } > > #if USE(PLUGIN_HOST_PROCESS) >+ > - (cpu_type_t)pluginHostArchitecture > { > return pluginHostArchitecture; >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >index b2b11d34cff57ec00406acff7c0e258ffb0357c8..49dc1c514f72c449ffdae729ca8d9c08164a9e3e 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >@@ -1724,19 +1724,18 @@ - (NPError)_postURL:(const char *)URLCString > > if (file) { > // If we're posting a file, buf is either a file URL or a path to the file. >- NSString *bufString = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, buf, kCFStringEncodingWindowsLatin1); >+ auto bufString = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, buf, kCFStringEncodingWindowsLatin1)); > if (!bufString) { > return NPERR_INVALID_PARAM; > } >- NSURL *fileURL = [NSURL _web_URLWithDataAsString:bufString]; >+ NSURL *fileURL = [NSURL _web_URLWithDataAsString:(__bridge NSString *)bufString.get()]; > NSString *path; > if ([fileURL isFileURL]) { > path = [fileURL path]; > } else { >- path = bufString; >+ path = (__bridge NSString *)bufString.get(); > } > postData = [NSData dataWithContentsOfFile:path]; >- CFRelease(bufString); > if (!postData) { > return NPERR_FILE_NOT_FOUND; > } >@@ -1866,7 +1865,7 @@ -(void)status:(const char *)message > > LOG(Plugins, "NPN_Status: %@", status); > WebView *wv = [self webView]; >- [[wv _UIDelegateForwarder] webView:wv setStatusText:(NSString *)status]; >+ [[wv _UIDelegateForwarder] webView:wv setStatusText:(__bridge NSString *)status]; > CFRelease(status); > } > >@@ -2120,7 +2119,7 @@ - (NPError)popUpContextMenu:(NPMenu *)menu > if (!currentEvent) > return NPERR_GENERIC_ERROR; > >- [NSMenu popUpContextMenu:(NSMenu *)menu withEvent:currentEvent forView:self]; >+ [NSMenu popUpContextMenu:(__bridge NSMenu *)menu withEvent:currentEvent forView:self]; > return NPERR_NO_ERROR; > } > >diff --git a/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm b/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm >index df127fe0cddae6a6f419f6d40cc5eb4734f9ac47..290fef63ad916aa618d30a21d9143e218ec90e85 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm >@@ -410,7 +410,7 @@ static void cancelOutstandingCheck(const void *item, void *context) > - (void)_cancelOutstandingChecks > { > if (_checksInProgress) { >- CFSetApplyFunction((CFSetRef)_checksInProgress, cancelOutstandingCheck, NULL); >+ CFSetApplyFunction((__bridge CFSetRef)_checksInProgress, cancelOutstandingCheck, NULL); > [_checksInProgress release]; > _checksInProgress = nil; > } >diff --git a/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm b/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm >index d86f2319c4d7789684a7dfa030adb3009cff23e8..b7697e70307393cb57b6233d74436d2a7a92b19c 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm >@@ -86,7 +86,7 @@ + (void)closeSharedDatabase > [sharedDatabase close]; > } > >-static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPackage **candidatePlugin) >+static void checkCandidate(WebBasePluginPackage * __strong *currentPlugin, WebBasePluginPackage * __strong *candidatePlugin) > { > if (!*currentPlugin) { > *currentPlugin = *candidatePlugin; >diff --git a/Source/WebKitLegacy/mac/Plugins/npapi.mm b/Source/WebKitLegacy/mac/Plugins/npapi.mm >index 23e4e467f0ee5c0210acc58f5cb3d4aba4a88dd1..c3ea74a8696fd41a284056f4c922e2c9f01f4801 100644 >--- a/Source/WebKitLegacy/mac/Plugins/npapi.mm >+++ b/Source/WebKitLegacy/mac/Plugins/npapi.mm >@@ -73,7 +73,7 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) > WebNetscapePluginView *pluginViewForInstance(NPP instance) > { > if (instance && instance->ndata) >- return (WebNetscapePluginView *)instance->ndata; >+ return (__bridge WebNetscapePluginView *)instance->ndata; > else > return [WebNetscapePluginView currentPluginView]; > } >diff --git a/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm b/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm >index 0051f582dd5462fdfe5ff837e0c19a0640107d35..ceece13fa2ae4816cb6066b448e819faf7819fcc 100644 >--- a/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm >+++ b/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm >@@ -118,16 +118,15 @@ - (NSDictionary *)detailsForDatabase:(NSString *)databaseIdentifier withOrigin:( > if (!origin) > return nil; > >- DatabaseDetails details = DatabaseManager::singleton().detailsForNameAndOrigin(databaseIdentifier, *[origin _core]); >+ auto details = DatabaseManager::singleton().detailsForNameAndOrigin(databaseIdentifier, *[origin _core]); > if (details.name().isNull()) > return nil; >- >- static const id keys[3] = { WebDatabaseDisplayNameKey, WebDatabaseExpectedSizeKey, WebDatabaseUsageKey }; >- id objects[3]; >- objects[0] = details.displayName().isEmpty() ? databaseIdentifier : (NSString *)details.displayName(); >- objects[1] = [NSNumber numberWithUnsignedLongLong:details.expectedUsage()]; >- objects[2] = [NSNumber numberWithUnsignedLongLong:details.currentUsage()]; >- return [[[NSDictionary alloc] initWithObjects:objects forKeys:keys count:3] autorelease]; >+ >+ return @{ >+ WebDatabaseDisplayNameKey: details.displayName().isEmpty() ? databaseIdentifier : (NSString *)details.displayName(), >+ WebDatabaseExpectedSizeKey: @(details.expectedUsage()), >+ WebDatabaseUsageKey: @(details.currentUsage()), >+ }; > } > > - (void)deleteAllDatabases >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >index 0ec1223ca141074e31adbf8e6c3c93002f8c2706..e0dd64647c814aa7df858a932538e0e3d460591f 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >@@ -32,16 +32,13 @@ > > #import "WebDelegateImplementationCaching.h" > #import "WebElementDictionary.h" >-#import "WebFrame.h" > #import "WebFrameInternal.h" >-#import "WebHTMLView.h" >+#import "WebFrameView.h" > #import "WebHTMLViewInternal.h" > #import "WebKitVersionChecks.h" > #import "WebNSPasteboardExtras.h" > #import "WebSharingServicePickerController.h" >-#import "WebUIDelegate.h" > #import "WebUIDelegatePrivate.h" >-#import "WebView.h" > #import "WebViewInternal.h" > #import <WebCore/BitmapImage.h> > #import <WebCore/ContextMenu.h> >@@ -121,7 +118,7 @@ bool WebContextMenuClient::isSpeaking() > > void WebContextMenuClient::speak(const String& string) > { >- [NSApp speakString:[[(NSString*)string copy] autorelease]]; >+ [NSApp speakString:(NSString *)string]; > } > > void WebContextMenuClient::stopSpeaking() >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >index 2eff76112ea9f895854835618fec7c872dbebf36..d311dd65f170c1b25d47a3279753a5d535b575eb 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >@@ -45,7 +45,7 @@ > #import "WebEditingDelegatePrivate.h" > #import "WebFormDelegate.h" > #import "WebFrameInternal.h" >-#import "WebHTMLView.h" >+#import "WebFrameView.h" > #import "WebHTMLViewInternal.h" > #import "WebKitLogging.h" > #import "WebKitVersionChecks.h" >@@ -772,7 +772,7 @@ void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) > { > auto* frame = downcast<Node>(event->target())->document().frame(); > #if !PLATFORM(IOS) >- WebHTMLView *webHTMLView = [[kit(frame) frameView] documentView]; >+ WebHTMLView *webHTMLView = (WebHTMLView *)[[kit(frame) frameView] documentView]; > if ([webHTMLView _interpretKeyEvent:event savingCommands:NO]) > event->setDefaultHandled(); > #else >@@ -787,7 +787,7 @@ void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event) > #if !PLATFORM(IOS) > // FIXME: Switch to WebKit2 model, interpreting the event before it's sent down to WebCore. > auto* frame = downcast<Node>(event->target())->document().frame(); >- WebHTMLView *webHTMLView = [[kit(frame) frameView] documentView]; >+ WebHTMLView *webHTMLView = (WebHTMLView *)[[kit(frame) frameView] documentView]; > if ([webHTMLView _interpretKeyEvent:event savingCommands:YES]) > event->setDefaultHandled(); > #else >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm >index 19f51cd0e08b974eeb578605de7d30646b8ee2d7..661a37c5d577fee065d7a32f23e0f27bbfd66511 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm >@@ -77,7 +77,7 @@ RetainPtr<CFDataRef> WebFrameNetworkingContext::sourceApplicationAuditData() con > if (!webview) > return nullptr; > >- return reinterpret_cast<CFDataRef>(webview._sourceApplicationAuditData); >+ return (__bridge CFDataRef)webview._sourceApplicationAuditData; > } > > String WebFrameNetworkingContext::sourceApplicationIdentifier() const >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOriginPrivate.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOriginPrivate.h >index 5fe1b0ba31b6c0109ce467dc41e031f9cd1b1b34..d6e5399f54d9df85d92ac416021cc1954e05ba6e 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOriginPrivate.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOriginPrivate.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2007, 2010, 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2007-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -26,7 +26,8 @@ > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-@class WebSecurityOriginPrivate; >+struct WebSecurityOriginPrivate; >+ > @protocol WebQuotaManager; > > @interface WebSecurityOrigin : NSObject { >diff --git a/Source/WebKitLegacy/mac/WebInspector/WebNodeHighlighter.mm b/Source/WebKitLegacy/mac/WebInspector/WebNodeHighlighter.mm >index b4aca6f7b878e94200f234216180fc4c59b740fb..7e907c980ad9fc910befb34850ee7b930d939bab 100644 >--- a/Source/WebKitLegacy/mac/WebInspector/WebNodeHighlighter.mm >+++ b/Source/WebKitLegacy/mac/WebInspector/WebNodeHighlighter.mm >@@ -29,7 +29,9 @@ > #import "WebNodeHighlighter.h" > > #import "DOMNodeInternal.h" >+#import "WebFrameView.h" > #import "WebNodeHighlight.h" >+#import "WebNodeHighlightView.h" > #import "WebViewInternal.h" > #import <WebCore/Page.h> > >diff --git a/Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm b/Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm >index fd3d3520e38dc19544364e5b0efb0d3010e167c3..753dceb28d30e6a90f4017d9f01e3d4edfff1539 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm >@@ -224,7 +224,7 @@ - (void)enterFullScreen:(NSScreen *)screen > [_webViewPlaceholder.get() setLayer:[CALayer layer]]; > [_webViewPlaceholder.get() setWantsLayer:YES]; > } >- [[_webViewPlaceholder.get() layer] setContents:(id)webViewContents.get()]; >+ [[_webViewPlaceholder.get() layer] setContents:(__bridge id)webViewContents.get()]; > _scrollPosition = [_webView _mainCoreFrame]->view()->scrollPosition(); > [self _swapView:_webView with:_webViewPlaceholder.get()]; > >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index f52a48c1443b22d4205d4a91b32e6a68b3729363..66fbeb207200dd6a68a4c672a11319c509b399cb 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -1335,7 +1335,7 @@ - (void)_writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPast > if ([types containsObject:WebArchivePboardType]) { > if (RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::createFromSelection(core([self _frame]))) { > if (RetainPtr<CFDataRef> data = coreArchive ? coreArchive->rawDataRepresentation() : 0) >- [pasteboard setData:(NSData *)data.get() forType:WebArchivePboardType]; >+ [pasteboard setData:(__bridge NSData *)data.get() forType:WebArchivePboardType]; > } > } > >@@ -2020,7 +2020,7 @@ - (void)pasteboard:(NSPasteboard *)pasteboard provideDataForType:(NSString *)typ > [pasteboard _web_writePromisedRTFDFromArchive:archive.get() containsImage:[[pasteboard types] containsObject:legacyTIFFPasteboardType()]]; > } else if ([type isEqualToString:legacyTIFFPasteboardType()] && _private->promisedDragTIFFDataSource) { > if (auto* image = _private->promisedDragTIFFDataSource->image()) >- [pasteboard setData:(NSData *)image->tiffRepresentation() forType:legacyTIFFPasteboardType()]; >+ [pasteboard setData:(__bridge NSData *)image->tiffRepresentation() forType:legacyTIFFPasteboardType()]; > [self setPromisedDragTIFFDataSource:nullptr]; > } > } >diff --git a/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm b/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >index 926d4e4264e92e2e2a07d398568e5d31a3166dc3..633872445d24a66f262f040eb299bd92d02cf47e 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >@@ -32,7 +32,7 @@ > #import "DOMRangeInternal.h" > #import "WebElementDictionary.h" > #import "WebFrameInternal.h" >-#import "WebHTMLView.h" >+#import "WebFrameView.h" > #import "WebHTMLViewInternal.h" > #import "WebUIDelegatePrivate.h" > #import "WebViewInternal.h" >@@ -145,9 +145,10 @@ - (void)_clearImmediateActionState > > - (void)performHitTestAtPoint:(NSPoint)viewPoint > { >- Frame* coreFrame = core([[[[_webView _selectedOrMainFrame] frameView] documentView] _frame]); >+ Frame* coreFrame = [_webView _mainCoreFrame]; > if (!coreFrame) > return; >+ > _hitTestResult = coreFrame->eventHandler().hitTestResultAtPoint(IntPoint(viewPoint)); > coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::PerformedHitTest); > >@@ -205,10 +206,9 @@ - (void)immediateActionRecognizerDidUpdateAnimation:(NSImmediateActionGestureRec > if (immediateActionRecognizer != _immediateActionRecognizer) > return; > >- Frame* coreFrame = core([[[[_webView _selectedOrMainFrame] frameView] documentView] _frame]); >- if (!coreFrame) >- return; >- coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionUpdated); >+ if (Frame* coreFrame = [_webView _mainCoreFrame]) >+ coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionUpdated); >+ > if (_contentPreventsDefault) > return; > >@@ -220,12 +220,7 @@ - (void)immediateActionRecognizerDidCancelAnimation:(NSImmediateActionGestureRec > if (immediateActionRecognizer != _immediateActionRecognizer) > return; > >- NSView *documentView = [[[_webView _selectedOrMainFrame] frameView] documentView]; >- if (![documentView isKindOfClass:[WebHTMLView class]]) >- return; >- >- Frame* coreFrame = core([(WebHTMLView *)documentView _frame]); >- if (coreFrame) { >+ if (Frame* coreFrame = [_webView _mainCoreFrame]) { > ImmediateActionStage lastStage = coreFrame->eventHandler().immediateActionStage(); > if (lastStage == ImmediateActionStage::ActionUpdated) > coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelledAfterUpdate); >@@ -244,10 +239,8 @@ - (void)immediateActionRecognizerDidCompleteAnimation:(NSImmediateActionGestureR > if (immediateActionRecognizer != _immediateActionRecognizer) > return; > >- Frame* coreFrame = core([[[[_webView _selectedOrMainFrame] frameView] documentView] _frame]); >- if (!coreFrame) >- return; >- coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCompleted); >+ if (Frame* coreFrame = [_webView _mainCoreFrame]) >+ coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCompleted); > > [_webView _setTextIndicatorAnimationProgress:1]; > [_webView _setMaintainsInactiveSelection:NO]; >diff --git a/Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm b/Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm >index 24169fe0a4e6feb23d9d8de3fe1e81706b718b4b..e8bf4b5135b8fde95a3bc50214a5aaea9ef32554 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm >@@ -33,19 +33,17 @@ > > static void jsPDFDocInitialize(JSContextRef ctx, JSObjectRef object) > { >- WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(object); >- CFRetain(dataSource); >+ CFRetain(JSObjectGetPrivate(object)); > } > > static void jsPDFDocFinalize(JSObjectRef object) > { >- WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(object); >- CFRelease(dataSource); >+ CFRelease(JSObjectGetPrivate(object)); > } > > static JSValueRef jsPDFDocPrint(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) > { >- WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(thisObject); >+ WebDataSource *dataSource = (__bridge WebDataSource *)JSObjectGetPrivate(thisObject); > > WebView *webView = [[dataSource webFrame] webView]; > CallUIDelegate(webView, @selector(webView:printFrameView:), [[dataSource webFrame] frameView]); >@@ -72,5 +70,5 @@ JSObjectRef makeJSPDFDoc(JSContextRef ctx, WebDataSource *dataSource) > { > static JSClassRef jsPDFDocClass = JSClassCreate(&jsPDFDocClassDefinition); > >- return JSObjectMake(ctx, jsPDFDocClass, dataSource); >+ return JSObjectMake(ctx, jsPDFDocClass, (__bridge void*)dataSource); > } >diff --git a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >index 26b25edc1e8813b132317ae9616a8713e1a0fc20..9ab23386de37dde6c2980e3f193e2a7533300ea1 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >@@ -26,10 +26,10 @@ > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#if !PLATFORM(IOS) >- > #import "WebPDFView.h" > >+#if PLATFORM(MAC) >+ > #import "DOMNodeInternal.h" > #import "DOMRangeInternal.h" > #import "PDFViewSPI.h" >@@ -128,12 +128,12 @@ static void _applicationInfoForMIMEType(NSString *type, NSString **name, NSImage > > #pragma clang diagnostic push > #pragma clang diagnostic ignored "-Wdeprecated-declarations" >- OSStatus error = LSCopyApplicationForMIMEType((CFStringRef)type, kLSRolesAll, &appURL); >+ OSStatus error = LSCopyApplicationForMIMEType((__bridge CFStringRef)type, kLSRolesAll, &appURL); > #pragma clang diagnostic pop > if (error != noErr) > return; > >- NSString *appPath = [(NSURL *)appURL path]; >+ NSString *appPath = [(__bridge NSURL *)appURL path]; > CFRelease(appURL); > > *image = [[NSWorkspace sharedWorkspace] iconForFile:appPath]; >@@ -1594,4 +1594,4 @@ - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel > > @end > >-#endif // !PLATFORM(IOS) >+#endif // PLATFORM(MAC) >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >index 1f65df0266dade9a6738249487846ab8fe9fb27c..4afda34d0606302c7ff7759ec4a9db616170bc87 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >@@ -764,7 +764,7 @@ - (void)_setIntegerValue:(int)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setInt:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -787,7 +787,7 @@ - (void)_setUnsignedIntValue:(unsigned int)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setUnsignedInt:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -810,7 +810,7 @@ - (void)_setFloatValue:(float)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setFloat:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -832,7 +832,7 @@ - (void)_setBoolValue:(BOOL)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setBool:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -855,7 +855,7 @@ - (void)_setLongLongValue:(long long)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setLongLong:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -878,7 +878,7 @@ - (void)_setUnsignedLongLongValue:(unsigned long long)value forKey:(NSString *)k > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setUnsignedLongLong:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index 9cff0bd6591c5a5337ced851df7c1086001be090..d4d1e6efceaa6dbc493e86e26ce4f81611ea03df 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -1114,13 +1114,13 @@ + (void)_makeAllWebViewsPerformSelector:(SEL)selector > if (!allWebViewsSet) > return; > >- [(NSMutableSet *)allWebViewsSet makeObjectsPerformSelector:selector]; >+ [(__bridge NSMutableSet *)allWebViewsSet makeObjectsPerformSelector:selector]; > } > > - (void)_removeFromAllWebViewsSet > { > if (allWebViewsSet) >- CFSetRemoveValue(allWebViewsSet, self); >+ CFSetRemoveValue(allWebViewsSet, (__bridge CFTypeRef)self); > } > > - (void)_addToAllWebViewsSet >@@ -1128,7 +1128,7 @@ - (void)_addToAllWebViewsSet > if (!allWebViewsSet) > allWebViewsSet = CFSetCreateMutable(NULL, 0, &NonRetainingSetCallbacks); > >- CFSetSetValue(allWebViewsSet, self); >+ CFSetSetValue(allWebViewsSet, (__bridge CFTypeRef)self); > } > > @end >@@ -2113,10 +2113,7 @@ + (void)closeAllWebViews > DOMWindow::dispatchAllPendingUnloadEvents(); > > // This will close the WebViews in a random order. Change this if close order is important. >- // Make a new set to avoid mutating the set we are enumerating. >- NSSet *webViewsToClose = [NSSet setWithSet:(NSSet *)allWebViewsSet]; >- NSEnumerator *enumerator = [webViewsToClose objectEnumerator]; >- while (WebView *webView = [enumerator nextObject]) >+ for (WebView *webView in [(__bridge NSSet *)allWebViewsSet allObjects]) > [webView close]; > } > >@@ -6174,11 +6171,6 @@ - (void)_windowWillOrderOffScreen:(NSNotification *)notification > } > } > >-- (void)_windowVisibilityChanged:(NSNotification *)notification >-{ >- [self _updateVisibilityState]; >-} >- > - (void)_windowWillClose:(NSNotification *)notification > { > if ([self shouldCloseWithWindow] && ([self window] == [self hostWindow] || ([self window] && ![self hostWindow]) || (![self window] && [self hostWindow]))) >@@ -10066,6 +10058,11 @@ - (id)candidateList > > #endif > >+- (void)_windowVisibilityChanged:(NSNotification *)notification >+{ >+ [self _updateVisibilityState]; >+} >+ > @end > > @implementation WebView (WebViewDeviceOrientation) >diff --git a/Source/WebKitLegacy/mac/WebView/WebViewData.mm b/Source/WebKitLegacy/mac/WebView/WebViewData.mm >index 68253714a04570898f0ebd6c6e43ade5d96a3796..6492e4aaea2abd6f4d590751b32c552d7c1578b0 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebViewData.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebViewData.mm >@@ -33,6 +33,7 @@ > #import "WebPreferenceKeysPrivate.h" > #import "WebSelectionServiceController.h" > #import "WebViewGroup.h" >+#import "WebViewInternal.h" > #import <JavaScriptCore/InitializeThreading.h> > #import <WebCore/AlternativeTextUIController.h> > #import <WebCore/HistoryItem.h> >diff --git a/Source/WebKitLegacy/mac/WebView/WebViewInternal.h b/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >index 90fa38770859ef1e8bacffac42fcc10a05e5499a..0e7c5d7e92e28b2efe62fa7ce3ad912a47f093d8 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >+++ b/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >@@ -146,6 +146,8 @@ OBJC_CLASS NSTextAlternatives; > - (WebSelectionServiceController&)_selectionServiceController; > #endif > >+- (void)_windowVisibilityChanged:(NSNotification *)notification; >+ > @end > > #endif >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 63bc8a732faf37b8734b3f512985d2e022691f6c..4d73aba335579c127c42b4ac408c1c206a9b4243 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,178 @@ >+2018-08-01 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h: Use const void* for a >+ CFTypeRef instead of void*. >+ >+ * DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm: >+ (createCoreAnimationLayer): Use CFBridgingRetain. >+ >+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm: >+ (AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Use bridging casts. >+ (AccessibilityUIElement::textMarkerRangeForElement): Ditto. >+ (AccessibilityUIElement::selectedTextMarkerRange): Ditto. >+ (AccessibilityUIElement::textMarkerRangeLength): Ditto. >+ (AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute): Ditto. >+ (AccessibilityUIElement::indexForTextMarker): Ditto. >+ (AccessibilityUIElement::textMarkerForIndex): Ditto. >+ (AccessibilityUIElement::isTextMarkerValid): Ditto. >+ (AccessibilityUIElement::previousTextMarker): Ditto. >+ (AccessibilityUIElement::nextTextMarker): Ditto. >+ (AccessibilityUIElement::stringForTextMarkerRange): Ditto. >+ (createJSStringRef): Ditto. >+ (AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto. >+ (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto. >+ (AccessibilityUIElement::textMarkerRangeForMarkers): Ditto. >+ (AccessibilityUIElement::startTextMarkerForTextMarkerRange): Ditto. >+ (AccessibilityUIElement::endTextMarkerForTextMarkerRange): Ditto. >+ (AccessibilityUIElement::endTextMarkerForBounds): Ditto. >+ (AccessibilityUIElement::startTextMarkerForBounds): Ditto. >+ (AccessibilityUIElement::textMarkerForPoint): Ditto. >+ (AccessibilityUIElement::accessibilityElementForTextMarker): Ditto. >+ (AccessibilityUIElement::startTextMarker): Ditto. >+ (AccessibilityUIElement::endTextMarker): Ditto. >+ (AccessibilityUIElement::setSelectedVisibleTextRange): Ditto. >+ (AccessibilityUIElement::leftWordTextMarkerRangeForTextMarker): Ditto. >+ (AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker): Ditto. >+ (AccessibilityUIElement::previousWordStartTextMarkerForTextMarker): Ditto. >+ (AccessibilityUIElement::nextWordEndTextMarkerForTextMarker): Ditto. >+ (AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker): Ditto. >+ (AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker): Ditto. >+ (AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): Ditto. >+ (AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): Ditto. >+ (AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): Ditto. >+ (AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): Ditto. >+ >+ * DumpRenderTree/mac/DumpRenderTree.mm: >+ (resetWebPreferencesToConsistentValues): Use bridging cast. >+ (dumpFramesAsText): Ditto. >+ (dumpBackForwardListForAllWindows): User a modern for loop instead of >+ CFArray functions to iterate the array. >+ (dump): Use bridging cast. >+ (runTest): Ditto. >+ >+ * DumpRenderTree/mac/DumpRenderTreePasteboard.mm: >+ (+[LocalPasteboard alloc]): Use class_createInstance instead of NSAllocateObject. >+ (toUTI): Return a RetainPtr<CFStringRef>. >+ (-[LocalPasteboard types]): Use the above and bridging casts. >+ (-[LocalPasteboard availableTypeFromArray:]): Ditto. >+ (-[LocalPasteboard setData:forType:]): Ditto. >+ (-[LocalPasteboard dataForType:]): Ditto. >+ (-[LocalPasteboard setPropertyList:forType:]): Use NSPropertyListSerialization >+ instead of CFPropertyList. >+ (-[LocalPasteboard setString:forType:]): Use NSString method instead of >+ CFStringCreateExternalRepresentation. >+ >+ * DumpRenderTree/mac/MockGeolocationProvider.h: Put CFTypeRef in a HashSet >+ instead of an Objective-C object pointer type. >+ * DumpRenderTree/mac/MockGeolocationProvider.mm: >+ (-[MockGeolocationProvider registerWebView:]): Update for above. >+ (-[MockGeolocationProvider unregisterWebView:]): Ditto. >+ (-[MockGeolocationProvider timerFired]): Ditto. >+ >+ * DumpRenderTree/mac/MockWebNotificationProvider.h: Use CFTypeRef in >+ HashMap and HashSet instead of an Objective-C object pointer type. >+ * DumpRenderTree/mac/MockWebNotificationProvider.mm: >+ (-[MockWebNotificationProvider registerWebView:]): Update for above. >+ (-[MockWebNotificationProvider unregisterWebView:]): Ditto. >+ (-[MockWebNotificationProvider showNotification:fromWebView:]): Ditto. >+ (-[MockWebNotificationProvider cancelNotification:]): Ditto. >+ (-[MockWebNotificationProvider simulateWebNotificationClick:]): Ditto. >+ >+ * DumpRenderTree/mac/ObjCPlugin.m: >+ (-[JSObjC retainObject:]): Use CFRetain instead of -[NSObject retain]. >+ >+ * DumpRenderTree/mac/TestRunnerMac.mm: >+ (TestRunner::addDisallowedURL): Use bridging cast. >+ (TestRunner::applicationCacheDiskUsageForOrigin): Ditto. >+ (TestRunner::clearApplicationCacheForOrigin): Ditto. >+ (originsArrayToJS): Ditto. >+ (TestRunner::copyDecodedHostName): Ditto. >+ (TestRunner::copyEncodedHostName): Ditto. >+ (TestRunner::queueLoad): Ditto. >+ (TestRunner::setDomainRelaxationForbiddenForURLScheme): Ditto. >+ (TestRunner::setMockGeolocationPositionUnavailableError): Ditto. >+ (TestRunner::setUserStyleSheetLocation): Ditto. >+ (TestRunner::setValueForUser): Ditto. >+ (TestRunner::overridePreference): Ditto. >+ (TestRunner::execCommand): Ditto. >+ (TestRunner::findString): Ditto. >+ (TestRunner::isCommandEnabled): Ditto. >+ (TestRunner::addOriginAccessWhitelistEntry): Ditto. >+ (TestRunner::removeOriginAccessWhitelistEntry): Ditto. >+ (TestRunner::addUserScript): Ditto. >+ (TestRunner::addUserStyleSheet): Ditto. >+ (TestRunner::evaluateInWebInspector): Ditto. >+ (TestRunner::evaluateScriptInIsolatedWorld): Ditto. >+ (TestRunner::authenticateSession): Ditto. >+ (TestRunner::grantWebNotificationPermission): Ditto. >+ (TestRunner::denyWebNotificationPermission): Ditto. >+ * TestRunnerShared/cocoa/LayoutTestSpellChecker.mm: >+ (-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Ditto. >+ >+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: >+ (WTR::AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Use bridging cast. >+ (WTR::AccessibilityUIElement::textMarkerRangeForElement): Ditto. >+ (WTR::AccessibilityUIElement::previousTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::nextTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Ditto. >+ (WTR::AccessibilityUIElement::selectedTextMarkerRange): Ditto. >+ (WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange): Ditto. >+ (WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange): Ditto. >+ (WTR::AccessibilityUIElement::endTextMarkerForBounds): Ditto. >+ (WTR::AccessibilityUIElement::startTextMarkerForBounds): Ditto. >+ (WTR::AccessibilityUIElement::textMarkerForPoint): Ditto. >+ (WTR::AccessibilityUIElement::textMarkerForIndex): Ditto. >+ (WTR::AccessibilityUIElement::startTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::endTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::leftWordTextMarkerRangeForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::previousWordStartTextMarkerForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::nextWordEndTextMarkerForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): Ditto. >+ (WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): Ditto. >+ >+ * WebKitTestRunner/PlatformMac.cmake: Added WebKitTestRunnerWindow.h and .mm files. >+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Ditto. >+ >+ * WebKitTestRunner/mac/EventSenderProxy.mm: Add include of WebKitTestRunnerWindow.h >+ so we can use the type and know it inherits from NSWindow. >+ >+ * WebKitTestRunner/mac/PlatformWebViewMac.mm: Add include of WebKitTestRunnerWindow.h >+ so we can use the type and know it inherits from NSWindow. Moved WebKitTestRunnerWindow >+ class into a separate file. >+ (WTR::PlatformWebView::keyWindow): Call +[WebKitTestRunnerWindow _WTR_keyWindow] >+ instead of have a second copy of the implementation. >+ >+ * WebKitTestRunner/mac/WebKitTestRunnerEvent.mm: Add include of WebKitTestRunnerWindow.h >+ so we can use the type and know it inherits from NSWindow. Also removed "using namespace". >+ (+[WebKitTestRunnerEvent mouseLocation]): Updated for above. >+ >+ * WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm: >+ (+[LocalPasteboard alloc]): Use class_createInstance instead of NSAllocateObject. >+ (-[LocalPasteboard availableTypeFromArray:]): Use modern for loop. >+ (-[LocalPasteboard setData:forType:]): Reordered method to be a tiny bit more efficient. >+ (-[LocalPasteboard setPropertyList:forType:]): Use NSPropertyListSerialization >+ instead of CFPropertyList. >+ (-[LocalPasteboard setString:forType:]): Use NSString method instead of >+ CFStringCreateExternalRepresentation. >+ >+ * WebKitTestRunner/mac/WebKitTestRunnerWindow.h: Moved declaration of >+ WebKitTestRunnerWindow here so it can be included by files that need to know >+ what the type is and that it inherits from NSWindow. >+ >+ * WebKitTestRunner/mac/WebKitTestRunnerWindow.mm: Added. Moved implementation here. >+ (+[WebKitTestRunnerWindow _WTR_keyWindow]): Use modern for loop instead of the old, >+ messier implementation. >+ > 2018-08-03 Carlos Garcia Campos <cgarcia@igalia.com> > > [WPE] Use the new key mapper API from WPEBackend >diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h >index e87744688e204817ea13a14b45f908317a570564..fc73263185a7cfecf41fe8a64086070acc39ce59 100644 >--- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h >+++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h >@@ -68,7 +68,7 @@ typedef struct { > NPEventModel eventModel; > #endif > #ifdef XP_MACOSX >- void* coreAnimationLayer; >+ const void* coreAnimationLayer; > #endif > NPWindow lastWindow; > } PluginObject; >@@ -83,7 +83,7 @@ extern bool testDocumentOpen(NPP npp); > extern bool testWindowOpen(NPP npp); > > #ifdef XP_MACOSX >-extern void* createCoreAnimationLayer(); >+extern const void* createCoreAnimationLayer(); > #endif > > #endif >diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm >index 4dca7f537ac62a952c706ae535b4426b2f11cfbd..edecd929c50b7d5de5b59c34ad373cddab715302 100644 >--- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm >+++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm >@@ -42,7 +42,7 @@ - (void)drawInContext:(CGContextRef)context > > @end > >-void* createCoreAnimationLayer() >+const void* createCoreAnimationLayer() > { > CALayer *caLayer = [[TestPluginLayer alloc] init]; > >@@ -93,5 +93,5 @@ void* createCoreAnimationLayer() > attribute:kCAConstraintMaxX]]; > > [caLayer addSublayer:sublayer]; >- return caLayer; >+ return CFBridgingRetain(caLayer); > } >diff --git a/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm >index bd840cea28d82fb41cefbdedb04850801bd26be9..ba9b550d7be8fc11369c3f125a48184c52bb41e7 100644 >--- a/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm >+++ b/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm >@@ -1587,8 +1587,8 @@ void AccessibilityUIElement::removeSelection() > AccessibilityTextMarkerRange AccessibilityUIElement::lineTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLineTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange(textMarkerRange); >+ id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLineTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarkerRange((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1598,7 +1598,7 @@ AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForElement(A > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:@"AXTextMarkerRangeForUIElement" forParameter:element->platformUIElement()]; >- return AccessibilityTextMarkerRange(textMarkerRange); >+ return AccessibilityTextMarkerRange((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1608,7 +1608,7 @@ AccessibilityTextMarkerRange AccessibilityUIElement::selectedTextMarkerRange() > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:NSAccessibilitySelectedTextMarkerRangeAttribute]; >- return AccessibilityTextMarkerRange(textMarkerRange); >+ return AccessibilityTextMarkerRange((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1633,7 +1633,7 @@ void AccessibilityUIElement::resetSelectedTextMarkerRange() > int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range) > { > BEGIN_AX_OBJC_EXCEPTIONS >- NSNumber* lengthValue = [m_element accessibilityAttributeValue:@"AXLengthForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()]; >+ NSNumber* lengthValue = [m_element accessibilityAttributeValue:@"AXLengthForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()]; > return [lengthValue intValue]; > END_AX_OBJC_EXCEPTIONS > >@@ -1643,7 +1643,7 @@ int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* > bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef attribute, AccessibilityTextMarkerRange* range) > { > BEGIN_AX_OBJC_EXCEPTIONS >- NSAttributedString* string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()]; >+ NSAttributedString* string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()]; > if (![string isKindOfClass:[NSAttributedString class]]) > return false; > >@@ -1658,7 +1658,7 @@ bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute > int AccessibilityUIElement::indexForTextMarker(AccessibilityTextMarker* marker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- NSNumber* indexNumber = [m_element accessibilityAttributeValue:@"AXIndexForTextMarker" forParameter:(id)marker->platformTextMarker()]; >+ NSNumber* indexNumber = [m_element accessibilityAttributeValue:@"AXIndexForTextMarker" forParameter:(__bridge id)marker->platformTextMarker()]; > return [indexNumber intValue]; > END_AX_OBJC_EXCEPTIONS > >@@ -1669,7 +1669,7 @@ AccessibilityTextMarker AccessibilityUIElement::textMarkerForIndex(int textIndex > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXTextMarkerForIndex" forParameter:[NSNumber numberWithInteger:textIndex]]; >- return AccessibilityTextMarker(textMarker); >+ return AccessibilityTextMarker((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1678,7 +1678,7 @@ AccessibilityTextMarker AccessibilityUIElement::textMarkerForIndex(int textIndex > bool AccessibilityUIElement::isTextMarkerValid(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- NSNumber* validNumber = [m_element accessibilityAttributeValue:@"AXTextMarkerIsValid" forParameter:(id)textMarker->platformTextMarker()]; >+ NSNumber* validNumber = [m_element accessibilityAttributeValue:@"AXTextMarkerIsValid" forParameter:(__bridge id)textMarker->platformTextMarker()]; > return [validNumber boolValue]; > END_AX_OBJC_EXCEPTIONS > >@@ -1688,8 +1688,8 @@ bool AccessibilityUIElement::isTextMarkerValid(AccessibilityTextMarker* textMark > AccessibilityTextMarker AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id previousMarker = [m_element accessibilityAttributeValue:@"AXPreviousTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker(previousMarker); >+ id previousMarker = [m_element accessibilityAttributeValue:@"AXPreviousTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)previousMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1698,8 +1698,8 @@ AccessibilityTextMarker AccessibilityUIElement::previousTextMarker(Accessibility > AccessibilityTextMarker AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id nextMarker = [m_element accessibilityAttributeValue:@"AXNextTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker(nextMarker); >+ id nextMarker = [m_element accessibilityAttributeValue:@"AXNextTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)nextMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1708,7 +1708,7 @@ AccessibilityTextMarker AccessibilityUIElement::nextTextMarker(AccessibilityText > JSStringRef AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id textString = [m_element accessibilityAttributeValue:@"AXStringForTextMarkerRange" forParameter:(id)markerRange->platformTextMarkerRange()]; >+ id textString = [m_element accessibilityAttributeValue:@"AXStringForTextMarkerRange" forParameter:(__bridge id)markerRange->platformTextMarkerRange()]; > return [textString createJSStringRef]; > END_AX_OBJC_EXCEPTIONS > >@@ -1727,9 +1727,9 @@ static JSStringRef createJSStringRef(id string) > misspelled = [[attrs objectForKey:NSAccessibilityMarkedMisspelledTextAttribute] boolValue]; > if (misspelled) > [mutableString appendString:@"Misspelled, "]; >- id font = [attributes objectForKey:(id)kAXFontTextAttribute]; >+ id font = [attributes objectForKey:(__bridge NSString *)kAXFontTextAttribute]; > if (font) >- [mutableString appendFormat:@"%@ - %@, ", (id)kAXFontTextAttribute, font]; >+ [mutableString appendFormat:@"%@ - %@, ", (__bridge NSString *)kAXFontTextAttribute, font]; > }; > [string enumerateAttributesInRange:NSMakeRange(0, [string length]) options:(NSAttributedStringEnumerationOptions)0 usingBlock:attributeEnumerationBlock]; > [mutableString appendString:[string string]]; >@@ -1738,7 +1738,7 @@ static JSStringRef createJSStringRef(id string) > > JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange) > { >- id string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(id)markerRange->platformTextMarkerRange()]; >+ id string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(__bridge id)markerRange->platformTextMarkerRange()]; > return createJSStringRef(string); > } > >@@ -1746,9 +1746,9 @@ JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRangeWithOption > { > id parameter = nil; > if (includeSpellCheck) >- parameter = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:includeSpellCheck], @"AXSpellCheck", (id)markerRange->platformTextMarkerRange(), @"AXTextMarkerRange", nil]; >+ parameter = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:includeSpellCheck], @"AXSpellCheck", (__bridge id)markerRange->platformTextMarkerRange(), @"AXTextMarkerRange", nil]; > else >- parameter = (id)markerRange->platformTextMarkerRange(); >+ parameter = (__bridge id)markerRange->platformTextMarkerRange(); > id string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRangeWithOptions" forParameter:parameter]; > return createJSStringRef(string); > } >@@ -1756,9 +1756,9 @@ JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRangeWithOption > AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- 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 accessibilityAttributeValue:@"AXTextMarkerRangeForUnorderedTextMarkers" forParameter:textMarkers]; >- return AccessibilityTextMarkerRange(textMarkerRange); >+ return AccessibilityTextMarkerRange((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1767,8 +1767,8 @@ AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForMarkers(A > AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarkerForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()]; >- return AccessibilityTextMarker(textMarker); >+ id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarkerForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1777,8 +1777,8 @@ AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForTextMarkerRang > AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarkerForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()]; >- return AccessibilityTextMarker(textMarker); >+ id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarkerForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1788,7 +1788,7 @@ AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForBounds(int x, in > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]]; >- return AccessibilityTextMarker(textMarker); >+ return AccessibilityTextMarker((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1798,7 +1798,7 @@ AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForBounds(int x, > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]]; >- return AccessibilityTextMarker(textMarker); >+ return AccessibilityTextMarker((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1808,7 +1808,7 @@ AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y) > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXTextMarkerForPosition" forParameter:[NSValue valueWithPoint:NSMakePoint(x, y)]]; >- return AccessibilityTextMarker(textMarker); >+ return AccessibilityTextMarker((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1817,7 +1817,7 @@ AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y) > AccessibilityUIElement AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id uiElement = [m_element accessibilityAttributeValue:@"AXUIElementForTextMarker" forParameter:(id)marker->platformTextMarker()]; >+ id uiElement = [m_element accessibilityAttributeValue:@"AXUIElementForTextMarker" forParameter:(__bridge id)marker->platformTextMarker()]; > return AccessibilityUIElement(uiElement); > END_AX_OBJC_EXCEPTIONS > >@@ -1828,7 +1828,7 @@ AccessibilityTextMarker AccessibilityUIElement::startTextMarker() > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarker"]; >- return AccessibilityTextMarker(textMarker); >+ return AccessibilityTextMarker((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1838,7 +1838,7 @@ AccessibilityTextMarker AccessibilityUIElement::endTextMarker() > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarker"]; >- return AccessibilityTextMarker(textMarker); >+ return AccessibilityTextMarker((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1847,7 +1847,7 @@ AccessibilityTextMarker AccessibilityUIElement::endTextMarker() > bool AccessibilityUIElement::setSelectedVisibleTextRange(AccessibilityTextMarkerRange* markerRange) > { > BEGIN_AX_OBJC_EXCEPTIONS >- [m_element accessibilitySetValue:(id)markerRange->platformTextMarkerRange() forAttribute:NSAccessibilitySelectedTextMarkerRangeAttribute]; >+ [m_element accessibilitySetValue:(__bridge id)markerRange->platformTextMarkerRange() forAttribute:NSAccessibilitySelectedTextMarkerRangeAttribute]; > END_AX_OBJC_EXCEPTIONS > > return true; >@@ -1856,8 +1856,8 @@ bool AccessibilityUIElement::setSelectedVisibleTextRange(AccessibilityTextMarker > AccessibilityTextMarkerRange AccessibilityUIElement::leftWordTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLeftWordTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange(textMarkerRange); >+ id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLeftWordTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarkerRange((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1866,8 +1866,8 @@ AccessibilityTextMarkerRange AccessibilityUIElement::leftWordTextMarkerRangeForT > AccessibilityTextMarkerRange AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id textMarkerRange = [m_element accessibilityAttributeValue:@"AXRightWordTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange(textMarkerRange); >+ id textMarkerRange = [m_element accessibilityAttributeValue:@"AXRightWordTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarkerRange((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1876,8 +1876,8 @@ AccessibilityTextMarkerRange AccessibilityUIElement::rightWordTextMarkerRangeFor > AccessibilityTextMarker AccessibilityUIElement::previousWordStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id previousTextMarker = [m_element accessibilityAttributeValue:@"AXPreviousWordStartTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker(previousTextMarker); >+ id previousTextMarker = [m_element accessibilityAttributeValue:@"AXPreviousWordStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)previousTextMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1886,8 +1886,8 @@ AccessibilityTextMarker AccessibilityUIElement::previousWordStartTextMarkerForTe > AccessibilityTextMarker AccessibilityUIElement::nextWordEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id nextTextMarker = [m_element accessibilityAttributeValue:@"AXNextWordEndTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker(nextTextMarker); >+ id nextTextMarker = [m_element accessibilityAttributeValue:@"AXNextWordEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)nextTextMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1896,8 +1896,8 @@ AccessibilityTextMarker AccessibilityUIElement::nextWordEndTextMarkerForTextMark > AccessibilityTextMarkerRange AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id textMarkerRange = [m_element accessibilityAttributeValue:@"AXParagraphTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange(textMarkerRange); >+ id textMarkerRange = [m_element accessibilityAttributeValue:@"AXParagraphTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarkerRange((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1906,8 +1906,8 @@ AccessibilityTextMarkerRange AccessibilityUIElement::paragraphTextMarkerRangeFor > AccessibilityTextMarker AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id previousTextMarker = [m_element accessibilityAttributeValue:@"AXPreviousParagraphStartTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker(previousTextMarker); >+ id previousTextMarker = [m_element accessibilityAttributeValue:@"AXPreviousParagraphStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)previousTextMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1916,8 +1916,8 @@ AccessibilityTextMarker AccessibilityUIElement::previousParagraphStartTextMarker > AccessibilityTextMarker AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id nextTextMarker = [m_element accessibilityAttributeValue:@"AXNextParagraphEndTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker(nextTextMarker); >+ id nextTextMarker = [m_element accessibilityAttributeValue:@"AXNextParagraphEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)nextTextMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1926,8 +1926,8 @@ AccessibilityTextMarker AccessibilityUIElement::nextParagraphEndTextMarkerForTex > AccessibilityTextMarkerRange AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id textMarkerRange = [m_element accessibilityAttributeValue:@"AXSentenceTextMarkerRangeForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange(textMarkerRange); >+ id textMarkerRange = [m_element accessibilityAttributeValue:@"AXSentenceTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarkerRange((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1936,8 +1936,8 @@ AccessibilityTextMarkerRange AccessibilityUIElement::sentenceTextMarkerRangeForT > AccessibilityTextMarker AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id previousTextMarker = [m_element accessibilityAttributeValue:@"AXPreviousSentenceStartTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker(previousTextMarker); >+ id previousTextMarker = [m_element accessibilityAttributeValue:@"AXPreviousSentenceStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)previousTextMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1946,8 +1946,8 @@ AccessibilityTextMarker AccessibilityUIElement::previousSentenceStartTextMarkerF > AccessibilityTextMarker AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(AccessibilityTextMarker* textMarker) > { > BEGIN_AX_OBJC_EXCEPTIONS >- id nextTextMarker = [m_element accessibilityAttributeValue:@"AXNextSentenceEndTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker(nextTextMarker); >+ id nextTextMarker = [m_element accessibilityAttributeValue:@"AXNextSentenceEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >+ return AccessibilityTextMarker((__bridge CFTypeRef)nextTextMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >index 3d0a8a09ac65592ce943a32ed7dcbeea6b91dff2..d9b84fc2009f2c976bae3dace8118e97241e2e60 100644 >--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm >+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >@@ -923,7 +923,7 @@ static void resetWebPreferencesToConsistentValues() > [preferences setMetaRefreshEnabled:YES]; > > if (persistentUserStyleSheetLocation) { >- [preferences setUserStyleSheetLocation:[NSURL URLWithString:(NSString *)(persistentUserStyleSheetLocation.get())]]; >+ [preferences setUserStyleSheetLocation:[NSURL URLWithString:(__bridge NSString *)persistentUserStyleSheetLocation.get()]]; > [preferences setUserStyleSheetEnabled:YES]; > } else > [preferences setUserStyleSheetEnabled:NO]; >@@ -1479,7 +1479,7 @@ static NSString *dumpFramesAsText(WebFrame *frame) > // conversion methods cannot. After the conversion to a buffer, we turn that buffer into > // a CFString via fromUTF8WithLatin1Fallback().createCFString() which can be appended to > // the result without any conversion. >- WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKStringCreateWithCFString((CFStringRef)innerText)); >+ WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKStringCreateWithCFString((__bridge CFStringRef)innerText)); > size_t bufferSize = WKStringGetMaximumUTF8CStringSize(stringRef.get()); > auto buffer = std::make_unique<char[]>(bufferSize); > size_t stringLength = WKStringGetUTF8CStringNonStrict(stringRef.get(), buffer.get(), bufferSize); >@@ -1612,10 +1612,7 @@ static const char *methodNameStringForFailedTest() > > static void dumpBackForwardListForAllWindows() > { >- CFArrayRef openWindows = (CFArrayRef)[DumpRenderTreeWindow openWindows]; >- unsigned count = CFArrayGetCount(openWindows); >- for (unsigned i = 0; i < count; i++) { >- NSWindow *window = (NSWindow *)CFArrayGetValueAtIndex(openWindows, i); >+ for (NSWindow *window in [DumpRenderTreeWindow openWindows]) { > #if !PLATFORM(IOS) > WebView *webView = [[[window contentView] subviews] objectAtIndex:0]; > #else >@@ -1693,11 +1690,11 @@ void dump() > resultMimeType = @"application/pdf"; > } else if (gTestRunner->dumpDOMAsWebArchive()) { > WebArchive *webArchive = [[mainFrame DOMDocument] webArchive]; >- resultString = CFBridgingRelease(WebCoreTestSupport::createXMLStringFromWebArchiveData((CFDataRef)[webArchive data])); >+ resultString = CFBridgingRelease(WebCoreTestSupport::createXMLStringFromWebArchiveData((__bridge CFDataRef)[webArchive data])); > resultMimeType = @"application/x-webarchive"; > } else if (gTestRunner->dumpSourceAsWebArchive()) { > WebArchive *webArchive = [[mainFrame dataSource] webArchive]; >- resultString = CFBridgingRelease(WebCoreTestSupport::createXMLStringFromWebArchiveData((CFDataRef)[webArchive data])); >+ resultString = CFBridgingRelease(WebCoreTestSupport::createXMLStringFromWebArchiveData((__bridge CFDataRef)[webArchive data])); > resultMimeType = @"application/x-webarchive"; > } else > resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gTestRunner->isPrinting()]; >@@ -1943,7 +1940,7 @@ static void runTest(const string& inputLine) > testPath = [url absoluteString]; > > NSString *informationString = [@"CRASHING TEST: " stringByAppendingString:testPath]; >- WebKit::setCrashReportApplicationSpecificInformation((CFStringRef)informationString); >+ WebKit::setCrashReportApplicationSpecificInformation((__bridge CFStringRef)informationString); > > TestOptions options { [url isFileURL] ? [url fileSystemRepresentation] : pathOrURL, command.absolutePath }; > >@@ -2085,7 +2082,7 @@ static void runTest(const string& inputLine) > > // We should only have our main window left open when we're done > ASSERT(CFArrayGetCount(openWindowsRef) == 1); >- ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]); >+ ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == (__bridge CFTypeRef)[[mainFrame webView] window]); > > gTestRunner->cleanup(); > gTestRunner = nullptr; >diff --git a/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm b/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm >index cb897ae700888166f901c7ff824b9ed72d31a577..cdd31b3bbb35bb86250fefc0cabf1c55c341bcae 100644 >--- a/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm >+++ b/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm >@@ -31,11 +31,11 @@ > #import "config.h" > #import "DumpRenderTreePasteboard.h" > >-#import "DumpRenderTreeMac.h" >- >-#if !PLATFORM(IOS) >+#if PLATFORM(MAC) > >+#import "DumpRenderTreeMac.h" > #import <WebKit/WebTypesInternal.h> >+#import <objc/runtime.h> > #import <wtf/Assertions.h> > #import <wtf/HashMap.h> > #import <wtf/ListHashSet.h> >@@ -46,8 +46,8 @@ @interface LocalPasteboard : NSPasteboard { > RetainPtr<NSString> _pasteboardName; > NSInteger _changeCount; > >- ListHashSet<RetainPtr<NSString>, WTF::RetainPtrObjectHash<NSString>> _types; >- HashMap<RetainPtr<NSString>, RetainPtr<NSData>, WTF::RetainPtrObjectHash<NSString>, WTF::RetainPtrObjectHashTraits<NSString>> _data; >+ ListHashSet<RetainPtr<CFStringRef>, WTF::RetainPtrObjectHash<CFStringRef>> _types; >+ HashMap<RetainPtr<CFStringRef>, RetainPtr<CFDataRef>, WTF::RetainPtrObjectHash<CFStringRef>, WTF::RetainPtrObjectHashTraits<CFStringRef>> _data; > } > > -(id)initWithName:(NSString *)name; >@@ -93,7 +93,8 @@ @implementation LocalPasteboard > > + (id)alloc > { >- return NSAllocateObject(self, 0, 0); >+ // Need to skip NSPasteboard's alloc, which does not allocate an object. >+ return class_createInstance(self, 0); > } > > - (id)initWithName:(NSString *)name >@@ -129,14 +130,14 @@ static bool isUTI(NSString *type) > return UTTypeIsDynamic((__bridge CFStringRef)type) || UTTypeIsDeclared((__bridge CFStringRef)type); > } > >-static RetainPtr<NSString> toUTI(NSString *type) >+static RetainPtr<CFStringRef> toUTI(NSString *type) > { > if (isUTI(type)) { >- // This is already an UTI. >- return adoptNS([type copy]); >+ // This is already a UTI. >+ return adoptCF(CFStringCreateCopy(nullptr, (__bridge CFStringRef)type)); > } > >- return adoptNS((__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, (__bridge CFStringRef)type, nullptr)); >+ return adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, (__bridge CFStringRef)type, nullptr)); > } > > - (NSInteger)addTypes:(NSArray *)newTypes owner:(id)newOwner >@@ -162,10 +163,10 @@ - (NSArray *)types > auto types = adoptNS([[NSMutableArray alloc] init]); > > for (const auto& type : _types) { >- [types addObject:type.get()]; >+ [types addObject:(__bridge NSString *)type.get()]; > > // Include the pasteboard type as well. >- if (auto pasteboardType = adoptNS((__bridge NSString *)UTTypeCopyPreferredTagWithClass((CFStringRef)type.get(), kUTTagClassNSPboardType))) >+ if (auto pasteboardType = adoptNS((__bridge NSString *)UTTypeCopyPreferredTagWithClass(type.get(), kUTTagClassNSPboardType))) > [types addObject:pasteboardType.get()]; > } > >@@ -175,7 +176,7 @@ - (NSArray *)types > - (NSString *)availableTypeFromArray:(NSArray *)types > { > for (NSString *type in types) { >- if (_types.contains(type)) >+ if (_types.contains((__bridge CFStringRef)type)) > return type; > } > >@@ -189,45 +190,32 @@ - (BOOL)setData:(NSData *)data forType:(NSString *)dataType > if (!_types.contains(uti)) > return NO; > >- _data.set(WTFMove(uti), data ? data : [NSData data]); >+ _data.set(WTFMove(uti), (__bridge CFDataRef)(data ?: [NSData data])); > return YES; > } > > - (NSData *)dataForType:(NSString *)dataType > { >- if (NSData *data = _data.get(toUTI(dataType)).get()) >+ if (NSData *data = (__bridge NSData *)_data.get(toUTI(dataType).get()).get()) > return data; > > if (_owner && [_owner respondsToSelector:@selector(pasteboard:provideDataForType:)]) > [_owner pasteboard:self provideDataForType:dataType]; > >- return _data.get(toUTI(dataType)).get(); >+ return (__bridge NSData *)_data.get(toUTI(dataType).get()).get(); > } > > - (BOOL)setPropertyList:(id)propertyList forType:(NSString *)dataType > { >- CFDataRef data = NULL; >+ NSData *data = nil; > if (propertyList) >- data = CFPropertyListCreateXMLData(NULL, propertyList); >- BOOL result = [self setData:(NSData *)data forType:dataType]; >- if (data) >- CFRelease(data); >- return result; >+ data = [NSPropertyListSerialization dataWithPropertyList:propertyList format:NSPropertyListXMLFormat_v1_0 options:0 error:nullptr]; >+ return [self setData:data forType:dataType]; > } > > - (BOOL)setString:(NSString *)string forType:(NSString *)dataType > { >- CFDataRef data = NULL; >- if (string) { >- if (!string.length) >- data = CFDataCreate(NULL, NULL, 0); >- else >- data = CFStringCreateExternalRepresentation(NULL, (CFStringRef)string, kCFStringEncodingUTF8, 0); >- } >- BOOL result = [self setData:(NSData *)data forType:dataType]; >- if (data) >- CFRelease(data); >- return result; >+ return [self setData:[string dataUsingEncoding:NSUTF8StringEncoding] forType:dataType]; > } > > - (BOOL)writeObjects:(NSArray<id <NSPasteboardWriting>> *)objects >@@ -251,4 +239,4 @@ - (BOOL)writeObjects:(NSArray<id <NSPasteboardWriting>> *)objects > > @end > >-#endif // !PLATFORM(IOS) >+#endif // PLATFORM(MAC) >diff --git a/Tools/DumpRenderTree/mac/MockGeolocationProvider.h b/Tools/DumpRenderTree/mac/MockGeolocationProvider.h >index 7265dcdd5ed27f251779e984a7cb0081da734ac2..ec959b710bdd41faac0ee183030eb9720d03fb42 100644 >--- a/Tools/DumpRenderTree/mac/MockGeolocationProvider.h >+++ b/Tools/DumpRenderTree/mac/MockGeolocationProvider.h >@@ -23,9 +23,6 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef MockGeolocationProvider_h >-#define MockGeolocationProvider_h >- > #import <WebKit/WebViewPrivate.h> > #import <wtf/HashSet.h> > #import <wtf/RetainPtr.h> >@@ -35,7 +32,7 @@ @interface MockGeolocationProvider : NSObject<WebGeolocationProvider> { > BOOL _hasError; > RetainPtr<NSString> _errorMessage; > NSTimer *_timer; >- HashSet<WebView *> _registeredViews; >+ HashSet<CFTypeRef> _registeredViews; > } > > + (MockGeolocationProvider *)shared; >@@ -47,4 +44,3 @@ @interface MockGeolocationProvider : NSObject<WebGeolocationProvider> { > - (BOOL)isActive; > > @end >-#endif >diff --git a/Tools/DumpRenderTree/mac/MockGeolocationProvider.mm b/Tools/DumpRenderTree/mac/MockGeolocationProvider.mm >index 17e6c46ba39f895c0acfa91e5fe632440cc22e95..acd88d3da03d36fee31b227b7b376c1c49ee3e15 100644 >--- a/Tools/DumpRenderTree/mac/MockGeolocationProvider.mm >+++ b/Tools/DumpRenderTree/mac/MockGeolocationProvider.mm >@@ -76,7 +76,7 @@ - (void)setPositionUnavailableErrorWithMessage:(NSString *)errorMessage > > - (void)registerWebView:(WebView *)webView > { >- _registeredViews.add(webView); >+ _registeredViews.add((__bridge CFTypeRef)webView); > > if (!_timer) > _timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO]; >@@ -84,7 +84,7 @@ - (void)registerWebView:(WebView *)webView > > - (void)unregisterWebView:(WebView *)webView > { >- _registeredViews.remove(webView); >+ _registeredViews.remove((__bridge CFTypeRef)webView); > } > > - (WebGeolocationPosition *)lastPosition >@@ -125,15 +125,14 @@ - (void)timerFired > _timer = 0; > > // Expect that views won't be (un)registered while iterating. >- HashSet<WebView*> views = _registeredViews; >- for (HashSet<WebView*>::iterator iter = views.begin(); iter != views.end(); ++iter) { >+ for (auto typelessView : _registeredViews) { >+ auto webView = (__bridge WebView*)typelessView; > #if !PLATFORM(IOS) > if (_hasError) >- [*iter _geolocationDidFailWithMessage:_errorMessage.get()]; >+ [webView _geolocationDidFailWithMessage:_errorMessage.get()]; > else >- [*iter _geolocationDidChangePosition:_lastPosition.get()]; >+ [webView _geolocationDidChangePosition:_lastPosition.get()]; > #else >- WebView* webView = *iter; > WebGeolocationPosition *lastPosition = _lastPosition.get(); > NSString *errorMessage = _errorMessage.get(); > if (_hasError) { >diff --git a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.h b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.h >index c4deb837b05f1f733658cf283233cf52c258c5d9..e46b32b6623f36058e069d136ca183cdeee30e67 100644 >--- a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.h >+++ b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.h >@@ -26,20 +26,17 @@ > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef MockWebNotificationProvider_h >-#define MockWebNotificationProvider_h >- > #import <WebKit/WebNotification.h> > #import <WebKit/WebViewPrivate.h> > #import <wtf/HashMap.h> > #import <wtf/HashSet.h> > #import <wtf/RetainPtr.h> > >-typedef HashMap<uint64_t, RetainPtr<WebNotification> > NotificationIDMap; >-typedef HashMap<uint64_t, WebView *> NotificationViewMap; >+using NotificationIDMap = HashMap<uint64_t, RetainPtr<WebNotification>>; >+using NotificationViewMap = HashMap<uint64_t, CFTypeRef>; > > @interface MockWebNotificationProvider : NSObject <WebNotificationProvider> { >- HashSet<WebView *> _registeredWebViews; >+ HashSet<CFTypeRef> _registeredWebViews; > NotificationIDMap _notifications; > NotificationViewMap _notificationViewMap; > RetainPtr<NSMutableDictionary> _permissions; >@@ -54,5 +51,3 @@ @interface MockWebNotificationProvider : NSObject <WebNotificationProvider> { > > - (void)reset; > @end >- >-#endif // MockWebNotificationProvider_h >diff --git a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm >index 948d4bbf6842b2b446c1f64b78184f52f8192267..1ad453b8d5a79fa06470b7ddbb16374c720ad6b7 100644 >--- a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm >+++ b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm >@@ -49,23 +49,23 @@ - (id)init > > - (void)registerWebView:(WebView *)webView > { >- ASSERT(!_registeredWebViews.contains(webView)); >- _registeredWebViews.add(webView); >+ ASSERT(!_registeredWebViews.contains((__bridge CFTypeRef)webView)); >+ _registeredWebViews.add((__bridge CFTypeRef)webView); > } > > - (void)unregisterWebView:(WebView *)webView > { >- ASSERT(_registeredWebViews.contains(webView)); >- _registeredWebViews.remove(webView); >+ ASSERT(_registeredWebViews.contains((__bridge CFTypeRef)webView)); >+ _registeredWebViews.remove((__bridge CFTypeRef)webView); > } > > - (void)showNotification:(WebNotification *)notification fromWebView:(WebView *)webView > { >- ASSERT(_registeredWebViews.contains(webView)); >+ ASSERT(_registeredWebViews.contains((__bridge CFTypeRef)webView)); > > uint64_t notificationID = [notification notificationID]; > _notifications.add(notificationID, notification); >- _notificationViewMap.add(notificationID, webView); >+ _notificationViewMap.add(notificationID, (__bridge CFTypeRef)webView); > > [webView _notificationDidShow:notificationID]; > } >@@ -75,7 +75,7 @@ - (void)cancelNotification:(WebNotification *)notification > uint64_t notificationID = [notification notificationID]; > ASSERT(_notifications.contains(notificationID)); > >- [_notificationViewMap.get(notificationID) _notificationsDidClose:[NSArray arrayWithObject:[NSNumber numberWithUnsignedLongLong:notificationID]]]; >+ [(__bridge WebView *)_notificationViewMap.get(notificationID) _notificationsDidClose:[NSArray arrayWithObject:[NSNumber numberWithUnsignedLongLong:notificationID]]]; > } > > - (void)notificationDestroyed:(WebNotification *)notification >@@ -118,7 +118,7 @@ - (void)webView:(WebView *)webView didCloseNotifications:(NSArray *)notification > - (void)simulateWebNotificationClick:(uint64_t)notificationID > { > ASSERT(_notifications.contains(notificationID)); >- [_notificationViewMap.get(notificationID) _notificationDidClick:notificationID]; >+ [(__bridge WebView *)_notificationViewMap.get(notificationID) _notificationDidClick:notificationID]; > } > > - (WebNotificationPermission)policyForOrigin:(WebSecurityOrigin *)origin >diff --git a/Tools/DumpRenderTree/mac/ObjCPlugin.m b/Tools/DumpRenderTree/mac/ObjCPlugin.m >index 58da3474d4c6a20dcfb349b5aa6b7a61142c0376..f934b99496f28087e1ca414776ef416a863be3ec 100644 >--- a/Tools/DumpRenderTree/mac/ObjCPlugin.m >+++ b/Tools/DumpRenderTree/mac/ObjCPlugin.m >@@ -116,7 +116,8 @@ - (void)log:(NSString *)message > > - (id)retainObject:(id)obj > { >- return [obj retain]; >+ CFRetain((__bridge CFTypeRef)obj); >+ return obj; > } > > - (id)classOfObject:(id)obj >diff --git a/Tools/DumpRenderTree/mac/TestRunnerMac.mm b/Tools/DumpRenderTree/mac/TestRunnerMac.mm >index 1f8a54a7c5a5f76b3f0bff8df8e6170227e748db..0f90274a4a04758fd43b33f17cbc833d1c76914f 100644 >--- a/Tools/DumpRenderTree/mac/TestRunnerMac.mm >+++ b/Tools/DumpRenderTree/mac/TestRunnerMac.mm >@@ -145,10 +145,10 @@ void TestRunner::addDisallowedURL(JSStringRef url) > disallowedURLs = CFSetCreateMutable(kCFAllocatorDefault, 0, NULL); > > // Canonicalize the URL >- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; >+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:(__bridge NSString *)urlCF.get()]]; > request = [NSURLProtocol canonicalRequestForRequest:request]; > >- CFSetAddValue(disallowedURLs, [request URL]); >+ CFSetAddValue(disallowedURLs, (__bridge CFURLRef)[request URL]); > } > > bool TestRunner::callShouldCloseOnWebView() >@@ -164,7 +164,7 @@ void TestRunner::clearAllApplicationCaches() > long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef url) > { > RetainPtr<CFStringRef> urlCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, url)); >- WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; >+ WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(__bridge NSString *)urlCF.get()]]; > long long usage = [WebApplicationCache diskUsageForOrigin:origin]; > [origin release]; > return usage; >@@ -174,7 +174,7 @@ void TestRunner::clearApplicationCacheForOrigin(JSStringRef url) > { > RetainPtr<CFStringRef> urlCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, url)); > >- WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; >+ WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(__bridge NSString *)urlCF.get()]]; > [WebApplicationCache deleteCacheForOrigin:origin]; > [origin release]; > } >@@ -187,7 +187,7 @@ JSValueRef originsArrayToJS(JSContextRef context, NSArray *origins) > JSObjectRef arrayObj = JSValueToObject(context, arrayResult, 0); > for (NSUInteger i = 0; i < count; i++) { > NSString *origin = [[origins objectAtIndex:i] databaseIdentifier]; >- JSRetainPtr<JSStringRef> originJS(Adopt, JSStringCreateWithCFString((CFStringRef)origin)); >+ JSRetainPtr<JSStringRef> originJS(Adopt, JSStringCreateWithCFString((__bridge CFStringRef)origin)); > JSObjectSetPropertyAtIndex(context, arrayObj, i, JSValueMakeString(context, originJS.get()), 0); > } > >@@ -252,15 +252,15 @@ void TestRunner::clearBackForwardList() > JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) > { > RetainPtr<CFStringRef> nameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name)); >- NSString *nameNS = (NSString *)nameCF.get(); >- return JSStringCreateWithCFString((CFStringRef)[nameNS _web_decodeHostName]); >+ NSString *nameNS = (__bridge NSString *)nameCF.get(); >+ return JSStringCreateWithCFString((__bridge CFStringRef)[nameNS _web_decodeHostName]); > } > > JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) > { > RetainPtr<CFStringRef> nameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name)); >- NSString *nameNS = (NSString *)nameCF.get(); >- return JSStringCreateWithCFString((CFStringRef)[nameNS _web_encodeHostName]); >+ NSString *nameNS = (__bridge NSString *)nameCF.get(); >+ return JSStringCreateWithCFString((__bridge CFStringRef)[nameNS _web_encodeHostName]); > } > > void TestRunner::display() >@@ -378,7 +378,7 @@ JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef lo > void TestRunner::queueLoad(JSStringRef url, JSStringRef target) > { > RetainPtr<CFStringRef> urlCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, url)); >- NSString *urlNS = (NSString *)urlCF.get(); >+ NSString *urlNS = (__bridge NSString *)urlCF.get(); > > NSURL *nsurl = [NSURL URLWithString:urlNS relativeToURL:[[[mainFrame dataSource] response] URL]]; > NSString *nsurlString = [nsurl absoluteString]; >@@ -443,7 +443,7 @@ void TestRunner::setDefersLoading(bool defers) > void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) > { > RetainPtr<CFStringRef> schemeCFString = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, scheme)); >- [WebView _setDomainRelaxationForbidden:forbidden forURLScheme:(NSString *)schemeCFString.get()]; >+ [WebView _setDomainRelaxationForbidden:forbidden forURLScheme:(__bridge NSString *)schemeCFString.get()]; > } > > void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) >@@ -483,7 +483,7 @@ void TestRunner::setMockGeolocationPosition(double latitude, double longitude, d > void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message) > { > RetainPtr<CFStringRef> messageCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, message)); >- NSString *messageNS = (NSString *)messageCF.get(); >+ NSString *messageNS = (__bridge NSString *)messageCF.get(); > [[MockGeolocationProvider shared] setPositionUnavailableErrorWithMessage:messageNS]; > } > >@@ -592,7 +592,7 @@ void TestRunner::setUserStyleSheetEnabled(bool flag) > void TestRunner::setUserStyleSheetLocation(JSStringRef path) > { > RetainPtr<CFStringRef> pathCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, path)); >- NSURL *url = [NSURL URLWithString:(NSString *)pathCF.get()]; >+ NSURL *url = [NSURL URLWithString:(__bridge NSString *)pathCF.get()]; > [[WebPreferences standardPreferences] setUserStyleSheetLocation:url]; > } > >@@ -603,7 +603,7 @@ void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JS > return; > > RetainPtr<CFStringRef> valueCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, value)); >- [(DOMHTMLInputElement *)element setValueForUser:(NSString *)valueCF.get()]; >+ [(DOMHTMLInputElement *)element setValueForUser:(__bridge NSString *)valueCF.get()]; > } > > void TestRunner::dispatchPendingLoadRequests() >@@ -614,10 +614,10 @@ void TestRunner::dispatchPendingLoadRequests() > void TestRunner::overridePreference(JSStringRef key, JSStringRef value) > { > RetainPtr<CFStringRef> keyCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, key)); >- NSString *keyNS = (NSString *)keyCF.get(); >+ NSString *keyNS = (__bridge NSString *)keyCF.get(); > > RetainPtr<CFStringRef> valueCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, value)); >- NSString *valueNS = (NSString *)valueCF.get(); >+ NSString *valueNS = (__bridge NSString *)valueCF.get(); > > [[WebPreferences standardPreferences] _setPreferenceForTestWithValue:valueNS forKey:keyNS]; > } >@@ -669,10 +669,10 @@ int TestRunner::windowCount() > void TestRunner::execCommand(JSStringRef name, JSStringRef value) > { > RetainPtr<CFStringRef> nameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name)); >- NSString *nameNS = (NSString *)nameCF.get(); >+ NSString *nameNS = (__bridge NSString *)nameCF.get(); > > RetainPtr<CFStringRef> valueCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, value)); >- NSString *valueNS = (NSString *)valueCF.get(); >+ NSString *valueNS = (__bridge NSString *)valueCF.get(); > > [[mainFrame webView] _executeCoreCommandByName:nameNS value:valueNS]; > } >@@ -710,7 +710,7 @@ bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRe > options |= WebFindOptionsStartInSelection; > } > >- return [[mainFrame webView] findString:(NSString *)targetCFString.get() options:options]; >+ return [[mainFrame webView] findString:(__bridge NSString *)targetCFString.get() options:options]; > } > > void TestRunner::setCacheModel(int cacheModel) >@@ -722,7 +722,7 @@ bool TestRunner::isCommandEnabled(JSStringRef name) > { > #if !PLATFORM(IOS) > RetainPtr<CFStringRef> nameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name)); >- NSString *nameNS = (NSString *)nameCF.get(); >+ NSString *nameNS = (__bridge NSString *)nameCF.get(); > > // Accept command strings with capital letters for first letter without trailing colon. > if (![nameNS hasSuffix:@":"] && [nameNS length]) { >@@ -756,22 +756,22 @@ void TestRunner::waitForPolicyDelegate() > void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) > { > RetainPtr<CFStringRef> sourceOriginCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin)); >- NSString *sourceOriginNS = (NSString *)sourceOriginCF.get(); >+ NSString *sourceOriginNS = (__bridge NSString *)sourceOriginCF.get(); > RetainPtr<CFStringRef> protocolCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, destinationProtocol)); >- NSString *destinationProtocolNS = (NSString *)protocolCF.get(); >+ NSString *destinationProtocolNS = (__bridge NSString *)protocolCF.get(); > RetainPtr<CFStringRef> hostCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, destinationHost)); >- NSString *destinationHostNS = (NSString *)hostCF.get(); >+ NSString *destinationHostNS = (__bridge NSString *)hostCF.get(); > [WebView _addOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains]; > } > > void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) > { > RetainPtr<CFStringRef> sourceOriginCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin)); >- NSString *sourceOriginNS = (NSString *)sourceOriginCF.get(); >+ NSString *sourceOriginNS = (__bridge NSString *)sourceOriginCF.get(); > RetainPtr<CFStringRef> protocolCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, destinationProtocol)); >- NSString *destinationProtocolNS = (NSString *)protocolCF.get(); >+ NSString *destinationProtocolNS = (__bridge NSString *)protocolCF.get(); > RetainPtr<CFStringRef> hostCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, destinationHost)); >- NSString *destinationHostNS = (NSString *)hostCF.get(); >+ NSString *destinationHostNS = (__bridge NSString *)hostCF.get(); > [WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains]; > } > >@@ -783,14 +783,14 @@ void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) > void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) > { > RetainPtr<CFStringRef> sourceCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, source)); >- NSString *sourceNS = (NSString *)sourceCF.get(); >+ NSString *sourceNS = (__bridge NSString *)sourceCF.get(); > [WebView _addUserScriptToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectionTime:(runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd) injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)]; > } > > void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) > { > RetainPtr<CFStringRef> sourceCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, source)); >- NSString *sourceNS = (NSString *)sourceCF.get(); >+ NSString *sourceNS = (__bridge NSString *)sourceCF.get(); > [WebView _addUserStyleSheetToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)]; > } > >@@ -812,7 +812,7 @@ void TestRunner::closeWebInspector() > void TestRunner::evaluateInWebInspector(JSStringRef script) > { > RetainPtr<CFStringRef> scriptCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, script)); >- NSString *scriptNS = (NSString *)scriptCF.get(); >+ NSString *scriptNS = (__bridge NSString *)scriptCF.get(); > [[[mainFrame webView] inspector] evaluateInFrontend:nil script:scriptNS]; > } > >@@ -863,7 +863,7 @@ void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, J > void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) > { > RetainPtr<CFStringRef> scriptCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, script)); >- NSString *scriptNS = (NSString *)scriptCF.get(); >+ NSString *scriptNS = (__bridge NSString *)scriptCF.get(); > > // A worldID of 0 always corresponds to a new world. Any other worldID corresponds to a world > // that is created once and cached forever. >@@ -1135,9 +1135,9 @@ void TestRunner::authenticateSession(JSStringRef url, JSStringRef username, JSSt > RetainPtr<CFStringRef> usernameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, username)); > RetainPtr<CFStringRef> passwordCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, password)); > >- RetainPtr<NSURLRequest> request = adoptNS([[NSURLRequest alloc] initWithURL:[NSURL URLWithString:(NSString *)urlStringCF.get()]]); >+ RetainPtr<NSURLRequest> request = adoptNS([[NSURLRequest alloc] initWithURL:[NSURL URLWithString:(__bridge NSString *)urlStringCF.get()]]); > >- [SynchronousLoader makeRequest:request.get() withUsername:(NSString *)usernameCF.get() password:(NSString *)passwordCF.get()]; >+ [SynchronousLoader makeRequest:request.get() withUsername:(__bridge NSString *)usernameCF.get() password:(__bridge NSString *)passwordCF.get()]; > } > > void TestRunner::abortModal() >@@ -1227,14 +1227,14 @@ void TestRunner::grantWebNotificationPermission(JSStringRef jsOrigin) > { > RetainPtr<CFStringRef> cfOrigin = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, jsOrigin)); > ASSERT([[mainFrame webView] _notificationProvider] == [MockWebNotificationProvider shared]); >- [[MockWebNotificationProvider shared] setWebNotificationOrigin:(NSString *)cfOrigin.get() permission:TRUE]; >+ [[MockWebNotificationProvider shared] setWebNotificationOrigin:(__bridge NSString *)cfOrigin.get() permission:TRUE]; > } > > void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin) > { > RetainPtr<CFStringRef> cfOrigin = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, jsOrigin)); > ASSERT([[mainFrame webView] _notificationProvider] == [MockWebNotificationProvider shared]); >- [[MockWebNotificationProvider shared] setWebNotificationOrigin:(NSString *)cfOrigin.get() permission:FALSE]; >+ [[MockWebNotificationProvider shared] setWebNotificationOrigin:(__bridge NSString *)cfOrigin.get() permission:FALSE]; > } > > void TestRunner::removeAllWebNotificationPermissions() >diff --git a/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm b/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm >index 2175a01bbbdc417c57916cffcdcc230590ff84a3..f9131af212898b538b17b9ffc0711a7d54ec8cca 100644 >--- a/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm >+++ b/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm >@@ -251,10 +251,10 @@ - (void)setResultsFromJSObject:(JSObjectRef)resultsObject inContext:(JSContextRe > } > JSPropertyNameArrayRelease(detailsObjectProperties); > } >- [resultsForWord addObject:[[[LayoutTestTextCheckingResult alloc] initWithType:nsTextCheckingType(WTFMove(typeValue)) range:NSMakeRange(fromValue, toValue - fromValue) replacement:(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:(NSString *)cfTextToCheck.get()]; >+ [results setObject:resultsForWord.get() forKey:(__bridge NSString *)cfTextToCheck.get()]; > JSPropertyNameArrayRelease(resultsArrayPropertyNames); > } > JSPropertyNameArrayRelease(properties); >diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm >index 9e074d1497fe2221766e751cd03ab13dfe0c4816..77dffb306a4813eea698ca09fa1c13b71b3aa4d0 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm >+++ b/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm >@@ -1671,7 +1671,7 @@ RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::lineTextMarkerRange > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLineTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange::create(textMarkerRange); >+ return AccessibilityTextMarkerRange::create((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1681,7 +1681,7 @@ RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForE > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:@"AXTextMarkerRangeForUIElement" forParameter:element->platformUIElement()]; >- return AccessibilityTextMarkerRange::create(textMarkerRange); >+ return AccessibilityTextMarkerRange::create((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1701,7 +1701,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(Acces > { > BEGIN_AX_OBJC_EXCEPTIONS > id previousMarker = [m_element accessibilityAttributeValue:@"AXPreviousTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker::create(previousMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)previousMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1711,7 +1711,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(Accessibi > { > BEGIN_AX_OBJC_EXCEPTIONS > id nextMarker = [m_element accessibilityAttributeValue:@"AXNextTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker::create(nextMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)nextMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1732,7 +1732,7 @@ RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForM > BEGIN_AX_OBJC_EXCEPTIONS > NSArray* textMarkers = [NSArray arrayWithObjects:(__bridge id)startMarker->platformTextMarker(), (__bridge id)endMarker->platformTextMarker(), nil]; > id textMarkerRange = [m_element accessibilityAttributeValue:@"AXTextMarkerRangeForUnorderedTextMarkers" forParameter:textMarkers]; >- return AccessibilityTextMarkerRange::create(textMarkerRange); >+ return AccessibilityTextMarkerRange::create((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1742,7 +1742,7 @@ RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::selectedTextMarkerR > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:NSAccessibilitySelectedTextMarkerRangeAttribute]; >- return AccessibilityTextMarkerRange::create(textMarkerRange); >+ return AccessibilityTextMarkerRange::create((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1768,7 +1768,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMa > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarkerForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()]; >- return AccessibilityTextMarker::create(textMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1778,7 +1778,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMark > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarkerForTextMarkerRange" forParameter:(__bridge id)range->platformTextMarkerRange()]; >- return AccessibilityTextMarker::create(textMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1788,7 +1788,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForBounds(i > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]]; >- return AccessibilityTextMarker::create(textMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1798,7 +1798,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForBounds > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]]; >- return AccessibilityTextMarker::create(textMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1808,7 +1808,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int x > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXTextMarkerForPosition" forParameter:[NSValue valueWithPoint:NSMakePoint(x, y)]]; >- return AccessibilityTextMarker::create(textMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1917,7 +1917,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForIndex(int t > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXTextMarkerForIndex" forParameter:[NSNumber numberWithInteger:textIndex]]; >- return AccessibilityTextMarker::create(textMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1927,7 +1927,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarker() > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarker"]; >- return AccessibilityTextMarker::create(textMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1937,7 +1937,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarker() > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarker"]; >- return AccessibilityTextMarker::create(textMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)textMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1947,7 +1947,7 @@ RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::leftWordTextMarkerR > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:@"AXLeftWordTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange::create(textMarkerRange); >+ return AccessibilityTextMarkerRange::create((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1957,7 +1957,7 @@ RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::rightWordTextMarker > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:@"AXRightWordTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange::create(textMarkerRange); >+ return AccessibilityTextMarkerRange::create((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1967,7 +1967,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousWordStartTextMar > { > BEGIN_AX_OBJC_EXCEPTIONS > id previousWordStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousWordStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker::create(previousWordStartMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)previousWordStartMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1977,7 +1977,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextWordEndTextMarkerFor > { > BEGIN_AX_OBJC_EXCEPTIONS > id nextWordEndMarker = [m_element accessibilityAttributeValue:@"AXNextWordEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker::create(nextWordEndMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)nextWordEndMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1987,7 +1987,7 @@ RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::paragraphTextMarker > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:@"AXParagraphTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange::create(textMarkerRange); >+ return AccessibilityTextMarkerRange::create((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -1997,7 +1997,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousParagraphStartTe > { > BEGIN_AX_OBJC_EXCEPTIONS > id previousParagraphStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousParagraphStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker::create(previousParagraphStartMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)previousParagraphStartMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -2007,7 +2007,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextParagraphEndTextMark > { > BEGIN_AX_OBJC_EXCEPTIONS > id nextParagraphEndMarker = [m_element accessibilityAttributeValue:@"AXNextParagraphEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker::create(nextParagraphEndMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)nextParagraphEndMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -2017,7 +2017,7 @@ RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::sentenceTextMarkerR > { > BEGIN_AX_OBJC_EXCEPTIONS > id textMarkerRange = [m_element accessibilityAttributeValue:@"AXSentenceTextMarkerRangeForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarkerRange::create(textMarkerRange); >+ return AccessibilityTextMarkerRange::create((__bridge CFTypeRef)textMarkerRange); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -2027,7 +2027,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousSentenceStartTex > { > BEGIN_AX_OBJC_EXCEPTIONS > id previousParagraphStartMarker = [m_element accessibilityAttributeValue:@"AXPreviousSentenceStartTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker::create(previousParagraphStartMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)previousParagraphStartMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >@@ -2037,7 +2037,7 @@ RefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextSentenceEndTextMarke > { > BEGIN_AX_OBJC_EXCEPTIONS > id nextParagraphEndMarker = [m_element accessibilityAttributeValue:@"AXNextSentenceEndTextMarkerForTextMarker" forParameter:(__bridge id)textMarker->platformTextMarker()]; >- return AccessibilityTextMarker::create(nextParagraphEndMarker); >+ return AccessibilityTextMarker::create((__bridge CFTypeRef)nextParagraphEndMarker); > END_AX_OBJC_EXCEPTIONS > > return nullptr; >diff --git a/Tools/WebKitTestRunner/PlatformMac.cmake b/Tools/WebKitTestRunner/PlatformMac.cmake >index 313dbcd0e5c16c1a0a60c6c7198562e786d5d1bb..edd7c4d81935107e92754ba33a15dccf7a3077e4 100644 >--- a/Tools/WebKitTestRunner/PlatformMac.cmake >+++ b/Tools/WebKitTestRunner/PlatformMac.cmake >@@ -62,6 +62,7 @@ list(APPEND WebKitTestRunner_SOURCES > ${WEBKIT_TESTRUNNER_DIR}/mac/WebKitTestRunnerDraggingInfo.mm > ${WEBKIT_TESTRUNNER_DIR}/mac/WebKitTestRunnerEvent.mm > ${WEBKIT_TESTRUNNER_DIR}/mac/WebKitTestRunnerPasteboard.mm >+ ${WEBKIT_TESTRUNNER_DIR}/mac/WebKitTestRunnerWindow.mm > ${WEBKIT_TESTRUNNER_DIR}/mac/main.mm > > ${WEBKIT_TESTRUNNER_SHARED_DIR}/EventSerialization/mac/EventSerializerMac.mm >diff --git a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj >index 1940f5be539a5028ed7498987bb2313146803c60..1c6c474e1a502ddaf7020f19b8cfe5b0ebd947eb 100644 >--- a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj >+++ b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj >@@ -103,6 +103,7 @@ > 65EB85A011EC67CC0034D300 /* ActivateFontsCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65EB859F11EC67CC0034D300 /* ActivateFontsCocoa.mm */; }; > 8034C6621487636400AC32E9 /* AccessibilityControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8034C6611487636400AC32E9 /* AccessibilityControllerMac.mm */; }; > 8097338A14874A5A008156D9 /* AccessibilityNotificationHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8097338914874A5A008156D9 /* AccessibilityNotificationHandler.mm */; }; >+ 9376417A210D737200A3DAAE /* WebKitTestRunnerWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93764176210D736000A3DAAE /* WebKitTestRunnerWindow.mm */; }; > A185103A1B9AE0DA00744AEB /* CrashReporterInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */; }; > A185103B1B9AE0E200744AEB /* TestControllerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */; }; > A185103C1B9AE0FE00744AEB /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841CC00D181185BF0042E9B6 /* Options.cpp */; }; >@@ -316,6 +317,8 @@ > 841CC00D181185BF0042E9B6 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Options.cpp; sourceTree = "<group>"; }; > 841CC00E181185BF0042E9B6 /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Options.h; sourceTree = "<group>"; }; > 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WebKitTestRunner; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 93764176210D736000A3DAAE /* WebKitTestRunnerWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKitTestRunnerWindow.mm; sourceTree = "<group>"; }; >+ 93764177210D736100A3DAAE /* WebKitTestRunnerWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitTestRunnerWindow.h; sourceTree = "<group>"; }; > 9B0D132E2036D346008FC8FB /* WebKitTestRunnerApp-iOS.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "WebKitTestRunnerApp-iOS.entitlements"; sourceTree = "<group>"; }; > 9B36A270209453A0003E0651 /* WhatToDump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WhatToDump.h; sourceTree = "<group>"; }; > A18510271B9ADE4800744AEB /* libWebKitTestRunner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWebKitTestRunner.a; sourceTree = BUILT_PRODUCTS_DIR; }; >@@ -749,6 +752,8 @@ > E132AA3B17CE776F00611DF0 /* WebKitTestRunnerEvent.mm */, > E1C642C517CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.h */, > E1C642C417CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.mm */, >+ 93764177210D736100A3DAAE /* WebKitTestRunnerWindow.h */, >+ 93764176210D736000A3DAAE /* WebKitTestRunnerWindow.mm */, > ); > path = mac; > sourceTree = "<group>"; >@@ -1045,6 +1050,7 @@ > E132AA3A17CD5F1000611DF0 /* WebKitTestRunnerDraggingInfo.mm in Sources */, > E132AA3D17CE776F00611DF0 /* WebKitTestRunnerEvent.mm in Sources */, > E1C642C617CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.mm in Sources */, >+ 9376417A210D737200A3DAAE /* WebKitTestRunnerWindow.mm in Sources */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm >index 790f6351bd6b01e3984581025ed9d0f4773541cb..46584ff778906f528ee06875f48665f0381a6c6e 100644 >--- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm >+++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm >@@ -31,6 +31,7 @@ > #import "StringFunctions.h" > #import "TestController.h" > #import "TestRunnerWKWebView.h" >+#import "WebKitTestRunnerWindow.h" > #import <Carbon/Carbon.h> > #import <WebKit/WKString.h> > #import <WebKit/WKPagePrivate.h> >diff --git a/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm b/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm >index ddd5749406cc3f1d20a3df3fbf271a308e6b0eac..f6cb2a08d64579cd444f820a30a6149f380dfa65 100644 >--- a/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm >+++ b/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm >@@ -29,6 +29,7 @@ > #import "TestController.h" > #import "TestRunnerWKWebView.h" > #import "WebKitTestRunnerDraggingInfo.h" >+#import "WebKitTestRunnerWindow.h" > #import <WebKit/WKImageCG.h> > #import <WebKit/WKPreferencesPrivate.h> > #import <WebKit/WKWebViewConfiguration.h> >@@ -37,93 +38,21 @@ > #import <wtf/mac/AppKitCompatibilityDeclarations.h> > > #if WK_API_ENABLED >-@interface WKWebView (Details) >+@interface WKWebView () > - (WKPageRef)_pageForTesting; > @end > #endif > > using namespace WTR; > >+// FIXME: Move to NSWindowSPI.h. > enum { > _NSBackingStoreUnbuffered = 3 > }; > >-@interface WebKitTestRunnerWindow : NSWindow { >- PlatformWebView* _platformWebView; >- NSPoint _fakeOrigin; >-} >-@property (nonatomic, assign) PlatformWebView* platformWebView; >-@end >- >-static Vector<WebKitTestRunnerWindow*> allWindows; >- >-@implementation WebKitTestRunnerWindow >-@synthesize platformWebView = _platformWebView; >- >-+ (NSWindow *)_WTR_keyWindow >-{ >- size_t i = allWindows.size(); >- while (i) { >- if ([allWindows[i] isKeyWindow]) >- return allWindows[i]; >- --i; >- } >- >- return nil; >-} >- >-- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation >-{ >- allWindows.append(self); >- return [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation]; >-} >- >-- (void)dealloc >-{ >- allWindows.removeFirst(self); >- ASSERT(!allWindows.contains(self)); >- [super dealloc]; >-} >- >-- (BOOL)isKeyWindow >-{ >- return _platformWebView ? _platformWebView->windowIsKey() : YES; >-} >- >-- (void)setFrameOrigin:(NSPoint)point >-{ >- _fakeOrigin = point; >-} >- >-- (void)setFrame:(NSRect)windowFrame display:(BOOL)displayViews animate:(BOOL)performAnimation >-{ >- NSRect currentFrame = [super frame]; >- >- _fakeOrigin = windowFrame.origin; >- >- [super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews animate:performAnimation]; >-} >- >-- (void)setFrame:(NSRect)windowFrame display:(BOOL)displayViews >-{ >- NSRect currentFrame = [super frame]; >- >- _fakeOrigin = windowFrame.origin; >- >- [super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews]; >-} >- >-- (NSRect)frameRespectingFakeOrigin >-{ >- NSRect currentFrame = [self frame]; >- return NSMakeRect(_fakeOrigin.x, _fakeOrigin.y, currentFrame.size.width, currentFrame.size.height); >-} >-@end >- >+// FIXME: Move to NSWindowSPI.h. > @interface NSWindow () >- > - (void)_setWindowResolution:(CGFloat)resolution displayIfChanged:(BOOL)displayIfChanged; >- > @end > > namespace WTR { >@@ -187,14 +116,7 @@ PlatformWebView::~PlatformWebView() > > PlatformWindow PlatformWebView::keyWindow() > { >- size_t i = allWindows.size(); >- while (i) { >- --i; >- if ([allWindows[i] isKeyWindow]) >- return allWindows[i]; >- } >- >- return nil; >+ return [WebKitTestRunnerWindow _WTR_keyWindow]; > } > > WKPageRef PlatformWebView::page() >diff --git a/Tools/WebKitTestRunner/mac/WebKitTestRunnerEvent.mm b/Tools/WebKitTestRunner/mac/WebKitTestRunnerEvent.mm >index 9dea2df818896fba87110eed5a8d94257ced2937..f547fd117dd652d2844651055c3e4d4f3448767b 100644 >--- a/Tools/WebKitTestRunner/mac/WebKitTestRunnerEvent.mm >+++ b/Tools/WebKitTestRunner/mac/WebKitTestRunnerEvent.mm >@@ -27,17 +27,16 @@ > #import "WebKitTestRunnerEvent.h" > > #import "EventSenderProxy.h" >-#import "TestController.h" > #import "PlatformWebView.h" >- >-using namespace WTR; >+#import "TestController.h" >+#import "WebKitTestRunnerWindow.h" > > @implementation WebKitTestRunnerEvent > > + (NSPoint)mouseLocation > { >- WKPoint location = TestController::singleton().eventSenderProxy()->position(); >- return [TestController::singleton().mainWebView()->platformWindow() convertBaseToScreen:NSMakePoint(location.x, location.y)]; >+ WKPoint location = WTR::TestController::singleton().eventSenderProxy()->position(); >+ return [WTR::TestController::singleton().mainWebView()->platformWindow() convertBaseToScreen:NSMakePoint(location.x, location.y)]; > } > > @end >diff --git a/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm b/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm >index a26180e01f411850699d1fcba11ac9d65663c35f..e3f65a066e4cc3f813fe78d3b2bfb337f65d75e5 100644 >--- a/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm >+++ b/Tools/WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2005, 2006, 2007, 2013 Apple, Inc. All rights reserved. >+ * Copyright (C) 2005-2018 Apple, Inc. All rights reserved. > * Copyright (C) 2007 Graham Dennis (graham.dennis@gmail.com) > * Copyright (C) 2007 Eric Seidel <eric@webkit.org> > * >@@ -28,6 +28,8 @@ > #include "config.h" > #include "WebKitTestRunnerPasteboard.h" > >+#include <objc/runtime.h> >+ > @interface LocalPasteboard : NSPasteboard > { > NSMutableArray *typesArray; >@@ -86,7 +88,8 @@ @implementation LocalPasteboard > > + (id)alloc > { >- return NSAllocateObject(self, 0, 0); >+ // Need to skip over [NSPasteboard alloc], which won't allocate a new object. >+ return class_createInstance(self, 0); > } > > - (id)initWithName:(NSString *)name >@@ -158,12 +161,8 @@ - (NSArray *)types > > - (NSString *)availableTypeFromArray:(NSArray *)types > { >- unsigned count = [types count]; >- unsigned i; >- for (i = 0; i < count; ++i) { >- NSString *type = [types objectAtIndex:i]; >- NSString *setType = [typesSet member:type]; >- if (setType) >+ for (NSString *type in types) { >+ if (NSString *setType = [typesSet member:type]) > return setType; > } > return nil; >@@ -171,10 +170,10 @@ - (NSString *)availableTypeFromArray:(NSArray *)types > > - (BOOL)setData:(NSData *)data forType:(NSString *)dataType > { >- if (data == nil) >- data = [NSData data]; > if (![typesSet containsObject:dataType]) > return NO; >+ if (data == nil) >+ data = [NSData data]; > [dataByType setObject:data forKey:dataType]; > ++changeCount; > return YES; >@@ -187,28 +186,15 @@ - (NSData *)dataForType:(NSString *)dataType > > - (BOOL)setPropertyList:(id)propertyList forType:(NSString *)dataType > { >- CFDataRef data = 0; >+ NSData *data = nil; > if (propertyList) >- data = CFPropertyListCreateXMLData(0, (__bridge CFTypeRef)propertyList); >- BOOL result = [self setData:(__bridge NSData *)data forType:dataType]; >- if (data) >- CFRelease(data); >- return result; >+ data = [NSPropertyListSerialization dataWithPropertyList:propertyList format:NSPropertyListXMLFormat_v1_0 options:0 error:nullptr]; >+ return [self setData:data forType:dataType]; > } > > - (BOOL)setString:(NSString *)string forType:(NSString *)dataType > { >- CFDataRef data = 0; >- if (string) { >- if ([string length] == 0) >- data = CFDataCreate(0, 0, 0); >- else >- data = CFStringCreateExternalRepresentation(0, (CFStringRef)string, kCFStringEncodingUTF8, 0); >- } >- BOOL result = [self setData:(__bridge NSData *)data forType:dataType]; >- if (data) >- CFRelease(data); >- return result; >+ return [self setData:[string dataUsingEncoding:NSUTF8StringEncoding] forType:dataType]; > } > > @end >diff --git a/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.h b/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.h >new file mode 100644 >index 0000000000000000000000000000000000000000..599343e75d98e87274b5e0d276d16d0db42490da >--- /dev/null >+++ b/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.h >@@ -0,0 +1,40 @@ >+/* >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+namespace WTR { >+class PlatformWebView; >+} >+ >+@interface WebKitTestRunnerWindow : NSWindow { >+ WTR::PlatformWebView* _platformWebView; >+ NSPoint _fakeOrigin; >+} >+ >++ (WebKitTestRunnerWindow *)_WTR_keyWindow; >+ >+@property (nonatomic, assign) WTR::PlatformWebView* platformWebView; >+- (NSRect)frameRespectingFakeOrigin; >+ >+@end >diff --git a/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm b/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..0aec3013923c205caf4b1f6cb9e79b164c58ac3f >--- /dev/null >+++ b/Tools/WebKitTestRunner/mac/WebKitTestRunnerWindow.mm >@@ -0,0 +1,90 @@ >+/* >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "WebKitTestRunnerWindow.h" >+ >+#import "PlatformWebView.h" >+#import <wtf/Vector.h> >+ >+@implementation WebKitTestRunnerWindow >+ >+static Vector<WebKitTestRunnerWindow*> allWindows; >+ >+@synthesize platformWebView = _platformWebView; >+ >++ (WebKitTestRunnerWindow *)_WTR_keyWindow >+{ >+ for (auto window : allWindows) { >+ if ([window isKeyWindow]) >+ return window; >+ } >+ return nil; >+} >+ >+- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation >+{ >+ allWindows.append(self); >+ return [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation]; >+} >+ >+- (void)dealloc >+{ >+ allWindows.removeFirst(self); >+ ASSERT(!allWindows.contains(self)); >+ [super dealloc]; >+} >+ >+- (BOOL)isKeyWindow >+{ >+ return !_platformWebView || _platformWebView->windowIsKey(); >+} >+ >+- (void)setFrameOrigin:(NSPoint)point >+{ >+ _fakeOrigin = point; >+} >+ >+- (void)setFrame:(NSRect)windowFrame display:(BOOL)displayViews animate:(BOOL)performAnimation >+{ >+ NSRect currentFrame = [super frame]; >+ _fakeOrigin = windowFrame.origin; >+ [super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews animate:performAnimation]; >+} >+ >+- (void)setFrame:(NSRect)windowFrame display:(BOOL)displayViews >+{ >+ NSRect currentFrame = [super frame]; >+ _fakeOrigin = windowFrame.origin; >+ [super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews]; >+} >+ >+- (NSRect)frameRespectingFakeOrigin >+{ >+ NSRect currentFrame = [self frame]; >+ return NSMakeRect(_fakeOrigin.x, _fakeOrigin.y, currentFrame.size.width, currentFrame.size.height); >+} >+ >+@end
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188245
:
346387
|
346479
|
346483
|
346499
|
346510
|
346557
|
346603
|
346604
|
346605
|
346629
|
346630