Bug 1362120 - Always enable SVG-in-OpenType in the parent process. r=heycam
authorJonathan Watt <jwatt@jwatt.org>
Thu, 20 Apr 2017 10:35:08 +0100
changeset 356998 bd9b7b29f95690ab9c3aacd7864206c68509fa8d
parent 356997 284d41dc240f0dea28af10a52327d0e6a99f62cd
child 356999 6086ceba2e8c787768266479d694806725e90add
push id31778
push usercbook@mozilla.com
push dateMon, 08 May 2017 08:07:41 +0000
treeherdermozilla-central@1fda52a1f3b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1362120
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1362120 - Always enable SVG-in-OpenType in the parent process. r=heycam MozReview-Commit-ID: HhJpF6DXdPm
gfx/thebes/gfxPlatform.cpp
layout/style/nsCSSParser.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1607,17 +1607,19 @@ gfxPlatform::UseCmapsDuringSystemFallbac
 bool
 gfxPlatform::OpenTypeSVGEnabled()
 {
     if (mOpenTypeSVGEnabled == UNINITIALIZED_VALUE) {
         mOpenTypeSVGEnabled =
             Preferences::GetBool(GFX_PREF_OPENTYPE_SVG, false);
     }
 
-    return mOpenTypeSVGEnabled > 0;
+    return mOpenTypeSVGEnabled > 0 ||
+           // is e10s parent process:
+           (XRE_IsParentProcess() && BrowserTabsRemoteAutostart());
 }
 
 uint32_t
 gfxPlatform::WordCacheCharLimit()
 {
     if (mWordCacheCharLimit == UNINITIALIZED_VALUE) {
         mWordCacheCharLimit =
             Preferences::GetInt(GFX_PREF_WORD_CACHE_CHARLIMIT, 32);
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -19,16 +19,17 @@
 
 #include <algorithm> // for std::stable_sort
 #include <limits> // for std::numeric_limits
 
 #include "nsAlgorithm.h"
 #include "nsCSSProps.h"
 #include "nsCSSKeywords.h"
 #include "nsCSSScanner.h"
+#include "nsXULAppAPI.h"
 #include "mozilla/css/ErrorReporter.h"
 #include "mozilla/css/Loader.h"
 #include "mozilla/css/StyleRule.h"
 #include "mozilla/css/ImportRule.h"
 #include "nsCSSRules.h"
 #include "nsCSSFontFaceRule.h"
 #include "mozilla/css/NameSpaceRule.h"
 #include "nsTArray.h"
@@ -17911,18 +17912,24 @@ CSSParserImpl::IsValueValidForProperty(c
 
 // Recycling of parser implementation objects
 
 static CSSParserImpl* gFreeList = nullptr;
 
 /* static */ void
 nsCSSParser::Startup()
 {
-  Preferences::AddBoolVarCache(&sOpentypeSVGEnabled,
-                               "gfx.font_rendering.opentype_svg.enabled");
+  const bool isE10sParent = XRE_IsParentProcess() && BrowserTabsRemoteAutostart();
+
+  if (isE10sParent) {
+    sOpentypeSVGEnabled = true;
+  } else {
+    Preferences::AddBoolVarCache(&sOpentypeSVGEnabled,
+                                 "gfx.font_rendering.opentype_svg.enabled");
+  }
   Preferences::AddBoolVarCache(&sWebkitPrefixedAliasesEnabled,
                                "layout.css.prefixes.webkit");
   Preferences::AddBoolVarCache(&sWebkitDevicePixelRatioEnabled,
                                "layout.css.prefixes.device-pixel-ratio-webkit");
   Preferences::AddBoolVarCache(&sMozGradientsEnabled,
                                "layout.css.prefixes.gradients");
   Preferences::AddBoolVarCache(&sControlCharVisibility,
                                "layout.css.control-characters.visible");