Changeset 259650 in webkit
- Timestamp:
- Apr 7, 2020, 11:37:44 AM (6 years ago)
- Location:
- trunk
- 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
-
trunk/Source/WebCore/ChangeLog
r259649 r259650 1 2020-04-07 Timothy Hatcher <timothy@apple.com> 2 3 WKUserScripts deferred from injection are not injected if -[WKWebView _notifyUserScripts] is called early. 4 https://bugs.webkit.org/show_bug.cgi?id=210131 5 rdar://problem/61368446 6 7 Reviewed by Brady Eidson. 8 9 If Page::notifyToInjectUserScripts() is called early, before Frame::injectUserScripts() happens, 10 m_hasBeenNotifiedToInjectUserScripts will be false, allowing scripts to build up in m_userScriptsAwaitingNotification 11 and never being injected (since Page::notifyToInjectUserScripts() will not be called again). 12 13 * page/Page.cpp: 14 (WebCore::Page::notifyToInjectUserScripts): Set m_hasBeenNotifiedToInjectUserScripts to true when called. 15 1 16 2020-04-07 Devin Rousso <drousso@apple.com> 2 17 -
trunk/Source/WebCore/page/Page.cpp
r259523 r259650 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 } -
trunk/Tools/ChangeLog
r259647 r259650 1 2020-04-07 Timothy Hatcher <timothy@apple.com> 2 3 WKUserScripts deferred from injection are not injected if -[WKWebView _notifyUserScripts] is called early. 4 https://bugs.webkit.org/show_bug.cgi?id=210131 5 rdar://problem/61368446 6 7 Reviewed by Brady Eidson. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm: 10 (TEST): 11 1 12 2020-04-07 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm
r259569 r259650 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.