Handle font-family strings containing both single and double quotes.

Fixes a failing unit test with WebKitGTK 2.18.

* ui/composer-web-view.js (EditContext::init): Check for and strip both "
  and ' from start and end of font-family string.
This commit is contained in:
Michael James Gratton 2017-11-16 10:48:42 +11:00
parent ccabe6ed6c
commit 7ad97fb5d9

View file

@ -616,7 +616,7 @@ EditContext.prototype = {
let styles = window.getComputedStyle(node);
let fontFamily = styles.getPropertyValue("font-family");
if (fontFamily.charAt() == "'") {
if (["'", "\""].indexOf(fontFamily.charAt()) != -1) {
fontFamily = fontFamily.substr(1, fontFamily.length - 2);
}
this.fontFamily = fontFamily;