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

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 13:46:24 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit ed8bfe49e8f17d24fba1a0dab36c285f3bee30e6
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Sep 26 17:39:34 2010 +0000

    2010-09-26  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Dan Bernstein.
    
            Canvas: Crash when setting a font with size in 'ex' units
            https://bugs.webkit.org/show_bug.cgi?id=46538
    
            update() the style's font after setting the style's font description.
            Needed because CSSPrimitiveValue::computeLengthDouble() later assumes
            that the style's font is properly initialized (for xHeight().)
    
            Fixes crash on IE test center's canvas-text-font-002 test.
    
            * html/canvas/CanvasRenderingContext2D.cpp:
            (WebCore::CanvasRenderingContext2D::setFont):
    2010-09-26  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Dan Bernstein.
    
            Canvas: Crash when setting a font with size in 'ex' units
            https://bugs.webkit.org/show_bug.cgi?id=46538
    
            * fast/canvas/canvas-font-ex-units-crash-expected.txt: Added.
            * fast/canvas/canvas-font-ex-units-crash.html: Added.
            * fast/canvas/script-tests/canvas-font-ex-units-crash.js: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68343 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e6a84c4..0afedbc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-26  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Dan Bernstein.
+
+        Canvas: Crash when setting a font with size in 'ex' units
+        https://bugs.webkit.org/show_bug.cgi?id=46538
+
+        * fast/canvas/canvas-font-ex-units-crash-expected.txt: Added.
+        * fast/canvas/canvas-font-ex-units-crash.html: Added.
+        * fast/canvas/script-tests/canvas-font-ex-units-crash.js: Added.
+
 2010-09-26  Robert Hogan  <robert at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/LayoutTests/fast/canvas/canvas-font-ex-units-crash-expected.txt b/LayoutTests/fast/canvas/canvas-font-ex-units-crash-expected.txt
new file mode 100644
index 0000000..48309f4
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-font-ex-units-crash-expected.txt
@@ -0,0 +1,10 @@
+Test that setting a font with size in 'ex' units doesn't crash.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS ctx.font = '5ex sans-serif'; ctx.font is '5ex sans-serif'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/canvas-font-ex-units-crash.html b/LayoutTests/fast/canvas/canvas-font-ex-units-crash.html
new file mode 100644
index 0000000..91f9215
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-font-ex-units-crash.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/canvas-font-ex-units-crash.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-font-ex-units-crash.js b/LayoutTests/fast/canvas/script-tests/canvas-font-ex-units-crash.js
new file mode 100644
index 0000000..52018ed
--- /dev/null
+++ b/LayoutTests/fast/canvas/script-tests/canvas-font-ex-units-crash.js
@@ -0,0 +1,8 @@
+description("Test that setting a font with size in 'ex' units doesn't crash.");
+
+ctx = document.createElement('canvas').getContext('2d');
+
+ctx.font = "5ex sans-serif";
+shouldBe("ctx.font = '5ex sans-serif'; ctx.font", "'5ex sans-serif'");
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 18ccc28..2b316bd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-26  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Dan Bernstein.
+
+        Canvas: Crash when setting a font with size in 'ex' units
+        https://bugs.webkit.org/show_bug.cgi?id=46538
+
+        update() the style's font after setting the style's font description.
+        Needed because CSSPrimitiveValue::computeLengthDouble() later assumes
+        that the style's font is properly initialized (for xHeight().)
+
+        Fixes crash on IE test center's canvas-text-font-002 test.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::setFont):
+
 2010-09-26  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 134ab67..ab2d3ba 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -1690,8 +1690,10 @@ void CanvasRenderingContext2D::setFont(const String& newFont)
     // Map the <canvas> font into the text style. If the font uses keywords like larger/smaller, these will work
     // relative to the canvas.
     RefPtr<RenderStyle> newStyle = RenderStyle::create();
-    if (RenderStyle* computedStyle = canvas()->computedStyle())
+    if (RenderStyle* computedStyle = canvas()->computedStyle()) {
         newStyle->setFontDescription(computedStyle->fontDescription());
+        newStyle->font().update(newStyle->font().fontSelector());
+    }
 
     // Now map the font property into the style.
     CSSStyleSelector* styleSelector = canvas()->styleSelector();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list