From 93109e7bf59a1f947fe9ee3c3b031997583a28b3 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Tue, 31 May 2011 14:18:50 +0900 Subject: [PATCH] Bug 660587 - Remove nsRuleNode::gLangService. r=roc --- layout/build/nsLayoutModule.cpp | 1 - layout/build/nsLayoutStatics.cpp | 2 -- layout/style/nsRuleNode.cpp | 17 ++++------------- layout/style/nsRuleNode.h | 2 -- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 384945da544..4921e6523b0 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -89,7 +89,6 @@ #include "nsBox.h" #include "nsIFrameTraversal.h" #include "nsLayoutCID.h" -#include "nsILanguageAtomService.h" #include "nsStyleSheetService.h" #include "nsXULPopupManager.h" #include "nsFocusManager.h" diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index 012a6db8088..e378385de8a 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -338,8 +338,6 @@ nsLayoutStatics::Shutdown() nsCSSScanner::ReleaseGlobals(); - NS_IF_RELEASE(nsRuleNode::gLangService); - nsTextFragment::Shutdown(); nsAttrValue::Shutdown(); diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 8b06de84fb1..21a00a2a89f 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -67,7 +67,6 @@ #include "nsSize.h" #include "imgIRequest.h" #include "nsRuleData.h" -#include "nsILanguageAtomService.h" #include "nsIStyleRule.h" #include "nsBidiUtils.h" #include "nsUnicharUtils.h" @@ -1172,8 +1171,6 @@ nsRuleNode* nsRuleNode::CreateRootNode(nsPresContext* aPresContext) nsRuleNode(aPresContext, nsnull, nsnull, 0xff, PR_FALSE); } -nsILanguageAtomService* nsRuleNode::gLangService = nsnull; - nsRuleNode::nsRuleNode(nsPresContext* aContext, nsRuleNode* aParent, nsIStyleRule* aRule, PRUint8 aLevel, PRBool aIsImportant) @@ -4528,17 +4525,11 @@ nsRuleNode::ComputeVisibilityData(void* aStartStruct, // this is not a real CSS property, it is a html attribute mapped to CSS struture const nsCSSValue* langValue = aRuleData->ValueForLang(); if (eCSSUnit_Ident == langValue->GetUnit()) { - if (!gLangService) { - CallGetService(NS_LANGUAGEATOMSERVICE_CONTRACTID, &gLangService); - } + nsAutoString lang; + langValue->GetStringValue(lang); - if (gLangService) { - nsAutoString lang; - langValue->GetStringValue(lang); - - nsContentUtils::ASCIIToLower(lang); - visibility->mLanguage = do_GetAtom(lang); - } + nsContentUtils::ASCIIToLower(lang); + visibility->mLanguage = do_GetAtom(lang); } COMPUTE_END_INHERITED(Visibility, visibility) diff --git a/layout/style/nsRuleNode.h b/layout/style/nsRuleNode.h index 8de4912f75d..bd5eb0ab8de 100644 --- a/layout/style/nsRuleNode.h +++ b/layout/style/nsRuleNode.h @@ -50,7 +50,6 @@ class nsStyleContext; struct PLDHashTable; -class nsILanguageAtomService; struct nsRuleData; class nsIStyleRule; struct nsCSSValueList; @@ -416,7 +415,6 @@ public: // (which comes from the presShell) to perform the allocation. void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW; void Destroy() { DestroyInternal(nsnull); } - static nsILanguageAtomService* gLangService; // Implemented in nsStyleSet.h, since it needs to know about nsStyleSet. inline void AddRef();