Changeset 259696 in webkit
- Timestamp:
- Apr 7, 2020, 5:43:15 PM (6 years ago)
- Location:
- branches/safari-610.1.9-branch
- Files:
-
- 4 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/Page.cpp (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-610.1.9-branch/Source/WebCore/ChangeLog
r259544 r259696 1 2020-04-07 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r259650. rdar://problem/61419505 4 5 WKUserScripts deferred from injection are not injected if -[WKWebView _notifyUserScripts] is called early. 6 https://bugs.webkit.org/show_bug.cgi?id=210131 7 rdar://problem/61368446 8 9 Reviewed by Brady Eidson. 10 11 Source/WebCore: 12 13 If Page::notifyToInjectUserScripts() is called early, before Frame::injectUserScripts() happens, 14 m_hasBeenNotifiedToInjectUserScripts will be false, allowing scripts to build up in m_userScriptsAwaitingNotification 15 and never being injected (since Page::notifyToInjectUserScripts() will not be called again). 16 17 * page/Page.cpp: 18 (WebCore::Page::notifyToInjectUserScripts): Set m_hasBeenNotifiedToInjectUserScripts to true when called. 19 20 Tools: 21 22 * TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm: 23 (TEST): 24 25 26 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259650 268f45cc-cd09-0410-ab3c-d52691b4dbfc 27 28 2020-04-07 Timothy Hatcher <timothy@apple.com> 29 30 WKUserScripts deferred from injection are not injected if -[WKWebView _notifyUserScripts] is called early. 31 https://bugs.webkit.org/show_bug.cgi?id=210131 32 rdar://problem/61368446 33 34 Reviewed by Brady Eidson. 35 36 If Page::notifyToInjectUserScripts() is called early, before Frame::injectUserScripts() happens, 37 m_hasBeenNotifiedToInjectUserScripts will be false, allowing scripts to build up in m_userScriptsAwaitingNotification 38 and never being injected (since Page::notifyToInjectUserScripts() will not be called again). 39 40 * page/Page.cpp: 41 (WebCore::Page::notifyToInjectUserScripts): Set m_hasBeenNotifiedToInjectUserScripts to true when called. 42 1 43 2020-04-04 Rob Buis <rbuis@igalia.com> 2 44 -
branches/safari-610.1.9-branch/Source/WebCore/page/Page.cpp
r259523 r259696 2480 2480 void Page::notifyToInjectUserScripts() 2481 2481 { 2482 m_hasBeenNotifiedToInjectUserScripts = true; 2483 2482 2484 for (auto* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { 2483 2485 for (const auto& pair : m_userScriptsAwaitingNotification) 2484 2486 frame->injectUserScriptImmediately(pair.first, pair.second.get()); 2485 2487 } 2488 2486 2489 m_userScriptsAwaitingNotification.clear(); 2487 2490 } -
branches/safari-610.1.9-branch/Tools/ChangeLog
r259541 r259696 1 2020-04-07 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r259650. rdar://problem/61419505 4 5 WKUserScripts deferred from injection are not injected if -[WKWebView _notifyUserScripts] is called early. 6 https://bugs.webkit.org/show_bug.cgi?id=210131 7 rdar://problem/61368446 8 9 Reviewed by Brady Eidson. 10 11 Source/WebCore: 12 13 If Page::notifyToInjectUserScripts() is called early, before Frame::injectUserScripts() happens, 14 m_hasBeenNotifiedToInjectUserScripts will be false, allowing scripts to build up in m_userScriptsAwaitingNotification 15 and never being injected (since Page::notifyToInjectUserScripts() will not be called again). 16 17 * page/Page.cpp: 18 (WebCore::Page::notifyToInjectUserScripts): Set m_hasBeenNotifiedToInjectUserScripts to true when called. 19 20 Tools: 21 22 * TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm: 23 (TEST): 24 25 26 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259650 268f45cc-cd09-0410-ab3c-d52691b4dbfc 27 28 2020-04-07 Timothy Hatcher <timothy@apple.com> 29 30 WKUserScripts deferred from injection are not injected if -[WKWebView _notifyUserScripts] is called early. 31 https://bugs.webkit.org/show_bug.cgi?id=210131 32 rdar://problem/61368446 33 34 Reviewed by Brady Eidson. 35 36 * TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm: 37 (TEST): 38 1 39 2020-04-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 40 -
branches/safari-610.1.9-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm
r259523 r259696 844 844 EXPECT_WK_STREQ([delegate waitForAlert], "waited for notification"); 845 845 EXPECT_WK_STREQ([delegate waitForAlert], "document parsing ended"); 846 } 846 847 TestWKWebView *webView3 = [[TestWKWebView new] autorelease]; 848 EXPECT_TRUE(webView3._deferrableUserScriptsNeedNotification); 849 [webView3.configuration.userContentController addUserScript:waitsForNotification]; 850 [webView3.configuration.userContentController addUserScript:documentEnd]; 851 webView3.UIDelegate = delegate; 852 [webView3 loadTestPageNamed:@"simple"]; 853 [webView3 _notifyUserScripts]; 854 EXPECT_FALSE(webView3._deferrableUserScriptsNeedNotification); 855 EXPECT_WK_STREQ([delegate waitForAlert], "waited for notification"); 856 EXPECT_WK_STREQ([delegate waitForAlert], "document parsing ended"); 857 }
Note:
See TracChangeset
for help on using the changeset viewer.