Bug 1099557 followup - Put the default setting for control-character visibility behind a runtime pref, and keep it off-by-default on release builds for now. r=dbaron

This commit is contained in:
Jonathan Kew 2015-10-01 12:26:52 +01:00
Родитель be39b36374
Коммит fa18513a7e
6 изменённых файлов: 31 добавлений и 6 удалений

Просмотреть файл

@ -316,10 +316,10 @@ pref(layout.css.text-align-true-value.enabled,true) == text-align-true.html text
!= control-chars-02.html control-chars-02-notref.html != control-chars-02.html control-chars-02-notref.html
== control-chars-03a.html control-chars-03-ref.html == control-chars-03a.html control-chars-03-ref.html
== control-chars-03b.html control-chars-03-ref.html == control-chars-03b.html control-chars-03-ref.html
!= control-chars-04a.html control-chars-04-notref.html pref(layout.css.control-characters.visible,true) != control-chars-04a.html control-chars-04-notref.html
!= control-chars-04b.html control-chars-04-notref.html pref(layout.css.control-characters.visible,true) != control-chars-04b.html control-chars-04-notref.html
!= control-chars-04c.html control-chars-04-notref.html pref(layout.css.control-characters.visible,true) != control-chars-04c.html control-chars-04-notref.html
!= control-chars-04d.html control-chars-04-notref.html pref(layout.css.control-characters.visible,true) != control-chars-04d.html control-chars-04-notref.html
# font fallback for <space> when not supported in the primary font family - bug 970891 # font fallback for <space> when not supported in the primary font family - bug 970891
HTTP(..) == space-font-1.html space-font-1-ref.html HTTP(..) == space-font-1.html space-font-1-ref.html

Просмотреть файл

@ -62,6 +62,7 @@ static bool sUnprefixingServiceEnabled;
static bool sUnprefixingServiceGloballyWhitelisted; static bool sUnprefixingServiceGloballyWhitelisted;
#endif #endif
static bool sMozGradientsEnabled; static bool sMozGradientsEnabled;
static bool sControlCharVisibility;
const uint32_t const uint32_t
nsCSSProps::kParserVariantTable[eCSSProperty_COUNT_no_shorthands] = { nsCSSProps::kParserVariantTable[eCSSProperty_COUNT_no_shorthands] = {
@ -15717,6 +15718,8 @@ nsCSSParser::Startup()
#endif #endif
Preferences::AddBoolVarCache(&sMozGradientsEnabled, Preferences::AddBoolVarCache(&sMozGradientsEnabled,
"layout.css.prefixes.gradients"); "layout.css.prefixes.gradients");
Preferences::AddBoolVarCache(&sControlCharVisibility,
"layout.css.control-characters.visible");
} }
nsCSSParser::nsCSSParser(mozilla::css::Loader* aLoader, nsCSSParser::nsCSSParser(mozilla::css::Loader* aLoader,
@ -16049,3 +16052,12 @@ nsCSSParser::IsValueValidForProperty(const nsCSSProperty aPropID,
return static_cast<CSSParserImpl*>(mImpl)-> return static_cast<CSSParserImpl*>(mImpl)->
IsValueValidForProperty(aPropID, aPropValue); IsValueValidForProperty(aPropID, aPropValue);
} }
/* static */
uint8_t
nsCSSParser::ControlCharVisibilityDefault()
{
return sControlCharVisibility
? NS_STYLE_CONTROL_CHARACTER_VISIBILITY_VISIBLE
: NS_STYLE_CONTROL_CHARACTER_VISIBILITY_HIDDEN;
}

Просмотреть файл

@ -314,6 +314,11 @@ public:
bool IsValueValidForProperty(const nsCSSProperty aPropID, bool IsValueValidForProperty(const nsCSSProperty aPropID,
const nsAString& aPropValue); const nsAString& aPropValue);
// Return the default value to be used for -moz-control-character-visibility,
// from preferences (cached by our Startup(), so that both nsStyleText and
// nsRuleNode can have fast access to it).
static uint8_t ControlCharVisibilityDefault();
protected: protected:
// This is a CSSParserImpl*, but if we expose that type name in this // This is a CSSParserImpl*, but if we expose that type name in this
// header, we can't put the type definition (in nsCSSParser.cpp) in // header, we can't put the type definition (in nsCSSParser.cpp) in

Просмотреть файл

@ -4379,7 +4379,7 @@ nsRuleNode::ComputeTextData(void* aStartStruct,
conditions, conditions,
SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT, SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT,
parentText->mControlCharacterVisibility, parentText->mControlCharacterVisibility,
NS_STYLE_CONTROL_CHARACTER_VISIBILITY_VISIBLE, 0, 0, 0, 0); nsCSSParser::ControlCharVisibilityDefault(), 0, 0, 0, 0);
COMPUTE_END_INHERITED(Text, text) COMPUTE_END_INHERITED(Text, text)
} }

Просмотреть файл

@ -16,6 +16,7 @@
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsCRTGlue.h" #include "nsCRTGlue.h"
#include "nsCSSParser.h"
#include "nsCSSProps.h" #include "nsCSSProps.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
@ -3421,7 +3422,7 @@ nsStyleText::nsStyleText(void)
mRubyPosition = NS_STYLE_RUBY_POSITION_OVER; mRubyPosition = NS_STYLE_RUBY_POSITION_OVER;
mTextSizeAdjust = NS_STYLE_TEXT_SIZE_ADJUST_AUTO; mTextSizeAdjust = NS_STYLE_TEXT_SIZE_ADJUST_AUTO;
mTextCombineUpright = NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE; mTextCombineUpright = NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE;
mControlCharacterVisibility = NS_STYLE_CONTROL_CHARACTER_VISIBILITY_VISIBLE; mControlCharacterVisibility = nsCSSParser::ControlCharVisibilityDefault();
mLetterSpacing.SetNormalValue(); mLetterSpacing.SetNormalValue();
mLineHeight.SetNormalValue(); mLineHeight.SetNormalValue();

Просмотреть файл

@ -2394,6 +2394,13 @@ pref("layout.css.scroll-snap.enabled", true);
// Is support for document.fonts enabled? // Is support for document.fonts enabled?
pref("layout.css.font-loading-api.enabled", true); pref("layout.css.font-loading-api.enabled", true);
// Should stray control characters be rendered visibly?
#ifdef RELEASE_BUILD
pref("layout.css.control-characters.visible", false);
#else
pref("layout.css.control-characters.visible", true);
#endif
// pref for which side vertical scrollbars should be on // pref for which side vertical scrollbars should be on
// 0 = end-side in UI direction // 0 = end-side in UI direction
// 1 = end-side in document/content direction // 1 = end-side in document/content direction