Bug 1156463 - Add a preference option to disable the scale transform applied to MathML operators. r=karl
authorFrédéric Wang <fred.wang@free.fr>
Sat, 25 Apr 2015 00:48:00 +0200
changeset 241711 485cf348d18c4ab3f7df5bf7a6630ebcd119f50d
parent 241710 20de9d756c9b668caa95f277dee6de7b558b014c
child 241712 aba92cf22b0bc39acfe938d21d62790fa77623ed
push id59210
push usercbook@mozilla.com
push dateThu, 30 Apr 2015 08:28:13 +0000
treeherdermozilla-inbound@69cff2238ff9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarl
bugs1156463
milestone40.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 1156463 - Add a preference option to disable the scale transform applied to MathML operators. r=karl
layout/mathml/nsMathMLChar.cpp
modules/libpref/init/all.js
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -1699,16 +1699,21 @@ nsMathMLChar::StretchInternal(nsPresCont
   // We did not find a size variant or a glyph assembly to stretch this
   // operator. Verify whether a font with an OpenType MATH table is available
   // and record missing math script otherwise.
   gfxMissingFontRecorder* MFR = aPresContext->MissingFontRecorder();
   if (MFR && !fm->GetThebesFontGroup()->GetFirstMathFont()) {
     MFR->RecordScript(MOZ_SCRIPT_MATHEMATICAL_NOTATION);
   }
 
+  // If the scale_stretchy_operators option is disabled, we are done.
+  if (!Preferences::GetBool("mathml.scale_stretchy_operators.enabled", true)) {
+    return NS_OK;
+  }
+  
   // stretchy character
   if (stretchy) {
     if (isVertical) {
       float scale =
         std::min(kMaxScaleFactor, float(aContainerSize.ascent + aContainerSize.descent) /
         (aDesiredStretchSize.ascent + aDesiredStretchSize.descent));
       if (!largeop || scale > 1.0) {
         // make the character match the desired height.
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -246,16 +246,19 @@ pref("browser.chrome.toolbar_style",    
 // if 0, no images are used for tab icons for image documents.
 pref("browser.chrome.image_icons.max_size", 1024);
 
 pref("browser.triple_click_selects_paragraph", true);
 
 // Print/Preview Shrink-To-Fit won't shrink below 20% for text-ish documents.
 pref("print.shrink-to-fit.scale-limit-percent", 20);
 
+// Enable scale transform for stretchy MathML operators. See bug 414277.
+pref("mathml.scale_stretchy_operators.enabled", true);
+
 // Media cache size in kilobytes
 pref("media.cache_size", 512000);
 // When a network connection is suspended, don't resume it until the
 // amount of buffered data falls below this threshold (in seconds).
 pref("media.cache_resume_threshold", 999999);
 // Stop reading ahead when our buffered data is this many seconds ahead
 // of the current playback position. This limit can stop us from using arbitrary
 // amounts of network bandwidth prefetching huge videos.