Commit 7498ffbf authored by pam@chromium.org's avatar pam@chromium.org

2008-12-05 Pamela Greene <pam@chromium.org>

        Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=22592
        Make sure the onload handler is only called once, even when there are
        multiple <body> nodes in the document.

        * fast/events/onload-fires-twice-expected.txt: Added.
        * fast/events/onload-fires-twice.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4d48da8f
2008-12-05 Pamela Greene <pam@chromium.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=22592
Make sure the onload handler is only called once, even when there are
multiple <body> nodes in the document.
* fast/events/onload-fires-twice-expected.txt: Added.
* fast/events/onload-fires-twice.html: Added.
2008-12-05 Pamela Greene <pam@chromium.org>
Reviewed by Darin Adler.
......
Makes sure an inline "load" event does not fire twice. This may occur if an inline event listener is not removed prior to being re-added in the case of multiple body nodes in the document. You should see "Test passed" below.
Test passed.
<html>
<head>
<!-- any unknown element in HEAD will trigger creation of a BODY node -->
<anytag>
<script type="text/javascript">
if (window.layoutTestController)
layoutTestController.dumpAsText()
var count = 2;
function testDoubleLoad() {
--count;
var result = document.getElementById("result");
if (count == 1)
result.innerHTML = "Test passed.";
else
result.innerHTML = "Test failed (fired more than once).";
}
</script>
</head>
<body onload="testDoubleLoad()">
<p>Makes sure an inline "load" event does not fire twice. This may occur if
an inline event listener is not removed prior to being re-added in the case
of multiple body nodes in the document. You should see "Test passed" below.
</p>
<div id='result'>Test failed (never ran).</div>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment