Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsCSSRules.cpp File Reference
#include "nsCSSRules.h"
#include "nsICSSImportRule.h"
#include "nsICSSNameSpaceRule.h"
#include "nsString.h"
#include "nsIAtom.h"
#include "nsISupportsArray.h"
#include "nsIURL.h"
#include "nsCSSRule.h"
#include "nsLayoutAtoms.h"
#include "nsICSSStyleSheet.h"
#include "nsCOMPtr.h"
#include "nsIDOMCSSStyleSheet.h"
#include "nsIDOMCSSRule.h"
#include "nsIDOMCSSImportRule.h"
#include "nsIDOMCSSMediaRule.h"
#include "nsIDOMCSSMozDocumentRule.h"
#include "nsIDOMCSSCharsetRule.h"
#include "nsIMediaList.h"
#include "nsIDOMMediaList.h"
#include "nsIDOMCSSRuleList.h"
#include "nsIDOMStyleSheet.h"
#include "nsIDocument.h"
#include "nsPresContext.h"
#include "nsContentUtils.h"
#include "nsStyleConsts.h"
#include "nsDOMError.h"

Go to the source code of this file.

Classes

class  CSSGroupRuleRuleListImpl
class  CSSCharsetRuleImpl
class  CSSImportRuleImpl
class  CSSNameSpaceRuleImpl

Defines

#define IMPL_STYLE_RULE_INHERIT(_class, super)
#define IMPL_STYLE_RULE_INHERIT2(_class, super)

Functions

nsresult NS_NewCSSCharsetRule (nsICSSRule **aInstancePtrResult, const nsAString &aEncoding)
nsresult NS_NewCSSImportRule (nsICSSImportRule **aInstancePtrResult, const nsString &aURLSpec, nsMediaList *aMedia)
static PRBool CloneRuleInto (nsISupports *aRule, void *aArray)
static PRBool SetParentRuleReference (nsISupports *aRule, void *aParentRule)
static PRBool SetStyleSheetReference (nsISupports *aRule, void *aSheet)
nsresult NS_NewCSSNameSpaceRule (nsICSSNameSpaceRule **aInstancePtrResult, nsIAtom *aPrefix, const nsString &aURLSpec)

Define Documentation

#define IMPL_STYLE_RULE_INHERIT (   _class,
  super 
)
Value:
NS_IMETHODIMP _class::GetStyleSheet(nsIStyleSheet*& aSheet) const { return super::GetStyleSheet(aSheet); }  \
NS_IMETHODIMP _class::SetStyleSheet(nsICSSStyleSheet* aSheet) { return super::SetStyleSheet(aSheet); }  \
NS_IMETHODIMP _class::SetParentRule(nsICSSGroupRule* aRule) { return super::SetParentRule(aRule); }  \
NS_IMETHODIMP _class::GetDOMRule(nsIDOMCSSRule** aDOMRule) { return CallQueryInterface(this, aDOMRule); }  \
NS_IMETHODIMP _class::MapRuleInfoInto(nsRuleData* aRuleData) { return NS_OK; }

Definition at line 69 of file nsCSSRules.cpp.

#define IMPL_STYLE_RULE_INHERIT2 (   _class,
  super 
)
Value:
NS_IMETHODIMP _class::GetStyleSheet(nsIStyleSheet*& aSheet) const { return super::GetStyleSheet(aSheet); }  \
NS_IMETHODIMP _class::SetParentRule(nsICSSGroupRule* aRule) { return super::SetParentRule(aRule); }  \
NS_IMETHODIMP _class::GetDOMRule(nsIDOMCSSRule** aDOMRule) { return CallQueryInterface(this, aDOMRule); }  \
NS_IMETHODIMP _class::MapRuleInfoInto(nsRuleData* aRuleData) { return NS_OK; }

Definition at line 76 of file nsCSSRules.cpp.


Function Documentation

static PRBool CloneRuleInto ( nsISupports *  aRule,
void aArray 
) [static]

Definition at line 630 of file nsCSSRules.cpp.

{
  nsICSSRule* rule = (nsICSSRule*)aRule;
  nsICSSRule* clone = nsnull;
  rule->Clone(clone);
  if (clone) {
    nsISupportsArray* array = (nsISupportsArray*)aArray;
    array->AppendElement(clone);
    NS_RELEASE(clone);
  }
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewCSSCharsetRule ( nsICSSRule **  aInstancePtrResult,
const nsAString &  aEncoding 
)

Definition at line 275 of file nsCSSRules.cpp.

{
  if (! aInstancePtrResult) {
    return NS_ERROR_NULL_POINTER;
  }

  CSSCharsetRuleImpl* it = new CSSCharsetRuleImpl(aEncoding);

  if (! it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  return CallQueryInterface(it, aInstancePtrResult);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewCSSImportRule ( nsICSSImportRule **  aInstancePtrResult,
const nsString aURLSpec,
nsMediaList aMedia 
)

Definition at line 523 of file nsCSSRules.cpp.

{
  NS_ENSURE_ARG_POINTER(aInstancePtrResult);

  CSSImportRuleImpl* it = new CSSImportRuleImpl(aMedia);

  if (! it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  it->SetURLSpec(aURLSpec);
  return CallQueryInterface(it, aInstancePtrResult);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewCSSNameSpaceRule ( nsICSSNameSpaceRule **  aInstancePtrResult,
nsIAtom aPrefix,
const nsString aURLSpec 
)

Definition at line 1440 of file nsCSSRules.cpp.

{
  if (! aInstancePtrResult) {
    return NS_ERROR_NULL_POINTER;
  }

  CSSNameSpaceRuleImpl* it = new CSSNameSpaceRuleImpl();

  if (! it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  it->SetPrefix(aPrefix);
  it->SetURLSpec(aURLSpec);
  return CallQueryInterface(it, aInstancePtrResult);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool SetParentRuleReference ( nsISupports *  aRule,
void aParentRule 
) [static]

Definition at line 644 of file nsCSSRules.cpp.

{
  nsICSSRule* rule = NS_STATIC_CAST(nsICSSRule*, aRule);
  nsCSSGroupRule* parentRule = NS_STATIC_CAST(nsCSSGroupRule*, aParentRule);
  rule->SetParentRule(parentRule);
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool SetStyleSheetReference ( nsISupports *  aRule,
void aSheet 
) [static]

Definition at line 679 of file nsCSSRules.cpp.

{
  nsICSSRule* rule = (nsICSSRule*)aRule;
  nsICSSStyleSheet* sheet = (nsICSSStyleSheet*)aSheet;
  rule->SetStyleSheet(sheet);
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function: