зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1418217 - Move visited links pref to StylePrefs. r=TYLin
On a CLOSED TREE to fix Servo bustage. MozReview-Commit-ID: HLukaX0EFFv
This commit is contained in:
Родитель
12e4204b4d
Коммит
99c87da38a
|
@ -236,7 +236,6 @@ nsLayoutStatics::Initialize()
|
|||
}
|
||||
|
||||
StylePrefs::Init();
|
||||
nsCSSRuleProcessor::Startup();
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
rv = nsXULPopupManager::Init();
|
||||
|
|
|
@ -307,12 +307,6 @@ Gecko_IsPrivateBrowsingEnabled(const nsIDocument* aDoc)
|
|||
return loadContext && loadContext->UsePrivateBrowsing();
|
||||
}
|
||||
|
||||
bool
|
||||
Gecko_AreVisitedLinksEnabled()
|
||||
{
|
||||
return nsCSSRuleProcessor::VisitedLinksEnabled();
|
||||
}
|
||||
|
||||
EventStates::ServoType
|
||||
Gecko_ElementState(RawGeckoElementBorrowed aElement)
|
||||
{
|
||||
|
|
|
@ -235,8 +235,6 @@ Gecko_GetActiveLinkAttrDeclarationBlock(RawGeckoElementBorrowed element);
|
|||
|
||||
// Returns whether private browsing is enabled for a given element.
|
||||
bool Gecko_IsPrivateBrowsingEnabled(const nsIDocument* aDoc);
|
||||
// Returns whether visited links are enabled.
|
||||
bool Gecko_AreVisitedLinksEnabled();
|
||||
|
||||
// Animations
|
||||
bool
|
||||
|
|
|
@ -18,6 +18,7 @@ bool StylePrefs::sMozGradientsEnabled;
|
|||
bool StylePrefs::sControlCharVisibility;
|
||||
bool StylePrefs::sFramesTimingFunctionEnabled;
|
||||
bool StylePrefs::sUnprefixedFullscreenApiEnabled;
|
||||
bool StylePrefs::sVisitedLinksEnabled;
|
||||
|
||||
/* static */ void
|
||||
StylePrefs::Init()
|
||||
|
@ -38,6 +39,8 @@ StylePrefs::Init()
|
|||
"layout.css.frames-timing.enabled");
|
||||
Preferences::AddBoolVarCache(&sUnprefixedFullscreenApiEnabled,
|
||||
"full-screen-api.unprefix.enabled");
|
||||
Preferences::AddBoolVarCache(&sVisitedLinksEnabled,
|
||||
"layout.css.visited_links_enabled");
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -21,6 +21,7 @@ struct StylePrefs
|
|||
static bool sControlCharVisibility;
|
||||
static bool sFramesTimingFunctionEnabled;
|
||||
static bool sUnprefixedFullscreenApiEnabled;
|
||||
static bool sVisitedLinksEnabled;
|
||||
|
||||
static void Init();
|
||||
};
|
||||
|
|
|
@ -61,10 +61,6 @@ using namespace mozilla::dom;
|
|||
|
||||
typedef ArenaAllocator<4096, 8> CascadeAllocator;
|
||||
|
||||
#define VISITED_PSEUDO_PREF "layout.css.visited_links_enabled"
|
||||
|
||||
static bool gSupportVisitedPseudo = true;
|
||||
|
||||
static nsTArray< RefPtr<nsAtom> >* sSystemMetrics = 0;
|
||||
|
||||
#ifdef XP_WIN
|
||||
|
@ -1051,19 +1047,6 @@ nsCSSRuleProcessor::ClearSheets()
|
|||
mSheets.Clear();
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsCSSRuleProcessor::Startup()
|
||||
{
|
||||
Preferences::AddBoolVarCache(&gSupportVisitedPseudo, VISITED_PSEUDO_PREF,
|
||||
true);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCSSRuleProcessor::VisitedLinksEnabled()
|
||||
{
|
||||
return gSupportVisitedPseudo;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsCSSRuleProcessor::InitSystemMetrics()
|
||||
{
|
||||
|
@ -1259,7 +1242,7 @@ nsCSSRuleProcessor::GetContentState(const Element* aElement,
|
|||
// than in GetContentStateForVisitedHandling, so that we don't
|
||||
// expose that :visited support is disabled to the Web page.
|
||||
if (state.HasState(NS_EVENT_STATE_VISITED) &&
|
||||
(!gSupportVisitedPseudo ||
|
||||
(!StylePrefs::sVisitedLinksEnabled ||
|
||||
aElement->OwnerDoc()->IsBeingUsedAsImage() ||
|
||||
aUsingPrivateBrowsing)) {
|
||||
state &= ~NS_EVENT_STATE_VISITED;
|
||||
|
|
|
@ -81,8 +81,6 @@ public:
|
|||
public:
|
||||
nsresult ClearRuleCascades();
|
||||
|
||||
static bool VisitedLinksEnabled();
|
||||
static void Startup();
|
||||
static void InitSystemMetrics();
|
||||
static void Shutdown();
|
||||
static void FreeSystemMetrics();
|
||||
|
|
Загрузка…
Ссылка в новой задаче