Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsImageFrame.cpp File Reference
#include "nsHTMLParts.h"
#include "nsCOMPtr.h"
#include "nsImageFrame.h"
#include "nsIImageLoadingContent.h"
#include "nsString.h"
#include "nsPrintfCString.h"
#include "nsPresContext.h"
#include "nsIRenderingContext.h"
#include "nsIPresShell.h"
#include "nsIImage.h"
#include "nsIWidget.h"
#include "nsHTMLAtoms.h"
#include "nsIDocument.h"
#include "nsINodeInfo.h"
#include "nsContentUtils.h"
#include "nsStyleContext.h"
#include "nsStyleConsts.h"
#include "nsImageMap.h"
#include "nsILinkHandler.h"
#include "nsIURL.h"
#include "nsIIOService.h"
#include "nsILoadGroup.h"
#include "nsISupportsPriority.h"
#include "nsIServiceManager.h"
#include "nsNetUtil.h"
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsHTMLContainerFrame.h"
#include "prprf.h"
#include "nsIFontMetrics.h"
#include "nsCSSRendering.h"
#include "nsILink.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsIDeviceContext.h"
#include "nsINameSpaceManager.h"
#include "nsTextFragment.h"
#include "nsIDOMHTMLMapElement.h"
#include "nsLayoutAtoms.h"
#include "nsImageMapUtils.h"
#include "nsIScriptSecurityManager.h"
#include "nsIDOMNode.h"
#include "nsGUIEvent.h"
#include "nsStyleSet.h"
#include "imgIContainer.h"
#include "imgILoader.h"
#include "nsIEventQueueService.h"
#include "plevent.h"
#include "nsContentPolicyUtils.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDOMWindow.h"
#include "nsIDOMDocument.h"
#include "nsCSSFrameConstructor.h"
#include "nsIPrefBranch2.h"
#include "nsIPrefService.h"
#include "gfxIImageFrame.h"
#include "nsIDOMRange.h"
#include "nsIContentPolicy.h"
#include "nsLayoutErrors.h"

Go to the source code of this file.

Classes

struct  nsRecessedBorder

Defines

#define ICON_SIZE   (16)
#define ICON_PADDING   (3)
#define ALT_BORDER_WIDTH   (1)
#define IMAGE_EDITOR_CHECK   1
#define ALIGN_UNSET   PRUint8(-1)
#define MINMAX(_value, _min, _max)

Functions

static PRBool HaveFixedSize (const nsStylePosition *aStylePosition)
PRBool HaveFixedSize (const nsHTMLReflowState &aReflowState)
nsresult NS_NewImageFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
 NS_IMETHODIMP_ (nsrefcnt) nsImageFrame

Variables

static const char kIconLoadPrefs [][40]

Define Documentation

Definition at line 126 of file nsImageFrame.cpp.

Definition at line 119 of file nsImageFrame.cpp.

#define ICON_PADDING   (3)

Definition at line 118 of file nsImageFrame.cpp.

#define ICON_SIZE   (16)

Definition at line 117 of file nsImageFrame.cpp.

Definition at line 123 of file nsImageFrame.cpp.

#define MINMAX (   _value,
  _min,
  _max 
)
Value:
((_value) < (_min)           \
     ? (_min)                    \
     : ((_value) > (_max)        \
        ? (_max)                 \
        : (_value)))

Definition at line 728 of file nsImageFrame.cpp.


Function Documentation

static PRBool HaveFixedSize ( const nsStylePosition aStylePosition) [static]

Definition at line 135 of file nsImageFrame.cpp.

{
  // check the width and height values in the reflow state's style struct
  // - if width and height are specified as either coord or percentage, then
  //   the size of the image frame is constrained
  nsStyleUnit widthUnit = aStylePosition->mWidth.GetUnit();
  nsStyleUnit heightUnit = aStylePosition->mHeight.GetUnit();

  return ((widthUnit  == eStyleUnit_Coord ||
           widthUnit  == eStyleUnit_Percent) &&
          (heightUnit == eStyleUnit_Coord ||
           heightUnit == eStyleUnit_Percent));
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool HaveFixedSize ( const nsHTMLReflowState aReflowState) [inline]

Definition at line 151 of file nsImageFrame.cpp.

{ 
  NS_ASSERTION(aReflowState.mStylePosition, "crappy reflowState - null stylePosition");
  // when an image has percent css style height or width, but mComputedHeight 
  // or mComputedWidth of reflow state is  NS_UNCONSTRAINEDSIZE  
  // it needs to return PR_FALSE to cause an incremental reflow later
  // if an image is inside table like bug 156731 simple testcase III, 
  // during pass 1 reflow, mComputedWidth is NS_UNCONSTRAINEDSIZE
  // in pass 2 reflow, mComputedWidth is 0, it also needs to return PR_FALSE
  // see bug 156731
  nsStyleUnit heightUnit = (*(aReflowState.mStylePosition)).mHeight.GetUnit();
  nsStyleUnit widthUnit = (*(aReflowState.mStylePosition)).mWidth.GetUnit();
  return ((eStyleUnit_Percent == heightUnit && NS_UNCONSTRAINEDSIZE == aReflowState.mComputedHeight) ||
          (eStyleUnit_Percent == widthUnit && (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth ||
           0 == aReflowState.mComputedWidth)))
          ? PR_FALSE
          : HaveFixedSize(aReflowState.mStylePosition); 
}

Here is the call graph for this function:

Definition at line 238 of file nsImageFrame.cpp.

{
  NS_WARNING("not supported for frames");
  return 1;
}
nsresult NS_NewImageFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 171 of file nsImageFrame.cpp.

{
  NS_PRECONDITION(aNewFrame, "null OUT ptr");
  if (nsnull == aNewFrame) {
    return NS_ERROR_NULL_POINTER;
  }
  nsImageFrame* it = new (aPresShell) nsImageFrame;
  if (nsnull == it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  *aNewFrame = it;
  return NS_OK;
}

Here is the caller graph for this function:


Variable Documentation

const char kIconLoadPrefs[][40] [static]
Initial value:
 {
  "browser.display.force_inline_alttext",
  "browser.display.show_image_placeholders"
}

Definition at line 2027 of file nsImageFrame.cpp.