Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsStyleContext.cpp File Reference
#include "nsStyleConsts.h"
#include "nsString.h"
#include "nsPresContext.h"
#include "nsIStyleRule.h"
#include "nsCRT.h"
#include "nsCOMPtr.h"
#include "nsStyleSet.h"
#include "nsIPresShell.h"
#include "nsLayoutAtoms.h"
#include "prenv.h"
#include "nsRuleNode.h"
#include "nsUnitConversion.h"
#include "nsStyleContext.h"
#include "imgIRequest.h"
#include "nsPrintfCString.h"

Go to the source code of this file.

Defines

#define UNIQUE_CASE(c_)
#define DO_STRUCT_DIFFERENCE(struct_)

Functions

already_AddRefed< nsStyleContextNS_NewStyleContext (nsStyleContext *aParentContext, nsIAtom *aPseudoTag, nsRuleNode *aRuleNode, nsPresContext *aPresContext)

Define Documentation

#define DO_STRUCT_DIFFERENCE (   struct_)
Value:
PR_BEGIN_MACRO                                                              \
    NS_ASSERTION(NS_IsHintSubset(nsStyle##struct_::MaxDifference(), maxHint), \
                 "Struct placed in the wrong maxHint section");               \
    const nsStyle##struct_* this##struct_ =                                   \
        NS_STATIC_CAST(const nsStyle##struct_*,                               \
                      PeekStyleData(NS_GET_STYLESTRUCTID(nsStyle##struct_))); \
    if (this##struct_) {                                                      \
      const nsStyle##struct_* other##struct_ =                                \
          NS_STATIC_CAST(const nsStyle##struct_*,                             \
               aOther->GetStyleData(NS_GET_STYLESTRUCTID(nsStyle##struct_))); \
      if (compare &&                                                          \
          !NS_IsHintSubset(maxHint, hint) &&                                  \
          this##struct_ != other##struct_) {                                  \
        NS_ASSERTION(NS_IsHintSubset(                                         \
             this##struct_->CalcDifference(*other##struct_),                  \
             nsStyle##struct_::MaxDifference()),                              \
             "CalcDifference() returned bigger hint than MaxDifference()");   \
        NS_UpdateHint(hint, this##struct_->CalcDifference(*other##struct_));  \
      }                                                                       \
    }                                                                         \
  PR_END_MACRO
#define UNIQUE_CASE (   c_)
Value:
case eStyleStruct_##c_:                                                     \
    result = new (presContext) nsStyle##c_(                                   \
      * NS_STATIC_CAST(const nsStyle##c_ *, current));                        \
    break;

Function Documentation

already_AddRefed<nsStyleContext> NS_NewStyleContext ( nsStyleContext aParentContext,
nsIAtom aPseudoTag,
nsRuleNode aRuleNode,
nsPresContext aPresContext 
)

Definition at line 970 of file nsStyleContext.cpp.

{
  nsStyleContext* context = new (aPresContext) nsStyleContext(aParentContext, aPseudoTag, 
                                                              aRuleNode, aPresContext);
  if (context)
    context->AddRef();
  return context;
}

Here is the call graph for this function:

Here is the caller graph for this function: