Title: [258974] trunk
Revision
258974
Author
dba...@webkit.org
Date
2020-03-24 23:00:23 -0700 (Tue, 24 Mar 2020)

Log Message

Unreviewed, reverting r258945.

Revert change that broke API tests while I investigate
offline.

Reverted changeset:

"Element context character rects may be in wrong coordinate
system"
https://bugs.webkit.org/show_bug.cgi?id=209493
https://trac.webkit.org/changeset/258945

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (258973 => 258974)


--- trunk/Source/WebKit/ChangeLog	2020-03-25 05:55:45 UTC (rev 258973)
+++ trunk/Source/WebKit/ChangeLog	2020-03-25 06:00:23 UTC (rev 258974)
@@ -1,3 +1,17 @@
+2020-03-24  Daniel Bates  <daba...@apple.com>
+
+        Unreviewed, reverting r258945.
+
+        Revert change that broke API tests while I investigate
+        offline.
+
+        Reverted changeset:
+
+        "Element context character rects may be in wrong coordinate
+        system"
+        https://bugs.webkit.org/show_bug.cgi?id=209493
+        https://trac.webkit.org/changeset/258945
+
 2020-03-24  John Wilander  <wilan...@apple.com>
 
         Refactor ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor() to return a struct instead of a Vector of pairs

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (258973 => 258974)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-03-25 05:55:45 UTC (rev 258973)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-03-25 06:00:23 UTC (rev 258974)
@@ -4242,11 +4242,8 @@
         unsigned offsetSoFar = startOffset;
         const int stride = 1;
         while (!iterator.atEnd()) {
-            if (!iterator.text().isEmpty()) {
-                auto currentRange = createLiveRange(iterator.range());
-                auto absoluteBoundingBox = currentRange->absoluteBoundingBox(Range::BoundingRectBehavior::IgnoreEmptyTextSelections);
-                rects.append({ currentRange->ownerDocument().view()->contentsToRootView(absoluteBoundingBox), { offsetSoFar++, stride } });
-            }
+            if (!iterator.text().isEmpty())
+                rects.append({ createLiveRange(iterator.range())->absoluteBoundingBox(Range::BoundingRectBehavior::IgnoreEmptyTextSelections), { offsetSoFar++, stride } });
             iterator.advance(stride);
         }
         return rects;

Modified: trunk/Tools/ChangeLog (258973 => 258974)


--- trunk/Tools/ChangeLog	2020-03-25 05:55:45 UTC (rev 258973)
+++ trunk/Tools/ChangeLog	2020-03-25 06:00:23 UTC (rev 258974)
@@ -1,3 +1,17 @@
+2020-03-24  Daniel Bates  <daba...@apple.com>
+
+        Unreviewed, reverting r258945.
+
+        Revert change that broke API tests while I investigate
+        offline.
+
+        Reverted changeset:
+
+        "Element context character rects may be in wrong coordinate
+        system"
+        https://bugs.webkit.org/show_bug.cgi?id=209493
+        https://trac.webkit.org/changeset/258945
+
 2020-03-24  Jiewen Tan  <jiewen_...@apple.com>
 
         Unreviewed, skips a test for iOS

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm (258973 => 258974)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm	2020-03-25 05:55:45 UTC (rev 258973)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm	2020-03-25 06:00:23 UTC (rev 258974)
@@ -513,64 +513,6 @@
     }
 }
 
-TEST(DocumentEditingContext, RequestRectsInTextAreaInsideIFrame)
-{
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-    // Use "padding: 0" for the <textarea> as the default user-agent stylesheet can effect text wrapping.
-    [webView synchronouslyLoadHTMLString:applyAhemStyle([NSString stringWithFormat:@"<iframe srcdoc=\"%@\" style='position: absolute; left: 1em; top: 1em; border: none'></iframe>", applyAhemStyle(@"<textarea id='test' style='padding: 0'>The quick brown fox jumps over the lazy dog.</textarea><script>let textarea = document.querySelector('iframe').contentDocument.getElementById('test'); textarea.focus(); textarea.setSelectionRange(0, 0); /* Place caret at the beginning of the field. */</script>")])];
-
-    auto *context = [webView synchronouslyRequestDocumentContext:makeRequest(UIWKDocumentRequestText | UIWKDocumentRequestRects, UITextGranularityWord, 1)];
-    EXPECT_NOT_NULL(context);
-    EXPECT_NULL(context.contextBefore);
-    EXPECT_NSSTRING_EQ("The", context.contextAfter);
-    auto *textRects = [context textRects];
-    EXPECT_EQ(3U, textRects.count);
-
-#if PLATFORM(MACCATALYST)
-    const size_t yPos = 27;
-    const size_t height = 26;
-#else
-    const size_t yPos = 28;
-    const size_t height = 25;
-#endif
-
-    if (textRects.count >= 3) {
-        CGFloat x = 28;
-        EXPECT_EQ(CGRectMake(x + 0 * glyphWidth, yPos, 25, height), textRects[0].CGRectValue); // T
-        EXPECT_EQ(CGRectMake(x + 1 * glyphWidth, yPos, 25, height), textRects[1].CGRectValue); // h
-        EXPECT_EQ(CGRectMake(x + 2 * glyphWidth, yPos, 25, height), textRects[2].CGRectValue); // e
-    }
-}
-
-TEST(DocumentEditingContext, RequestRectsInTextAreaInsideScrolledIFrame)
-{
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-    // Use "padding: 0" for the <textarea> as the default user-agent stylesheet can effect text wrapping.
-    [webView synchronouslyLoadHTMLString:applyAhemStyle([NSString stringWithFormat:@"<iframe srcdoc=\"%@\" style='position: absolute; left: 1em; top: 1em; border: none' height='200'></iframe>", applyAhemStyle(@"<body style='height: 1000px'><div style='width: 200px; height: 200px'></div><textarea id='test' style='padding: 0'>The quick brown fox jumps over the lazy dog.</textarea><script>let textarea = document.getElementById('test'); textarea.focus(); textarea.setSelectionRange(0, 0); window.scrollTo(0, 200); /* Scroll <textarea> to the top. */</script></body>")])];
-
-    auto *context = [webView synchronouslyRequestDocumentContext:makeRequest(UIWKDocumentRequestText | UIWKDocumentRequestRects, UITextGranularityWord, 1)];
-    EXPECT_NOT_NULL(context);
-    EXPECT_NULL(context.contextBefore);
-    EXPECT_NSSTRING_EQ("The", context.contextAfter);
-    auto *textRects = [context textRects];
-    EXPECT_EQ(3U, textRects.count);
-
-#if PLATFORM(MACCATALYST)
-    const size_t yPos = 27;
-    const size_t height = 26;
-#else
-    const size_t yPos = 28;
-    const size_t height = 25;
-#endif
-
-    if (textRects.count >= 3) {
-        CGFloat x = 28;
-        EXPECT_EQ(CGRectMake(x + 0 * glyphWidth, yPos, 25, height), textRects[0].CGRectValue); // T
-        EXPECT_EQ(CGRectMake(x + 1 * glyphWidth, yPos, 25, height), textRects[1].CGRectValue); // h
-        EXPECT_EQ(CGRectMake(x + 2 * glyphWidth, yPos, 25, height), textRects[2].CGRectValue); // e
-    }
-}
-
 // MARK: Tests using word granularity
 
 TEST(DocumentEditingContext, RequestFirstTwoWords)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to