Skip to content
Permalink
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
eseidel committed May 4, 2010
1 parent 94c02a8 commit d20e4dd91596b701d521f4f76d2730d2628c9f84
Showing 5 changed files with 90 additions and 2 deletions.
@@ -1,3 +1,13 @@
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 Dirk Pranke <dpranke@chromium.org>

Unreviewed, expectations change.
@@ -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
@@ -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>
@@ -1,3 +1,18 @@
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):

2010-05-03 Holger Hans Peter Freyther <zecke@selfish.org>

Rubber-stamped by Xan Lopez.
@@ -4850,10 +4850,9 @@ void Document::enqueuePageshowEvent(PageshowEventPersistence persisted)

void Document::enqueueHashchangeEvent(const String& /*oldURL*/, const String& /*newURL*/)
{
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=36201 Hashchange event needs to fire asynchronously.
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=36335 Hashchange event is now its own interface and takes two
// URL arguments which we need to pass in here.
dispatchWindowEvent(Event::create(eventNames().hashchangeEvent, false, false));
enqueueEvent(Event::create(eventNames().hashchangeEvent, false, false));
}

void Document::enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject)

0 comments on commit d20e4dd

Please sign in to comment.