Commit 3c49db48 authored by alice.liu@apple.com's avatar alice.liu@apple.com

WebCore:

2009-06-19  Alice Liu  <alice.liu@apple.com>

        Fix https://bugs.webkit.org/show_bug.cgi?id=26568 
        Repro crash animating GIF if previously used in a closed window's back/forward list
        Also filed as <rdar://problem/6978362>

        Reviewed by Maciej Stachowiak.

        Can't test this bug with an automated layout test since it requires b/f caching 
        * manual-tests/animated-gif-bfcache-crash.html: Added.
        * manual-tests/resources/containsAnimatedGif.html: Added.

        Adding checks for hostWindow() since there is no guarantee that the Page is alive
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::scrollRectIntoViewRecursively):
        (WebCore::ScrollView::contentsToScreen):
        (WebCore::ScrollView::screenToContents):
        (WebCore::ScrollView::wheelEvent):

LayoutTests:

2009-06-19  Alice Liu  <alice.liu@apple.com>

        Fix https://bugs.webkit.org/show_bug.cgi?id=26568 
        Repro crash animating GIF if previously used in a closed window's back/forward list
        Also filed as <rdar://problem/6978362>

        Reviewed by Maciej Stachowiak.

        Adding resource used in WebCore/manual-tests/animated-gif-bfcache-crash.html
        * http/tests/misc/resources/animated-gif-with-offsets.gif: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7d676a48
2009-06-19 Alice Liu <alice.liu@apple.com>
Fix https://bugs.webkit.org/show_bug.cgi?id=26568
Repro crash animating GIF if previously used in a closed window's back/forward list
Also filed as <rdar://problem/6978362>
Reviewed by Maciej Stachowiak.
Adding resource used in WebCore/manual-tests/animated-gif-bfcache-crash.html
* http/tests/misc/resources/animated-gif-with-offsets.gif: Added.
2009-06-20 Sam Weinig <sam@webkit.org>
Reviewed by Adam Barth.
......
2009-06-19 Alice Liu <alice.liu@apple.com>
Fix https://bugs.webkit.org/show_bug.cgi?id=26568
Repro crash animating GIF if previously used in a closed window's back/forward list
Also filed as <rdar://problem/6978362>
Reviewed by Maciej Stachowiak.
Can't test this bug with an automated layout test since it requires b/f caching
* manual-tests/animated-gif-bfcache-crash.html: Added.
* manual-tests/resources/containsAnimatedGif.html: Added.
Adding checks for hostWindow() since there is no guarantee that the Page is alive
* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollRectIntoViewRecursively):
(WebCore::ScrollView::contentsToScreen):
(WebCore::ScrollView::screenToContents):
(WebCore::ScrollView::wheelEvent):
2009-06-20 Sam Weinig <sam@webkit.org>
Reviewed by Adam Barth.
......
<html>
<script>
var theWindow;
function step1()
{
theWindow = window.open("./resources/containsAnimatedGif.html", "x");
setTimeout(step2, 100);
}
function step2()
{
window.open("about:blank", "x");
setTimeout(step3, 100);
}
function step3()
{
theWindow.close();
theWindow = window.open("./resources/containsAnimatedGif.html");
setTimeout(step4, 500);
}
function step4()
{
theWindow.close();
document.getElementById("results").appendChild(document.createTextNode("PASSED"));
}
</script>
<body>
<p>This page tests the fix for <br>
<a href="rdar://problem/6978362">rdar://problem/6978362</a> Repro crash animating GIF if previously used in a closed window's back/forward list <br>
<a href="https://bugs.webkit.org/show_bug.cgi?id=26568">Bug 26568</a> <br>
<p>Prerequisites:<br>
<ul><li>run the LayoutTest's webserver (WebKitTools/run-webkit-httpd)</ul>
<p>Then click this button: <input type="button" value="Run test" onclick="step1()">
<p>Expected results:<br>
<ul>
<li>A window will open, loading a page with an animated gif.</li>
<li>about:blank will be loaded in that window, putting the animated gif in the back/forward cache.</li>
<li>That window will close.</li>
<li>A new window will open, loading that page with the animated gif</li>
<li>No crash means test passed </li>
</ul>
<span style="color:green;" id="results"></span>
</body>
</html>
<html>
<img src="http://127.0.0.1:8000/misc/resources/animated-gif-with-offsets.gif" />
</html>
......@@ -279,7 +279,8 @@ void ScrollView::scrollRectIntoViewRecursively(const IntRect& r)
// on up the view chain.
// This rect is not clamped, since Mail actually relies on receiving an unclamped rect with negative coordinates in order to
// expose the headers.
hostWindow()->scrollRectIntoView(rect, this);
if (hostWindow())
hostWindow()->scrollRectIntoView(rect, this);
}
void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
......@@ -544,6 +545,8 @@ IntRect ScrollView::contentsToScreen(const IntRect& rect) const
{
if (platformWidget())
return platformContentsToScreen(rect);
if (!hostWindow())
return IntRect();
return hostWindow()->windowToScreen(contentsToWindow(rect));
}
......@@ -551,6 +554,8 @@ IntPoint ScrollView::screenToContents(const IntPoint& point) const
{
if (platformWidget())
return platformScreenToContents(point);
if (!hostWindow())
return IntPoint();
return windowToContents(hostWindow()->screenToWindow(point));
}
......@@ -717,7 +722,8 @@ void ScrollView::repaintContentRectangle(const IntRect& rect, bool now)
return;
}
hostWindow()->repaint(contentsToWindow(rect), true, now);
if (hostWindow())
hostWindow()->repaint(contentsToWindow(rect), true, now);
}
void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
......@@ -853,6 +859,8 @@ bool ScrollView::isOffscreen() const
void ScrollView::addPanScrollIcon(const IntPoint& iconPosition)
{
if (!hostWindow())
return;
m_drawPanScrollIcon = true;
m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ;
hostWindow()->repaint(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength,panIconSizeLength)), true, true);
......@@ -860,6 +868,8 @@ void ScrollView::addPanScrollIcon(const IntPoint& iconPosition)
void ScrollView::removePanScrollIcon()
{
if (!hostWindow())
return;
m_drawPanScrollIcon = false;
hostWindow()->repaint(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true, true);
}
......
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