Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsCSSParser.cpp File Reference
#include "nsICSSParser.h"
#include "nsCSSProps.h"
#include "nsCSSKeywords.h"
#include "nsCSSScanner.h"
#include "nsICSSLoader.h"
#include "nsICSSStyleRule.h"
#include "nsICSSImportRule.h"
#include "nsCSSRules.h"
#include "nsICSSNameSpaceRule.h"
#include "nsIUnicharInputStream.h"
#include "nsICSSStyleSheet.h"
#include "nsCSSDeclaration.h"
#include "nsStyleConsts.h"
#include "nsIURL.h"
#include "nsNetUtil.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsIAtom.h"
#include "nsVoidArray.h"
#include "nsISupportsArray.h"
#include "nsCOMArray.h"
#include "nsColor.h"
#include "nsLayoutAtoms.h"
#include "nsCSSPseudoClasses.h"
#include "nsCSSPseudoElements.h"
#include "nsCSSAnonBoxes.h"
#include "nsINameSpaceManager.h"
#include "nsXMLNameSpaceMap.h"
#include "nsThemeConstants.h"
#include "nsContentErrors.h"
#include "nsUnitConversion.h"
#include "nsPrintfCString.h"
#include "nsIMediaList.h"
#include "nsILookAndFeel.h"
#include "prprf.h"
#include "math.h"

Go to the source code of this file.

Classes

class  CSSParserImpl
struct  SingleCounterPropValue

Defines

#define REPORT_UNEXPECTED(msg_)   mScanner.ReportUnexpected(#msg_)
#define REPORT_UNEXPECTED_P(msg_, params_)   mScanner.ReportUnexpectedParams(#msg_, params_, NS_ARRAY_LENGTH(params_))
#define REPORT_UNEXPECTED_EOF(lf_)   mScanner.ReportUnexpectedEOF(#lf_)
#define REPORT_UNEXPECTED_TOKEN(msg_)   mScanner.ReportUnexpectedToken(mToken, #msg_)
#define REPORT_UNEXPECTED_TOKEN_P(msg_, params_)
#define OUTPUT_ERROR()   mScanner.OutputError()
#define CLEAR_ERROR()   mScanner.ClearError()
#define SEL_MASK_NSPACE   0x01
#define SEL_MASK_ELEM   0x02
#define SEL_MASK_ID   0x04
#define SEL_MASK_CLASS   0x08
#define SEL_MASK_ATTRIB   0x10
#define SEL_MASK_PCLASS   0x20
#define SEL_MASK_PELEM   0x40
#define COLOR_TYPE_UNKNOWN   0
#define COLOR_TYPE_INTEGERS   1
#define COLOR_TYPE_PERCENTAGES   2
#define VARIANT_KEYWORD   0x000001
#define VARIANT_LENGTH   0x000002
#define VARIANT_PERCENT   0x000004
#define VARIANT_COLOR   0x000008
#define VARIANT_URL   0x000010
#define VARIANT_NUMBER   0x000020
#define VARIANT_INTEGER   0x000040
#define VARIANT_ANGLE   0x000080
#define VARIANT_FREQUENCY   0x000100
#define VARIANT_TIME   0x000200
#define VARIANT_STRING   0x000400
#define VARIANT_COUNTER   0x000800
#define VARIANT_ATTR   0x001000
#define VARIANT_IDENTIFIER   0x002000
#define VARIANT_AUTO   0x010000
#define VARIANT_INHERIT   0x020000
#define VARIANT_NONE   0x040000
#define VARIANT_NORMAL   0x080000
#define VARIANT_AL   (VARIANT_AUTO | VARIANT_LENGTH)
#define VARIANT_LP   (VARIANT_LENGTH | VARIANT_PERCENT)
#define VARIANT_AH   (VARIANT_AUTO | VARIANT_INHERIT)
#define VARIANT_AHLP   (VARIANT_AH | VARIANT_LP)
#define VARIANT_AHI   (VARIANT_AH | VARIANT_INTEGER)
#define VARIANT_AHK   (VARIANT_AH | VARIANT_KEYWORD)
#define VARIANT_AUK   (VARIANT_AUTO | VARIANT_URL | VARIANT_KEYWORD)
#define VARIANT_AHUK   (VARIANT_AH | VARIANT_URL | VARIANT_KEYWORD)
#define VARIANT_AHL   (VARIANT_AH | VARIANT_LENGTH)
#define VARIANT_AHKL   (VARIANT_AHK | VARIANT_LENGTH)
#define VARIANT_HK   (VARIANT_INHERIT | VARIANT_KEYWORD)
#define VARIANT_HKF   (VARIANT_HK | VARIANT_FREQUENCY)
#define VARIANT_HKL   (VARIANT_HK | VARIANT_LENGTH)
#define VARIANT_HKLP   (VARIANT_HK | VARIANT_LP)
#define VARIANT_HL   (VARIANT_INHERIT | VARIANT_LENGTH)
#define VARIANT_HI   (VARIANT_INHERIT | VARIANT_INTEGER)
#define VARIANT_HLP   (VARIANT_HL | VARIANT_PERCENT)
#define VARIANT_HLPN   (VARIANT_HLP | VARIANT_NUMBER)
#define VARIANT_HLPO   (VARIANT_HLP | VARIANT_NONE)
#define VARIANT_HTP   (VARIANT_INHERIT | VARIANT_TIME | VARIANT_PERCENT)
#define VARIANT_HMK   (VARIANT_HK | VARIANT_NORMAL)
#define VARIANT_HMKI   (VARIANT_HMK | VARIANT_INTEGER)
#define VARIANT_HC   (VARIANT_INHERIT | VARIANT_COLOR)
#define VARIANT_HCK   (VARIANT_HK | VARIANT_COLOR)
#define VARIANT_HUO   (VARIANT_INHERIT | VARIANT_URL | VARIANT_NONE)
#define VARIANT_AHUO   (VARIANT_AUTO | VARIANT_HUO)
#define VARIANT_HPN   (VARIANT_INHERIT | VARIANT_PERCENT | VARIANT_NUMBER)
#define VARIANT_HOK   (VARIANT_HK | VARIANT_NONE)
#define VARIANT_HN   (VARIANT_INHERIT | VARIANT_NUMBER)
#define VARIANT_HON   (VARIANT_HN | VARIANT_NONE)
#define VARIANT_HOS   (VARIANT_INHERIT | VARIANT_NONE | VARIANT_STRING)
#define BG_CENTER   0x01
#define BG_TOP   0x02
#define BG_BOTTOM   0x04
#define BG_LEFT   0x08
#define BG_RIGHT   0x10
#define BG_CTB   (BG_CENTER | BG_TOP | BG_BOTTOM)
#define BG_CLR   (BG_CENTER | BG_LEFT | BG_RIGHT)
#define VARIANT_CONTENT

Functions

 PR_STATIC_CALLBACK (void) AppendRuleToArray(nsICSSRule *aRule
 mScanner ()
 mChildLoader (nsnull)
 mSection (eCSSSection_Charset)
 mNameSpaceMap (nsnull)
 mHavePushBack (PR_FALSE)
 mNavQuirkMode (PR_FALSE)
 mUnsafeRulesEnabled (PR_FALSE)
 mHTMLMediaMode (PR_FALSE)
 mHandleAlphaColors (PR_FALSE)
 mCaseSensitive (PR_FALSE)
 mParsingCompoundProperty (PR_FALSE)
static PRBool IsSinglePseudoClass (const nsCSSSelector &aSelector)
static nsCSSValue BackgroundPositionMaskToCSSValue (PRInt32 aMask, PRBool isX)

Variables

static const nsCSSProperty kBorderTopIDs []
static const nsCSSProperty kBorderRightIDs []
static const nsCSSProperty kBorderBottomIDs []
static const nsCSSProperty kBorderLeftIDs []
static const PRInt32 kBackgroundXYPositionKTable []
static const nsCSSProperty kBorderStyleIDs []
static const nsCSSProperty kBorderWidthIDs []
static const nsCSSProperty kBorderColorIDs []
static const nsCSSProperty kBorderRadiusIDs []
static const nsCSSProperty kOutlineRadiusIDs []

Class Documentation

struct SingleCounterPropValue

Definition at line 5255 of file nsCSSParser.cpp.

Class Members
char str
nsCSSUnit unit

Define Documentation

#define BG_BOTTOM   0x04

Definition at line 4243 of file nsCSSParser.cpp.

#define BG_CENTER   0x01

Definition at line 4241 of file nsCSSParser.cpp.

Definition at line 4247 of file nsCSSParser.cpp.

Definition at line 4246 of file nsCSSParser.cpp.

#define BG_LEFT   0x08

Definition at line 4244 of file nsCSSParser.cpp.

#define BG_RIGHT   0x10

Definition at line 4245 of file nsCSSParser.cpp.

#define BG_TOP   0x02

Definition at line 4242 of file nsCSSParser.cpp.

#define CLEAR_ERROR ( )    mScanner.ClearError()

Definition at line 2757 of file nsCSSParser.cpp.

Definition at line 2758 of file nsCSSParser.cpp.

Definition at line 2756 of file nsCSSParser.cpp.

#define OUTPUT_ERROR ( )    mScanner.OutputError()
#define REPORT_UNEXPECTED (   msg_)    mScanner.ReportUnexpected(#msg_)
#define REPORT_UNEXPECTED_EOF (   lf_)    mScanner.ReportUnexpectedEOF(#lf_)
#define REPORT_UNEXPECTED_P (   msg_,
  params_ 
)    mScanner.ReportUnexpectedParams(#msg_, params_, NS_ARRAY_LENGTH(params_))
#define REPORT_UNEXPECTED_TOKEN (   msg_)    mScanner.ReportUnexpectedToken(mToken, #msg_)
#define REPORT_UNEXPECTED_TOKEN_P (   msg_,
  params_ 
)
Value:
mScanner.ReportUnexpectedTokenParams(mToken, #msg_, \
                                       params_, NS_ARRAY_LENGTH(params_))
#define SEL_MASK_ATTRIB   0x10

Definition at line 1992 of file nsCSSParser.cpp.

#define SEL_MASK_CLASS   0x08

Definition at line 1991 of file nsCSSParser.cpp.

#define SEL_MASK_ELEM   0x02

Definition at line 1989 of file nsCSSParser.cpp.

#define SEL_MASK_ID   0x04

Definition at line 1990 of file nsCSSParser.cpp.

#define SEL_MASK_NSPACE   0x01

Definition at line 1988 of file nsCSSParser.cpp.

#define SEL_MASK_PCLASS   0x20

Definition at line 1993 of file nsCSSParser.cpp.

#define SEL_MASK_PELEM   0x40

Definition at line 1994 of file nsCSSParser.cpp.

Definition at line 3439 of file nsCSSParser.cpp.

Definition at line 3441 of file nsCSSParser.cpp.

Definition at line 3442 of file nsCSSParser.cpp.

Definition at line 3446 of file nsCSSParser.cpp.

Definition at line 3445 of file nsCSSParser.cpp.

Definition at line 3440 of file nsCSSParser.cpp.

Definition at line 3444 of file nsCSSParser.cpp.

Definition at line 3462 of file nsCSSParser.cpp.

Definition at line 3437 of file nsCSSParser.cpp.

#define VARIANT_ANGLE   0x000080

Definition at line 3424 of file nsCSSParser.cpp.

#define VARIANT_ATTR   0x001000

Definition at line 3429 of file nsCSSParser.cpp.

Definition at line 3443 of file nsCSSParser.cpp.

#define VARIANT_AUTO   0x010000

Definition at line 3431 of file nsCSSParser.cpp.

#define VARIANT_COLOR   0x000008

Definition at line 3420 of file nsCSSParser.cpp.

Value:

Definition at line 5206 of file nsCSSParser.cpp.

#define VARIANT_COUNTER   0x000800

Definition at line 3428 of file nsCSSParser.cpp.

#define VARIANT_FREQUENCY   0x000100

Definition at line 3425 of file nsCSSParser.cpp.

Definition at line 3459 of file nsCSSParser.cpp.

Definition at line 3460 of file nsCSSParser.cpp.

Definition at line 3452 of file nsCSSParser.cpp.

Definition at line 3447 of file nsCSSParser.cpp.

Definition at line 3448 of file nsCSSParser.cpp.

Definition at line 3449 of file nsCSSParser.cpp.

Definition at line 3450 of file nsCSSParser.cpp.

Definition at line 3451 of file nsCSSParser.cpp.

Definition at line 3453 of file nsCSSParser.cpp.

Definition at line 3454 of file nsCSSParser.cpp.

Definition at line 3455 of file nsCSSParser.cpp.

Definition at line 3457 of file nsCSSParser.cpp.

Definition at line 3458 of file nsCSSParser.cpp.

Definition at line 3465 of file nsCSSParser.cpp.

Definition at line 3464 of file nsCSSParser.cpp.

Definition at line 3466 of file nsCSSParser.cpp.

Definition at line 3467 of file nsCSSParser.cpp.

Definition at line 3463 of file nsCSSParser.cpp.

Definition at line 3456 of file nsCSSParser.cpp.

Definition at line 3461 of file nsCSSParser.cpp.

#define VARIANT_IDENTIFIER   0x002000

Definition at line 3430 of file nsCSSParser.cpp.

#define VARIANT_INHERIT   0x020000

Definition at line 3432 of file nsCSSParser.cpp.

#define VARIANT_INTEGER   0x000040

Definition at line 3423 of file nsCSSParser.cpp.

#define VARIANT_KEYWORD   0x000001

Definition at line 3417 of file nsCSSParser.cpp.

#define VARIANT_LENGTH   0x000002

Definition at line 3418 of file nsCSSParser.cpp.

Definition at line 3438 of file nsCSSParser.cpp.

#define VARIANT_NONE   0x040000

Definition at line 3433 of file nsCSSParser.cpp.

#define VARIANT_NORMAL   0x080000

Definition at line 3434 of file nsCSSParser.cpp.

#define VARIANT_NUMBER   0x000020

Definition at line 3422 of file nsCSSParser.cpp.

#define VARIANT_PERCENT   0x000004

Definition at line 3419 of file nsCSSParser.cpp.

#define VARIANT_STRING   0x000400

Definition at line 3427 of file nsCSSParser.cpp.

#define VARIANT_TIME   0x000200

Definition at line 3426 of file nsCSSParser.cpp.

#define VARIANT_URL   0x000010

Definition at line 3421 of file nsCSSParser.cpp.


Function Documentation

static nsCSSValue BackgroundPositionMaskToCSSValue ( PRInt32  aMask,
PRBool  isX 
) [static]

Definition at line 4720 of file nsCSSParser.cpp.

{
  PRInt32 pct = 50;
  if (isX) {
    if (aMask & BG_LEFT) {
      pct = 0;
    }
    else if (aMask & BG_RIGHT) {
      pct = 100;
    }
  }
  else {
    if (aMask & BG_TOP) {
      pct = 0;
    }
    else if (aMask & BG_BOTTOM) {
      pct = 100;
    }
  }

  return nsCSSValue(pct, eCSSUnit_Enumerated);
}

Here is the caller graph for this function:

static PRBool IsSinglePseudoClass ( const nsCSSSelector aSelector) [static]

