|
for (var i = 0; i < attr.length; i++) { |
For an input tts:fontFamily value of e.g. "Arial, Roboto, proportionalSansSerif, default" the attr array looks like ["Arial", " Roboto", " proportionalSansSerif", " default"] and the code that does an equality test against those array items, for values like "proportionalSansSerif" finds that they are unequal.
Propose to add a call to trim() on the input vaalue before doing those tests.
The eventual impact of this is that the call to dom_element.style.fontFamily = rslt.join(","); generates a browser error "Error in parsing value for ‘font-family’. Declaration dropped." and the font-family property is not set.