Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
nsHTMLCSSUtils.cpp File Reference
#include "nsHTMLEditor.h"
#include "nsCOMPtr.h"
#include "nsHTMLEditUtils.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsIServiceManager.h"
#include "nsEditProperty.h"
#include "ChangeCSSInlineStyleTxn.h"
#include "nsIDOMElement.h"
#include "TransactionFactory.h"
#include "nsIDOMElementCSSInlineStyle.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIContent.h"
#include "nsIAtom.h"
#include "nsTextEditUtils.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsHTMLCSSUtils.h"
#include "nsColor.h"
#include "nsAutoPtr.h"

Go to the source code of this file.

Functions

static void ProcessBValue (const nsAString *aInputString, nsAString &aOutputString, const char *aDefaultValueString, const char *aPrependString, const char *aAppendString)
static void ProcessDefaultValue (const nsAString *aInputString, nsAString &aOutputString, const char *aDefaultValueString, const char *aPrependString, const char *aAppendString)
static void ProcessSameValue (const nsAString *aInputString, nsAString &aOutputString, const char *aDefaultValueString, const char *aPrependString, const char *aAppendString)
static void ProcessExtendedValue (const nsAString *aInputString, nsAString &aOutputString, const char *aDefaultValueString, const char *aPrependString, const char *aAppendString)
static void ProcessLengthValue (const nsAString *aInputString, nsAString &aOutputString, const char *aDefaultValueString, const char *aPrependString, const char *aAppendString)
static void ProcessListStyleTypeValue (const nsAString *aInputString, nsAString &aOutputString, const char *aDefaultValueString, const char *aPrependString, const char *aAppendString)
static void ProcessMarginLeftValue (const nsAString *aInputString, nsAString &aOutputString, const char *aDefaultValueString, const char *aPrependString, const char *aAppendString)
static void ProcessMarginRightValue (const nsAString *aInputString, nsAString &aOutputString, const char *aDefaultValueString, const char *aPrependString, const char *aAppendString)
nsresult NS_NewHTMLCSSUtils (nsHTMLCSSUtils **aInstancePtrResult)

Variables

const nsHTMLCSSUtils::CSSEquivTable boldEquivTable []
const nsHTMLCSSUtils::CSSEquivTable italicEquivTable []
const nsHTMLCSSUtils::CSSEquivTable underlineEquivTable []
const nsHTMLCSSUtils::CSSEquivTable strikeEquivTable []
const nsHTMLCSSUtils::CSSEquivTable ttEquivTable []
const nsHTMLCSSUtils::CSSEquivTable fontColorEquivTable []
const nsHTMLCSSUtils::CSSEquivTable fontFaceEquivTable []
const nsHTMLCSSUtils::CSSEquivTable bgcolorEquivTable []
const nsHTMLCSSUtils::CSSEquivTable backgroundImageEquivTable []
const nsHTMLCSSUtils::CSSEquivTable textColorEquivTable []
const nsHTMLCSSUtils::CSSEquivTable borderEquivTable []
const nsHTMLCSSUtils::CSSEquivTable textAlignEquivTable []
const nsHTMLCSSUtils::CSSEquivTable captionAlignEquivTable []
const nsHTMLCSSUtils::CSSEquivTable verticalAlignEquivTable []
const nsHTMLCSSUtils::CSSEquivTable nowrapEquivTable []
const nsHTMLCSSUtils::CSSEquivTable widthEquivTable []
const nsHTMLCSSUtils::CSSEquivTable heightEquivTable []
const nsHTMLCSSUtils::CSSEquivTable listStyleTypeEquivTable []
const nsHTMLCSSUtils::CSSEquivTable tableAlignEquivTable []
const nsHTMLCSSUtils::CSSEquivTable hrAlignEquivTable []

Function Documentation

nsresult NS_NewHTMLCSSUtils ( nsHTMLCSSUtils **  aInstancePtrResult)

Definition at line 628 of file nsHTMLCSSUtils.cpp.

{
  nsHTMLCSSUtils * rules = new nsHTMLCSSUtils();
  if (rules) {
    *aInstancePtrResult = rules;
    return NS_OK;
  }

  *aInstancePtrResult = nsnull;
  return NS_ERROR_OUT_OF_MEMORY;
}

Here is the caller graph for this function:

static void ProcessBValue ( const nsAString *  aInputString,
nsAString &  aOutputString,
const char *  aDefaultValueString,
const char *  aPrependString,
const char *  aAppendString 
) [static]

Definition at line 62 of file nsHTMLCSSUtils.cpp.

