Bug 1573268 - Convert layout.css.ruby.intercharacter.enabled to static pref. r=njn

Converts layout.css.ruby.intercharacter.enabled to a static pref and removes the associated function nsLayoutUtils::IsInterCharacterRubyEnabled(). Also removes the macro INTERCHARACTER_RUBY_ENABLED_PREF_NAME, since it was only being used to add the varcache pref.

Differential Revision: https://phabricator.services.mozilla.com/D41653

--HG--
extra : moz-landing-system : lando
This commit is contained in:
kriswright 2019-08-13 22:52:38 +00:00
parent 6c57b2f2a8
commit 2809ff7952
5 changed files with 8 additions and 25 deletions

View File

@ -167,9 +167,6 @@ using namespace mozilla::gfx;
using mozilla::dom::HTMLMediaElement_Binding::HAVE_METADATA;
using mozilla::dom::HTMLMediaElement_Binding::HAVE_NOTHING;
#define INTERCHARACTER_RUBY_ENABLED_PREF_NAME \
"layout.css.ruby.intercharacter.enabled"
// The time in number of frames that we estimate for a refresh driver
// to be quiescent
#define DEFAULT_QUIESCENT_FRAMES 2
@ -557,19 +554,6 @@ bool nsLayoutUtils::GPUImageScalingEnabled() {
return sGPUImageScalingEnabled;
}
bool nsLayoutUtils::IsInterCharacterRubyEnabled() {
static bool sInterCharacterRubyEnabled;
static bool sInterCharacterRubyEnabledPrefCached = false;
if (!sInterCharacterRubyEnabledPrefCached) {
sInterCharacterRubyEnabledPrefCached = true;
Preferences::AddBoolVarCache(&sInterCharacterRubyEnabled,
INTERCHARACTER_RUBY_ENABLED_PREF_NAME, false);
}
return sInterCharacterRubyEnabled;
}
void nsLayoutUtils::UnionChildOverflow(nsIFrame* aFrame,
nsOverflowAreas& aOverflowAreas,
FrameChildListIDs aSkipChildLists) {

View File

@ -2397,11 +2397,6 @@ class nsLayoutUtils {
*/
static bool GPUImageScalingEnabled();
/**
* Checks whether support for inter-character ruby is enabled.
*/
static bool IsInterCharacterRubyEnabled();
static bool InterruptibleReflowEnabled() {
return sInterruptibleReflowEnabled;
}

View File

@ -12,6 +12,7 @@
#include "mozilla/ComputedStyle.h"
#include "mozilla/Maybe.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/WritingModes.h"
#include "nsLineLayout.h"
#include "nsPresContext.h"
@ -312,7 +313,7 @@ void nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
LogicalPoint position(lineWM);
if (side.isSome()) {
if (nsLayoutUtils::IsInterCharacterRubyEnabled() &&
if (StaticPrefs::layout_css_ruby_intercharacter_enabled() &&
rtcWM.IsVerticalRL() &&
lineWM.GetInlineDir() == WritingMode::eInlineLTR) {
// Inter-character ruby annotations are only supported for vertical-rl

View File

@ -4329,6 +4329,12 @@
value: true
mirror: always
# Are inter-character ruby annotations enabled?
- name: layout.css.ruby.intercharacter.enabled
type: bool
value: false
mirror: always
- name: layout.css.scroll-behavior.damping-ratio
type: AtomicFloat
value: 1.0f

View File

@ -2952,9 +2952,6 @@ pref("layout.css.scroll-behavior.spring-constant", "250.0");
// at the greatest speed without overshooting.
pref("layout.css.scroll-behavior.damping-ratio", "1.0");
// Are inter-character ruby annotations enabled?
pref("layout.css.ruby.intercharacter.enabled", false);
// pref for which side vertical scrollbars should be on
// 0 = end-side in UI direction
// 1 = end-side in document/content direction