Bug 41509 - Ranges for @font-face unicode-range must be separated by commas
Summary: Ranges for @font-face unicode-range must be separated by commas
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yuzo Fujishima
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 00:24 PDT by Yuzo Fujishima
Modified: 2010-07-06 01:07 PDT (History)
8 users (show)

See Also:


Attachments
Fix for Bug 41509 - Multiple ranges for unicode-range causes parse error (5.94 KB, patch)
2010-07-02 01:04 PDT, Yuzo Fujishima
no flags Details | Formatted Diff | Diff
Make operator checking more strict. (14.14 KB, patch)
2010-07-04 23:46 PDT, Yuzo Fujishima
no flags Details | Formatted Diff | Diff
Also fixed LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css (15.16 KB, patch)
2010-07-05 19:05 PDT, Yuzo Fujishima
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuzo Fujishima 2010-07-02 00:24:46 PDT
http://dev.w3.org/csswg/css3-fonts/#unicode-range-desc says that multiple ranges separated by commas can be specified for unicode-range descriptor.

But as of r62335, WebKit considers such unicode-range as invalid.

For example,

@font-face {
    font-family:myfont;
    src: local('Courier');
    unicode-range: u+69, u+6a; /* 'i' and 'j' */
}

is erroneously treated as if it were

@font-face {
    font-family:myfont;
    src: local('Courier');
}
Comment 1 Yuzo Fujishima 2010-07-02 01:04:00 PDT
Created attachment 60346 [details]
Fix for Bug 41509 - Multiple ranges for unicode-range causes parse error
Comment 2 mitz 2010-07-02 08:02:47 PDT
Comment on attachment 60346 [details]
Fix for Bug 41509 - Multiple ranges for unicode-range causes parse error

Isn't this going to allow multiple consecutive commas, only commas, and no commas? The working draft doesn't appear to allow any of these.
Comment 3 mitz 2010-07-02 08:05:01 PDT
I think the title and the description of the bug are wrong. WebKit currently supports space-separated lists of ranges, but the WD calls for comma separation.
Comment 4 Yuzo Fujishima 2010-07-04 23:46:20 PDT
Created attachment 60496 [details]
Make operator checking more strict.
Comment 5 Yuzo Fujishima 2010-07-04 23:49:25 PDT
Hi, mitz,

Thank you for the review.

I've:
- made the operator checking stricter
- added tests
- corrected existing tests that use space-separated ranges
- changed the bug's title.
Comment 6 mitz 2010-07-05 11:26:15 PDT
There are a couple more layout tests that use the old space-separated syntax:

fast/text/international/resources/Mac-compatible-font-fallback.css
platform/win/svg/W3C-SVG-1.1/resources/Mac-compatible-font-fallback.css
platform/win/css2.1/resources/Mac-compatible-font-fallback.css
Comment 7 Yuzo Fujishima 2010-07-05 19:05:39 PDT
Created attachment 60575 [details]
Also fixed LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css
Comment 8 Yuzo Fujishima 2010-07-05 19:11:42 PDT
Hi, Thank you for the review.

(In reply to comment #6)
> There are a couple more layout tests that use the old space-separated syntax:
> 
> fast/text/international/resources/Mac-compatible-font-fallback.css
> platform/win/svg/W3C-SVG-1.1/resources/Mac-compatible-font-fallback.css

These don't contain space-separated values, do they?

> platform/win/css2.1/resources/Mac-compatible-font-fallback.css

Fixed this.

I've grep'ed all the files under LayoutTests as follows and found no others.

$ find LayoutTests | xargs grep -i 'unicode-range.*u+[^;,]*  *u'
LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range.html:    unicode-range: u+69 u+6a ; /* 'i' and 'j' */
Comment 9 Yuzo Fujishima 2010-07-06 00:09:46 PDT
Committed r62530: <http://trac.webkit.org/changeset/62530>
Comment 10 Eric Seidel (no email) 2010-07-06 00:13:13 PDT
I wonder if this affects <svg::font-face> and if we need further testing for such.
Comment 11 WebKit Review Bot 2010-07-06 01:07:54 PDT
http://trac.webkit.org/changeset/62530 might have broken Qt Linux Release