Remove some now-unnecessary dynamic class lookup
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2019 04:45:13 +0000 (04:45 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2019 04:45:13 +0000 (04:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196237

Reviewed by Simon Fraser.

Source/WebKit:

* Shared/DocumentEditingContext.mm:
(WebKit::DocumentEditingContext::toPlatformContext):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:
(makeRequest):
(TEST):

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

Source/WebKit/ChangeLog
Source/WebKit/Shared/DocumentEditingContext.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm

index 6837303..da381d4 100644 (file)
@@ -1,5 +1,15 @@
 2019-03-25  Tim Horton  <timothy_horton@apple.com>
 
+        Remove some now-unnecessary dynamic class lookup
+        https://bugs.webkit.org/show_bug.cgi?id=196237
+
+        Reviewed by Simon Fraser.
+
+        * Shared/DocumentEditingContext.mm:
+        (WebKit::DocumentEditingContext::toPlatformContext):
+
+2019-03-25  Tim Horton  <timothy_horton@apple.com>
+
         Get rid of ENABLE(ANIMATED_KEYBOARD_SCROLLING)
         https://bugs.webkit.org/show_bug.cgi?id=196224
 
index ba424a0..316c013 100644 (file)
@@ -42,7 +42,7 @@ static inline NSRange toNSRange(DocumentEditingContext::Range range)
 UIWKDocumentContext *DocumentEditingContext::toPlatformContext(OptionSet<DocumentEditingContextRequest::Options> options)
 {
 #if HAVE(UI_WK_DOCUMENT_CONTEXT)
-    RetainPtr<UIWKDocumentContext> platformContext = adoptNS([[NSClassFromString(@"UIWKDocumentContext") alloc] init]);
+    auto platformContext = adoptNS([[UIWKDocumentContext alloc] init]);
 
     if (options.contains(DocumentEditingContextRequest::Options::AttributedText)) {
         [platformContext setContextBefore:contextBefore.string.get()];
index c965ee8..cbf089d 100644 (file)
@@ -1,3 +1,14 @@
+2019-03-25  Tim Horton  <timothy_horton@apple.com>
+
+        Remove some now-unnecessary dynamic class lookup
+        https://bugs.webkit.org/show_bug.cgi?id=196237
+
+        Reviewed by Simon Fraser.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:
+        (makeRequest):
+        (TEST):
+
 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         Unreviewed, rolling out r243450.
index 23cdf94..4ba37f6 100644 (file)
@@ -59,7 +59,7 @@
 
 static UIWKDocumentRequest *makeRequest(UIWKDocumentRequestFlags flags, UITextGranularity granularity, NSInteger granularityCount, CGRect documentRect = CGRectZero, id <NSCopying> inputElementIdentifier = nil)
 {
-    RetainPtr<UIWKDocumentRequest> request = adoptNS([[NSClassFromString(@"UIWKDocumentRequest") alloc] init]);
+    auto request = adoptNS([[UIWKDocumentRequest alloc] init]);
     [request setFlags:flags];
     [request setSurroundingGranularity:granularity];
     [request setGranularityCount:granularityCount];
@@ -117,9 +117,6 @@ static NSString *applyAhemStyle(NSString *HTMLString)
 
 TEST(WebKit, DocumentEditingContext)
 {
-    if (!NSClassFromString(@"UIWKDocumentRequest"))
-        return;
-
     RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
 
     UIWKDocumentContext *context;