Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html

Issue 136463002: Don't fire popstate event on initial document load (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix replacestate-in-iframe test Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html
diff --git a/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html b/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html
index 8ad8bf5530dc66bdb75cf5bae8df615c6da4bfa2..78e6cec349dd63fbd130329e71e023107231365b 100644
--- a/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html
+++ b/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html
@@ -20,18 +20,8 @@ function runTest()
history.back();
}
-var beganTest = false;
-
function statePopped()
{
- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
log("State popped - " + event.state + " (type " + typeof event.state + ")");
if (event.state == null) {
document.body.onpopstate = statePopped;
@@ -41,7 +31,7 @@ function statePopped()
}
</script>
-<body onpopstate="statePopped();">
+<body onload="runTest();" onpopstate="statePopped();">
<pre>
This test does the following:
-Uses body.onpopstate to add a popstate handler (both by using the inline attribute and a script-assigned attribute)

Powered by Google App Engine
This is Rietveld 408576698