Source/WebCore/ChangeLog

 12011-06-02 MustafizurRahaman <mustaf.here@gmail.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 HTML5 Conformance Test failure: approved/canvas/canvas_text_font_001.htm
 6 https://bugs.webkit.org/show_bug.cgi?id=48578
 7
 8 While setting font for HTML Canvas, checking for "inherit" & "initial"
 9 & if font string contains "inherit", returning without assigning new font value
 10
 11 Test: fast/canvas/canvas-text-inherit.html
 12
 13 * html/canvas/CanvasRenderingContext2D.cpp:
 14 (WebCore::CanvasRenderingContext2D::setFont):
 15
1162011-06-02 Piroska AndrĂ¡s <Piroska.Andras@stud.u-szeged.hu>
217
318 Rubber-stamped by Gabor Loki.
87884

Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

@@String CanvasRenderingContext2D::font()
17971797
17981798void CanvasRenderingContext2D::setFont(const String& newFont)
17991799{
 1800 if (newFont.contains("inherit", false) || newFont.contains("initial", false))
 1801 return;
 1802
18001803 RefPtr<CSSMutableStyleDeclaration> tempDecl = CSSMutableStyleDeclaration::create();
18011804 CSSParser parser(!m_usesCSSCompatibilityParseMode);
18021805
87836

LayoutTests/ChangeLog

 12011-06-02 MustafizurRahaman <mustaf.here@gmail.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 HTML5 Conformance Test failure: approved/canvas/canvas_text_font_001.htm
 6 https://bugs.webkit.org/show_bug.cgi?id=48578
 7
 8 * fast/canvas/canvas-text-inherit-expected.txt: Added.
 9 * fast/canvas/canvas-text-inherit.html: Added.
 10
1112011-06-02 Yuta Kitamura <yutak@chromium.org>
212
313 Reviewed by Kent Tamura.
87884

LayoutTests/fast/canvas/canvas-text-inherit-expected.txt

 1Tests for border attribute with Object tag
 2Bug 48578 : HTML5 Conformance Test failure: approved/canvas/canvas_text_font_001.htm
 3
 4Test passes if All strings are identical in both size, style, and text.
 5
 6TEST COMPLETE
 7
0

LayoutTests/fast/canvas/canvas-text-inherit.html

 1<!doctype HTML>
 2<html>
 3 <head>
 4 <title>HTML5 Canvas Test: Ignore property-independent style sheet syntax "inherit" in Text</title>
 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com" />
 6 <link rel="help" href="http://www.w3.org/TR/2dcontext/#dom-context-2d-font" />
 7 <meta name="assert" content=": Ignore 'inherit' property-independent style sheet syntax without assigning a new font value." />
 8 <script type="text/javascript">
 9 function runTest()
 10 {
 11 var canvas = document.getElementById("canvas1");
 12 var ctx = canvas.getContext("2d");
 13
 14 // Assign a valid font.
 15 ctx.font = "40px Times New Roman";
 16
 17 // Assign property-independent style sheet syntax 'inherit' as font.
 18 ctx.font = "20px inherit";
 19 ctx.fillText("Test String", 5, 50);
 20
 21 // Assign property-independent style sheet syntax 'inherit' as font.
 22 ctx.font = "inherit";
 23 ctx.fillText("Test String", 5, 100);
 24
 25 // Assign property-independent style sheet syntax 'inherit' as font.
 26 ctx.font = "INHERIT";
 27 ctx.fillText("Test String", 5, 150);
 28
 29 // Assign property-independent style sheet syntax 'inherit' as font.
 30 ctx.font = "inherit 20px";
 31 ctx.fillText("Test String", 5, 200);
 32
 33 // Assign property-independent style sheet syntax 'inherit' as font.
 34 ctx.font = "Inheritance 20px";
 35 ctx.fillText("Test String", 5, 250);
 36
 37 // Assign a valid font which was used earlier.
 38 ctx.font = "40px Times New Roman";
 39 ctx.fillText("Test String", 5, 300);
 40 }
 41 </script>
 42 </head>
 43
 44 <body onload="runTest()">
 45 <p>Description: Ignore "inherit" property-independent style sheet syntax without assigning a new font value.</p>
 46 <p>Test passes if All strings are identical in both size, style, and text.</p>
 47 <canvas id="canvas1" width="300" height="400">Browser does not support HTML5 Canvas.</canvas>
 48 </body>
 49</html>
0