{
  if (aInputString && aInputString->EqualsLiteral("-moz-editor-invert-value")) {
      aOutputString.AssignLiteral("normal");
  }
  else {
    aOutputString.AssignLiteral("bold");
  }
}
static void ProcessDefaultValue ( const nsAString *  aInputString,
nsAString &  aOutputString,
const char *  aDefaultValueString,
const char *  aPrependString,
const char *  aAppendString 
) [static]

Definition at line 75 of file nsHTMLCSSUtils.cpp.

{
  CopyASCIItoUTF16(aDefaultValueString, aOutputString);
}

Here is the call graph for this function:

static void ProcessExtendedValue ( const nsAString *  aInputString,
nsAString &  aOutputString,
const char *  aDefaultValueString,
const char *  aPrependString,
const char *  aAppendString 
) [static]

Definition at line 95 of file nsHTMLCSSUtils.cpp.

{
  aOutputString.Truncate();
  if (aInputString) {
    if (aPrependString) {
      AppendASCIItoUTF16(aPrependString, aOutputString);
    }
    aOutputString.Append(*aInputString);
    if (aAppendString) {
      AppendASCIItoUTF16(aAppendString, aOutputString);
    }
  }
}

Here is the call graph for this function:

static void ProcessLengthValue ( const nsAString *  aInputString,
nsAString &  aOutputString,
const char *  aDefaultValueString,
const char *  aPrependString,
const char *  aAppendString 
) [static]

Definition at line 112 of file nsHTMLCSSUtils.cpp.

{
  aOutputString.Truncate();
  if (aInputString) {
    aOutputString.Append(*aInputString);
    if (-1 == aOutputString.FindChar(PRUnichar('%'))) {
      aOutputString.AppendLiteral("px");
    }
  }
}
static void ProcessListStyleTypeValue ( const nsAString *  aInputString,
nsAString &  aOutputString,
const char *  aDefaultValueString,
const char *  aPrependString,
const char *  aAppendString 
) [static]

Definition at line 126 of file nsHTMLCSSUtils.cpp.

{
  aOutputString.Truncate();
  if (aInputString) {
    if (aInputString->EqualsLiteral("1")) {
      aOutputString.AppendLiteral("decimal");
    }
    else if (aInputString->EqualsLiteral("a")) {
      aOutputString.AppendLiteral("lower-alpha");
    }
    else if (aInputString->EqualsLiteral("A")) {
      aOutputString.AppendLiteral("upper-alpha");
    }
    else if (aInputString->EqualsLiteral("i")) {
      aOutputString.AppendLiteral("lower-roman");
    }
    else if (aInputString->EqualsLiteral("I")) {
      aOutputString.AppendLiteral("upper-roman");
    }
    else if (aInputString->EqualsLiteral("square")
             || aInputString->EqualsLiteral("circle")
             || aInputString->EqualsLiteral("disc")) {
      aOutputString.Append(*aInputString);
    }
  }
}
static void ProcessMarginLeftValue ( const nsAString *  aInputString,
nsAString &  aOutputString,
const char *  aDefaultValueString,
const char *  aPrependString,
const char *  aAppendString 
) [static]

Definition at line 156 of file nsHTMLCSSUtils.cpp.

{
  aOutputString.Truncate();
  if (aInputString) {
    if (aInputString->EqualsLiteral("center") ||
        aInputString->EqualsLiteral("-moz-center")) {
      aOutputString.AppendLiteral("auto"); 
    }
    else if (aInputString->EqualsLiteral("right") ||
             aInputString->EqualsLiteral("-moz-right")) {
      aOutputString.AppendLiteral("auto"); 
    }
    else {
      aOutputString.AppendLiteral("0px"); 
    }
  }
}
static void ProcessMarginRightValue ( const nsAString *  aInputString,
nsAString &  aOutputString,
const char *  aDefaultValueString,
const char *  aPrependString,
const char *  aAppendString 
) [static]

Definition at line 177 of file nsHTMLCSSUtils.cpp.

{
  aOutputString.Truncate();
  if (aInputString) {
    if (aInputString->EqualsLiteral("center") ||
        aInputString->EqualsLiteral("-moz-center")) {
      aOutputString.AppendLiteral("auto"); 
    }
    else if (aInputString->EqualsLiteral("left") ||
             aInputString->EqualsLiteral("-moz-left")) {
      aOutputString.AppendLiteral("auto"); 
    }
    else {
      aOutputString.AppendLiteral("0px"); 
    }
  }
}
static void ProcessSameValue ( const nsAString *  aInputString,
nsAString &  aOutputString,
const char *  aDefaultValueString,
const char *  aPrependString,
const char *  aAppendString 
) [static]

Definition at line 83 of file nsHTMLCSSUtils.cpp.

{
  if (aInputString) {
    aOutputString.Assign(*aInputString);
  }
  else
    aOutputString.Truncate();
}

Variable Documentation