Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
nsComputedDOMStyle Class Reference

#include <nsComputedDOMStyle.h>

Inheritance diagram for nsComputedDOMStyle:
Inheritance graph
[legend]
Collaboration diagram for nsComputedDOMStyle:
Collaboration graph
[legend]

List of all members.

Classes

struct  ComputedStyleMapEntry

Public Member Functions

NS_DECL_ISUPPORTS NS_IMETHOD Init (nsIDOMElement *aElement, const nsAString &aPseudoElt, nsIPresShell *aPresShell)
NS_DECL_NSICSSDECLARATION
NS_DECL_NSIDOMCSSSTYLEDECLARATION 
nsComputedDOMStyle ()
virtual ~nsComputedDOMStyle ()
NS_IMETHOD GetPropertyValue (const nsCSSProperty aPropID, nsAString &aValue)=0
 Method analogous to nsIDOMCSSStyleDeclaration::GetPropertyValue, which obeys all the same restrictions.
NS_IMETHOD GetPropertyValue (const nsAString &aPropName, nsAString &aValue)=0
NS_IMETHOD SetPropertyValue (const nsCSSProperty aPropID, const nsAString &aValue)=0
 Method analogous to nsIDOMCSSStyleDeclaration::SetProperty.
DOMString getPropertyValue (in DOMString propertyName)
nsIDOMCSSValue getPropertyCSSValue (in DOMString propertyName)
DOMString removeProperty (in DOMString propertyName) raises (DOMException)
DOMString getPropertyPriority (in DOMString propertyName)
void setProperty (in DOMString propertyName, in DOMString value, in DOMString priority) raises (DOMException)
DOMString item (in unsigned long index)

Static Public Member Functions

static void Shutdown ()

Public Attributes

attribute DOMString cssText
readonly attribute unsigned long length
readonly attribute nsIDOMCSSRule parentRule

Private Member Functions

void FlushPendingReflows ()
nsresult GetStyleData (nsStyleStructID aID, const nsStyleStruct *&aStyleStruct, nsIFrame *aFrame=0)
nsresult GetOffsetWidthFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetAbsoluteOffset (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetRelativeOffset (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetStaticOffset (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetPaddingWidthFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nscoord GetPaddingWidthCoordFor (PRUint8 aSide, nsIFrame *aFrame)
nsresult GetBorderColorsFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderStyleFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRadiusFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderWidthFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nscoord GetBorderWidthCoordFor (PRUint8 aSide, nsIFrame *aFrame)
nsresult GetBorderColorFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineRadiusFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMarginWidthFor (PRUint8 aSide, nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nscoord GetMarginWidthCoordFor (PRUint8 aSide, nsIFrame *aFrame)
nsresult GetLineHeightCoord (nsIFrame *aFrame, const nsStyleText *aText, nscoord &aCoord)
nsresult GetAppearance (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBoxAlign (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBoxDirection (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBoxFlex (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBoxOrdinalGroup (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBoxOrient (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBoxPack (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBoxSizing (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetHeight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMaxHeight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMaxWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMinHeight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMinWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetLeft (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetTop (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetRight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBottom (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetColor (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetFontFamily (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetFontStyle (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetFontSize (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetFontSizeAdjust (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetFontWeight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetFontVariant (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBackgroundAttachment (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBackgroundColor (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBackgroundImage (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBackgroundRepeat (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBackgroundClip (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBackgroundInlinePolicy (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBackgroundOrigin (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetPadding (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetPaddingTop (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetPaddingBottom (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetPaddingLeft (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetPaddingRight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderCollapse (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderSpacing (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetCaptionSide (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetEmptyCells (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetTableLayout (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetVerticalAlign (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderStyle (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderTopStyle (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderBottomStyle (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderLeftStyle (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRightStyle (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderTopWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderBottomWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderLeftWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRightWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderTopColor (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderBottomColor (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderLeftColor (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRightColor (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderBottomColors (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderLeftColors (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRightColors (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderTopColors (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRadiusBottomLeft (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRadiusBottomRight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRadiusTopLeft (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBorderRadiusTopRight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetFloatEdge (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMarginWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMarginTopWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMarginBottomWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMarginLeftWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMarginRightWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutline (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineStyle (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineColor (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineOffset (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineRadiusBottomLeft (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineRadiusBottomRight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineRadiusTopLeft (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOutlineRadiusTopRight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetCounterIncrement (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetCounterReset (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetMarkerOffset (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetZIndex (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetListStyleImage (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetListStylePosition (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetListStyleType (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetImageRegion (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetLineHeight (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetTextAlign (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetTextDecoration (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetTextIndent (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetTextTransform (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetLetterSpacing (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetWordSpacing (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetWhiteSpace (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOpacity (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetVisibility (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetDirection (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetUnicodeBidi (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetBinding (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetClear (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetCssFloat (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetDisplay (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetPosition (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetClip (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOverflow (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOverflowX (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetOverflowY (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetCursor (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetUserFocus (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetUserInput (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetUserModify (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetUserSelect (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetColumnCount (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetColumnWidth (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsresult GetColumnGap (nsIFrame *aFrame, nsIDOMCSSValue **aValue)
nsROCSSPrimitiveValueGetROCSSPrimitiveValue ()
nsDOMCSSValueListGetROCSSValueList (PRBool aCommaDelimited)
nsDOMCSSRGBColorGetDOMCSSRGBColor (nscolor aColor)

Static Private Member Functions

static const
ComputedStyleMapEntry
GetQueryablePropertyMap (PRUint32 *aLength)

Private Attributes

CSS2PropertiesTearoff mInner
nsWeakPtr mDocumentWeak
nsCOMPtr< nsIContentmContent
nsRefPtr< nsStyleContextmStyleContextHolder
nsCOMPtr< nsIAtommPseudo
float mT2P

Detailed Description

Definition at line 57 of file nsComputedDOMStyle.h.


Constructor & Destructor Documentation

Definition at line 112 of file nsComputedDOMStyle.cpp.

  : mInner(this), mDocumentWeak(nsnull), mT2P(0.0f)
{
}

Definition at line 118 of file nsComputedDOMStyle.cpp.

{
}

Here is the caller graph for this function:


Member Function Documentation

Definition at line 3278 of file nsComputedDOMStyle.cpp.

{
  // Flush all pending notifications so that our frames are up to date
  nsCOMPtr<nsIDocument> document = mContent->GetDocument();
  if (document) {
    document->FlushPendingNotifications(Flush_Layout);
  }
}

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetAbsoluteOffset ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3114 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  nsIFrame* container = GetContainingBlockFor(aFrame);
  if (container) {
    nscoord margin = GetMarginWidthCoordFor(aSide, aFrame);
    nscoord border = GetBorderWidthCoordFor(aSide, container);
    nsMargin scrollbarSizes(0, 0, 0, 0);
    nsRect rect = aFrame->GetRect();
    nsRect containerRect = container->GetRect();
      
    if (container->GetType() == nsLayoutAtoms::viewportFrame) {
      // For absolutely positioned frames scrollbars are taken into
      // account by virtue of getting a containing block that does
      // _not_ include the scrollbars.  For fixed positioned frames,
      // the containing block is the viewport, which _does_ include
      // scrollbars.  We have to do some extra work.
      // the first child in the default frame list is what we want
      nsIFrame* scrollingChild = container->GetFirstChild(nsnull);
      nsCOMPtr<nsIScrollableFrame> scrollFrame =
        do_QueryInterface(scrollingChild);
      if (scrollFrame) {
        scrollbarSizes = scrollFrame->GetActualScrollbarSizes();
      }
    }

    nscoord offset = 0;
    switch (aSide) {
      case NS_SIDE_TOP:
        offset = rect.y - margin - border - scrollbarSizes.top;

        break;
      case NS_SIDE_RIGHT:
        offset = containerRect.width - rect.width -
          rect.x - margin - border - scrollbarSizes.right;

        break;
      case NS_SIDE_BOTTOM:
        offset = containerRect.height - rect.height -
          rect.y - margin - border - scrollbarSizes.bottom;

        break;
      case NS_SIDE_LEFT:
        offset = rect.x - margin - border - scrollbarSizes.left;

        break;
      default:
        NS_ERROR("Invalid side");
        break;
    }
    val->SetTwips(offset);
  } else {
    // XXX no frame.  This property makes no sense
    val->SetTwips(0);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetAppearance ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2195 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay *displayData = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)displayData,
               aFrame);

  PRUint8 appearance = NS_THEME_NONE;
  if (displayData) {
    appearance = displayData->mAppearance;
  }

  const nsAFlatCString& appearanceIdent =
    nsCSSProps::ValueToKeyword(appearance,
                               nsCSSProps::kAppearanceKTable);
  val->SetIdent(appearanceIdent);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 858 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBackground *background = nsnull;
  GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)background,
               aFrame);

  if (background) {
    const nsAFlatCString& backgroundAttachment =
      nsCSSProps::ValueToKeyword(background->mBackgroundAttachment,
                                 nsCSSProps::kBackgroundAttachmentKTable);
    val->SetIdent(backgroundAttachment);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBackgroundClip ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 879 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBackground *background = nsnull;
  GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)background, aFrame);

  PRUint8 clip = NS_STYLE_BG_CLIP_BORDER;
  if (background) {
    clip = background->mBackgroundClip;
  }

  const nsAFlatCString& backgroundClip =
    nsCSSProps::ValueToKeyword(clip,
                               nsCSSProps::kBackgroundClipKTable);

  val->SetIdent(backgroundClip);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 903 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBackground* color = nsnull;
  GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)color, aFrame);

  if (color) {
    if (color->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) {
      const nsAFlatCString& backgroundColor =
        nsCSSProps::ValueToKeyword(NS_STYLE_BG_COLOR_TRANSPARENT,
                                   nsCSSProps::kBackgroundColorKTable);
      val->SetIdent(backgroundColor);
    } else {
      nsDOMCSSRGBColor *rgb = nsnull;
      rgb = GetDOMCSSRGBColor(color->mBackgroundColor);
      if (!rgb) {
        delete val;

        return NS_ERROR_OUT_OF_MEMORY;
      }

      val->SetColor(rgb);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 935 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBackground* color = nsnull;
  GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)color, aFrame);

  if (color) {
    if (color->mBackgroundFlags & NS_STYLE_BG_IMAGE_NONE) {
      val->SetIdent(nsLayoutAtoms::none);
    } else {
      nsCOMPtr<nsIURI> uri;
      if (color->mBackgroundImage) {
        color->mBackgroundImage->GetURI(getter_AddRefs(uri));
      }
      val->SetURI(uri);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 960 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBackground *background = nsnull;
  GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)background, aFrame);

  PRUint8 policy = NS_STYLE_BG_INLINE_POLICY_CONTINUOUS;
  if (background) {
    policy = background->mBackgroundInlinePolicy;
  }

  const nsAFlatCString& backgroundPolicy =
      nsCSSProps::ValueToKeyword(policy,
                                 nsCSSProps::kBackgroundInlinePolicyKTable);

  val->SetIdent(backgroundPolicy);

  return CallQueryInterface(val, aValue);  
}

Here is the call graph for this function:

Definition at line 984 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBackground *background = nsnull;
  GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)background, aFrame);

  PRUint8 origin = NS_STYLE_BG_ORIGIN_PADDING;
  if (background) {
    origin = background->mBackgroundOrigin;
  }

  const nsAFlatCString& backgroundOrigin =
    nsCSSProps::ValueToKeyword(origin,
                               nsCSSProps::kBackgroundOriginKTable);

  val->SetIdent(backgroundOrigin);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 1008 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBackground *background = nsnull;
  GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)background,
               aFrame);

  if (background) {
    const nsAFlatCString& backgroundRepeat =
      nsCSSProps::ValueToKeyword(background->mBackgroundRepeat,
                                 nsCSSProps::kBackgroundRepeatKTable);
    val->SetIdent(backgroundRepeat);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBinding ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 393 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay* display = nsnull;

  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  if (display && display->mBinding) {
    val->SetURI(display->mBinding);
  } else {
    val->SetIdent(nsLayoutAtoms::none);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 1330 of file nsComputedDOMStyle.cpp.

{
  return GetBorderColorFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1227 of file nsComputedDOMStyle.cpp.

{
  return GetBorderColorsFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1207 of file nsComputedDOMStyle.cpp.

{
  return GetBorderStyleFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1302 of file nsComputedDOMStyle.cpp.

{
  return GetBorderWidthFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBorderCollapse ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1067 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleTableBorder* table = nsnull;
  GetStyleData(eStyleStruct_TableBorder, (const nsStyleStruct*&)table, aFrame);

  if (table) {
    const nsAFlatCString& ident=
      nsCSSProps::ValueToKeyword(table->mBorderCollapse,
                                 nsCSSProps::kBorderCollapseKTable);
    val->SetIdent(ident);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBorderColorFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3536 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBorder* border = nsnull;
  GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);

  if (border) {
    nscolor color; 
    PRBool transparent;
    PRBool foreground;
    border->GetBorderColor(aSide, color, transparent, foreground);
    if (transparent) {
      val->SetIdent(nsLayoutAtoms::transparent);
    } else {
      if (foreground) {
        const nsStyleColor* colorStruct = nsnull;
        GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)colorStruct,
                     aFrame);
        color = colorStruct->mColor;
      }

      nsDOMCSSRGBColor *rgb = GetDOMCSSRGBColor(color);
      if (!rgb) {
        delete val;

        return NS_ERROR_OUT_OF_MEMORY;
      }

      val->SetColor(rgb);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetBorderColorsFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3425 of file nsComputedDOMStyle.cpp.

{
  const nsStyleBorder *border = nsnull;
  GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);

  if (border && border->mBorderColors) {
    nsBorderColors* borderColors = border->mBorderColors[aSide];
    if (borderColors) {
      nsDOMCSSValueList *valueList = GetROCSSValueList(PR_FALSE);
      NS_ENSURE_TRUE(valueList, NS_ERROR_OUT_OF_MEMORY);

      do {
        nsROCSSPrimitiveValue *primitive = GetROCSSPrimitiveValue();
        if (!primitive) {
          delete valueList;

          return NS_ERROR_OUT_OF_MEMORY;
        }
        if (borderColors->mTransparent) {
          primitive->SetIdent(nsLayoutAtoms::transparent);
        } else {
          nsDOMCSSRGBColor *rgb = GetDOMCSSRGBColor(borderColors->mColor);
          if (rgb) {
            primitive->SetColor(rgb);
          } else {
            delete valueList;
            delete primitive;

            return NS_ERROR_OUT_OF_MEMORY;
          }
        }

        PRBool success = valueList->AppendCSSValue(primitive);
        if (!success) {
          delete valueList;
          delete primitive;

          return NS_ERROR_OUT_OF_MEMORY;
        }
        borderColors = borderColors->mNext;
      } while (borderColors);

      return CallQueryInterface(valueList, aValue);
    }
  }

  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  val->SetIdent(nsLayoutAtoms::none);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1337 of file nsComputedDOMStyle.cpp.

{
  return GetBorderColorFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1234 of file nsComputedDOMStyle.cpp.

{
  return GetBorderColorsFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1213 of file nsComputedDOMStyle.cpp.

{
  return GetBorderStyleFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1309 of file nsComputedDOMStyle.cpp.

{
  return GetBorderWidthFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1257 of file nsComputedDOMStyle.cpp.

{
  return GetBorderRadiusFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1264 of file nsComputedDOMStyle.cpp.

{
  return GetBorderRadiusFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBorderRadiusFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3481 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBorder *border = nsnull;
  GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);

  if (border) {
    nsStyleCoord coord;
    border->mBorderRadius.Get(aSide, coord);
    
    switch (coord.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(coord.GetCoordValue());
        break;
      case eStyleUnit_Percent:
        if (aFrame) {
          val->SetTwips(coord.GetPercentValue() * aFrame->GetSize().width);
        } else {
          val->SetPercent(coord.GetPercentValue());
        }
        break;
      default:
        NS_ERROR("Unexpected border radius unit");
        break;
    }
  } else {
    val->SetTwips(0);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1271 of file nsComputedDOMStyle.cpp.

{
  return GetBorderRadiusFor(NS_SIDE_TOP, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1278 of file nsComputedDOMStyle.cpp.

{
  return GetBorderRadiusFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1344 of file nsComputedDOMStyle.cpp.

{
  return GetBorderColorFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1241 of file nsComputedDOMStyle.cpp.

{
  return GetBorderColorsFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1220 of file nsComputedDOMStyle.cpp.

{
  return GetBorderStyleFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1316 of file nsComputedDOMStyle.cpp.

{
  return GetBorderWidthFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBorderSpacing ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1087 of file nsComputedDOMStyle.cpp.

{
  nsDOMCSSValueList *valueList = GetROCSSValueList(PR_FALSE);
  NS_ENSURE_TRUE(valueList, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleTableBorder *border = nsnull;
  GetStyleData(eStyleStruct_TableBorder, (const nsStyleStruct*&)border, aFrame);
  if (border) {
    nsROCSSPrimitiveValue* xSpacing = GetROCSSPrimitiveValue();
    if (!xSpacing) {
      delete valueList;
      return NS_ERROR_OUT_OF_MEMORY;
    }
    if (!valueList->AppendCSSValue(xSpacing)) {
      delete valueList;
      delete xSpacing;
      return NS_ERROR_OUT_OF_MEMORY;
    }
    
    nsROCSSPrimitiveValue* ySpacing = GetROCSSPrimitiveValue();
    if (!ySpacing) {
      delete valueList;
      return NS_ERROR_OUT_OF_MEMORY;
    }
    if (!valueList->AppendCSSValue(ySpacing)) {
      delete valueList;
      delete ySpacing;
      return NS_ERROR_OUT_OF_MEMORY;
    }

    // border-spacing will always be a coord
    xSpacing->SetTwips(border->mBorderSpacingX.GetCoordValue());
    ySpacing->SetTwips(border->mBorderSpacingY.GetCoordValue());
        
  }

  return CallQueryInterface(valueList, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBorderStyle ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1190 of file nsComputedDOMStyle.cpp.

{
  // return null per spec.
  aValue = nsnull;

  return NS_OK;
}
nsresult nsComputedDOMStyle::GetBorderStyleFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3616 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBorder* border = nsnull;
  GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);

  PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_NONE;

  if (border) {
    borderStyle = border->GetBorderStyle(aSide);
  }

  if (borderStyle != NS_STYLE_BORDER_STYLE_NONE) {
    const nsAFlatCString& style=
      nsCSSProps::ValueToKeyword(borderStyle,
                                 nsCSSProps::kBorderStyleKTable);
    val->SetIdent(style);
  } else {
    val->SetIdent(nsLayoutAtoms::none);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetBorderTopColor ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1323 of file nsComputedDOMStyle.cpp.

{
  return GetBorderColorFor(NS_SIDE_TOP, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1249 of file nsComputedDOMStyle.cpp.

{
  return GetBorderColorsFor(NS_SIDE_TOP, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBorderTopStyle ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1200 of file nsComputedDOMStyle.cpp.

{
  return GetBorderStyleFor(NS_SIDE_TOP, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBorderTopWidth ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1295 of file nsComputedDOMStyle.cpp.

{
  return GetBorderWidthFor(NS_SIDE_TOP, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBorderWidth ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1285 of file nsComputedDOMStyle.cpp.

{
  // return null per spec.
  aValue = nsnull;

  return NS_OK;
}

Definition at line 3360 of file nsComputedDOMStyle.cpp.

{
  const nsStyleBorder* borderData = nsnull;
  GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)borderData, aFrame);

  if (borderData) {
    nsMargin border;
    borderData->CalcBorderFor(aFrame, border);
    switch(aSide) {
      case NS_SIDE_TOP    :
        return border.top;
      case NS_SIDE_BOTTOM :
        return border.bottom;
      case NS_SIDE_LEFT   :
        return border.left;
      case NS_SIDE_RIGHT  :
        return border.right;
      default:
        NS_ERROR("Invalid side");
        break;
    }
  }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetBorderWidthFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3517 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBorder* border = nsnull;
  GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);

  if (border) {
    nscoord width;
    border->CalcBorderFor(aFrame, aSide, width);
    val->SetTwips(width);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetBottom ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 457 of file nsComputedDOMStyle.cpp.

{
  return GetOffsetWidthFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBoxAlign ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2220 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleXUL *xul = nsnull;
  GetStyleData(eStyleStruct_XUL, (const nsStyleStruct*&)xul, aFrame);

  PRUint8 boxAlign = NS_STYLE_BOX_ALIGN_STRETCH;
  if (xul) {
    boxAlign = xul->mBoxAlign;
  }

  const nsAFlatCString& boxAlignIdent =
    nsCSSProps::ValueToKeyword(boxAlign,
                               nsCSSProps::kBoxAlignKTable);
  val->SetIdent(boxAlignIdent);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBoxDirection ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2243 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleXUL *xul = nsnull;
  GetStyleData(eStyleStruct_XUL, (const nsStyleStruct*&)xul, aFrame);

  PRUint8 boxDirection = NS_STYLE_BOX_DIRECTION_NORMAL;
  if (xul) {
    boxDirection = xul->mBoxDirection;
  }

  const nsAFlatCString& boxDirectionIdent =
    nsCSSProps::ValueToKeyword(boxDirection,
                               nsCSSProps::kBoxDirectionKTable);
  val->SetIdent(boxDirectionIdent);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBoxFlex ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2266 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleXUL *xul = nsnull;
  GetStyleData(eStyleStruct_XUL, (const nsStyleStruct*&)xul, aFrame);

  float boxFlex = 0.0f;
  if (xul) {
    boxFlex = xul->mBoxFlex;
  }

  val->SetNumber(boxFlex);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 2286 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleXUL *xul = nsnull;
  GetStyleData(eStyleStruct_XUL, (const nsStyleStruct*&)xul, aFrame);

  PRUint32 boxOrdinalGroup = 1;
  if (xul) {
    boxOrdinalGroup = xul->mBoxOrdinal;
  }

  val->SetNumber(boxOrdinalGroup);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBoxOrient ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2306 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleXUL *xul = nsnull;
  GetStyleData(eStyleStruct_XUL, (const nsStyleStruct*&)xul, aFrame);

  PRUint8 boxOrient = NS_STYLE_BOX_ORIENT_HORIZONTAL;
  if (xul) {
    boxOrient = xul->mBoxOrient;
  }

  const nsAFlatCString& boxOrientIdent =
    nsCSSProps::ValueToKeyword(boxOrient,
                               nsCSSProps::kBoxOrientKTable);
  val->SetIdent(boxOrientIdent);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBoxPack ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2329 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleXUL *xul = nsnull;
  GetStyleData(eStyleStruct_XUL, (const nsStyleStruct*&)xul, aFrame);

  PRUint8 boxPack = NS_STYLE_BOX_PACK_START;
  if (xul) {
    boxPack = xul->mBoxPack;
  }

  const nsAFlatCString& boxPackIdent =
    nsCSSProps::ValueToKeyword(boxPack,
                               nsCSSProps::kBoxPackKTable);
  val->SetIdent(boxPackIdent);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetBoxSizing ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2352 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStylePosition *positionData = nsnull;
  GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)positionData,
               aFrame);

  PRUint8 boxSizing = NS_STYLE_BOX_SIZING_CONTENT;
  if (positionData) {
    boxSizing = positionData->mBoxSizing;
  }

  const nsAFlatCString& boxSizingIdent =
    nsCSSProps::ValueToKeyword(boxSizing,
                               nsCSSProps::kBoxSizingKTable);
  val->SetIdent(boxSizingIdent);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetCaptionSide ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1128 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleTableBorder *table = nsnull;
  GetStyleData(eStyleStruct_TableBorder, (const nsStyleStruct*&)table, aFrame);

  if (table) {
    const nsAFlatCString& side =
      nsCSSProps::ValueToKeyword(table->mCaptionSide,
                                 nsCSSProps::kCaptionSideKTable);
    val->SetIdent(side);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetClear ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 413 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay *display = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  if (display && display->mBreakType != NS_STYLE_CLEAR_NONE) {
    const nsAFlatCString& clear =
      nsCSSProps::ValueToKeyword(display->mBreakType,
                                 nsCSSProps::kClearKTable);
    val->SetIdent(clear);
  } else {
    val->SetIdent(nsLayoutAtoms::none);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetClip ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2562 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay* display = nsnull;

  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  nsresult rv = NS_OK;
  nsROCSSPrimitiveValue *topVal = nsnull;
  nsROCSSPrimitiveValue *rightVal = nsnull;
  nsROCSSPrimitiveValue *bottomVal = nsnull;
  nsROCSSPrimitiveValue *leftVal = nsnull;
  if (display) {
    if (display->mClipFlags == NS_STYLE_CLIP_AUTO ||
        display->mClipFlags == (NS_STYLE_CLIP_TOP_AUTO |
                                NS_STYLE_CLIP_RIGHT_AUTO |
                                NS_STYLE_CLIP_BOTTOM_AUTO |
                                NS_STYLE_CLIP_LEFT_AUTO)) {
      val->SetIdent(nsLayoutAtoms::autoAtom);
    } else {
      // create the cssvalues for the sides, stick them in the rect object
      topVal = GetROCSSPrimitiveValue();
      rightVal = GetROCSSPrimitiveValue();
      bottomVal = GetROCSSPrimitiveValue();
      leftVal = GetROCSSPrimitiveValue();
      if (topVal && rightVal && bottomVal && leftVal) {
        nsDOMCSSRect * domRect = new nsDOMCSSRect(topVal, rightVal,
                                                  bottomVal, leftVal);
        if (domRect) {
          if (display->mClipFlags & NS_STYLE_CLIP_TOP_AUTO) {
            topVal->SetIdent(nsLayoutAtoms::autoAtom);
          } else {
            topVal->SetTwips(display->mClip.y);
          }
        
          if (display->mClipFlags & NS_STYLE_CLIP_RIGHT_AUTO) {
            rightVal->SetIdent(nsLayoutAtoms::autoAtom);
          } else {
            rightVal->SetTwips(display->mClip.width + display->mClip.x);
          }
        
          if (display->mClipFlags & NS_STYLE_CLIP_BOTTOM_AUTO) {
            bottomVal->SetIdent(nsLayoutAtoms::autoAtom);
          } else {
            bottomVal->SetTwips(display->mClip.height + display->mClip.y);
          }
          
          if (display->mClipFlags & NS_STYLE_CLIP_LEFT_AUTO) {
            leftVal->SetIdent(nsLayoutAtoms::autoAtom);
          } else {
            leftVal->SetTwips(display->mClip.x);
          }

          val->SetRect(domRect);
        } else {
          rv = NS_ERROR_OUT_OF_MEMORY;
        }
      } else {
        rv = NS_ERROR_OUT_OF_MEMORY;
      }
    }
  }

  if (NS_FAILED(rv)) {
    delete topVal;
    delete rightVal;
    delete bottomVal;
    delete leftVal;
    delete val;

    return rv;
  }
  
  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetColor ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 490 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleColor* color = nsnull;
  GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)color, aFrame);

  nsDOMCSSRGBColor *rgb = nsnull;

  if (color) {
    rgb = GetDOMCSSRGBColor(color->mColor);
    if (!rgb) {
      delete val;

      return NS_ERROR_OUT_OF_MEMORY;
    }

    val->SetColor(rgb);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetColumnCount ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 533 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleColumn* column = nsnull;
  GetStyleData(eStyleStruct_Column, (const nsStyleStruct*&)column, aFrame);

  if (column) {
    if (column->mColumnCount == NS_STYLE_COLUMN_COUNT_AUTO) {
      val->SetIdent(nsLayoutAtoms::autoAtom);
    } else {
      val->SetNumber(column->mColumnCount);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetColumnGap ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 584 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleColumn* column = nsnull;
  GetStyleData(eStyleStruct_Column, (const nsStyleStruct*&)column, aFrame);

  if (column) {
    switch (column->mColumnGap.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(column->mColumnGap.GetCoordValue());
        break;
      case eStyleUnit_Percent:
        if (aFrame) {
          val->SetTwips(column->mColumnGap.GetPercentValue()*aFrame->GetSize().width);
        } else {
          val->SetPercent(column->mColumnGap.GetPercentValue());
        }
        break;
      default:
        NS_ERROR("Unexpected column gap unit");
        val->SetTwips(0);
        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetColumnWidth ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 554 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleColumn* column = nsnull;
  GetStyleData(eStyleStruct_Column, (const nsStyleStruct*&)column, aFrame);

  if (column) {
    switch (column->mColumnWidth.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(column->mColumnWidth.GetCoordValue());
        break;
      case eStyleUnit_Auto:
        // XXX fix this. When we actually have a column frame, I think
        // we should return the computed column width.
        val->SetIdent(nsLayoutAtoms::autoAtom);
        break;
      default:
        NS_ERROR("Unexpected column width unit");
        val->SetTwips(0);
        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 616 of file nsComputedDOMStyle.cpp.

{
  const nsStyleContent *content = nsnull;
  GetStyleData(eStyleStruct_Content, (const nsStyleStruct*&)content, aFrame);

  if (content && content->CounterIncrementCount() == 0) {
    nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
    NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
    val->SetIdent(nsLayoutAtoms::none);
    return CallQueryInterface(val, aValue);
  }

  nsDOMCSSValueList *valueList = GetROCSSValueList(PR_FALSE);
  NS_ENSURE_TRUE(valueList, NS_ERROR_OUT_OF_MEMORY);

  if (content) {
    for (PRUint32 i = 0, i_end = content->CounterIncrementCount(); i < i_end; ++i) {
      nsROCSSPrimitiveValue* name = GetROCSSPrimitiveValue();
      if (!name) {
        delete valueList;
        return NS_ERROR_OUT_OF_MEMORY;
      }
      if (!valueList->AppendCSSValue(name)) {
        delete valueList;
        delete name;
        return NS_ERROR_OUT_OF_MEMORY;
      }
    
      nsROCSSPrimitiveValue* value = GetROCSSPrimitiveValue();
      if (!value) {
        delete valueList;
        return NS_ERROR_OUT_OF_MEMORY;
      }
      if (!valueList->AppendCSSValue(value)) {
        delete valueList;
        delete value;
        return NS_ERROR_OUT_OF_MEMORY;
      }

      const nsStyleCounterData *data = content->GetCounterIncrementAt(i);
      name->SetString(data->mCounter);
      value->SetNumber(data->mValue); // XXX This should really be integer
    }
  }

  return CallQueryInterface(valueList, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetCounterReset ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 666 of file nsComputedDOMStyle.cpp.

{
  const nsStyleContent *content = nsnull;
  GetStyleData(eStyleStruct_Content, (const nsStyleStruct*&)content, aFrame);

  if (content && content->CounterResetCount() == 0) {
    nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
    NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
    val->SetIdent(nsLayoutAtoms::none);
    return CallQueryInterface(val, aValue);
  }

  nsDOMCSSValueList *valueList = GetROCSSValueList(PR_FALSE);
  NS_ENSURE_TRUE(valueList, NS_ERROR_OUT_OF_MEMORY);

  if (content) {
    for (PRUint32 i = 0, i_end = content->CounterResetCount(); i < i_end; ++i) {
      nsROCSSPrimitiveValue* name = GetROCSSPrimitiveValue();
      if (!name) {
        delete valueList;
        return NS_ERROR_OUT_OF_MEMORY;
      }
      if (!valueList->AppendCSSValue(name)) {
        delete valueList;
        delete name;
        return NS_ERROR_OUT_OF_MEMORY;
      }
    
      nsROCSSPrimitiveValue* value = GetROCSSPrimitiveValue();
      if (!value) {
        delete valueList;
        return NS_ERROR_OUT_OF_MEMORY;
      }
      if (!valueList->AppendCSSValue(value)) {
        delete valueList;
        delete value;
        return NS_ERROR_OUT_OF_MEMORY;
      }

      const nsStyleCounterData *data = content->GetCounterResetAt(i);
      name->SetString(data->mCounter);
      value->SetNumber(data->mValue); // XXX This should really be integer
    }
  }

  return CallQueryInterface(valueList, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetCssFloat ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 435 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay* display = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  if (display && display->mFloats != NS_STYLE_FLOAT_NONE) {
    const nsAFlatCString& cssFloat =
      nsCSSProps::ValueToKeyword(display->mFloats,
                                 nsCSSProps::kFloatKTable);
    val->SetIdent(cssFloat);
  } else {
    val->SetIdent(nsLayoutAtoms::none);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetCursor ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2120 of file nsComputedDOMStyle.cpp.

{
  nsDOMCSSValueList *valueList = GetROCSSValueList(PR_TRUE);
  NS_ENSURE_TRUE(valueList, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleUserInterface *ui = nsnull;
  GetStyleData(eStyleStruct_UserInterface, (const nsStyleStruct*&)ui, aFrame);

  if (ui) {
    for (nsCursorImage *item = ui->mCursorArray,
                   *item_end = ui->mCursorArray + ui->mCursorArrayLength;
         item < item_end; ++item) {
      nsDOMCSSValueList *itemList = GetROCSSValueList(PR_FALSE);
      if (!itemList || !valueList->AppendCSSValue(itemList)) {
        delete itemList;
        delete valueList;
        return NS_ERROR_OUT_OF_MEMORY;
      }

      nsCOMPtr<nsIURI> uri;
      item->mImage->GetURI(getter_AddRefs(uri));

      nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
      if (!val || !itemList->AppendCSSValue(val)) {
        delete val;
        delete valueList;
        return NS_ERROR_OUT_OF_MEMORY;
      }
      val->SetURI(uri);

      if (item->mHaveHotspot) {
        nsROCSSPrimitiveValue *valX = GetROCSSPrimitiveValue();
        if (!valX || !itemList->AppendCSSValue(valX)) {
          delete valX;
          delete valueList;
          return NS_ERROR_OUT_OF_MEMORY;
        }
        nsROCSSPrimitiveValue *valY = GetROCSSPrimitiveValue();
        if (!valY || !itemList->AppendCSSValue(valY)) {
          delete valY;
          delete valueList;
          return NS_ERROR_OUT_OF_MEMORY;
        }

        valX->SetNumber(item->mHotspotX);
        valY->SetNumber(item->mHotspotY);
      }
    }

    nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
    if (!val) {
      delete valueList;
      return NS_ERROR_OUT_OF_MEMORY;
    }

    if (ui->mCursor == NS_STYLE_CURSOR_AUTO) {
      val->SetIdent(nsLayoutAtoms::autoAtom);
    } else {
      const nsAFlatCString& cursor =
        nsCSSProps::ValueToKeyword(ui->mCursor,
                                   nsCSSProps::kCursorKTable);
      val->SetIdent(cursor);
    }
    if (!valueList->AppendCSSValue(val)) {
      delete valueList;
      delete val;
      return NS_ERROR_OUT_OF_MEMORY;
    }
  }

  return CallQueryInterface(valueList, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetDirection ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2077 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleVisibility *visibility = nsnull;
  GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)visibility,
               aFrame);

  if (visibility) {
    const nsAFlatCString & direction =
      nsCSSProps::ValueToKeyword(visibility->mDirection,
                                 nsCSSProps::kDirectionKTable);
    val->SetIdent(direction);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetDisplay ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2516 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay *displayData = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)displayData,
               aFrame);

  if (displayData) {
    if (displayData->mDisplay == NS_STYLE_DISPLAY_NONE) {
      val->SetIdent(nsLayoutAtoms::none);
    } else {
      const nsAFlatCString& display =
        nsCSSProps::ValueToKeyword(displayData->mDisplay,
                                   nsCSSProps::kDisplayKTable);
      val->SetIdent(display);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 464 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *red   = GetROCSSPrimitiveValue();
  nsROCSSPrimitiveValue *green = GetROCSSPrimitiveValue();
  nsROCSSPrimitiveValue *blue  = GetROCSSPrimitiveValue();

  if (red && green && blue) {
    nsDOMCSSRGBColor *rgbColor = new nsDOMCSSRGBColor(red, green, blue);

    if (rgbColor) {
      red->SetNumber(NS_GET_R(aColor));
      green->SetNumber(NS_GET_G(aColor));
      blue->SetNumber(NS_GET_B(aColor));

      return rgbColor;
    }
  }

  delete red;
  delete green;
  delete blue;

  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetEmptyCells ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1148 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleTableBorder *table = nsnull;
  GetStyleData(eStyleStruct_TableBorder, (const nsStyleStruct*&)table, aFrame);

  if (table) {
    const nsAFlatCString& emptyCells =
      nsCSSProps::ValueToKeyword(table->mEmptyCells,
                                 nsCSSProps::kEmptyCellsKTable);
    val->SetIdent(emptyCells);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetFloatEdge ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2376 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleBorder *borderData = nsnull;
  GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)borderData, aFrame);

  PRUint8 floatEdge = NS_STYLE_FLOAT_EDGE_CONTENT;
  if (borderData) {
    floatEdge = borderData->mFloatEdge;
  }

  const nsAFlatCString& floatEdgeIdent =
    nsCSSProps::ValueToKeyword(floatEdge,
                               nsCSSProps::kFloatEdgeKTable);
  val->SetIdent(floatEdgeIdent);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetFontFamily ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 716 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleFont* font = nsnull;
  GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font, aFrame);

  if (font) {
    nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocumentWeak);
    NS_ASSERTION(doc, "document is required");
    nsIPresShell* presShell = doc->GetShellAt(0);
    NS_ASSERTION(presShell, "pres shell is required");
    nsPresContext *presContext = presShell->GetPresContext();
    NS_ASSERTION(presContext, "pres context is required");

    const nsString& fontName = font->mFont.name;
    PRUint8 generic = font->mFlags & NS_STYLE_FONT_FACE_MASK;
    if (generic == kGenericFont_NONE && !font->mFont.systemFont) { 
      const nsFont* defaultFont =
        presContext->GetDefaultFont(kPresContext_DefaultVariableFont_ID);

      PRInt32 lendiff = fontName.Length() - defaultFont->name.Length();
      if (lendiff > 0) {
        val->SetString(Substring(fontName, 0, lendiff-1)); // -1 removes comma
      } else {
        val->SetString(fontName);
      }
    } else {
      val->SetString(fontName);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetFontSize ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 754 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleFont* font = nsnull;
  GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font, aFrame);

  // Note: font->mSize is the 'computed size'; font->mFont.size is the
  // 'actual size'
  val->SetTwips(font? font->mSize:0);

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetFontSizeAdjust ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 771 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleFont *font = nsnull;
  GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font, aFrame);

  if (font && font->mFont.sizeAdjust) {
    val->SetNumber(font->mFont.sizeAdjust);
  } else {
    val->SetIdent(nsLayoutAtoms::none);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetFontStyle ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 790 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleFont* font = nsnull;
  GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font, aFrame);

  if (font && font->mFont.style != NS_STYLE_FONT_STYLE_NORMAL) {
    const nsAFlatCString& style=
      nsCSSProps::ValueToKeyword(font->mFont.style,
                                 nsCSSProps::kFontStyleKTable);
    val->SetIdent(style);
  } else {
    val->SetIdent(nsLayoutAtoms::normal);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetFontVariant ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 836 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleFont* font = nsnull;
  GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font, aFrame);

  if (font && font->mFont.variant != NS_STYLE_FONT_VARIANT_NORMAL) {
    const nsAFlatCString& variant=
      nsCSSProps::ValueToKeyword(font->mFont.variant,
                                 nsCSSProps::kFontVariantKTable);
    val->SetIdent(variant);
  } else {
    val->SetIdent(nsLayoutAtoms::normal);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetFontWeight ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 812 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleFont* font = nsnull;
  GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font, aFrame);

  if (font) {
    const nsAFlatCString& str_weight=
      nsCSSProps::ValueToKeyword(font->mFont.weight,
                                 nsCSSProps::kFontWeightKTable);
    if (!str_weight.IsEmpty()) {
      val->SetIdent(str_weight);
    } else {
      val->SetNumber(font->mFont.weight);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetHeight ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2710 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  PRBool calcHeight = PR_FALSE;
  
  if (aFrame) {
    calcHeight = PR_TRUE;

    FlushPendingReflows();
  
    const nsStyleDisplay* displayData = nsnull;
    GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)displayData,
                 aFrame);
    if (displayData && displayData->mDisplay == NS_STYLE_DISPLAY_INLINE
        && !(aFrame->GetStateBits() & NS_FRAME_REPLACED_ELEMENT)) {
      calcHeight = PR_FALSE;
    }
  }

  if (calcHeight) {
    nsMargin padding;
    nsMargin border;
    nsSize size = aFrame->GetSize();
    const nsStylePadding* paddingData = nsnull;
    GetStyleData(eStyleStruct_Padding, (const nsStyleStruct*&)paddingData,
                 aFrame);
    if (paddingData) {
      paddingData->CalcPaddingFor(aFrame, padding);
    }
    const nsStyleBorder* borderData = nsnull;
    GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)borderData,
                 aFrame);
    if (borderData) {
      borderData->CalcBorderFor(aFrame, border);
    }
  
    val->SetTwips(size.height - padding.top - padding.bottom -
                  border.top - border.bottom);
  } else {
    // Just return the value in the style context
    const nsStylePosition* positionData = nsnull;
    GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)positionData,
                 aFrame);
    if (positionData) {
      switch (positionData->mHeight.GetUnit()) {
        case eStyleUnit_Coord:
          val->SetTwips(positionData->mHeight.GetCoordValue());
          break;
        case eStyleUnit_Percent:
          val->SetPercent(positionData->mHeight.GetPercentValue());
          break;
        case eStyleUnit_Auto:
          val->SetIdent(nsLayoutAtoms::autoAtom);
          break;
        default:
          NS_ERROR("Unexpected height unit");
          val->SetTwips(0);
          break;
      }
    }
  }
  
  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetImageRegion ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1721 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleList* list = nsnull;

  GetStyleData(eStyleStruct_List, (const nsStyleStruct*&)list, aFrame);

  nsresult rv = NS_OK;
  nsROCSSPrimitiveValue *topVal = nsnull;
  nsROCSSPrimitiveValue *rightVal = nsnull;
  nsROCSSPrimitiveValue *bottomVal = nsnull;
  nsROCSSPrimitiveValue *leftVal = nsnull;
  if (list) {
    if (list->mImageRegion.width <= 0 || list->mImageRegion.height <= 0) {
      val->SetIdent(nsLayoutAtoms::autoAtom);
    } else {
      // create the cssvalues for the sides, stick them in the rect object
      topVal = GetROCSSPrimitiveValue();
      rightVal = GetROCSSPrimitiveValue();
      bottomVal = GetROCSSPrimitiveValue();
      leftVal = GetROCSSPrimitiveValue();
      if (topVal && rightVal && bottomVal && leftVal) {
        nsDOMCSSRect * domRect = new nsDOMCSSRect(topVal, rightVal,
                                                  bottomVal, leftVal);
        if (domRect) {
          topVal->SetTwips(list->mImageRegion.y);
          rightVal->SetTwips(list->mImageRegion.width + list->mImageRegion.x);
          bottomVal->SetTwips(list->mImageRegion.height + list->mImageRegion.y);
          leftVal->SetTwips(list->mImageRegion.x);
          val->SetRect(domRect);
        } else {
          rv = NS_ERROR_OUT_OF_MEMORY;
        }
      } else {
        rv = NS_ERROR_OUT_OF_MEMORY;
      }
    }
  }

  if (NS_FAILED(rv)) {
    delete topVal;
    delete rightVal;
    delete bottomVal;
    delete leftVal;
    delete val;

    return rv;
  }
  
  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetLeft ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3045 of file nsComputedDOMStyle.cpp.

{
  return GetOffsetWidthFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetLetterSpacing ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1996 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleText *text = nsnull;
  GetStyleData(eStyleStruct_Text, (const nsStyleStruct*&)text, aFrame);

  if (text && text->mLetterSpacing.GetUnit() == eStyleUnit_Coord) {
    val->SetTwips(text->mLetterSpacing.GetCoordValue());
  } else {
    val->SetIdent(nsLayoutAtoms::normal);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetLineHeight ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1777 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleText *text = nsnull;
  GetStyleData(eStyleStruct_Text, (const nsStyleStruct*&)text, aFrame);

  nscoord lineHeight;
  nsresult rv = GetLineHeightCoord(aFrame, text, lineHeight);

  if (NS_SUCCEEDED(rv)) {
    val->SetTwips(lineHeight);
  } else if (text) {
    switch (text->mLineHeight.GetUnit()) {
      case eStyleUnit_Percent:
        val->SetPercent(text->mLineHeight.GetPercentValue());
        break;
      case eStyleUnit_Factor:
        val->SetNumber(text->mLineHeight.GetFactorValue());
        break;
      default:
        NS_ERROR("Unexpected line-height unit");
        val->SetIdent(nsLayoutAtoms::normal);
        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetLineHeightCoord ( nsIFrame aFrame,
const nsStyleText aText,
nscoord aCoord 
) [private]

Definition at line 3387 of file nsComputedDOMStyle.cpp.

{
  nsresult rv = NS_ERROR_FAILURE;

  if (aText) {
    const nsStyleFont *font = nsnull;
    GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font, aFrame);
    switch (aText->mLineHeight.GetUnit()) {
      case eStyleUnit_Coord:
        aCoord = aText->mLineHeight.GetCoordValue();
        rv = NS_OK;
        break;
      case eStyleUnit_Percent:
        if (font) {
          aCoord = nscoord(aText->mLineHeight.GetPercentValue() * font->mSize);
          rv = NS_OK;
        }
        break;
      case eStyleUnit_Factor:
        if (font) {
          aCoord = nscoord(aText->mLineHeight.GetFactorValue() * font->mSize);
          rv = NS_OK;
        }
        break;
      default:
        break;
    }
  }

  if (NS_FAILED(rv))
    aCoord = 0;

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetListStyleImage ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1652 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleList* list = nsnull;
  GetStyleData(eStyleStruct_List, (const nsStyleStruct*&)list, aFrame);

  if (list) {
    if (!list->mListStyleImage) {
      val->SetIdent(nsLayoutAtoms::none);
    } else {
      nsCOMPtr<nsIURI> uri;
      if (list->mListStyleImage) {
        list->mListStyleImage->GetURI(getter_AddRefs(uri));
      }
      val->SetURI(uri);
    }
  }
    
  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 1677 of file nsComputedDOMStyle.cpp.

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetListStyleType ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1697 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleList *list = nsnull;
  GetStyleData(eStyleStruct_List, (const nsStyleStruct*&)list, aFrame);

  if (list) {
    if (list->mListStyleType == NS_STYLE_LIST_STYLE_NONE) {
      val->SetIdent(nsLayoutAtoms::none);
    } else {
      const nsAFlatCString& style =
        nsCSSProps::ValueToKeyword(list->mListStyleType,
                                   nsCSSProps::kListStyleKTable);
      val->SetIdent(style);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 1368 of file nsComputedDOMStyle.cpp.

{
  return GetMarginWidthFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1375 of file nsComputedDOMStyle.cpp.

{
  return GetMarginWidthFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1382 of file nsComputedDOMStyle.cpp.

{
  return GetMarginWidthFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetMarginTopWidth ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1361 of file nsComputedDOMStyle.cpp.

{
  return GetMarginWidthFor(NS_SIDE_TOP, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetMarginWidth ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1351 of file nsComputedDOMStyle.cpp.

{
  // return null per spec.
  aValue = nsnull;

  return NS_OK;
}

Definition at line 3590 of file nsComputedDOMStyle.cpp.

{
  const nsStyleMargin* marginData = nsnull;
  GetStyleData(eStyleStruct_Margin, (const nsStyleStruct*&)marginData, aFrame);
  if (marginData) {
    nsMargin margin;
    marginData->CalcMarginFor(aFrame, margin);
    switch(aSide) {
      case NS_SIDE_TOP    :
        return margin.top;
      case NS_SIDE_BOTTOM :
        return margin.bottom;
      case NS_SIDE_LEFT   :
        return margin.left;
      case NS_SIDE_RIGHT  :
        return margin.right;
      default:
        NS_ERROR("Invalid side");
        break;
    }
  }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetMarginWidthFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3575 of file nsComputedDOMStyle.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetMarkerOffset ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1389 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleContent* content = nsnull;
  GetStyleData(eStyleStruct_Content, (const nsStyleStruct*&)content, aFrame);

  if (content) {
    switch (content->mMarkerOffset.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(content->mMarkerOffset.GetCoordValue());
        break;
      case eStyleUnit_Auto:
        val->SetIdent(nsLayoutAtoms::autoAtom);
        break;
      case eStyleUnit_Null:
        val->SetIdent(nsLayoutAtoms::none);
        break;
      default:
        NS_ERROR("Unexpected marker offset unit");
        val->SetTwips(0);
        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetMaxHeight ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2847 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStylePosition *positionData = nsnull;
  GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)positionData,
               aFrame);

  FlushPendingReflows();

  if (positionData) {
    nsIFrame *container = nsnull;
    nsSize size;
    nscoord minHeight = 0;

    if (positionData->mMinHeight.GetUnit() == eStyleUnit_Percent) {
      container = GetContainingBlockFor(aFrame);
      if (container) {
        size = container->GetSize();
        minHeight = nscoord(size.height *
                            positionData->mMinHeight.GetPercentValue());
      }
    } else if (positionData->mMinHeight.GetUnit() == eStyleUnit_Coord) {
      minHeight = positionData->mMinHeight.GetCoordValue();
    }

    switch (positionData->mMaxHeight.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(PR_MAX(minHeight,
                             positionData->mMaxHeight.GetCoordValue()));
        break;
      case eStyleUnit_Percent:
        if (!container) {
          container = GetContainingBlockFor(aFrame);
          if (container) {
            size = container->GetSize();
          } else {
            // no containing block
            val->SetPercent(positionData->mMaxHeight.GetPercentValue());
          }
        }
        if (container) {
          val->SetTwips(PR_MAX(minHeight, size.height *
                               positionData->mMaxHeight.GetPercentValue()));
        }

        break;
      default:
        val->SetIdent(nsLayoutAtoms::none);

        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetMaxWidth ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2907 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStylePosition *positionData = nsnull;
  GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)positionData,
               aFrame);

  FlushPendingReflows();

  if (positionData) {
    nsIFrame *container = nsnull;
    nsSize size;
    nscoord minWidth = 0;

    if (positionData->mMinWidth.GetUnit() == eStyleUnit_Percent) {
      container = GetContainingBlockFor(aFrame);
      if (container) {
        size = container->GetSize();
        minWidth = nscoord(size.width *
                           positionData->mMinWidth.GetPercentValue());
      }
    } else if (positionData->mMinWidth.GetUnit() == eStyleUnit_Coord) {
      minWidth = positionData->mMinWidth.GetCoordValue();
    }

    switch (positionData->mMaxWidth.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(PR_MAX(minWidth,
                             positionData->mMaxWidth.GetCoordValue()));
        break;
      case eStyleUnit_Percent:
        if (!container) {
          container = GetContainingBlockFor(aFrame);
          if (container) {
            size = container->GetSize();
          } else {
            // no containing block
            val->SetPercent(positionData->mMaxWidth.GetPercentValue());
          }
        }
        if (container) {
          val->SetTwips(PR_MAX(minWidth, size.width *
                               positionData->mMaxWidth.GetPercentValue()));
        }

        break;
      default:
        val->SetIdent(nsLayoutAtoms::none);

        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetMinHeight ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2967 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStylePosition *positionData = nsnull;
  GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)positionData,
               aFrame);

  FlushPendingReflows();

  if (positionData) {
    nsIFrame *container = nsnull;
    switch (positionData->mMinHeight.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(positionData->mMinHeight.GetCoordValue());
        break;
      case eStyleUnit_Percent:
        container = GetContainingBlockFor(aFrame);
        if (container) {
          val->SetTwips(container->GetSize().height *
                        positionData->mMinHeight.GetPercentValue());
        } else {
          // no containing block
          val->SetPercent(positionData->mMinHeight.GetPercentValue());
        }

        break;
      default:
        val->SetTwips(0);

        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetMinWidth ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3007 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStylePosition *positionData = nsnull;
  GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)positionData,
               aFrame);

  FlushPendingReflows();

  if (positionData) {
    nsIFrame *container = nsnull;
    switch (positionData->mMinWidth.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(positionData->mMinWidth.GetCoordValue());
        break;
      case eStyleUnit_Percent:
        container = GetContainingBlockFor(aFrame);
        if (container) {
          val->SetTwips(container->GetSize().width *
                        positionData->mMinWidth.GetPercentValue());
        } else {
          // no containing block
          val->SetPercent(positionData->mMinWidth.GetPercentValue());
        }
        break;
      default:
        val->SetTwips(0);
        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOffsetWidthFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3083 of file nsComputedDOMStyle.cpp.

{
  const nsStyleDisplay* display = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  FlushPendingReflows();

  nsresult rv = NS_OK;
  if (display) {
    switch (display->mPosition) {
      case NS_STYLE_POSITION_STATIC:
        rv = GetStaticOffset(aSide, aFrame, aValue);
        break;
      case NS_STYLE_POSITION_RELATIVE:
        rv = GetRelativeOffset(aSide, aFrame, aValue);
        break;
      case NS_STYLE_POSITION_ABSOLUTE:
      case NS_STYLE_POSITION_FIXED:
        rv = GetAbsoluteOffset(aSide, aFrame, aValue);
        break;
      default:
        NS_ERROR("Invalid position");
        break;
    }
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetOpacity ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 516 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay *display = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  if (display) {
    val->SetNumber(display->mOpacity);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOutline ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1420 of file nsComputedDOMStyle.cpp.

{
  // return null per spec.
  aValue = nsnull;

  return NS_OK;
}
nsresult nsComputedDOMStyle::GetOutlineColor ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1561 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleOutline* outline = nsnull;
  GetStyleData(eStyleStruct_Outline, (const nsStyleStruct*&)outline, aFrame);

  if (outline) {
    nscolor color;
    outline->GetOutlineColor(color);

    nsDOMCSSRGBColor *rgb = nsnull;
    rgb = GetDOMCSSRGBColor(color);
    if (!rgb) {
      delete val;

      return NS_ERROR_OUT_OF_MEMORY;
    }

    val->SetColor(rgb);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOutlineOffset ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1504 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleOutline* outline = nsnull;
  GetStyleData(eStyleStruct_Outline, (const nsStyleStruct*&)outline, aFrame);

  if (outline) {
    switch (outline->mOutlineOffset.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(outline->mOutlineOffset.GetCoordValue());
        break;
      case eStyleUnit_Chars:
        // XXX we need a frame and a rendering context to calculate this, bug 281972, bug 282126.
        val->SetTwips(0);
        break;
      default:
        NS_ERROR("Unexpected outline offset unit");
        val->SetTwips(0);
        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Definition at line 1533 of file nsComputedDOMStyle.cpp.

{
  return GetOutlineRadiusFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1540 of file nsComputedDOMStyle.cpp.

{
  return GetOutlineRadiusFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOutlineRadiusFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1589 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleOutline *outline = nsnull;
  GetStyleData(eStyleStruct_Outline, (const nsStyleStruct*&)outline, aFrame);

  if (outline) {
    nsStyleCoord coord;
    outline->mOutlineRadius.Get(aSide, coord);

    switch (coord.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(coord.GetCoordValue());
        break;
      case eStyleUnit_Percent:
        if (aFrame) {
          val->SetTwips(coord.GetPercentValue() * aFrame->GetSize().width);
        } else {
          val->SetPercent(coord.GetPercentValue());
        }
        break;
      default:
        NS_ERROR("Unexpected outline radius unit");
        break;
    }
  } else {
    val->SetTwips(0);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1547 of file nsComputedDOMStyle.cpp.

{
  return GetOutlineRadiusFor(NS_SIDE_TOP, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 1554 of file nsComputedDOMStyle.cpp.

{
  return GetOutlineRadiusFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOutlineStyle ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1474 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleOutline* outline = nsnull;
  GetStyleData(eStyleStruct_Outline, (const nsStyleStruct*&)outline, aFrame);

  if (outline) {
    PRUint8 outlineStyle = outline->GetOutlineStyle();
    switch (outlineStyle) {
      case NS_STYLE_BORDER_STYLE_NONE:
        val->SetIdent(nsLayoutAtoms::none);
        break;
      case NS_STYLE_BORDER_STYLE_AUTO:
        val->SetIdent(nsLayoutAtoms::autoAtom);
        break;
      default:
        const nsAFlatCString& style =
          nsCSSProps::ValueToKeyword(outlineStyle,
                                     nsCSSProps::kOutlineStyleKTable);
        val->SetIdent(style);
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOutlineWidth ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1430 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleOutline* outline = nsnull;
  GetStyleData(eStyleStruct_Outline, (const nsStyleStruct*&)outline, aFrame);

  if (outline) {
    nsStyleCoord coord;
    PRUint8 outlineStyle = outline->GetOutlineStyle();
    if (outlineStyle == NS_STYLE_BORDER_STYLE_NONE) {
      coord.SetCoordValue(0);
    } else {
      coord = outline->mOutlineWidth;
    }
    switch (coord.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(coord.GetCoordValue());
        break;
      case eStyleUnit_Enumerated:
        {
          const nsAFlatCString& width =
            nsCSSProps::ValueToKeyword(coord.GetIntValue(),
                                       nsCSSProps::kBorderWidthKTable);
          val->SetIdent(width);
          break;
        }
      case eStyleUnit_Chars:
        // XXX we need a frame and a rendering context to calculate this, bug 281972, bug 282126.
        val->SetTwips(0);
        break;
      default:
        NS_ERROR("Unexpected outline width unit");
        val->SetTwips(0);
        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOverflow ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2642 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay* display = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  if (display && display->mOverflowX == display->mOverflowY) {
    if (display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
      const nsAFlatCString& overflow =
        nsCSSProps::ValueToKeyword(display->mOverflowX,
                                   nsCSSProps::kOverflowKTable);
      val->SetIdent(overflow);
    } else {
      val->SetIdent(nsLayoutAtoms::autoAtom);
    }
  } // XXX else what?

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOverflowX ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2666 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay* display = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  if (display && display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
    const nsAFlatCString& overflow =
      nsCSSProps::ValueToKeyword(display->mOverflowX,
                                 nsCSSProps::kOverflowSubKTable);
    val->SetIdent(overflow);
  } else {
    val->SetIdent(nsLayoutAtoms::autoAtom);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetOverflowY ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2688 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay* display = nsnull;
  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  if (display && display->mOverflowY != NS_STYLE_OVERFLOW_AUTO) {
    const nsAFlatCString& overflow =
      nsCSSProps::ValueToKeyword(display->mOverflowY,
                                 nsCSSProps::kOverflowSubKTable);
    val->SetIdent(overflow);
  } else {
    val->SetIdent(nsLayoutAtoms::autoAtom);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetPadding ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1029 of file nsComputedDOMStyle.cpp.

{
  // return null per spec.
  aValue = nsnull;

  return NS_OK;
}
nsresult nsComputedDOMStyle::GetPaddingBottom ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1046 of file nsComputedDOMStyle.cpp.

{
  return GetPaddingWidthFor(NS_SIDE_BOTTOM, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetPaddingLeft ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1053 of file nsComputedDOMStyle.cpp.

{
  return GetPaddingWidthFor(NS_SIDE_LEFT, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetPaddingRight ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1060 of file nsComputedDOMStyle.cpp.

{
  return GetPaddingWidthFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetPaddingTop ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 1039 of file nsComputedDOMStyle.cpp.

{
  return GetPaddingWidthFor(NS_SIDE_TOP, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 3332 of file nsComputedDOMStyle.cpp.

{
  const nsStylePadding* paddingData = nsnull;
  GetStyleData(eStyleStruct_Padding, (const nsStyleStruct*&)paddingData,
               aFrame);

  if (paddingData) {
    nsMargin padding;
    paddingData->CalcPaddingFor(aFrame, padding);
    switch(aSide) {
      case NS_SIDE_TOP    :
        return padding.top;
      case NS_SIDE_BOTTOM :
        return padding.bottom;
      case NS_SIDE_LEFT   :
        return padding.left;
      case NS_SIDE_RIGHT  :
        return padding.right;
      default:
        NS_ERROR("Invalid side");
        break;
    }
  }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetPaddingWidthFor ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3317 of file nsComputedDOMStyle.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetPosition ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 2541 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStyleDisplay* display = nsnull;

  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);

  if (display) {
    const nsAFlatCString& position =
      nsCSSProps::ValueToKeyword(display->mPosition,
                                 nsCSSProps::kPositionKTable);
    val->SetIdent(position);
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

nsIDOMCSSValue nsIDOMCSSStyleDeclaration::getPropertyCSSValue ( in DOMString  propertyName) [inherited]
DOMString nsIDOMCSSStyleDeclaration::getPropertyPriority ( in DOMString  propertyName) [inherited]
DOMString nsIDOMCSSStyleDeclaration::getPropertyValue ( in DOMString  propertyName) [inherited]
NS_IMETHOD nsICSSDeclaration::GetPropertyValue ( const nsCSSProperty  aPropID,
nsAString &  aValue 
) [pure virtual, inherited]

Method analogous to nsIDOMCSSStyleDeclaration::GetPropertyValue, which obeys all the same restrictions.

NS_IMETHOD nsICSSDeclaration::GetPropertyValue ( const nsAString &  aPropName,
nsAString &  aValue 
) [pure virtual, inherited]

Implemented in nsDOMCSSDeclaration.

Definition at line 3648 of file nsComputedDOMStyle.cpp.

{
  /* ******************************************************************* *\
   * Properties below are listed in alphabetical order.                  *
   * Please keep them that way.                                          *
   *                                                                     *
   * Properties commented out with // are not yet implemented            *
   * Properties commented out with //// are shorthands and not queryable *
  \* ******************************************************************* */
  static
#ifndef XP_MACOSX
    // XXX If this actually fixes the bustage, replace this with an
    // autoconf test.
  const
#endif
  ComputedStyleMapEntry map[] = {
    /* ****************************** *\
     * Implementations of CSS2 styles *
    \* ****************************** */

    // COMPUTED_STYLE_MAP_ENTRY(azimuth,                    Azimuth),
    COMPUTED_STYLE_MAP_ENTRY(background_attachment,         BackgroundAttachment),
    COMPUTED_STYLE_MAP_ENTRY(background_color,              BackgroundColor),
    COMPUTED_STYLE_MAP_ENTRY(background_image,              BackgroundImage),
    COMPUTED_STYLE_MAP_ENTRY(background_repeat,             BackgroundRepeat),
    COMPUTED_STYLE_MAP_ENTRY(border_bottom_color,           BorderBottomColor),
    COMPUTED_STYLE_MAP_ENTRY(border_bottom_style,           BorderBottomStyle),
    COMPUTED_STYLE_MAP_ENTRY(border_bottom_width,           BorderBottomWidth),
    COMPUTED_STYLE_MAP_ENTRY(border_collapse,               BorderCollapse),
    COMPUTED_STYLE_MAP_ENTRY(border_left_color,             BorderLeftColor),
    COMPUTED_STYLE_MAP_ENTRY(border_left_style,             BorderLeftStyle),
    COMPUTED_STYLE_MAP_ENTRY(border_left_width,             BorderLeftWidth),
    COMPUTED_STYLE_MAP_ENTRY(border_right_color,            BorderRightColor),
    COMPUTED_STYLE_MAP_ENTRY(border_right_style,            BorderRightStyle),
    COMPUTED_STYLE_MAP_ENTRY(border_right_width,            BorderRightWidth),
    COMPUTED_STYLE_MAP_ENTRY(border_spacing,                BorderSpacing),
    COMPUTED_STYLE_MAP_ENTRY(border_top_color,              BorderTopColor),
    COMPUTED_STYLE_MAP_ENTRY(border_top_style,              BorderTopStyle),
    COMPUTED_STYLE_MAP_ENTRY(border_top_width,              BorderTopWidth),
    COMPUTED_STYLE_MAP_ENTRY(bottom,                        Bottom),
    COMPUTED_STYLE_MAP_ENTRY(caption_side,                  CaptionSide),
    COMPUTED_STYLE_MAP_ENTRY(clear,                         Clear),
    COMPUTED_STYLE_MAP_ENTRY(clip,                          Clip),
    COMPUTED_STYLE_MAP_ENTRY(color,                         Color),
    // COMPUTED_STYLE_MAP_ENTRY(content,                    Content),
    COMPUTED_STYLE_MAP_ENTRY(counter_increment,             CounterIncrement),
    COMPUTED_STYLE_MAP_ENTRY(counter_reset,                 CounterReset),
    // COMPUTED_STYLE_MAP_ENTRY(cue_after,                  CueAfter),
    // COMPUTED_STYLE_MAP_ENTRY(cue_before,                 CueBefore),
    COMPUTED_STYLE_MAP_ENTRY(cursor,                        Cursor),
    COMPUTED_STYLE_MAP_ENTRY(direction,                     Direction),
    COMPUTED_STYLE_MAP_ENTRY(display,                       Display),
    // COMPUTED_STYLE_MAP_ENTRY(elevation,                  Elevation),
    COMPUTED_STYLE_MAP_ENTRY(empty_cells,                   EmptyCells),
    COMPUTED_STYLE_MAP_ENTRY(float,                         CssFloat),
    COMPUTED_STYLE_MAP_ENTRY(font_family,                   FontFamily),
    COMPUTED_STYLE_MAP_ENTRY(font_size,                     FontSize),
    COMPUTED_STYLE_MAP_ENTRY(font_size_adjust,              FontSizeAdjust),
    // COMPUTED_STYLE_MAP_ENTRY(font_stretch,               FontStretch),
    COMPUTED_STYLE_MAP_ENTRY(font_style,                    FontStyle),
    COMPUTED_STYLE_MAP_ENTRY(font_variant,                  FontVariant),
    COMPUTED_STYLE_MAP_ENTRY(font_weight,                   FontWeight),
    COMPUTED_STYLE_MAP_ENTRY(height,                        Height),
    COMPUTED_STYLE_MAP_ENTRY(left,                          Left),
    COMPUTED_STYLE_MAP_ENTRY(letter_spacing,                LetterSpacing),
    COMPUTED_STYLE_MAP_ENTRY(line_height,                   LineHeight),
    COMPUTED_STYLE_MAP_ENTRY(list_style_image,              ListStyleImage),
    COMPUTED_STYLE_MAP_ENTRY(list_style_position,           ListStylePosition),
    COMPUTED_STYLE_MAP_ENTRY(list_style_type,               ListStyleType),
    COMPUTED_STYLE_MAP_ENTRY(margin_bottom,                 MarginBottomWidth),
    COMPUTED_STYLE_MAP_ENTRY(margin_left,                   MarginLeftWidth),
    COMPUTED_STYLE_MAP_ENTRY(margin_right,                  MarginRightWidth),
    COMPUTED_STYLE_MAP_ENTRY(margin_top,                    MarginTopWidth),
    COMPUTED_STYLE_MAP_ENTRY(marker_offset,                 MarkerOffset),
    // COMPUTED_STYLE_MAP_ENTRY(marks,                      Marks),
    COMPUTED_STYLE_MAP_ENTRY(max_height,                    MaxHeight),
    COMPUTED_STYLE_MAP_ENTRY(max_width,                     MaxWidth),
    COMPUTED_STYLE_MAP_ENTRY(min_height,                    MinHeight),
    COMPUTED_STYLE_MAP_ENTRY(min_width,                     MinWidth),
    // COMPUTED_STYLE_MAP_ENTRY(orphans,                    Orphans),
    COMPUTED_STYLE_MAP_ENTRY(outline_color,                 OutlineColor),
    COMPUTED_STYLE_MAP_ENTRY(outline_style,                 OutlineStyle),
    COMPUTED_STYLE_MAP_ENTRY(outline_width,                 OutlineWidth),
    COMPUTED_STYLE_MAP_ENTRY(outline_offset,                OutlineOffset),
    COMPUTED_STYLE_MAP_ENTRY(overflow,                      Overflow),
    COMPUTED_STYLE_MAP_ENTRY(overflow_x,                    OverflowX),
    COMPUTED_STYLE_MAP_ENTRY(overflow_y,                    OverflowY),
    COMPUTED_STYLE_MAP_ENTRY(padding_bottom,                PaddingBottom),
    COMPUTED_STYLE_MAP_ENTRY(padding_left,                  PaddingLeft),
    COMPUTED_STYLE_MAP_ENTRY(padding_right,                 PaddingRight),
    COMPUTED_STYLE_MAP_ENTRY(padding_top,                   PaddingTop),
    // COMPUTED_STYLE_MAP_ENTRY(page,                       Page),
    // COMPUTED_STYLE_MAP_ENTRY(page_break_after,           PageBreakAfter),
    // COMPUTED_STYLE_MAP_ENTRY(page_break_before,          PageBreakBefore),
    // COMPUTED_STYLE_MAP_ENTRY(page_break_inside,          PageBreakInside),
    // COMPUTED_STYLE_MAP_ENTRY(pause_after,                PauseAfter),
    // COMPUTED_STYLE_MAP_ENTRY(pause_before,               PauseBefore),
    // COMPUTED_STYLE_MAP_ENTRY(pitch,                      Pitch),
    // COMPUTED_STYLE_MAP_ENTRY(pitch_range,                PitchRange),
    COMPUTED_STYLE_MAP_ENTRY(position,                      Position),
    // COMPUTED_STYLE_MAP_ENTRY(quotes,                     Quotes),
    // COMPUTED_STYLE_MAP_ENTRY(richness,                   Richness),
    COMPUTED_STYLE_MAP_ENTRY(right,                         Right),
    // COMPUTED_STYLE_MAP_ENTRY(speak,                      Speak),
    // COMPUTED_STYLE_MAP_ENTRY(speak_header,               SpeakHeader),
    // COMPUTED_STYLE_MAP_ENTRY(speak_numeral,              SpeakNumeral),
    // COMPUTED_STYLE_MAP_ENTRY(speak_punctuation,          SpeakPunctuation),
    // COMPUTED_STYLE_MAP_ENTRY(speech_rate,                SpeechRate),
    // COMPUTED_STYLE_MAP_ENTRY(stress,                     Stress),
    COMPUTED_STYLE_MAP_ENTRY(table_layout,                  TableLayout),
    COMPUTED_STYLE_MAP_ENTRY(text_align,                    TextAlign),
    COMPUTED_STYLE_MAP_ENTRY(text_decoration,               TextDecoration),
    COMPUTED_STYLE_MAP_ENTRY(text_indent,                   TextIndent),
    // COMPUTED_STYLE_MAP_ENTRY(text_shadow,                TextShadow),
    COMPUTED_STYLE_MAP_ENTRY(text_transform,                TextTransform),
    COMPUTED_STYLE_MAP_ENTRY(top,                           Top),
    COMPUTED_STYLE_MAP_ENTRY(unicode_bidi,                  UnicodeBidi),
    COMPUTED_STYLE_MAP_ENTRY(vertical_align,                VerticalAlign),
    COMPUTED_STYLE_MAP_ENTRY(visibility,                    Visibility),
    // COMPUTED_STYLE_MAP_ENTRY(voice_family,               VoiceFamily),
    // COMPUTED_STYLE_MAP_ENTRY(volume,                     Volume),
    COMPUTED_STYLE_MAP_ENTRY(white_space,                   WhiteSpace),
    // COMPUTED_STYLE_MAP_ENTRY(widows,                     Widows),
    COMPUTED_STYLE_MAP_ENTRY(width,                         Width),
    COMPUTED_STYLE_MAP_ENTRY(word_spacing,                  WordSpacing),
    COMPUTED_STYLE_MAP_ENTRY(z_index,                       ZIndex),

    /* ******************************* *\
     * Implementations of -moz- styles *
    \* ******************************* */

    COMPUTED_STYLE_MAP_ENTRY(appearance,                    Appearance),
    COMPUTED_STYLE_MAP_ENTRY(_moz_background_clip,          BackgroundClip),
    COMPUTED_STYLE_MAP_ENTRY(_moz_background_inline_policy, BackgroundInlinePolicy),
    COMPUTED_STYLE_MAP_ENTRY(_moz_background_origin,        BackgroundOrigin),
    COMPUTED_STYLE_MAP_ENTRY(binding,                       Binding),
    COMPUTED_STYLE_MAP_ENTRY(border_bottom_colors,          BorderBottomColors),
    COMPUTED_STYLE_MAP_ENTRY(border_left_colors,            BorderLeftColors),
    COMPUTED_STYLE_MAP_ENTRY(border_right_colors,           BorderRightColors),
    COMPUTED_STYLE_MAP_ENTRY(border_top_colors,             BorderTopColors),
    COMPUTED_STYLE_MAP_ENTRY(_moz_border_radius_bottomLeft, BorderRadiusBottomLeft),
    COMPUTED_STYLE_MAP_ENTRY(_moz_border_radius_bottomRight,BorderRadiusBottomRight),
    COMPUTED_STYLE_MAP_ENTRY(_moz_border_radius_topLeft,    BorderRadiusTopLeft),
    COMPUTED_STYLE_MAP_ENTRY(_moz_border_radius_topRight,   BorderRadiusTopRight),
    COMPUTED_STYLE_MAP_ENTRY(box_align,                     BoxAlign),
    COMPUTED_STYLE_MAP_ENTRY(box_direction,                 BoxDirection),
    COMPUTED_STYLE_MAP_ENTRY(box_flex,                      BoxFlex),
    COMPUTED_STYLE_MAP_ENTRY(box_ordinal_group,             BoxOrdinalGroup),
    COMPUTED_STYLE_MAP_ENTRY(box_orient,                    BoxOrient),
    COMPUTED_STYLE_MAP_ENTRY(box_pack,                      BoxPack),
    COMPUTED_STYLE_MAP_ENTRY(box_sizing,                    BoxSizing),
    COMPUTED_STYLE_MAP_ENTRY(_moz_column_count,             ColumnCount),
    COMPUTED_STYLE_MAP_ENTRY(_moz_column_width,             ColumnWidth),
    COMPUTED_STYLE_MAP_ENTRY(_moz_column_gap,               ColumnGap),
    COMPUTED_STYLE_MAP_ENTRY(float_edge,                    FloatEdge),
    COMPUTED_STYLE_MAP_ENTRY(image_region,                  ImageRegion),
    COMPUTED_STYLE_MAP_ENTRY(opacity,                       Opacity),
    COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_bottomLeft, OutlineRadiusBottomLeft),
    COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_bottomRight,OutlineRadiusBottomRight),
    COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_topLeft,    OutlineRadiusTopLeft),
    COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_topRight,   OutlineRadiusTopRight),
    COMPUTED_STYLE_MAP_ENTRY(user_focus,                    UserFocus),
    COMPUTED_STYLE_MAP_ENTRY(user_input,                    UserInput),
    COMPUTED_STYLE_MAP_ENTRY(user_modify,                   UserModify),
    COMPUTED_STYLE_MAP_ENTRY(user_select,                   UserSelect)
  };

  *aLength = NS_ARRAY_LENGTH(map);

  return map;
}

Here is the call graph for this function:

nsresult nsComputedDOMStyle::GetRelativeOffset ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3184 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStylePosition* positionData = nsnull;
  GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)positionData,
               aFrame);
  if (positionData) {
    nsStyleCoord coord;
    PRInt32 sign = 1;
    positionData->mOffset.Get(aSide, coord);
    if (coord.GetUnit() != eStyleUnit_Coord &&
        coord.GetUnit() != eStyleUnit_Percent) {
      positionData->mOffset.Get(NS_OPPOSITE_SIDE(aSide), coord);
      sign = -1;
    }
    nsIFrame* container = nsnull;
    switch(coord.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(sign * coord.GetCoordValue());
        break;
      case eStyleUnit_Percent:
        container = GetContainingBlockFor(aFrame);
        if (container) {
          nsMargin border;
          nsMargin padding;
          container->GetStyleBorder()->CalcBorderFor(container, border);
          container->GetStylePadding()->CalcPaddingFor(container, padding);
          nsSize size = container->GetSize();
          if (aSide == NS_SIDE_LEFT || aSide == NS_SIDE_RIGHT) {
            val->SetTwips(sign * coord.GetPercentValue() *
                          (size.width - border.left - border.right -
                           padding.left - padding.right));
          } else {
            val->SetTwips(sign * coord.GetPercentValue() *
                          (size.height - border.top - border.bottom -
                           padding.top - padding.bottom));
          }
        } else {
          // XXX no containing block.
          val->SetTwips(0);
        }
        break;
      default:
        NS_ERROR("Unexpected left/right/top/bottom unit");
        val->SetTwips(0);
        break;
    }
  }

  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetRight ( nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3051 of file nsComputedDOMStyle.cpp.

{
  return GetOffsetWidthFor(NS_SIDE_RIGHT, aFrame, aValue);
}

Here is the call graph for this function:

Definition at line 3063 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *primitiveValue = new nsROCSSPrimitiveValue(mT2P);

  NS_ASSERTION(primitiveValue != 0, "ran out of memory");

  return primitiveValue;
}

Definition at line 3073 of file nsComputedDOMStyle.cpp.

{
  nsDOMCSSValueList *valueList = new nsDOMCSSValueList(aCommaDelimited,
                                                       PR_TRUE);
  NS_ASSERTION(valueList != 0, "ran out of memory");

  return valueList;
}

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetStaticOffset ( PRUint8  aSide,
nsIFrame aFrame,
nsIDOMCSSValue **  aValue 
) [private]

Definition at line 3240 of file nsComputedDOMStyle.cpp.

{
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);

  const nsStylePosition* positionData = nsnull;
  GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)positionData,
               aFrame);
  if (positionData) {
    nsStyleCoord coord;
    positionData->mOffset.Get(aSide, coord);
    switch(coord.GetUnit()) {
      case eStyleUnit_Coord:
        val->SetTwips(coord.GetCoordValue());

        break;
      case eStyleUnit_Percent:
        val->SetPercent(coord.GetPercentValue());

        break;
      case eStyleUnit_Auto:
        val->SetIdent(nsLayoutAtoms::autoAtom);

        break;
      default:
        NS_ERROR("Unexpected left/right/top/bottom unit");
        val->SetTwips(0);

        break;
    }
  }
  
  return CallQueryInterface(val, aValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsComputedDOMStyle::GetStyleData ( nsStyleStructID  aID,
const nsStyleStruct *&  aStyleStruct,
nsIFrame aFrame = 0 
) [private]

Definition at line 3288 of file nsComputedDOMStyle.cpp.

{
  if (aFrame && !mPseudo) {
    aStyleStruct = aFrame->GetStyleData(aID);
  } else if (mStyleContextHolder) {
    aStyleStruct = mStyleContextHolder->GetStyleData(aID);    
  } else {
    nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocumentWeak);
    NS_ENSURE_TRUE(doc, NS_ERROR_NOT_AVAILABLE);

    nsIPresShell* presShell = doc->GetShellAt(0);
    NS_ENSURE_TRUE(presShell, NS_ERROR_NOT_AVAILABLE);

    mStyleContextHolder =
      nsInspectorCSSUtils::GetStyleContextForContent(mContent,
                                                     mPseudo,
                                                     presShell);
    if (mStyleContextHolder) {
      aStyleStruct = mStyleContextHolder->GetStyleData(aID);
    }
  }
  NS_ASSERTION(aStyleStruct, "Failed to get a style struct");

  return NS_OK;
}

Here is the call graph for this function: