WebInspectorUI and WebKitLegacy parts of [Xcode] Update some build settings as recomm...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2018 20:36:56 +0000 (20:36 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2018 20:36:56 +0000 (20:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190250

Reviewed by Andy Estes.

Source/WebCore/PAL:

* pal/spi/mac/NSWindowSPI.h: Added a private API declaration.

Source/WebInspectorUI:

* Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_INFINITE_RECURSION,
  CLANG_WARN_SUSPICIOUS_MOVE, CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS, and
  CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF.

* WebInspectorUI.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck.

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck.

Source/WebKitLegacy/mac:
WebKitLegacy part of [Xcode] Update some build settings as recommended by Xcode 10
https://bugs.webkit.org/show_bug.cgi?id=190250

Reviewed by Andy Estes.

* Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF,
  CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS, and CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED.
  Also enabled GCC_WARN_UNDECLARED_SELECTOR by deleting the line that set it to NO, which let
  an earlier line set it to YES.

Enabling -Wundeclared-selector exposed some long-standing mistakes and required the most
changes below.

* DefaultDelegates/WebDefaultContextMenuDelegate.mm: Imported an internal header that
  provides some missing method declarations.

* Misc/WebDownload.mm:
(-[WebDownload initWithRequest:delegate:]): Suppressed warning about this implementation of
  a deprecated method.

* Misc/WebIconDatabase.mm: Suppressed warning around our implementation of a deprecated class.

* Misc/WebNSObjectExtras.mm: Declare a category that is implemented in this file, because
  other code in the file uses a method from it.

* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView renewGState]): Suppressed warning about this implementation of
  a deprecated method.

* Plugins/WebPluginController.mm:
(installFlip4MacPlugInWorkaroundIfNecessary): Suppressed the undeclared selector warning
  around use of a selector that may be present in some WebKit client.

* Plugins/WebPluginDatabase.mm: Imported an internal header that provides some missing
  method declarations.

* WebCoreSupport/PopupMenuMac.mm: Imported a header that delcares delegate methods we call
  from here.

* WebCoreSupport/WebCachedFramePlatformData.h: Imported an internal header that provides some
  missing method declarations.

* WebCoreSupport/WebChromeClient.mm: Imported a header that declares delegate methods we call
  from here.

* WebCoreSupport/WebFrameLoaderClient.mm: Imported headers that declare delegate methods we
  call from here.
(WebFrameLoaderClient::setTitle): Suppressed the undeclared selector warning around use of
  an obsolete delegate method for binary compatibility.
(pluginView): Ditto.

* WebCoreSupport/WebVisitedLinkStore.mm: Imported a header that declares delegate methods we
  call from here.

* WebView/WebDeviceOrientationInternal.h: Declared -setController in a new
  WebDeviceOrientationProviderMock protocol.

* WebView/WebDeviceOrientationProviderMock.mm:
(-[WebDeviceOrientationProviderMock setController:]): Moved from an internal category to the
  main @implementation.

* WebView/WebDeviceOrientationProviderMockInternal.h: Declared that
  WebDeviceOrientationProviderMock conforms to WebDeviceOrientationProviderMock.

* WebView/WebDynamicScrollBarsView.mm:
(-[WebDynamicScrollBarsView accessibilityIsIgnored]): Suppressed warning about this implementation
  of a deprecated method.

* WebView/WebHTMLView.mm:
(-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Suppressed the undeclared
  selector warning around action methods that are not declared anywhere in WebKit.

(-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): Suppressed warning
  about implementing this deprecated method.
(-[WebHTMLView draggingSourceOperationMaskForLocal:]): Ditto.
(-[WebHTMLView draggedImage:endedAt:operation:]): Ditto.
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto.
(-[WebHTMLView accessibilityAttributeValue:]): Ditto.
(-[WebHTMLView characterIndexForPoint:]): Ditto.
(-[WebHTMLView firstRectForCharacterRange:]): Ditto.
(-[WebHTMLView attributedSubstringFromRange:]): Ditto.
(-[WebHTMLView setMarkedText:selectedRange:]): Ditto.
(-[WebHTMLView doCommandBySelector:]): Ditto.
(-[WebHTMLView insertText:]): Ditto.

* WebView/WebHTMLViewInternal.h: Declared an internal method that’s used from another file.

* WebView/WebJSPDFDoc.mm: Imported a header that declares delegate methods we call from here.

* WebView/WebPDFView.h: Removed previewView ivar.

* WebView/WebPDFView.mm:
  Removed declaration of FileInternal category and merged its implementation with the main
  implementation.
(-[WebPDFView dealloc]): Removed previewView ivar.
(-[WebPDFView initWithFrame:]): Removed code to deal with PDFPreviewView, which doesn’t
  exist in macOS versions we support.
(+[WebPDFView _PDFPreviewViewClass]): Deleted. PDFPreviewView doesn’t exist anymore.
(-[WebPDFView _canLookUpInDictionary]): Suppressed undeclared selector warning around use of
  action methods internal to PDFKit.
(-[WebPDFView _lookUpInDictionaryFromMenu:]): Ditto.
(-[WebPDFView _menuItemsFromPDFKitForEvent:]): Ditto.

* WebView/WebUIDelegatePrivate.h: Restored declarations of the delegate methods we actually
  call on macOS, even though in r86988 we started calling different methods on iOS.

* WebView/WebView.mm:
- Imported headers that declare delegate methods that we call.
- Removed declaration of WebFileInternal category and merged its implementation with the
  main implementation.
- Many internal methods were inexplicibly implemented as part of the WebViewEditingInMail
  category, which made them impossible to call from the main implementation. Moved those
  into the main implementation. One of those had to be declared in a class extension,
  because it is called from a method implemented in the WebPrivate category, and that
  category’s implementation appears first in the file.

(-[WebView _cacheHistoryDelegateImplementations]): Suppressed undeclared selector warning
  around use of obsolete delegate method for binary compatibility.

* WebView/WebViewInternal.h: Declared an internal method that’s used from another file.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236846 268f45cc-cd09-0410-ab3c-d52691b4dbfc

40 files changed:
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/mac/NSWindowSPI.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Configurations/Base.xcconfig
Source/WebInspectorUI/WebInspectorUI.xcodeproj/project.pbxproj
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj
Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm
Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm
Source/WebKitLegacy/mac/Carbon/CarbonWindowAdapter.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/Base.xcconfig
Source/WebKitLegacy/mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm
Source/WebKitLegacy/mac/Misc/WebDownload.mm
Source/WebKitLegacy/mac/Misc/WebIconDatabase.mm
Source/WebKitLegacy/mac/Misc/WebNSObjectExtras.mm
Source/WebKitLegacy/mac/Plugins/WebBaseNetscapePluginView.mm
Source/WebKitLegacy/mac/Plugins/WebPluginController.mm
Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm
Source/WebKitLegacy/mac/WebCoreSupport/PopupMenuMac.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebCachedFramePlatformData.h
Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h
Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebVisitedLinkStore.mm
Source/WebKitLegacy/mac/WebView/WebDeviceOrientationInternal.h
Source/WebKitLegacy/mac/WebView/WebDeviceOrientationProviderMock.mm
Source/WebKitLegacy/mac/WebView/WebDeviceOrientationProviderMockInternal.h
Source/WebKitLegacy/mac/WebView/WebDocumentPrivate.h
Source/WebKitLegacy/mac/WebView/WebDynamicScrollBarsView.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebHTMLViewInternal.h
Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm
Source/WebKitLegacy/mac/WebView/WebPDFView.h
Source/WebKitLegacy/mac/WebView/WebPDFView.mm
Source/WebKitLegacy/mac/WebView/WebUIDelegatePrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/mac/WebView/WebViewInternal.h
Source/WebKitLegacy/mac/WebView/WebViewPrivate.h

index 3497fb7..5fd7b67 100644 (file)
@@ -1,5 +1,14 @@
 2018-10-04  Dan Bernstein  <mitz@apple.com>
 
+        PAL change for the WebKitLegacy part of [Xcode] Update some build settings as recommended by Xcode 10
+        https://bugs.webkit.org/show_bug.cgi?id=190250
+
+        Reviewed by Andy Estes.
+
+        * pal/spi/mac/NSWindowSPI.h: Added a private API declaration.
+
+2018-10-04  Dan Bernstein  <mitz@apple.com>
+
         PAL part of [Xcode] Update some build settings as recommended by Xcode 10
         https://bugs.webkit.org/show_bug.cgi?id=190250
 
index aa81255..0bb2a99 100644 (file)
@@ -38,6 +38,7 @@
 @interface NSWindow ()
 
 - (id)_newFirstResponderAfterResigning;
+- (void)_setCursorForMouseLocation:(NSPoint)point;
 
 @end
 
index 65b627c..76eae64 100644 (file)
@@ -1,3 +1,16 @@
+2018-10-04  Dan Bernstein  <mitz@apple.com>
+
+        WebInspectorUI part of [Xcode] Update some build settings as recommended by Xcode 10
+        https://bugs.webkit.org/show_bug.cgi?id=190250
+
+        Reviewed by Andy Estes.
+
+        * Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_INFINITE_RECURSION,
+          CLANG_WARN_SUSPICIOUS_MOVE, CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS, and
+          CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF.
+
+        * WebInspectorUI.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck.
+
 2018-10-04  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: merge ProbeManager into DebuggerManager
index 540f6c1..3da5d2a 100644 (file)
@@ -19,14 +19,17 @@ CLANG_CXX_LIBRARY = libc++;
 CLANG_ENABLE_OBJC_WEAK = YES;
 CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
 CLANG_WARN_BOOL_CONVERSION = YES;
+CLANG_WARN_COMMA = YES;
 CLANG_WARN_CONSTANT_CONVERSION = YES;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 CLANG_WARN_EMPTY_BODY = YES;
 CLANG_WARN_ENUM_CONVERSION = YES;
+CLANG_WARN_INFINITE_RECURSION = YES;
 CLANG_WARN_INT_CONVERSION = YES;
 CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
 CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+CLANG_WARN_SUSPICIOUS_MOVE = YES;
 CLANG_WARN_STRICT_PROTOTYPES = YES;
 CLANG_WARN_UNREACHABLE_CODE = YES;
 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -52,7 +55,9 @@ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
 GCC_WARN_ABOUT_RETURN_TYPE = YES
 GCC_WARN_ABOUT_RETURN_TYPE = YES;
 GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
+CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
 GCC_WARN_UNDECLARED_SELECTOR = YES;
+CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 GCC_WARN_UNINITIALIZED_AUTOS = YES
 GCC_WARN_UNUSED_FUNCTION = YES;
 GCC_WARN_UNUSED_VARIABLE = YES
index 1f68298..7f40ba1 100644 (file)
                        isa = PBXProject;
                        attributes = {
                                LastSwiftUpdateCheck = 0700;
-                               LastUpgradeCheck = 0700;
+                               LastUpgradeCheck = 1000;
                                ORGANIZATIONNAME = Apple;
                        };
                        buildConfigurationList = A54C2250148B23DE00373FA3 /* Build configuration list for PBXProject "WebInspectorUI" */;
index 14c620a..f627d59 100644 (file)
@@ -1,3 +1,12 @@
+2018-10-04  Dan Bernstein  <mitz@apple.com>
+
+        WebKitLegacy part of [Xcode] Update some build settings as recommended by Xcode 10
+        https://bugs.webkit.org/show_bug.cgi?id=190250
+
+        Reviewed by Andy Estes.
+
+        * WebKitLegacy.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck.
+
 2018-10-01  Dean Jackson  <dino@apple.com>
 
         [macOS] Switching to discrete GPU should be done in the UI process
index ca93488..b562fe4 100644 (file)
                        isa = PBXProject;
                        attributes = {
                                LastSwiftUpdateCheck = 0700;
-                               LastUpgradeCheck = 0700;
+                               LastUpgradeCheck = 1000;
                        };
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKitLegacy" */;
                        compatibilityVersion = "Xcode 3.2";
index 27da23b..45b2e2e 100644 (file)
@@ -30,6 +30,7 @@
 #import "WebDelegateImplementationCaching.h"
 #import "WebGeolocationCoreLocationProvider.h"
 #import <WebGeolocationPosition.h>
+#import <WebUIDelegatePrivate.h>
 #import <WebCore/GeolocationPosition.h>
 #import <WebCore/WebCoreThread.h>
 #import <WebCore/WebCoreThreadRun.h>
index 93b1566..1e86ba0 100644 (file)
 
 using namespace WebCore;
 
-@interface WebPDFView (Secrets)
-+ (Class)_representationClassForWebFrame:(WebFrame *)webFrame;
-@end
-
 #pragma mark Constants
 
 static const float PAGE_WIDTH_INSET = 4.0f * 2.0f;
index b09e06c..fb02c81 100644 (file)
@@ -715,7 +715,9 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
 
 
 // Do the right thing for a Carbon window.
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (id)initWithCoder:(NSCoder *)coder
+IGNORE_WARNINGS_END
 {
 
     // Actually, this will probably never be implemented.  M.P. Notice - 8/2/00
@@ -817,6 +819,7 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
     // Initialize with the default return value.
     UInt32 hiCommandID = 0;
 
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
     // Pretty simple, if tedious.
     if (inActionSelector == @selector(clear:))
         hiCommandID = kHICommandClear;
@@ -832,6 +835,7 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
         hiCommandID = kHICommandSelectAll;
     else if (inActionSelector == @selector(undo:))
         hiCommandID = kHICommandUndo;
+IGNORE_WARNINGS_END
 
     // Done.
     return hiCommandID;
index 3cf3160..a5b5a18 100644 (file)
@@ -1,3 +1,126 @@
+2018-10-04  Dan Bernstein  <mitz@apple.com>
+
+        WebKitLegacy part of [Xcode] Update some build settings as recommended by Xcode 10
+        https://bugs.webkit.org/show_bug.cgi?id=190250
+
+        Reviewed by Andy Estes.
+
+        * Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF,
+          CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS, and CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED.
+          Also enabled GCC_WARN_UNDECLARED_SELECTOR by deleting the line that set it to NO, which let
+          an earlier line set it to YES.
+
+        Enabling -Wundeclared-selector exposed some long-standing mistakes and required the most
+        changes below.
+
+        * DefaultDelegates/WebDefaultContextMenuDelegate.mm: Imported an internal header that
+          provides some missing method declarations.
+
+        * Misc/WebDownload.mm:
+        (-[WebDownload initWithRequest:delegate:]): Suppressed warning about this implementation of
+          a deprecated method.
+
+        * Misc/WebIconDatabase.mm: Suppressed warning around our implementation of a deprecated class.
+
+        * Misc/WebNSObjectExtras.mm: Declare a category that is implemented in this file, because
+          other code in the file uses a method from it.
+
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView renewGState]): Suppressed warning about this implementation of
+          a deprecated method.
+
+        * Plugins/WebPluginController.mm:
+        (installFlip4MacPlugInWorkaroundIfNecessary): Suppressed the undeclared selector warning
+          around use of a selector that may be present in some WebKit client.
+
+        * Plugins/WebPluginDatabase.mm: Imported an internal header that provides some missing
+          method declarations.
+
+        * WebCoreSupport/PopupMenuMac.mm: Imported a header that delcares delegate methods we call
+          from here.
+
+        * WebCoreSupport/WebCachedFramePlatformData.h: Imported an internal header that provides some
+          missing method declarations.
+
+        * WebCoreSupport/WebChromeClient.mm: Imported a header that declares delegate methods we call
+          from here.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm: Imported headers that declare delegate methods we
+          call from here.
+        (WebFrameLoaderClient::setTitle): Suppressed the undeclared selector warning around use of
+          an obsolete delegate method for binary compatibility.
+        (pluginView): Ditto.
+
+        * WebCoreSupport/WebVisitedLinkStore.mm: Imported a header that declares delegate methods we
+          call from here.
+
+        * WebView/WebDeviceOrientationInternal.h: Declared -setController in a new
+          WebDeviceOrientationProviderMock protocol.
+
+        * WebView/WebDeviceOrientationProviderMock.mm:
+        (-[WebDeviceOrientationProviderMock setController:]): Moved from an internal category to the
+          main @implementation.
+
+        * WebView/WebDeviceOrientationProviderMockInternal.h: Declared that
+          WebDeviceOrientationProviderMock conforms to WebDeviceOrientationProviderMock.
+
+        * WebView/WebDynamicScrollBarsView.mm:
+        (-[WebDynamicScrollBarsView accessibilityIsIgnored]): Suppressed warning about this implementation
+          of a deprecated method.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Suppressed the undeclared
+          selector warning around action methods that are not declared anywhere in WebKit.
+
+        (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): Suppressed warning
+          about implementing this deprecated method.
+        (-[WebHTMLView draggingSourceOperationMaskForLocal:]): Ditto.
+        (-[WebHTMLView draggedImage:endedAt:operation:]): Ditto.
+        (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto.
+        (-[WebHTMLView accessibilityAttributeValue:]): Ditto.
+        (-[WebHTMLView characterIndexForPoint:]): Ditto.
+        (-[WebHTMLView firstRectForCharacterRange:]): Ditto.
+        (-[WebHTMLView attributedSubstringFromRange:]): Ditto.
+        (-[WebHTMLView setMarkedText:selectedRange:]): Ditto.
+        (-[WebHTMLView doCommandBySelector:]): Ditto.
+        (-[WebHTMLView insertText:]): Ditto.
+
+        * WebView/WebHTMLViewInternal.h: Declared an internal method that’s used from another file.
+
+        * WebView/WebJSPDFDoc.mm: Imported a header that declares delegate methods we call from here.
+
+        * WebView/WebPDFView.h: Removed previewView ivar.
+
+        * WebView/WebPDFView.mm:
+          Removed declaration of FileInternal category and merged its implementation with the main
+          implementation.
+        (-[WebPDFView dealloc]): Removed previewView ivar.
+        (-[WebPDFView initWithFrame:]): Removed code to deal with PDFPreviewView, which doesn’t
+          exist in macOS versions we support.
+        (+[WebPDFView _PDFPreviewViewClass]): Deleted. PDFPreviewView doesn’t exist anymore.
+        (-[WebPDFView _canLookUpInDictionary]): Suppressed undeclared selector warning around use of
+          action methods internal to PDFKit.
+        (-[WebPDFView _lookUpInDictionaryFromMenu:]): Ditto.
+        (-[WebPDFView _menuItemsFromPDFKitForEvent:]): Ditto.
+
+        * WebView/WebUIDelegatePrivate.h: Restored declarations of the delegate methods we actually
+          call on macOS, even though in r86988 we started calling different methods on iOS.
+
+        * WebView/WebView.mm:
+        - Imported headers that declare delegate methods that we call.
+        - Removed declaration of WebFileInternal category and merged its implementation with the
+          main implementation.
+        - Many internal methods were inexplicibly implemented as part of the WebViewEditingInMail
+          category, which made them impossible to call from the main implementation. Moved those
+          into the main implementation. One of those had to be declared in a class extension,
+          because it is called from a method implemented in the WebPrivate category, and that
+          category’s implementation appears first in the file.
+
+        (-[WebView _cacheHistoryDelegateImplementations]): Suppressed undeclared selector warning
+          around use of obsolete delegate method for binary compatibility.
+
+        * WebView/WebViewInternal.h: Declared an internal method that’s used from another file.
+
 2018-10-04  YUHAN WU  <yuhan_wu@apple.com>
 
         Runtime flag and IDL for MediaRecorder
index 9e95954..3bb1d8b 100644 (file)
@@ -37,6 +37,7 @@ CLANG_CXX_LIBRARY = libc++;
 CLANG_ENABLE_OBJC_WEAK = YES;
 CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
 CLANG_WARN_BOOL_CONVERSION = YES;
+CLANG_WARN_COMMA = YES;
 CLANG_WARN_CONSTANT_CONVERSION = YES;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 CLANG_WARN_EMPTY_BODY = YES;
@@ -51,6 +52,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES;
 CLANG_WARN_UNREACHABLE_CODE = YES;
 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 GCC_WARN_UNDECLARED_SELECTOR = YES;
+CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 COMBINE_HIDPI_IMAGES = NO;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
 ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -76,13 +78,14 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
 GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
 GCC_WARN_ABOUT_RETURN_TYPE = YES;
 GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
+CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
 GCC_WARN_SIGN_COMPARE = YES;
-GCC_WARN_UNDECLARED_SELECTOR = NO;
 GCC_WARN_UNINITIALIZED_AUTOS = YES;
 GCC_WARN_UNUSED_FUNCTION = YES;
 GCC_WARN_UNUSED_VARIABLE = YES;
 CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
 OTHER_MIGFLAGS = -F$(BUILT_PRODUCTS_DIR);
+CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
 PREBINDING = NO;
 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough;
 
index 8e5fbe0..d85a8b5 100644 (file)
@@ -35,7 +35,7 @@
 #import "WebDefaultUIDelegate.h"
 #import "WebFrameInternal.h"
 #import "WebFrameView.h"
-#import "WebHTMLViewPrivate.h"
+#import "WebHTMLViewInternal.h"
 #import "WebLocalizableStringsInternal.h"
 #import "WebNSPasteboardExtras.h"
 #import "WebNSURLRequestExtras.h"
index 8c6afd2..9b6bfc3 100644 (file)
@@ -181,25 +181,31 @@ using namespace WebCore;
     [super dealloc];
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (id)initWithRequest:(NSURLRequest *)request delegate:(id<NSURLDownloadDelegate>)delegate
+IGNORE_WARNINGS_END
 {
     [self _setRealDelegate:delegate];
     return [super initWithRequest:request delegate:_webInternal];
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (id)_initWithLoadingConnection:(NSURLConnection *)connection
                          request:(NSURLRequest *)request
                         response:(NSURLResponse *)response
                         delegate:(id)delegate
                            proxy:(NSURLConnectionDelegateProxy *)proxy
+IGNORE_WARNINGS_END
 {
     [self _setRealDelegate:delegate];
     return [super _initWithLoadingConnection:connection request:request response:response delegate:_webInternal proxy:proxy];
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (id)_initWithRequest:(NSURLRequest *)request
               delegate:(id)delegate
              directory:(NSString *)directory
+IGNORE_WARNINGS_END
 {
     [self _setRealDelegate:delegate];
     return [super _initWithRequest:request delegate:_webInternal directory:directory];
index 67ef086..4ea690a 100644 (file)
@@ -91,7 +91,9 @@ static const unsigned char defaultIconData[] = { 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0
     0x00, 0x00, 0x01, 0x52, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x0A, 
     0xFC, 0x80, 0x00, 0x00, 0x27, 0x10, 0x00, 0x0A, 0xFC, 0x80, 0x00, 0x00, 0x27, 0x10 };
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 @implementation WebIconDatabase
+IGNORE_WARNINGS_END
 
 + (void)initialize
 {
index b7e7f18..7498e5a 100644 (file)
 }
 @end
 
+@interface NSInvocation (WebMainThreadInvoker)
+- (void)_webkit_invokeAndHandleException:(WebMainThreadInvoker *)exceptionHandler;
+@end
+
 static bool returnTypeIsObject(NSInvocation *invocation)
 {
     // Could use either _C_ID or NSObjCObjectType, but it seems that neither is
index b4c5e6f..232033d 100644 (file)
@@ -613,7 +613,9 @@ using namespace WebCore;
     }
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (void)renewGState
+IGNORE_WARNINGS_END
 {
     [super renewGState];
     
index 8379d3d..79af416 100644 (file)
@@ -679,7 +679,9 @@ static void installFlip4MacPlugInWorkaroundIfNecessary()
         if (!TSUpdateCheck)
             return;
 
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
         Method methodToPatch = class_getInstanceMethod(TSUpdateCheck, @selector(alertDidEnd:returnCode:contextInfo:));
+IGNORE_WARNINGS_END
         if (!methodToPatch)
             return;
 
index b7697e7..3653a77 100644 (file)
@@ -34,7 +34,7 @@
 #import "WebFrame.h"
 #import "WebFrameViewInternal.h"
 #import "WebHTMLRepresentation.h"
-#import "WebHTMLView.h"
+#import "WebHTMLViewInternal.h"
 #import "WebKitLogging.h"
 #import "WebNSFileManagerExtras.h"
 #import "WebNetscapePluginPackage.h"
index 8971038..248d173 100644 (file)
@@ -22,6 +22,7 @@
 
 #import "WebDelegateImplementationCaching.h"
 #import "WebFrameInternal.h"
+#import "WebUIDelegatePrivate.h"
 #import <WebCore/IntRect.h>
 #import <WebCore/AXObjectCache.h>
 #import <WebCore/Chrome.h>
index c3671f3..7f324d9 100644 (file)
@@ -26,6 +26,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#import "WebHTMLViewInternal.h"
 #import <WebCore/CachedFramePlatformData.h>
 #import <wtf/ObjcRuntimeExtras.h>
 #import <wtf/RetainPtr.h>
index 1a70bce..ce01d58 100644 (file)
@@ -160,8 +160,10 @@ private:
     bool shouldReplaceWithGeneratedFileForUpload(const String& path, String &generatedFilename) final;
     String generateReplacementFile(const String& path) final;
 
+#if !PLATFORM(IOS)
     void elementDidFocus(WebCore::Element&) override;
     void elementDidBlur(WebCore::Element&) override;
+#endif
 
     bool shouldPaintEntireContents() const final;
 
index 58784b9..5114dbe 100644 (file)
@@ -38,6 +38,7 @@
 #import "WebDefaultUIDelegate.h"
 #import "WebDelegateImplementationCaching.h"
 #import "WebElementDictionary.h"
+#import "WebFormDelegate.h"
 #import "WebFrameInternal.h"
 #import "WebFrameView.h"
 #import "WebHTMLViewInternal.h"
@@ -876,6 +877,7 @@ String WebChromeClient::generateReplacementFile(const String& path)
     return [[m_webView _UIDelegateForwarder] webView:m_webView generateReplacementFile:path];
 }
 
+#if !PLATFORM(IOS)
 void WebChromeClient::elementDidFocus(WebCore::Element& element)
 {
     CallUIDelegate(m_webView, @selector(webView:formDidFocusNode:), kit(&element));
@@ -885,6 +887,7 @@ void WebChromeClient::elementDidBlur(WebCore::Element& element)
 {
     CallUIDelegate(m_webView, @selector(webView:formDidBlurNode:), kit(&element));
 }
+#endif
 
 bool WebChromeClient::selectItemWritingDirectionIsNatural()
 {
index 5079ec3..3180429 100644 (file)
@@ -843,6 +843,7 @@ static SEL selectorForKeyEvent(KeyboardEvent* event)
         return @selector(moveUp:);
     if (key == "Down")
         return @selector(moveDown:);
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
     if (key == "U+001B")
         return @selector(cancel:);
     if (key == "U+0009") {
@@ -852,6 +853,7 @@ static SEL selectorForKeyEvent(KeyboardEvent* event)
     }
     if (key == "Enter")
         return @selector(insertNewline:);
+IGNORE_WARNINGS_END
     return 0;
 }
 
index 2821242..64d6cf0 100644 (file)
 #import "WebElementDictionary.h"
 #import "WebFormDelegate.h"
 #import "WebFrameInternal.h"
-#import "WebFrameLoadDelegate.h"
+#import "WebFrameLoadDelegatePrivate.h"
 #import "WebFrameNetworkingContext.h"
 #import "WebFrameViewInternal.h"
 #import "WebHTMLRepresentationPrivate.h"
 #import "WebHTMLViewInternal.h"
+#import "WebHistoryDelegate.h"
 #import "WebHistoryInternal.h"
 #import "WebHistoryItemInternal.h"
 #import "WebKitErrorsPrivate.h"
@@ -67,6 +68,7 @@
 #import "WebPolicyDelegatePrivate.h"
 #import "WebPreferences.h"
 #import "WebResourceLoadDelegate.h"
+#import "WebResourceLoadDelegatePrivate.h"
 #import "WebScriptWorldInternal.h"
 #import "WebSecurityOriginInternal.h"
 #import "WebUIDelegate.h"
@@ -1365,8 +1367,11 @@ void WebFrameLoaderClient::setTitle(const StringWithDirection& title, const URL&
         // FIXME: Use direction of title.
         if (implementations->setTitleFunc)
             CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:inFrame:), (NSString *)title.string, (NSString *)url, m_webFrame.get());
-        else if (implementations->deprecatedSetTitleFunc)
+        else if (implementations->deprecatedSetTitleFunc) {
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
             CallHistoryDelegate(implementations->deprecatedSetTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.string, (NSString *)url);
+IGNORE_WARNINGS_END
+        }
         return;
     }
 
@@ -1749,7 +1754,9 @@ static NSView *pluginView(WebFrame *frame, WebPluginPackage *pluginPackage,
             element, WebPlugInContainingElementKey,
             nil];
         LOG(Plugins, "arguments:\n%@", arguments);
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
     } else if ([viewFactory respondsToSelector:@selector(pluginViewWithArguments:)]) {
+IGNORE_WARNINGS_END
         arguments = [NSDictionary dictionaryWithObjectsAndKeys:
             baseURL, WebPluginBaseURLKey,
             attributes, WebPluginAttributesKey,
index b221d93..ad3ca27 100644 (file)
@@ -27,6 +27,7 @@
 
 #import "WebDelegateImplementationCaching.h"
 #import "WebFrameInternal.h"
+#import "WebHistoryDelegate.h"
 #import "WebHistoryInternal.h"
 #import "WebViewInternal.h"
 #import <WebCore/PageCache.h>
index fcc3bb3..99f69cb 100644 (file)
@@ -25,6 +25,8 @@
 
 #import "WebDeviceOrientation.h"
 
+#import "WebDeviceOrientationProvider.h"
+#import <WebCore/DeviceOrientationClientMock.h>
 #import <WebCore/DeviceOrientationData.h>
 #import <wtf/RefPtr.h>
 
@@ -43,3 +45,7 @@
 @end
 
 WebCore::DeviceOrientationData* core(WebDeviceOrientation*);
+
+@protocol WebDeviceOrientationProviderMock <WebDeviceOrientationProvider>
+- (void)setController:(WebCore::DeviceOrientationController*)controller;
+@end
index f23523b..253648d 100644 (file)
@@ -67,15 +67,6 @@ using namespace WebCore;
 
 @end
 
-@implementation WebDeviceOrientationProviderMock (Internal)
-
-- (void)setController:(WebCore::DeviceOrientationController*)controller
-{
-   [m_internal setController:controller];
-}
-
-@end
-
 @implementation WebDeviceOrientationProviderMock
 
 + (WebDeviceOrientationProviderMock *)shared
@@ -119,4 +110,9 @@ using namespace WebCore;
     return [m_internal lastOrientation];
 }
 
+- (void)setController:(WebCore::DeviceOrientationController*)controller
+{
+   [m_internal setController:controller];
+}
+
 @end
index b06b2c1..820185d 100644 (file)
@@ -23,6 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#import "WebDeviceOrientationInternal.h"
 #import "WebDeviceOrientationProviderMock.h"
 #import <WebCore/DeviceOrientationClientMock.h>
 
@@ -41,6 +42,5 @@
 - (WebDeviceOrientation*)lastOrientation;
 @end
 
-@interface WebDeviceOrientationProviderMock (Internal)
-- (void)setController:(WebCore::DeviceOrientationController*)controller;
+@interface WebDeviceOrientationProviderMock () <WebDeviceOrientationProviderMock>
 @end
index 2524fc6..7b7ea45 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #import <WebKitLegacy/WebDocument.h>
+#import <WebKitLegacy/WebFrame.h>
 #import <WebKitLegacy/WebHTMLView.h>
 
 @class DOMDocument;
     @result Array of strings representing the supported MIME types.
 */
 + (NSArray *)supportedMIMETypes;
++ (Class)_representationClassForWebFrame:(WebFrame *)webFrame;
 @end
 
 @protocol WebPDFDocumentView <WebDocumentView>
index a6547f3..c3a8650 100644 (file)
@@ -580,7 +580,9 @@ static const unsigned cMaxUpdateScrollbarsPass = 2;
 }
 
 // This object will be the parent of the web area in WK1, so it should not be ignored.
-- (BOOL)accessibilityIsIgnored 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
+- (BOOL)accessibilityIsIgnored
+IGNORE_WARNINGS_END
 {
     return NO;
 }
index c0fa144..3a4aa7c 100644 (file)
@@ -2900,9 +2900,10 @@ WEBCORE_COMMAND(toggleUnderline)
             return NO;
         }
     }
-
     if (action == @selector(changeSpelling:)
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
             || action == @selector(_changeSpellingFromMenu:)
+IGNORE_WARNINGS_END
             || action == @selector(checkSpelling:)
             || action == @selector(complete:)
             || action == @selector(pasteFont:))
@@ -2978,8 +2979,10 @@ WEBCORE_COMMAND(toggleUnderline)
     if (action == @selector(changeDocumentBackgroundColor:))
         return [[self _webView] isEditable] && [self _canEditRichly];
 
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
     if (action == @selector(_ignoreSpellingFromMenu:)
             || action == @selector(_learnSpellingFromMenu:)
+IGNORE_WARNINGS_END
             || action == @selector(takeFindStringFromSelection:))
         return [self _hasSelection];
 
@@ -4251,6 +4254,7 @@ static BOOL currentScrollIsBlit(NSView *clipView)
 #endif
 
 #if ENABLE(DRAG_SUPPORT) && PLATFORM(MAC)
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (void)dragImage:(NSImage *)dragImage
                at:(NSPoint)at
            offset:(NSSize)offset
@@ -4258,6 +4262,7 @@ static BOOL currentScrollIsBlit(NSView *clipView)
        pasteboard:(NSPasteboard *)pasteboard
            source:(id)source
         slideBack:(BOOL)slideBack
+IGNORE_WARNINGS_END
 {
     ASSERT(self == [self _topHTMLView]);
     [pasteboard setString:@"" forType:[WebHTMLView _dummyPasteboardType]];
@@ -4290,7 +4295,9 @@ static BOOL currentScrollIsBlit(NSView *clipView)
     [self release];
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
+IGNORE_WARNINGS_END
 {
     ASSERT(![self _webView] || [self _isTopHTMLView]);
     
@@ -4301,7 +4308,9 @@ static BOOL currentScrollIsBlit(NSView *clipView)
     return (NSDragOperation)page->dragController().sourceDragOperation();
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
+IGNORE_WARNINGS_END
 {
     ASSERT(![self _webView] || [self _isTopHTMLView]);
     
@@ -4338,7 +4347,9 @@ static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension
         && [filename _webkit_hasCaseInsensitiveSuffix:@".jpg"]);
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
+IGNORE_WARNINGS_END
 {
     NSFileWrapper *wrapper = nil;
     NSURL *draggingElementURL = nil;
@@ -4996,7 +5007,9 @@ static RefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
     [super flagsChanged:event];
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (id)accessibilityAttributeValue:(NSString*)attributeName
+IGNORE_WARNINGS_END
 {
     if ([attributeName isEqualToString: NSAccessibilityChildrenAttribute]) {
         id accTree = [[self _frame] accessibilityRoot];
@@ -5668,6 +5681,73 @@ static BOOL writingDirectionKeyBindingsEnabled()
 
 #endif
 
+#if PLATFORM(IOS)
+- (void)markedTextUpdate:(NSNotification *)notification
+{
+    NSString *text = [notification object];
+    NSRange range = NSMakeRange(0, [text length]);
+    [self setMarkedText:text selectedRange:range];
+}
+#endif
+
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
+- (void)setMarkedText:(id)string selectedRange:(NSRange)newSelRange
+IGNORE_WARNINGS_END
+{
+    [self _executeSavedKeypressCommands];
+
+#if PLATFORM(MAC)
+    BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]];
+    ASSERT(isAttributedString || [string isKindOfClass:[NSString class]]);
+
+    LOG(TextInput, "setMarkedText:\"%@\" selectedRange:(%u, %u)", isAttributedString ? [string string] : string, newSelRange.location, newSelRange.length);
+#endif
+
+    // Use pointer to get parameters passed to us by the caller of interpretKeyEvents.
+    auto* parameters = _private->interpretKeyEventsParameters;
+
+    if (parameters) {
+        parameters->eventInterpretationHadSideEffects = true;
+        parameters->consumedByIM = false;
+    }
+    
+    Frame* coreFrame = core([self _frame]);
+    if (!coreFrame)
+        return;
+
+    if (![self _isEditable])
+        return;
+
+    Vector<CompositionUnderline> underlines;
+    NSString *text;
+    NSRange replacementRange = { NSNotFound, 0 };
+
+#if PLATFORM(MAC)
+    if (isAttributedString) {
+        // FIXME: We ignore most attributes from the string, so an input method cannot specify e.g. a font or a glyph variation.
+        text = [string string];
+        NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:0 inRange:NSMakeRange(0, [text length])];
+        LOG(TextInput, "    ReplacementRange: %@", rangeString);
+        // The AppKit adds a 'secret' property to the string that contains the replacement range.
+        // The replacement range is the range of the text that should be replaced with the new string.
+        if (rangeString)
+            replacementRange = NSRangeFromString(rangeString);
+
+        extractUnderlines(string, underlines);
+    } else {
+        text = string;
+        underlines.append(CompositionUnderline(0, [text length], CompositionUnderlineColor::TextColor, Color::black, false));
+    }
+#else
+    text = string;
+#endif
+
+    if (replacementRange.location != NSNotFound)
+        [[self _frame] _selectNSRange:replacementRange];
+
+    coreFrame->editor().setComposition(text, underlines, newSelRange.location, NSMaxRange(newSelRange));
+}
+
 @end
 
 @implementation WebHTMLView (WebInternal)
@@ -6242,7 +6322,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
 
 #if PLATFORM(MAC)
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSArray *)validAttributesForMarkedText
+IGNORE_WARNINGS_END
 {
     static NSArray *validAttributes = [[NSArray alloc] initWithObjects:
         NSUnderlineStyleAttributeName,
@@ -6283,7 +6365,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
 
 #endif // PLATFORM(MAC)
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
+IGNORE_WARNINGS_END
 {
     [self _executeSavedKeypressCommands];
 
@@ -6307,7 +6391,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
     return result;
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSRect)firstRectForCharacterRange:(NSRange)theRange
+IGNORE_WARNINGS_END
 {
     [self _executeSavedKeypressCommands];
 
@@ -6339,7 +6425,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
     return resultRect;
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSRange)selectedRange
+IGNORE_WARNINGS_END
 {
     [self _executeSavedKeypressCommands];
 
@@ -6353,7 +6441,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
     return result;
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSRange)markedRange
+IGNORE_WARNINGS_END
 {
     [self _executeSavedKeypressCommands];
 
@@ -6369,7 +6459,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
 
 #if PLATFORM(MAC)
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSAttributedString *)attributedSubstringFromRange:(NSRange)nsRange
+IGNORE_WARNINGS_END
 {
     [self _executeSavedKeypressCommands];
 
@@ -6401,7 +6493,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
 
 #endif
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (NSInteger)conversationIdentifier
+IGNORE_WARNINGS_END
 {
     return (NSInteger)self;
 }
@@ -6421,7 +6515,9 @@ static BOOL writingDirectionKeyBindingsEnabled()
     return result;
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (void)unmarkText
+IGNORE_WARNINGS_END
 {
     [self _executeSavedKeypressCommands];
 
@@ -6466,72 +6562,9 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
 
 #endif
 
-- (void)setMarkedText:(id)string selectedRange:(NSRange)newSelRange
-{
-    [self _executeSavedKeypressCommands];
-
-#if PLATFORM(MAC)
-    BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]];
-    ASSERT(isAttributedString || [string isKindOfClass:[NSString class]]);
-
-    LOG(TextInput, "setMarkedText:\"%@\" selectedRange:(%u, %u)", isAttributedString ? [string string] : string, newSelRange.location, newSelRange.length);
-#endif
-
-    // Use pointer to get parameters passed to us by the caller of interpretKeyEvents.
-    auto* parameters = _private->interpretKeyEventsParameters;
-
-    if (parameters) {
-        parameters->eventInterpretationHadSideEffects = true;
-        parameters->consumedByIM = false;
-    }
-    
-    Frame* coreFrame = core([self _frame]);
-    if (!coreFrame)
-        return;
-
-    if (![self _isEditable])
-        return;
-
-    Vector<CompositionUnderline> underlines;
-    NSString *text;
-    NSRange replacementRange = { NSNotFound, 0 };
-
-#if PLATFORM(MAC)
-    if (isAttributedString) {
-        // FIXME: We ignore most attributes from the string, so an input method cannot specify e.g. a font or a glyph variation.
-        text = [string string];
-        NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:0 inRange:NSMakeRange(0, [text length])];
-        LOG(TextInput, "    ReplacementRange: %@", rangeString);
-        // The AppKit adds a 'secret' property to the string that contains the replacement range.
-        // The replacement range is the range of the text that should be replaced with the new string.
-        if (rangeString)
-            replacementRange = NSRangeFromString(rangeString);
-
-        extractUnderlines(string, underlines);
-    } else {
-        text = string;
-        underlines.append(CompositionUnderline(0, [text length], CompositionUnderlineColor::TextColor, Color::black, false));
-    }
-#else
-    text = string;
-#endif
-
-    if (replacementRange.location != NSNotFound)
-        [[self _frame] _selectNSRange:replacementRange];
-
-    coreFrame->editor().setComposition(text, underlines, newSelRange.location, NSMaxRange(newSelRange));
-}
-
-#if PLATFORM(IOS)
-- (void)markedTextUpdate:(NSNotification *)notification
-{
-    NSString *text = [notification object];
-    NSRange range = NSMakeRange(0, [text length]);
-    [self setMarkedText:text selectedRange:range];
-}
-#endif
-
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (void)doCommandBySelector:(SEL)selector
+IGNORE_WARNINGS_END
 {
     LOG(TextInput, "doCommandBySelector:\"%s\"", sel_getName(selector));
 
@@ -6589,7 +6622,9 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
     }
 }
 
+IGNORE_WARNINGS_BEGIN("deprecated-implementations")
 - (void)insertText:(id)string
+IGNORE_WARNINGS_END
 {
 #if PLATFORM(MAC)
     BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]];
index 2201b21..1c8bb12 100644 (file)
@@ -57,6 +57,7 @@ namespace WebCore {
 - (BOOL)_canSmartCopyOrDelete;
 
 - (WebFrame *)_frame;
+- (void)closeIfNotCurrentView;
 
 #if PLATFORM(MAC)
 - (void)_lookUpInDictionaryFromMenu:(id)sender;
@@ -98,6 +99,8 @@ namespace WebCore {
 
 - (WebPluginController *)_pluginController;
 
+- (void)_executeSavedKeypressCommands;
+
 @end
 
 @interface WebHTMLView (RemovedAppKitSuperclassMethods)
index e8bf4b5..8656ec0 100644 (file)
@@ -28,6 +28,7 @@
 #import "WebDataSource.h"
 #import "WebDelegateImplementationCaching.h"
 #import "WebFrame.h"
+#import "WebUIDelegate.h"
 #import "WebView.h"
 #import <JavaScriptCore/JSObjectRef.h>
 
index 633b4ff..8861350 100644 (file)
@@ -40,7 +40,6 @@
 
 @interface WebPDFView : NSView <PDFViewDelegate, WebDocumentView, WebDocumentSearching, WebDocumentIncrementalSearching, WebMultipleTextMatches, WebDocumentSelection, WebDocumentElement, WebDocumentPDF, _WebDocumentViewState, _WebDocumentZooming>
 {
-    NSView *previewView;
     PDFView *PDFSubview;
     NSString *path;
     BOOL firstResponderIsPDFDocumentView;
index a099c46..d333ab7 100644 (file)
@@ -84,27 +84,6 @@ using namespace WebCore;
 
 extern "C" NSString *_NSPathForSystemFramework(NSString *framework);
 
-@interface WebPDFView (FileInternal)
-+ (Class)_PDFPreviewViewClass;
-+ (Class)_PDFViewClass;
-- (void)_applyPDFDefaults;
-- (BOOL)_canLookUpInDictionary;
-- (NSClipView *)_clipViewForPDFDocumentView;
-- (NSEvent *)_fakeKeyEventWithFunctionKey:(unichar)functionKey;
-- (NSMutableArray *)_menuItemsFromPDFKitForEvent:(NSEvent *)theEvent;
-- (PDFSelection *)_nextMatchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag fromSelection:(PDFSelection *)initialSelection startInSelection:(BOOL)startInSelection;
-- (void)_openWithFinder:(id)sender;
-- (NSString *)_path;
-- (void)_PDFDocumentViewMightHaveScrolled:(NSNotification *)notification;
-- (BOOL)_pointIsInSelection:(NSPoint)point;
-- (NSAttributedString *)_scaledAttributedString:(NSAttributedString *)unscaledAttributedString;
-- (void)_setTextMatches:(NSArray *)array;
-- (NSString *)_temporaryPDFDirectoryPath;
-- (void)_trackFirstResponder;
-- (void)_updatePreferencesSoon;
-- (NSSet *)_visiblePDFPages;
-@end;
-
 @interface NSView ()
 - (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView;
 - (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect;
@@ -211,7 +190,6 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
 - (void)dealloc
 {
     [dataSource release];
-    [previewView release];
     [PDFSubview setDelegate:nil];
     [PDFSubview release];
     [path release];
@@ -327,31 +305,12 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
     if (self) {
         [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
         
-        Class previewViewClass = [[self class] _PDFPreviewViewClass];
-        
-        // We might not have found a previewViewClass, but if we did find it
-        // then we should be able to create an instance.
-        if (previewViewClass) {
-            previewView = [[previewViewClass alloc] initWithFrame:frame];
-            ASSERT(previewView);
-        }
-        
-        NSView *topLevelPDFKitView = nil;
-        if (previewView) {
-            // We'll retain the PDFSubview here so that it is equally retained in all
-            // code paths. That way we don't need to worry about conditionally releasing
-            // it later.
-            PDFSubview = [[previewView performSelector:@selector(pdfView)] retain];
-            topLevelPDFKitView = previewView;
-        } else {
-            PDFSubview = [[[[self class] _PDFViewClass] alloc] initWithFrame:frame];
-            topLevelPDFKitView = PDFSubview;
-        }
-        
+        PDFSubview = [[[[self class] _PDFViewClass] alloc] initWithFrame:frame];
+
         ASSERT(PDFSubview);
         
-        [topLevelPDFKitView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-        [self addSubview:topLevelPDFKitView];
+        [PDFSubview setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+        [self addSubview:PDFSubview];
         
         [PDFSubview setDelegate:self];
         written = NO;
@@ -1060,24 +1019,6 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range)
     CallUIDelegate([self _webView], @selector(webView:saveFrameView:showingPanel:), [[dataSource webFrame] frameView], NO);
 }
 
-@end
-
-@implementation WebPDFView (FileInternal)
-
-+ (Class)_PDFPreviewViewClass
-{
-    static Class PDFPreviewViewClass = nil;
-    static BOOL checkedForPDFPreviewViewClass = NO;
-    
-    if (!checkedForPDFPreviewViewClass) {
-        checkedForPDFPreviewViewClass = YES;
-        PDFPreviewViewClass = [[WebPDFView PDFKitBundle] classNamed:@"PDFPreviewView"];
-    }
-    
-    // This class might not be available; callers need to deal with a nil return here.
-    return PDFPreviewViewClass;
-}
-
 + (Class)_PDFViewClass
 {
     static Class PDFViewClass = nil;
@@ -1116,7 +1057,9 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range)
 
 - (BOOL)_canLookUpInDictionary
 {
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
     return [PDFSubview respondsToSelector:@selector(_searchInDictionary:)];
+IGNORE_WARNINGS_END
 }
 
 - (NSClipView *)_clipViewForPDFDocumentView
@@ -1152,8 +1095,10 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range)
     // This method is used by WebKit's context menu item. Here we map to the method that
     // PDFView uses. Since the PDFView method isn't API, and isn't available on all versions
     // of PDFKit, we use performSelector after a respondsToSelector check, rather than calling it directly.
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
     if ([self _canLookUpInDictionary])
         [PDFSubview performSelector:@selector(_searchInDictionary:) withObject:sender];
+IGNORE_WARNINGS_END
 }
 
 static void removeUselessMenuItemSeparators(NSMutableArray *menuItems)
@@ -1185,6 +1130,7 @@ static void removeUselessMenuItemSeparators(NSMutableArray *menuItems)
 {
     NSMutableArray *copiedItems = [NSMutableArray array];
     NSDictionary *actionsToTags = [[NSDictionary alloc] initWithObjectsAndKeys:
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
         [NSNumber numberWithInt:WebMenuItemPDFActualSize], NSStringFromSelector(@selector(_setActualSize:)),
         [NSNumber numberWithInt:WebMenuItemPDFZoomIn], NSStringFromSelector(@selector(zoomIn:)),
         [NSNumber numberWithInt:WebMenuItemPDFZoomOut], NSStringFromSelector(@selector(zoomOut:)),
@@ -1196,15 +1142,18 @@ static void removeUselessMenuItemSeparators(NSMutableArray *menuItems)
         [NSNumber numberWithInt:WebMenuItemPDFContinuous], NSStringFromSelector(@selector(_toggleContinuous:)),
         [NSNumber numberWithInt:WebMenuItemPDFNextPage], NSStringFromSelector(@selector(goToNextPage:)),
         [NSNumber numberWithInt:WebMenuItemPDFPreviousPage], NSStringFromSelector(@selector(goToPreviousPage:)),
+IGNORE_WARNINGS_END
         nil];
     
     // Leave these menu items out, since WebKit inserts equivalent ones. Note that we leave out PDFKit's "Look Up in Dictionary"
     // item here because WebKit already includes an item with the same title and purpose. We map WebKit's to PDFKit's 
     // "Look Up in Dictionary" via the implementation of -[WebPDFView _lookUpInDictionaryFromMenu:].
     NSSet *unwantedActions = [[NSSet alloc] initWithObjects:
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
                               NSStringFromSelector(@selector(_searchInSpotlight:)),
                               NSStringFromSelector(@selector(_searchInGoogle:)),
                               NSStringFromSelector(@selector(_searchInDictionary:)),
+IGNORE_WARNINGS_END
                               NSStringFromSelector(@selector(copy:)),
                               nil];
     
index a4f3a4e..a7b6e68 100644 (file)
@@ -265,8 +265,13 @@ extern NSString *WebConsoleMessageErrorMessageLevel;
 - (void)webView:(WebView *)webView decidePolicyForUserMediaRequestFromOrigin:(WebSecurityOrigin *)origin listener:(id<WebAllowDenyPolicyListener>)listener;
 - (void)webView:(WebView *)webView checkPolicyForUserMediaRequestFromOrigin:(WebSecurityOrigin *)origin listener:(id<WebAllowDenyPolicyListener>)listener;
 
+#if !TARGET_OS_IPHONE
+- (void)webView:(WebView *)sender formDidFocusNode:(DOMNode *)node;
+- (void)webView:(WebView *)sender formDidBlurNode:(DOMNode *)node;
+#else
 - (void)webView:(WebView *)sender elementDidFocusNode:(DOMNode *)node;
 - (void)webView:(WebView *)sender elementDidBlurNode:(DOMNode *)node;
+#endif
 
 /*!
     @method webView:printFrame:
@@ -278,9 +283,10 @@ extern NSString *WebConsoleMessageErrorMessageLevel;
 - (void)webView:(WebView *)sender printFrame:(WebFrame *)frame;
 
 #if ENABLE_FULLSCREEN_API
-- (BOOL)webView:(WebView *)sender supportsFullScreenForElement:(DOMElement *)element;
-- (void)webView:(WebView *)sender enterFullScreenForElement:(DOMElement *)element;
-- (void)webView:(WebView *)sender exitFullScreenForElement:(DOMElement *)element;
+- (BOOL)webView:(WebView *)sender supportsFullScreenForElement:(DOMElement *)element withKeyboard:(BOOL)withKeyboard;
+- (void)webView:(WebView *)sender enterFullScreenForElement:(DOMElement *)element listener:(id <WebKitFullScreenListener>)listener;
+- (void)webView:(WebView *)sender exitFullScreenForElement:(DOMElement *)element listener:(id <WebKitFullScreenListener>)listener;
+- (void)webView:(WebView *)sender closeFullScreenWithListener:(id <WebKitFullScreenListener>)listener;
 #endif
 
 - (void)webView:(WebView *)sender didDrawFrame:(WebFrame *)frame;
index 72d9c0d..852debf 100644 (file)
@@ -64,6 +64,7 @@
 #import "WebEditorClient.h"
 #import "WebFormDelegatePrivate.h"
 #import "WebFrameInternal.h"
+#import "WebFrameLoadDelegatePrivate.h"
 #import "WebFrameLoaderClient.h"
 #import "WebFrameNetworkingContext.h"
 #import "WebFrameViewInternal.h"
@@ -71,6 +72,7 @@
 #import "WebGeolocationPositionInternal.h"
 #import "WebHTMLRepresentation.h"
 #import "WebHTMLViewInternal.h"
+#import "WebHistoryDelegate.h"
 #import "WebHistoryItemInternal.h"
 #import "WebIconDatabase.h"
 #import "WebInspector.h"
 #import "WebPreferenceKeysPrivate.h"
 #import "WebPreferencesPrivate.h"
 #import "WebProgressTrackerClient.h"
+#import "WebResourceLoadDelegate.h"
+#import "WebResourceLoadDelegatePrivate.h"
 #import "WebResourceLoadScheduler.h"
 #import "WebScriptDebugDelegate.h"
 #import "WebScriptWorldInternal.h"
@@ -392,9 +396,12 @@ macro(alignRight) \
 macro(capitalizeWord) \
 macro(centerSelectionInVisibleArea) \
 macro(changeAttributes) \
+_Pragma("clang diagnostic push") \
+_Pragma("clang diagnostic ignored \"-Wundeclared-selector\"") \
 macro(changeBaseWritingDirection) \
 macro(changeBaseWritingDirectionToLTR) \
 macro(changeBaseWritingDirectionToRTL) \
+_Pragma("clang diagnostic pop") \
 macro(changeColor) \
 macro(changeDocumentBackgroundColor) \
 macro(changeFont) \
@@ -503,14 +510,20 @@ macro(stopSpeaking) \
 macro(subscript) \
 macro(superscript) \
 macro(swapWithMark) \
+_Pragma("clang diagnostic push") \
+_Pragma("clang diagnostic ignored \"-Wundeclared-selector\"") \
 macro(takeFindStringFromSelection) \
+_Pragma("clang diagnostic pop") \
 macro(toggleBaseWritingDirection) \
 macro(transpose) \
 macro(underline) \
 macro(unscript) \
 macro(uppercaseWord) \
 macro(yank) \
+_Pragma("clang diagnostic push") \
+_Pragma("clang diagnostic ignored \"-Wundeclared-selector\"") \
 macro(yankAndSelect) \
+_Pragma("clang diagnostic pop") \
 
 #define WebKitOriginalTopPrintingMarginKey @"WebKitOriginalTopMargin"
 #define WebKitOriginalBottomPrintingMarginKey @"WebKitOriginalBottomMargin"
@@ -727,18 +740,6 @@ private:
 @end
 #endif // ENABLE(DATA_INTERACTION)
 
-@interface WebView (WebFileInternal)
-#if !PLATFORM(IOS)
-- (float)_deviceScaleFactor;
-#endif
-- (BOOL)_isLoading;
-- (WebFrameView *)_frameViewAtWindowPoint:(NSPoint)point;
-- (WebFrame *)_focusedFrame;
-+ (void)_preflightSpellChecker;
-- (BOOL)_continuousCheckingAllowed;
-- (NSResponder *)_responderForResponderOperations;
-@end
-
 NSString *WebElementDOMNodeKey =            @"WebElementDOMNode";
 NSString *WebElementFrameKey =              @"WebElementFrame";
 NSString *WebElementImageKey =              @"WebElementImage";
@@ -1097,6 +1098,15 @@ static const NSUInteger orderedListSegment = 2;
 
 #endif // HAVE(TOUCH_BAR)
 
+@interface WebView ()
+#if PLATFORM(IOS)
+- (void)_wakWindowScreenScaleChanged:(NSNotification *)notification;
+- (void)_wakWindowVisibilityChanged:(NSNotification *)notification;
+#else
+- (float)_deviceScaleFactor;
+#endif
+@end
+
 @implementation WebView (AllWebViews)
 
 static CFSetCallBacks NonRetainingSetCallbacks = {
@@ -3339,7 +3349,9 @@ static inline IMP getMethod(id o, SEL s)
     cache->navigatedFunc = getMethod(delegate, @selector(webView:didNavigateWithNavigationData:inFrame:));
     cache->clientRedirectFunc = getMethod(delegate, @selector(webView:didPerformClientRedirectFromURL:toURL:inFrame:));
     cache->serverRedirectFunc = getMethod(delegate, @selector(webView:didPerformServerRedirectFromURL:toURL:inFrame:));
+IGNORE_WARNINGS_BEGIN("undeclared-selector")
     cache->deprecatedSetTitleFunc = getMethod(delegate, @selector(webView:updateHistoryTitle:forURL:));
+IGNORE_WARNINGS_END
     cache->setTitleFunc = getMethod(delegate, @selector(webView:updateHistoryTitle:forURL:inFrame:));
     cache->populateVisitedLinksFunc = getMethod(delegate, @selector(populateVisitedLinksForWebView:));
 }
@@ -3397,11 +3409,6 @@ static inline IMP getMethod(id o, SEL s)
     return _private->editingDelegateForwarder;
 }
 
-- (void)_closeWindow
-{
-    [[self _UIDelegateForwarder] webViewClose:self];
-}
-
 + (void)_unregisterViewClassAndRepresentationClassForMIMEType:(NSString *)MIMEType
 {
     [[WebFrameView _viewTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType];
@@ -7344,6 +7351,155 @@ static TextCheckingResult textCheckingResultFromNSTextCheckingResult(NSTextCheck
 
 #endif // HAVE(TOUCH_BAR)
 
+static WebFrameView *containingFrameView(NSView *view)
+{
+    while (view && ![view isKindOfClass:[WebFrameView class]])
+        view = [view superview];
+    return (WebFrameView *)view;
+}
+
+#if !PLATFORM(IOS)
+- (float)_deviceScaleFactor
+{
+    if (_private->customDeviceScaleFactor != 0)
+        return _private->customDeviceScaleFactor;
+
+    NSWindow *window = [self window];
+    NSWindow *hostWindow = [self hostWindow];
+    if (window)
+        return [window backingScaleFactor];
+    if (hostWindow)
+        return [hostWindow backingScaleFactor];
+    return [[NSScreen mainScreen] backingScaleFactor];
+}
+#endif
+
++ (BOOL)_didSetCacheModel
+{
+    return s_didSetCacheModel;
+}
+
++ (WebCacheModel)_maxCacheModelInAnyInstance
+{
+    WebCacheModel cacheModel = WebCacheModelDocumentViewer;
+    NSEnumerator *enumerator = [(NSMutableSet *)allWebViewsSet objectEnumerator];
+    while (WebPreferences *preferences = [[enumerator nextObject] preferences])
+        cacheModel = std::max(cacheModel, [preferences cacheModel]);
+    return cacheModel;
+}
+
++ (void)_cacheModelChangedNotification:(NSNotification *)notification
+{
+#if PLATFORM(IOS)
+    // This needs to happen on the Web Thread
+    WebThreadRun(^{
+#endif
+    WebPreferences *preferences = (WebPreferences *)[notification object];
+    ASSERT([preferences isKindOfClass:[WebPreferences class]]);
+
+    WebCacheModel cacheModel = [preferences cacheModel];
+    if (![self _didSetCacheModel] || cacheModel > [self _cacheModel])
+        [self _setCacheModel:cacheModel];
+    else if (cacheModel < [self _cacheModel])
+        [self _setCacheModel:std::max([[WebPreferences standardPreferences] cacheModel], [self _maxCacheModelInAnyInstance])];
+#if PLATFORM(IOS)
+    });
+#endif
+}
+
++ (void)_preferencesRemovedNotification:(NSNotification *)notification
+{
+    WebPreferences *preferences = (WebPreferences *)[notification object];
+    ASSERT([preferences isKindOfClass:[WebPreferences class]]);
+
+    if ([preferences cacheModel] == [self _cacheModel])
+        [self _setCacheModel:std::max([[WebPreferences standardPreferences] cacheModel], [self _maxCacheModelInAnyInstance])];
+}
+
+- (WebFrame *)_focusedFrame
+{
+    NSResponder *resp = [[self window] firstResponder];
+    if (resp && [resp isKindOfClass:[NSView class]] && [(NSView *)resp isDescendantOf:[[self mainFrame] frameView]]) {
+        WebFrameView *frameView = containingFrameView((NSView *)resp);
+        ASSERT(frameView != nil);
+        return [frameView webFrame];
+    }
+
+    return nil;
+}
+
+- (BOOL)_isLoading
+{
+    WebFrame *mainFrame = [self mainFrame];
+    return [[mainFrame _dataSource] isLoading]
+        || [[mainFrame provisionalDataSource] isLoading];
+}
+
+- (WebFrameView *)_frameViewAtWindowPoint:(NSPoint)point
+{
+    if (_private->closed)
+        return nil;
+#if !PLATFORM(IOS)
+    NSView *view = [self hitTest:[[self superview] convertPoint:point fromView:nil]];
+#else
+    //[WebView superview] on iOS is nil, don't do a convertPoint
+    NSView *view = [self hitTest:point];
+#endif
+    if (![view isDescendantOf:[[self mainFrame] frameView]])
+        return nil;
+    WebFrameView *frameView = containingFrameView(view);
+    ASSERT(frameView);
+    return frameView;
+}
+
++ (void)_preflightSpellCheckerNow:(id)sender
+{
+#if !PLATFORM(IOS)
+    [[NSSpellChecker sharedSpellChecker] _preflightChosenSpellServer];
+#endif
+}
+
++ (void)_preflightSpellChecker
+{
+#if !PLATFORM(IOS)
+    // As AppKit does, we wish to delay tickling the shared spellchecker into existence on application launch.
+    if ([NSSpellChecker sharedSpellCheckerExists]) {
+        [self _preflightSpellCheckerNow:self];
+    } else {
+        [self performSelector:@selector(_preflightSpellCheckerNow:) withObject:self afterDelay:2.0];
+    }
+#endif
+}
+
+- (BOOL)_continuousCheckingAllowed
+{
+    static BOOL allowContinuousSpellChecking = YES;
+    static BOOL readAllowContinuousSpellCheckingDefault = NO;
+    if (!readAllowContinuousSpellCheckingDefault) {
+        if ([[NSUserDefaults standardUserDefaults] objectForKey:@"NSAllowContinuousSpellChecking"]) {
+            allowContinuousSpellChecking = [[NSUserDefaults standardUserDefaults] boolForKey:@"NSAllowContinuousSpellChecking"];
+        }
+        readAllowContinuousSpellCheckingDefault = YES;
+    }
+    return allowContinuousSpellChecking;
+}
+
+- (NSResponder *)_responderForResponderOperations
+{
+    NSResponder *responder = [[self window] firstResponder];
+    WebFrameView *mainFrameView = [[self mainFrame] frameView];
+
+    // If the current responder is outside of the webview, use our main frameView or its
+    // document view. We also do this for subviews of self that are siblings of the main
+    // frameView since clients might insert non-webview-related views there (see 4552713).
+    if (responder != self && ![mainFrameView _web_firstResponderIsSelfOrDescendantView]) {
+        responder = [mainFrameView documentView];
+        if (!responder)
+            responder = mainFrameView;
+    }
+    return responder;
+}
+
 @end
 
 @implementation WebView (WebIBActions)
@@ -8676,33 +8832,6 @@ FORWARD(toggleUnderline)
     return coreFrame->editor().simplifyMarkup(coreStartNode, core(endNode));
 }
 
-@end
-
-static WebFrameView *containingFrameView(NSView *view)
-{
-    while (view && ![view isKindOfClass:[WebFrameView class]])
-        view = [view superview];
-    return (WebFrameView *)view;    
-}
-
-@implementation WebView (WebFileInternal)
-
-#if !PLATFORM(IOS)
-- (float)_deviceScaleFactor
-{
-    if (_private->customDeviceScaleFactor != 0)
-        return _private->customDeviceScaleFactor;
-
-    NSWindow *window = [self window];
-    NSWindow *hostWindow = [self hostWindow];
-    if (window)
-        return [window backingScaleFactor];
-    if (hostWindow)
-        return [hostWindow backingScaleFactor];
-    return [[NSScreen mainScreen] backingScaleFactor];
-}
-#endif
-
 + (void)_setCacheModel:(WebCacheModel)cacheModel
 {
     if (s_didSetCacheModel && cacheModel == s_cacheModel)
@@ -8931,132 +9060,6 @@ static WebFrameView *containingFrameView(NSView *view)
     return s_cacheModel;
 }
 
-+ (BOOL)_didSetCacheModel
-{
-    return s_didSetCacheModel;
-}
-
-+ (WebCacheModel)_maxCacheModelInAnyInstance
-{
-    WebCacheModel cacheModel = WebCacheModelDocumentViewer;
-    NSEnumerator *enumerator = [(NSMutableSet *)allWebViewsSet objectEnumerator];
-    while (WebPreferences *preferences = [[enumerator nextObject] preferences])
-        cacheModel = std::max(cacheModel, [preferences cacheModel]);
-    return cacheModel;
-}
-
-+ (void)_cacheModelChangedNotification:(NSNotification *)notification
-{
-#if PLATFORM(IOS)
-    // This needs to happen on the Web Thread
-    WebThreadRun(^{
-#endif    
-    WebPreferences *preferences = (WebPreferences *)[notification object];
-    ASSERT([preferences isKindOfClass:[WebPreferences class]]);
-
-    WebCacheModel cacheModel = [preferences cacheModel];
-    if (![self _didSetCacheModel] || cacheModel > [self _cacheModel])
-        [self _setCacheModel:cacheModel];
-    else if (cacheModel < [self _cacheModel])
-        [self _setCacheModel:std::max([[WebPreferences standardPreferences] cacheModel], [self _maxCacheModelInAnyInstance])];
-#if PLATFORM(IOS)
-    });
-#endif
-}
-
-+ (void)_preferencesRemovedNotification:(NSNotification *)notification
-{
-    WebPreferences *preferences = (WebPreferences *)[notification object];
-    ASSERT([preferences isKindOfClass:[WebPreferences class]]);
-
-    if ([preferences cacheModel] == [self _cacheModel])
-        [self _setCacheModel:std::max([[WebPreferences standardPreferences] cacheModel], [self _maxCacheModelInAnyInstance])];
-}
-
-- (WebFrame *)_focusedFrame
-{
-    NSResponder *resp = [[self window] firstResponder];
-    if (resp && [resp isKindOfClass:[NSView class]] && [(NSView *)resp isDescendantOf:[[self mainFrame] frameView]]) {
-        WebFrameView *frameView = containingFrameView((NSView *)resp);
-        ASSERT(frameView != nil);
-        return [frameView webFrame];
-    }
-    
-    return nil;
-}
-
-- (BOOL)_isLoading
-{
-    WebFrame *mainFrame = [self mainFrame];
-    return [[mainFrame _dataSource] isLoading]
-        || [[mainFrame provisionalDataSource] isLoading];
-}
-
-- (WebFrameView *)_frameViewAtWindowPoint:(NSPoint)point
-{
-    if (_private->closed)
-        return nil;
-#if !PLATFORM(IOS)
-    NSView *view = [self hitTest:[[self superview] convertPoint:point fromView:nil]];
-#else
-    //[WebView superview] on iOS is nil, don't do a convertPoint
-    NSView *view = [self hitTest:point];    
-#endif
-    if (![view isDescendantOf:[[self mainFrame] frameView]])
-        return nil;
-    WebFrameView *frameView = containingFrameView(view);
-    ASSERT(frameView);
-    return frameView;
-}
-
-+ (void)_preflightSpellCheckerNow:(id)sender
-{
-#if !PLATFORM(IOS)
-    [[NSSpellChecker sharedSpellChecker] _preflightChosenSpellServer];
-#endif
-}
-
-+ (void)_preflightSpellChecker
-{
-#if !PLATFORM(IOS)
-    // As AppKit does, we wish to delay tickling the shared spellchecker into existence on application launch.
-    if ([NSSpellChecker sharedSpellCheckerExists]) {
-        [self _preflightSpellCheckerNow:self];
-    } else {
-        [self performSelector:@selector(_preflightSpellCheckerNow:) withObject:self afterDelay:2.0];
-    }
-#endif
-}
-
-- (BOOL)_continuousCheckingAllowed
-{
-    static BOOL allowContinuousSpellChecking = YES;
-    static BOOL readAllowContinuousSpellCheckingDefault = NO;
-    if (!readAllowContinuousSpellCheckingDefault) {
-        if ([[NSUserDefaults standardUserDefaults] objectForKey:@"NSAllowContinuousSpellChecking"]) {
-            allowContinuousSpellChecking = [[NSUserDefaults standardUserDefaults] boolForKey:@"NSAllowContinuousSpellChecking"];
-        }
-        readAllowContinuousSpellCheckingDefault = YES;
-    }
-    return allowContinuousSpellChecking;
-}
-
-- (NSResponder *)_responderForResponderOperations
-{
-    NSResponder *responder = [[self window] firstResponder];
-    WebFrameView *mainFrameView = [[self mainFrame] frameView];
-    
-    // If the current responder is outside of the webview, use our main frameView or its
-    // document view. We also do this for subviews of self that are siblings of the main
-    // frameView since clients might insert non-webview-related views there (see 4552713).
-    if (responder != self && ![mainFrameView _web_firstResponderIsSelfOrDescendantView]) {
-        responder = [mainFrameView documentView];
-        if (!responder)
-            responder = mainFrameView;
-    }
-    return responder;
-}
-
 #if !PLATFORM(IOS)
 - (void)_openFrameInNewWindowFromMenu:(NSMenuItem *)sender
 {
@@ -10063,6 +10066,11 @@ static NSTextAlignment nsTextAlignmentFromRenderStyle(const RenderStyle* style)
     [self _updateVisibilityState];
 }
 
+- (void)_closeWindow
+{
+    [[self _UIDelegateForwarder] webViewClose:self];
+}
+
 @end
 
 @implementation WebView (WebViewDeviceOrientation)
index 0e7c5d7..fdaf476 100644 (file)
@@ -148,6 +148,8 @@ OBJC_CLASS NSTextAlternatives;
 
 - (void)_windowVisibilityChanged:(NSNotification *)notification;
 
+- (void)_closeWindow;
+
 @end
 
 #endif
index f9bac55..e572601 100644 (file)
@@ -1085,6 +1085,10 @@ typedef struct WebEdgeInsets {
 
 - (void)webView:(WebView *)sender didLayout:(WebLayoutMilestones)milestones;
 
+#if TARGET_OS_IPHONE
+- (void)webThreadWebView:(WebView *)sender didLayout:(WebLayoutMilestones)milestones;
+#endif
+
 // For implementing the WebInspector's test harness
 - (void)webView:(WebView *)webView didClearInspectorWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame;