2006-07-18 Anders Carlsson <acarlsson@apple.com>
Reviewed by Darin.
http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
REGRESSION: iframes stop rendering after 200th one on successive reloads
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::attach):
(WebCore::HTMLFrameElement::close):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::insertedIntoDocument):
(WebCore::HTMLIFrameElement::willRemove):
Remove calls to incrementFrameCount and decrementFrameCount.
* page/Frame.cpp:
(WebCore::Frame::Frame):
Call incrementFrameCount here.
(WebCore::Frame::~Frame):
Call disconnectOwnerElement.
(WebCore::Frame::disconnectOwnerElement):
Call decrementFrameCount here.
LayoutTests:
2006-07-18 Anders Carlsson <acarlsson@apple.com>
Reviewed by Darin.
http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
REGRESSION: iframes stop rendering after 200th one on successive reloads
* fast/frames/frame-limit-expected.txt: Added.
* fast/frames/frame-limit.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15506
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-07-18 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by Darin.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
+ REGRESSION: iframes stop rendering after 200th one on successive reloads
+
+ * fast/frames/frame-limit-expected.txt: Added.
+ * fast/frames/frame-limit.html: Added.
+
2006-07-18 Darin Adler <darin@apple.com>
Reviewed by Alice.
--- /dev/null
+This tests that frames are properly deregistered with the page's counter when removed. If this test is successful, the text "SUCCESS" will be shown below.
+SUCCESS
+
--- /dev/null
+<script>
+ function addFrames() {
+ var parent = document.createElement('iframe');
+ parent.id = 'theframe';
+ document.body.appendChild(parent);
+
+ for (i = 0; i < 150; i++) {
+ var frame = document.createElement("iframe");
+ frame.setAttribute("src", "data:text/plain," + i);
+ frame.style.display = 'none';
+ parent.contentDocument.body.appendChild(frame);
+ }
+ }
+
+ function runTest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ // Add 150 frames.
+ addFrames();
+
+ // Remove the parent frame
+ var parent = document.getElementById('theframe');
+ parent.parentNode.removeChild(parent);
+
+ // Add 150 frames again.
+ addFrames();
+ var parent = document.getElementById('theframe');
+
+ if (parent.contentWindow.frames.length != 150)
+ return;
+
+ document.getElementById('result').innerHTML = 'SUCCESS';
+ }
+</script>
+<body onload="runTest()">
+<div>This tests that frames are properly deregistered with the page's counter when removed. If this test is successful, the text "SUCCESS" will be shown below.</div>
+<div id="result">FAILURE</div>
+</body>
+2006-07-18 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by Darin.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
+ REGRESSION: iframes stop rendering after 200th one on successive reloads
+
+ * html/HTMLFrameElement.cpp:
+ (WebCore::HTMLFrameElement::attach):
+ (WebCore::HTMLFrameElement::close):
+ * html/HTMLIFrameElement.cpp:
+ (WebCore::HTMLIFrameElement::insertedIntoDocument):
+ (WebCore::HTMLIFrameElement::willRemove):
+ Remove calls to incrementFrameCount and decrementFrameCount.
+
+ * page/Frame.cpp:
+ (WebCore::Frame::Frame):
+ Call incrementFrameCount here.
+
+ (WebCore::Frame::~Frame):
+ Call disconnectOwnerElement.
+
+ (WebCore::Frame::disconnectOwnerElement):
+ Call decrementFrameCount here.
+
2006-07-18 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Darin.
if (!frame)
return;
- frame->page()->incrementFrameCount();
-
AtomicString relativeURL = m_URL;
if (relativeURL.isEmpty())
relativeURL = "about:blank";
Frame* frame = document()->frame();
if (renderer() && frame) {
frame->disconnectOwnerElement();
- frame->page()->decrementFrameCount();
if (Frame* childFrame = frame->tree()->child(m_name))
childFrame->frameDetached();
}
if (m_name.isNull())
m_name = getAttribute(idAttr);
- Frame* parentFrame = document()->frame();
- if (parentFrame) {
- parentFrame->page()->incrementFrameCount();
+ if (Frame* parentFrame = document()->frame()) {
m_name = parentFrame->tree()->uniqueChildName(m_name);
openURL();
{
if (Frame* frame = contentFrame()) {
frame->disconnectOwnerElement();
- frame->page()->decrementFrameCount();
frame->frameDetached();
ASSERT(!contentFrame());
}
XMLNames::init();
#endif
+ if (d->m_ownerElement)
+ d->m_page->incrementFrameCount();
+
// FIXME: Frames were originally created with a refcount of 1, leave this
// ref call here until we can straighten that out.
ref();
w = 0;
}
+ disconnectOwnerElement();
+
if (d->m_domWindow)
d->m_domWindow->disconnectFrame();
void Frame::disconnectOwnerElement()
{
+ if (d->m_ownerElement)
+ d->m_page->decrementFrameCount();
+
d->m_ownerElement = 0;
}