source: trunk/LayoutTests/fast/dom/constructor-in-removed-frame.html @ 114989

Revision 114989, 781 bytes checked in by arv@chromium.org, 2 years ago (diff)

[V8] Fix issue with trying to access a constructor in a frame that has been removed
https://bugs.webkit.org/show_bug.cgi?id=84640

Reviewed by Kentaro Hara.

Source/WebCore:

This regressed in r113250. Now we do what we did before and return undefined if the frame
does not have a context.

Test: fast/dom/constructor-in-removed-frame.html

  • bindings/v8/V8DOMWrapper.cpp:

(WebCore::V8DOMWrapper::constructorForType):

LayoutTests:

  • fast/dom/constructor-in-removed-frame-expected.txt: Added.
  • fast/dom/constructor-in-removed-frame.html: Added.
Line 
1<!DOCTYPE html>
2<p>FAIL</p>
3<iframe src="data:text/html,FAIL"></iframe>
4<script>
5
6window.onload = function() {
7    if (window.layoutTestController) {
8        layoutTestController.waitUntilDone();
9        layoutTestController.dumpAsText();
10
11        var iframeElement = document.querySelector('iframe');
12        iframeElement.onload = function() {
13            var frame = window.frames[0];
14            iframeElement.parentNode.removeChild(iframeElement);
15
16            // The V8 bindings does not keep the frame constructor alive but at least it should not crash!
17            frame.Window;
18
19            document.body.textContent = 'PASS';
20            layoutTestController.notifyDone();
21        };
22        iframeElement.src = 'data:text/html,PASS';
23    }
24};
25
26</script>
27</body>
28</html>
Note: See TracBrowser for help on using the repository browser.