Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Bug 645956 - Part 5: Remove NS_NewCSSCharsetRule, r=bzbarsky
Browse files Browse the repository at this point in the history
  • Loading branch information
topperc committed Mar 23, 2011
1 parent fae2ff7 commit 508c107
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
8 changes: 2 additions & 6 deletions layout/style/nsCSSParser.cpp
Expand Up @@ -1557,12 +1557,8 @@ CSSParserImpl::ParseCharsetRule(RuleAppendFunc aAppendFunc,
return PR_FALSE;
}

nsCOMPtr<nsICSSRule> rule;
NS_NewCSSCharsetRule(getter_AddRefs(rule), charset);

if (rule) {
(*aAppendFunc)(rule, aData);
}
nsCOMPtr<nsICSSRule> rule = new css::CharsetRule(charset);
(*aAppendFunc)(rule, aData);

return PR_TRUE;
}
Expand Down
23 changes: 0 additions & 23 deletions layout/style/nsCSSRules.cpp
Expand Up @@ -325,35 +325,12 @@ CharsetRule::GetParentRule(nsIDOMCSSRule** aParentRule)
return NS_OK;
}

} // namespace css
} // namespace mozilla

nsresult
NS_NewCSSCharsetRule(nsICSSRule** aInstancePtrResult, const nsAString& aEncoding)
{
if (! aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}

css::CharsetRule* it = new css::CharsetRule(aEncoding);

if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}

NS_ADDREF(*aInstancePtrResult = it);
return NS_OK;
}



// -------------------------------------------
// ImportRule
//

namespace mozilla {
namespace css {

ImportRule::ImportRule(nsMediaList* aMedia, const nsString& aURLSpec)
: Rule()
, mURLSpec(aURLSpec)
Expand Down
6 changes: 0 additions & 6 deletions layout/style/nsICSSRule.h
Expand Up @@ -105,10 +105,4 @@ class nsICSSRule : public nsIStyleRule {

NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSRule, NS_ICSS_RULE_IID)

/* Define global NS_New* functions for rules that don't need their own
interfaces here */
nsresult
NS_NewCSSCharsetRule(nsICSSRule** aInstancePtrResult,
const nsAString& aEncoding);

#endif /* nsICSSRule_h */

0 comments on commit 508c107

Please sign in to comment.