-
Notifications
You must be signed in to change notification settings - Fork 15
/
FontLoader.js
1006 lines (907 loc) · 82.4 KB
/
FontLoader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* globals define, exports, module */
(function(root, definition) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], definition);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but only CommonJS-like
// environments that support module.exports, like Node.
module.exports = definition();
} else {
// Browser globals (root is window)
root.FontLoader = definition();
}
}(window, function() {
var isIE = /MSIE/i.test(navigator.userAgent),
ieVer = null;
// Get Internet Explorer version
if (isIE) {
var re, result;
re = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
result = re.exec(navigator.userAgent);
if (result !== null) {
ieVer = parseFloat(result[1]);
}
}
/**
* @typedef {Object} FontDescriptor
* @property {String} family
* @property {String} weight
* @property {String} style
* @property {String} stretch
*/
function FontDescriptor(fontDescriptor) {
this._validateFontDescriptor(fontDescriptor);
this.family = fontDescriptor.family;
this.weight = fontDescriptor.weight;
this.style = fontDescriptor.style;
this.stretch = fontDescriptor.stretch;
}
FontDescriptor.prototype = {
constructor: FontDescriptor,
/**
* Returns font variation identifier of the FontDescriptor.
*
* FontDescriptors with different family-names may have same variation identifiers.
* This identifier is useful for mapping and storing font dimensions of fallback fonts with font variation
* properties similar to these of the loaded fonts.
*
* @returns {string}
*/
variationKey: function() {
return this.weight + this.style + this.stretch;
},
/**
* Returns identifier of the FontDescriptor.
*
* @returns {string}
*/
fontKey: function() {
return this.family + this.variationKey();
},
toJSON: function() {
return {
family: this.family,
weight: this.weight,
style: this.style,
stretch: this.stretch
};
},
_validateFontDescriptor: function(fontDescriptor) {
var style, stretch;
if (!fontDescriptor.family || !fontDescriptor.weight || !fontDescriptor.style) {
throw new Error("Illegal font descriptor, family, weight and style properties are required.")
}
if (!('possibleFontStyles' in FontLoader)) {
FontLoader.possibleFontStyles = [];
for (style in FontLoader.fontStyleAliasesMap) {
if (FontLoader.fontStyleAliasesMap.hasOwnProperty(style)) {
FontLoader.possibleFontStyles.push(FontLoader.fontStyleAliasesMap[style]);
}
}
}
if (FontLoader.possibleFontStyles.indexOf(fontDescriptor.style) === -1) {
throw new Error("Illegal font descriptor, style property must be one of the following: " + FontLoader.possibleFontStyles.join(", "));
}
// For backward compatibility do not require "stretch" property
if ('stretch' in fontDescriptor) {
if (!('possibleFontStretches' in FontLoader)) {
FontLoader.possibleFontStretches = [];
for (stretch in FontLoader.fontStretchAliasesMap) {
if (FontLoader.fontStretchAliasesMap.hasOwnProperty(stretch)) {
FontLoader.possibleFontStretches.push(FontLoader.fontStretchAliasesMap[stretch]);
}
}
}
if (FontLoader.possibleFontStretches.indexOf(fontDescriptor.stretch) === -1) {
throw new Error("Illegal font descriptor, stretch property must be one of the following: " + FontLoader.possibleFontStretches.join(", "));
}
} else {
fontDescriptor.stretch = 'normal';
}
}
};
/**
* FontLoader detects when web fonts specified in the "fontFamiliesArray" array were loaded and rendered. Then it
* notifies the specified delegate object via "fontLoaded" and "complete" methods when specific or all fonts were
* loaded respectively. The use of this functions implies that the insertion of specified web fonts into the
* document is done elsewhere.
*
* The fonts parameter may be an array of strings specifying the font-families with optionally specified font
* variations using FVD notation or font descriptor objects of the following type:
* {
* family: "fontFamily",
* weight: 400,
* style: 'normal',
* stretch: 'normal'
* }
* Where styles may ne one of the following: normal, bold, italic or oblique. If only string is specified, the
* default values used for weight, style and stretch are 400, 'normal' and 'normal' respectively.
*
* If all the specified fonts were loaded before the timeout was reached, the "complete" delegate method will be
* invoked with "null" error parameter. Otherwise, if timeout was reached before all specified fonts were loaded,
* the "complete" method will be invoked with an error object with two fields: the "message" string and the
* "notLoadedFonts" array of FontDescriptor objects of all the fonts that weren't loaded.
*
* @param {Array.<String|FontDescriptor>} fonts Array of font-family strings or font descriptor objects.
* @param {Object} delegate Delegate object whose callback methods will be invoked in its own context.
* @param {Function} [delegate.complete] Called when all fonts were loaded or the timeout was reached.
* @param {Function} [delegate.fontLoaded] Called for each loaded font with its font-family string as its single parameter.
* @param {Number} [timeout=3000] Timeout in milliseconds. Pass "null" to disable timeout.
* @param {HTMLDocument} [contextDocument] The DOM tree context to use, if none provided then it will be the document.
* @constructor
*/
function FontLoader(fonts, delegate, timeout, contextDocument) {
// Public
this.delegate = delegate;
this.timeout = (typeof timeout !== "undefined") ? timeout : 3000;
// Private
this._fontsArray = this._parseFonts(fonts);
this._started = false;
this._testDiv = null;
this._testContainer = null;
this._adobeBlankSizeWatcher = null;
this._sizeWatchers = [];
this._timeoutId = null;
this._intervalId = null;
this._intervalDelay = 50;
this._numberOfLoadedFonts = 0;
this._numberOfFonts = this._fontsArray.length;
this._fontsMap = {};
this._finished = false;
this._document = contextDocument || document;
}
FontLoader.useAdobeBlank = !isIE || ieVer >= 11.0;
FontLoader.useResizeEvent = isIE && ieVer < 11.0 && typeof document.attachEvent !== "undefined";
FontLoader.useIntervalChecking = window.opera || (isIE && ieVer < 11.0 && !FontLoader.useResizeEvent);
FontLoader.referenceText = " !\"\\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~";
FontLoader.referenceFontFamilies = FontLoader.useAdobeBlank ? ["AdobeBlank"] : ["serif", "cursive"];
FontLoader.adobeBlankFontFaceStyleId = "fontLoaderAdobeBlankFontFace";
FontLoader.adobeBlankReferenceSize = null;
FontLoader.referenceFontFamilyVariationSizes = {};
FontLoader.adobeBlankFontFaceRule = "@font-face{ font-family:AdobeBlank; src:url('data:font/opentype;base64,T1RUTwAKAIAAAwAgQ0ZGIM6ZbkwAAEPEAAAZM0RTSUcAAAABAABtAAAAAAhPUy8yAR6vMwAAARAAAABgY21hcDqI98oAACjEAAAa4GhlYWT+BQILAAAArAAAADZoaGVhCCID7wAAAOQAAAAkaG10eAPoAHwAAFz4AAAQBm1heHAIAVAAAAABCAAAAAZuYW1lD/tWxwAAAXAAACdScG9zdP+4ADIAAEOkAAAAIAABAAAAAQj1Snw1O18PPPUAAwPoAAAAAM2C2p8AAAAAzYLanwB8/4gDbANwAAAAAwACAAAAAAAAAAEAAANw/4gAyAPoA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VAAgAFcAQQBSAFIAQQBOAFQAWQAgAE8ARgAgAEEATgBZACAASwBJAE4ARAAsACAARQBYAFAAUgBFAFMAUwAgAE8AUgAgAEkATQBQAEwASQBFAEQALAAgAEkATgBDAEwAVQBEAEkATgBHACAAQgBVAFQAIABOAE8AVAAgAEwASQBNAEkAVABFAEQAIABUAE8AIABBAE4AWQAgAFcAQQBSAFIAQQBOAFQASQBFAFMAIABPAEYAIABNAEUAUgBDAEgAQQBOAFQAQQBCAEkATABJAFQAWQAsACAARgBJAFQATgBFAFMAUwAgAEYATwBSACAAQQAgAFAAQQBSAFQASQBDAFUATABBAFIAIABQAFUAUgBQAE8AUwBFACAAQQBOAEQAIABOAE8ATgBJAE4ARgBSAEkATgBHAEUATQBFAE4AVAAgAE8ARgAgAEMATwBQAFkAUgBJAEcASABUACwAIABQAEEAVABFAE4AVAAsACAAVABSAEEARABFAE0AQQBSAEsALAAgAE8AUgAgAE8AVABIAEUAUgAgAFIASQBHAEgAVAAuACAASQBOACAATgBPACAARQBWAEUATgBUACAAUwBIAEEATABMACAAVABIAEUAIABDAE8AUABZAFIASQBHAEgAVAAgAEgATwBMAEQARQBSACAAQgBFACAATABJAEEAQgBMAEUAIABGAE8AUgAgAEEATgBZACAAQwBMAEEASQBNACwAIABEAEEATQBBAEcARQBTACAATwBSACAATwBUAEgARQBSACAATABJAEEAQgBJAEwASQBUAFkALAAgAEkATgBDAEwAVQBEAEkATgBHACAAQQBOAFkAIABHAEUATgBFAFIAQQBMACwAIABTAFAARQBDAEkAQQBMACwAIABJAE4ARABJAFIARQBDAFQALAAgAEkATgBDAEkARABFAE4AVABBAEwALAAgAE8AUgAgAEMATwBOAFMARQBRAFUARQBOAFQASQBBAEwAIABEAEEATQBBAEcARQBTACwAIABXAEgARQBUAEgARQBSACAASQBOACAAQQBOACAAQQBDAFQASQBPAE4AIABPAEYAIABDAE8ATgBUAFIAQQBDAFQALAAgAFQATwBSAFQAIABPAFIAIABPAFQASABFAFIAVwBJAFMAR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4AAAAf/8AAAABAACAAAAAh/8AAAABAACIAAAAj/8AAAABAACQAAAAl/8AAAABAACYAAAAn/8AAAABAACgAAAAp/8AAAABAACoAAAAr/8AAAABAACwAAAAt/8AAAABAAC4AAAAv/8AAAABAADAAAAAx/8AAAABAADIAAAAz/8AAAABAADQAAAA1/8AAAABAADgAAAA5/8AAAABAADoAAAA7/8AAAABAADwAAAA9/8AAAABAAD4AAAA/c8AAAABAAD98AAA//0AAAXxAAEAAAABB/8AAAABAAEIAAABD/8AAAABAAEQAAABF/8AAAABAAEYAAABH/8AAAABAAEgAAABJ/8AAAABAAEoAAABL/8AAAABAAEwAAABN/8AAAABAAE4AAABP/8AAAABAAFAAAABR/8AAAABAAFIAAABT/8AAAABAAFQAAABV/8AAAABAAFYAAABX/8AAAABAAFgAAABZ/8AAAABAAFoAAABb/8AAAABAAFwAAABd/8AAAABAAF4AAABf/8AAAABAAGAAAABh/8AAAABAAGIAAABj/8AAAABAAGQAAABl/8AAAABAAGYAAABn/8AAAABAAGgAAABp/8AAAABAAGoAAABr/8AAAABAAGwAAABt/8AAAABAAG4AAABv/8AAAABAAHAAAABx/8AAAABAAHIAAABz/8AAAABAAHQAAAB1/8AAAABAAHYAAAB3/8AAAABAAHgAAAB5/8AAAABAAHoAAAB7/8AAAABAAHwAAAB9/8AAAABAAH4AAAB//0AAAABAAIAAAACB/8AAAABAAIIAAACD/8AAAABAAIQAAACF/8AAAABAAIYAAACH/8AAAABAAIgAAACJ/8AAAABAAIoAAACL/8AAAABAAIwAAACN/8AAAABAAI4AAACP/8AAAABAAJAAAACR/8AAAABAAJIAAACT/8AAAABAAJQAAACV/8AAAABAAJYAAACX/8AAAABAAJgAAACZ/8AAAABAAJoAAACb/8AAAABAAJwAAACd/8AAAABAAJ4AAACf/8AAAABAAKAAAACh/8AAAABAAKIAAACj/8AAAABAAKQAAACl/8AAAABAAKYAAACn/8AAAABAAKgAAACp/8AAAABAAKoAAACr/8AAAABAAKwAAACt/8AAAABAAK4AAACv/8AAAABAALAAAACx/8AAAABAALIAAACz/8AAAABAALQAAAC1/8AAAABAALYAAAC3/8AAAABAALgAAAC5/8AAAABAALoAAAC7/8AAAABAALwAAAC9/8AAAABAAL4AAAC//0AAAABAAMAAAADB/8AAAABAAMIAAADD/8AAAABAAMQAAADF/8AAAABAAMYAAADH/8AAAABAAMgAAADJ/8AAAABAAMoAAADL/8AAAABAAMwAAADN/8AAAABAAM4AAADP/8AAAABAANAAAADR/8AAAABAANIAAADT/8AAAABAANQAAADV/8AAAABAANYAAADX/8AAAABAANgAAADZ/8AAAABAANoAAADb/8AAAABAANwAAADd/8AAAABAAN4AAADf/8AAAABAAOAAAADh/8AAAABAAOIAAADj/8AAAABAAOQAAADl/8AAAABAAOYAAADn/8AAAABAAOgAAADp/8AAAABAAOoAAADr/8AAAABAAOwAAADt/8AAAABAAO4AAADv/8AAAABAAPAAAADx/8AAAABAAPIAAADz/8AAAABAAPQAAAD1/8AAAABAAPYAAAD3/8AAAABAAPgAAAD5/8AAAABAAPoAAAD7/8AAAABAAPwAAAD9/8AAAABAAP4AAAD//0AAAABAAQAAAAEB/8AAAABAAQIAAAED/8AAAABAAQQAAAEF/8AAAABAAQYAAAEH/8AAAABAAQgAAAEJ/8AAAABAAQoAAAEL/8AAAABAAQwAAAEN/8AAAABAAQ4AAAEP/8AAAABAARAAAAER/8AAAABAARIAAAET/8AAAABAARQAAAEV/8AAAABAARYAAAEX/8AAAABAARgAAAEZ/8AAAABAARoAAAEb/8AAAABAARwAAAEd/8AAAABAAR4AAAEf/8AAAABAASAAAAEh/8AAAABAASIAAAEj/8AAAABAASQAAAEl/8AAAABAASYAAAEn/8AAAABAASgAAAEp/8AAAABAASoAAAEr/8AAAABAASwAAAEt/8AAAABAAS4AAAEv/8AAAABAATAAAAEx/8AAAABAATIAAAEz/8AAAABAATQAAAE1/8AAAABAATYAAAE3/8AAAABAATgAAAE5/8AAAABAAToAAAE7/8AAAABAATwAAAE9/8AAAABAAT4AAAE//0AAAAB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AAABAAt4AAALf/8AAAABAAuAAAALh/8AAAABAAuIAAALj/8AAAABAAuQAAALl/8AAAABAAuYAAALn/8AAAABAAugAAALp/8AAAABAAuoAAALr/8AAAABAAuwAAALt/8AAAABAAu4AAALv/8AAAABAAvAAAALx/8AAAABAAvIAAALz/8AAAABAAvQAAAL1/8AAAABAAvYAAAL3/8AAAABAAvgAAAL5/8AAAABAAvoAAAL7/8AAAABAAvwAAAL9/8AAAABAAv4AAAL//0AAAABAAwAAAAMB/8AAAABAAwIAAAMD/8AAAABAAwQAAAMF/8AAAABAAwYAAAMH/8AAAABAAwgAAAMJ/8AAAABAAwoAAAML/8AAAABAAwwAAAMN/8AAAABAAw4AAAMP/8AAAABAAxAAAAMR/8AAAABAAxIAAAMT/8AAAABAAxQAAAMV/8AAAABAAxYAAAMX/8AAAABAAxgAAAMZ/8AAAABAAxoAAAMb/8AAAABAAxwAAAMd/8AAAABAAx4AAAMf/8AAAABAAyAAAAMh/8AAAABAAyIAAAMj/8AAAABAAyQAAAMl/8AAAABAAyYAAAMn/8AAAABAAygAAAMp/8AAAABAAyoAAAMr/8AAAABAAywAAAMt/8AAAABAAy4AAAMv/8AAAABAAzAAAAMx/8AAAABAAzIAAAMz/8AAAABAAzQAAAM1/8AAAABAAzYAAAM3/8AAAABAAzgAAAM5/8AAAABAAzoAAAM7/8AAAABAAzwAAAM9/8AAAABAAz4AAAM//0AAAABAA0AAAANB/8AAAABAA0IAAAND/8AAAABAA0QAAANF/8AAAABAA0YAAANH/8AAAABAA0gAAANJ/8AAAABAA0oAAANL/8AAAABAA0wAAANN/8AAAABAA04AAANP/8AAAABAA1AAAANR/8AAAABAA1IAAANT/8AAAABAA1QAAANV/8AAAABAA1YAAANX/8AAAABAA1gAAANZ/8AAAABAA1oAAANb/8AAAABAA1wAAANd/8AAAABAA14AAANf/8AAAABAA2AAAANh/8AAAABAA2IAAANj/8AAAABAA2QAAANl/8AAAABAA2YAAANn/8AAAABAA2gAAANp/8AAAABAA2oAAAN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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAA') format('truetype'); }";
FontLoader.fontStyleAliasesMap = {"n": "normal", "b": "bold", "i": "italic", "o": "oblique"};
FontLoader.fontStretchAliasesMap = {"a": "ultra-condensed", "b": "extra-condensed", "c": "condensed", "d": "semi-condensed", "n": "normal", "e": "semi-expanded", "f": "expanded", "g": "extra-expanded", "h": "ultra-expanded"};
FontLoader.prototype = {
constructor: FontLoader,
loadFonts: function() {
var self = this,
newFontVariations;
if (this._started) {
throw new Error("FontLoader: loadFonts can not be called twice. Create new FontLoader to load different fonts.");
}
this._started = true;
if (this._numberOfFonts === 0) {
this._finish();
return;
}
if (this.timeout !== null) {
this._timeoutId = window.setTimeout(function timeoutFire() {
self._finish();
}, this.timeout);
}
// Use constant line-height so there won't be changes in height because Adobe Blank uses zero width but not zero height.
this._testContainer = this._document.createElement("div");
this._testContainer.style.cssText = "position:absolute; left:-10000px; top:-10000px; white-space:nowrap; font-size:20px; line-height:20px;";
// Create testDiv template that will be cloned for each font
this._testDiv = this._document.createElement("div");
this._testDiv.style.position = "absolute";
this._testDiv.appendChild(this._document.createTextNode(FontLoader.referenceText));
if (!FontLoader.useAdobeBlank) {
// AdobeBlank is not used
// We need to extract dimensions of reference font-families for each requested font variation.
// The extracted dimensions are stored in a static property "referenceFontFamilyVariationSizes",
// so we might already have some or all of them all.
newFontVariations = this._getNewFontVariationsFromFonts(this._fontsArray);
if (newFontVariations.length) {
this._extractReferenceFontSizes(newFontVariations);
}
this._loadFonts();
} else if (FontLoader.adobeBlankReferenceSize) {
// AdobeBlank is used, and was loaded
this._loadFonts();
} else {
// AdobeBlank is used but was not loaded
this._loadAdobeBlankFont();
}
},
_extractReferenceFontSizes: function(newFontVariations) {
var clonedDiv, j, i,
key, size, fontVariation;
clonedDiv = this._testDiv.cloneNode(true);
this._testContainer.appendChild(clonedDiv);
this._document.body.appendChild(this._testContainer);
for (i = 0; i < newFontVariations.length; i++) {
fontVariation = newFontVariations[i];
key = fontVariation.key;
FontLoader.referenceFontFamilyVariationSizes[key] = [];
for (j = 0; j < FontLoader.referenceFontFamilies.length; j++) {
clonedDiv.style.fontFamily = FontLoader.referenceFontFamilies[j];
clonedDiv.style.fontWeight = fontVariation.weight;
clonedDiv.style.fontStyle = fontVariation.style;
clonedDiv.style.fontStretch = fontVariation.stretch;
size = new Size(clonedDiv.offsetWidth, clonedDiv.offsetHeight);
FontLoader.referenceFontFamilyVariationSizes[key].push(size);
}
}
this._testContainer.parentNode.removeChild(this._testContainer);
clonedDiv.parentNode.removeChild(clonedDiv);
},
_loadAdobeBlankFont: function() {
var self = this,
adobeBlankDiv,
adobeBlankFallbackFont = "serif";
this._addAdobeBlankFontFaceIfNeeded();
adobeBlankDiv = this._testDiv.cloneNode(true);
this._testContainer.appendChild(adobeBlankDiv);
this._document.body.appendChild(this._testContainer);
// When using AdobeBlank (all browsers except IE < 11) only interval checking and size watcher methods
// are available for watching element size.
if (FontLoader.useIntervalChecking) {
adobeBlankDiv.style.fontFamily = FontLoader.referenceFontFamilies[0] + ", " + adobeBlankFallbackFont;
this._testContainer.appendChild(adobeBlankDiv);
// Start polling element sizes but also do first synchronous check in case all fonts where already loaded.
this._intervalId = window.setInterval(function intervalFire() {
self._checkAdobeBlankSize();
}, this._intervalDelay);
this._checkAdobeBlankSize();
} else {
adobeBlankDiv.style.fontFamily = adobeBlankFallbackFont;
this._adobeBlankSizeWatcher = new SizeWatcher(/** @type HTMLElement */adobeBlankDiv, {
container: this._testContainer,
delegate: this,
continuous: true,
direction: SizeWatcher.directions.decrease,
dimension: SizeWatcher.dimensions.horizontal,
document: this._document
});
this._adobeBlankSizeWatcher.prepareForWatch();
this._adobeBlankSizeWatcher.beginWatching();
adobeBlankDiv.style.fontFamily = FontLoader.referenceFontFamilies[0] + ", " + adobeBlankFallbackFont;
}
},
_getNewFontVariationsFromFonts: function(fontDescriptors) {
var fontDescriptor, key, i,
variations = [],
variationsMap = {};
for (i = 0; i < fontDescriptors.length; i++) {
fontDescriptor = fontDescriptors[i];
key = fontDescriptor.variationKey();
if (!(key in variationsMap) && !(key in FontLoader.referenceFontFamilyVariationSizes)) {
variationsMap[key] = true;
variations.push({
key: key,
weight: fontDescriptor.weight,
style: fontDescriptor.style,
stretch: fontDescriptor.stretch
});
}
}
return variations;
},
_parseFonts: function(fonts) {
var fontDescriptors = [], filteredFD,
i, font, fontKey, fontKeys = {};
for (i = 0; i < fonts.length; i++) {
font = fonts[i];
if (typeof font === "string") {
if (font.indexOf(':') > -1) {
fontDescriptors = fontDescriptors.concat(this._parseFVD(font));
} else {
fontDescriptors.push(new FontDescriptor({
family: font,
weight: 400,
style: 'normal',
stretch: 'normal'
}));
}
} else {
fontDescriptors.push(new FontDescriptor(font));
}
}
// Filter duplicate fonts
filteredFD = [];
for (i = 0; i < fontDescriptors.length; i++) {
fontKey = fontDescriptors[i].fontKey();
if (!(fontKey in fontKeys)) {
fontKeys[fontKey] = true;
filteredFD.push(fontDescriptors[i]);
}
}
return filteredFD;
},
/**
* @param {string} fontString
* @returns {Array.<FontDescriptor>}
* @private
*/
_parseFVD: function(fontString) {
var fontDescriptors = [],
parts = fontString.split(':'),
fontFamily, variants, i, variant,
styleAlias, weightAlias, stretchAlias,
weight, style, stretch;
fontFamily = parts[0];
variants = parts[1].split(',');
for (i = 0; i < variants.length; i++) {
variant = variants[i];
if (variant.length < 2 || variant.length > 3) {
throw new Error("Invalid Font Variation Description: '" + fontString + "', number of variation characters must be 2 or 3");
}
styleAlias = variant[0];
weightAlias = variant[1];
stretchAlias = "n"; // stretch character is optional, default is 'n': 'normal'
if (variant.length === 3) {
stretchAlias = variant[2]
}
if (styleAlias in FontLoader.fontStyleAliasesMap) {
style = FontLoader.fontStyleAliasesMap[styleAlias];
} else {
throw new Error("Invalid Font Variation Description: '" + fontString + "', the first variant character is not complying to FVD font-style specification");
}
weight = parseInt(weightAlias, 10);
if (isNaN(weight)) {
throw new Error("Invalid Font Variation Description: '" + fontString + "', the second variant character is not complying to FVD font-weight specification");
} else {
weight *= 100;
}
if (stretchAlias in FontLoader.fontStretchAliasesMap) {
stretch = FontLoader.fontStretchAliasesMap[stretchAlias];
} else {
throw new Error("Invalid Font Variation Description: '" + fontString + "', the third variant character is not complying to FVD font-stretch specification");
}
fontDescriptors.push(new FontDescriptor({
family: fontFamily,
weight: weight,
style: style,
stretch: stretch
}));
}
return fontDescriptors;
},
_addAdobeBlankFontFaceIfNeeded: function() {
var adobeBlankFontFaceStyle;
if (!this._document.getElementById(FontLoader.adobeBlankFontFaceStyleId)) {
adobeBlankFontFaceStyle = this._document.createElement("style");
adobeBlankFontFaceStyle.setAttribute("type", "text/css");
adobeBlankFontFaceStyle.setAttribute("id", FontLoader.adobeBlankFontFaceStyleId);
adobeBlankFontFaceStyle.appendChild(this._document.createTextNode(FontLoader.adobeBlankFontFaceRule));
this._document.getElementsByTagName("head")[0].appendChild(adobeBlankFontFaceStyle);
}
},
_checkAdobeBlankSize: function() {
var adobeBlankDiv = this._testContainer.firstChild;
this._adobeBlankLoaded(adobeBlankDiv);
},
_adobeBlankLoaded: function(adobeBlankDiv) {
// Prevent false size change, for example if AdobeBlank height is higher than fallback font.
if (adobeBlankDiv.offsetWidth !== 0) {
return;
}
FontLoader.adobeBlankReferenceSize = new Size(adobeBlankDiv.offsetWidth, adobeBlankDiv.offsetHeight);
if (this._adobeBlankSizeWatcher !== null) {
// SizeWatcher method
this._adobeBlankSizeWatcher.endWatching();
this._adobeBlankSizeWatcher.removeScrollWatchers();
this._adobeBlankSizeWatcher = null;
} else {
// Polling method (IE)
window.clearInterval(this._intervalId);
adobeBlankDiv.parentNode.removeChild(adobeBlankDiv);
}
this._testContainer.parentNode.removeChild(this._testContainer);
this._loadFonts();
},
_cloneNodeSetStyleAndAttributes: function(font, fontKey, referenceFontFamilyIndex) {
var clonedDiv = this._testDiv.cloneNode(true);
clonedDiv.style.fontWeight = font.weight;
clonedDiv.style.fontStyle = font.style;
clonedDiv.style.fontStretch = font.stretch;
clonedDiv.setAttribute("data-font-map-key", fontKey);
clonedDiv.setAttribute("data-ref-font-family-index", String(referenceFontFamilyIndex));
return clonedDiv;
},
_getFontMapKeyFromElement: function(element) {
return element.getAttribute("data-font-map-key");
},
_getFontFromElement: function(element) {
var fontKey = this._getFontMapKeyFromElement(element);
return this._fontsMap[fontKey];
},
_getFontFamilyFromElement: function(element) {
var font = this._getFontFromElement(element);
return font.family;
},
_getReferenceFontFamilyIndexFromElement: function(element) {
return element.getAttribute("data-ref-font-family-index");
},
_getReferenceFontFamilyFromElement: function(element) {
var referenceFontFamilyIndex = this._getReferenceFontFamilyIndexFromElement(element);
return FontLoader.referenceFontFamilies[referenceFontFamilyIndex];
},
_loadFonts: function() {
var i, j, clonedDiv, sizeWatcher,
font,
fontKey,
fontVariationKey,
referenceFontSize,
sizeWatcherDirection,
sizeWatcherDimension,
self = this;
// Add div for each font-family
for (i = 0; i < this._numberOfFonts; i++) {
font = this._fontsArray[i];
fontKey = font.fontKey();
this._fontsMap[fontKey] = font;
for (j = 0; j < FontLoader.referenceFontFamilies.length; j++) {
clonedDiv = this._cloneNodeSetStyleAndAttributes(font, fontKey, j);
if (FontLoader.useResizeEvent) {
clonedDiv.style.fontFamily = FontLoader.referenceFontFamilies[j];
this._testContainer.appendChild(clonedDiv);
} else if (FontLoader.useIntervalChecking) {
clonedDiv.style.fontFamily = "'" + font.family + "', " + FontLoader.referenceFontFamilies[j];
this._testContainer.appendChild(clonedDiv);
} else {
clonedDiv.style.fontFamily = FontLoader.referenceFontFamilies[j];
if (FontLoader.useAdobeBlank) {
referenceFontSize = FontLoader.adobeBlankReferenceSize;
sizeWatcherDirection = SizeWatcher.directions.increase;
sizeWatcherDimension = SizeWatcher.dimensions.horizontal;
} else {
fontVariationKey = font.variationKey();
referenceFontSize = FontLoader.referenceFontFamilyVariationSizes[fontVariationKey][j];
sizeWatcherDirection = SizeWatcher.directions.both;
sizeWatcherDimension = SizeWatcher.dimensions.both;
}
sizeWatcher = new SizeWatcher(/** @type HTMLElement */clonedDiv, {
container: this._testContainer,
delegate: this,
size: referenceFontSize,
direction: sizeWatcherDirection,
dimension: sizeWatcherDimension,
document: this._document
});
// The prepareForWatch() and beginWatching() methods will be invoked in separate iterations to
// reduce number of browser's CSS recalculations.
this._sizeWatchers.push(sizeWatcher);
}
}
}
// Append the testContainer after all test elements to minimize DOM insertions
this._document.body.appendChild(this._testContainer);
if (FontLoader.useResizeEvent) {
for (j = 0; j < this._testContainer.childNodes.length; j++) {
clonedDiv = this._testContainer.childNodes[j];
// "resize" event works only with attachEvent
clonedDiv.attachEvent("onresize", (function(self, clonedDiv) {
return function() {
self._elementSizeChanged(clonedDiv);
}
})(this, clonedDiv));
}
window.setTimeout(function() {
for (j = 0; j < self._testContainer.childNodes.length; j++) {
clonedDiv = self._testContainer.childNodes[j];
clonedDiv.style.fontFamily = "'" + self._getFontFamilyFromElement(clonedDiv) + "', " + self._getReferenceFontFamilyFromElement(clonedDiv);
}
}, 0);
} else if (FontLoader.useIntervalChecking) {
// Start polling element sizes but also do first synchronous check in case all fonts where already loaded.
this._intervalId = window.setInterval(function intervalFire() {
self._checkSizes();
}, this._intervalDelay);
this._checkSizes();
} else {
// We are dividing the prepareForWatch() and beginWatching() methods to optimize browser performance by
// removing CSS recalculation from each iteration to the end of iterations.
for (i = 0; i < this._sizeWatchers.length; i++) {
sizeWatcher = this._sizeWatchers[i];
sizeWatcher.prepareForWatch();
}
for (i = 0; i < this._sizeWatchers.length; i++) {
sizeWatcher = this._sizeWatchers[i];
sizeWatcher.beginWatching();
// Apply tested font-family
clonedDiv = sizeWatcher.getWatchedElement();
clonedDiv.style.fontFamily = "'" + this._getFontFamilyFromElement(clonedDiv) + "', " + self._getReferenceFontFamilyFromElement(clonedDiv);
}
}
},
_checkSizes: function() {
var i, testDiv, font, fontVariationKey, currSize, refSize, refFontFamilyIndex;
for (i = this._testContainer.childNodes.length - 1; i >= 0; i--) {
testDiv = this._testContainer.childNodes[i];
currSize = new Size(testDiv.offsetWidth, testDiv.offsetHeight);
if (FontLoader.useAdobeBlank) {
refSize = FontLoader.adobeBlankReferenceSize;
} else {
font = this._getFontFromElement(testDiv);
fontVariationKey = font.variationKey();
refFontFamilyIndex = this._getReferenceFontFamilyIndexFromElement(testDiv);
refSize = FontLoader.referenceFontFamilyVariationSizes[fontVariationKey][refFontFamilyIndex];
}
if (!refSize.isEqual(currSize)) {
// Element dimensions changed, this means its font loaded, remove it from testContainer div
testDiv.parentNode.removeChild(testDiv);
this._elementSizeChanged(testDiv);
}
}
},
_elementSizeChanged: function(element) {
var font, fontKey;
if (this._finished) {
return;
}
fontKey = this._getFontMapKeyFromElement(element);
// Check that the font of this element wasn't already marked as loaded by an element with different reference font family.
if (typeof this._fontsMap[fontKey] === "undefined") {
return;
}
font = this._fontsMap[fontKey];
this._numberOfLoadedFonts++;
delete this._fontsMap[fontKey];
if (this.delegate && typeof this.delegate.fontLoaded === "function") {
this.delegate.fontLoaded(font.toJSON());
}
if (this._numberOfLoadedFonts === this._numberOfFonts) {
this._finish();
}
},
_finish: function() {
var error, i, sizeWatcher,
fontKey,
notLoadedFonts = [];
if (this._finished) {
return;
}
this._finished = true;
if (this._adobeBlankSizeWatcher !== null) {
if (this._adobeBlankSizeWatcher.getState() === SizeWatcher.states.watchingForSizeChange) {
this._adobeBlankSizeWatcher.endWatching();
}
this._adobeBlankSizeWatcher = null;
}
for (i = 0; i < this._sizeWatchers.length; i++) {
sizeWatcher = this._sizeWatchers[i];
if (sizeWatcher.getState() === SizeWatcher.states.watchingForSizeChange) {
sizeWatcher.endWatching();
}
}
this._sizeWatchers = [];
if (this._testContainer !== null) {
this._testContainer.parentNode.removeChild(this._testContainer);
}
if (this._timeoutId !== null) {
window.clearTimeout(this._timeoutId);
}
if (this._intervalId !== null) {
window.clearInterval(this._intervalId);
}
if (this.delegate) {
if (this._numberOfLoadedFonts < this._numberOfFonts) {
for (fontKey in this._fontsMap) {
if (this._fontsMap.hasOwnProperty(fontKey)) {
notLoadedFonts.push(this._fontsMap[fontKey].toJSON());
}
}
error = {
message: "Not all fonts were loaded (" + this._numberOfLoadedFonts + "/" + this._numberOfFonts + ")",
notLoadedFonts: notLoadedFonts
};
} else {
error = null;
}
if (typeof this.delegate.complete === "function") {
this.delegate.complete(error);
} else if (typeof this.delegate.fontsLoaded === "function") {
this.delegate.fontsLoaded(error);
}
}
},
/**
* SizeWatcher delegate method
* @param {SizeWatcher} sizeWatcher
*/
sizeWatcherChangedSize: function(sizeWatcher) {
var watchedElement = sizeWatcher.getWatchedElement();
if (sizeWatcher === this._adobeBlankSizeWatcher) {
this._adobeBlankLoaded(watchedElement);
} else {
this._elementSizeChanged(watchedElement);
}
}
};
/**
* Size object
*
* @param width
* @param height
* @constructor
*/
function Size(width, height) {
this.width = width;
this.height = height;
}
Size.sizeFromString = function(sizeString) {
var arr = sizeString.split(",");
if (arr.length !== 2) {
return null;
}
return new Size(arr[0], arr[1]);
};
/**
* Compares receiver object to passed in size object.
*
* @param otherSize
* @returns {boolean}
*/
Size.prototype.isEqual = function(otherSize) {
return (this.width === otherSize.width && this.height === otherSize.height);
};
Size.prototype.toString = function() {
return this.width + "," + this.height;
};
/**
* SizeWatcher observes size of an element and notifies when its size is changed. It doesn't use any timeouts
* to check the element size, when change in size occurs a callback method immediately invoked.
*
* To watch for element's size changes the element, and other required elements are appended to a container element
* you specify, and which must be added to the DOM tree before invoking prepareForWatch() method. Your container
* element should be positioned outside of client's visible area. Therefore you shouldn't use SizeWatcher to watch
* for size changes of elements used for UI.
* Such container element could be a simple <div> that is a child of the <body> element:
* <div style="position:absolute; left:-10000px; top:-10000px;"></div>
*
* You must invoke SizeWatcher's methods in a specific order to establish size change listeners:
*
* 1. Create SizeWatcher instance by invoke SizeWatcher constructor passing the element (size of which you want to
* observe), the container element, the delegate object and optional size parameter of type Size which should be
* the pre-calculated initial size of your element.
* 4. Invoke prepareForWatch() method. This method will calculate element size if you didn't passed it to the constructor.
* 5. Invoke beginWatching() method. This method will set event listeners and invoke your delegate's method once
* element size changes.
*
* Failing to invoke above methods in their predefined order will throw an exception.
*
* @param {HTMLElement} element An element, size of which will be observed for changes.
* @param {Object} options
* @param {HTMLElement} options.container An element to which special observing elements will be added. Must be in DOM tree
* when prepareForWatch() method is called.
* @param {Object} options.delegate A delegate object with a sizeWatcherChangedSize method which will be invoked, in
* context of the delegate object, when change in size occurs. This method is invoked with single
* parameter which is the current SizeWatcher instance.
* @param {Size} [options.size] The pre-calculated initial size of your element. When passed, the element is not
* asked for offsetWidth and offsetHeight, which may be useful to reduce browser's CSS
* recalculations. If you will not pass the size parameter then its size calculation will be
* deferred to prepareForWatch() method.
* @param {Boolean} [options.continuous=false] A boolean flag indicating if the SizeWatcher will watch only for
* the first size change (default) or will continuously watch for size changes.
* @param {Number} [options.direction=SizeWatcher.directions.both] The direction of size change that should be
* watched: SizeWatcher.directions.increase, SizeWatcher.directions.decrease or
* SizeWatcher.directions.both
* @param {Number} [options.dimension=SizeWatcher.dimensions.both] The dimension of size change that should be
* watched: SizeWatcher.dimensions.horizontal, SizeWatcher.dimensions.vertical or
* SizeWatcher.dimensions.both
* @param {HTMLDocument} [options.document] The DOM tree context to use, if none provided then it will be the document.
* @constructor
*/
function SizeWatcher(element, options) {
this._element = element;
this._delegate = options.delegate;
this._size = null;
this._continuous = !!options.continuous;
this._direction = options.direction ? options.direction : SizeWatcher.directions.both;
this._dimension = options.dimension ? options.dimension : SizeWatcher.dimensions.both;
this._sizeIncreaseWatcherContentElm = null;
this._sizeDecreaseWatcherElm = null;
this._sizeIncreaseWatcherElm = null;
this._state = SizeWatcher.states.initialized;
this._scrollAmount = 2;
this._document = options.document || document;
this._generateScrollWatchers(options.size);
this._appendScrollWatchersToElement(options.container);
}
SizeWatcher.states = {
initialized: 0,
generatedScrollWatchers: 1,
appendedScrollWatchers: 2,
preparedScrollWatchers: 3,
watchingForSizeChange: 4
};
SizeWatcher.directions = {
decrease: 1,
increase: 2,
both: 3
};
SizeWatcher.dimensions = {
horizontal: 1,
vertical: 2,
both: 3
};
//noinspection JSUnusedLocalSymbols
SizeWatcher.prototype = {
constructor: SizeWatcher,
getWatchedElement: function() {
return this._element;
},
getState: function() {
return this._state;
},
setSize: function(size) {
this._size = size;
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.increase) {
this._sizeIncreaseWatcherContentElm.style.cssText = "width: " + (size.width + this._scrollAmount) + "px; height: " + (size.height + this._scrollAmount) + "px;";
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.decrease) {
this._sizeDecreaseWatcherElm.style.cssText = "position:absolute; left: 0px; top: 0px; overflow: hidden; width: " + (size.width - this._scrollAmount) + "px; height: " + (size.height - this._scrollAmount) + "px;";
}
},
_generateScrollWatchers: function(size) {
this._element.style.position = "absolute";
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.increase) {
this._sizeIncreaseWatcherContentElm = this._document.createElement("div");
this._sizeIncreaseWatcherElm = this._document.createElement("div");
this._sizeIncreaseWatcherElm.style.cssText = "position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden;";
this._sizeIncreaseWatcherElm.appendChild(this._sizeIncreaseWatcherContentElm);
this._element.appendChild(this._sizeIncreaseWatcherElm);
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.decrease) {
this._sizeDecreaseWatcherElm = this._document.createElement("div");
this._sizeDecreaseWatcherElm.appendChild(this._element);
}
if (size) {
this.setSize(size);
}
this._state = SizeWatcher.states.generatedScrollWatchers;
},
_appendScrollWatchersToElement: function(container) {
if (this._state !== SizeWatcher.states.generatedScrollWatchers) {
throw new Error("SizeWatcher._appendScrollWatchersToElement() was invoked before SizeWatcher._generateScrollWatchers()");
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.decrease) {
container.appendChild(this._sizeDecreaseWatcherElm);
} else {
container.appendChild(this._element);
}
this._state = SizeWatcher.states.appendedScrollWatchers;
},
removeScrollWatchers: function() {
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.decrease) {
if (this._sizeDecreaseWatcherElm.parentNode) {
this._sizeDecreaseWatcherElm.parentNode.removeChild(this._sizeDecreaseWatcherElm);
}
} else if (this._element.parentNode) {
this._element.parentNode.removeChild(this._element);
}
},
prepareForWatch: function() {
var parentNode,
sizeDecreaseWatcherElmScrolled = true,
sizeIncreaseWatcherElmScrolled = true;
if (this._state !== SizeWatcher.states.appendedScrollWatchers) {
throw new Error("SizeWatcher.prepareForWatch() invoked before SizeWatcher._appendScrollWatchersToElement()");
}
if (this._size === null) {
this.setSize(new Size(this._element.offsetWidth, this._element.offsetHeight));
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.decrease) {
sizeDecreaseWatcherElmScrolled = this._scrollElementToBottomRight(this._sizeDecreaseWatcherElm);
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.increase) {
sizeIncreaseWatcherElmScrolled = this._scrollElementToBottomRight(this._sizeIncreaseWatcherElm);
}
// Check if scroll positions updated.
if (!sizeDecreaseWatcherElmScrolled || !sizeIncreaseWatcherElmScrolled) {
// Traverse tree to the top node to see if element is in the DOM tree.
parentNode = this._element.parentNode;
while (parentNode !== this._document && parentNode !== null) {
parentNode = parentNode.parentNode;
}
if (parentNode === null) {
throw new Error("Can't set scroll position of scroll watchers. SizeWatcher is not in the DOM tree.");
} else if (console && typeof console.warn === "function") {
console.warn("SizeWatcher can't set scroll position of scroll watchers.");
}
}
this._state = SizeWatcher.states.preparedScrollWatchers;
},
_scrollElementToBottomRight: function(element) {
var elementScrolled = true;
//noinspection JSBitwiseOperatorUsage
if (this._dimension & SizeWatcher.dimensions.vertical) {
element.scrollTop = this._scrollAmount;
elementScrolled = elementScrolled && element.scrollTop > 0;
}
//noinspection JSBitwiseOperatorUsage
if (this._dimension & SizeWatcher.dimensions.horizontal) {
element.scrollLeft = this._scrollAmount;
elementScrolled = elementScrolled && element.scrollLeft > 0;
}
return elementScrolled;
},
beginWatching: function() {
if (this._state !== SizeWatcher.states.preparedScrollWatchers) {
throw new Error("SizeWatcher.beginWatching() invoked before SizeWatcher.prepareForWatch()");
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.decrease) {
//noinspection JSValidateTypes
this._sizeDecreaseWatcherElm.addEventListener("scroll", this, false);
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.increase) {
//noinspection JSValidateTypes
this._sizeIncreaseWatcherElm.addEventListener("scroll", this, false);
}
this._state = SizeWatcher.states.watchingForSizeChange;
},
endWatching: function() {
if (this._state !== SizeWatcher.states.watchingForSizeChange) {
throw new Error("SizeWatcher.endWatching() invoked before SizeWatcher.beginWatching()");
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.decrease) {
//noinspection JSValidateTypes
this._sizeDecreaseWatcherElm.removeEventListener("scroll", this, false);
}
//noinspection JSBitwiseOperatorUsage
if (this._direction & SizeWatcher.directions.increase) {
//noinspection JSValidateTypes
this._sizeIncreaseWatcherElm.removeEventListener("scroll", this, false);
}
this._state = SizeWatcher.states.appendedScrollWatchers;
},
/**
* @private
*/
handleEvent: function(event) {
var newSize, oldSize;
// This is not suppose to happen because when we run endWatching() we remove scroll listeners.
// But some browsers will fire second scroll event which was pushed into event stack before listener was
// removed so do this check anyway.
if (this._state !== SizeWatcher.states.watchingForSizeChange) {
return;
}
newSize = new Size(this._element.offsetWidth, this._element.offsetHeight);
oldSize = this._size;
// Check if element size is changed. How come that element size isn't changed but scroll event fired?
// This can happen in two cases: when double scroll occurs or immediately after calling prepareForWatch()
// (event if scroll event listeners attached after it).
// The double scroll event happens when one size dimension (e.g.:width) is increased and another
// (e.g.:height) is decreased.
if (oldSize.isEqual(newSize)) {
return;
}
if (this._delegate && typeof this._delegate.sizeWatcherChangedSize === "function") {
this._delegate.sizeWatcherChangedSize(this);
// Check that endWatching() wasn't invoked from within the delegate.
if (this._state !== SizeWatcher.states.watchingForSizeChange) {
return;
}
}
if (!this._continuous) {
this.endWatching();
} else {
// Set the new size so in case of double scroll event we won't cause the delegate method to be executed twice
// and also to update to the new watched size.
this.setSize(newSize);
// change state so prepareFowWatch() won't throw exception about wrong order invocation.
this._state = SizeWatcher.states.appendedScrollWatchers;
// Run prepareForWatch to reset the scroll watchers, we have already set the size
this.prepareForWatch();
// Set state to listeningForSizeChange, there is no need to invoke beginWatching() method as scroll event
// listeners and callback are already set.
this._state = SizeWatcher.states.watchingForSizeChange;
}