Reviewed by Maciej.
Fix http://bugs.webkit.org/show_bug.cgi?id=13038
Bug 13038: ASSERTION FAILED: item->target().isEmpty() || m_mainFrame->tree()->find(item->target()) == m_mainFrame
Modify an ASSERT in goToItem related to going back/forward in history. We don't need to check the frameset if the target is _blank.
The attached test case is a manual one since it relies on having pages opened in tabs in Safari.
* manual-tests/goBack-blank-tab-page.html: Added.
* manual-tests/resources/before-go-back.html: Added.
* manual-tests/resources/will-go-back.html: Added.
* page/Page.cpp:
(WebCore::Page::goToItem):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24057
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-07-06 Maxime Britto <mbritto@pleyo.com>
+
+ Reviewed by Maciej.
+
+ Fix http://bugs.webkit.org/show_bug.cgi?id=13038
+ Bug 13038: ASSERTION FAILED: item->target().isEmpty() || m_mainFrame->tree()->find(item->target()) == m_mainFrame
+
+ Modify an ASSERT in goToItem related to going back/forward in history. We don't need to check the frameset if the target is _blank.
+ The attached test case is a manual one since it relies on having pages opened in tabs in Safari.
+
+ * manual-tests/goBack-blank-tab-page.html: Added.
+ * manual-tests/resources/before-go-back.html: Added.
+ * manual-tests/resources/will-go-back.html: Added.
+ * page/Page.cpp:
+ (WebCore::Page::goToItem):
+
2007-07-06 Mitz Pettel <mitz@webkit.org>
Reviewed by Maciej.
--- /dev/null
+<html>
+<body>
+<a href="resources/before-go-back.html" target="_blank">
+Link to open in a tab</a>
+<br>
+<br>
+<u>Manual test :</u>
+<br>
+You need to open the above link in a new tab. In the opened page, just click on the link : if the webkit doesn't crash, the test has succeed.
+<br>
+<u>Details :</u>
+<br>
+This test checks if you can go back to a _blank-target previously tab-opened page.
+<br>
+If the webkit doesn't meet an assertion error : this test is Successfull.
+<br>
+When you click on the above link, one page (with _blank target) is loaded and this page will open a link and go back.
+</body>
+</html>
--- /dev/null
+<html>
+<body>
+<a href="will-go-back.html">
+Click this link</a>
+<br>
+<br>
+<u>Manual test :</u>
+Just click on the link : if the webkit doesn't crash, the test has succeed.
+<br>
+<u>Details:</u>
+This test checks if you can go back to a _blank previously tab-opened page.
+<br>
+When you click on the above link, one page is loaded and tries to go back.
+<br>
+If the webkit doesn't meet an assertion failure : this test is successfull.
+</body>
+</html>
--- /dev/null
+<html>
+<script>
+function goBack() {
+ history.back();
+}
+</script>
+
+<body onload="if (!window.layoutTestController) goBack();">
+If you can go back using the history : test has succeed.
+</body>
+</html>
void Page::goToItem(HistoryItem* item, FrameLoadType type)
{
+ // Handle the go back/forward to a frameset, don't need to handle if the traget is a _blank
// We never go back/forward on a per-frame basis, so the target must be the main frame
- ASSERT(item->target().isEmpty() || m_mainFrame->tree()->find(item->target()) == m_mainFrame);
+ ASSERT(item->target().isEmpty() || item->target().contains("_blank", true) || m_mainFrame->tree()->find(item->target()) == m_mainFrame);
// Abort any current load if we're going to a history item
m_mainFrame->loader()->stopAllLoaders();