Bug 1221436 patch 3 - Remove Rule::SetHTMLCSSStyleSheet and related code, now unused. r=heycam

This was made unused by patch 2.
This commit is contained in:
L. David Baron 2015-11-09 15:57:16 +08:00
parent 87f75f0802
commit b81fbdc72b
2 changed files with 5 additions and 40 deletions

View File

@ -33,7 +33,7 @@ class GroupRule;
class Rule : public nsISupports { class Rule : public nsISupports {
protected: protected:
Rule(uint32_t aLineNumber, uint32_t aColumnNumber) Rule(uint32_t aLineNumber, uint32_t aColumnNumber)
: mSheet(0), : mSheet(nullptr),
mParentRule(nullptr), mParentRule(nullptr),
mLineNumber(aLineNumber), mLineNumber(aLineNumber),
mColumnNumber(aColumnNumber) mColumnNumber(aColumnNumber)
@ -80,8 +80,7 @@ public:
virtual int32_t GetType() const = 0; virtual int32_t GetType() const = 0;
CSSStyleSheet* GetStyleSheet() const; CSSStyleSheet* GetStyleSheet() const { return mSheet; }
nsHTMLCSSStyleSheet* GetHTMLCSSStyleSheet() const;
// Return the document the rule lives in, if any // Return the document the rule lives in, if any
nsIDocument* GetDocument() const nsIDocument* GetDocument() const
@ -91,9 +90,6 @@ public:
} }
virtual void SetStyleSheet(CSSStyleSheet* aSheet); virtual void SetStyleSheet(CSSStyleSheet* aSheet);
// This does not need to be virtual, because GroupRule and MediaRule are not
// used for inline style.
void SetHTMLCSSStyleSheet(nsHTMLCSSStyleSheet* aSheet);
void SetParentRule(GroupRule* aRule) { void SetParentRule(GroupRule* aRule) {
// We don't reference count this up reference. The group rule // We don't reference count this up reference. The group rule
@ -133,9 +129,8 @@ public:
void* aData); void* aData);
protected: protected:
// This is either a CSSStyleSheet* or an nsHTMLStyleSheet*. The former // This is sometimes null (e.g., for style attributes).
// if the low bit is 0, the latter if the low bit is 1. CSSStyleSheet* mSheet;
uintptr_t mSheet;
// When the parent GroupRule is destroyed, it will call SetParentRule(nullptr) // When the parent GroupRule is destroyed, it will call SetParentRule(nullptr)
// on this object. (Through SetParentRuleReference); // on this object. (Through SetParentRuleReference);
GroupRule* MOZ_NON_OWNING_REF mParentRule; GroupRule* MOZ_NON_OWNING_REF mParentRule;

View File

@ -55,43 +55,13 @@ IMPL_STYLE_RULE_INHERIT_GET_DOM_RULE_WEAK(class_, super_)
namespace mozilla { namespace mozilla {
namespace css { namespace css {
CSSStyleSheet*
Rule::GetStyleSheet() const
{
if (!(mSheet & 0x1)) {
return reinterpret_cast<CSSStyleSheet*>(mSheet);
}
return nullptr;
}
nsHTMLCSSStyleSheet*
Rule::GetHTMLCSSStyleSheet() const
{
if (mSheet & 0x1) {
return reinterpret_cast<nsHTMLCSSStyleSheet*>(mSheet & ~uintptr_t(0x1));
}
return nullptr;
}
/* virtual */ void /* virtual */ void
Rule::SetStyleSheet(CSSStyleSheet* aSheet) Rule::SetStyleSheet(CSSStyleSheet* aSheet)
{ {
// We don't reference count this up reference. The style sheet // We don't reference count this up reference. The style sheet
// will tell us when it's going away or when we're detached from // will tell us when it's going away or when we're detached from
// it. // it.
mSheet = reinterpret_cast<uintptr_t>(aSheet); mSheet = aSheet;
}
void
Rule::SetHTMLCSSStyleSheet(nsHTMLCSSStyleSheet* aSheet)
{
// We don't reference count this up reference. The style sheet
// will tell us when it's going away or when we're detached from
// it.
mSheet = reinterpret_cast<uintptr_t>(aSheet);
mSheet |= 0x1;
} }
nsresult nsresult