Changeset 271514 in webkit
- Timestamp:
- Jan 15, 2021 2:51:27 AM (18 months ago)
- Location:
- trunk
- Files:
-
- 19 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/title-text-property-2.html (modified) (4 diffs)
-
LayoutTests/fast/dom/title-text-property-assigning-empty-string.html (modified) (2 diffs)
-
LayoutTests/fast/dom/title-text-property.html (modified) (2 diffs)
-
LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/globalhistory/history-delegate-basic-title.html (modified) (1 diff)
-
LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt (modified) (2 diffs)
-
LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html (modified) (2 diffs)
-
LayoutTests/http/tests/loading/redirect-with-no-location-crash-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/loading/redirect-with-no-location-crash.html (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/win/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt (copied) (copied from trunk/LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt) (2 diffs)
-
LayoutTests/platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/wk2/http/tests/loading/redirect-with-no-location-crash-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (1 diff)
-
Source/WebCore/dom/Document.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKit/PageLoadState.cpp (modified) (3 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271510 r271514 1 2021-01-15 Rob Buis <rbuis@igalia.com> 2 3 Use event loop to set title 4 https://bugs.webkit.org/show_bug.cgi?id=218496 5 6 Reviewed by Ryosuke Niwa. 7 8 Adapt tests to make sure pending title change tasks 9 are processed before the test is done. 10 11 * fast/dom/title-text-property-2.html: 12 * fast/dom/title-text-property-assigning-empty-string.html: 13 * fast/dom/title-text-property.html: 14 * http/tests/globalhistory/history-delegate-basic-title-expected.txt: 15 * http/tests/globalhistory/history-delegate-basic-title.html: 16 * http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: 17 * http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html: 18 * http/tests/loading/redirect-with-no-location-crash-expected.txt: 19 * http/tests/loading/redirect-with-no-location-crash.html: 20 * platform/mac-wk2/TestExpectations: 21 * platform/win/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Copied from LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt. 22 * platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: 23 * platform/wk2/http/tests/loading/redirect-with-no-location-crash-expected.txt: 24 1 25 2021-01-14 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 26 -
trunk/LayoutTests/fast/dom/title-text-property-2.html
r210833 r271514 2 2 <head> 3 3 <script> 4 function runTests() {4 function startTest() { 5 5 if (window.testRunner) { 6 testRunner.waitUntilDone(); 6 7 testRunner.dumpAsText(); 7 8 testRunner.dumpTitleChanges(); … … 11 12 document.title = 'TITLE1'; 12 13 14 internals.queueTask("DOMManipulation", () => continueTest()); 15 } 16 17 function continueTest() { 13 18 title = document.getElementsByTagName('title').item(0); 14 19 … … 16 21 title.text = 'TITLE2'; 17 22 23 internals.queueTask("DOMManipulation", () => endTest()); 24 } 25 26 function endTest() { 18 27 newTitle = document.createElement('title'); 19 28 console.log("Should not set title"); … … 29 38 titleElement.parentNode.removeChild(titleElement); 30 39 } 40 41 internals.queueTask("DOMManipulation", () => testRunner.notifyDone()); 31 42 } 32 43 </script> 33 44 <title>Initial title</title> 34 45 </head> 35 <body onload=" runTests();" >46 <body onload="startTest();" > 36 47 </body> 37 48 </html> -
trunk/LayoutTests/fast/dom/title-text-property-assigning-empty-string.html
r128943 r271514 2 2 <head> 3 3 <script> 4 function runTests() {4 function startTest() { 5 5 if (window.testRunner) { 6 testRunner.waitUntilDone(); 6 7 testRunner.dumpAsText(); 7 8 testRunner.dumpTitleChanges(); … … 9 10 10 11 document.title = 'New non-empty title'; 12 internals.queueTask("DOMManipulation", () => endTest()) 13 } 14 15 function endTest() { 11 16 document.title = ''; 17 internals.queueTask("DOMManipulation", () => testRunner.notifyDone()) 12 18 } 13 19 </script> 14 20 </head> 15 <body onload=' runTests();'>21 <body onload='startTest();'> 16 22 </body> 17 23 </html> -
trunk/LayoutTests/fast/dom/title-text-property.html
r269896 r271514 13 13 function runTests() { 14 14 if (window.testRunner) { 15 testRunner.waitUntilDone(); 15 16 testRunner.dumpAsText(); 16 17 testRunner.dumpTitleChanges(); … … 25 26 26 27 debugOutput('New title is: \'' + titleElem.text + '\''); 28 29 internals.queueTask("DOMManipulation", () => testRunner.notifyDone()); 27 30 } 28 31 </script> -
trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt
r210833 r271514 1 1 WebView navigated to url "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" with title "" with HTTP equivalent method "GET". The navigation was successful and was not a client redirect. 2 WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 1".3 2 WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 2". 4 3 This test sees if the history delegate is notified of title changes. -
trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title.html
r120167 r271514 2 2 <head> 3 3 <script> 4 if (window.testRunner) 4 if (window.testRunner) { 5 testRunner.waitUntilDone(); 5 6 testRunner.dumpAsText(); 7 } 6 8 </script> 7 9 <title>Test Title 1</title> 8 10 </head> 9 <body >11 <body onload="runTest()"> 10 12 This test sees if the history delegate is notified of title changes. 13 <script> 14 function runTest() { 15 document.title = "Test Title 2"; 16 internals.queueTask("DOMManipulation", () => testRunner.notifyDone()); 17 } 18 </script> 11 19 </body> 12 <script>13 document.title = "Test Title 2";14 </script>15 20 </html> -
trunk/LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt
r267644 r271514 6 6 frame "<!--frame1-->" - didCommitLoadForFrame 7 7 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 8 frame "<!--frame1-->" - didHandleOnloadEventsForFrame 8 9 frame "<!--frame1-->" - willPerformClientRedirectToURL: http://127.0.0.1:8000/a//b/non-existent-file.html 9 frame "<!--frame1-->" - didHandleOnloadEventsForFrame10 10 main frame - didHandleOnloadEventsForFrame 11 11 frame "<!--frame1-->" - didFinishLoadForFrame … … 16 16 frame "<!--frame1-->" - didReceiveTitle: 404 Not Found 17 17 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 18 frame "<!--frame1-->" - didFailLoadWithError 18 frame "<!--frame1-->" - didHandleOnloadEventsForFrame 19 frame "<!--frame1-->" - didFinishLoadForFrame 19 20 PASS did not cause assertion failure. -
trunk/LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
r195590 r271514 13 13 function done() 14 14 { 15 document.body.removeChild(document.getElementById("frame")); 16 if (window.testRunner) 17 testRunner.notifyDone(); 15 setTimeout(function() { 16 document.body.removeChild(document.getElementById("frame")); 17 if (window.testRunner) 18 testRunner.notifyDone(); 19 }, 500); 18 20 } 19 21 … … 25 27 </script> 26 28 </head> 27 <body >28 <iframe id="frame" src="resources/basic-auth-testing.php?username=webkit&password=rocks" onl oad="notifyFrameDidLoad(this)"></iframe>29 <body onload="notifyFrameDidLoad(frame)"> 30 <iframe id="frame" src="resources/basic-auth-testing.php?username=webkit&password=rocks" onlad="notifyFrameDidLoad(this)"></iframe> 29 31 <p>PASS did not cause assertion failure.</p> 30 32 </body> -
trunk/LayoutTests/http/tests/loading/redirect-with-no-location-crash-expected.txt
r231450 r271514 1 1 main frame - didStartProvisionalLoadForFrame 2 2 main frame - didCommitLoadForFrame 3 main frame - didReceiveTitle: Test for https://bugs.webkit.org/show_bug.cgi?id=292934 3 frame "<!--frame1-->" - didStartProvisionalLoadForFrame 5 4 main frame - didFinishDocumentLoadForFrame 5 main frame - didReceiveTitle: Test for https://bugs.webkit.org/show_bug.cgi?id=29293 6 6 frame "<!--frame1-->" - didCommitLoadForFrame 7 7 frame "<!--frame1-->" - didFinishDocumentLoadForFrame -
trunk/LayoutTests/http/tests/loading/redirect-with-no-location-crash.html
r120167 r271514 3 3 <title>Test for https://bugs.webkit.org/show_bug.cgi?id=29293</title> 4 4 <script> 5 if (window.testRunner) 5 if (window.testRunner) { 6 6 testRunner.dumpAsText(); 7 testRunner.waitUntilDone(); 8 } 7 9 </script> 8 10 </head> 9 <body >11 <body onload="setTimeout(function() { if (window.testRunner) testRunner.notifyDone(); })"> 10 12 <iframe src="resources/redirect-with-no-location-crash.php"></iframe> 11 13 </body> -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r271454 r271514 584 584 webkit.org/b/163136 http/tests/xmlhttprequest/auth-reject-protection-space.html [ Pass Failure ] 585 585 586 webkit.org/b/163139 http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html [ Pass Failure ]586 #webkit.org/b/163139 http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html [ Pass Failure ] 587 587 588 588 webkit.org/b/162975 http/tests/cache/disk-cache/memory-cache-revalidation-updates-disk-cache.html [ Pass Failure ] -
trunk/LayoutTests/platform/win/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt
r271513 r271514 6 6 frame "<!--frame1-->" - didCommitLoadForFrame 7 7 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 8 frame "<!--frame1-->" - didHandleOnloadEventsForFrame 8 9 frame "<!--frame1-->" - willPerformClientRedirectToURL: http://127.0.0.1:8000/a//b/non-existent-file.html 9 frame "<!--frame1-->" - didHandleOnloadEventsForFrame10 10 main frame - didHandleOnloadEventsForFrame 11 11 frame "<!--frame1-->" - didFinishLoadForFrame … … 14 14 frame "<!--frame1-->" - didCancelClientRedirectForFrame 15 15 frame "<!--frame1-->" - didCommitLoadForFrame 16 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 17 frame "<!--frame1-->" - didHandleOnloadEventsForFrame 18 frame "<!--frame1-->" - didFinishLoadForFrame 16 19 frame "<!--frame1-->" - didReceiveTitle: 404 Not Found 17 frame "<!--frame1-->" - didFinishDocumentLoadForFrame18 frame "<!--frame1-->" - didFailLoadWithError19 20 PASS did not cause assertion failure. -
trunk/LayoutTests/platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt
r267644 r271514 6 6 frame "<!--frame1-->" - didCommitLoadForFrame 7 7 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 8 frame "<!--frame1-->" - didHandleOnloadEventsForFrame 8 9 frame "<!--frame1-->" - willPerformClientRedirectToURL: http://127.0.0.1:8000/a//b/non-existent-file.html 9 frame "<!--frame1-->" - didHandleOnloadEventsForFrame10 10 main frame - didHandleOnloadEventsForFrame 11 11 frame "<!--frame1-->" - didFinishLoadForFrame … … 14 14 frame "<!--frame1-->" - didCancelClientRedirectForFrame 15 15 frame "<!--frame1-->" - didCommitLoadForFrame 16 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 17 frame "<!--frame1-->" - didHandleOnloadEventsForFrame 18 frame "<!--frame1-->" - didFinishLoadForFrame 16 19 frame "<!--frame1-->" - didReceiveTitle: 404 Not Found 17 frame "<!--frame1-->" - didFinishDocumentLoadForFrame18 frame "<!--frame1-->" - didFailLoadWithError19 20 PASS did not cause assertion failure. -
trunk/LayoutTests/platform/wk2/http/tests/loading/redirect-with-no-location-crash-expected.txt
r231450 r271514 1 1 main frame - didStartProvisionalLoadForFrame 2 2 main frame - didCommitLoadForFrame 3 main frame - didFinishDocumentLoadForFrame 3 4 main frame - didReceiveTitle: Test for https://bugs.webkit.org/show_bug.cgi?id=29293 4 main frame - didFinishDocumentLoadForFrame5 5 frame "<!--frame1-->" - didStartProvisionalLoadForFrame 6 6 frame "<!--frame1-->" - didCommitLoadForFrame -
trunk/Source/WebCore/ChangeLog
r271513 r271514 1 2021-01-15 Rob Buis <rbuis@igalia.com> 2 3 Use event loop to set title 4 https://bugs.webkit.org/show_bug.cgi?id=218496 5 6 Reviewed by Ryosuke Niwa. 7 8 Use event loop to set title to avoid calling WebFrameLoaderClient 9 within HTMLTitleElement::insertedIntoAncestor. 10 11 * dom/Document.cpp: 12 (WebCore::Document::updateTitle): 13 * dom/Document.h: 14 1 15 2021-01-15 Philippe Normand <pnormand@igalia.com> 2 16 -
trunk/Source/WebCore/dom/Document.cpp
r271440 r271514 1679 1679 m_title.direction = title.direction; 1680 1680 1681 if (auto* loader = this->loader()) 1682 loader->setTitle(m_title); 1681 if (!m_updateTitleTaskScheduled) { 1682 eventLoop().queueTask(TaskSource::DOMManipulation, [protectedThis = makeRef(*this), this]() mutable { 1683 m_updateTitleTaskScheduled = false; 1684 if (auto documentLoader = makeRefPtr(loader())) 1685 documentLoader->setTitle(m_title); 1686 }); 1687 m_updateTitleTaskScheduled = true; 1688 } 1683 1689 } 1684 1690 -
trunk/Source/WebCore/dom/Document.h
r271418 r271514 2115 2115 #endif 2116 2116 2117 bool m_updateTitleTaskScheduled { false }; 2118 2117 2119 OrientationNotifier m_orientationNotifier; 2118 2120 mutable RefPtr<Logger> m_logger; -
trunk/Tools/ChangeLog
r271512 r271514 1 2021-01-15 Rob Buis <rbuis@igalia.com> 2 3 Use event loop to set title 4 https://bugs.webkit.org/show_bug.cgi?id=218496 5 6 Reviewed by Ryosuke Niwa. 7 8 Adapt unit tests to wait for title change tasks 9 to be processed. 10 11 * TestWebKitAPI/Tests/WebKit/PageLoadState.cpp: 12 (TestWebKitAPI::didChangeTitle): 13 (TestWebKitAPI::TEST): 14 * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm: 15 (TEST): 16 1 17 2021-01-15 Philippe Normand <pnormand@igalia.com> 2 18 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadState.cpp
r248336 r271514 36 36 37 37 static bool test1Done; 38 static bool titleChangeDone; 38 39 39 40 struct PageLoadTestState { … … 113 114 PageLoadTestState* state = reinterpret_cast<PageLoadTestState*>(const_cast<void*>(clientInfo)); 114 115 state->didChangeTitle++; 116 titleChangeDone = true; 115 117 } 116 118 … … 279 281 EXPECT_EQ(state.willChangeCanGoForward, 1); 280 282 281 t est1Done = false;283 titleChangeDone = false; 282 284 url = adoptWK(Util::createURLForResource("set-long-title", "html")); 283 285 WKPageLoadURL(webView.page(), url.get()); 284 Util::run(&t est1Done);286 Util::run(&titleChangeDone); 285 287 286 288 EXPECT_EQ(state.didChangeActiveURL, 4); 287 EXPECT_EQ(state.didChangeTitle, 2);288 EXPECT_EQ(state.willChangeTitle, 2);289 EXPECT_EQ(state.didChangeTitle, 1); 290 EXPECT_EQ(state.willChangeTitle, 1); 289 291 290 292 WKPageSetPageStateClient(webView.page(), nullptr); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm
r263196 r271514 413 413 auto delegate = adoptNS([[PrintDelegate alloc] init]); 414 414 [webView setUIDelegate:delegate.get()]; 415 [webView loadHTMLString:@"<head><title>test_title</title></head><body onload=' print()'>hello world!</body>" baseURL:[NSURL URLWithString:@"http://example.com/"]];415 [webView loadHTMLString:@"<head><title>test_title</title></head><body onload='setTimeout(function() { print() });'>hello world!</body>" baseURL:[NSURL URLWithString:@"http://example.com/"]]; 416 416 TestWebKitAPI::Util::run(&done); 417 417
Note: See TracChangeset
for help on using the changeset viewer.