Bug 119567
| Summary: | LayoutTests/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html is against the spec | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Rashmi Shyamasundar <rashmi.s2> |
| Component: | Canvas | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | ap, bfulgham, cdumez, ian, krit, mrobinson, rashmi.shyam |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Rashmi Shyamasundar
The layout test - LayoutTests/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html, is against the spec.
According to the below points in spec :-
1. http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#text-preparation-algorithm
2. http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#space-character
Only 4 space characters listed below should be replaced with U+0020
1. U+0009
2. U+000A
3. U+000C
4. U+000D
But, this test case is expecting that U+000B should also be replaced with U+0020.
Currently this test case passing on WebKit, since we are replacing U+000B with U+0020. So, both the implementation and the test case needs to be corrected.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Rashmi Shyamasundar
I am trying to fix the implementation as part of patch to the bug -
https://bugs.webkit.org/show_bug.cgi?id=108881
Rashmi Shyamasundar
There is a bug on W3C for the same test case :-
https://www.w3.org/Bugs/Public/show_bug.cgi?id=15925
And, the proposed patch in this W3C bug is to :-
replace the line
"ctx.fillText('E\x0b EE', -150, 37.5);"
with
"ctx.fillText('E\x0b EE', -100, 37.5);"
Chris Dumez
How do other browsers (Firefox 23 / IE10) behave?
Chris Dumez
(In reply to comment #3)
> How do other browsers (Firefox 23 / IE10) behave?
The test passes on Firefox 23, WebKit and Blink.
It fails on IE10 but apparently due to lack of support:
"Aborted with exception: Object doesn't support property or method 'getContext'"
So it seems Chrome / Safari / Firefox and currently in sync. I would not change our behavior despite what the specification says.
Rashmi Shyamasundar
According to this draft spec - http://www.w3.org/html/wg/drafts/html/master/single-page.html#space-character , U+000B is an undefined Unicode character and its usage should result in a parse error.
Extracted from the above link :-
Any occurrences of any characters in the ranges U+0001 to U+0008, U+000E to U+001F, U+007F to U+009F, U+FDD0 to U+FDEF, and characters U+000B, U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, U+2FFFF, U+3FFFE, U+3FFFF, U+4FFFE, U+4FFFF, U+5FFFE, U+5FFFF, U+6FFFE, U+6FFFF, U+7FFFE, U+7FFFF, U+8FFFE, U+8FFFF, U+9FFFE, U+9FFFF, U+AFFFE, U+AFFFF, U+BFFFE, U+BFFFF, U+CFFFE, U+CFFFF, U+DFFFE, U+DFFFF, U+EFFFE, U+EFFFF, U+FFFFE, U+FFFFF, U+10FFFE, and U+10FFFF are parse errors. These are all control characters or permanently undefined Unicode characters (noncharacters).
Ian 'Hixie' Hickson
This test seems bogus to me -- how do you know what the font will draw U+000B as?
A better test would be something like comparing these two calls:
ctx.fillText("E \x0b E", ...
ctx.fillText("E E", ...
...to see if the two spaces collapse into one.
There should probably also be a separate test that checks the text in:
http://www.w3.org/TR/css3-text/#white-space-processing
...saying that control characters in general should be ignored...
Rashmi Shyamasundar
As discussed with Mr. Christophe Dumez :-
The test passes on Chrome / Safari and Firefox. Our behavior should be in sync with others, despite what the specification says.
Alexey Proskuryakov
We deleted this test suit from LayoutTests a while ago.
Alexey Proskuryakov
suite*