[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
darin at apple.com
darin at apple.com
Wed Jan 6 00:20:32 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 3ab7b9d653576cd654b1de58c0b0741900919276
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 5 01:07:26 2010 +0000
WebCore: Added missing null check in BarInfo code.
Reviewed by Sam Weinig.
Test: fast/dom/Window/BarInfo-after-frame-removed.html
* page/BarInfo.cpp:
(WebCore::BarInfo::visible): Added null check. A few other
cleanups.
LayoutTests: Added test for use of BarInfo object after a frame is no longer
associated with a web page.
Reviewed by Sam Weinig.
* fast/dom/Window/BarInfo-after-frame-removed-expected.txt: Added.
* fast/dom/Window/BarInfo-after-frame-removed.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ed91f93..be7c6cd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-04 Darin Adler <darin at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Added test for use of BarInfo object after a frame is no longer
+ associated with a web page.
+
+ * fast/dom/Window/BarInfo-after-frame-removed-expected.txt: Added.
+ * fast/dom/Window/BarInfo-after-frame-removed.html: Added.
+
2010-01-04 Simon Fraser <simon.fraser at apple.com>
Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/dom/Window/BarInfo-after-frame-removed-expected.txt b/LayoutTests/fast/dom/Window/BarInfo-after-frame-removed-expected.txt
new file mode 100644
index 0000000..b826899
--- /dev/null
+++ b/LayoutTests/fast/dom/Window/BarInfo-after-frame-removed-expected.txt
@@ -0,0 +1,3 @@
+This tests accessing the visible property of a BarInfo after the relevant frame is no longer in a web page. If the test did not crash, it passed.
+
+TEST RAN
diff --git a/LayoutTests/fast/dom/Window/BarInfo-after-frame-removed.html b/LayoutTests/fast/dom/Window/BarInfo-after-frame-removed.html
new file mode 100644
index 0000000..d27f9f7
--- /dev/null
+++ b/LayoutTests/fast/dom/Window/BarInfo-after-frame-removed.html
@@ -0,0 +1,35 @@
+<html>
+<head>
+<script>
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ function runTest()
+ {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+
+ var frame = document.getElementById("frame");
+ var childWindow = frame.contentWindow;
+ frame.parentNode.removeChild(frame);
+ childWindow.toolbar.visible;
+
+ document.getElementById("console").firstChild.data = "TEST RAN";
+ }
+
+</script>
+</head>
+<body>
+
+<p>This tests accessing the visible property of a BarInfo after the relevant frame is no longer in a web page.
+If the test did not crash, it passed.<p>
+
+<pre id="console">TEST DID NOT RUN</pre>
+
+<iframe id="frame" src="about:blank" onload="runTest()">
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9ebbf77..4d0c2fc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-04 Darin Adler <darin at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Added missing null check in BarInfo code.
+
+ Test: fast/dom/Window/BarInfo-after-frame-removed.html
+
+ * page/BarInfo.cpp:
+ (WebCore::BarInfo::visible): Added null check. A few other
+ cleanups.
+
2010-01-04 Mark Rowe <mrowe at apple.com>
Rubber-stamped by Jon Honeycutt.
diff --git a/WebCore/page/BarInfo.cpp b/WebCore/page/BarInfo.cpp
index 0f6cad5..b6ab686 100644
--- a/WebCore/page/BarInfo.cpp
+++ b/WebCore/page/BarInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -60,23 +60,25 @@ bool BarInfo::visible() const
{
if (!m_frame)
return false;
+ Page* page = m_frame->page();
+ if (!page)
+ return false;
switch (m_type) {
case Locationbar:
- return m_frame->page()->chrome()->toolbarsVisible();
- case Toolbar:
- return m_frame->page()->chrome()->toolbarsVisible();
case Personalbar:
- return m_frame->page()->chrome()->toolbarsVisible();
+ case Toolbar:
+ return page->chrome()->toolbarsVisible();
case Menubar:
- return m_frame->page()->chrome()->menubarVisible();
+ return page->chrome()->menubarVisible();
case Scrollbars:
- return m_frame->page()->chrome()->scrollbarsVisible();
+ return page->chrome()->scrollbarsVisible();
case Statusbar:
- return m_frame->page()->chrome()->statusbarVisible();
- default:
- return false;
+ return page->chrome()->statusbarVisible();
}
+
+ ASSERT_NOT_REACHED();
+ return false;
}
} // namespace WebCore
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list