[geary/bug/788797-missing_text_caret: 3/5] Handle font-family strings containing both single and double quotes.



commit 7ad97fb5d90755fefb41d9e6a42bc5771d923cd6
Author: Michael James Gratton <mike vee net>
Date:   Thu Nov 16 10:48:42 2017 +1100

    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.

 ui/composer-web-view.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/ui/composer-web-view.js b/ui/composer-web-view.js
index a0ab097..63cea8e 100644
--- a/ui/composer-web-view.js
+++ b/ui/composer-web-view.js
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]