Bug 41339 - unicode-range property only with a descending range causes a crash
Summary: unicode-range property only with a descending range causes a crash
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-06-29 03:01 PDT by Yuzo Fujishima
Modified: 2010-06-29 23:47 PDT (History)
3 users (show)

See Also:


Attachments
Testcase -- causes a crash (461 bytes, text/html)
2010-06-29 03:01 PDT, Yuzo Fujishima
no flags Details
Fix for Bug 41339 - unicode-range property only with a descending range causes (4.34 KB, patch)
2010-06-29 04:42 PDT, Yuzo Fujishima
no flags Details | Formatted Diff | Diff
Addressed review comment. Test by JavaScript. (4.53 KB, patch)
2010-06-29 23:00 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-06-29 03:01:10 PDT
http://dev.w3.org/csswg/css3-fonts/#unicode-range-desc says:
    ... interval ranges that descend (e.g. U+400-32f) are invalid and omitted rather than treated as parse errors
    ... Without any valid ranges, the descriptor is omitted.

It follows that in the following example unicode-range must be omitted:
    @font-face {
        font-family: 'myfont';
        src: local('Arial');
        unicode-range: U+062-60;
    }

But as of r62096, opening a file containing the above rule results in a crash.
Comment 1 Yuzo Fujishima 2010-06-29 03:01:55 PDT
Created attachment 59998 [details]
Testcase -- causes a crash
Comment 2 Yuzo Fujishima 2010-06-29 04:42:31 PDT
Created attachment 60007 [details]
Fix for Bug 41339 - unicode-range property only with a descending range causes
Comment 3 mitz 2010-06-29 08:19:51 PDT
Comment on attachment 60007 [details]
Fix for Bug 41339 - unicode-range property only with a descending range causes

Can this be tested with a text-only test using getComputedStyle or the CSSOM?
Comment 4 Yuzo Fujishima 2010-06-29 23:00:25 PDT
Created attachment 60086 [details]
Addressed review comment. Test by JavaScript.
Comment 5 Yuzo Fujishima 2010-06-29 23:05:29 PDT
Hi, mitz,

Thank you for the review.

(In reply to comment #3)
> (From update of attachment 60007 [details])
> Can this be tested with a text-only test using getComputedStyle or the CSSOM?

I tried but I couldn't find a way to retrieve the actual font name.
(I can get 'myfont' but not 'Arial' in the above example).

Instead, I used a monospace font and compare the width of two spans.
I believe it is good enough for this test.
Comment 6 mitz 2010-06-29 23:11:08 PDT
(In reply to comment #5)
> Hi, mitz,
> 
> Thank you for the review.
> 
> (In reply to comment #3)
> > (From update of attachment 60007 [details] [details])
> > Can this be tested with a text-only test using getComputedStyle or the CSSOM?
> 
> I tried but I couldn't find a way to retrieve the actual font name.
> (I can get 'myfont' but not 'Arial' in the above example).

What I meant was to test the value of documents.styleSheets[0].rules[0].style.unicodeRange, but it looks like there’s insufficient support for unicodeRange values in WebKit’s CSSOM implementation.
Comment 7 Yuzo Fujishima 2010-06-29 23:47:43 PDT
Committed r62161: <http://trac.webkit.org/changeset/62161>