Changeset 267487 in webkit
- Timestamp:
- Sep 23, 2020, 10:07:50 AM (6 years ago)
- Location:
- branches/safari-611.1.1-branch
- 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
-
branches/safari-611.1.1-branch/Source/WebCore/ChangeLog
r267325 r267487 1 2020-09-23 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r267439. rdar://problem/69441287 4 5 REGRESSION(r266075): WebContent process crashes at TextManipulationController::getPath 6 https://bugs.webkit.org/show_bug.cgi?id=216846 7 8 Reviewed by Wenson Hsieh. 9 10 Source/WebCore: 11 12 TextIterator does not visit node that has no renderer, so if node has become hidden, TextManipulationController 13 will not find content node in paragraph range during replacement. 14 15 API Test: TextManipulation.CompleteTextManipulationParagraphBecomesHidden 16 17 * editing/TextManipulationController.cpp: 18 (WebCore::TextManipulationController::replace): 19 20 Tools: 21 22 * TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm: 23 (TestWebKitAPI::TEST): 24 25 26 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267439 268f45cc-cd09-0410-ab3c-d52691b4dbfc 27 28 2020-09-22 Sihui Liu <sihui_liu@apple.com> 29 30 REGRESSION(r266075): WebContent process crashes at TextManipulationController::getPath 31 https://bugs.webkit.org/show_bug.cgi?id=216846 32 33 Reviewed by Wenson Hsieh. 34 35 TextIterator does not visit node that has no renderer, so if node has become hidden, TextManipulationController 36 will not find content node in paragraph range during replacement. 37 38 API Test: TextManipulation.CompleteTextManipulationParagraphBecomesHidden 39 40 * editing/TextManipulationController.cpp: 41 (WebCore::TextManipulationController::replace): 42 1 43 2020-09-20 Zalan Bujtas <zalan@apple.com> 2 44 -
branches/safari-611.1.1-branch/Source/WebCore/editing/TextManipulationController.cpp
r266993 r267487 829 829 } 830 830 831 if (!firstContentNode) 832 return ManipulationFailureType::ContentChanged; 833 831 834 while (lastChildOfCommonAncestorInRange && lastChildOfCommonAncestorInRange->parentNode() != commonAncestor) 832 835 lastChildOfCommonAncestorInRange = lastChildOfCommonAncestorInRange->parentNode(); -
branches/safari-611.1.1-branch/Tools/ChangeLog
r267323 r267487 1 2020-09-23 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r267439. rdar://problem/69441287 4 5 REGRESSION(r266075): WebContent process crashes at TextManipulationController::getPath 6 https://bugs.webkit.org/show_bug.cgi?id=216846 7 8 Reviewed by Wenson Hsieh. 9 10 Source/WebCore: 11 12 TextIterator does not visit node that has no renderer, so if node has become hidden, TextManipulationController 13 will not find content node in paragraph range during replacement. 14 15 API Test: TextManipulation.CompleteTextManipulationParagraphBecomesHidden 16 17 * editing/TextManipulationController.cpp: 18 (WebCore::TextManipulationController::replace): 19 20 Tools: 21 22 * TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm: 23 (TestWebKitAPI::TEST): 24 25 26 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267439 268f45cc-cd09-0410-ab3c-d52691b4dbfc 27 28 2020-09-22 Sihui Liu <sihui_liu@apple.com> 29 30 REGRESSION(r266075): WebContent process crashes at TextManipulationController::getPath 31 https://bugs.webkit.org/show_bug.cgi?id=216846 32 33 Reviewed by Wenson Hsieh. 34 35 * TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm: 36 (TestWebKitAPI::TEST): 37 1 38 2020-09-19 Lauro Moura <lmoura@igalia.com> 2 39 -
branches/safari-611.1.1-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm
r266993 r267487 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.