Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsCSSStyleRule.cpp File Reference
#include "nsCOMPtr.h"
#include "nsCSSRule.h"
#include "nsICSSStyleRule.h"
#include "nsICSSGroupRule.h"
#include "nsCSSDeclaration.h"
#include "nsICSSStyleSheet.h"
#include "nsICSSParser.h"
#include "nsICSSLoader.h"
#include "nsIURL.h"
#include "nsPresContext.h"
#include "nsIDocument.h"
#include "nsIDeviceContext.h"
#include "nsIAtom.h"
#include "nsCRT.h"
#include "nsString.h"
#include "nsStyleConsts.h"
#include "nsStyleUtil.h"
#include "nsHTMLAtoms.h"
#include "nsUnitConversion.h"
#include "nsIFontMetrics.h"
#include "nsIDOMCSSStyleSheet.h"
#include "nsICSSStyleRuleDOMWrapper.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsDOMCSSDeclaration.h"
#include "nsINameSpaceManager.h"
#include "nsXMLNameSpaceMap.h"
#include "nsILookAndFeel.h"
#include "nsRuleNode.h"
#include "nsUnicharUtils.h"
#include "nsCSSPseudoElements.h"
#include "nsContentUtils.h"
#include "nsContentErrors.h"

Go to the source code of this file.

Classes

class  CSSImportantRule
class  DOMCSSDeclarationImpl
class  DOMCSSStyleRuleImpl
class  CSSStyleRuleImpl

Defines

#define NS_IF_CLONE(member_)
#define NS_IF_DEEP_CLONE(type_, member_, args_)
#define NS_IF_DELETE(ptr)
#define NS_IF_DEEP_DELETE(type_, member_)
#define NS_IF_NEGATED_START(bool, str)   if (bool) { str.AppendLiteral(":not("); }
#define NS_IF_NEGATED_END(bool, str)   if (bool) { str.Append(PRUnichar(')')); }

Functions

static PRBool IsPseudoElement (nsIAtom *aAtom)
nsresult NS_NewCSSStyleRule (nsICSSStyleRule **aInstancePtrResult, nsCSSSelectorList *aSelector, nsCSSDeclaration *aDeclaration)

Define Documentation

#define NS_IF_CLONE (   member_)
Value:
PR_BEGIN_MACRO                                                              \
    if (member_) {                                                            \
      result->member_ = member_->Clone();                                     \
      if (!result->member_) {                                                 \
        delete result;                                                        \
        return nsnull;                                                        \
      }                                                                       \
    }                                                                         \
  PR_END_MACRO

Definition at line 73 of file nsCSSStyleRule.cpp.

#define NS_IF_DEEP_CLONE (   type_,
  member_,
  args_ 
)
Value:
PR_BEGIN_MACRO                                                              \
    type_ *dest = result;                                                     \
    for (type_ *src = member_; src; src = src->member_) {                     \
      type_ *clone = src->Clone args_;                                        \
      if (!clone) {                                                           \
        delete result;                                                        \
        return nsnull;                                                        \
      }                                                                       \
      dest->member_ = clone;                                                  \
      dest = clone;                                                           \
    }                                                                         \
  PR_END_MACRO

Definition at line 84 of file nsCSSStyleRule.cpp.

#define NS_IF_DEEP_DELETE (   type_,
  member_ 
)
Value:
PR_BEGIN_MACRO                                                              \
    type_ *cur = member_;                                                     \
    member_ = nsnull;                                                         \
    while (cur) {                                                             \
      type_ *next = cur->member_;                                             \
      cur->member_ = nsnull;                                                  \
      delete cur;                                                             \
      cur = next;                                                             \
    }                                                                         \
  PR_END_MACRO

Definition at line 106 of file nsCSSStyleRule.cpp.

Value:
PR_BEGIN_MACRO                                                              \
    if (ptr) {                                                                \
      delete ptr;                                                             \
      ptr = nsnull;                                                           \
    }                                                                         \
  PR_END_MACRO

Definition at line 98 of file nsCSSStyleRule.cpp.

#define NS_IF_NEGATED_END (   bool,
  str 
)    if (bool) { str.Append(PRUnichar(')')); }

Definition at line 121 of file nsCSSStyleRule.cpp.

#define NS_IF_NEGATED_START (   bool,
  str 
)    if (bool) { str.AppendLiteral(":not("); }

Definition at line 118 of file nsCSSStyleRule.cpp.


Function Documentation

static PRBool IsPseudoElement ( nsIAtom aAtom) [static]

Definition at line 455 of file nsCSSStyleRule.cpp.

{
  if (aAtom) {
    const char* str;
    aAtom->GetUTF8String(&str);
    return str && (*str == ':');
  }

  return PR_FALSE;
}

Here is the caller graph for this function:

nsresult NS_NewCSSStyleRule ( nsICSSStyleRule **  aInstancePtrResult,
nsCSSSelectorList aSelector,
nsCSSDeclaration aDeclaration 
)

Definition at line 1487 of file nsCSSStyleRule.cpp.

{
  NS_PRECONDITION(aDeclaration, "must have a declaration");
  CSSStyleRuleImpl *it = new CSSStyleRuleImpl(aSelector, aDeclaration);
  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: