Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2010-05-03 Steven Lai <steven_lai@asia.apple.com>
Reviewed by Brady Eidson. Test hashchange() event is fired in asynchronous manner. https://bugs.webkit.org/show_bug.cgi?id=36201 * fast/loader/hashchange-event-async-expected.txt: Added. * fast/loader/hashchange-event-async.html: Added. 2010-05-03 Steven Lai <steven_lai@asia.apple.com> Reviewed by Brady Eidson. Reverted hashchange() event back to async. (This change does not update HashChangeEvent to its new proposed interface) https://bugs.webkit.org/show_bug.cgi?id=36201 rdar://problem/7780794 rdar://problem/7761278 (partial fix) Tests: fast/loader/hashchange-event-async.html * dom/Document.cpp: reverted hashchange() event back to async (WebCore::Document::enqueueHashchangeEvent): Canonical link: https://commits.webkit.org/49991@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,9 @@ | ||
This test checks to make sure the hashchange event is fired __ansynchronously__ when the value of location.hash changes. | ||
It assumes there is a hashchange event for each location.hash change. | ||
|
||
updateHash("#foo") | ||
updateHash("#bar") | ||
hashChangeHandler() | ||
hashChangeHandler() | ||
|
||
SUCCESS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,55 @@ | ||
<html> | ||
<body> | ||
<div> | ||
This test checks to make sure the hashchange event is fired __ansynchronously__ when the value of location.hash changes.<br/> | ||
It assumes there is a hashchange event for each location.hash change.<br/> | ||
<br/> | ||
</div> | ||
<div id="msg"></div> | ||
</body> | ||
<script language="javascript"> | ||
<!-- | ||
|
||
var hashChanging = false; | ||
var failed = false; | ||
var msgs = []; | ||
|
||
var lc = window.layoutTestController; | ||
if (lc) { | ||
lc.dumpAsText(); | ||
lc.waitUntilDone(); | ||
} | ||
|
||
function updateHash (hash) { | ||
msgs.push('updateHash("' + hash + '")'); | ||
location.href = hash; | ||
}; | ||
|
||
function loadHandler () { | ||
hashChanging = true; | ||
updateHash('#foo'); | ||
updateHash('#bar'); | ||
hashChanging = false; | ||
}; | ||
|
||
var cnt = 0; | ||
function hashChangeHandler () { | ||
msgs.push('hashChangeHandler()'); | ||
if (hashChanging) { | ||
failed = true; | ||
} | ||
if (++cnt == 2) { | ||
msgs.push('', failed ? "FAILURE" : "SUCCESS"); | ||
document.getElementById("msg").innerHTML = msgs.join('<br/>'); | ||
if (lc) { | ||
lc.notifyDone(); | ||
} | ||
} | ||
}; | ||
|
||
window.addEventListener('load', loadHandler, false); | ||
window.addEventListener('hashchange', hashChangeHandler, false); | ||
|
||
//--> | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters