Changeset 267439 in webkit
- Timestamp:
- Sep 22, 2020, 3:21:43 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/editing/TextManipulationController.cpp (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267437 r267439 1 2020-09-22 Sihui Liu <sihui_liu@apple.com> 2 3 REGRESSION(r266075): WebContent process crashes at TextManipulationController::getPath 4 https://bugs.webkit.org/show_bug.cgi?id=216846 5 6 Reviewed by Wenson Hsieh. 7 8 TextIterator does not visit node that has no renderer, so if node has become hidden, TextManipulationController 9 will not find content node in paragraph range during replacement. 10 11 API Test: TextManipulation.CompleteTextManipulationParagraphBecomesHidden 12 13 * editing/TextManipulationController.cpp: 14 (WebCore::TextManipulationController::replace): 15 1 16 2020-09-22 Zalan Bujtas <zalan@apple.com> 2 17 -
trunk/Source/WebCore/editing/TextManipulationController.cpp
r266993 r267439 829 829 } 830 830 831 if (!firstContentNode) 832 return ManipulationFailureType::ContentChanged; 833 831 834 while (lastChildOfCommonAncestorInRange && lastChildOfCommonAncestorInRange->parentNode() != commonAncestor) 832 835 lastChildOfCommonAncestorInRange = lastChildOfCommonAncestorInRange->parentNode(); -
trunk/Tools/ChangeLog
r267424 r267439 1 2020-09-22 Sihui Liu <sihui_liu@apple.com> 2 3 REGRESSION(r266075): WebContent process crashes at TextManipulationController::getPath 4 https://bugs.webkit.org/show_bug.cgi?id=216846 5 6 Reviewed by Wenson Hsieh. 7 8 * TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm: 9 (TestWebKitAPI::TEST): 10 1 11 2020-09-22 Keith Rollin <krollin@apple.com> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm
r266993 r267439 3196 3196 } 3197 3197 3198 TEST(TextManipulation, CompleteTextManipulationParagraphBecomesHidden) 3199 { 3200 auto delegate = adoptNS([[TextManipulationDelegate alloc] init]); 3201 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 400, 400)]); 3202 [webView _setTextManipulationDelegate:delegate.get()]; 3203 [webView synchronouslyLoadHTMLString:@"<!DOCTYPE html>" 3204 "<head><style> .hidden { display: none; } </style></head>" 3205 "<body><span>hello</span></body>"]; 3206 3207 done = false; 3208 [webView _startTextManipulationsWithConfiguration:nil completion:^{ 3209 done = true; 3210 }]; 3211 TestWebKitAPI::Util::run(&done); 3212 3213 auto items = [delegate items]; 3214 EXPECT_EQ(items.count, 1UL); 3215 EXPECT_EQ(items[0].tokens.count, 1UL); 3216 EXPECT_WK_STREQ("hello", items[0].tokens[0].content); 3217 3218 done = false; 3219 [webView evaluateJavaScript:@"document.querySelector('span').classList.add('hidden');" completionHandler:^(id result, NSError *) { 3220 EXPECT_NULL(result); 3221 done = true; 3222 }]; 3223 3224 done = false; 3225 __block auto item = createItem(items[0].identifier, {{ items[0].tokens[0].identifier, @"Hello" }}); 3226 [webView _completeTextManipulationForItems:@[item.get()] completion:^(NSArray<NSError *> *errors) { 3227 EXPECT_EQ(errors.count, 1UL); 3228 EXPECT_EQ(errors.firstObject.domain, _WKTextManipulationItemErrorDomain); 3229 EXPECT_EQ(errors.firstObject.code, _WKTextManipulationItemErrorContentChanged); 3230 EXPECT_EQ(errors.firstObject.userInfo[_WKTextManipulationItemErrorItemKey], item.get()); 3231 done = true; 3232 }]; 3233 TestWebKitAPI::Util::run(&done); 3234 3235 EXPECT_WK_STREQ("<span class=\"hidden\">hello</span>", [webView stringByEvaluatingJavaScript:@"document.body.innerHTML"]); 3236 } 3237 3198 3238 TEST(TextManipulation, TextManipulationTokenDebugDescription) 3199 3239 {
Note:
See TracChangeset
for help on using the changeset viewer.