Definition at line 1833 of file nsCSSParser.cpp.

{
  return PRBool((aSelector.mNameSpace == kNameSpaceID_Unknown) && 
                (aSelector.mTag == nsnull) && 
                (aSelector.mIDList == nsnull) &&
                (aSelector.mClassList == nsnull) &&
                (aSelector.mAttrList == nsnull) &&
                (aSelector.mNegations == nsnull) &&
                (aSelector.mPseudoClassList != nsnull) &&
                (aSelector.mPseudoClassList->mNext == nsnull));
}

Here is the caller graph for this function:

Definition at line 525 of file nsCSSParser.cpp.

{
}
mScanner ( )

Here is the caller graph for this function:

mSection ( eCSSSection_Charset  )

Here is the caller graph for this function:

Definition at line 102 of file TestIPCLocks.cpp.

{
  const char *lockName = (const char *) arg;

  LOG("entering TestThread [lock=%s]\n", lockName);

  nsresult rv;

  RandomSleep(1000, 1100);

  //LOG("done sleeping\n");

  rv = gLockService->AcquireLock(lockName, PR_TRUE);
  if (NS_SUCCEEDED(rv))
  {
    //LOG("acquired lock \"%s\"\n", lockName);
    RandomSleep(500, 1000);
    //LOG("releasing lock \"%s\"\n", lockName);
    rv = gLockService->ReleaseLock(lockName);
    if (NS_FAILED(rv))
    {
      LOG("failed to release lock [rv=%x]\n", rv);
      NS_ERROR("failed to release lock");
    }
  }
  else
  {
    LOG("failed to acquire lock [rv=%x]\n", rv);
    NS_NOTREACHED("failed to acquire lock");
  }

  LOG("exiting TestThread [lock=%s rv=%x]\n", lockName, rv);
}

Variable Documentation

Initial value:
 {
  eCSSKeyword_center, BG_CENTER,
  eCSSKeyword_top, BG_TOP,
  eCSSKeyword_bottom, BG_BOTTOM,
  eCSSKeyword_left, BG_LEFT,
  eCSSKeyword_right, BG_RIGHT,
  -1,
}

Definition at line 4252 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty_border_bottom_width,
  eCSSProperty_border_bottom_style,
  eCSSProperty_border_bottom_color
}

Definition at line 3479 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty_border_top_color,
  eCSSProperty_border_right_color,
  eCSSProperty_border_bottom_color,
  eCSSProperty_border_left_color
}

Definition at line 4978 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty_border_left_width,
  eCSSProperty_border_left_style,
  eCSSProperty_border_left_color
}

Definition at line 3484 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty__moz_border_radius_topLeft,
  eCSSProperty__moz_border_radius_topRight,
  eCSSProperty__moz_border_radius_bottomRight,
  eCSSProperty__moz_border_radius_bottomLeft
}

Definition at line 4984 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty_border_right_width,
  eCSSProperty_border_right_style,
  eCSSProperty_border_right_color
}

Definition at line 3474 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty_border_top_style,
  eCSSProperty_border_right_style,
  eCSSProperty_border_bottom_style,
  eCSSProperty_border_left_style
}

Definition at line 4966 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty_border_top_width,
  eCSSProperty_border_top_style,
  eCSSProperty_border_top_color
}

Definition at line 3469 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty_border_top_width,
  eCSSProperty_border_right_width,
  eCSSProperty_border_bottom_width,
  eCSSProperty_border_left_width
}

Definition at line 4972 of file nsCSSParser.cpp.

Initial value:
 {
  eCSSProperty__moz_outline_radius_topLeft,
  eCSSProperty__moz_outline_radius_topRight,
  eCSSProperty__moz_outline_radius_bottomRight,
  eCSSProperty__moz_outline_radius_bottomLeft
}

Definition at line 4990 of file nsCSSParser.cpp.