Reviewed by Hyatt.
We handle a null GraphicsContext everywhere, but we weren't checking for
a null ImageBuffer, which is what will result in a null GraphicsContext in
the first place.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30452
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-02-20 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Hyatt.
+
+ Test to ensure we do not crash on a zero sized canvas.
+
+ * fast/canvas/access-zero-sized-canvas-expected.txt: Added.
+ * fast/canvas/access-zero-sized-canvas.html: Added.
+
2008-02-20 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
--- /dev/null
+This test ensures that accessing the context of a zero sized canvas does not crash.
+
--- /dev/null
+This test ensures that accessing the context of a zero sized canvas does not crash.
+<canvas id="canvas" width="0" height="0"></canvas><br />
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+var context = document.getElementById("canvas").getContext("2d");
+context.fillStyle = "green";
+
+</script>
+2008-02-20 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Hyatt.
+
+ Bug 17303: Canvas crash in ImageBuffer
+
+ We handle a null GraphicsContext everywhere, but we weren't checking for
+ a null ImageBuffer, which is what will result in a null GraphicsContext in
+ the first place.
+
+ Test: fast/canvas/access-zero-sized-canvas.html
+
+ * html/HTMLCanvasElement.cpp:
+
2008-02-20 David Hyatt <hyatt@apple.com>
Fix the layout test failure that never should have passed in the first
GraphicsContext* HTMLCanvasElement::drawingContext() const
{
- return buffer()->context();
+ return buffer() ? m_imageBuffer->context() : 0;
}
ImageBuffer* HTMLCanvasElement::buffer() const