Bug 1221436 patch 7 - Remove ReplaceStyleRule/ReplaceRuleInGroup mechanism. r=heycam

This is no longer used, thanks to patch 5.

--HG--
extra : commitid : HUH1X5rr3Ij
This commit is contained in:
L. David Baron 2015-11-09 15:57:17 +08:00
Родитель 764b2b1601
Коммит 62dcb6818d
4 изменённых файлов: 0 добавлений и 51 удалений

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

@ -1552,27 +1552,6 @@ CSSStyleSheet::AppendStyleRule(css::Rule* aRule)
}
}
void
CSSStyleSheet::ReplaceStyleRule(css::Rule* aOld, css::Rule* aNew)
{
NS_PRECONDITION(mInner->mOrderedRules.Count() != 0, "can't have old rule");
NS_PRECONDITION(mInner->mComplete, "No replacing in an incomplete sheet!");
WillDirty();
int32_t index = mInner->mOrderedRules.IndexOf(aOld);
if (MOZ_UNLIKELY(index == -1)) {
NS_NOTREACHED("Couldn't find old rule");
return;
}
mInner->mOrderedRules.ReplaceObjectAt(aNew, index);
aNew->SetStyleSheet(this);
aOld->SetStyleSheet(nullptr);
DidDirty();
NS_ASSERTION(css::Rule::NAMESPACE_RULE != aNew->GetType(), "not yet implemented");
NS_ASSERTION(css::Rule::NAMESPACE_RULE != aOld->GetType(), "not yet implemented");
}
int32_t
CSSStyleSheet::StyleRuleCount() const
{
@ -2202,20 +2181,6 @@ CSSStyleSheet::InsertRuleIntoGroup(const nsAString & aRule,
return NS_OK;
}
nsresult
CSSStyleSheet::ReplaceRuleInGroup(css::GroupRule* aGroup,
css::Rule* aOld, css::Rule* aNew)
{
NS_PRECONDITION(mInner->mComplete, "No replacing in an incomplete sheet!");
NS_ASSERTION(this == aGroup->GetStyleSheet(), "group doesn't belong to this sheet");
WillDirty();
nsresult result = aGroup->ReplaceStyleRule(aOld, aNew);
DidDirty();
return result;
}
// nsICSSLoaderObserver implementation
NS_IMETHODIMP
CSSStyleSheet::StyleSheetLoaded(CSSStyleSheet* aSheet,

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

@ -159,14 +159,12 @@ public:
// XXX do these belong here or are they generic?
void AppendStyleRule(css::Rule* aRule);
void ReplaceStyleRule(css::Rule* aOld, css::Rule* aNew);
int32_t StyleRuleCount() const;
css::Rule* GetStyleRuleAt(int32_t aIndex) const;
nsresult DeleteRuleFromGroup(css::GroupRule* aGroup, uint32_t aIndex);
nsresult InsertRuleIntoGroup(const nsAString& aRule, css::GroupRule* aGroup, uint32_t aIndex, uint32_t* _retval);
nsresult ReplaceRuleInGroup(css::GroupRule* aGroup, css::Rule* aOld, css::Rule* aNew);
/**
* SetURIs must be called on all sheets before parsing into them.

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

@ -65,7 +65,6 @@ public:
*/
nsresult DeleteStyleRuleAt(uint32_t aIndex);
nsresult InsertStyleRuleAt(uint32_t aIndex, Rule* aRule);
nsresult ReplaceStyleRule(Rule *aOld, Rule *aNew);
virtual bool UseForPresentation(nsPresContext* aPresContext,
nsMediaQueryResultCacheKey& aKey) = 0;

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

@ -507,19 +507,6 @@ GroupRule::InsertStyleRuleAt(uint32_t aIndex, Rule* aRule)
return NS_OK;
}
nsresult
GroupRule::ReplaceStyleRule(Rule* aOld, Rule* aNew)
{
int32_t index = mRules.IndexOf(aOld);
NS_ENSURE_TRUE(index != -1, NS_ERROR_UNEXPECTED);
mRules.ReplaceObjectAt(aNew, index);
aNew->SetStyleSheet(GetStyleSheet());
aNew->SetParentRule(this);
aOld->SetStyleSheet(nullptr);
aOld->SetParentRule(nullptr);
return NS_OK;
}
void
GroupRule::AppendRulesToCssText(nsAString& aCssText)
{