Bug 1210575 part 4: Prevent CSS parser from invoking CSSUnprefixingService if native webkit prefix support is enabled. r=heycam
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 07 Oct 2015 11:02:50 -0700
changeset 266571 73d17d930b759852b5104e713ab21841d2b07d29
parent 266570 d7c82707060bb75e595a85203e94cd7dba4e9e88
child 266647 2499a66d5b37595ec35063b0a6c3d7ed1a9cf154
push id66234
push userdholbert@mozilla.com
push dateWed, 07 Oct 2015 18:04:06 +0000
treeherdermozilla-inbound@73d17d930b75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1210575
milestone44.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 1210575 part 4: Prevent CSS parser from invoking CSSUnprefixingService if native webkit prefix support is enabled. r=heycam
layout/style/nsCSSParser.cpp
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -52,16 +52,17 @@
 #include "gfxFontFamilyList.h"
 
 using namespace mozilla;
 
 typedef nsCSSProps::KTableValue KTableValue;
 
 // pref-backed bool values (hooked up in nsCSSParser::Startup)
 static bool sOpentypeSVGEnabled;
+static bool sWebkitPrefixedAliasesEnabled;
 static bool sUnprefixingServiceEnabled;
 #ifdef NIGHTLY_BUILD
 static bool sUnprefixingServiceGloballyWhitelisted;
 #endif
 static bool sMozGradientsEnabled;
 static bool sControlCharVisibility;
 
 const uint32_t
@@ -6688,16 +6689,21 @@ CSSParserImpl::LookupKeywordPrefixAware(
 
 bool
 CSSParserImpl::ShouldUseUnprefixingService() const
 {
   if (!sUnprefixingServiceEnabled) {
     // Unprefixing is globally disabled.
     return false;
   }
+  if (sWebkitPrefixedAliasesEnabled) {
+    // Native webkit-prefix support is enabled, which trumps the unprefixing
+    // service for handling prefixed CSS. Don't try to use both at once.
+    return false;
+  }
 
 #ifdef NIGHTLY_BUILD
   if (sUnprefixingServiceGloballyWhitelisted) {
     // Unprefixing is globally whitelisted,
     // so no need to check mSheetPrincipal.
     return true;
   }
 #endif
@@ -15722,16 +15728,18 @@ CSSParserImpl::IsValueValidForProperty(c
 
 static CSSParserImpl* gFreeList = nullptr;
 
 /* static */ void
 nsCSSParser::Startup()
 {
   Preferences::AddBoolVarCache(&sOpentypeSVGEnabled,
                                "gfx.font_rendering.opentype_svg.enabled");
+  Preferences::AddBoolVarCache(&sWebkitPrefixedAliasesEnabled,
+                               "layout.css.prefixes.webkit");
   Preferences::AddBoolVarCache(&sUnprefixingServiceEnabled,
                                "layout.css.unprefixing-service.enabled");
 #ifdef NIGHTLY_BUILD
   Preferences::AddBoolVarCache(&sUnprefixingServiceGloballyWhitelisted,
                                "layout.css.unprefixing-service.globally-whitelisted");
 #endif
   Preferences::AddBoolVarCache(&sMozGradientsEnabled,
                                "layout.css.prefixes.gradients");