webfontloader 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/lib/webfontloader.rb +1 -1
- data/src-test/core/useragenttest.js +16 -0
- data/src/core/useragentparser.js +2 -2
- data/webfontloader.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
v1.0.25 (February 7, 2012)
|
2
|
+
* Updated the user agent parser to recognize Chrome for Android properly as a Chrome browser.
|
3
|
+
|
1
4
|
v1.0.24 (January 9, 2012)
|
2
5
|
* Updated the standard test string from "BESs" to "BESbswy" for more width variability.
|
3
6
|
* Improved Google's custom FontWatchRunner implementation for Webkit to work around an issue where the browser reports the 400 weight's width when it is already loaded.
|
data/lib/webfontloader.rb
CHANGED
@@ -165,6 +165,22 @@ UserAgentTest.prototype.testBrowserIsAndroid = function() {
|
|
165
165
|
assertTrue(userAgent.isSupportingWebFont());
|
166
166
|
};
|
167
167
|
|
168
|
+
UserAgentTest.prototype.testBrowserIsAndroidChromeMobile = function() {
|
169
|
+
var userAgentParser = new webfont.UserAgentParser(
|
170
|
+
"Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Nexus S Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7",
|
171
|
+
this.defaultDocument_);
|
172
|
+
var userAgent = userAgentParser.parse();
|
173
|
+
|
174
|
+
assertEquals("Chrome", userAgent.getName());
|
175
|
+
assertEquals("16.0.912.75", userAgent.getVersion());
|
176
|
+
assertEquals("Android", userAgent.getPlatform());
|
177
|
+
assertEquals("4.0.3", userAgent.getPlatformVersion());
|
178
|
+
assertEquals("AppleWebKit", userAgent.getEngine());
|
179
|
+
assertEquals("535.7", userAgent.getEngineVersion());
|
180
|
+
assertEquals(undefined, userAgent.getDocumentMode());
|
181
|
+
assertTrue(userAgent.isSupportingWebFont());
|
182
|
+
};
|
183
|
+
|
168
184
|
UserAgentTest.prototype.testBrowserIsFirefoxLettersVersion = function() {
|
169
185
|
var userAgentParser = new webfont.UserAgentParser(
|
170
186
|
"Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.9.2a1pre) Gecko/20090405 Ubuntu/9.04 (jaunty) Firefox/3.6a1pre",
|
data/src/core/useragentparser.js
CHANGED
@@ -195,7 +195,7 @@ webfont.UserAgentParser.prototype.parseWebKitUserAgentString_ = function() {
|
|
195
195
|
}
|
196
196
|
var name = webfont.UserAgentParser.UNKNOWN;
|
197
197
|
|
198
|
-
if (this.userAgent_.indexOf("Chrome") != -1) {
|
198
|
+
if (this.userAgent_.indexOf("Chrome") != -1 || this.userAgent_.indexOf("CrMo") != -1) {
|
199
199
|
name = "Chrome";
|
200
200
|
} else if (this.userAgent_.indexOf("Safari") != -1) {
|
201
201
|
name = "Safari";
|
@@ -209,7 +209,7 @@ webfont.UserAgentParser.prototype.parseWebKitUserAgentString_ = function() {
|
|
209
209
|
/Version\/([\d\.\w]+)/, 1);
|
210
210
|
} else if (name == "Chrome") {
|
211
211
|
version = this.getMatchingGroup_(this.userAgent_,
|
212
|
-
/Chrome\/([\d\.]+)/,
|
212
|
+
/(Chrome|CrMo)\/([\d\.]+)/, 2);
|
213
213
|
} else if (name == "AdobeAIR") {
|
214
214
|
version = this.getMatchingGroup_(this.userAgent_,
|
215
215
|
/AdobeAIR\/([\d\.]+)/, 1);
|
data/webfontloader.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'webfontloader'
|
16
|
-
s.version = '1.0.
|
17
|
-
s.date = '2012-
|
16
|
+
s.version = '1.0.25'
|
17
|
+
s.date = '2012-02-07'
|
18
18
|
|
19
19
|
## Make sure your summary is short. The description may be as long
|
20
20
|
## as you like.
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webfontloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 25
|
10
|
+
version: 1.0.25
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Carver
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
19
|
+
date: 2012-02-07 00:00:00 -08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|