jekyll-theme-hydejack 8.0.0 → 8.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -19
  3. data/_includes/body/analytics.html +16 -9
  4. data/_includes/body/comments.html +2 -4
  5. data/_includes/body/footer.html +1 -1
  6. data/_includes/body/menu.html +2 -2
  7. data/_includes/body/scripts.html +11 -3
  8. data/_includes/body/sidebar.html +1 -1
  9. data/_includes/components/hy-img.html +3 -3
  10. data/_includes/head/links.html +11 -9
  11. data/_includes/head/meta.html +1 -1
  12. data/_includes/head/page-style.html +2 -3
  13. data/_includes/head/scripts.html +15 -15
  14. data/_includes/head/styles.html +1 -1
  15. data/_includes/header.txt +1 -1
  16. data/_includes/my-comments.html +24 -0
  17. data/_includes/styles/inline.scss +24 -27
  18. data/_includes/styles/style.scss +27 -30
  19. data/_includes/templates/back.html +1 -1
  20. data/_includes/templates/index.html +2 -2
  21. data/_includes/templates/loading.html +1 -1
  22. data/_includes/templates/{cookies-banner.html → pro/cookies-banner.html} +2 -2
  23. data/_layouts/base.html +4 -4
  24. data/_layouts/compress.html +1 -1
  25. data/_sass/_mixins.scss +23 -12
  26. data/_sass/_syntax.scss +131 -67
  27. data/_sass/_variables.scss +4 -7
  28. data/_sass/hydejack/{__inline → __inline__}/_avatar.scss +1 -1
  29. data/_sass/hydejack/{__inline → __inline__}/_base.scss +2 -2
  30. data/_sass/hydejack/{__inline → __inline__}/_break-layout.scss +1 -1
  31. data/_sass/hydejack/{__inline → __inline__}/_content.scss +2 -2
  32. data/_sass/hydejack/{__inline → __inline__}/_footer.scss +1 -1
  33. data/_sass/hydejack/{__inline → __inline__}/_images.scss +2 -2
  34. data/_sass/hydejack/{__inline → __inline__}/_katex.scss +1 -1
  35. data/_sass/hydejack/{__inline → __inline__}/_links.scss +4 -4
  36. data/_sass/hydejack/{__link → __inline__}/_mark-external.scss +1 -1
  37. data/_sass/hydejack/{__inline → __inline__}/_menu.scss +18 -16
  38. data/_sass/hydejack/{__inline → __inline__}/_sidebar.scss +2 -2
  39. data/_sass/hydejack/{__inline → __inline__}/_social.scss +1 -1
  40. data/_sass/hydejack/{__inline → __inline__}/_utilities.scss +6 -3
  41. data/_sass/hydejack/{__link → __link__}/_avatar.scss +1 -1
  42. data/_sass/hydejack/{__link → __link__}/_base.scss +1 -1
  43. data/_sass/hydejack/{__link → __link__}/_break-layout.scss +1 -1
  44. data/_sass/hydejack/{__link → __link__}/_content.scss +1 -1
  45. data/_sass/hydejack/{__link → __link__}/_footer.scss +2 -2
  46. data/_sass/hydejack/{__link → __link__}/_images.scss +7 -5
  47. data/_sass/hydejack/{__link → __link__}/_katex.scss +6 -11
  48. data/_sass/hydejack/{__link → __link__}/_links.scss +5 -5
  49. data/_sass/hydejack/{__inline → __link__}/_mark-external.scss +1 -1
  50. data/_sass/hydejack/{__link → __link__}/_menu.scss +9 -16
  51. data/_sass/hydejack/{__link → __link__}/_sidebar.scss +1 -2
  52. data/_sass/hydejack/{__link → __link__}/_social.scss +1 -1
  53. data/_sass/hydejack/{__link → __link__}/_utilities.scss +6 -3
  54. data/_sass/hydejack/_base.pre.scss +1 -1
  55. data/_sass/hydejack/_content.pre.scss +1 -1
  56. data/_sass/hydejack/_footer.pre.scss +1 -1
  57. data/_sass/hydejack/_images.pre.scss +6 -4
  58. data/_sass/hydejack/_katex.pre.scss +5 -10
  59. data/_sass/hydejack/_links.pre.scss +4 -4
  60. data/_sass/hydejack/_menu.pre.scss +25 -30
  61. data/_sass/hydejack/_sidebar.pre.scss +1 -2
  62. data/_sass/hydejack/_utilities.pre.scss +5 -2
  63. data/_sass/my-style.scss +9 -0
  64. data/_sass/my-variables.scss +1 -23
  65. data/_sass/pooleparty/{__inline → __inline__}/_base.scss +6 -4
  66. data/_sass/pooleparty/{__inline → __inline__}/_code.scss +1 -1
  67. data/_sass/pooleparty/{__inline → __inline__}/_footer.scss +1 -1
  68. data/_sass/pooleparty/{__inline → __inline__}/_footnotes.scss +1 -1
  69. data/_sass/pooleparty/{__inline → __inline__}/_message.scss +4 -3
  70. data/_sass/pooleparty/{__inline → __inline__}/_pagination.scss +1 -1
  71. data/_sass/pooleparty/{__inline → __inline__}/_posts.scss +2 -2
  72. data/_sass/pooleparty/{__inline → __inline__}/_read-more.scss +1 -1
  73. data/_sass/pooleparty/{__inline → __inline__}/_related.scss +1 -1
  74. data/_sass/pooleparty/{__inline → __inline__}/_table.scss +3 -2
  75. data/_sass/pooleparty/{__inline → __inline__}/_type.scss +10 -6
  76. data/_sass/pooleparty/{__link → __link__}/_base.scss +1 -1
  77. data/_sass/pooleparty/{__link → __link__}/_code.scss +25 -12
  78. data/_sass/pooleparty/{__link → __link__}/_footer.scss +1 -1
  79. data/_sass/pooleparty/{__link → __link__}/_footnotes.scss +7 -6
  80. data/_sass/pooleparty/{__link → __link__}/_message.scss +1 -1
  81. data/_sass/pooleparty/{__link → __link__}/_pagination.scss +9 -6
  82. data/_sass/pooleparty/{__link → __link__}/_posts.scss +2 -2
  83. data/_sass/pooleparty/{__link → __link__}/_read-more.scss +1 -1
  84. data/_sass/pooleparty/{__link → __link__}/_related.scss +1 -1
  85. data/_sass/pooleparty/{__link → __link__}/_table.scss +13 -9
  86. data/_sass/pooleparty/{__link → __link__}/_type.scss +10 -9
  87. data/_sass/pooleparty/_base.pre.scss +5 -3
  88. data/_sass/pooleparty/_code.pre.scss +24 -11
  89. data/_sass/pooleparty/_footnotes.pre.scss +6 -5
  90. data/_sass/pooleparty/_message.pre.scss +3 -2
  91. data/_sass/pooleparty/_pagination.pre.scss +8 -5
  92. data/_sass/pooleparty/_posts.pre.scss +2 -2
  93. data/_sass/pooleparty/_table.pre.scss +14 -9
  94. data/_sass/pooleparty/_type.pre.scss +18 -13
  95. data/assets/css/{hydejack-8.0.0.css → hydejack-8.1.0.css} +0 -0
  96. data/assets/icomoon/fonts/icomoon.eot +0 -0
  97. data/assets/icomoon/fonts/icomoon.svg +3 -0
  98. data/assets/icomoon/fonts/icomoon.ttf +0 -0
  99. data/assets/icomoon/fonts/icomoon.woff +0 -0
  100. data/assets/icomoon/selection.json +91 -10
  101. data/assets/icomoon/style.css +14 -5
  102. data/assets/img/{COLOURlovers.com-Hydejack.png → blog/COLOURlovers.com-Hydejack.png} +0 -0
  103. data/assets/img/blog/blog-layout.jpg +0 -0
  104. data/assets/img/{caleb-george-old.jpg → blog/caleb-george-old.jpg} +0 -0
  105. data/assets/img/{caleb-george.jpg → blog/caleb-george.jpg} +0 -0
  106. data/assets/img/blog/cover-page.jpg +0 -0
  107. data/assets/img/blog/dark-mode.jpg +0 -0
  108. data/assets/img/{example-content-ii.jpg → blog/example-content-ii.jpg} +0 -0
  109. data/assets/img/{example-content-iii.jpg → blog/example-content-iii.jpg} +0 -0
  110. data/assets/img/blog/hydejack-8.png +0 -0
  111. data/assets/img/blog/hydejack-8@0,25x.png +0 -0
  112. data/assets/img/blog/hydejack-8@0,5x.png +0 -0
  113. data/assets/img/blog/lazy-images.jpg +0 -0
  114. data/assets/img/blog/resume.png +0 -0
  115. data/assets/img/blog/w3m.png +0 -0
  116. data/assets/js/hydejack-8.1.0.js +46 -0
  117. data/assets/js/sw.js +3 -3
  118. data/assets/version.json +1 -1
  119. data/assets/video/blog-layout.mp4 +0 -0
  120. data/assets/video/cover-page.mp4 +0 -0
  121. data/assets/video/dark-mode.mp4 +0 -0
  122. data/assets/video/lazy-images.mp4 +0 -0
  123. metadata +72 -76
  124. data/assets/bower_components/fontfaceobserver/test/assets/index.html +0 -8
  125. data/assets/bower_components/fontfaceobserver/test/assets/late.css +0 -1
  126. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.eot +0 -0
  127. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.ttf +0 -0
  128. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.woff +0 -0
  129. data/assets/bower_components/fontfaceobserver/test/assets/subset.eot +0 -0
  130. data/assets/bower_components/fontfaceobserver/test/assets/subset.ttf +0 -0
  131. data/assets/bower_components/fontfaceobserver/test/assets/subset.woff +0 -0
  132. data/assets/bower_components/fontfaceobserver/test/deps.js +0 -5
  133. data/assets/bower_components/fontfaceobserver/test/index.html +0 -97
  134. data/assets/bower_components/fontfaceobserver/test/observer-test.js +0 -465
  135. data/assets/bower_components/fontfaceobserver/test/ruler-test.js +0 -112
  136. data/assets/img/default-1.jpg +0 -0
  137. data/assets/img/hydejack-8.jpg +0 -0
  138. data/assets/img/hydejack-8@0,25x.jpg +0 -0
  139. data/assets/img/hydejack-8@0,5x.jpg +0 -0
  140. data/assets/img/resume.png +0 -0
  141. data/assets/img/w3m.png +0 -0
  142. data/assets/js/hydejack-8.0.0.js +0 -46
@@ -1,465 +0,0 @@
1
- describe('Observer', function () {
2
- var Observer = fontface.Observer,
3
- Ruler = fontface.Ruler;
4
-
5
- describe('#constructor', function () {
6
- it('creates a new instance with the correct signature', function () {
7
- var observer = new Observer('my family', {});
8
- expect(observer, 'not to be', null);
9
- expect(observer.load, 'to be a function');
10
- });
11
-
12
- it('parses descriptors', function () {
13
- var observer = new Observer('my family', {
14
- weight: 'bold'
15
- });
16
-
17
- expect(observer.family, 'to equal', 'my family');
18
- expect(observer.weight, 'to equal', 'bold');
19
- });
20
-
21
- it('defaults descriptors that are not given', function () {
22
- var observer = new Observer('my family', {
23
- weight: 'bold'
24
- });
25
-
26
- expect(observer.style, 'to equal', 'normal');
27
- });
28
- });
29
-
30
- describe('#getStyle', function () {
31
- it('creates the correct default style', function () {
32
- var observer = new Observer('my family', {});
33
-
34
- if (Observer.supportStretch()) {
35
- expect(observer.getStyle('sans-serif'), 'to equal', 'normal normal normal 100px sans-serif');
36
- } else {
37
- expect(observer.getStyle('sans-serif'), 'to equal', 'normal normal 100px sans-serif');
38
- }
39
- });
40
-
41
- it('passes through all descriptors', function () {
42
- var observer = new Observer('my family', {
43
- style: 'italic',
44
- weight: 'bold',
45
- stretch: 'condensed'
46
- });
47
-
48
- if (Observer.supportStretch()) {
49
- expect(observer.getStyle('sans-serif'), 'to equal', 'italic bold condensed 100px sans-serif');
50
- } else {
51
- expect(observer.getStyle('sans-serif'), 'to equal', 'italic bold 100px sans-serif');
52
- }
53
- });
54
- });
55
-
56
- describe('#load', function () {
57
- this.timeout(5000);
58
-
59
- it('finds a font and resolve the promise', function (done) {
60
- var observer = new Observer('observer-test1', {}),
61
- ruler = new Ruler('hello');
62
-
63
- document.body.appendChild(ruler.getElement());
64
-
65
- ruler.setFont('monospace', '');
66
- var beforeWidth = ruler.getWidth();
67
-
68
- ruler.setFont('100px observer-test1, monospace');
69
- observer.load(null, 5000).then(function () {
70
- var activeWidth = ruler.getWidth();
71
-
72
- expect(activeWidth, 'not to equal', beforeWidth);
73
-
74
- setTimeout(function () {
75
- var afterWidth = ruler.getWidth();
76
-
77
- expect(afterWidth, 'to equal', activeWidth);
78
- expect(afterWidth, 'not to equal', beforeWidth);
79
- document.body.removeChild(ruler.getElement());
80
- done();
81
- }, 0);
82
- }, function () {
83
- done(new Error('Timeout'));
84
- });
85
- });
86
-
87
- it('finds a font and resolves the promise even though the @font-face rule is not in the CSSOM yet', function (done) {
88
- var observer = new Observer('observer-test9', {}),
89
- ruler = new Ruler('hello');
90
-
91
- document.body.appendChild(ruler.getElement());
92
-
93
- ruler.setFont('monospace', '');
94
- var beforeWidth = ruler.getWidth();
95
-
96
- ruler.setFont('100px observer-test9, monospace');
97
- observer.load(null, 10000).then(function () {
98
- var activeWidth = ruler.getWidth();
99
-
100
- expect(activeWidth, 'not to equal', beforeWidth);
101
-
102
- setTimeout(function () {
103
- var afterWidth = ruler.getWidth();
104
-
105
- expect(afterWidth, 'to equal', activeWidth);
106
- expect(afterWidth, 'not to equal', beforeWidth);
107
- document.body.removeChild(ruler.getElement());
108
- done();
109
- }, 0);
110
- }, function () {
111
- done(new Error('Timeout'));
112
- });
113
-
114
- // We don't use a style element here because IE9/10 have issues with
115
- // dynamically inserted @font-face rules.
116
- var link = document.createElement('link');
117
-
118
- link.rel = 'stylesheet';
119
- link.href = 'assets/late.css';
120
-
121
- document.head.appendChild(link);
122
- });
123
-
124
- it('finds a font and resolve the promise even when the page is RTL', function (done) {
125
- var observer = new Observer('observer-test8', {}),
126
- ruler = new Ruler('hello');
127
-
128
- document.body.dir = 'rtl';
129
- document.body.appendChild(ruler.getElement());
130
-
131
- ruler.setFont('monospace', '');
132
- var beforeWidth = ruler.getWidth();
133
-
134
- ruler.setFont('100px observer-test1, monospace');
135
- observer.load(null, 5000).then(function () {
136
- var activeWidth = ruler.getWidth();
137
-
138
- expect(activeWidth, 'not to equal', beforeWidth);
139
-
140
- setTimeout(function () {
141
- var afterWidth = ruler.getWidth();
142
-
143
- expect(afterWidth, 'to equal', activeWidth);
144
- expect(afterWidth, 'not to equal', beforeWidth);
145
- document.body.removeChild(ruler.getElement());
146
- document.body.dir = 'ltr';
147
- done();
148
- }, 0);
149
- }, function () {
150
- done(new Error('Timeout'));
151
- });
152
- });
153
-
154
-
155
- it('finds a font with spaces in the name and resolve the promise', function (done) {
156
- var observer = new Observer('Trebuchet W01 Regular', {}),
157
- ruler = new Ruler('hello');
158
-
159
- document.body.appendChild(ruler.getElement());
160
-
161
- ruler.setFont('100px monospace');
162
- var beforeWidth = ruler.getWidth();
163
-
164
- ruler.setFont('100px "Trebuchet W01 Regular", monospace');
165
- observer.load(null, 5000).then(function () {
166
- var activeWidth = ruler.getWidth();
167
-
168
- expect(activeWidth, 'not to equal', beforeWidth);
169
-
170
- setTimeout(function () {
171
- var afterWidth = ruler.getWidth();
172
-
173
- expect(afterWidth, 'to equal', activeWidth);
174
- expect(afterWidth, 'not to equal', beforeWidth);
175
- document.body.removeChild(ruler.getElement());
176
- done();
177
- }, 0);
178
- }, function () {
179
- done(new Error('Timeout'));
180
- });
181
- });
182
-
183
- it('loads a font with spaces and numbers in the name and resolve the promise', function (done) {
184
- var observer = new Observer('Neue Frutiger 1450 W04', {}),
185
- ruler = new Ruler('hello');
186
-
187
- document.body.appendChild(ruler.getElement());
188
-
189
- ruler.setFont('100px monospace');
190
- var beforeWidth = ruler.getWidth();
191
-
192
- ruler.setFont('100px "Neue Frutiger 1450 W04", monospace');
193
- observer.load(null, 5000).then(function () {
194
- var activeWidth = ruler.getWidth();
195
-
196
- expect(activeWidth, 'not to equal', beforeWidth);
197
-
198
- setTimeout(function () {
199
- var afterWidth = ruler.getWidth();
200
-
201
- expect(afterWidth, 'to equal', activeWidth);
202
- expect(afterWidth, 'not to equal', beforeWidth);
203
- document.body.removeChild(ruler.getElement());
204
- done();
205
- }, 0);
206
- }, function () {
207
- done(new Error('Timeout'));
208
- });
209
- });
210
-
211
- it('fails to find a font and reject the promise', function (done) {
212
- var observer = new Observer('observer-test2', {});
213
-
214
- observer.load(null, 50).then(function () {
215
- done(new Error('Should not resolve'));
216
- }, function () {
217
- done();
218
- });
219
- });
220
-
221
- it('finds the font even if it is already loaded', function (done) {
222
- var observer = new Observer('observer-test3', {});
223
-
224
- observer.load(null, 5000).then(function () {
225
- observer.load(null, 5000).then(function () {
226
- done();
227
- }, function () {
228
- done(new Error('Second call failed'));
229
- });
230
- }, function () {
231
- done(new Error('Timeout'));
232
- });
233
- });
234
-
235
- it('finds a font with a custom unicode range within ASCII', function (done) {
236
- var observer = new Observer('observer-test4', {}),
237
- ruler = new Ruler('\u0021');
238
-
239
- ruler.setFont('monospace', '');
240
- document.body.appendChild(ruler.getElement());
241
-
242
- var beforeWidth = ruler.getWidth();
243
-
244
- ruler.setFont('100px observer-test4,monospace');
245
-
246
- observer.load('\u0021', 5000).then(function () {
247
- var activeWidth = ruler.getWidth();
248
-
249
- expect(activeWidth, 'not to equal', beforeWidth);
250
-
251
- setTimeout(function () {
252
- var afterWidth = ruler.getWidth();
253
-
254
- expect(afterWidth, 'to equal', activeWidth);
255
- expect(afterWidth, 'not to equal', beforeWidth);
256
-
257
- document.body.removeChild(ruler.getElement());
258
- done();
259
- }, 0);
260
- }, function () {
261
- done(new Error('Timeout'));
262
- });
263
- });
264
-
265
- it('finds a font with a custom unicode range outside ASCII (but within BMP)', function (done) {
266
- var observer = new Observer('observer-test5', {}),
267
- ruler = new Ruler('\u4e2d\u56fd');
268
-
269
- ruler.setFont('100px monospace');
270
- document.body.appendChild(ruler.getElement());
271
-
272
- var beforeWidth = ruler.getWidth();
273
-
274
- ruler.setFont('100px observer-test5,monospace');
275
-
276
- observer.load('\u4e2d\u56fd', 5000).then(function () {
277
- var activeWidth = ruler.getWidth();
278
-
279
- expect(activeWidth, 'not to equal', beforeWidth);
280
-
281
- setTimeout(function () {
282
- var afterWidth = ruler.getWidth();
283
-
284
- expect(afterWidth, 'to equal', activeWidth);
285
- expect(afterWidth, 'not to equal', beforeWidth);
286
-
287
- document.body.removeChild(ruler.getElement());
288
-
289
- done();
290
- }, 0);
291
- }, function () {
292
- done(new Error('Timeout'));
293
- });
294
- });
295
-
296
- it('finds a font with a custom unicode range outside the BMP', function (done) {
297
- var observer = new Observer('observer-test6', {}),
298
- ruler = new Ruler('\udbff\udfff');
299
-
300
- ruler.setFont('100px monospace');
301
- document.body.appendChild(ruler.getElement());
302
-
303
- var beforeWidth = ruler.getWidth();
304
-
305
- ruler.setFont('100px observer-test6,monospace');
306
-
307
- observer.load('\udbff\udfff', 5000).then(function () {
308
- var activeWidth = ruler.getWidth();
309
-
310
- expect(activeWidth, 'not to equal', beforeWidth);
311
-
312
- setTimeout(function () {
313
- var afterWidth = ruler.getWidth();
314
-
315
- expect(afterWidth, 'to equal', activeWidth);
316
- expect(afterWidth, 'not to equal', beforeWidth);
317
-
318
- document.body.removeChild(ruler.getElement());
319
-
320
- done();
321
- }, 0);
322
- }, function () {
323
- done(new Error('Timeout'));
324
- });
325
- });
326
-
327
- it('fails to find the font if it is available but does not contain the test string', function (done) {
328
- var observer = new Observer('observer-test7', {});
329
-
330
- observer.load(null, 50).then(function () {
331
- done(new Error('Should not be called'));
332
- }, function () {
333
- done();
334
- });
335
- });
336
-
337
- xit('finds a locally installed font', function (done) {
338
- var observer = new Observer('sans-serif', {});
339
-
340
- observer.load(null, 50).then(function () {
341
- done();
342
- }, function () {
343
- done(new Error('Did not detect local font'));
344
- });
345
- });
346
-
347
- xit('finds a locally installed font with the same metrics as the a fallback font (on OS X)', function (done) {
348
- var observer = new Observer('serif', {});
349
-
350
- observer.load(null, 50).then(function () {
351
- done();
352
- }, function () {
353
- done(new Error('Did not detect local font'));
354
- });
355
- });
356
- });
357
-
358
- describe('hasSafari10Bug', function () {
359
- var getUserAgent = null;
360
- var getNavigatorVendor = null;
361
- var supportsNativeFontLoading = null;
362
-
363
- beforeEach(function () {
364
- Observer.HAS_SAFARI_10_BUG = null;
365
-
366
- getUserAgent = sinon.stub(Observer, 'getUserAgent');
367
- getNavigatorVendor = sinon.stub(Observer, 'getNavigatorVendor');
368
- supportsNativeFontLoading = sinon.stub(Observer, 'supportsNativeFontLoading');
369
- });
370
-
371
- afterEach(function () {
372
- getUserAgent.restore();
373
- getNavigatorVendor.restore();
374
- supportsNativeFontLoading.restore();
375
- });
376
-
377
- it('returns false when the user agent is not WebKit', function () {
378
- getUserAgent.returns('Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/15.0 Firefox/14.0');
379
- getNavigatorVendor.returns('Google');
380
- supportsNativeFontLoading.returns(true);
381
-
382
- expect(Observer.hasSafari10Bug(), 'to be false');
383
- });
384
-
385
- it('returns true if the browser is an affected version of Safari 10', function () {
386
- getUserAgent.returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14');
387
- getNavigatorVendor.returns('Apple');
388
- supportsNativeFontLoading.returns(true);
389
-
390
- expect(Observer.hasSafari10Bug(), 'to be true');
391
- });
392
-
393
- it('returns true if the browser is an WebView with an affected version of Safari 10', function () {
394
- getUserAgent.returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.2.14 (KHTML, like Gecko) FxiOS/6.1 Safari/602.2.14');
395
- getNavigatorVendor.returns('Apple');
396
- supportsNativeFontLoading.returns(true);
397
-
398
- expect(Observer.hasSafari10Bug(), 'to be true');
399
- });
400
-
401
- it('returns false in older versions of Safari', function () {
402
- getUserAgent.returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/9.3.2 Safari/537.75.14');
403
- getNavigatorVendor.returns('Apple');
404
- supportsNativeFontLoading.returns(false);
405
-
406
- expect(Observer.hasSafari10Bug(), 'to be false');
407
- });
408
-
409
- it('returns false in newer versions of Safari', function () {
410
- getUserAgent.returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.20 (KHTML, like Gecko) Version/10.1 Safari/603.1.20');
411
- getNavigatorVendor.returns('Apple');
412
- supportsNativeFontLoading.returns(true);
413
-
414
- expect(Observer.hasSafari10Bug(), 'to be false');
415
- });
416
- });
417
-
418
- describe('hasWebKitFallbackBug', function () {
419
- var getUserAgent = null;
420
-
421
- beforeEach(function () {
422
- Observer.HAS_WEBKIT_FALLBACK_BUG = null;
423
-
424
- getUserAgent = sinon.stub(Observer, 'getUserAgent');
425
- });
426
-
427
- afterEach(function () {
428
- getUserAgent.restore();
429
- });
430
-
431
- it('returns false when the user agent is not WebKit', function () {
432
- getUserAgent.returns('Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/15.0 Firefox/14.0');
433
-
434
- expect(Observer.hasWebKitFallbackBug(), 'to be false');
435
- });
436
-
437
- it('returns false when the user agent is WebKit but the bug is not present', function () {
438
- getUserAgent.returns('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.12 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/536.12');
439
-
440
- expect(Observer.hasWebKitFallbackBug(), 'to be false');
441
- });
442
-
443
- it('returns true when the user agent is WebKit and the bug is present', function () {
444
- getUserAgent.returns('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/536.11');
445
-
446
- expect(Observer.hasWebKitFallbackBug(), 'to be true');
447
- });
448
-
449
- it('returns true when the user agent is WebKit and the bug is present in an old version', function () {
450
- getUserAgent.returns('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/535.19');
451
-
452
- expect(Observer.hasWebKitFallbackBug(), 'to be true');
453
- });
454
-
455
- it('caches the results', function () {
456
- getUserAgent.returns('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/536.11');
457
-
458
- expect(Observer.hasWebKitFallbackBug(), 'to be true');
459
-
460
- getUserAgent.returns('Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/15.0 Firefox/14.0');
461
-
462
- expect(Observer.hasWebKitFallbackBug(), 'to be true');
463
- });
464
- });
465
- });