Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unicode-range test #1062

Merged
merged 1 commit into from
Jan 6, 2014
Merged

Conversation

patrickkettner
Copy link
Member

fixes #1058

This test embeds a base64'd truetype font with two characters, the <space> and m specifically, specifying the unicode-range to only use the <space> (U+002E) . It then creates four elements, two of each, one with the font and without, adds them to the DOM, and check their width. If the space changes width, and the m doesn't, then we have a winner.

@infojunkie
Copy link

Sounds great! I built your fork of Modernizr but when I run the tests through the web browser it only runs 97 tests, not including the new unicode-range one. How can I try it?

@patrickkettner
Copy link
Member Author

Sorry about that, I left out a key bit.
Try it now

@infojunkie
Copy link

Thanks. I can see the unicoderange property but it returns false even under
Chrome which does support unicode-range.

I've copied your test to a JSFiddle to see it visually, but I can't tell
the difference between the spans: http://jsfiddle.net/infojunkie/VufQU/1/ -
maybe I misunderstand the test!

On Sat, Oct 19, 2013 at 12:27 AM, patrick kettner
notifications@github.comwrote:

Sorry about that, I left out a key bit.
Try it now


Reply to this email directly or view it on GitHubhttps://github.com//pull/1062#issuecomment-26645226
.

@infojunkie
Copy link

I've looked at http://css3test.com/ to see how they detect unicode-range support. Seems to be a very different test, based on creating a dummy element, assigning a test style and checking whether its properties match the given test value. Since I'm a n00b at browser testing, I am just reporting that this test seems to work :-)

@patrickkettner
Copy link
Member Author

Man, im really sorry. This is embarrassing.
I had changed the test to the the . character, not the space.

updated test

That being said, after thinking about it at lunch, I was able to come up with a much simpler test that actually works.

I updated this pull accordingly.

RE: css3test, as it says up top

Caution: This test checks which CSS3 features the browser recognizes,
not whether they are implemented correctly.

I didn't actually dig into what they are doing, but I did see it fails in all IE, so its not 100%.

This test does seem to cover all browsers I can find accurately.

@infojunkie
Copy link

Thanks so much for updating the test! Works perfectly now.

On Sat, Oct 19, 2013 at 5:36 PM, patrick kettner
notifications@github.comwrote:

Man, im really sorry. This is embarrassing.
I had changed the test to the the . character, not the space.

updated test http://jsfiddle.net/VufQU/2/

That being said, after thinking about it at lunch, I was able to come up
wit ha much simpler test that actually works.

I updated this pull accordingly.

RE: css3test, as it says up top

Caution: This test checks which CSS3 features the browser recognizes,
not whether they are implemented correctly.

I didn't actually dig into what they are doing, but I did see it fails in
all IE, so its not 100%.

This test does seem to cover all browsers I can find accurately.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1062#issuecomment-26662180
.

@patrickkettner
Copy link
Member Author

@ryanseddon @stucox - how you livin?

@stucox
Copy link
Member

stucox commented Jan 6, 2014

LGTM.

I guess the only danger would be if Arial isn’t supported and it defaults to a monospace font (or at least one which has a . and m which are both the same width as Courier or whatever). Unlikely.

stucox pushed a commit that referenced this pull request Jan 6, 2014
@stucox stucox merged commit 7904e04 into Modernizr:master Jan 6, 2014
@patrickkettner patrickkettner deleted the unicode-range branch October 4, 2014 01:43
patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this pull request Feb 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect support for unicode-range?
3 participants