Skip to content

Commit 6f807d8

Browse files
Yi Xuchromium-wpt-export-bot
Yi Xu
authored andcommitted
Fix test 2d.text.draw.baseline.ideographic.html
The ideographic baseline is defined as follows: https://drafts.csswg.org/css-writing-modes-4/#line-under: the line-relative “bottom” or descender side. (The side underlines are typically drawn on.) I attached result here: https://bugs.chromium.org/p/chromium/issues/detail?id=1066953#c14 (It's with font 50 and draw at height 50) I think this test case is wrong: The test case draws text at ideographic under baseline at height 31.25, so that text is draw above 31.25 and leaves 31.25 to 50 to be at its original color (red for test). The test tests if the resulting rect, rect(0, 0, 50, 100), to be all green. I think the test needs to know the location of the green rectangle and move it down. The test is updated. Bug: 1066953 Change-Id: I2b9c029a439fd8a19343dc826b70b1bc1c95b60e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4615191 Commit-Queue: Yi Xu <[email protected]> Reviewed-by: Justin Novosad <[email protected]> Cr-Commit-Position: refs/heads/main@{#1158349}
1 parent 435846e commit 6f807d8

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

html/canvas/element/text-styles/2d.text.draw.baseline.ideographic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1>2d.text.draw.baseline.ideographic</h1>
3333
ctx.fillRect(0, 0, 100, 50);
3434
ctx.fillStyle = '#0f0';
3535
ctx.textBaseline = 'ideographic';
36-
ctx.fillText('CC', 0, 31.25);
36+
ctx.fillText('CC', 0, 81.25);
3737
_assertPixelApprox(canvas, 5,5, 0,255,0,255, 2);
3838
_assertPixelApprox(canvas, 95,5, 0,255,0,255, 2);
3939
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);

html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h1>2d.text.draw.baseline.ideographic</h1>
3030
ctx.fillRect(0, 0, 100, 50);
3131
ctx.fillStyle = '#0f0';
3232
ctx.textBaseline = 'ideographic';
33-
ctx.fillText('CC', 0, 31.25);
33+
ctx.fillText('CC', 0, 81.25);
3434
_assertPixelApprox(canvas, 5,5, 0,255,0,255, 2);
3535
_assertPixelApprox(canvas, 95,5, 0,255,0,255, 2);
3636
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);

html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ t.step(function() {
2626
ctx.fillRect(0, 0, 100, 50);
2727
ctx.fillStyle = '#0f0';
2828
ctx.textBaseline = 'ideographic';
29-
ctx.fillText('CC', 0, 31.25);
29+
ctx.fillText('CC', 0, 81.25);
3030
_assertPixelApprox(canvas, 5,5, 0,255,0,255, 2);
3131
_assertPixelApprox(canvas, 95,5, 0,255,0,255, 2);
3232
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);

html/canvas/tools/yaml/element/text-styles.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
ctx.fillRect(0, 0, 100, 50);
297297
ctx.fillStyle = '#0f0';
298298
ctx.textBaseline = 'ideographic';
299-
ctx.fillText('CC', 0, 31.25);
299+
ctx.fillText('CC', 0, 81.25);
300300
@assert pixel 5,5 ==~ 0,255,0,255;
301301
@assert pixel 95,5 ==~ 0,255,0,255;
302302
@assert pixel 25,25 ==~ 0,255,0,255;

html/canvas/tools/yaml/offscreen/text.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@
614614
ctx.fillRect(0, 0, 100, 50);
615615
ctx.fillStyle = '#0f0';
616616
ctx.textBaseline = 'ideographic';
617-
ctx.fillText('CC', 0, 31.25);
617+
ctx.fillText('CC', 0, 81.25);
618618
@assert pixel 5,5 ==~ 0,255,0,255;
619619
@assert pixel 95,5 ==~ 0,255,0,255;
620620
@assert pixel 25,25 ==~ 0,255,0,255;

0 commit comments

Comments
 (0)