1
1
1
1
1
1
1
{"ScriptPreparationCode":"function CleanUpFontFamilyStyles1(node) {\r\n\t\tvar fontOjects = node.find(\u0027span\u0027);\r\n\t\tfor (var ii = 0; ii \u003C fontOjects.length; \u002B\u002Bii) {\r\n\t\t\tvar obj = fontOjects.eq(ii);\r\n\t\t\tvar fontFamily = obj.css(\u0027font-family\u0027);\r\n\t\t\tif (!ss.isNullOrEmptyString(fontFamily)) {\r\n\t\t\t\tvar newCss = {};\r\n\t\t\t\tvar fontFaces = [];\r\n\t\t\t\tfontFaces.push(fontFamily);\r\n\t\t\t\tif (ss.startsWithString(fontFamily, \u0022\u0027\u0022) || ss.startsWithString(fontFamily, \u0027\u0022\u0027)) {\r\n\t\t\t\t\tfontFamily = fontFamily.substr(1, fontFamily.length - 2);\r\n\t\t\t\t}\r\n\t\t\t\tif (fontFaces.length \u003E 1) {\r\n\t\t\t\t\tnewCss[\u0027font-family\u0027] = fontFaces.join(\u0027,\u0027);\r\n\t\t\t\t\tobj.css(newCss);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\nfunction CleanUpFontFamilyStyles2(node) {\r\n\t\tvar fontOjects = node.find(\u0027span\u0027);\r\n \t\t\r\n \t\tfontOjects.each(function( index, obj ) {\r\n\t\t\tvar fontFamily = obj.style.fontFamily;\r\n\t\t\tif (!ss.isNullOrEmptyString(fontFamily)) {\r\n\t\t\t\tvar newCss = {};\r\n\t\t\t\tvar fontFaces = [];\r\n\t\t\t\tfontFaces.push(fontFamily);\r\n\t\t\t\tif (ss.startsWithString(fontFamily, \u0022\u0027\u0022) || ss.startsWithString(fontFamily, \u0027\u0022\u0027)) {\r\n\t\t\t\t\tfontFamily = fontFamily.substr(1, fontFamily.length - 2);\r\n\t\t\t\t}\r\n\t\t\t\tif (fontFaces.length \u003E 1) {\r\n\t\t\t\t\tnewCss[\u0027font-family\u0027] = fontFaces.join(\u0027,\u0027);\r\n\t\t\t\t\tobj.css(newCss);\r\n\t\t\t\t}\r\n\t\t\t}\r\n });\r\n\t};\r\n\r\nfunction CleanUpFontFamilyStyles3(node) {\r\n\t\tvar fontOjects = node.find(\u0027span\u0027);\r\n \t\t\r\n \t\tfontOjects.each(function( index, obj ) {\r\n\t\t\tvar fontFamily = window.getComputedStyle(obj).fontFamily;\r\n\t\t\tif (!ss.isNullOrEmptyString(fontFamily)) {\r\n\t\t\t\tvar newCss = {};\r\n\t\t\t\tvar fontFaces = [];\r\n\t\t\t\tfontFaces.push(fontFamily);\r\n\t\t\t\tif (ss.startsWithString(fontFamily, \u0022\u0027\u0022) || ss.startsWithString(fontFamily, \u0027\u0022\u0027)) {\r\n\t\t\t\t\tfontFamily = fontFamily.substr(1, fontFamily.length - 2);\r\n\t\t\t\t}\r\n\t\t\t\tif (fontFaces.length \u003E 1) {\r\n\t\t\t\t\tnewCss[\u0027font-family\u0027] = fontFaces.join(\u0027,\u0027);\r\n\t\t\t\t\tobj.css(newCss);\r\n\t\t\t\t}\r\n\t\t\t}\r\n });\r\n\t};","TestCases":[{"Name":"Test 1","Code":"CleanUpFontFamilyStyles1($(\u0022#testRoot\u0022));","IsDeferred":false},{"Name":"Optimized","Code":"CleanUpFontFamilyStyles2($(\u0022#testRoot\u0022));","IsDeferred":false},{"Name":"with getComputedStyle","Code":"CleanUpFontFamilyStyles3($(\u0022#testRoot\u0022));","IsDeferred":false}]}