LayoutTests:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Feb 2007 11:59:07 +0000 (11:59 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Feb 2007 11:59:07 +0000 (11:59 +0000)
        Reviewed by Antti.

        - test case for <rdar://problem/4928675> REGRESSION: Crash in CGBlt_copyBytes under WebCore::Font::drawGlyphs (12083)
        http://bugs.webkit.org/show_bug.cgi?id=12083

        * fast/text/text-shadow-extreme-value.html: Added.
        * fast/text/text-shadow-extreme-value-expected.txt: Added.

WebCore:

        Reviewed by Antti.

        - fixed <rdar://problem/4928675> REGRESSION: Crash in CGBlt_copyBytes under WebCore::Font::drawGlyphs (12083)
        http://bugs.webkit.org/show_bug.cgi?id=12083

        Test: fast/text/text-shadow-extreme-value.html

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::setShadow): Clamp shadow value to 1000px, anything more seems to
        make CG unhappy.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19573 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/text/text-shadow-extreme-value-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/text-shadow-extreme-value.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/graphics/cg/GraphicsContextCG.cpp

index e2fe814d74df2bd75c1773717107d01dd5ffb76f..4f6d61603ca3057f88599bde81dc583c5b6345ba 100644 (file)
@@ -1,3 +1,13 @@
+2007-02-12  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Antti.
+        
+        - test case for <rdar://problem/4928675> REGRESSION: Crash in CGBlt_copyBytes under WebCore::Font::drawGlyphs (12083)
+        http://bugs.webkit.org/show_bug.cgi?id=12083
+        
+        * fast/text/text-shadow-extreme-value.html: Added.
+        * fast/text/text-shadow-extreme-value-expected.txt: Added.
+
 2007-02-11  Maciej Stachowiak  <mjs@apple.com>
 
         Test case not reviewed; based on manual test by David Kilzer.
diff --git a/LayoutTests/fast/text/text-shadow-extreme-value-expected.txt b/LayoutTests/fast/text/text-shadow-extreme-value-expected.txt
new file mode 100644 (file)
index 0000000..aeb5f51
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 506742501x506742511
+  RenderView at (0,0) size 785x585
+layer at (0,0) size 506742501x506742511
+  RenderBlock {HTML} at (0,0) size 785x585
+    RenderBody {BODY} at (8,8) size 769x561
+      RenderBlock {P} at (0,0) size 769x18
+        RenderText {#text} at (0,0) size 8x18
+          text run at (0,0) width 8: "p"
diff --git a/LayoutTests/fast/text/text-shadow-extreme-value.html b/LayoutTests/fast/text/text-shadow-extreme-value.html
new file mode 100644 (file)
index 0000000..0c81531
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+    <title>Test HTML Page</title>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+</script>
+    <style type="text/css">
+    p { text-shadow: purple 0px 0px 38005685px; }
+    </style>
+</head>
+<body>
+    <p>Extreme text-shadow blur values should not crash.</p>
+</body>
+</html>
index 74d3b36b1dd2a7aff45e8444d0e8b642676ae97b..3e48484fac9cb88274594f08fd9f20c4e2b1345d 100644 (file)
@@ -1,6 +1,19 @@
+2007-02-12  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Antti.
+
+        - fixed <rdar://problem/4928675> REGRESSION: Crash in CGBlt_copyBytes under WebCore::Font::drawGlyphs (12083)
+        http://bugs.webkit.org/show_bug.cgi?id=12083
+        
+        Test: fast/text/text-shadow-extreme-value.html
+
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::setShadow): Clamp shadow value to 1000px, anything more seems to 
+        make CG unhappy.
+
 2007-02-11  Brady Eidson <beidson@apple.com>
 
-        Reviewed by Maciej
+        Reviewed by Maciej.
 
         First in what will be a series of HistoryItem enhancements to help debugging
 
index bf1ed7337ababe6dd8beb9a2671351fd1fc5cd20..6a3c07566168de6ad7165463bc930d1cf187587b 100644 (file)
@@ -595,6 +595,9 @@ void GraphicsContext::endTransparencyLayer()
 
 void GraphicsContext::setShadow(const IntSize& size, int blur, const Color& color)
 {
+    // Extreme "blur" values can make text drawing crash or take crazy long times, so clamp
+    blur = min(blur, 1000);
+
     if (paintingDisabled())
         return;
     // Check for an invalid color, as this means that the color was not set for the shadow