mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 11:38:16 +00:00
Consolidate SetEnabled and SetDisabled; make sure both of them clear the rule cascade on the rule processors. Bug 230651, r+sr=bzbarsky.
This commit is contained in:
parent
107a86d7ae
commit
072b7160a8
@ -1873,18 +1873,7 @@ CSSStyleSheetImpl::GetApplicable(PRBool& aApplicable) const
|
||||
NS_IMETHODIMP
|
||||
CSSStyleSheetImpl::SetEnabled(PRBool aEnabled)
|
||||
{
|
||||
PRBool oldDisabled = mDisabled;
|
||||
mDisabled = !aEnabled;
|
||||
|
||||
if (mDocument && mInner && mInner->mComplete && oldDisabled != mDisabled) {
|
||||
ClearRuleCascades();
|
||||
|
||||
mDocument->BeginUpdate(UPDATE_STYLE);
|
||||
mDocument->SetStyleSheetApplicableState(this, !mDisabled);
|
||||
mDocument->EndUpdate(UPDATE_STYLE);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return CSSStyleSheetImpl::SetDisabled(!aEnabled);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -2446,6 +2435,8 @@ CSSStyleSheetImpl::SetDisabled(PRBool aDisabled)
|
||||
mDisabled = aDisabled;
|
||||
|
||||
if (mDocument && mInner && mInner->mComplete && oldDisabled != mDisabled) {
|
||||
ClearRuleCascades();
|
||||
|
||||
mDocument->BeginUpdate(UPDATE_STYLE);
|
||||
mDocument->SetStyleSheetApplicableState(this, !mDisabled);
|
||||
mDocument->EndUpdate(UPDATE_STYLE);
|
||||
|
@ -1873,18 +1873,7 @@ CSSStyleSheetImpl::GetApplicable(PRBool& aApplicable) const
|
||||
NS_IMETHODIMP
|
||||
CSSStyleSheetImpl::SetEnabled(PRBool aEnabled)
|
||||
{
|
||||
PRBool oldDisabled = mDisabled;
|
||||
mDisabled = !aEnabled;
|
||||
|
||||
if (mDocument && mInner && mInner->mComplete && oldDisabled != mDisabled) {
|
||||
ClearRuleCascades();
|
||||
|
||||
mDocument->BeginUpdate(UPDATE_STYLE);
|
||||
mDocument->SetStyleSheetApplicableState(this, !mDisabled);
|
||||
mDocument->EndUpdate(UPDATE_STYLE);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return CSSStyleSheetImpl::SetDisabled(!aEnabled);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -2446,6 +2435,8 @@ CSSStyleSheetImpl::SetDisabled(PRBool aDisabled)
|
||||
mDisabled = aDisabled;
|
||||
|
||||
if (mDocument && mInner && mInner->mComplete && oldDisabled != mDisabled) {
|
||||
ClearRuleCascades();
|
||||
|
||||
mDocument->BeginUpdate(UPDATE_STYLE);
|
||||
mDocument->SetStyleSheetApplicableState(this, !mDisabled);
|
||||
mDocument->EndUpdate(UPDATE_STYLE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user