Reviewed by Geoff.
- test case for <rdar://problem/
4583892> 10.4.7 regression: Hang occurs when attempting to load
search results at mapquest.com
* fast/events/no-window-load-expected.txt: Added.
* fast/events/no-window-load.html: Added.
WebCore:
Reviewed by Darin.
<rdar://problem/
4583892> 10.4.7 regression: Hang occurs when attempting to load search results at mapquest.com
* dom/EventTargetNode.cpp:
(WebCore::EventTargetNode::dispatchGenericEvent): Don't allow
"load" events to propagate up to the window. We need this quirk to
avoid site hangs, because they depend on an old Mozilla bug.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14855
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-06-13 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Geoff.
+
+ - test case for <rdar://problem/4583892> 10.4.7 regression: Hang occurs when attempting to load
+ search results at mapquest.com
+
+ * fast/events/no-window-load-expected.txt: Added.
+ * fast/events/no-window-load.html: Added.
+
2006-06-13 Antti Koivisto <koivisto@iki.fi>
Reviewed by Hyatt
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 781x36
+ text run at (0,0) width 781: "This test ensures that \"load\" events for images do not trigger bubble or capture handlers on the window object. We need this"
+ text run at (0,18) width 314: "quirk to be compatible with a variety of web sites."
+ RenderBlock (anonymous) at (0,36) size 784x65
+ RenderText {#text} at (0,0) size 248x18
+ text run at (0,0) width 248: "Bubble for load event hit at most once: "
+ RenderInline {SPAN} at (0,0) size 39x18
+ RenderText {#text} at (248,0) size 39x18
+ text run at (248,0) width 39: "PASS"
+ RenderText {#text} at (287,0) size 4x18
+ text run at (287,0) width 4: "."
+ RenderBR {BR} at (291,14) size 0x0
+ RenderText {#text} at (0,18) size 252x18
+ text run at (0,18) width 252: "Capture for load event hit at most once: "
+ RenderInline {SPAN} at (0,0) size 39x18
+ RenderText {#text} at (252,18) size 39x18
+ text run at (252,18) width 39: "PASS"
+ RenderText {#text} at (291,18) size 4x18
+ text run at (291,18) width 4: "."
+ RenderBR {BR} at (295,32) size 0x0
+ RenderImage {IMG} at (0,36) size 25x25
+ RenderText {#text} at (25,47) size 4x18
+ text run at (25,47) width 4: " "
+ RenderImage {IMG} at (29,36) size 25x25
+ RenderText {#text} at (0,0) size 0x0
--- /dev/null
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+var bubbleCount = 0;
+
+function checkBubble()
+{
+ bubbleCount++;
+ if (bubbleCount > 1) {
+ document.getElementById("bubble").innerHTML = "FAIL (hit " + bubbleCount + " times)";
+ }
+}
+
+var captureCount = 0;
+
+function checkCapture()
+{
+ captureCount++;
+ if (captureCount > 1) {
+ document.getElementById("capture").innerHTML = "FAIL (hit " + captureCount + " times)";
+ }
+}
+
+window.addEventListener("load", checkBubble, false);
+window.addEventListener("load", checkCapture, true);
+
+
+</script>
+<div>
+This test ensures that "load" events for images do not trigger bubble
+or capture handlers on the window object. We need this quirk to be
+compatible with a variety of web sites.
+</div>
+Bubble for load event hit at most once: <span id="bubble">PASS</span>.<br>
+Capture for load event hit at most once: <span id="capture">PASS</span>.<br>
+
+<img src="resources/greenbox.png">
+<img src="resources/greenbox.png">
+2006-06-13 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Darin.
+
+ <rdar://problem/4583892> 10.4.7 regression: Hang occurs when attempting to load search results at mapquest.com
+
+ * dom/EventTargetNode.cpp:
+ (WebCore::EventTargetNode::dispatchGenericEvent): Don't allow
+ "load" events to propagate up to the window. We need this quirk to
+ avoid site hangs, because they depend on an old Mozilla bug.
+
2006-06-13 Antti Koivisto <koivisto@iki.fi>
Reviewed by Hyatt.
evt->setEventPhase(Event::CAPTURING_PHASE);
it.toFirst();
- // Handle window events for capture phase
- if (it.current()->isDocumentNode() && !evt->propagationStopped()) {
+ // Handle window events for capture phase, except load events, this quirk is needed
+ // because Mozilla used to never propagate load events to the window object
+ if (evt->type() != loadEvent && it.current()->isDocumentNode() && !evt->propagationStopped())
static_cast<Document*>(it.current())->handleWindowEvent(evt.get(), true);
- }
for (; it.current() && it.current() != this && !evt->propagationStopped(); ++it) {
evt->setCurrentTarget(it.current());
evt->setCurrentTarget(it.current());
EventTargetNodeCast(it.current())->handleLocalEvents(evt.get(), false);
}
- // Handle window events for bubbling phase
+ // Handle window events for bubbling phase, except load events, this quirk is needed
+ // because Mozilla used to never propagate load events at all
+
it.toFirst();
- if (it.current()->isDocumentNode() && !evt->propagationStopped() && !evt->getCancelBubble()) {
+ if (evt->type() != loadEvent && it.current()->isDocumentNode() && !evt->propagationStopped() && !evt->getCancelBubble()) {
evt->setCurrentTarget(it.current());
static_cast<Document*>(it.current())->handleWindowEvent(evt.get(), false);
}