[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 12:06:38 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bb569f5510d30e559a46959f7fd0c231c7093f7b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Aug 14 15:36:40 2010 +0000

    2010-08-14  Matthew Delaney  <mdelaney at apple.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Canvas is not reset when setting canvas.width
            https://bugs.webkit.org/show_bug.cgi?id=43341
    
            * html/HTMLCanvasElement.cpp:
            (WebCore::HTMLCanvasElement::reset): Moved the call to
            hasCreatedImageBuffer up *before* the call to setSurface since setSurface
            sets hasCreatedImageBuffer to false every time.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65367 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/fast/repaint/resources/repaint.js b/LayoutTests/fast/canvas/resources/repaint.js
similarity index 100%
copy from LayoutTests/fast/repaint/resources/repaint.js
copy to LayoutTests/fast/canvas/resources/repaint.js
diff --git a/LayoutTests/fast/canvas/setWidthResetAfterForcedRender.html b/LayoutTests/fast/canvas/setWidthResetAfterForcedRender.html
new file mode 100644
index 0000000..93b619c
--- /dev/null
+++ b/LayoutTests/fast/canvas/setWidthResetAfterForcedRender.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<script src="resources/repaint.js"></script>
+<script>
+function repaintTest()
+{
+    var canvas = document.getElementById('c1');
+    var offset = document.body.offsetLeft; // Forces layout
+    canvas.width = canvas.width; // Should wipe canvas clean
+}
+</script>
+</head>
+<body onload="runRepaintTest();">
+<p><b>BUG ID:</b> <a href="https://bugs.webkit.org/show_bug.cgi?id=43341">Bugzilla bug 43341</a>
+Setting canvas width after canvas already rendered resets canvas data appropriately, but doesn't repaint immediately.
+<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
+The canvas should go blank due to setting on the canvas width.
+</p>
+
+<hr>
+
+<p class="output">Actual output: (blank canvas)</p>
+<canvas id="c1" class="output" width="100" height="50" ></canvas>
+
+<script>
+
+var canvas = document.getElementById('c1');
+var ctx = canvas.getContext('2d');
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.checksum b/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.checksum
new file mode 100644
index 0000000..cd4e01f
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.checksum
@@ -0,0 +1 @@
+2c34428ccb32492cb222a6bbf5b94b08
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.png b/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.png
new file mode 100644
index 0000000..db33f9f
Binary files /dev/null and b/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.txt b/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.txt
new file mode 100644
index 0000000..d821d7d
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/canvas/setWidthResetAfterForcedRender-expected.txt
@@ -0,0 +1,32 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x222
+  RenderBlock {HTML} at (0,0) size 800x222
+    RenderBody {BODY} at (8,16) size 784x198
+      RenderBlock {P} at (0,0) size 784x36
+        RenderInline {B} at (0,0) size 62x18
+          RenderText {#text} at (0,0) size 62x18
+            text run at (0,0) width 62: "BUG ID:"
+        RenderText {#text} at (62,0) size 4x18
+          text run at (62,0) width 4: " "
+        RenderInline {A} at (0,0) size 125x18 [color=#0000EE]
+          RenderText {#text} at (66,0) size 125x18
+            text run at (66,0) width 125: "Bugzilla bug 43341"
+        RenderText {#text} at (191,0) size 745x36
+          text run at (191,0) width 554: " Setting canvas width after canvas already rendered resets canvas data appropriately, but"
+          text run at (0,18) width 176: "doesn't repaint immediately."
+      RenderBlock {P} at (0,52) size 784x24 [bgcolor=#98FB98]
+        RenderInline {B} at (0,0) size 91x18
+          RenderText {#text} at (3,3) size 91x18
+            text run at (3,3) width 91: "TEST PASS:"
+        RenderText {#text} at (94,3) size 403x18
+          text run at (94,3) width 4: " "
+          text run at (98,3) width 399: "The canvas should go blank due to setting on the canvas width."
+      RenderBlock {HR} at (0,92) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,110) size 784x18
+        RenderText {#text} at (0,0) size 186x18
+          text run at (0,0) width 186: "Actual output: (blank canvas)"
+      RenderBlock (anonymous) at (0,144) size 784x54
+        RenderHTMLCanvas {CANVAS} at (0,0) size 100x50
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e76b80b..f3a50b8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-14  Matthew Delaney  <mdelaney at apple.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Canvas is not reset when setting canvas.width
+        https://bugs.webkit.org/show_bug.cgi?id=43341
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::reset): Moved the call to
+        hasCreatedImageBuffer up *before* the call to setSurface since setSurface
+        sets hasCreatedImageBuffer to false every time.
+
 2010-08-14  Patrick Gansterer  <paroga at paroga.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index b306361..3629776 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -233,6 +233,7 @@ void HTMLCanvasElement::reset()
         return;
 
     bool ok;
+    bool hadImageBuffer = hasCreatedImageBuffer();
     int w = getAttribute(widthAttr).toInt(&ok);
     if (!ok || w < 0)
         w = DefaultWidth;
@@ -248,7 +249,6 @@ void HTMLCanvasElement::reset()
         static_cast<WebGLRenderingContext*>(m_context.get())->reshape(width(), height());
 #endif
 
-    bool hadImageBuffer = hasCreatedImageBuffer();
     if (m_context && m_context->is2d())
         static_cast<CanvasRenderingContext2D*>(m_context.get())->reset();
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list