Rename nsIFrame::GetPresContext to nsIFrame::PresContext. Bug 376042, patch byTaras Glek <tglek@mozilla.com>, rs=roc.
authorbzbarsky@mit.edu
Fri, 30 Mar 2007 14:11:41 -0700
changeset 238 4901e7ea427db4943e365c0fcc75e4cd697034ca
parent 237 22f941627da0039650f560531a183fe6ad08d1d9
child 239 049712ff75068fc4e96311546e60784f8de0db6d
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs376042
milestone1.9a4pre
Rename nsIFrame::GetPresContext to nsIFrame::PresContext. Bug 376042, patch byTaras Glek <tglek@mozilla.com>, rs=roc.
content/events/src/nsEventStateManager.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSRendering.cpp
layout/base/nsDisplayList.cpp
layout/base/nsDisplayList.h
layout/base/nsLayoutUtils.cpp
layout/base/nsPresContext.cpp
layout/base/nsPresShell.cpp
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsFileControlFrame.cpp
layout/forms/nsFormControlFrame.cpp
layout/forms/nsGfxButtonControlFrame.cpp
layout/forms/nsGfxCheckboxControlFrame.cpp
layout/forms/nsGfxRadioControlFrame.cpp
layout/forms/nsHTMLButtonControlFrame.cpp
layout/forms/nsIsIndexFrame.cpp
layout/forms/nsListControlFrame.cpp
layout/forms/nsTextControlFrame.cpp
layout/generic/nsAbsoluteContainingBlock.cpp
layout/generic/nsAreaFrame.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockReflowContext.cpp
layout/generic/nsBulletFrame.cpp
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsContainerFrame.cpp
layout/generic/nsFirstLetterFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrameFrame.cpp
layout/generic/nsFrameList.cpp
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsHTMLContainerFrame.cpp
layout/generic/nsHTMLFrame.cpp
layout/generic/nsHTMLReflowState.cpp
layout/generic/nsIFrame.h
layout/generic/nsImageFrame.cpp
layout/generic/nsLineBox.cpp
layout/generic/nsObjectFrame.cpp
layout/generic/nsPageFrame.cpp
layout/generic/nsPlaceholderFrame.cpp
layout/generic/nsSelection.cpp
layout/generic/nsSimplePageSequence.cpp
layout/generic/nsTextFrame.cpp
layout/mathml/base/src/nsMathMLChar.cpp
layout/mathml/base/src/nsMathMLContainerFrame.cpp
layout/mathml/base/src/nsMathMLContainerFrame.h
layout/mathml/base/src/nsMathMLFrame.h
layout/mathml/base/src/nsMathMLTokenFrame.cpp
layout/mathml/base/src/nsMathMLmactionFrame.cpp
layout/mathml/base/src/nsMathMLmfencedFrame.cpp
layout/mathml/base/src/nsMathMLmfracFrame.cpp
layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp
layout/mathml/base/src/nsMathMLmoFrame.cpp
layout/mathml/base/src/nsMathMLmoverFrame.cpp
layout/mathml/base/src/nsMathMLmrootFrame.cpp
layout/mathml/base/src/nsMathMLmsqrtFrame.cpp
layout/mathml/base/src/nsMathMLmstyleFrame.cpp
layout/mathml/base/src/nsMathMLmsubFrame.cpp
layout/mathml/base/src/nsMathMLmsubsupFrame.cpp
layout/mathml/base/src/nsMathMLmsupFrame.cpp
layout/mathml/base/src/nsMathMLmtableFrame.cpp
layout/mathml/base/src/nsMathMLmunderFrame.cpp
layout/mathml/base/src/nsMathMLmunderoverFrame.cpp
layout/style/nsComputedDOMStyle.cpp
layout/svg/base/src/nsSVGForeignObjectFrame.cpp
layout/svg/base/src/nsSVGGeometryFrame.cpp
layout/svg/base/src/nsSVGGlyphFrame.cpp
layout/svg/base/src/nsSVGGradientFrame.cpp
layout/svg/base/src/nsSVGOuterSVGFrame.cpp
layout/svg/base/src/nsSVGPatternFrame.cpp
layout/svg/base/src/nsSVGTextPathFrame.cpp
layout/tables/BasicTableLayoutStrategy.cpp
layout/tables/nsCellMap.cpp
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableColGroupFrame.cpp
layout/tables/nsTableFrame.cpp
layout/tables/nsTableOuterFrame.cpp
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowGroupFrame.cpp
layout/xul/base/src/grid/nsGridRowLeafFrame.cpp
layout/xul/base/src/nsBox.cpp
layout/xul/base/src/nsBoxFrame.cpp
layout/xul/base/src/nsButtonBoxFrame.cpp
layout/xul/base/src/nsDeckFrame.cpp
layout/xul/base/src/nsGroupBoxFrame.cpp
layout/xul/base/src/nsImageBoxFrame.cpp
layout/xul/base/src/nsLeafBoxFrame.cpp
layout/xul/base/src/nsListBoxBodyFrame.cpp
layout/xul/base/src/nsMenuBarFrame.cpp
layout/xul/base/src/nsMenuFrame.cpp
layout/xul/base/src/nsMenuPopupFrame.cpp
layout/xul/base/src/nsNativeScrollbarFrame.cpp
layout/xul/base/src/nsPopupSetFrame.cpp
layout/xul/base/src/nsProgressMeterFrame.cpp
layout/xul/base/src/nsScrollbarFrame.cpp
layout/xul/base/src/nsSliderFrame.cpp
layout/xul/base/src/nsSplitterFrame.cpp
layout/xul/base/src/nsTextBoxFrame.cpp
layout/xul/base/src/nsTitleBarFrame.cpp
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
layout/xul/base/src/tree/src/nsTreeColumns.cpp
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -1475,17 +1475,17 @@ nsEventStateManager::FireContextClick()
   // when we're through because no one else is doing anything more with this
   // event and it will get reset on the very next event to the correct frame).
   mCurrentTarget = nsnull;
   nsIPresShell *shell = mPresContext->GetPresShell();
   if ( shell ) {
     mCurrentTarget = shell->GetPrimaryFrameFor(mGestureDownFrameOwner);
 
     if ( mCurrentTarget ) {
-      NS_ASSERTION(mPresContext == mCurrentTarget->GetPresContext(),
+      NS_ASSERTION(mPresContext == mCurrentTarget->PresContext(),
                    "a prescontext returned a primary frame that didn't belong to it?");
 
       // before dispatching, check that we're not on something that
       // doesn't get a context menu
       nsIAtom *tag = mGestureDownContent->Tag();
       PRBool allowedToDispatch = PR_TRUE;
 
       if (mGestureDownContent->IsNodeOfType(nsINode::eXUL)) {
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -812,17 +812,17 @@ nsAbsoluteItems::nsAbsoluteItems(nsIFram
   : containingBlock(aContainingBlock)
 {
 }
 
 // Additional behavior is that it sets the frame's NS_FRAME_OUT_OF_FLOW flag
 void
 nsAbsoluteItems::AddChild(nsIFrame* aChild)
 {
-  NS_ASSERTION(aChild->GetPresContext()->FrameManager()->
+  NS_ASSERTION(aChild->PresContext()->FrameManager()->
                GetPlaceholderFrameFor(aChild),
                "Child without placeholder being added to nsAbsoluteItems?");
   aChild->AddStateBits(NS_FRAME_OUT_OF_FLOW);
   nsFrameItems::AddChild(aChild);
 }
 
 // Structures used to record the creation of pseudo table frames where 
 // the content belongs to some ancestor. 
@@ -9601,17 +9601,17 @@ UpdateViewsForTree(nsIFrame* aFrame, nsI
                    nsChangeHint aChange)
 {
   NS_PRECONDITION(gInApplyRenderingChangeToTree,
                   "should only be called within ApplyRenderingChangeToTree");
 
   nsIView* view = aFrame->GetView();
   if (view) {
     if (aChange & nsChangeHint_SyncFrameView) {
-      nsContainerFrame::SyncFrameViewProperties(aFrame->GetPresContext(),
+      nsContainerFrame::SyncFrameViewProperties(aFrame->PresContext(),
                                                 aFrame, nsnull, view);
     }
   }
 
   // now do children of frame
   PRInt32 listIndex = 0;
   nsIAtom* childList = nsnull;
 
@@ -9743,17 +9743,17 @@ InvalidateCanvasIfNeeded(nsIFrame* aFram
 
   // At this point the node has no parent or it's an HTML <body> child of the
   // root.  We might not need to invalidate in this case (eg we might be in
   // XHTML or something), but chances are we want to.  Play it safe.  Find the
   // frame to invalidate and do it.
   nsIFrame *ancestor = aFrame;
   const nsStyleBackground *bg;
   PRBool isCanvas;
-  nsPresContext* presContext = aFrame->GetPresContext();
+  nsPresContext* presContext = aFrame->PresContext();
   while (!nsCSSRendering::FindBackground(presContext, ancestor,
                                          &bg, &isCanvas)) {
     ancestor = ancestor->GetParent();
     NS_ASSERTION(ancestor, "canvas must paint");
   }
 
   if (ancestor->GetType() == nsGkAtoms::canvasFrame) {
     // The canvas frame's dimensions are not meaningful; invalidate the
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -2549,17 +2549,17 @@ FindCanvasBackground(nsIFrame* aForFrame
             // will reflow a document with no body.  In particular, if a
             // SCRIPT element in the head blocks the parser and then has a
             // SCRIPT that does "document.location.href = 'foo'", then
             // nsParser::Terminate will call |DidBuildModel| methods
             // through to the content sink, which will call |StartLayout|
             // and thus |InitialReflow| on the pres shell.  See bug 119351
             // for the ugly details.
             if (bodyContent) {
-              nsIFrame *bodyFrame = aForFrame->GetPresContext()->GetPresShell()->
+              nsIFrame *bodyFrame = aForFrame->PresContext()->GetPresShell()->
                 GetPrimaryFrameFor(bodyContent);
               if (bodyFrame)
                 result = bodyFrame->GetStyleBackground();
             }
           }
         }
       }
     }
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -63,17 +63,17 @@ nsDisplayListBuilder::nsDisplayListBuild
       mMovingFrame(aMovingFrame),
       mIgnoreScrollFrame(nsnull),
       mBuildCaret(aBuildCaret),
       mEventDelivery(aIsForEvents),
       mIsAtRootOfPseudoStackingContext(PR_FALSE),
       mPaintAllFrames(PR_FALSE) {
   PL_InitArenaPool(&mPool, "displayListArena", 1024, sizeof(void*)-1);
 
-  nsPresContext* pc = aReferenceFrame->GetPresContext();
+  nsPresContext* pc = aReferenceFrame->PresContext();
   nsIPresShell *shell = pc->PresShell();
   PRBool suppressed;
   shell->IsPaintingSuppressed(&suppressed);
   mIsBackgroundOnly = suppressed;
   if (pc->IsRenderingOnlySelection()) {
     nsCOMPtr<nsISelectionController> selcon(do_QueryInterface(shell));
     if (selcon) {
       selcon->GetSelection(nsISelectionController::SELECTION_NORMAL,
@@ -92,17 +92,17 @@ DestroyRectFunc(void*    aFrame,
                 nsIAtom* aPropertyName,
                 void*    aPropertyValue,
                 void*    aDtorData)
 {
   delete NS_STATIC_CAST(nsRect*, aPropertyValue);
 }
 
 static void MarkFrameForDisplay(nsIFrame* aFrame, nsIFrame* aStopAtFrame) {
-  nsFrameManager* frameManager = aFrame->GetPresContext()->PresShell()->FrameManager();
+  nsFrameManager* frameManager = aFrame->PresContext()->PresShell()->FrameManager();
 
   for (nsIFrame* f = aFrame; f;
        f = nsLayoutUtils::GetParentOrPlaceholderFor(frameManager, f)) {
     if (f->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)
       return;
     f->AddStateBits(NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO);
     if (f == aStopAtFrame) {
       // we've reached a frame that we know will be painted, so we can stop.
@@ -122,17 +122,17 @@ static void MarkOutOfFlowFrameForDisplay
                       new nsRect(dirty), DestroyRectFunc);
 
   MarkFrameForDisplay(aFrame, aDirtyFrame);
 }
 
 static void UnmarkFrameForDisplay(nsIFrame* aFrame) {
   aFrame->DeleteProperty(nsGkAtoms::outOfFlowDirtyRectProperty);
 
-  nsFrameManager* frameManager = aFrame->GetPresContext()->PresShell()->FrameManager();
+  nsFrameManager* frameManager = aFrame->PresContext()->PresShell()->FrameManager();
 
   for (nsIFrame* f = aFrame; f;
        f = nsLayoutUtils::GetParentOrPlaceholderFor(frameManager, f)) {
     if (!(f->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO))
       return;
     f->RemoveStateBits(NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO);
   }
 }
@@ -149,30 +149,30 @@ nsDisplayListBuilder::~nsDisplayListBuil
 nsICaret *
 nsDisplayListBuilder::GetCaret() {
   NS_ASSERTION(mCaretStates.Length() > 0, "Not enough presshells");
 
   nsIFrame* frame = GetCaretFrame();
   if (!frame) {
     return nsnull;
   }
-  nsIPresShell* shell = frame->GetPresContext()->PresShell();
+  nsIPresShell* shell = frame->PresContext()->PresShell();
   nsCOMPtr<nsICaret> caret;
   shell->GetCaret(getter_AddRefs(caret));
 
   return caret;
 }
 
 void
 nsDisplayListBuilder::EnterPresShell(nsIFrame* aReferenceFrame,
                                      const nsRect& aDirtyRect) {
   if (!mBuildCaret)
     return;
 
-  nsIPresShell* shell = aReferenceFrame->GetPresContext()->PresShell();
+  nsIPresShell* shell = aReferenceFrame->PresContext()->PresShell();
   nsCOMPtr<nsICaret> caret;
   shell->GetCaret(getter_AddRefs(caret));
   nsIFrame* frame = caret->GetCaretFrame();
 
   if (frame) {
     // Check if the dirty rect intersects with the caret's dirty rect.
     nsRect caretRect =
       caret->GetCaretRect() + frame->GetOffsetTo(aReferenceFrame);
@@ -497,17 +497,17 @@ PRBool
 nsDisplayBackground::IsOpaque(nsDisplayListBuilder* aBuilder) {
   // theme background overrides any other background
   if (mFrame->IsThemed())
     return PR_FALSE;
 
   PRBool isCanvas;
   const nsStyleBackground* bg;
   PRBool hasBG =
-    nsCSSRendering::FindBackground(mFrame->GetPresContext(), mFrame, &bg, &isCanvas);
+    nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bg, &isCanvas);
   if (!hasBG || (bg->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) ||
       bg->mBackgroundClip != NS_STYLE_BG_CLIP_BORDER ||
       HasNonZeroSide(mFrame->GetStyleBorder()->mBorderRadius) ||
       NS_GET_A(bg->mBackgroundColor) < 255)
     return PR_FALSE;
   return PR_TRUE;
 }
 
@@ -515,34 +515,34 @@ PRBool
 nsDisplayBackground::IsUniform(nsDisplayListBuilder* aBuilder) {
   // theme background overrides any other background
   if (mFrame->IsThemed())
     return PR_FALSE;
 
   PRBool isCanvas;
   const nsStyleBackground* bg;
   PRBool hasBG =
-    nsCSSRendering::FindBackground(mFrame->GetPresContext(), mFrame, &bg, &isCanvas);
+    nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bg, &isCanvas);
   if (!hasBG)
     return PR_TRUE;
   if ((bg->mBackgroundFlags & NS_STYLE_BG_IMAGE_NONE) &&
       !HasNonZeroSide(mFrame->GetStyleBorder()->mBorderRadius) &&
       bg->mBackgroundClip == NS_STYLE_BG_CLIP_BORDER)
     return PR_TRUE;
   return PR_FALSE;
 }
 
 PRBool
 nsDisplayBackground::IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
     nsIFrame* aAncestorFrame)
 {
   PRBool isCanvas;
   const nsStyleBackground* bg;
   PRBool hasBG =
-    nsCSSRendering::FindBackground(mFrame->GetPresContext(), mFrame, &bg, &isCanvas);
+    nsCSSRendering::FindBackground(mFrame->PresContext(), mFrame, &bg, &isCanvas);
   if (!hasBG)
     return PR_FALSE;
   if (!bg->HasFixedBackground())
     return PR_FALSE;
 
   // aAncestorFrame is the frame that is going to be moved.
   // Check if mFrame is equal to aAncestorFrame or aAncestorFrame is an
   // ancestor of mFrame in the same document. If this is true, mFrame
@@ -555,34 +555,34 @@ nsDisplayBackground::IsVaryingRelativeTo
   }
   return PR_FALSE;
 }
 
 void
 nsDisplayBackground::Paint(nsDisplayListBuilder* aBuilder,
      nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
   nsPoint offset = aBuilder->ToReferenceFrame(mFrame);
-  nsCSSRendering::PaintBackground(mFrame->GetPresContext(), *aCtx, mFrame,
+  nsCSSRendering::PaintBackground(mFrame->PresContext(), *aCtx, mFrame,
                                   aDirtyRect, nsRect(offset, mFrame->GetSize()),
                                   *mFrame->GetStyleBorder(),
                                   *mFrame->GetStylePadding(),
                                   mFrame->HonorPrintBackgroundSettings());
 }
 
 nsRect
 nsDisplayOutline::GetBounds(nsDisplayListBuilder* aBuilder) {
   return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame);
 }
 
 void
 nsDisplayOutline::Paint(nsDisplayListBuilder* aBuilder,
      nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
   // TODO join outlines together
   nsPoint offset = aBuilder->ToReferenceFrame(mFrame);
-  nsCSSRendering::PaintOutline(mFrame->GetPresContext(), *aCtx, mFrame,
+  nsCSSRendering::PaintOutline(mFrame->PresContext(), *aCtx, mFrame,
                                aDirtyRect, nsRect(offset, mFrame->GetSize()),
                                *mFrame->GetStyleBorder(),
                                *mFrame->GetStyleOutline(),                              
                                mFrame->GetStyleContext(), 0);
 }
 
 PRBool
 nsDisplayOutline::OptimizeVisibility(nsDisplayListBuilder* aBuilder,
@@ -634,17 +634,17 @@ nsDisplayBorder::OptimizeVisibility(nsDi
 
   return PR_TRUE;
 }
 
 void
 nsDisplayBorder::Paint(nsDisplayListBuilder* aBuilder,
      nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
   nsPoint offset = aBuilder->ToReferenceFrame(mFrame);
-  nsCSSRendering::PaintBorder(mFrame->GetPresContext(), *aCtx, mFrame,
+  nsCSSRendering::PaintBorder(mFrame->PresContext(), *aCtx, mFrame,
                               aDirtyRect, nsRect(offset, mFrame->GetSize()),
                               *mFrame->GetStyleBorder(),
                               mFrame->GetStyleContext(), mFrame->GetSkipSides());
 }
 
 nsDisplayWrapList::nsDisplayWrapList(nsIFrame* aFrame, nsDisplayList* aList)
   : nsDisplayItem(aFrame) {
   mList.AppendToTop(aList);
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -847,18 +847,18 @@ public:
     MOZ_COUNT_DTOR(nsDisplayReflowCount);
   }
 #endif
   
   virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
      const nsRect& aDirtyRect) {
     nsPoint pt = aBuilder->ToReferenceFrame(mFrame);
     nsIRenderingContext::AutoPushTranslation translate(aCtx, pt.x, pt.y);
-    mFrame->GetPresContext()->PresShell()->PaintCount(mFrameName, aCtx,
-                                                      mFrame->GetPresContext(),
+    mFrame->PresContext()->PresShell()->PaintCount(mFrameName, aCtx,
+                                                      mFrame->PresContext(),
                                                       mFrame, mColor);
   }
   NS_DISPLAY_DECL_NAME("nsDisplayReflowCount")
 protected:
   const char* mFrameName;
   nscolor mColor;
 };
 
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -395,18 +395,18 @@ nsLayoutUtils::DoCompareTreePosition(nsI
                                      nsIFrame* aFrame2,
                                      PRInt32 aIf1Ancestor,
                                      PRInt32 aIf2Ancestor,
                                      nsIFrame* aCommonAncestor)
 {
   NS_PRECONDITION(aFrame1, "aFrame1 must not be null");
   NS_PRECONDITION(aFrame2, "aFrame2 must not be null");
 
-  nsPresContext* presContext = aFrame1->GetPresContext();
-  if (presContext != aFrame2->GetPresContext()) {
+  nsPresContext* presContext = aFrame1->PresContext();
+  if (presContext != aFrame2->PresContext()) {
     NS_ERROR("no common ancestor at all, different documents");
     return 0;
   }
   nsFrameManager* frameManager = presContext->PresShell()->FrameManager();
 
   nsAutoTArray<nsIFrame*,20> frame1Ancestors;
   if (!FillAncestors(aFrame1, aCommonAncestor, frameManager, &frame1Ancestors)) {
     // We reached the root of the frame tree ... if aCommonAncestor was set,
@@ -614,17 +614,17 @@ nsLayoutUtils::GetEventCoordinatesRelati
 #endif
     rootFrame = f;
   }
 
   nsIView* rootView = rootFrame->GetView();
   if (!rootView)
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
 
-  nsPoint widgetToView = TranslateWidgetToView(rootFrame->GetPresContext(),
+  nsPoint widgetToView = TranslateWidgetToView(rootFrame->PresContext(),
                                GUIEvent->widget, GUIEvent->refPoint,
                                rootView);
 
   if (widgetToView == nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE))
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
 
   return widgetToView - aFrame->GetOffsetTo(rootFrame);
 }
@@ -643,17 +643,17 @@ nsLayoutUtils::GetEventCoordinatesForNea
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
 
   nsPoint viewToFrame;
   nsIView* frameView;
   aFrame->GetOffsetFromView(viewToFrame, &frameView);
   if (aView)
     *aView = frameView;
 
-  return TranslateWidgetToView(aFrame->GetPresContext(), GUIEvent->widget,
+  return TranslateWidgetToView(aFrame->PresContext(), GUIEvent->widget,
                                GUIEvent->refPoint, frameView);
 }
 
 nsPoint
 nsLayoutUtils::TranslateWidgetToView(nsPresContext* aPresContext, 
                                      nsIWidget* aWidget, nsIntPoint aPt,
                                      nsIView* aView)
 {
@@ -697,17 +697,17 @@ nsLayoutUtils::CombineBreakType(PRUint8 
   }
   return breakType;
 }
 
 PRBool
 nsLayoutUtils::IsInitialContainingBlock(nsIFrame* aFrame)
 {
   return aFrame ==
-    aFrame->GetPresContext()->PresShell()->FrameConstructor()->GetInitialContainingBlock();
+    aFrame->PresContext()->PresShell()->FrameConstructor()->GetInitialContainingBlock();
 }
 
 #ifdef DEBUG
 #include <stdio.h>
 
 static PRBool gDumpPaintList = PR_FALSE;
 static PRBool gDumpEventList = PR_FALSE;
 static PRBool gDumpRepaintRegionForCopy = PR_FALSE;
@@ -1067,17 +1067,17 @@ nsLayoutUtils::GetAllInFlowBoundingRect(
   return r - aFrame->GetPosition();
 }
 
 nsresult
 nsLayoutUtils::GetFontMetricsForFrame(nsIFrame* aFrame,
                                       nsIFontMetrics** aFontMetrics)
 {
   nsStyleContext* sc = aFrame->GetStyleContext();
-  return aFrame->GetPresContext()->DeviceContext()->
+  return aFrame->PresContext()->DeviceContext()->
     GetMetricsFor(sc->GetStyleFont()->mFont,
                   sc->GetStyleVisibility()->mLangGroup,
                   *aFontMetrics);
 }
 
 nsIFrame*
 nsLayoutUtils::FindChildContainingDescendant(nsIFrame* aParent, nsIFrame* aDescendantFrame)
 {
@@ -1121,18 +1121,18 @@ nsLayoutUtils::GetParentOrPlaceholderFor
 nsIFrame*
 nsLayoutUtils::GetClosestCommonAncestorViaPlaceholders(nsIFrame* aFrame1,
                                                        nsIFrame* aFrame2,
                                                        nsIFrame* aKnownCommonAncestorHint)
 {
   NS_PRECONDITION(aFrame1, "aFrame1 must not be null");
   NS_PRECONDITION(aFrame2, "aFrame2 must not be null");
 
-  nsPresContext* presContext = aFrame1->GetPresContext();
-  if (presContext != aFrame2->GetPresContext()) {
+  nsPresContext* presContext = aFrame1->PresContext();
+  if (presContext != aFrame2->PresContext()) {
     // different documents, no common ancestor
     return nsnull;
   }
   nsFrameManager* frameManager = presContext->PresShell()->FrameManager();
 
   nsAutoVoidArray frame1Ancestors;
   nsIFrame* f1;
   for (f1 = aFrame1; f1 && f1 != aKnownCommonAncestorHint;
@@ -1196,17 +1196,17 @@ nsLayoutUtils::GetNextContinuationOrSpec
 
 PRBool
 nsLayoutUtils::IsViewportScrollbarFrame(nsIFrame* aFrame)
 {
   if (!aFrame)
     return PR_FALSE;
 
   nsIFrame* rootScrollFrame =
-    aFrame->GetPresContext()->PresShell()->GetRootScrollFrame();
+    aFrame->PresContext()->PresShell()->GetRootScrollFrame();
   if (!rootScrollFrame)
     return PR_FALSE;
 
   nsIScrollableFrame* rootScrollableFrame = nsnull;
   CallQueryInterface(rootScrollFrame, &rootScrollableFrame);
   NS_ASSERTION(rootScrollableFrame, "The root scorollable frame is null");
 
   if (!IsProperAncestorFrame(rootScrollFrame, aFrame))
@@ -1393,17 +1393,17 @@ nsLayoutUtils::IntrinsicForContainer(nsI
   min = AddPercents(aType, min, pctTotal);
   if (result < min)
     result = min;
 
   const nsStyleDisplay *disp = aFrame->GetStyleDisplay();
   if (aFrame->IsThemed(disp)) {
     nsSize size(0, 0);
     PRBool canOverride = PR_TRUE;
-    nsPresContext *presContext = aFrame->GetPresContext();
+    nsPresContext *presContext = aFrame->PresContext();
     presContext->GetTheme()->
       GetMinimumWidgetSize(aRenderingContext, aFrame, disp->mAppearance,
                            &size, &canOverride);
 
     nscoord themeWidth = presContext->DevPixelsToAppUnits(size.width);
 
     // GMWS() returns a border-box width
     themeWidth += offsets.hMargin;
@@ -1708,17 +1708,17 @@ void
 nsLayoutUtils::DrawString(const nsIFrame*      aFrame,
                           nsIRenderingContext* aContext,
                           const PRUnichar*     aString,
                           PRInt32              aLength,
                           nsPoint              aPoint)
 {
 #ifdef IBMBIDI
   nsresult rv = NS_ERROR_FAILURE;
-  nsPresContext* presContext = aFrame->GetPresContext();
+  nsPresContext* presContext = aFrame->PresContext();
   if (presContext->BidiEnabled()) {
     nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
 
     if (bidiUtils) {
       const nsStyleVisibility* vis = aFrame->GetStyleVisibility();
       nsBidiDirection direction =
         (NS_STYLE_DIRECTION_RTL == vis->mDirection) ?
         NSBIDI_RTL : NSBIDI_LTR;
@@ -1743,17 +1743,17 @@ nsLayoutUtils::GetStringWidth(const nsIF
 {
 #ifdef IBMBIDI
   PRUint32 hints = 0;
   aContext->GetHints(hints);
   // Only do bidi resolution for width measurement if we have a "real"
   // textrun implementation. Otherwise assume the platform can get
   // things right for a mixed-direction string.
   if (hints & NS_RENDERING_HINT_NEW_TEXT_RUNS) {
-    nsPresContext* presContext = aFrame->GetPresContext();
+    nsPresContext* presContext = aFrame->PresContext();
     if (presContext->BidiEnabled()) {
       nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
 
       if (bidiUtils) {
         const nsStyleVisibility* vis = aFrame->GetStyleVisibility();
         nsBidiDirection direction =
           (NS_STYLE_DIRECTION_RTL == vis->mDirection) ?
           NSBIDI_RTL : NSBIDI_LTR;
@@ -1870,17 +1870,17 @@ nsLayoutUtils::GetClosestLayer(nsIFrame*
   for (layer = aFrame; layer; layer = layer->GetParent()) {
     if (layer->GetStyleDisplay()->IsPositioned() ||
         (layer->GetParent() &&
           layer->GetParent()->GetType() == nsGkAtoms::scrollFrame))
       break;
   }
   if (layer)
     return layer;
-  return aFrame->GetPresContext()->PresShell()->FrameManager()->GetRootFrame();
+  return aFrame->PresContext()->PresShell()->FrameManager()->GetRootFrame();
 }
 
 /* static */ nsresult
 nsLayoutUtils::DrawImage(nsIRenderingContext* aRenderingContext,
                          imgIContainer* aImage,
                          const nsRect& aDestRect,
                          const nsRect& aDirtyRect,
                          const nsRect* aSourceRect)
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -899,17 +899,17 @@ nsPresContext::RootPresContext()
 {
   nsPresContext* pc = this;
   for (;;) {
     if (pc->mShell) {
       nsIFrame* rootFrame = pc->mShell->FrameManager()->GetRootFrame();
       if (rootFrame) {
         nsIFrame* f = nsLayoutUtils::GetCrossDocParentFrame(rootFrame);
         if (f) {
-          pc = f->GetPresContext();
+          pc = f->PresContext();
           continue;
         }
       }
     }
     return pc;
   }
 }
 
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -5569,17 +5569,17 @@ PresShell::HandleEvent(nsIView         *
     }
   }
 
   if (dispatchUsingCoordinates) {
     NS_ASSERTION(frame, "Nothing to handle this event!");
     if (!frame)
       return NS_OK;
 
-    nsPresContext* framePresContext = frame->GetPresContext();
+    nsPresContext* framePresContext = frame->PresContext();
     nsPresContext* rootPresContext = framePresContext->RootPresContext();
     NS_ASSERTION(rootPresContext = mPresContext->RootPresContext(),
                  "How did we end up outside the connected prescontext/viewmanager hierarchy?"); 
     // If we aren't starting our event dispatch from the root frame of the root prescontext,
     // then someone must be capturing the mouse. In that case we don't want to search the popup
     // list.
     if (framePresContext == rootPresContext &&
         frame == FrameManager()->GetRootFrame()) {
@@ -5597,17 +5597,17 @@ PresShell::HandleEvent(nsIView         *
       }
     }
 
     nsPoint eventPoint
         = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, frame);
     nsIFrame* targetFrame = nsLayoutUtils::GetFrameForPoint(frame, eventPoint);
     if (targetFrame) {
       PresShell* shell =
-          NS_STATIC_CAST(PresShell*, targetFrame->GetPresContext()->PresShell());
+          NS_STATIC_CAST(PresShell*, targetFrame->PresContext()->PresShell());
       if (shell != this) {
         // Handle the event in the correct shell.
         // Prevent deletion until we're done with event handling (bug 336582).
         nsRefPtr<nsIPresShell> kungFuDeathGrip(shell);
         nsIView* subshellRootView;
         shell->GetViewManager()->GetRootView(subshellRootView);
         // We pass the subshell's root view as the view to start from. This is
         // the only correct alternative; if the event was captured then it
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -132,28 +132,28 @@ private:
   nsButtonFrameRenderer* mBFR;
 };
 
 void nsDisplayButtonBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
                                             nsIRenderingContext* aCtx,
                                             const nsRect& aDirtyRect)
 {
   NS_ASSERTION(mFrame, "No frame?");
-  nsPresContext* pc = mFrame->GetPresContext();
+  nsPresContext* pc = mFrame->PresContext();
   nsRect r = nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize());
   
   // draw the border and background inside the focus and outline borders
   mBFR->PaintBorderAndBackground(pc, *aCtx, aDirtyRect, r);
 }
 
 void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder,
                                       nsIRenderingContext* aCtx,
                                       const nsRect& aDirtyRect)
 {
-  nsPresContext *presContext = mFrame->GetPresContext();
+  nsPresContext *presContext = mFrame->PresContext();
   const nsStyleDisplay *disp = mFrame->GetStyleDisplay();
   if (!mFrame->IsThemed(disp) ||
       !presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, mFrame, disp->mAppearance)) {
     // draw the focus and outline borders
     nsRect r = nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize());
     mBFR->PaintOutlineAndFocusBorders(presContext, *aCtx, aDirtyRect, r);
   }
 }
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -323,17 +323,17 @@ nsComboboxControlFrame::QueryInterface(c
 
 #ifdef ACCESSIBILITY
 NS_IMETHODIMP nsComboboxControlFrame::GetAccessible(nsIAccessible** aAccessible)
 {
   nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
 
   if (accService) {
     nsCOMPtr<nsIDOMNode> node = do_QueryInterface(mContent);
-    nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(GetPresContext()->PresShell()));
+    nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(PresContext()->PresShell()));
     return accService->CreateHTMLComboboxAccessible(node, weakShell, aAccessible);
   }
 
   return NS_ERROR_FAILURE;
 }
 #endif
 
 void 
@@ -360,17 +360,17 @@ nsComboboxControlFrame::SetFocus(PRBool 
   // rect to be drawn. This is much faster than ReResolvingStyle
   // Bug 32920
   Invalidate(nsRect(0,0,mRect.width,mRect.height), PR_TRUE);
 
   // Make sure the content area gets updated for where the dropdown was
   // This is only needed for embedding, the focus may go to 
   // the chrome that is not part of the Gecko system (Bug 83493)
   // XXX this is rather inefficient
-  nsIViewManager* vm = GetPresContext()->GetViewManager();
+  nsIViewManager* vm = PresContext()->GetViewManager();
   if (vm) {
     vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
   }
 }
 
 void
 nsComboboxControlFrame::ShowPopup(PRBool aShowPopup)
 {
@@ -389,17 +389,17 @@ nsComboboxControlFrame::ShowPopup(PRBool
   }
 
   // fire a popup dom event
   nsEventStatus status = nsEventStatus_eIgnore;
   nsMouseEvent event(PR_TRUE, aShowPopup ?
                      NS_XUL_POPUP_SHOWING : NS_XUL_POPUP_HIDING, nsnull,
                      nsMouseEvent::eReal);
 
-  nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+  nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
   if (shell) 
     shell->HandleDOMEventWithTarget(mContent, &event, &status);
 }
 
 // Show the dropdown list
 
 void 
 nsComboboxControlFrame::ShowList(nsPresContext* aPresContext, PRBool aShowList)
@@ -508,17 +508,17 @@ nsComboboxControlFrame::AbsolutelyPositi
    // for it's AbsoluteBounds. The problem with this approach, is that the dropdown lists y location can
    // change based on whether the dropdown is placed below or above the display frame.
    // The approach, taken here is to get use the absolute position of the display frame and use it's location
    // to determine if the dropdown will go offscreen.
 
    // Use the height calculated for the area frame so it includes both
    // the display and button heights.
   nscoord dropdownYOffset = GetRect().height;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 // XXX: Enable this code to debug popping up above the display frame, rather than below it
   nsSize dropdownSize = mDropdownFrame->GetSize();
 
   nscoord screenHeightInPixels = 0;
   if (NS_SUCCEEDED(nsFormControlFrame::GetScreenHeight(presContext, screenHeightInPixels))) {
     // Get the height of the dropdown list in pixels.
     nscoord absoluteDropDownHeight = presContext->AppUnitsToDevPixels(dropdownSize.height);
     // Check to see if the drop-down list will go offscreen
@@ -632,17 +632,17 @@ nsComboboxControlFrame::Reflow(nsPresCon
   // First reflow our dropdown so that we know how tall we should be.
   ReflowDropdown(aPresContext, aReflowState);
 
   // Get the width of the vertical scrollbar.  That will be the width of the
   // dropdown button.
   nsIScrollableFrame* scrollable;
   CallQueryInterface(mListControlFrame, &scrollable);
   NS_ASSERTION(scrollable, "List must be a scrollable frame");
-  nsBoxLayoutState bls(GetPresContext(), aReflowState.rendContext);
+  nsBoxLayoutState bls(PresContext(), aReflowState.rendContext);
   nscoord buttonWidth = scrollable->GetDesiredScrollbarSizes(&bls).LeftRight();
 
   if (buttonWidth > aReflowState.ComputedWidth()) {
     buttonWidth = 0;
   }
 
   mDisplayWidth = aReflowState.ComputedWidth() - buttonWidth;
 
@@ -706,19 +706,19 @@ nsComboboxControlFrame::ShowDropDown(PRB
   if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
     return;
   }
 
   if (!mDroppedDown && aDoDropDown) {
     if (mListControlFrame) {
       mListControlFrame->SyncViewWithFrame();
     }
-    ToggleList(GetPresContext());
+    ToggleList(PresContext());
   } else if (mDroppedDown && !aDoDropDown) {
-    ToggleList(GetPresContext());
+    ToggleList(PresContext());
   }
 }
 
 void
 nsComboboxControlFrame::SetDropDown(nsIFrame* aDropDownFrame)
 {
   mDropdownFrame = aDropDownFrame;
  
@@ -786,30 +786,30 @@ void
 nsComboboxControlFrame::HandleRedisplayTextEvent()
 {
   // First, make sure that the content model is up to date and we've
   // constructed the frames for all our content in the right places.
   // Otherwise they'll end up under the wrong insertion frame when we
   // ActuallyDisplayText, since that flushes out the content sink by
   // calling SetText on a DOM node with aNotify set to true.  See bug
   // 289730.
-  GetPresContext()->Document()->
+  PresContext()->Document()->
     FlushPendingNotifications(Flush_ContentAndNotify);
   
   // Redirect frame insertions during this method (see GetContentInsertionFrame())
   // so that any reframing that the frame constructor forces upon us is inserted
   // into the correct parent (mDisplayFrame). See bug 282607.
   NS_PRECONDITION(!mInRedisplayText, "Nested RedisplayText");
   mInRedisplayText = PR_TRUE;
   mRedisplayTextEvent.Forget();
 
   ActuallyDisplayText(PR_TRUE);
   mDisplayFrame->AddStateBits(NS_FRAME_IS_DIRTY);
   // XXXbz This should perhaps be eResize.  Check.
-  GetPresContext()->PresShell()->FrameNeedsReflow(mDisplayFrame,
+  PresContext()->PresShell()->FrameNeedsReflow(mDisplayFrame,
                                                   nsIPresShell::eStyleChange);
 
   mInRedisplayText = PR_FALSE;
 }
 
 void
 nsComboboxControlFrame::ActuallyDisplayText(PRBool aNotify)
 {
@@ -1097,17 +1097,17 @@ nsComboboxControlFrame::CreateFrameFor(n
   NS_ASSERTION(mDisplayContent, "mDisplayContent can't be null!");
 
   if (mDisplayContent != aContent) {
     // We only handle the frames for mDisplayContent here
     return nsnull;
   }
   
   // Get PresShell
-  nsIPresShell *shell = GetPresContext()->PresShell();
+  nsIPresShell *shell = PresContext()->PresShell();
   nsStyleSet *styleSet = shell->StyleSet();
 
   // create the style contexts for the anonymous block frame and text frame
   nsRefPtr<nsStyleContext> styleContext;
   styleContext = styleSet->
     ResolvePseudoStyleFor(mContent, 
                           nsCSSAnonBoxes::mozDisplayComboboxControlFrame,
                           mStyleContext);
@@ -1245,17 +1245,17 @@ nsComboboxControlFrame::Rollup()
     mListControlFrame->CaptureMouseEvents(PR_FALSE);
   }
   return NS_OK;
 }
 
 void
 nsComboboxControlFrame::RollupFromList()
 {
-  nsPresContext* aPresContext = GetPresContext();
+  nsPresContext* aPresContext = PresContext();
 
   ShowList(aPresContext, PR_FALSE);
   mListControlFrame->CaptureMouseEvents(PR_FALSE);
 }
 
 PRInt32
 nsComboboxControlFrame::UpdateRecentIndex(PRInt32 aIndex)
 {
@@ -1306,17 +1306,17 @@ nsComboboxControlFrame::BuildDisplayList
     NS_ENSURE_SUCCESS(rv, rv);
   } else {
     // REVIEW: Our in-flow child frames are inline-level so they will paint in our
     // content list, so we don't need to mess with layers.
     nsresult rv = nsAreaFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   const nsStyleDisplay *disp = GetStyleDisplay();
   if ((!IsThemed(disp) ||
        !presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, this, disp->mAppearance)) &&
       mDisplayFrame && IsVisibleForPainting(aBuilder)) {
     nsresult rv = aLists.Content()->AppendNewToTop(new (aBuilder)
                                                    nsDisplayComboboxFocus(this));
     NS_ENSURE_SUCCESS(rv, rv);
   }
@@ -1405,17 +1405,17 @@ nsComboboxControlFrame::OnOptionSelected
 
   return NS_OK;
 }
 
 void nsComboboxControlFrame::FireValueChangeEvent()
 {
   // Fire ValueChange event to indicate data value of combo box has changed
   nsCOMPtr<nsIDOMEvent> event;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   if (NS_SUCCEEDED(nsEventDispatcher::CreateEvent(presContext, nsnull,
                                                   NS_LITERAL_STRING("Events"),
                                                   getter_AddRefs(event)))) {
     event->InitEvent(NS_LITERAL_STRING("ValueChange"), PR_TRUE, PR_TRUE);
 
     nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
     privateEvent->SetTrusted(PR_TRUE);
     nsEventDispatcher::DispatchDOMEvent(mContent, nsnull, event, nsnull,
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -257,17 +257,17 @@ nsFieldSetFrame::PaintBorderBackground(n
     nsPoint aPt, const nsRect& aDirtyRect)
 {
   PRIntn skipSides = GetSkipSides();
   const nsStyleBorder* borderStyle = GetStyleBorder();
   const nsStylePadding* paddingStyle = GetStylePadding();
        
   nscoord topBorder = borderStyle->GetBorderWidth(NS_SIDE_TOP);
   nscoord yoff = 0;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
      
   // if the border is smaller than the legend. Move the border down
   // to be centered on the legend. 
   if (topBorder < mLegendRect.height)
     yoff = (mLegendRect.height - topBorder)/2;
       
   nsRect rect(aPt.x, aPt.y + yoff, mRect.width, mRect.height - yoff);
 
@@ -695,17 +695,17 @@ nsFieldSetFrame::RemoveFrame(nsIAtom*   
   if (aOldFrame == mLegendFrame) {
     NS_ASSERTION(!aListName, "Unexpected frame list when removing legend frame");
     NS_ASSERTION(mLegendFrame->GetParent() == this, "Legend Parent has wrong parent");
     NS_ASSERTION(mLegendFrame->GetNextSibling() == mContentFrame, "mContentFrame is not next sibling");
 
     mFrames.DestroyFrame(mLegendFrame);
     mLegendFrame = nsnull;
     AddStateBits(NS_FRAME_IS_DIRTY);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     return NS_OK;
   }
   return mContentFrame->RemoveFrame(aListName, aOldFrame);
 }
 
 #ifdef ACCESSIBILITY
 NS_IMETHODIMP nsFieldSetFrame::GetAccessible(nsIAccessible** aAccessible)
@@ -725,24 +725,24 @@ nsFieldSetFrame::MaybeSetLegend(nsIFrame
 {
   if (!mLegendFrame && aFrameList->GetType() == nsGkAtoms::legendFrame) {
     NS_ASSERTION(!aListName, "Unexpected frame list when adding legend frame");
     mLegendFrame = aFrameList;
     aFrameList = mLegendFrame->GetNextSibling();
     mLegendFrame->SetNextSibling(mContentFrame);
     mFrames.SetFrames(mLegendFrame);
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   }
   return aFrameList;
 }
 
 void
 nsFieldSetFrame::ReParentFrameList(nsIFrame* aFrameList)
 {
-  nsFrameManager* frameManager = GetPresContext()->FrameManager();
+  nsFrameManager* frameManager = PresContext()->FrameManager();
   for (nsIFrame* frame = aFrameList; frame; frame = frame->GetNextSibling()) {
     frame->SetParent(mContentFrame);
     frameManager->ReParentStyleContext(frame);
   }
   mContentFrame->AddStateBits(GetStateBits() & NS_FRAME_HAS_CHILD_WITH_VIEW);
 }
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -229,17 +229,17 @@ nsFileControlFrame::QueryInterface(const
 
 void 
 nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
 {
   // Fix for Bug 6133 
   if (mTextFrame) {
     nsIContent* content = mTextFrame->GetContent();
     if (content) {
-      content->SetFocus(GetPresContext());
+      content->SetFocus(PresContext());
     }
   }
 }
 
 /**
  * This is called when our browse button is clicked
  */
 nsresult 
--- a/layout/forms/nsFormControlFrame.cpp
+++ b/layout/forms/nsFormControlFrame.cpp
@@ -112,17 +112,17 @@ nsFormControlFrame::Reflow(nsPresContext
                              aStatus);
 }
 
 nsresult
 nsFormControlFrame::RegUnRegAccessKey(nsIFrame * aFrame, PRBool aDoReg)
 {
   NS_ENSURE_ARG_POINTER(aFrame);
   
-  nsPresContext* presContext = aFrame->GetPresContext();
+  nsPresContext* presContext = aFrame->PresContext();
   
   NS_ASSERTION(presContext, "aPresContext is NULL in RegUnRegAccessKey!");
 
   nsAutoString accessKey;
 
   nsIContent* content = aFrame->GetContent();
   content->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accessKey);
   if (!accessKey.IsEmpty()) {
--- a/layout/forms/nsGfxButtonControlFrame.cpp
+++ b/layout/forms/nsGfxButtonControlFrame.cpp
@@ -135,17 +135,17 @@ nsIFrame*
 nsGfxButtonControlFrame::CreateFrameFor(nsIContent*      aContent)
 {
   nsIFrame * newFrame = nsnull;
 
   if (aContent == mTextContent) {
     nsIFrame * parentFrame = mFrames.FirstChild();
     nsStyleContext* styleContext = parentFrame->GetStyleContext();
 
-    nsPresContext* presContext = GetPresContext();
+    nsPresContext* presContext = PresContext();
     nsRefPtr<nsStyleContext> textStyleContext;
     textStyleContext = presContext->StyleSet()->
       ResolveStyleForNonElement(styleContext);
 
     if (textStyleContext && styleContext) {
       newFrame = NS_NewTextFrame(presContext->PresShell(), textStyleContext);
       if (newFrame) {
         // initialize the text frame
--- a/layout/forms/nsGfxCheckboxControlFrame.cpp
+++ b/layout/forms/nsGfxCheckboxControlFrame.cpp
@@ -259,20 +259,20 @@ nsGfxCheckboxControlFrame::PaintCheckBox
 
   nscoord width = myPosition->mWidth.GetCoordValue();
   nscoord height = myPosition->mHeight.GetCoordValue();
   // Position the button centered within the control's rectangle.
   nscoord x = (mRect.width - width) / 2;
   nscoord y = (mRect.height - height) / 2;
   nsRect rect(aPt.x + x, aPt.y + y, width, height);
 
-  nsCSSRendering::PaintBackgroundWithSC(GetPresContext(), aRenderingContext,
+  nsCSSRendering::PaintBackgroundWithSC(PresContext(), aRenderingContext,
                                         this, aDirtyRect, rect, *myBackground,
                                         *myBorder, *myPadding, PR_FALSE);
-  nsCSSRendering::PaintBorder(GetPresContext(), aRenderingContext, this,
+  nsCSSRendering::PaintBorder(PresContext(), aRenderingContext, this,
                               aDirtyRect, rect, *myBorder, mCheckButtonFaceStyle, 0);
 }
 
 //------------------------------------------------------------
 PRBool
 nsGfxCheckboxControlFrame::GetCheckboxState ( )
 {
   nsCOMPtr<nsIDOMHTMLInputElement> elem(do_QueryInterface(mContent));
--- a/layout/forms/nsGfxRadioControlFrame.cpp
+++ b/layout/forms/nsGfxRadioControlFrame.cpp
@@ -145,17 +145,17 @@ nsGfxRadioControlFrame::PaintRadioButton
   // So we will use PaintBackgroundWithSC to paint the dot, 
   // but it uses the mBackgroundColor for painting and we need to use the mColor
   // so create a temporary style color struct and set it up appropriately
   // XXXldb It would make more sense to use
   // |aRenderingContext.FillEllipse| here, but on at least GTK that
   // doesn't draw a round enough circle.
   nsStyleBackground tmpColor     = *myColor;
   tmpColor.mBackgroundColor = color->mColor;
-  nsPresContext* pc = GetPresContext();
+  nsPresContext* pc = PresContext();
   nsCSSRendering::PaintBackgroundWithSC(pc, aRenderingContext,
                                         this, aDirtyRect, rect,
                                         tmpColor, *myBorder, *myPadding, PR_FALSE);
   nsCSSRendering::PaintBorder(pc, aRenderingContext, this,
                               aDirtyRect, rect, *myBorder, mRadioButtonFaceStyle, 0);
 }
 
 class nsDisplayRadioButtonFromStyle : public nsDisplayItem {
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -95,17 +95,17 @@ nsHTMLButtonControlFrame::Destroy()
 NS_IMETHODIMP
 nsHTMLButtonControlFrame::Init(
               nsIContent*      aContent,
               nsIFrame*        aParent,
               nsIFrame*        aPrevInFlow)
 {
   nsresult  rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
   if (NS_SUCCEEDED(rv)) {
-    mRenderer.SetFrame(this, GetPresContext());
+    mRenderer.SetFrame(this, PresContext());
   }
   return rv;
 }
 
 nsrefcnt nsHTMLButtonControlFrame::AddRef(void)
 {
   NS_WARNING("not supported");
   return 1;
--- a/layout/forms/nsIsIndexFrame.cpp
+++ b/layout/forms/nsIsIndexFrame.cpp
@@ -137,17 +137,17 @@ nsIsIndexFrame::UpdatePromptLabel()
   mTextContent->SetText(prompt, PR_TRUE);
 
   return NS_OK;
 }
 
 nsresult
 nsIsIndexFrame::GetInputFrame(nsIFormControlFrame** oFrame)
 {
-  nsIPresShell *presShell = GetPresContext()->GetPresShell();
+  nsIPresShell *presShell = PresContext()->GetPresShell();
   if (!mInputContent) NS_WARNING("null content - cannot restore state");
   if (presShell && mInputContent) {
     nsIFrame *frame = presShell->GetPrimaryFrameFor(mInputContent);
     if (frame) {
       return CallQueryInterface(frame, oFrame);
     }
   }
   return NS_OK;
@@ -298,17 +298,17 @@ nsIsIndexFrame::KeyPress(nsIDOMEvent* aE
   nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
   if (keyEvent) {
     PRUint32 code;
     keyEvent->GetKeyCode(&code);
     if (code == 0) {
       keyEvent->GetCharCode(&code);
     }
     if (nsIDOMKeyEvent::DOM_VK_RETURN == code) {
-      OnSubmit(GetPresContext());
+      OnSubmit(PresContext());
       aEvent->PreventDefault(); // XXX Needed?
     }
   }
 
   return NS_OK;
 }
 
 #ifdef NS_DEBUG
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -255,17 +255,17 @@ void nsListControlFrame::PaintFocus(nsIR
   // use the selected index if this is kNothingSelected
   PRInt32 focusedIndex;
   if (mEndSelectionIndex == kNothingSelected) {
     focusedIndex = GetSelectedIndex();
   } else {
     focusedIndex = mEndSelectionIndex;
   }
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   if (!GetScrollableView()) return;
 
   nsIPresShell *presShell = presContext->GetPresShell();
   if (!presShell) return;
 
   nsIFrame* containerFrame = GetOptionsContainer();
   if (!containerFrame) return;
 
@@ -400,17 +400,17 @@ nsListControlFrame::QueryInterface(const
 
 #ifdef ACCESSIBILITY
 NS_IMETHODIMP nsListControlFrame::GetAccessible(nsIAccessible** aAccessible)
 {
   nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
 
   if (accService) {
     nsCOMPtr<nsIDOMNode> node = do_QueryInterface(mContent);
-    nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(GetPresContext()->PresShell()));
+    nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(PresContext()->PresShell()));
     return accService->CreateHTMLListboxAccessible(node, weakShell, aAccessible);
   }
 
   return NS_ERROR_FAILURE;
 }
 #endif
 
 static nscoord
@@ -1653,17 +1653,17 @@ nsListControlFrame::FireOnChange()
     if (index == GetSelectedIndex())
       return;
   }
 
   // Dispatch the NS_FORM_CHANGE event
   nsEventStatus status = nsEventStatus_eIgnore;
   nsEvent event(PR_TRUE, NS_FORM_CHANGE);
 
-  nsCOMPtr<nsIPresShell> presShell = GetPresContext()->GetPresShell();
+  nsCOMPtr<nsIPresShell> presShell = PresContext()->GetPresShell();
   if (presShell) {
     presShell->HandleEventWithTarget(&event, this, nsnull, &status);
   }
 }
 
 //---------------------------------------------------------
 // Determine if the specified item in the listbox is selected.
 NS_IMETHODIMP
@@ -1891,17 +1891,17 @@ nscoord
 nsListControlFrame::CalcFallbackRowHeight(PRInt32 aNumOptions)
 {
   const nsStyleFont* styleFont = nsnull;
     
   if (aNumOptions > 0) {
     // Try the first option
     nsCOMPtr<nsIContent> option = GetOptionContent(0);
     if (option) {
-      nsIFrame * optFrame = GetPresContext()->PresShell()->
+      nsIFrame * optFrame = PresContext()->PresShell()->
         GetPrimaryFrameFor(option);
       if (optFrame) {
         styleFont = optFrame->GetStyleFont();
       }
     }
   }
 
   if (!styleFont) {
@@ -1909,17 +1909,17 @@ nsListControlFrame::CalcFallbackRowHeigh
     styleFont = GetStyleFont();
   }
 
   NS_ASSERTION(styleFont, "Must have font style by now!");
 
   nscoord rowHeight = 0;
   
   nsCOMPtr<nsIFontMetrics> fontMet;
-  nsresult result = GetPresContext()->DeviceContext()->
+  nsresult result = PresContext()->DeviceContext()->
     GetMetricsFor(styleFont->mFont, *getter_AddRefs(fontMet));
   if (NS_SUCCEEDED(result) && fontMet) {
     if (fontMet) {
       fontMet->GetHeight(rowHeight);
     }
   }
 
   return rowHeight;
@@ -1938,17 +1938,17 @@ nsListControlFrame::CalcIntrinsicHeight(
   // Extra height to tack on to aHeightOfARow * mNumDisplayRows
   nscoord extraHeight = 0;
   
   if (mNumDisplayRows < 1) {
     // When SIZE=0 or unspecified we constrain the height to
     // [2..kMaxDropDownRows] rows.  We add in the height of optgroup labels
     // (within the constraint above), bug 300474.
     nscoord labelHeight =
-      ::GetOptGroupLabelsHeight(GetPresContext(), mContent, aHeightOfARow);
+      ::GetOptGroupLabelsHeight(PresContext(), mContent, aHeightOfARow);
 
     if (GetMultiple()) {
       if (aNumberOfOptions < 2) {
         // Add in 1 aHeightOfARow also when aNumberOfOptions == 0
         mNumDisplayRows = 1;
         extraHeight = PR_MAX(aHeightOfARow, labelHeight);
       }
       else if (aNumberOfOptions * aHeightOfARow + labelHeight >
@@ -2161,26 +2161,26 @@ nsListControlFrame::GetIndexFromDOMEvent
     nsPoint pt = nsLayoutUtils::GetDOMEventCoordinatesRelativeTo(aMouseEvent, this);
     nsRect borderInnerEdge = GetScrollableView()->View()->GetBounds();
     if (!borderInnerEdge.Contains(pt)) {
       return NS_ERROR_FAILURE;
     }
   }
 
   nsCOMPtr<nsIContent> content;
-  GetPresContext()->EventStateManager()->
+  PresContext()->EventStateManager()->
     GetEventTargetContent(nsnull, getter_AddRefs(content));
 
   nsCOMPtr<nsIContent> optionContent = GetOptionFromContent(content);
   if (optionContent) {
     aCurIndex = GetIndexFromContent(optionContent);
     return NS_OK;
   }
 
-  nsIPresShell *presShell = GetPresContext()->PresShell();
+  nsIPresShell *presShell = PresContext()->PresShell();
   PRInt32 numOptions = GetNumberOfOptions();
   if (numOptions < 1)
     return NS_ERROR_FAILURE;
 
   nsPoint pt = nsLayoutUtils::GetDOMEventCoordinatesRelativeTo(aMouseEvent, this);
 
   // If the event coordinate is above the first option frame, then target the
   // first option frame
@@ -2363,17 +2363,17 @@ nsListControlFrame::ScrollToFrame(nsICon
   if (scrollableView) {
     // if null is passed in we scroll to 0,0
     if (nsnull == aOptElement) {
       scrollableView->ScrollTo(0, 0, PR_TRUE);
       return NS_OK;
     }
   
     // otherwise we find the content's frame and scroll to it
-    nsIPresShell *presShell = GetPresContext()->PresShell();
+    nsIPresShell *presShell = PresContext()->PresShell();
     nsIFrame * childframe;
     if (aOptElement) {
       childframe = presShell->GetPrimaryFrameFor(aOptElement);
     } else {
       return NS_ERROR_FAILURE;
     }
 
     if (childframe) {
@@ -2802,17 +2802,17 @@ nsListControlFrame::KeyPress(nsIDOMEvent
     }
 #endif
 
     // XXX - Are we cover up a problem here???
     // Why aren't they getting flushed each time?
     // because this isn't needed for Gfx
     if (IsInDropDownMode()) {
       // Don't flush anything but reflows lest it destroy us
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         GetDocument()->FlushPendingNotifications(Flush_OnlyReflow);
     }
 
     // Make sure the SelectArea frame gets painted
     Invalidate(nsRect(0,0,mRect.width,mRect.height), PR_TRUE);
 
   }
 
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -1082,17 +1082,17 @@ nsTextControlFrame::PreDestroy()
       // in content).
       SetValue(value);
     }
     mEditor->PreDestroy();
   }
   
   // Clean up the controller
 
-  if (!SuppressEventHandlers(GetPresContext()))
+  if (!SuppressEventHandlers(PresContext()))
   {
     nsCOMPtr<nsIControllers> controllers;
     nsCOMPtr<nsIDOMNSHTMLInputElement> inputElement = do_QueryInterface(mContent);
     if (inputElement)
       inputElement->GetControllers(getter_AddRefs(controllers));
     else
     {
       nsCOMPtr<nsIDOMNSHTMLTextAreaElement> textAreaElement = do_QueryInterface(mContent);
@@ -1277,17 +1277,17 @@ nsTextControlFrame::CalcIntrinsicSize(ns
   nscoord charMaxAdvance  = 0;
 
   nsCOMPtr<nsIFontMetrics> fontMet;
   nsresult rv =
     nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet));
   NS_ENSURE_SUCCESS(rv, rv);
   aRenderingContext->SetFont(fontMet);
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   lineHeight = nsHTMLReflowState::CalcLineHeight(presContext,
                                                  aRenderingContext,
                                                  this);
   fontMet->GetAveCharWidth(charWidth);
   fontMet->GetMaxAdvance(charMaxAdvance);
 
   // Set the width equal to the width in characters
   PRInt32 cols = GetCols();
@@ -1336,17 +1336,17 @@ nsTextControlFrame::CalcIntrinsicSize(ns
   // Add in the size of the scrollbars for textarea
   if (IsTextArea()) {
     nsIFrame* first = GetFirstChild(nsnull);
 
     nsIScrollableFrame *scrollableFrame;
     CallQueryInterface(first, &scrollableFrame);
     NS_ASSERTION(scrollableFrame, "Child must be scrollable");
 
-    nsBoxLayoutState bls(GetPresContext(), aRenderingContext);
+    nsBoxLayoutState bls(PresContext(), aRenderingContext);
     nsMargin scrollbarSizes = scrollableFrame->GetDesiredScrollbarSizes(&bls);
 
     aIntrinsicSize.width  += scrollbarSizes.LeftRight();
     
     aIntrinsicSize.height += scrollbarSizes.TopBottom();;
   }
 
   return NS_OK;
@@ -1359,17 +1359,17 @@ void nsTextControlFrame::PostCreateFrame
 nsIFrame*
 nsTextControlFrame::CreateFrameFor(nsIContent*      aContent)
 {
 #ifdef DEBUG
   NS_ASSERTION(!mCreateFrameForCalled, "CreateFrameFor called more than once!");
   mCreateFrameForCalled = PR_TRUE;
 #endif
   
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsIPresShell *shell = presContext->GetPresShell();
   if (!shell)
     return nsnull;
   
   nsCOMPtr<nsIDOMDocument> domdoc = do_QueryInterface(shell->GetDocument());
   if (!domdoc)
     return nsnull;
 
@@ -1646,17 +1646,17 @@ nsTextControlFrame::InitEditor()
   return NS_OK;
 }
 
 nsresult
 nsTextControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
 {
   mState |= NS_FRAME_INDEPENDENT_SELECTION;
 
-  nsIPresShell* shell = GetPresContext()->GetPresShell();
+  nsIPresShell* shell = PresContext()->GetPresShell();
   if (!shell)
     return NS_ERROR_FAILURE;
 
   nsIDocument *doc = shell->GetDocument();
   if (!doc)
     return NS_ERROR_FAILURE;
 
   // Now create a DIV and add it to the anonymous content child list.
@@ -1820,27 +1820,27 @@ IsFocusedContent(nsPresContext* aPresCon
 void nsTextControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
 {
   if (!aOn || !mSelCon)
     return;
 
   // onfocus="some_where_else.focus()" can trigger several focus
   // in succession. Here, we only care if we are the winner.
   // @see also nsTextEditorFocusListener::Focus()
-  if (!IsFocusedContent(GetPresContext(), mContent))
+  if (!IsFocusedContent(PresContext(), mContent))
     return;
 
   // tell the caret to use our selection
 
   nsCOMPtr<nsISelection> ourSel;
   mSelCon->GetSelection(nsISelectionController::SELECTION_NORMAL, 
     getter_AddRefs(ourSel));
   if (!ourSel) return;
 
-  nsIPresShell* presShell = GetPresContext()->GetPresShell();
+  nsIPresShell* presShell = PresContext()->GetPresShell();
   nsCOMPtr<nsICaret> caret;
   presShell->GetCaret(getter_AddRefs(caret));
   if (!caret) return;
   caret->SetCaretDOMSelection(ourSel);
 
   // mutual-exclusion: the selection is either controlled by the
   // document or by the text input/area. Clear any selection in the
   // document since the focus is now on our independent selection.
@@ -2343,37 +2343,37 @@ nsTextControlFrame::AttributeChanged(PRI
   } 
   else if (nsGkAtoms::readonly == aAttribute) 
   {
     PRUint32 flags;
     mEditor->GetFlags(&flags);
     if (AttributeExists(nsGkAtoms::readonly))
     { // set readonly
       flags |= nsIPlaintextEditor::eEditorReadonlyMask;
-      if (IsFocusedContent(GetPresContext(), mContent))
+      if (IsFocusedContent(PresContext(), mContent))
         mSelCon->SetCaretEnabled(PR_FALSE);
     }
     else 
     { // unset readonly
       flags &= ~(nsIPlaintextEditor::eEditorReadonlyMask);
       if (!(flags & nsIPlaintextEditor::eEditorDisabledMask) &&
-          IsFocusedContent(GetPresContext(), mContent))
+          IsFocusedContent(PresContext(), mContent))
         mSelCon->SetCaretEnabled(PR_TRUE);
     }    
     mEditor->SetFlags(flags);
   }
   else if (mEditor && nsGkAtoms::disabled == aAttribute) 
   {
     PRUint32 flags;
     mEditor->GetFlags(&flags);
     if (AttributeExists(nsGkAtoms::disabled))
     { // set disabled
       flags |= nsIPlaintextEditor::eEditorDisabledMask;
       mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_OFF);
-      if (IsFocusedContent(GetPresContext(), mContent))
+      if (IsFocusedContent(PresContext(), mContent))
         mSelCon->SetCaretEnabled(PR_FALSE);
     }
     else 
     { // unset disabled
       flags &= ~(nsIPlaintextEditor::eEditorDisabledMask);
       mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_HIDDEN);
     }    
     mEditor->SetFlags(flags);
@@ -2462,17 +2462,17 @@ nsTextControlFrame::FireOnInput()
     return; // if notification is turned off, do nothing
   
   // Dispatch the "input" event
   nsEventStatus status = nsEventStatus_eIgnore;
   nsUIEvent event(PR_TRUE, NS_FORM_INPUT, 0);
 
   // Have the content handle the event, propagating it according to normal
   // DOM rules.
-  nsCOMPtr<nsIPresShell> shell = GetPresContext()->PresShell();
+  nsCOMPtr<nsIPresShell> shell = PresContext()->PresShell();
   shell->HandleEventWithTarget(&event, nsnull, mContent, &status);
 }
 
 nsresult
 nsTextControlFrame::InitFocusedValue()
 {
   return GetText(&mFocusedValue);
 }
@@ -2483,17 +2483,17 @@ nsTextControlFrame::CheckFireOnChange()
   nsString value;
   GetText(&value);
   if (!mFocusedValue.Equals(value))
   {
     mFocusedValue = value;
     // Dispatch the change event
     nsEventStatus status = nsEventStatus_eIgnore;
     nsInputEvent event(PR_TRUE, NS_FORM_CHANGE, nsnull);
-    nsCOMPtr<nsIPresShell> shell = GetPresContext()->PresShell();
+    nsCOMPtr<nsIPresShell> shell = PresContext()->PresShell();
     shell->HandleEventWithTarget(&event, nsnull, mContent, &status);
   }
   return NS_OK;
 }
 
 //======
 //privates
 
@@ -2735,17 +2735,17 @@ nsTextControlFrame::SetInitialChildList(
 
   //register focus and key listeners
   nsCOMPtr<nsIDOMEventReceiver> erP = do_QueryInterface(mContent);
   if (erP) {
     // register the event listeners with the DOM event receiver
     rv = erP->AddEventListenerByIID(NS_STATIC_CAST(nsIDOMFocusListener *,mTextListener), NS_GET_IID(nsIDOMFocusListener));
     NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register focus listener");
     // XXXbryner do we need to check for a null presshell here?
-    if (!GetPresContext()->GetPresShell())
+    if (!PresContext()->GetPresShell())
       return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIDOMEventGroup> systemGroup;
   erP->GetSystemEventGroup(getter_AddRefs(systemGroup));
   nsCOMPtr<nsIDOM3EventTarget> dom3Targ = do_QueryInterface(mContent);
   if (dom3Targ) {
     // cast because of ambiguous base
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -86,17 +86,17 @@ nsAbsoluteContainingBlock::AppendFrames(
 #ifdef NS_DEBUG
   nsFrame::VerifyDirtyBitSet(aFrameList);
 #endif
   mAbsoluteFrames.AppendFrames(nsnull, aFrameList);
 
   aDelegatingFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
   // no damage to intrinsic widths, since absolutely positioned frames can't
   // change them
-  return aDelegatingFrame->GetPresContext()->PresShell()->
+  return aDelegatingFrame->PresContext()->PresShell()->
     FrameNeedsReflow(aDelegatingFrame, nsIPresShell::eResize);
 }
 
 nsresult
 nsAbsoluteContainingBlock::InsertFrames(nsIFrame*      aDelegatingFrame,
                                         nsIAtom*       aListName,
                                         nsIFrame*      aPrevFrame,
                                         nsIFrame*      aFrameList)
@@ -108,17 +108,17 @@ nsAbsoluteContainingBlock::InsertFrames(
 #ifdef NS_DEBUG
   nsFrame::VerifyDirtyBitSet(aFrameList);
 #endif
   mAbsoluteFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
 
   aDelegatingFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
   // no damage to intrinsic widths, since absolutely positioned frames can't
   // change them
-  return aDelegatingFrame->GetPresContext()->PresShell()->
+  return aDelegatingFrame->PresContext()->PresShell()->
     FrameNeedsReflow(aDelegatingFrame, nsIPresShell::eResize);
 }
 
 nsresult
 nsAbsoluteContainingBlock::RemoveFrame(nsIFrame*       aDelegatingFrame,
                                        nsIAtom*        aListName,
                                        nsIFrame*       aOldFrame)
 {
--- a/layout/generic/nsAreaFrame.cpp
+++ b/layout/generic/nsAreaFrame.cpp
@@ -91,17 +91,17 @@ nsAreaFrame::RegUnregAccessKey(PRBool aD
   nsAutoString accessKey;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accessKey);
 
   if (accessKey.IsEmpty())
     return NS_OK;
 
   // With a valid PresContext we can get the ESM 
   // and register the access key
-  nsIEventStateManager *esm = GetPresContext()->EventStateManager();
+  nsIEventStateManager *esm = PresContext()->EventStateManager();
   nsresult rv;
 
   PRUint32 key = accessKey.First();
   if (aDoReg)
     rv = esm->RegisterAccessKey(mContent, key);
   else
     rv = esm->UnregisterAccessKey(mContent, key);
 
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -302,17 +302,17 @@ nsBlockFrame::Destroy()
   // and delete them when present.
   if (mBullet && HaveOutsideBullet()) {
     mBullet->Destroy();
     mBullet = nsnull;
   }
 
   mFloats.DestroyFrames();
   
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   nsLineBox::DeleteLineList(presContext, mLines);
 
   // destroy overflow lines now
   nsLineList* overflowLines = RemoveOverflowLines();
   if (overflowLines) {
     nsLineBox::DeleteLineList(presContext, *overflowLines);
   }
@@ -598,17 +598,17 @@ static void ReparentFrame(nsIFrame* aFra
                           nsIFrame* aNewParent) {
   NS_ASSERTION(aOldParent == aFrame->GetParent(),
                "Parent not consistent with exepectations");
 
   aFrame->SetParent(aNewParent);
 
   // When pushing and pulling frames we need to check for whether any
   // views need to be reparented
-  nsHTMLContainerFrame::ReparentFrameView(aFrame->GetPresContext(), aFrame,
+  nsHTMLContainerFrame::ReparentFrameView(aFrame->PresContext(), aFrame,
                                           aOldParent, aNewParent);
 }
  
 //////////////////////////////////////////////////////////////////////
 // Frame structure methods
 
 //////////////////////////////////////////////////////////////////////
 // Reflow methods
@@ -780,17 +780,17 @@ CalculateContainingBlockSizeForAbsolutes
       NS_ASSERTION(aLastRS->frame->GetStyleDisplay()->IsBlockLevel(),
                    "Wrapping frame should be block-level");
       // Scrollbars need to be specifically excluded, if present, because they are outside the
       // padding-edge. We need better APIs for getting the various boxes from a frame.
       nsIScrollableFrame* scrollFrame;
       CallQueryInterface(aLastRS->frame, &scrollFrame);
       nsMargin scrollbars(0,0,0,0);
       if (scrollFrame) {
-        nsBoxLayoutState dummyState(aLastRS->frame->GetPresContext(),
+        nsBoxLayoutState dummyState(aLastRS->frame->PresContext(),
                                     aLastRS->rendContext);
         scrollbars = scrollFrame->GetDesiredScrollbarSizes(&dummyState);
         // XXX We should account for the horizontal scrollbar too --- but currently
         // nsGfxScrollFrame assumes nothing depends on the presence (or absence) of
         // a horizontal scrollbar, so accounting for it would create incremental
         // reflow bugs.
         //if (!lastButOneRS->mFlags.mAssumingHScrollbar) {
           scrollbars.top = scrollbars.bottom = 0;
@@ -2418,17 +2418,17 @@ nsBlockFrame::AttributeChanged(PRInt32  
 {
   nsresult rv = nsBlockFrameSuper::AttributeChanged(aNameSpaceID,
                                                     aAttribute, aModType);
 
   if (NS_FAILED(rv)) {
     return rv;
   }
   if (nsGkAtoms::start == aAttribute) {
-    nsPresContext* presContext = GetPresContext();
+    nsPresContext* presContext = PresContext();
 
     // XXX Not sure if this is necessary anymore
     RenumberLists(presContext);
 
     presContext->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eStyleChange);
   }
   else if (nsGkAtoms::value == aAttribute) {
@@ -2438,17 +2438,17 @@ nsBlockFrame::AttributeChanged(PRInt32  
       // make the assumption that all related list items share a
       // common block parent.
       // XXXldb I think that's a bad assumption.
       nsBlockFrame* blockParent = nsLayoutUtils::FindNearestBlockAncestor(this);
 
       // Tell the enclosing block frame to renumber list items within
       // itself
       if (nsnull != blockParent) {
-        nsPresContext* presContext = GetPresContext();
+        nsPresContext* presContext = PresContext();
         // XXX Not sure if this is necessary anymore
         blockParent->RenumberLists(presContext);
 
         presContext->PresShell()->
           FrameNeedsReflow(blockParent, nsIPresShell::eStyleChange);
       }
     }
   }
@@ -4452,17 +4452,17 @@ DestroyOverflowLines(void*           aFr
 nsresult
 nsBlockFrame::SetOverflowLines(nsLineList* aOverflowLines)
 {
   NS_ASSERTION(aOverflowLines, "null lines");
   NS_ASSERTION(!aOverflowLines->empty(), "empty lines");
   NS_ASSERTION(!(GetStateBits() & NS_BLOCK_HAS_OVERFLOW_LINES),
                "Overwriting existing overflow lines");
 
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsresult rv = presContext->PropertyTable()->
     SetProperty(this, nsGkAtoms::overflowLinesProperty, aOverflowLines,
                 DestroyOverflowLines, presContext);
   // Verify that we didn't overwrite an existing overflow list
   NS_ASSERTION(rv != NS_PROPTABLE_PROP_OVERWRITTEN, "existing overflow list");
   AddStateBits(NS_BLOCK_HAS_OVERFLOW_LINES);
   return rv;
 }
@@ -4559,17 +4559,17 @@ nsBlockFrame::AppendFrames(nsIAtom*  aLi
     printf(" after ");
     nsFrame::ListTag(stdout, lastKid);
   }
   printf("\n");
 #endif
   nsresult rv = AddFrames(aFrameList, lastKid);
   if (NS_SUCCEEDED(rv)) {
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsBlockFrame::InsertFrames(nsIAtom*  aListName,
                            nsIFrame* aPrevFrame,
@@ -4607,17 +4607,17 @@ nsBlockFrame::InsertFrames(nsIAtom*  aLi
   printf("\n");
 #endif
   nsresult rv = AddFrames(aFrameList, aPrevFrame);
 #ifdef IBMBIDI
   if (aListName != nsGkAtoms::nextBidi)
 #endif // IBMBIDI
   if (NS_SUCCEEDED(rv)) {
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   }
   return rv;
 }
 
 static PRBool
 ShouldPutNextSiblingOnNewLine(nsIFrame* aLastFrame)
 {
@@ -4646,17 +4646,17 @@ nsBlockFrame::AddFrames(nsIFrame* aFrame
   // If we're inserting at the beginning of our list and we have an
   // inside bullet, insert after that bullet.
   if (!aPrevSibling && mBullet && !HaveOutsideBullet()) {
     NS_ASSERTION(!nsFrameList(aFrameList).ContainsFrame(mBullet),
                  "Trying to make mBullet prev sibling to itself");
     aPrevSibling = mBullet;
   }
   
-  nsIPresShell *presShell = GetPresContext()->PresShell();
+  nsIPresShell *presShell = PresContext()->PresShell();
 
   // Attempt to find the line that contains the previous sibling
   nsLineList::iterator prevSibLine = end_lines();
   PRInt32 prevSiblingIndex = -1;
   if (aPrevSibling) {
     // XXX_perf This is technically O(N^2) in some cases, but by using
     // RFind instead of Find, we make it O(N) in the most common case,
     // which is appending content.
@@ -4757,17 +4757,17 @@ nsBlockFrame::RemoveFloat(nsIFrame* aFlo
   for ( ; line != line_end; ++line) {
     if (line->IsInline() && line->RemoveFloat(aFloat)) {
       break;
     }
   }
 
   // Unlink the placeholder *after* we searched the lines, because
   // the line search uses the placeholder relationship.
-  nsFrameManager* fm = GetPresContext()->GetPresShell()->FrameManager();
+  nsFrameManager* fm = PresContext()->GetPresShell()->FrameManager();
   nsPlaceholderFrame* placeholder = fm->GetPlaceholderFrameFor(aFloat);
   if (placeholder) {
     fm->UnregisterPlaceholderFrame(placeholder);
     placeholder->SetOutOfFlowFrame(nsnull);
   }
 
   // Try to destroy if it's in mFloats.
   if (mFloats.DestroyFrame(aFloat)) {
@@ -4882,17 +4882,17 @@ nsBlockFrame::RemoveFrame(nsIAtom*  aLis
 #endif // IBMBIDI
   else {
     NS_ERROR("unexpected child list");
     rv = NS_ERROR_INVALID_ARG;
   }
 
   if (NS_SUCCEEDED(rv)) {
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   }
   return rv;
 }
 
 void
 nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame)
 {
@@ -4966,17 +4966,17 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aD
   ClearLineCursor();
         
   if (aDeletedFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
     NS_ASSERTION(aDestroyFrames, "We can't not destroy out of flows");
     DoRemoveOutOfFlowFrame(aDeletedFrame);
     return NS_OK;
   }
   
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsIPresShell* presShell = presContext->PresShell();
 
   PRBool isPlaceholder = nsGkAtoms::placeholderFrame == aDeletedFrame->GetType();
   if (isPlaceholder) {
     nsFrameList* overflowPlaceholders = GetOverflowPlaceholders();
     if (overflowPlaceholders && overflowPlaceholders->RemoveFrame(aDeletedFrame)) {
       nsIFrame* nif = aDeletedFrame->GetNextInFlow();
       if (aDestroyFrames) {
@@ -5683,17 +5683,17 @@ NS_IMETHODIMP nsBlockFrame::GetAccessibl
     do_GetService("@mozilla.org/accessibilityService;1");
   NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
 
   // block frame may be for <hr>
   if (mContent->Tag() == nsGkAtoms::hr) {
     return accService->CreateHTMLHRAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
   }
 
-  nsPresContext *aPresContext = GetPresContext();
+  nsPresContext *aPresContext = PresContext();
   if (!mBullet || !aPresContext) {
     if (!mContent || !mContent->GetParent()) {
       // Don't create accessible objects for the root content node, they are redundant with
       // the nsDocAccessible object created with the document node
       return NS_ERROR_FAILURE;
     }
     
     nsCOMPtr<nsIDOMHTMLDocument> htmlDoc =
@@ -5923,17 +5923,17 @@ nsBlockFrame::SetInitialChildList(nsIAto
 
   if (mAbsoluteContainer.GetChildListName() == aListName) {
     mAbsoluteContainer.SetInitialChildList(this, aListName, aChildList);
   }
   else if (nsGkAtoms::floatList == aListName) {
     mFloats.SetFrames(aChildList);
   }
   else {
-    nsPresContext* presContext = GetPresContext();
+    nsPresContext* presContext = PresContext();
 
     // Lookup up the two pseudo style contexts
     if (nsnull == GetPrevInFlow()) {
       nsRefPtr<nsStyleContext> firstLetterStyle = GetFirstLetterStyle(presContext);
       if (nsnull != firstLetterStyle) {
         mState |= NS_BLOCK_HAS_FIRST_LETTER_STYLE;
 #ifdef NOISY_FIRST_LETTER
         ListTag(stdout);
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -107,17 +107,17 @@ nsBlockReflowContext::ComputeCollapsedTo
 
   // Calculate the frame's generational top-margin from its child
   // blocks. Note that if the frame has a non-zero top-border or
   // top-padding then this step is skipped because it will be a margin
   // root.  It is also skipped if the frame is a margin root for other
   // reasons.
   void* bf;
   nsIFrame* frame = DescendIntoBlockLevelFrame(aRS.frame);
-  nsPresContext* prescontext = frame->GetPresContext();
+  nsPresContext* prescontext = frame->PresContext();
   if (0 == aRS.mComputedBorderPadding.top &&
       NS_SUCCEEDED(frame->QueryInterface(kBlockFrameCID, &bf)) &&
       !nsBlockFrame::BlockIsMarginRoot(frame)) {
     // iterate not just through the lines of 'block' but also its
     // overflow lines and the normal and overflow lines of its next in
     // flows. Note that this will traverse some frames more than once:
     // for example, if A contains B and A->nextinflow contains
     // B->nextinflow, we'll traverse B->nextinflow twice. But this is
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -356,17 +356,17 @@ nsBulletFrame::PaintBullet(nsIRenderingC
   case NS_STYLE_LIST_STYLE_MOZ_KHMER:
   case NS_STYLE_LIST_STYLE_MOZ_HANGUL:
   case NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT:
   case NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME:
   case NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC:
   case NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM:
   case NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER:
   case NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET:
-    fm = GetPresContext()->GetMetricsFor(myFont->mFont);
+    fm = PresContext()->GetMetricsFor(myFont->mFont);
 #ifdef IBMBIDI
     // If we can't render our numeral using the chars in the numbering
     // system, we'll be using "decimal"...
     PRBool usedChars =
 #endif // IBMBIDI
     GetListItemText(*myList, text);
 #ifdef IBMBIDI
     if (!usedChars)
@@ -377,17 +377,17 @@ nsBulletFrame::PaintBullet(nsIRenderingC
     fm->GetMaxAscent(ascent);
     aRenderingContext.SetTextRunRTL(PR_FALSE);
     aRenderingContext.DrawString(text, mPadding.left + aPt.x,
                                  mPadding.top + aPt.y + ascent);
     break;
   }
 #ifdef IBMBIDI
   if (charType != eCharType_LeftToRight) {
-    nsPresContext* presContext = GetPresContext();
+    nsPresContext* presContext = PresContext();
     fm = presContext->GetMetricsFor(myFont->mFont);
     aRenderingContext.SetFont(fm);
     nscoord ascent;
     fm->GetMaxAscent(ascent);
 
     nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
     if (bidiUtils) {
       const PRUnichar* buffer = text.get();
@@ -1568,26 +1568,26 @@ nsBulletFrame::Reflow(nsPresContext* aPr
   return NS_OK;
 }
 
 /* virtual */ nscoord
 nsBulletFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
 {
   nsHTMLReflowMetrics metrics;
   DISPLAY_MIN_WIDTH(this, metrics.width);
-  GetDesiredSize(GetPresContext(), aRenderingContext, metrics);
+  GetDesiredSize(PresContext(), aRenderingContext, metrics);
   return metrics.width;
 }
 
 /* virtual */ nscoord
 nsBulletFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
 {
   nsHTMLReflowMetrics metrics;
   DISPLAY_PREF_WIDTH(this, metrics.width);
-  GetDesiredSize(GetPresContext(), aRenderingContext, metrics);
+  GetDesiredSize(PresContext(), aRenderingContext, metrics);
   return metrics.width;
 }
 
 
 NS_IMETHODIMP nsBulletFrame::OnStartContainer(imgIRequest *aRequest,
                                               imgIContainer *aImage)
 {
   if (!aImage) return NS_ERROR_INVALID_ARG;
@@ -1598,17 +1598,17 @@ NS_IMETHODIMP nsBulletFrame::OnStartCont
   if (status & imgIRequest::STATUS_ERROR) {
     return NS_OK;
   }
   
   nscoord w, h;
   aImage->GetWidth(&w);
   aImage->GetHeight(&h);
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   nsSize newsize(nsPresContext::CSSPixelsToAppUnits(w),
                  nsPresContext::CSSPixelsToAppUnits(h));
 
   if (mIntrinsicSize != newsize) {
     mIntrinsicSize = newsize;
 
     // Now that the size is available (or an error occurred), trigger
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -422,17 +422,17 @@ nsColumnSetFrame::ReflowChildren(nsHTMLR
       
       if (aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1) {
         availSize.height = GetAvailableContentHeight(aReflowState);
       }
   
       if (reflowNext)
         child->AddStateBits(NS_FRAME_IS_DIRTY);
 
-      nsHTMLReflowState kidReflowState(GetPresContext(), aReflowState, child,
+      nsHTMLReflowState kidReflowState(PresContext(), aReflowState, child,
                                        availSize, availSize.width,
                                        aReflowState.mComputedHeight);
       kidReflowState.mFlags.mIsTopOfPage = PR_TRUE;
       kidReflowState.mFlags.mTableIsSplittable = PR_FALSE;
           
 #ifdef DEBUG_roc
       printf("*** Reflowing child #%d %p: availHeight=%d\n",
              columnCount, (void*)child,availSize.height);
@@ -451,17 +451,17 @@ nsColumnSetFrame::ReflowChildren(nsHTMLR
       // XXX it would be cool to consult the space manager for the
       // previous block to figure out the region of floats from the
       // previous column that extend into this column, and subtract
       // that region from the new space manager.  So you could stick a
       // really big float in the first column and text in following
       // columns would flow around it.
 
       // Reflow the frame
-      ReflowChild(child, GetPresContext(), kidDesiredSize, kidReflowState,
+      ReflowChild(child, PresContext(), kidDesiredSize, kidReflowState,
                   childOrigin.x + kidReflowState.mComputedMargin.left,
                   childOrigin.y + kidReflowState.mComputedMargin.top,
                   0, aStatus);
 
       if (kidDesiredSize.height > aConfig.mColMaxHeight) {
         allFit = PR_FALSE;
       }
       
@@ -471,17 +471,17 @@ nsColumnSetFrame::ReflowChildren(nsHTMLR
       printf("*** Reflowed child #%d %p: status = %d, desiredSize=%d,%d\n",
              columnCount, (void*)child, aStatus, kidDesiredSize.width, kidDesiredSize.height);
 #endif
 
       NS_FRAME_TRACE_REFLOW_OUT("Column::Reflow", aStatus);
 
       *aBottomMarginCarriedOut = kidDesiredSize.mCarriedOutBottomMargin;
       
-      FinishReflowChild(child, GetPresContext(), &kidReflowState, 
+      FinishReflowChild(child, PresContext(), &kidReflowState, 
                         kidDesiredSize, childOrigin.x, childOrigin.y, 0);
     }
 
     contentRect.UnionRect(contentRect, child->GetRect());
 
     ConsiderChildOverflow(overflowRect, child);
 
     // Build a continuation column if necessary
@@ -496,34 +496,34 @@ nsColumnSetFrame::ReflowChildren(nsHTMLR
       // create one to hold the overflowing stuff, even if we're just
       // going to put it on our overflow list and let *our*
       // next in flow handle it.
       if (!kidNextInFlow) {
         NS_ASSERTION(aStatus & NS_FRAME_REFLOW_NEXTINFLOW,
                      "We have to create a continuation, but the block doesn't want us to reflow it?");
 
         // We need to create a continuing column
-        nsresult rv = CreateNextInFlow(GetPresContext(), this, child, kidNextInFlow);
+        nsresult rv = CreateNextInFlow(PresContext(), this, child, kidNextInFlow);
         
         if (NS_FAILED(rv)) {
           NS_NOTREACHED("Couldn't create continuation");
           break;
         }
       }
         
       if (columnCount >= aConfig.mBalanceColCount) {
         // No more columns allowed here. Stop.
         aStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
         kidNextInFlow->AddStateBits(NS_FRAME_IS_DIRTY);
         
         // Move any of our leftover columns to our overflow list. Our
         // next-in-flow will eventually pick them up.
         nsIFrame* continuationColumns = child->GetNextSibling();
         if (continuationColumns) {
-          SetOverflowFrames(GetPresContext(), continuationColumns);
+          SetOverflowFrames(PresContext(), continuationColumns);
           child->SetNextSibling(nsnull);
         }
         break;
       }
     }
 
     // Advance to the next column
     child = child->GetNextSibling();
@@ -611,41 +611,41 @@ static nscoord ComputeSumOfChildHeights(
 
 void
 nsColumnSetFrame::DrainOverflowColumns()
 {
   // First grab the prev-in-flows overflows and reparent them to this
   // frame.
   nsColumnSetFrame* prev = NS_STATIC_CAST(nsColumnSetFrame*, GetPrevInFlow());
   if (prev) {
-    nsIFrame* overflows = prev->GetOverflowFrames(GetPresContext(), PR_TRUE);
+    nsIFrame* overflows = prev->GetOverflowFrames(PresContext(), PR_TRUE);
     if (overflows) {
       // Make all the frames on the overflow list mine
       nsIFrame* lastFrame = nsnull;
       for (nsIFrame* f = overflows; f; f = f->GetNextSibling()) {
         f->SetParent(this);
 
         // When pushing and pulling frames we need to check for whether any
         // views need to be reparented
-        nsHTMLContainerFrame::ReparentFrameView(GetPresContext(), f, prev, this);
+        nsHTMLContainerFrame::ReparentFrameView(PresContext(), f, prev, this);
 
         // Get the next frame
         lastFrame = f;
       }
 
       NS_ASSERTION(lastFrame, "overflow list was created with no frames");
       lastFrame->SetNextSibling(mFrames.FirstChild());
       
       mFrames.SetFrames(overflows);
     }
   }
   
   // Now pull back our own overflows and append them to our children.
   // We don't need to reparent them since we're already their parent.
-  nsIFrame* overflows = GetOverflowFrames(GetPresContext(), PR_TRUE);
+  nsIFrame* overflows = GetOverflowFrames(PresContext(), PR_TRUE);
   if (overflows) {
     mFrames.AppendFrames(this, overflows);
   }
 }
 
 NS_IMETHODIMP 
 nsColumnSetFrame::Reflow(nsPresContext*          aPresContext,
                       nsHTMLReflowMetrics&     aDesiredSize,
@@ -798,17 +798,17 @@ nsColumnSetFrame::Reflow(nsPresContext* 
       if (!skip) {
         AddStateBits(NS_FRAME_IS_DIRTY);
         ReflowChildren(aDesiredSize, aReflowState,
                        aStatus, config, PR_FALSE, &carriedOutBottomMargin);
       }
     }
   }
   
-  CheckInvalidateSizeChange(GetPresContext(), aDesiredSize, aReflowState);
+  CheckInvalidateSizeChange(PresContext(), aDesiredSize, aReflowState);
 
   FinishAndStoreOverflow(&aDesiredSize);
   aDesiredSize.mCarriedOutBottomMargin = carriedOutBottomMargin;
 
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
 
   return NS_OK;
 }
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -134,17 +134,17 @@ nsContainerFrame::AppendFrames(nsIAtom* 
     mFrames.AppendFrames(this, aFrameList);
 
     // Ask the parent frame to reflow me.
 #ifdef IBMBIDI
     if (nsnull == aListName)
 #endif
     {
       AddStateBits(NS_FRAME_IS_DIRTY);
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsContainerFrame::InsertFrames(nsIAtom*  aListName,
@@ -168,17 +168,17 @@ nsContainerFrame::InsertFrames(nsIAtom* 
     mFrames.InsertFrames(this, aPrevFrame, aFrameList);
 
 #ifdef IBMBIDI
     if (nsnull == aListName)
 #endif
     {
       // Ask the parent frame to reflow me.
       AddStateBits(NS_FRAME_IS_DIRTY);
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsContainerFrame::RemoveFrame(nsIAtom*  aListName,
@@ -226,17 +226,17 @@ nsContainerFrame::RemoveFrame(nsIAtom*  
       if (aOldFrame) {
         parent = NS_STATIC_CAST(nsContainerFrame*, aOldFrame->GetParent());
       }
     }
 
     if (generateReflowCommand) {
       // Ask the parent frame to reflow me.
       AddStateBits(NS_FRAME_IS_DIRTY);
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     }
   }
 
   return NS_OK;
 }
 
 void
@@ -246,17 +246,17 @@ nsContainerFrame::CleanupGeneratedConten
   PRInt32 listIndex = 0;
   do {
     nsIFrame* child = aRoot->GetFirstChild(frameList);
     while (child) {
       nsIContent* content = child->GetContent();
       if (content && content != aRealContent) {
         // Tell the ESM that this content is going away now, so it'll update
         // its hover content, etc.
-        aRoot->GetPresContext()->EventStateManager()->ContentRemoved(content);
+        aRoot->PresContext()->EventStateManager()->ContentRemoved(content);
         content->UnbindFromTree();
       }
       CleanupGeneratedContentIn(aRealContent, child);
       child = child->GetNextSibling();
     }
     frameList = aRoot->GetAdditionalChildListName(listIndex++);
   } while (frameList);
 }
@@ -268,17 +268,17 @@ nsContainerFrame::Destroy()
   if (HasView()) {
     GetView()->SetClientData(nsnull);
   }
 
   // Delete the primary child list
   mFrames.DestroyFrames();
   
   // Destroy overflow frames now
-  nsFrameList overflowFrames(GetOverflowFrames(GetPresContext(), PR_TRUE));
+  nsFrameList overflowFrames(GetOverflowFrames(PresContext(), PR_TRUE));
   overflowFrames.DestroyFrames();
 
   // Destroy the frame and remove the flow pointers
   nsSplittableFrame::Destroy();
 }
 
 /////////////////////////////////////////////////////////////////////////////
 // Child frame enumeration
@@ -286,17 +286,17 @@ nsContainerFrame::Destroy()
 nsIFrame*
 nsContainerFrame::GetFirstChild(nsIAtom* aListName) const
 {
   // We only know about the unnamed principal child list and the overflow
   // list
   if (nsnull == aListName) {
     return mFrames.FirstChild();
   } else if (nsGkAtoms::overflowList == aListName) {
-    return GetOverflowFrames(GetPresContext(), PR_FALSE);
+    return GetOverflowFrames(PresContext(), PR_FALSE);
   } else {
     return nsnull;
   }
 }
 
 nsIAtom*
 nsContainerFrame::GetAdditionalChildListName(PRInt32 aIndex) const
 {
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -145,17 +145,17 @@ nsFirstLetterFrame::Init(nsIContent*    
   return nsFirstLetterFrameSuper::Init(aContent, aParent, aPrevInFlow);
 }
 
 NS_IMETHODIMP
 nsFirstLetterFrame::SetInitialChildList(nsIAtom*  aListName,
                                         nsIFrame* aChildList)
 {
   mFrames.SetFrames(aChildList);
-  nsFrameManager *frameManager = GetPresContext()->FrameManager();
+  nsFrameManager *frameManager = PresContext()->FrameManager();
 
   for (nsIFrame* frame = aChildList; frame; frame = frame->GetNextSibling()) {
     NS_ASSERTION(frame->GetParent() == this, "Unexpected parent");
     frameManager->ReParentStyleContext(frame);
   }
   return NS_OK;
 }
 
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -260,17 +260,17 @@ nsIFrameDebug::GetLogModuleInfo()
     gLogModule = PR_NewLogModule("frame");
   }
   return gLogModule;
 }
 
 void
 nsIFrameDebug::DumpFrameTree(nsIFrame* aFrame)
 {
-    RootFrameList(aFrame->GetPresContext(), stdout, 0);
+    RootFrameList(aFrame->PresContext(), stdout, 0);
 }
 
 void
 nsIFrameDebug::RootFrameList(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent)
 {
   if((nsnull == aPresContext) || (nsnull == out))
     return;
 
@@ -443,20 +443,20 @@ void SetFontFromStyle(nsIRenderingContex
   const nsStyleVisibility* visibility = aSC->GetStyleVisibility();
 
   aRC->SetFont(font->mFont, visibility->mLangGroup);
 }
 
 void
 nsWeakFrame::Init(nsIFrame* aFrame)
 {
-  Clear(mFrame ? mFrame->GetPresContext()->GetPresShell() : nsnull);
+  Clear(mFrame ? mFrame->PresContext()->GetPresShell() : nsnull);
   mFrame = aFrame;
   if (mFrame) {
-    nsIPresShell* shell = mFrame->GetPresContext()->GetPresShell();
+    nsIPresShell* shell = mFrame->PresContext()->GetPresShell();
     NS_WARN_IF_FALSE(shell, "Null PresShell in nsWeakFrame!");
     if (shell) {
       shell->AddWeakFrame(this);
     } else {
       mFrame = nsnull;
     }
   }
 }
@@ -637,17 +637,17 @@ nsFrame::RemoveFrame(nsIAtom*        aLi
 }
 
 void
 nsFrame::Destroy()
 {
   // Get the view pointer now before the frame properties disappear
   // when we call NotifyDestroyingFrame()
   nsIView* view = GetView();
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   nsIPresShell *shell = presContext->GetPresShell();
   NS_ASSERTION(!(mState & NS_FRAME_OUT_OF_FLOW) ||
                !shell->FrameManager()->GetPlaceholderFrameFor(this),
                "Deleting out of flow without tearing down placeholder "
                "relationship; see comments in nsFrame.h");
 
   shell->NotifyDestroyingFrame(this);
@@ -722,17 +722,17 @@ nsIFrame::GetUsedBorder() const
                "cannot call on a dirty frame not currently being reflowed");
 
   // Theme methods don't use const-ness.
   nsIFrame *mutable_this = NS_CONST_CAST(nsIFrame*, this);
 
   const nsStyleDisplay *disp = GetStyleDisplay();
   if (mutable_this->IsThemed(disp)) {
     nsMargin result;
-    nsPresContext *presContext = GetPresContext();
+    nsPresContext *presContext = PresContext();
     presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(),
                                              mutable_this, disp->mAppearance,
                                              &result);
     result.top = presContext->DevPixelsToAppUnits(result.top);
     result.right = presContext->DevPixelsToAppUnits(result.right);
     result.bottom = presContext->DevPixelsToAppUnits(result.bottom);
     result.left = presContext->DevPixelsToAppUnits(result.left);
     return result;
@@ -751,17 +751,17 @@ nsIFrame::GetUsedPadding() const
 
   nsMargin padding(0, 0, 0, 0);
 
   // Theme methods don't use const-ness.
   nsIFrame *mutable_this = NS_CONST_CAST(nsIFrame*, this);
 
   const nsStyleDisplay *disp = GetStyleDisplay();
   if (mutable_this->IsThemed(disp)) {
-    nsPresContext *presContext = GetPresContext();
+    nsPresContext *presContext = PresContext();
     if (presContext->GetTheme()->GetWidgetPadding(presContext->DeviceContext(),
                                                   mutable_this,
                                                   disp->mAppearance,
                                                   &padding)) {
       padding.top = presContext->DevPixelsToAppUnits(padding.top);
       padding.right = presContext->DevPixelsToAppUnits(padding.right);
       padding.bottom = presContext->DevPixelsToAppUnits(padding.bottom);
       padding.left = presContext->DevPixelsToAppUnits(padding.left);
@@ -862,17 +862,17 @@ nsFrame::GetFirstChild(nsIAtom* aListNam
 {
   return nsnull;
 }
 
 static nsIFrame*
 GetActiveSelectionFrame(nsIFrame* aFrame)
 {
   nsIView* mouseGrabber;
-  aFrame->GetPresContext()->GetViewManager()->GetMouseEventGrabber(mouseGrabber);
+  aFrame->PresContext()->GetViewManager()->GetMouseEventGrabber(mouseGrabber);
   if (mouseGrabber) {
     nsIFrame* activeFrame = nsLayoutUtils::GetFrameFor(mouseGrabber);
     if (activeFrame) {
       return activeFrame;
     }
   }
     
   return aFrame;
@@ -962,17 +962,17 @@ void nsDisplaySelectionOverlay::Paint(ns
   gfxRGBA c(color);
   c.a = .5;
 
   nsRefPtr<gfxContext> ctx = (gfxContext*)aCtx->GetNativeGraphicData(nsIRenderingContext::NATIVE_THEBES_CONTEXT);
   ctx->SetColor(c);
 
   nsRect rect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize());
   rect.IntersectRect(rect, aDirtyRect);
-  rect.ScaleRoundOut(1.0f / mFrame->GetPresContext()->AppUnitsPerDevPixel());
+  rect.ScaleRoundOut(1.0f / mFrame->PresContext()->AppUnitsPerDevPixel());
   ctx->NewPath();
   ctx->Rectangle(gfxRect(rect.x, rect.y, rect.width, rect.height), PR_TRUE);
   ctx->Fill();
 #endif
 }
 
 /********************************************************
 * Refreshes each content's frame
@@ -984,17 +984,17 @@ nsFrame::DisplaySelectionOverlay(nsDispl
                                  PRUint16                aContentType)
 {
 //check frame selection state
   if ((GetStateBits() & NS_FRAME_SELECTED_CONTENT) != NS_FRAME_SELECTED_CONTENT)
     return NS_OK;
   if (!IsVisibleForPainting(aBuilder))
     return NS_OK;
     
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsIPresShell *shell = presContext->PresShell();
   if (!shell)
     return NS_OK;
 
   PRInt16 displaySelection;
   nsresult rv = shell->GetSelectionFlags(&displaySelection);
   if (NS_FAILED(rv))
     return rv;
@@ -1131,17 +1131,17 @@ static PRBool ApplyAbsPosClipping(nsDisp
   // for when an abs-pos frame clips a fixed-pos frame. So when fixed-pos
   // elements are present we do not allow a moving abs-pos frame with
   // an out-of-flow descendant (which could be a fixed frame) child to clip
   // anything. It's OK to not clip anything, even the moving children ...
   // all that could happen is that we get unnecessarily conservative results
   // for nsLayoutUtils::ComputeRepaintRegionForCopy ... but this is a rare
   // situation.
   if (aBuilder->HasMovingFrames() &&
-      aFrame->GetPresContext()->FrameManager()->GetRootFrame()->
+      aFrame->PresContext()->FrameManager()->GetRootFrame()->
           GetFirstChild(nsGkAtoms::fixedList) &&
       aBuilder->IsMovingFrame(aFrame))
     return PR_FALSE;
 
   *aRect += aBuilder->ToReferenceFrame(aFrame);
 
   return PR_TRUE;
 }
@@ -1309,17 +1309,17 @@ DisplayDebugBorders(nsDisplayListBuilder
   // Draw a border around the child
   // REVIEW: From nsContainerFrame::PaintChild
   if (nsIFrameDebug::GetShowFrameBorders() && !aFrame->GetRect().IsEmpty()) {
     aLists.Outlines()->AppendNewToTop(new (aBuilder)
         nsDisplayGeneric(aFrame, PaintDebugBorder, "DebugBorder"));
   }
   // Draw a border around the current event target
   if (nsIFrameDebug::GetShowEventTargetFrameBorder() &&
-      aFrame->GetPresContext()->PresShell()->GetDrawEventTargetFrame() == aFrame) {
+      aFrame->PresContext()->PresShell()->GetDrawEventTargetFrame() == aFrame) {
     aLists.Outlines()->AppendNewToTop(new (aBuilder)
         nsDisplayGeneric(aFrame, PaintEventTargetBorder, "EventTargetBorder"));
   }
 }
 #endif
 
 nsresult
 nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
@@ -1507,32 +1507,32 @@ nsIFrame::BuildDisplayListForChild(nsDis
     // to descend into it because its scrolled child may intersect the dirty
     // area even if the scrollframe itself doesn't.
     if (dirty.IsEmpty() && aChild != aBuilder->GetIgnoreScrollFrame())
       return NS_OK;
 
     // Note that aBuilder->GetRootMovingFrame() is non-null only if we're doing
     // ComputeRepaintRegionForCopy.
     if (aBuilder->GetRootMovingFrame() == this &&
-        !GetPresContext()->GetRenderedPositionVaryingContent()) {
+        !PresContext()->GetRenderedPositionVaryingContent()) {
       // No position-varying content has been rendered in this prescontext.
       // Therefore there is no need to descend into analyzing the moving frame's
       // descendants looking for such content, because any bitblit will
       // not be copying position-varying graphics.
       return NS_OK;
     }
   }
 
   // XXX need to have inline-block and inline-table set pseudoStackingContext
   
   const nsStyleDisplay* ourDisp = GetStyleDisplay();
   // REVIEW: Taken from nsBoxFrame::Paint
   // Don't paint our children if the theme object is a leaf.
   if (IsThemed(ourDisp) &&
-      !GetPresContext()->GetTheme()->WidgetIsContainer(ourDisp->mAppearance))
+      !PresContext()->GetTheme()->WidgetIsContainer(ourDisp->mAppearance))
     return NS_OK;
 
   PRBool isComposited = disp->mOpacity != 1.0f;
   PRBool isPositioned = disp->IsPositioned();
   if (isComposited || isPositioned || (aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT)) {
     // If you change this, also change IsPseudoStackingContextFromStyle()
     pseudoStackingContext = PR_TRUE;
   }
@@ -2126,17 +2126,17 @@ nsFrame::HandleMultiplePress(nsPresConte
 
   nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
   ContentOffsets offsets = GetContentOffsetsFromPoint(pt);
   if (!offsets.content) return NS_ERROR_FAILURE;
 
   nsIFrame* theFrame;
   PRInt32 offset;
   // Maybe make this a static helper?
-  theFrame = GetPresContext()->GetPresShell()->FrameSelection()->
+  theFrame = PresContext()->GetPresShell()->FrameSelection()->
     GetFrameForNodeOffset(offsets.content, offsets.offset,
                           nsFrameSelection::HINT(offsets.associateWithNext),
                           &offset);
   if (!theFrame)
     return NS_ERROR_FAILURE;
 
   nsFrame* frame = NS_STATIC_CAST(nsFrame*, theFrame);
 
@@ -2419,30 +2419,30 @@ NS_IMETHODIMP nsFrame::HandleRelease(nsP
       PRBool mouseDown = frameselection->GetMouseDownState();
       nsMouseEvent *me = frameselection->GetDelayedCaretData();
 
       if (!mouseDown && me && me->clickCount < 2) {
         nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
         offsets = GetContentOffsetsFromPoint(pt);
         handleTableSelection = PR_FALSE;
       } else {
-        GetDataForTableSelection(frameselection, GetPresContext()->PresShell(),
+        GetDataForTableSelection(frameselection, PresContext()->PresShell(),
                                  (nsMouseEvent *)aEvent,
                                  getter_AddRefs(parentContent),
                                  &contentOffsetForTableSel,
                                  &targetForTableSel);
       }
     }
   }
 
   // We might be capturing in some other document and the event just happened to
   // trickle down here. Make sure that document's frame selection is notified.
   // Note, this may cause the current nsFrame object to be deleted, bug 336592.
   if (activeFrame != this &&
-      NS_STATIC_CAST(nsFrame*, activeFrame)->DisplaySelection(activeFrame->GetPresContext())
+      NS_STATIC_CAST(nsFrame*, activeFrame)->DisplaySelection(activeFrame->PresContext())
         != nsISelectionController::SELECTION_OFF) {
     nsRefPtr<nsFrameSelection> frameSelection =
       activeFrame->GetFrameSelection();
     frameSelection->SetMouseDownState(PR_FALSE);
     frameSelection->StopAutoScrollTimer();
   }
 
   // Do not call any methods of the current object after this point!!!
@@ -3088,17 +3088,17 @@ nsFrame::IntrinsicWidthOffsets(nsIRender
            &result.hPadding, &result.hPctPadding);
 
   const nsStyleBorder *styleBorder = GetStyleBorder();
   result.hBorder += styleBorder->GetBorderWidth(NS_SIDE_LEFT);
   result.hBorder += styleBorder->GetBorderWidth(NS_SIDE_RIGHT);
 
   const nsStyleDisplay *disp = GetStyleDisplay();
   if (IsThemed(disp)) {
-    nsPresContext *presContext = GetPresContext();
+    nsPresContext *presContext = PresContext();
 
     nsMargin border;
     presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(),
                                              this, disp->mAppearance,
                                              &border);
     result.hBorder = presContext->DevPixelsToAppUnits(border.LeftRight());
 
     nsMargin padding;
@@ -3195,17 +3195,17 @@ nsFrame::ComputeSize(nsIRenderingContext
         result.height = minHeight;
     }
   }
 
   const nsStyleDisplay *disp = GetStyleDisplay();
   if (IsThemed(disp)) {
     nsSize size(0, 0);
     PRBool canOverride = PR_TRUE;
-    nsPresContext *presContext = GetPresContext();
+    nsPresContext *presContext = PresContext();
     presContext->GetTheme()->
       GetMinimumWidgetSize(aRenderingContext, this, disp->mAppearance,
                            &size, &canOverride);
 
     size.width = presContext->DevPixelsToAppUnits(size.width);
     size.height = presContext->DevPixelsToAppUnits(size.height);
 
     // GMWS() returns border-box; we need content-box
@@ -3533,17 +3533,17 @@ nsIntRect nsIFrame::GetScreenRect() cons
 
   if (view) {
     nsPoint toWidgetOffset(0,0);
     nsIWidget* widget = view->GetNearestWidget(&toWidgetOffset);
 
     if (widget) {
       nsRect ourRect = mRect;
       ourRect.MoveTo(toViewOffset + toWidgetOffset);
-      ourRect.ScaleRoundOut(1.0f / GetPresContext()->AppUnitsPerDevPixel());
+      ourRect.ScaleRoundOut(1.0f / PresContext()->AppUnitsPerDevPixel());
       // Is it safe to pass the same rect for both args of WidgetToScreen?
       // It's not clear, so let's not...
       nsIntRect ourPxRect(ourRect.x, ourRect.y, ourRect.width, ourRect.height);
       
       widget->WidgetToScreen(ourPxRect, retval);
     }
   }
 
@@ -3685,17 +3685,17 @@ nsIFrame::Invalidate(const nsRect& aDama
                      PRBool        aImmediate)
 {
   if (aDamageRect.IsEmpty()) {
     return;
   }
 
   // Don't allow invalidates to do anything when
   // painting is suppressed.
-  nsIPresShell *shell = GetPresContext()->GetPresShell();
+  nsIPresShell *shell = PresContext()->GetPresShell();
   if (shell) {
     PRBool suppressed = PR_FALSE;
     shell->IsPaintingSuppressed(&suppressed);
     if (suppressed)
       return;
   }
   
   InvalidateInternal(aDamageRect, 0, 0, nsnull, aImmediate);
@@ -4014,17 +4014,17 @@ nsIFrame::IsVisibleForPainting(nsDisplay
   return !sel || IsVisibleInSelection(sel);
 }
 
 PRBool
 nsIFrame::IsVisibleForPainting() {
   if (!GetStyleVisibility()->IsVisible())
     return PR_FALSE;
 
-  nsPresContext* pc = GetPresContext();
+  nsPresContext* pc = PresContext();
   if (!pc->IsRenderingOnlySelection())
     return PR_TRUE;
 
   nsCOMPtr<nsISelectionController> selcon(do_QueryInterface(pc->PresShell()));
   if (selcon) {
     nsCOMPtr<nsISelection> sel;
     selcon->GetSelection(nsISelectionController::SELECTION_NORMAL,
                          getter_AddRefs(sel));
@@ -4105,17 +4105,17 @@ nsFrameSelection* nsIFrame::GetFrameSele
   while (frame && (frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION)) {
     nsITextControlFrame *tcf;
     if (NS_SUCCEEDED(frame->QueryInterface(NS_GET_IID(nsITextControlFrame),(void**)&tcf))) {
       return tcf->GetOwnedFrameSelection();
     }
     frame = frame->GetParent();
   }
 
-  return GetPresContext()->PresShell()->FrameSelection();
+  return PresContext()->PresShell()->FrameSelection();
 }
 
 #ifdef NS_DEBUG
 NS_IMETHODIMP
 nsFrame::DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData)
 {
   IndentBy(out, aIndent);
   fprintf(out, "<frame va=\"%ld\" type=\"", PRUptrdiff(this));
@@ -4872,17 +4872,17 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct*
 
         int edgeCase = 0;//no edge case. this should look at thisLine
         
         PRBool doneLooping = PR_FALSE;//tells us when no more block frames hit.
         //this part will find a frame or a block frame. if it's a block frame
         //it will "drill down" to find a viable frame or it will return an error.
         nsIFrame *lastFrame = this;
         do {
-          result = nsFrame::GetNextPrevLineFromeBlockFrame(GetPresContext(),
+          result = nsFrame::GetNextPrevLineFromeBlockFrame(PresContext(),
                                                            aPos, 
                                                            blockFrame, 
                                                            thisLine, 
                                                            edgeCase //start from thisLine
             );
           if (NS_SUCCEEDED(result) && (!aPos->mResultFrame || aPos->mResultFrame == lastFrame))//we came back to same spot! keep going
           {
             aPos->mResultFrame = nsnull;
@@ -4967,17 +4967,17 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct*
       PRInt32 lineFrameCount;
       nsIFrame *firstFrame;
       nsRect usedRect;
       PRUint32 lineFlags;
       nsIFrame* baseFrame = nsnull;
       PRBool endOfLine = (eSelectEndLine == aPos->mAmount);
       
 #ifdef IBMBIDI
-      if (aPos->mVisual && GetPresContext()->BidiEnabled()) {
+      if (aPos->mVisual && PresContext()->BidiEnabled()) {
         PRBool lineIsRTL;
         it->GetDirection(&lineIsRTL);
         PRBool isReordered;
         nsIFrame *lastFrame;
         result = it->CheckLineOrder(thisLine, &isReordered, &firstFrame, &lastFrame);
         baseFrame = endOfLine ? lastFrame : firstFrame;
         nsBidiLevel embeddingLevel = nsBidiPresUtils::GetFrameEmbeddingLevel(baseFrame);
         // If the direction of the frame on the edge is opposite to that of the line,
@@ -5074,17 +5074,17 @@ nsFrame::CheckVisibility(nsPresContext* 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 
 PRInt32
 nsFrame::GetLineNumber(nsIFrame *aFrame, nsIFrame** aContainingBlock)
 {
   NS_ASSERTION(aFrame, "null aFrame");
-  nsFrameManager* frameManager = aFrame->GetPresContext()->FrameManager();
+  nsFrameManager* frameManager = aFrame->PresContext()->FrameManager();
   nsIFrame *blockFrame = aFrame;
   nsIFrame *thisBlock;
   PRInt32   thisLine;
   nsCOMPtr<nsILineIteratorNavigator> it; 
   nsresult result = NS_ERROR_FAILURE;
   while (NS_FAILED(result) && blockFrame)
   {
     thisBlock = blockFrame;
@@ -5115,17 +5115,17 @@ nsFrame::GetLineNumber(nsIFrame *aFrame,
 nsresult
 nsIFrame::GetFrameFromDirection(nsDirection aDirection, PRBool aVisual,
                                 PRBool aJumpLines, PRBool aScrollViewStop, 
                                 nsIFrame** aOutFrame, PRInt32* aOutOffset, PRBool* aOutJumpedLine)
 {  
   if (!aOutFrame || !aOutOffset || !aOutJumpedLine)
     return NS_ERROR_NULL_POINTER;
   
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   *aOutFrame = nsnull;
   *aOutOffset = 0;
   *aOutJumpedLine = PR_FALSE;
 
   // Find the prev/next selectable frame
   PRBool selectable = PR_FALSE;
   nsIFrame *traversedFrame = this;
   while (!selectable) {
@@ -5283,17 +5283,17 @@ DestroyRectFunc(void*    aFrame,
 
 nsRect*
 nsIFrame::GetOverflowAreaProperty(PRBool aCreateIfNecessary) 
 {
   if (!((GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) || aCreateIfNecessary)) {
     return nsnull;
   }
 
-  nsPropertyTable *propTable = GetPresContext()->PropertyTable();
+  nsPropertyTable *propTable = PresContext()->PropertyTable();
   void *value = propTable->GetProperty(this,
                                        nsGkAtoms::overflowAreaProperty);
 
   if (value) {
     return (nsRect*)value;  // the property already exists
   } else if (aCreateIfNecessary) {
     // The property isn't set yet, so allocate a new rect, set the property,
     // and return the newly allocated rect
@@ -5317,17 +5317,17 @@ nsIFrame::FinishAndStoreOverflow(nsRect*
   // we should think about starting a new method like GetAdditionalOverflow()
   NS_ASSERTION(aNewSize.width == 0 || aNewSize.height == 0 ||
                aOverflowArea->Contains(nsRect(nsPoint(0, 0), aNewSize)),
                "Computed overflow area must contain frame bounds");
 
   const nsStyleDisplay *disp = GetStyleDisplay();
   if (IsThemed(disp)) {
     nsRect r;
-    nsPresContext *presContext = GetPresContext();
+    nsPresContext *presContext = PresContext();
     if (presContext->GetTheme()->
           GetWidgetOverflow(presContext->DeviceContext(), this,
                             disp->mAppearance, &r)) {
       aOverflowArea->UnionRect(*aOverflowArea, r);
     }
   }
 
   PRBool geometricOverflow =
@@ -5630,43 +5630,43 @@ nsFrame::IsMouseCaptured(nsPresContext* 
 }
 
 nsresult
 nsIFrame::SetProperty(nsIAtom*           aPropName,
                       void*              aPropValue,
                       NSPropertyDtorFunc aPropDtorFunc,
                       void*              aDtorData)
 {
-  return GetPresContext()->PropertyTable()->
+  return PresContext()->PropertyTable()->
     SetProperty(this, aPropName, aPropValue, aPropDtorFunc, aDtorData);
 }
 
 void* 
 nsIFrame::GetProperty(nsIAtom* aPropName, nsresult* aStatus) const
 {
-  return GetPresContext()->PropertyTable()->GetProperty(this, aPropName,
+  return PresContext()->PropertyTable()->GetProperty(this, aPropName,
                                                         aStatus);
 }
 
 /* virtual */ void* 
 nsIFrame::GetPropertyExternal(nsIAtom* aPropName, nsresult* aStatus) const
 {
   return GetProperty(aPropName, aStatus);
 }
 
 nsresult
 nsIFrame::DeleteProperty(nsIAtom* aPropName) const
 {
-  return GetPresContext()->PropertyTable()->DeleteProperty(this, aPropName);
+  return PresContext()->PropertyTable()->DeleteProperty(this, aPropName);
 }
 
 void*
 nsIFrame::UnsetProperty(nsIAtom* aPropName, nsresult* aStatus) const
 {
-  return GetPresContext()->PropertyTable()->UnsetProperty(this, aPropName,
+  return PresContext()->PropertyTable()->UnsetProperty(this, aPropName,
                                                           aStatus);
 }
 
 /* virtual */ const nsStyleStruct*
 nsFrame::GetStyleDataExternal(nsStyleStructID aSID) const
 {
   NS_ASSERTION(mStyleContext, "unexpected null pointer");
   return mStyleContext->GetStyleData(aSID);
@@ -5682,17 +5682,17 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex
   PRBool isFocusable = PR_FALSE;
 
   if (mContent && mContent->IsNodeOfType(nsINode::eELEMENT) &&
       AreAncestorViewsVisible()) {
     const nsStyleVisibility* vis = GetStyleVisibility();
     if (vis->mVisible != NS_STYLE_VISIBILITY_COLLAPSE &&
         vis->mVisible != NS_STYLE_VISIBILITY_HIDDEN) {
       if (mContent->IsNodeOfType(nsINode::eHTML)) {
-        nsCOMPtr<nsISupports> container(GetPresContext()->GetContainer());
+        nsCOMPtr<nsISupports> container(PresContext()->GetContainer());
         nsCOMPtr<nsIEditorDocShell> editorDocShell(do_QueryInterface(container));
         if (editorDocShell) {
           PRBool isEditable;
           editorDocShell->GetEditable(&isEditable);
           if (isEditable) {
             return NS_OK;  // Editor content is not focusable
           }
         }
--- a/layout/generic/nsFrameFrame.cpp
+++ b/layout/generic/nsFrameFrame.cpp
@@ -226,17 +226,17 @@ nsSubDocumentFrame::Init(nsIContent*    
     nsCOMPtr<nsIDOMHTMLFrameElement> frameElem = do_QueryInterface(aContent);
     mIsInline = frameElem ? PR_FALSE : PR_TRUE;
   }
 
   nsresult rv =  nsLeafFrame::Init(aContent, aParent, aPrevInFlow);
   if (NS_FAILED(rv))
     return rv;
     
-  nsPresContext *aPresContext = GetPresContext();
+  nsPresContext *aPresContext = PresContext();
 
   // We are going to create an inner view.  If we need a view for the
   // OuterFrame but we wait for the normal view creation path in
   // nsCSSFrameConstructor, then we will lose because the inner view's
   // parent will already have been set to some outer view (e.g., the
   // canvas) when it really needs to have this frame's view as its
   // parent. So, create this frame's view right away, whether we
   // really need it or not, and the inner view will get it as the
--- a/layout/generic/nsFrameList.cpp
+++ b/layout/generic/nsFrameList.cpp
@@ -438,17 +438,17 @@ nsFrameList::GetPrevVisualFor(nsIFrame* 
   if (!mFirstChild)
     return nsnull;
   
   nsIFrame* parent = mFirstChild->GetParent();
   if (!parent)
     return aFrame ? GetPrevSiblingFor(aFrame) : LastChild();
 
   nsBidiLevel baseLevel = nsBidiPresUtils::GetFrameBaseLevel(mFirstChild);  
-  nsBidiPresUtils* bidiUtils = mFirstChild->GetPresContext()->GetBidiUtils();
+  nsBidiPresUtils* bidiUtils = mFirstChild->PresContext()->GetBidiUtils();
 
   nsresult result = parent->QueryInterface(NS_GET_IID(nsILineIterator), (void**)&iter);
   if (NS_FAILED(result) || !iter) { 
     // Parent is not a block Frame
     if (parent->GetType() == nsGkAtoms::lineFrame) {
       // Line frames are not bidi-splittable, so need to consider bidi reordering
       if (baseLevel == NSBIDI_LTR) {
         return bidiUtils->GetFrameToLeftOf(aFrame, mFirstChild, -1);
@@ -515,17 +515,17 @@ nsFrameList::GetNextVisualFor(nsIFrame* 
   if (!mFirstChild)
     return nsnull;
   
   nsIFrame* parent = mFirstChild->GetParent();
   if (!parent)
     return aFrame ? GetPrevSiblingFor(aFrame) : mFirstChild;
 
   nsBidiLevel baseLevel = nsBidiPresUtils::GetFrameBaseLevel(mFirstChild);
-  nsBidiPresUtils* bidiUtils = mFirstChild->GetPresContext()->GetBidiUtils();
+  nsBidiPresUtils* bidiUtils = mFirstChild->PresContext()->GetBidiUtils();
   
   nsresult result = parent->QueryInterface(NS_GET_IID(nsILineIterator), (void**)&iter);
   if (NS_FAILED(result) || !iter) { 
     // Parent is not a block Frame
     if (parent->GetType() == nsGkAtoms::lineFrame) {
       // Line frames are not bidi-splittable, so need to consider bidi reordering
       if (baseLevel == NSBIDI_LTR) {
         return bidiUtils->GetFrameToRightOf(aFrame, mFirstChild, -1);
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -316,17 +316,17 @@ nsHTMLFramesetFrame::Init(nsIContent*   
     if (frameset) {
       mTopLevelFrameset = frameset;
       parentFrame = parentFrame->GetParent();
     } else {
       break;
     }
   }
 
-  nsPresContext* aPresContext = GetPresContext();
+  nsPresContext* aPresContext = PresContext();
 
   // create the view. a view is needed since it needs to be a mouse grabber
   nsIViewManager* viewMan = aPresContext->GetViewManager();
 
   nsIView *parView = GetAncestorWithView()->GetView();
   nsRect boundBox(0, 0, 0, 0); 
   nsIView* view = viewMan->CreateView(boundBox, parView);
   if (!view)
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -247,17 +247,17 @@ struct ScrollReflowState {
   // Whether we decided to show the horizontal scrollbar
   PRPackedBool mShowHScrollbar;
   // Whether we decided to show the vertical scrollbar
   PRPackedBool mShowVScrollbar;
 
   ScrollReflowState(nsIScrollableFrame* aFrame,
                     const nsHTMLReflowState& aState) :
     mReflowState(aState),
-    mBoxState(aState.frame->GetPresContext(), aState.rendContext),
+    mBoxState(aState.frame->PresContext(), aState.rendContext),
     mStyles(aFrame->GetScrollbarStyles()) {
   }
 };
 
 // XXXldb Can this go away?
 static nsSize ComputeInsideBorderSize(ScrollReflowState* aState,
                                       const nsSize& aDesiredInsideBorderSize)
 {
@@ -422,17 +422,17 @@ nsHTMLScrollFrame::ReflowScrolledFrame(c
 
   if (aAssumeVScroll) {
     nsSize vScrollbarPrefSize = 
       mInner.mVScrollbarBox->GetPrefSize(NS_CONST_CAST(nsBoxLayoutState&, 
                                                        aState.mBoxState));
     availWidth = PR_MAX(0, availWidth - vScrollbarPrefSize.width);
   }
   // pixel align the content
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nscoord twp = nsPresContext::CSSPixelsToAppUnits(1);
   availWidth -=  availWidth % twp;
 
   if (!aFirstPass)
     mInner.mScrolledFrame->AddStateBits(NS_FRAME_IS_DIRTY);
 
   // We're forcing the padding on our scrolled frame, so let it know what that
   // padding is.
@@ -636,17 +636,17 @@ nsHTMLScrollFrame::PlaceScrollArea(const
   // This needs to happen before SyncFrameViewAfterReflow so
   // NS_FRAME_OUTSIDE_CHILDREN is set.
   scrolledFrame->FinishAndStoreOverflow(&scrolledArea,
                                         scrolledFrame->GetSize());
 
   // Note that making the view *exactly* the size of the scrolled area
   // is critical, since the view scrolling code uses the size of the
   // scrolled view to clamp scroll requests.
-  nsContainerFrame::SyncFrameViewAfterReflow(scrolledFrame->GetPresContext(),
+  nsContainerFrame::SyncFrameViewAfterReflow(scrolledFrame->PresContext(),
                                              scrolledFrame,
                                              scrolledView,
                                              &scrolledArea,
                                              NS_FRAME_NO_MOVE_VIEW);
 
   mInner.PostOverflowEvent();
 }
 
@@ -665,17 +665,17 @@ nsHTMLScrollFrame::GetPrefWidth(nsIRende
   DISPLAY_PREF_WIDTH(this, result);
   // XXX Might this make us count padding/border/margin twice?
   result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
                              mInner.mScrolledFrame, nsLayoutUtils::PREF_WIDTH);
 
   nsGfxScrollFrameInner::ScrollbarStyles ss = GetScrollbarStyles();
   if (ss.mVertical != NS_STYLE_OVERFLOW_HIDDEN && // ideal?
       mInner.mVScrollbarBox) {
-    nsBoxLayoutState bls(GetPresContext(), aRenderingContext);
+    nsBoxLayoutState bls(PresContext(), aRenderingContext);
     nsSize vScrollbarPrefSize(0, 0);
     GetScrollbarMetrics(bls, mInner.mVScrollbarBox,
                         nsnull, &vScrollbarPrefSize, PR_TRUE);
     result += vScrollbarPrefSize.width;
   }
 
   return result;
 }
@@ -1415,17 +1415,17 @@ nsGfxScrollFrameInner::GetParentViewForC
   return mOuter->GetView();
 }
 
 nsGfxScrollFrameInner::ScrollbarStyles
 nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
 {
   ScrollbarStyles result;
 
-  nsPresContext* presContext = mOuter->GetPresContext();
+  nsPresContext* presContext = mOuter->PresContext();
   if (!presContext->IsDynamic() &&
       !(mIsRoot && presContext->HasPaginatedScrolling())) {
     return ScrollbarStyles(NS_STYLE_OVERFLOW_HIDDEN, NS_STYLE_OVERFLOW_HIDDEN);
   }
 
   if (mIsRoot) {
     result = presContext->GetViewportOverflowOverride();
 
@@ -1509,17 +1509,17 @@ nsGfxScrollFrameInner::ScrollToRestoredP
     mLastPos.y = -1;
   }
 }
 
 nsresult
 nsGfxScrollFrameInner::FireScrollPortEvent()
 {
   mAsyncScrollPortEvent.Forget();
-  mOuter->GetPresContext()->GetPresShell()->
+  mOuter->PresContext()->GetPresShell()->
     FlushPendingNotifications(Flush_OnlyReflow);
   if (mAsyncScrollPortEvent.IsPending()) {
     return NS_OK;
   }
 
   nsSize scrollportSize = GetScrollPortSize();
   nsSize childSize = GetScrolledRect(scrollportSize).Size();
 
@@ -1560,17 +1560,17 @@ nsGfxScrollFrameInner::FireScrollPortEve
 
   nsScrollPortEvent event(PR_TRUE,
                           (orient == nsScrollPortEvent::horizontal ?
                            mHorizontalOverflow : mVerticalOverflow) ?
                             NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW,
                           nsnull);
   event.orient = orient;
   return nsEventDispatcher::Dispatch(mOuter->GetContent(),
-                                     mOuter->GetPresContext(), &event);
+                                     mOuter->PresContext(), &event);
 }
 
 void
 nsGfxScrollFrameInner::ReloadChildFrames()
 {
   mScrolledFrame = nsnull;
   mHScrollbarBox = nsnull;
   mVScrollbarBox = nsnull;
@@ -1603,17 +1603,17 @@ nsGfxScrollFrameInner::ReloadChildFrames
 
     frame = frame->GetNextSibling();
   }
 }
   
 nsresult
 nsGfxScrollFrameInner::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
 {
-  nsPresContext* presContext = mOuter->GetPresContext();
+  nsPresContext* presContext = mOuter->PresContext();
   nsIFrame* parent = mOuter->GetParent();
 
   // Don't create scrollbars if we're printing/print previewing
   // Get rid of this code when printing moves to its own presentation
   if (!presContext->IsDynamic()) {
     // allow scrollbars if this is the child of the viewport, because
     // we must be the scrollbars for the print preview window
     if (!(mIsRoot && presContext->HasPaginatedScrolling())) {
@@ -1706,17 +1706,17 @@ nsGfxScrollFrameInner::Destroy()
   // Unbind any content created in CreateAnonymousContent from the tree
   nsContentUtils::DestroyAnonymousContent(&mHScrollbarContent);
   nsContentUtils::DestroyAnonymousContent(&mVScrollbarContent);
   nsContentUtils::DestroyAnonymousContent(&mScrollCornerContent);
 
   mScrollEvent.Revoke();
   mAsyncScrollPortEvent.Revoke();
   if (mPostedReflowCallback) {
-    mOuter->GetPresContext()->PresShell()->CancelReflowCallback(this);
+    mOuter->PresContext()->PresShell()->CancelReflowCallback(this);
     mPostedReflowCallback = PR_FALSE;
   }
   nsIScrollableView *view = GetScrollableView();
   NS_ASSERTION(view, "unexpected null pointer");
   if (view)
     view->RemoveScrollPositionListener(this);
 }
 
@@ -1832,17 +1832,17 @@ void nsGfxScrollFrameInner::CurPosAttrib
 
       NS_ASSERTION(!mFrameInitiatedScroll, "Unexpected reentry");
       // Make sure we don't do anything in when the view calls us back
       // for this scroll operation.
       mFrameInitiatedScroll = PR_TRUE;
       InternalScrollPositionDidChange(curPosX, curPosY);
       mFrameInitiatedScroll = PR_FALSE;
     }
-    ScrollbarChanged(mOuter->GetPresContext(), x, y, isSmooth ? NS_VMREFRESH_SMOOTHSCROLL : 0);
+    ScrollbarChanged(mOuter->PresContext(), x, y, isSmooth ? NS_VMREFRESH_SMOOTHSCROLL : 0);
   }
 }
 
 /* ============= Scroll events ========== */
 
 NS_IMETHODIMP
 nsGfxScrollFrameInner::ScrollEvent::Run()
 {
@@ -1854,17 +1854,17 @@ nsGfxScrollFrameInner::ScrollEvent::Run(
 void
 nsGfxScrollFrameInner::FireScrollEvent()
 {
   mScrollEvent.Forget();
 
   nsScrollbarEvent event(PR_TRUE, NS_SCROLL_EVENT, nsnull);
   nsEventStatus status = nsEventStatus_eIgnore;
   nsIContent* content = mOuter->GetContent();
-  nsPresContext* prescontext = mOuter->GetPresContext();
+  nsPresContext* prescontext = mOuter->PresContext();
   // Fire viewport scroll events at the document (where they
   // will bubble to the window)
   if (mIsRoot) {
     nsIDocument* doc = content->GetCurrentDoc();
     if (doc) {
       nsEventDispatcher::Dispatch(doc, prescontext, &event, nsnull,  &status);
     }
   } else {
@@ -2042,17 +2042,17 @@ nsXULScrollFrame::LayoutScrollArea(nsBox
   if (childRect.width < aRect.width || childRect.height < aRect.height)
   {
     childRect.width = PR_MAX(childRect.width, aRect.width);
     childRect.height = PR_MAX(childRect.height, aRect.height);
 
     // remove overflow area when we update the bounds,
     // because we've already accounted for it
     mInner.mScrolledFrame->SetBounds(aState, childRect);
-    GetPresContext()->PropertyTable()->
+    PresContext()->PropertyTable()->
         DeleteProperty(mInner.mScrolledFrame, nsGkAtoms::overflowAreaProperty);
     mInner.mScrolledFrame->RemoveStateBits(NS_FRAME_OUTSIDE_CHILDREN);
   }
 
   aState.SetLayoutFlags(oldflags);
 
 }
 
@@ -2070,17 +2070,17 @@ PRBool
 nsGfxScrollFrameInner::IsLTR() const
 {
   //TODO make bidi code set these from preferences
 
   nsIFrame *frame = mOuter;
   // XXX This is a bit on the slow side.
   if (mIsRoot) {
     // If we're the root scrollframe, we need the root element's style data.
-    nsPresContext *presContext = mOuter->GetPresContext();
+    nsPresContext *presContext = mOuter->PresContext();
     nsIDocument *document = presContext->Document();
     nsIContent *root = document->GetRootContent();
 
     // But for HTML we want the body element.
     nsCOMPtr<nsIDOMHTMLDocument> htmlDoc = do_QueryInterface(document);
     if (htmlDoc && !document->IsCaseSensitive()) { // HTML, not XHTML
       nsCOMPtr<nsIDOMHTMLElement> body;
       htmlDoc->GetBody(getter_AddRefs(body));
@@ -2098,17 +2098,17 @@ nsGfxScrollFrameInner::IsLTR() const
   }
 
   return frame->GetStyleVisibility()->mDirection != NS_STYLE_DIRECTION_RTL;
 }
 
 PRBool
 nsGfxScrollFrameInner::IsScrollbarOnRight() const
 {
-  nsPresContext *presContext = mOuter->GetPresContext();
+  nsPresContext *presContext = mOuter->PresContext();
   switch (presContext->GetCachedIntPref(kPresContext_ScrollbarSide)) {
     default:
     case 0: // UI directionality
       return presContext->GetCachedIntPref(kPresContext_BidiDirection)
              == IBMBIDI_TEXTDIRECTION_LTR;
     case 1: // Document / content directionality
       return IsLTR();
     case 2: // Always right
@@ -2321,17 +2321,17 @@ nsGfxScrollFrameInner::FinishReflowForSc
 }
 
 PRBool
 nsGfxScrollFrameInner::ReflowFinished()
 {
   mPostedReflowCallback = PR_FALSE;
 
   // Update scrollbar attributes.
-  nsPresContext* presContext = mOuter->GetPresContext();
+  nsPresContext* presContext = mOuter->PresContext();
 
   nsIScrollableView* scrollable = GetScrollableView();
   nsRect scrollArea = scrollable->View()->GetBounds();
 
   const nsStyleFont* font = mOuter->GetStyleFont();
   const nsFont& f = font->mFont;
   nsCOMPtr<nsIFontMetrics> fm = presContext->GetMetricsFor(f);
   nscoord fontHeight = 1;
@@ -2597,17 +2597,17 @@ nsGfxScrollFrameInner::GetCoordAttribute
     }
   }
 
   return defaultValue;
 }
 
 static nsIURI* GetDocURI(nsIFrame* aFrame)
 {
-  nsIPresShell* shell = aFrame->GetPresContext()->GetPresShell();
+  nsIPresShell* shell = aFrame->PresContext()->GetPresShell();
   if (!shell)
     return nsnull;
   nsIDocument* doc = shell->GetDocument();
   if (!doc)
     return nsnull;
   return doc->GetDocumentURI();
 }
 
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -178,18 +178,18 @@ nsHTMLCanvasFrame::PaintCanvas(nsIRender
 {
   nsRect inner = GetInnerArea() + aPt;
 
   nsCOMPtr<nsICanvasElement> canvas(do_QueryInterface(GetContent()));
   if (!canvas)
     return;
 
   nsSize canvasSize = GetCanvasSize();
-  nsSize sizeAppUnits(GetPresContext()->DevPixelsToAppUnits(canvasSize.width),
-                      GetPresContext()->DevPixelsToAppUnits(canvasSize.height));
+  nsSize sizeAppUnits(PresContext()->DevPixelsToAppUnits(canvasSize.width),
+                      PresContext()->DevPixelsToAppUnits(canvasSize.height));
 
   // XXXvlad clip to aDirtyRect!
 
   if (inner.Size() != sizeAppUnits)
   {
     float sx = inner.width / (float) sizeAppUnits.width;
     float sy = inner.height / (float) sizeAppUnits.height;
 
--- a/layout/generic/nsHTMLContainerFrame.cpp
+++ b/layout/generic/nsHTMLContainerFrame.cpp
@@ -128,27 +128,27 @@ nsDisplayTextDecoration::Paint(nsDisplay
 }
 
 nsresult
 nsHTMLContainerFrame::DisplayTextDecorations(nsDisplayListBuilder* aBuilder,
                                              nsDisplayList* aBelowTextDecorations,
                                              nsDisplayList* aAboveTextDecorations,
                                              nsLineBox* aLine)
 {
-  if (eCompatibility_NavQuirks == GetPresContext()->CompatibilityMode())
+  if (eCompatibility_NavQuirks == PresContext()->CompatibilityMode())
     return NS_OK;
   if (!IsVisibleForPainting(aBuilder))
     return NS_OK;
   
   // Do standards mode painting of 'text-decoration's: under+overline
   // behind children, line-through in front.  For Quirks mode, see
   // nsTextFrame::PaintTextDecorations.  (See bug 1777.)
   nscolor underColor, overColor, strikeColor;
   PRUint8 decorations = NS_STYLE_TEXT_DECORATION_NONE;
-  GetTextDecorations(GetPresContext(), aLine != nsnull, decorations, underColor, 
+  GetTextDecorations(PresContext(), aLine != nsnull, decorations, underColor, 
                      overColor, strikeColor);
 
   if (decorations & NS_STYLE_TEXT_DECORATION_UNDERLINE) {
     nsresult rv = aBelowTextDecorations->AppendNewToTop(new (aBuilder)
       nsDisplayTextDecoration(this, NS_STYLE_TEXT_DECORATION_UNDERLINE, underColor, aLine));
     NS_ENSURE_SUCCESS(rv, rv);
   }
   if (decorations & NS_STYLE_TEXT_DECORATION_OVERLINE) {
@@ -549,17 +549,17 @@ nsHTMLContainerFrame::CreateViewForFrame
   nsIViewManager* viewManager = parentView->GetViewManager();
   NS_ASSERTION(viewManager, "null view manager");
     
   // Create a view
   nsIView* view = viewManager->CreateView(aFrame->GetRect(), parentView);
   if (!view)
     return NS_ERROR_OUT_OF_MEMORY;
 
-  SyncFrameViewProperties(aFrame->GetPresContext(), aFrame, nsnull, view);
+  SyncFrameViewProperties(aFrame->PresContext(), aFrame, nsnull, view);
 
   // Insert the view into the view hierarchy. If the parent view is a
   // scrolling view we need to do this differently
   nsIScrollableView*  scrollingView = parentView->ToScrollableView();
   if (scrollingView) {
     scrollingView->SetScrolledView(view);
   } else {
     nsIView* insertBefore = nsLayoutUtils::FindSiblingViewFor(parentView, aFrame);
--- a/layout/generic/nsHTMLFrame.cpp
+++ b/layout/generic/nsHTMLFrame.cpp
@@ -183,17 +183,17 @@ CanvasFrame::QueryInterface(const nsIID&
 
 NS_IMETHODIMP
 CanvasFrame::Init(nsIContent*      aContent,
                   nsIFrame*        aParent,
                   nsIFrame*        aPrevInFlow)
 {
   nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
 
-  mViewManager = GetPresContext()->GetViewManager();
+  mViewManager = PresContext()->GetViewManager();
 
   nsIScrollableView* scrollingView = nsnull;
   mViewManager->GetRootScrollableView(&scrollingView);
   if (scrollingView) {
     scrollingView->AddScrollPositionListener(this);
   }
 
   return rv;
@@ -245,17 +245,17 @@ CanvasFrame::ScrollPositionDidChange(nsI
   return NS_OK;
 }
 
 NS_IMETHODIMP
 CanvasFrame::SetHasFocus(PRBool aHasFocus)
 {
   if (mDoPaintFocus != aHasFocus) {
     mDoPaintFocus = aHasFocus;
-    nsIViewManager* vm = GetPresContext()->PresShell()->GetViewManager();
+    nsIViewManager* vm = PresContext()->PresShell()->GetViewManager();
     if (vm) {
       vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -276,17 +276,17 @@ CanvasFrame::AppendFrames(nsIAtom*      
 
   } else {
     // Insert the new frames
 #ifdef NS_DEBUG
     nsFrame::VerifyDirtyBitSet(aFrameList);
 #endif
     mFrames.AppendFrame(nsnull, aFrameList);
 
-    rv = GetPresContext()->PresShell()->
+    rv = PresContext()->PresShell()->
            FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
 CanvasFrame::InsertFrames(nsIAtom*        aListName,
@@ -324,17 +324,17 @@ CanvasFrame::RemoveFrame(nsIAtom*       
     // The child of the canvas probably can't have an outline, but why bother
     // thinking about that?
     Invalidate(aOldFrame->GetOverflowRect() + aOldFrame->GetPosition(), PR_FALSE);
 
     // Remove the frame and destroy it
     mFrames.DestroyFrame(aOldFrame);
 
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    rv = GetPresContext()->PresShell()->
+    rv = PresContext()->PresShell()->
            FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   } else {
     rv = NS_ERROR_FAILURE;
   }
 
   return rv;
 }
 
@@ -370,17 +370,17 @@ public:
   }
 
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
   {
     CanvasFrame* frame = NS_STATIC_CAST(CanvasFrame*, mFrame);
     nsPoint offset = aBuilder->ToReferenceFrame(mFrame);
     nsRect bgClipRect = frame->CanvasArea() + offset;
-    nsCSSRendering::PaintBackground(mFrame->GetPresContext(), *aCtx, mFrame,
+    nsCSSRendering::PaintBackground(mFrame->PresContext(), *aCtx, mFrame,
                                     aDirtyRect,
                                     nsRect(offset, mFrame->GetSize()),
                                     *mFrame->GetStyleBorder(),
                                     *mFrame->GetStylePadding(),
                                     mFrame->HonorPrintBackgroundSettings(),
                                     &bgClipRect);
   }
 
@@ -486,17 +486,17 @@ CanvasFrame::PaintFocus(nsIRenderingCont
     focusRect.width = vcr.width;
     focusRect.height = vcr.height;
     nscoord x,y;
     scrollableView->GetScrollPosition(x, y);
     focusRect.x += x;
     focusRect.y += y;
   }
 
-  nsStyleOutline outlineStyle(GetPresContext());
+  nsStyleOutline outlineStyle(PresContext());
   outlineStyle.SetOutlineStyle(NS_STYLE_BORDER_STYLE_DOTTED);
   outlineStyle.SetOutlineInitialColor();
 
  // XXX use the root frame foreground color, but should we find BODY frame
  // for HTML documents?
   nsIFrame* root = mFrames.FirstChild();
   const nsStyleColor* color =
     root ? root->GetStyleContext()->GetStyleColor() :
--- a/layout/generic/nsHTMLReflowState.cpp
+++ b/layout/generic/nsHTMLReflowState.cpp
@@ -216,17 +216,17 @@ nsHTMLReflowState::SetComputedWidth(nsco
   //    frame's own reflow state.  So given a nsBoxFrame inside some non-XUL
   //    (like a text control, for example), we'll end up creating a reflow
   //    state for the parent while the parent is reflowing.
 
   nscoord oldComputedWidth = mComputedWidth;
   mComputedWidth = aComputedWidth;
   if (mComputedWidth != oldComputedWidth &&
       frame->GetType() != nsGkAtoms::viewportFrame) {  // Or check GetParent()?
-    InitResizeFlags(frame->GetPresContext());
+    InitResizeFlags(frame->PresContext());
   }
 }
 
 void
 nsHTMLReflowState::Init(nsPresContext* aPresContext,
                         nscoord         aContainingBlockWidth,
                         nscoord         aContainingBlockHeight,
                         const nsMargin* aBorder,
@@ -1681,17 +1681,17 @@ nsCSSOffsetState::InitOffsets(nscoord aC
   // Compute margins from the specified margin style information. These
   // become the default computed values, and may be adjusted below
   // XXX fix to provide 0,0 for the top&bottom margins for
   // inline-non-replaced elements
   ComputeMargin(aContainingBlockWidth);
 
   const nsStyleDisplay *disp = frame->GetStyleDisplay();
   PRBool isThemed = frame->IsThemed(disp);
-  nsPresContext *presContext = frame->GetPresContext();
+  nsPresContext *presContext = frame->PresContext();
 
   if (isThemed &&
       presContext->GetTheme()->GetWidgetPadding(presContext->DeviceContext(),
                                                 frame, disp->mAppearance,
                                                 &mComputedPadding)) {
     mComputedPadding.top = presContext->DevPixelsToAppUnits(mComputedPadding.top);
     mComputedPadding.right = presContext->DevPixelsToAppUnits(mComputedPadding.right);
     mComputedPadding.bottom = presContext->DevPixelsToAppUnits(mComputedPadding.bottom);
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -399,17 +399,17 @@ typedef PRBool nsDidReflowStatus;
  * If you're not in layout but you must call functions in here, at least
  * restrict yourself to calling virtual methods, which won't hurt you as badly.
  */
 class nsIFrame : public nsISupports
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAME_IID)
 
-  nsPresContext* GetPresContext() const {
+  nsPresContext* PresContext() const {
     return GetStyleContext()->GetRuleNode()->GetPresContext();
   }
 
   /**
    * Called to initialize the frame. This is called immediately after creating
    * the frame.
    *
    * If the frame is a continuing frame, then aPrevInFlow indicates the previous
@@ -770,17 +770,17 @@ public:
                         const nsDisplayListSet&     aLists);
 
   PRBool IsThemed() {
     return IsThemed(GetStyleDisplay());
   }
   PRBool IsThemed(const nsStyleDisplay* aDisp) {
     if (!aDisp->mAppearance)
       return PR_FALSE;
-    nsPresContext* pc = GetPresContext();
+    nsPresContext* pc = PresContext();
     nsITheme *theme = pc->GetTheme();
     return theme && theme->ThemeSupportsWidget(pc, this, aDisp->mAppearance);
   }
   
   /**
    * Builds a display list for the content represented by this frame,
    * treating this frame as the root of a stacking context.
    * @param aDirtyRect content outside this rectangle can be ignored; the
@@ -2078,17 +2078,17 @@ public:
   nsIFrame* GetFrame() { return mFrame; }
 
   nsWeakFrame* GetPreviousWeakFrame() { return mPrev; }
 
   void SetPreviousWeakFrame(nsWeakFrame* aPrev) { mPrev = aPrev; }
 
   ~nsWeakFrame()
   {
-    Clear(mFrame ? mFrame->GetPresContext()->GetPresShell() : nsnull);
+    Clear(mFrame ? mFrame->PresContext()->GetPresShell() : nsnull);
   }
 private:
   void Init(nsIFrame* aFrame);
 
   nsWeakFrame*  mPrev;
   nsIFrame*     mFrame;
 };
 
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -275,17 +275,17 @@ nsImageFrame::Init(nsIContent*      aCon
 
   mListener = new nsImageListener(this);
   if (!mListener) return NS_ERROR_OUT_OF_MEMORY;
 
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(aContent);
   NS_ENSURE_TRUE(imageLoader, NS_ERROR_UNEXPECTED);
   imageLoader->AddObserver(mListener);
 
-  nsPresContext *aPresContext = GetPresContext();
+  nsPresContext *aPresContext = PresContext();
   
   if (!gIconLoad)
     LoadIcons(aPresContext);
 
   // Give image loads associated with an image frame a small priority boost!
   nsCOMPtr<imgIRequest> currentRequest;
   imageLoader->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
                           getter_AddRefs(currentRequest));
@@ -511,17 +511,17 @@ nsImageFrame::OnStartContainer(imgIReque
     return NS_OK;
   }
 
   /* Get requested animation policy from the pres context:
    *   normal = 0
    *   one frame = 1
    *   one loop = 2
    */
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   aImage->SetAnimationMode(presContext->ImageAnimationMode());
   // Ensure the animation (if any) is started.
   aImage->StartAnimation();
 
   if (IsPendingLoad(aRequest)) {
     // We don't care
     return NS_OK;
   }
@@ -599,17 +599,17 @@ nsImageFrame::OnDataAvailable(imgIReques
   return NS_OK;
 }
 
 nsresult
 nsImageFrame::OnStopDecode(imgIRequest *aRequest,
                            nsresult aStatus,
                            const PRUnichar *aStatusArg)
 {
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsIPresShell *presShell = presContext->GetPresShell();
   NS_ASSERTION(presShell, "No PresShell.");
 
   // handle iconLoads first...
   if (HandleIconLoads(aRequest, NS_SUCCEEDED(aStatus))) {
     return NS_OK;
   }
 
@@ -713,17 +713,17 @@ nsImageFrame::EnsureIntrinsicSize(nsPres
 }
 
 /* virtual */ nsSize
 nsImageFrame::ComputeSize(nsIRenderingContext *aRenderingContext,
                           nsSize aCBSize, nscoord aAvailableWidth,
                           nsSize aMargin, nsSize aBorder, nsSize aPadding,
                           PRBool aShrinkWrap)
 {
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   EnsureIntrinsicSize(presContext);
 
   return nsLayoutUtils::ComputeSizeWithIntrinsicDimensions(
                             aRenderingContext, this,
                             mIntrinsicSize,
                             aCBSize, aBorder, aPadding);
 }
 
@@ -747,30 +747,30 @@ nsImageFrame::GetContinuationOffset() co
 
 /* virtual */ nscoord
 nsImageFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
 {
   // XXX The caller doesn't account for constraints of the height,
   // min-height, and max-height properties.
   nscoord result;
   DISPLAY_MIN_WIDTH(this, result);
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   EnsureIntrinsicSize(presContext);
   result = mIntrinsicSize.width;
   return result;
 }
 
 /* virtual */ nscoord
 nsImageFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
 {
   // XXX The caller doesn't account for constraints of the height,
   // min-height, and max-height properties.
   nscoord result;
   DISPLAY_PREF_WIDTH(this, result);
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   EnsureIntrinsicSize(presContext);
   // convert from normal twips to scaled twips (printing...)
   result = mIntrinsicSize.width;
   return result;
 }
 
 NS_IMETHODIMP
 nsImageFrame::Reflow(nsPresContext*          aPresContext,
@@ -1032,18 +1032,18 @@ nsImageFrame::DisplayAltFeedback(nsIRend
 
   // Make sure we have enough room to actually render the border within
   // our frame bounds
   if ((inner.width < 2 * borderEdgeWidth) || (inner.height < 2 * borderEdgeWidth)) {
     return;
   }
 
   // Paint the border
-  nsRecessedBorder recessedBorder(borderEdgeWidth, GetPresContext());
-  nsCSSRendering::PaintBorder(GetPresContext(), aRenderingContext, this, inner,
+  nsRecessedBorder recessedBorder(borderEdgeWidth, PresContext());
+  nsCSSRendering::PaintBorder(PresContext(), aRenderingContext, this, inner,
                               inner, recessedBorder, mStyleContext, 0);
 
   // Adjust the inner rect to account for the one pixel recessed border,
   // and a six pixel padding on each edge
   inner.Deflate(nsPresContext::CSSPixelsToAppUnits(ICON_PADDING+ALT_BORDER_WIDTH), 
                 nsPresContext::CSSPixelsToAppUnits(ICON_PADDING+ALT_BORDER_WIDTH));
   if (inner.IsEmpty()) {
     return;
@@ -1103,17 +1103,17 @@ nsImageFrame::DisplayAltFeedback(nsIRend
 
   // If there's still room, display the alt-text
   if (!inner.IsEmpty()) {
     nsIContent* content = GetContent();
     if (content) {
       nsXPIDLString altText;
       nsCSSFrameConstructor::GetAlternateTextFor(content, content->Tag(),
                                                  altText);
-      DisplayAltText(GetPresContext(), aRenderingContext, altText, inner);
+      DisplayAltText(PresContext(), aRenderingContext, altText, inner);
     }
   }
 
   aRenderingContext.PopState();
 }
 
 static void PaintAltFeedback(nsIFrame* aFrame, nsIRenderingContext* aCtx,
      const nsRect& aDirtyRect, nsPoint aPt)
@@ -1127,17 +1127,17 @@ static void PaintAltFeedback(nsIFrame* a
                         aPt);
 }
 
 #ifdef NS_DEBUG
 static void PaintDebugImageMap(nsIFrame* aFrame, nsIRenderingContext* aCtx,
      const nsRect& aDirtyRect, nsPoint aPt) {
   nsImageFrame* f = NS_STATIC_CAST(nsImageFrame*, aFrame);
   nsRect inner = f->GetInnerArea() + aPt;
-  nsPresContext* pc = f->GetPresContext();
+  nsPresContext* pc = f->PresContext();
 
   aCtx->SetColor(NS_RGB(0, 0, 0));
   aCtx->PushState();
   aCtx->Translate(inner.x, inner.y);
   f->GetImageMap(pc)->Draw(pc, *aCtx);
   aCtx->PopState();
 }
 #endif
@@ -1182,17 +1182,17 @@ nsImageFrame::PaintImage(nsIRenderingCon
   nsRect clip;
   clip.IntersectRect(inner, aDirtyRect);
 
   nsRect dest(inner.TopLeft(), mComputedSize);
   dest.y -= GetContinuationOffset();
 
   nsLayoutUtils::DrawImage(&aRenderingContext, aImage, dest, clip);
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsImageMap* map = GetImageMap(presContext);
   if (nsnull != map) {
     aRenderingContext.PushState();
     aRenderingContext.SetColor(NS_RGB(0, 0, 0));
     aRenderingContext.SetLineStyle(nsLineStyle_kDotted);
     aRenderingContext.Translate(inner.x, inner.y);
     map->Draw(presContext, aRenderingContext);
     aRenderingContext.PopState();
@@ -1243,29 +1243,29 @@ nsImageFrame::BuildDisplayList(nsDisplay
       NS_ENSURE_SUCCESS(rv, rv);
     }
     else {
       rv = aLists.Content()->AppendNewToTop(new (aBuilder)
           nsDisplayImage(this, imgCon));
       NS_ENSURE_SUCCESS(rv, rv);
         
 #ifdef DEBUG
-      if (GetShowFrameBorders() && GetImageMap(GetPresContext())) {
+      if (GetShowFrameBorders() && GetImageMap(PresContext())) {
         rv = aLists.Outlines()->AppendNewToTop(new (aBuilder)
             nsDisplayGeneric(this, PaintDebugImageMap, "DebugImageMap"));
         NS_ENSURE_SUCCESS(rv, rv);
       }
 #endif
     }
   }
 
   // XXX what on EARTH is this code for?
   PRInt16 displaySelection = 0;
   nsresult result;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   result = presContext->PresShell()->GetSelectionFlags(&displaySelection);
   if (NS_FAILED(result))
     return result;
   if (!(displaySelection & nsISelectionDisplay::DISPLAY_IMAGES))
     return NS_OK;//no need to check the blue border, we cannot be drawn selected
 //insert hook here for image selection drawing
 #if IMAGE_EDITOR_CHECK
   //check to see if this frame is in an editor context
@@ -1531,30 +1531,30 @@ nsImageFrame::HandleEvent(nsPresContext*
 
   return nsSplittableFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
 }
 
 NS_IMETHODIMP
 nsImageFrame::GetCursor(const nsPoint& aPoint,
                         nsIFrame::Cursor& aCursor)
 {
-  nsPresContext* context = GetPresContext();
+  nsPresContext* context = PresContext();
   nsImageMap* map = GetImageMap(context);
   if (nsnull != map) {
     nsIntPoint p;
     TranslateEventCoords(aPoint, p);
     nsCOMPtr<nsIContent> area;
     if (map->IsInside(p.x, p.y, getter_AddRefs(area))) {
       // Use the cursor from the style of the *area* element.
       // XXX Using the image as the parent style context isn't
       // technically correct, but it's probably the right thing to do
       // here, since it means that areas on which the cursor isn't
       // specified will inherit the style from the image.
       nsRefPtr<nsStyleContext> areaStyle = 
-        GetPresContext()->PresShell()->StyleSet()->
+        PresContext()->PresShell()->StyleSet()->
           ResolveStyleFor(area, GetStyleContext());
       if (areaStyle) {
         FillCursorInformationFromStyle(areaStyle->GetStyleUserInterface(),
                                        aCursor);
         if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
           aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
         }
         return NS_OK;
@@ -1572,17 +1572,17 @@ nsImageFrame::AttributeChanged(PRInt32 a
   nsresult rv = nsSplittableFrame::AttributeChanged(aNameSpaceID,
                                                     aAttribute, aModType);
   if (NS_FAILED(rv)) {
     return rv;
   }
   if (nsGkAtoms::alt == aAttribute)
   {
     AddStateBits(NS_FRAME_IS_DIRTY);
-    GetPresContext()->PresShell()->FrameNeedsReflow(
+    PresContext()->PresShell()->FrameNeedsReflow(
                                        NS_STATIC_CAST(nsIFrame*, this),
                                        nsIPresShell::eStyleChange);
   }
 
   return NS_OK;
 }
 
 nsIAtom*
--- a/layout/generic/nsLineBox.cpp
+++ b/layout/generic/nsLineBox.cpp
@@ -708,17 +708,17 @@ nsLineIterator::CheckLineOrder(PRInt32  
 
   if (!line->mFirstChild) { // empty line
     *aIsReordered = PR_FALSE;
     *aFirstVisual = nsnull;
     *aLastVisual = nsnull;
     return NS_OK;
   }
   
-  nsPresContext* presContext = line->mFirstChild->GetPresContext();
+  nsPresContext* presContext = line->mFirstChild->PresContext();
 
   nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
 
   nsIFrame* leftmostFrame;
   nsIFrame* rightmostFrame;
   *aIsReordered = bidiUtils->CheckLineOrder(line->mFirstChild, line->GetChildCount(), &leftmostFrame, &rightmostFrame);
 
   // map leftmost/rightmost to first/last according to paragraph direction
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -749,25 +749,25 @@ nsObjectFrame::InstantiatePlugin(nsIPlug
 
   if (appShell) {
     appShell->ResumeNative();
   }
 
   // XXX having to do this sucks. it'd be better to move the code from DidReflow
   // to FixupWindow or something.
   AddStateBits(NS_FRAME_IS_DIRTY);
-  GetPresContext()->GetPresShell()->
+  PresContext()->GetPresShell()->
     FrameNeedsReflow(this, nsIPresShell::eStyleChange);
   return rv;
 }
 
 void
 nsObjectFrame::FixupWindow(const nsSize& aSize)
 {
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   if (!mInstanceOwner)
     return;
 
   nsPluginWindow  *window;
   mInstanceOwner->GetWindow(window);
 
   NS_ENSURE_TRUE(window, /**/);
@@ -852,18 +852,18 @@ nsPoint nsObjectFrame::GetWindowOriginIn
       if (theView->GetViewManager() != parentVM)
         break;
 
       origin += theView->GetPosition();
       theView = theView->GetParent();
     }  
   }
 
-  origin.x = GetPresContext()->AppUnitsToDevPixels(origin.x);
-  origin.y = GetPresContext()->AppUnitsToDevPixels(origin.y);
+  origin.x = PresContext()->AppUnitsToDevPixels(origin.x);
+  origin.y = PresContext()->AppUnitsToDevPixels(origin.y);
 
   return origin;
 }
 
 NS_IMETHODIMP
 nsObjectFrame::DidReflow(nsPresContext*            aPresContext,
                          const nsHTMLReflowState*  aReflowState,
                          nsDidReflowStatus         aStatus)
@@ -943,17 +943,17 @@ nsObjectFrame::BuildDisplayList(nsDispla
 {
   // XXX why are we painting collapsed object frames?
   if (!IsVisibleOrCollapsedForPainting(aBuilder))
     return NS_OK;
     
   nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
   NS_ENSURE_SUCCESS(rv, rv);
   
-  nsPresContext::nsPresContextType type = GetPresContext()->Type();
+  nsPresContext::nsPresContextType type = PresContext()->Type();
 
   // If we are painting in Print Preview do nothing....
   if (type == nsPresContext::eContext_PrintPreview)
     return NS_OK;
 
   DO_GLOBAL_REFLOW_COUNT_DSP("nsObjectFrame");
   
   // determine if we are printing
@@ -983,17 +983,17 @@ nsObjectFrame::PrintPlugin(nsIRenderingC
   if (!shell)
     return;
 
   // then the shell can give us the screen frame for this content node
   nsIFrame* frame = shell->GetPrimaryFrameFor(mContent);
   if (!frame)
     return;
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   // make sure this is REALLY an nsIObjectFrame
   // we may need to go through the children to get it
   nsIObjectFrame* objectFrame = nsnull;
   CallQueryInterface(frame,&objectFrame);
   if (!objectFrame)
     objectFrame = GetNextObjectFrame(presContext,frame);
   if (!objectFrame)
     return;
@@ -1291,17 +1291,17 @@ nsObjectFrame::PrepareInstanceOwner()
 
   NS_ASSERTION(!mInstanceOwner, "Must not have an instance owner here");
 
   mInstanceOwner = new nsPluginInstanceOwner();
   if (!mInstanceOwner)
     return NS_ERROR_OUT_OF_MEMORY;
 
   NS_ADDREF(mInstanceOwner);
-  mInstanceOwner->Init(GetPresContext(), this, GetContent());
+  mInstanceOwner->Init(PresContext(), this, GetContent());
   return NS_OK;
 }
 
 nsresult
 nsObjectFrame::Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamListener)
 {
   nsresult rv = PrepareInstanceOwner();
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1313,17 +1313,17 @@ nsObjectFrame::Instantiate(nsIChannel* a
 
   // This must be done before instantiating the plugin
   FixupWindow(mRect.Size());
 
   rv = pluginHost->InstantiatePluginForChannel(aChannel, mInstanceOwner, aStreamListener);
 
   // XXX having to do this sucks. it'd be better to move the code from DidReflow
   // to FixupWindow.
-  GetPresContext()->GetPresShell()->
+  PresContext()->GetPresShell()->
     FrameNeedsReflow(this, nsIPresShell::eStyleChange);
   return rv;
 }
 
 nsresult
 nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI)
 {
   NS_ASSERTION(aMimeType || aURI, "Need a type or a URI!");
@@ -1732,17 +1732,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Get
 }
 
 NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarget, void *aPostData, PRUint32 aPostDataLen, void *aHeadersData, 
                                             PRUint32 aHeadersDataLen, PRBool isFile)
 {
   NS_ENSURE_TRUE(mOwner,NS_ERROR_NULL_POINTER);
 
   // the container of the pres context will give us the link handler
-  nsCOMPtr<nsISupports> container = mOwner->GetPresContext()->GetContainer();
+  nsCOMPtr<nsISupports> container = mOwner->PresContext()->GetContainer();
   NS_ENSURE_TRUE(container,NS_ERROR_FAILURE);
   nsCOMPtr<nsILinkHandler> lh = do_QueryInterface(container);
   NS_ENSURE_TRUE(lh, NS_ERROR_FAILURE);
 
   nsAutoString  unitarget;
   unitarget.AssignASCII(aTarget); // XXX could this be nonascii?
 
   nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
@@ -1799,17 +1799,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Sho
 
 NS_IMETHODIMP nsPluginInstanceOwner::ShowStatus(const PRUnichar *aStatusMsg)
 {
   nsresult  rv = NS_ERROR_FAILURE;
 
   if (!mOwner) {
     return rv;
   }
-  nsCOMPtr<nsISupports> cont = mOwner->GetPresContext()->GetContainer();
+  nsCOMPtr<nsISupports> cont = mOwner->PresContext()->GetContainer();
   if (!cont) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> docShellItem(do_QueryInterface(cont, &rv));
   if (NS_FAILED(rv) || !docShellItem) {
     return rv;
   }
@@ -1845,17 +1845,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Inv
 {
   nsresult rv = NS_ERROR_FAILURE;
 
   if (mOwner && invalidRect) {
     //no reference count on view
     nsIView* view = mOwner->GetView();
 
     if (view) {
-      nsPresContext* presContext = mOwner->GetPresContext();
+      nsPresContext* presContext = mOwner->PresContext();
 
       nsRect rect(presContext->DevPixelsToAppUnits(invalidRect->left),
             presContext->DevPixelsToAppUnits(invalidRect->top),
             presContext->DevPixelsToAppUnits(invalidRect->right - invalidRect->left),
             presContext->DevPixelsToAppUnits(invalidRect->bottom - invalidRect->top));
 
       //set flags to not do a synchronous update, force update does the redraw
       view->GetViewManager()->UpdateView(view, rect, NS_VMREFRESH_NO_SYNC);
@@ -1884,17 +1884,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Get
 {
   nsresult rv = NS_ERROR_FAILURE;
 
   switch(variable) {
     case nsPluginInstancePeerVariable_NetscapeWindow:
     {      
       if (mOwner) {
         void** pvalue = (void**)value;
-        nsIViewManager* vm = mOwner->GetPresContext()->GetViewManager();
+        nsIViewManager* vm = mOwner->PresContext()->GetViewManager();
         if (vm) {
 #if defined(XP_WIN)
           // This property is provided to allow a "windowless" plugin to determine the window it is drawing
           // in, so it can translate mouse coordinates it receives directly from the operating system
           // to coordinates relative to itself.
         
           // The original code (outside this #if) returns the document's window, which is OK if the window the "windowless" plugin
           // is drawing into has the same origin as the document's window, but this is not the case for "windowless" plugins inside of scrolling DIVs etc
@@ -2575,17 +2575,17 @@ NPDrawingModel nsPluginInstanceOwner::Ge
   mInstance->GetValue(nsPluginInstanceVariable_DrawingModel,
                       (void *)&drawingModel);
 
   return drawingModel;
 }
 
 void nsPluginInstanceOwner::GUItoMacEvent(const nsGUIEvent& anEvent, EventRecord* origEvent, EventRecord& aMacEvent)
 {
-  nsPresContext* presContext = mOwner ? mOwner->GetPresContext() : nsnull;
+  nsPresContext* presContext = mOwner ? mOwner->PresContext() : nsnull;
   InitializeEventRecord(&aMacEvent);
   switch (anEvent.message) {
     case NS_FOCUS_EVENT_START:   // this is the same as NS_FOCUS_CONTENT
         aMacEvent.what = nsPluginEventType_GetFocusEvent;
         if (presContext) {
             nsIContent* content = mContent;
             if (content)
                 content->SetFocus(presContext);
@@ -2893,17 +2893,17 @@ nsPluginInstanceOwner::MouseDown(nsIDOME
     return aMouseEvent->PreventDefault(); // consume event
   // continue only for cases without child window
 #endif
 
   // if the plugin is windowless, we need to set focus ourselves
   // otherwise, we might not get key events
   if (mOwner && mPluginWindow &&
       mPluginWindow->type == nsPluginWindowType_Drawable) {
-    mContent->SetFocus(mOwner->GetPresContext());
+    mContent->SetFocus(mOwner->PresContext());
   }
 
   nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aMouseEvent));
   if (privateEvent) {
     nsMouseEvent* mouseEvent = nsnull;
     privateEvent->GetInternalNSEvent((nsEvent**)&mouseEvent);
     if (mouseEvent) {
       nsEventStatus rv = ProcessEvent(*mouseEvent);
@@ -3165,17 +3165,17 @@ void nsPluginInstanceOwner::Paint(const 
   }
 #endif
 
 #ifdef XP_WIN
   nsPluginWindow * window;
   GetWindow(window);
   nsRect relDirtyRect = nsRect(aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height);
   nsRect relDirtyRectInPixels;
-  ConvertAppUnitsToPixels(*mOwner->GetPresContext(), relDirtyRect,
+  ConvertAppUnitsToPixels(*mOwner->PresContext(), relDirtyRect,
                           relDirtyRectInPixels);
 
   // we got dirty rectangle in relative window coordinates, but we
   // need it in absolute units and in the (left, top, right, bottom) form
   RECT drc;
   drc.left   = relDirtyRectInPixels.x + window->x;
   drc.top    = relDirtyRectInPixels.y + window->y;
   drc.right  = drc.left + relDirtyRectInPixels.width;
@@ -3356,17 +3356,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Cre
 
     if (!view || !mWidget) {
       PRBool windowless = PR_FALSE;
 
       mInstance->GetValue(nsPluginInstanceVariable_WindowlessBool,
                           (void *)&windowless);
 
       // always create widgets in Twips, not pixels
-      nsPresContext* context = mOwner->GetPresContext();
+      nsPresContext* context = mOwner->PresContext();
       rv = mOwner->CreateWidget(context->DevPixelsToAppUnits(mPluginWindow->width),
                                 context->DevPixelsToAppUnits(mPluginWindow->height),
                                 windowless);
       if (NS_OK == rv) {
         view = mOwner->GetView();
 
         if (view) {
           mWidget = view->GetWidget();
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -435,27 +435,27 @@ static void PaintHeaderFooter(nsIFrame* 
 NS_IMETHODIMP
 nsPageFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                               const nsRect&           aDirtyRect,
                               const nsDisplayListSet& aLists)
 {
   nsDisplayListCollection set;
   nsresult rv;
 
-  if (GetPresContext()->IsScreen()) {
+  if (PresContext()->IsScreen()) {
     rv = set.BorderBackground()->AppendNewToTop(new (aBuilder)
         nsDisplayGeneric(this, ::PaintPrintPreviewBackground, "PrintPreviewBackground"));
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   rv = set.BorderBackground()->AppendNewToTop(new (aBuilder)
         nsDisplayGeneric(this, ::PaintPageContent, "PageContent"));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  if (GetPresContext()->IsRootPaginatedDocument()) {
+  if (PresContext()->IsRootPaginatedDocument()) {
     rv = set.Content()->AppendNewToTop(new (aBuilder)
         nsDisplayGeneric(this, ::PaintHeaderFooter, "HeaderFooter"));
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   set.MoveTo(aLists);
   return NS_OK;
 }
@@ -503,17 +503,17 @@ nsPageFrame::PaintPrintPreviewBackground
     aRenderingContext.FillRect(shadowRect);
   }
 }
 
 void
 nsPageFrame::PaintHeaderFooter(nsIRenderingContext& aRenderingContext,
                                nsPoint aPt)
 {
-  nsPresContext* pc = GetPresContext();
+  nsPresContext* pc = PresContext();
 
   if (!mPD->mPrintSettings) {
     if (pc->Type() == nsPresContext::eContext_PrintPreview || pc->IsDynamic())
       mPD->mPrintSettings = pc->GetPrintSettings();
     if (!mPD->mPrintSettings)
       return;
   }
 
@@ -554,17 +554,17 @@ nsPageFrame::PaintHeaderFooter(nsIRender
 
 //------------------------------------------------------------------------------
 void
 nsPageFrame::PaintPageContent(nsIRenderingContext& aRenderingContext,
                               const nsRect&        aDirtyRect,
                               nsPoint              aPt) {
   nsIFrame* pageContentFrame  = mFrames.FirstChild();
   nsRect rect = aDirtyRect;
-  float scale = GetPresContext()->GetPageScale();
+  float scale = PresContext()->GetPageScale();
   aRenderingContext.PushState();
   // Make sure we don't draw where we aren't supposed to draw, especially
   // when printing selection
   nsRect clipRect(nsPoint(0, 0), GetSize());
   clipRect.Deflate(mPD->mReflowMargin);
   aRenderingContext.SetClipRect(clipRect, nsClipCombine_kIntersect);
   // aPt translates to coords relative to this, then margins translate to
   // pageContentFrame's coords
@@ -572,17 +572,17 @@ nsPageFrame::PaintPageContent(nsIRenderi
   aRenderingContext.Translate(framePos.x, framePos.y);
   rect -= framePos;
   aRenderingContext.Scale(scale, scale);
   rect.ScaleRoundOut(1.0f / scale);
 
   const nsStyleBorder* border = GetStyleBorder();
   const nsStylePadding* padding = GetStylePadding();
   nsRect backgroundRect = nsRect(nsPoint(0, 0), pageContentFrame->GetSize());
-  nsCSSRendering::PaintBackground(GetPresContext(), aRenderingContext, this,
+  nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this,
                                   rect, backgroundRect, *border, *padding,
                                   PR_TRUE);
 
   nsLayoutUtils::PaintFrame(&aRenderingContext, pageContentFrame,
                             nsRegion(rect), NS_RGBA(0,0,0,0));
 
   aRenderingContext.PopState();
 }
--- a/layout/generic/nsPlaceholderFrame.cpp
+++ b/layout/generic/nsPlaceholderFrame.cpp
@@ -120,17 +120,17 @@ nsPlaceholderFrame::Reflow(nsPresContext
   aStatus = NS_FRAME_COMPLETE;
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
   return NS_OK;
 }
 
 void
 nsPlaceholderFrame::Destroy()
 {
-  nsIPresShell* shell = GetPresContext()->GetPresShell();
+  nsIPresShell* shell = PresContext()->GetPresShell();
   if (shell && mOutOfFlowFrame) {
     NS_ASSERTION(!shell->FrameManager()->GetPlaceholderFrameFor(mOutOfFlowFrame),
                  "Placeholder relationship should have been torn down; see "
                  "comments in nsPlaceholderFrame.h");
   }
 
   nsSplittableFrame::Destroy();
 }
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -449,17 +449,17 @@ public:
     // the capturing frame is the root.
     nsIFrame* clientFrame = NS_STATIC_CAST(nsIFrame*, aView->GetClientData());
     NS_ASSERTION(clientFrame, "Missing client frame");
 
     nsIFrame* capturingFrame = nsFrame::GetNearestCapturingFrame(clientFrame);
     NS_ASSERTION(!capturingFrame || capturingFrame->GetMouseCapturer(),
                  "Capturing frame should have a mouse capturer" );
 
-    NS_ASSERTION(!capturingFrame || mPresContext == capturingFrame->GetPresContext(),
+    NS_ASSERTION(!capturingFrame || mPresContext == capturingFrame->PresContext(),
                  "Shouldn't have different pres contexts");
 
     NS_ASSERTION(capturingFrame != mPresContext->PresShell()->FrameManager()->GetRootFrame(),
                  "Capturing frame should not be the root frame");
 
     if (capturingFrame)
     {
       mContent = capturingFrame->GetContent();
--- a/layout/generic/nsSimplePageSequence.cpp
+++ b/layout/generic/nsSimplePageSequence.cpp
@@ -115,18 +115,18 @@ nsSimplePageSequenceFrame::nsSimplePageS
   mSelectionHeight(-1),
   mYSelOffset(0)
 {
   nscoord halfInch = NS_INCHES_TO_TWIPS(0.5);
   mMargin.SizeTo(halfInch, halfInch, halfInch, halfInch);
 
   // XXX Unsafe to assume successful allocation
   mPageData = new nsSharedPageData();
-  mPageData->mHeadFootFont = new nsFont(*GetPresContext()->GetDefaultFont(kGenericFont_serif));
-  mPageData->mHeadFootFont->size = GetPresContext()->PointsToAppUnits(10);
+  mPageData->mHeadFootFont = new nsFont(*PresContext()->GetDefaultFont(kGenericFont_serif));
+  mPageData->mHeadFootFont->size = PresContext()->PointsToAppUnits(10);
 
   nsresult rv;
   mPageData->mPrintOptions = do_GetService(sPrintOptionsContractID, &rv);
 
   // Doing this here so we only have to go get these formats once
   SetPageNumberFormat("pagenumber",  "%1$d", PR_TRUE);
   SetPageNumberFormat("pageofpages", "%1$d of %2$d", PR_FALSE);
 }
@@ -361,18 +361,18 @@ nsSimplePageSequenceFrame::Reflow(nsPres
     PRUnichar * uStr = ToNewUnicode(formattedDateString);
     SetDateTimeStr(uStr); // memory will be freed
   }
 #endif
 
   // Return our desired size
   // Adjustr the reflow size by PrintPreviewScale so the scrollbars end up the
   // correct size
-  aDesiredSize.height  = y * GetPresContext()->GetPrintPreviewScale(); // includes page heights and dead space
-  aDesiredSize.width   = (x + availSize.width + deadSpaceGap) * GetPresContext()->GetPrintPreviewScale();
+  aDesiredSize.height  = y * PresContext()->GetPrintPreviewScale(); // includes page heights and dead space
+  aDesiredSize.width   = (x + availSize.width + deadSpaceGap) * PresContext()->GetPrintPreviewScale();
 
   aDesiredSize.mOverflowArea = nsRect(0, 0, aDesiredSize.width,
                                       aDesiredSize.height);
   FinishAndStoreOverflow(&aDesiredSize);
 
   // cache the size so we can set the desired size 
   // for the other reflows that happen
   mSize.width  = aDesiredSize.width;
@@ -552,17 +552,17 @@ nsSimplePageSequenceFrame::PrintNextPage
     return NS_ERROR_FAILURE;
   }
 
   PRBool printEvenPages, printOddPages;
   mPageData->mPrintSettings->GetPrintOptions(nsIPrintSettings::kPrintEvenPages, &printEvenPages);
   mPageData->mPrintSettings->GetPrintOptions(nsIPrintSettings::kPrintOddPages, &printOddPages);
 
   // Begin printing of the document
-  nsIDeviceContext *dc = GetPresContext()->DeviceContext();
+  nsIDeviceContext *dc = PresContext()->DeviceContext();
 
   nsresult rv = NS_OK;
 
   // See whether we should print this page
   mPrintThisPage = PR_TRUE;
 
   // If printing a range of pages check whether the page number is in the
   // range of pages to print
@@ -595,44 +595,44 @@ nsSimplePageSequenceFrame::PrintNextPage
     // XXX This is temporary fix for printing more than one page of a selection
     // This does a poor man's "dump" pagination (see Bug 89353)
     // It has laid out as one long page and now we are just moving or view up/down 
     // one page at a time and printing the contents of what is exposed by the rect.
     // currently this does not work for IFrames
     // I will soon improve this to work with IFrames 
     PRBool  continuePrinting = PR_TRUE;
     PRInt32 width, height;
-    width = GetPresContext()->GetPageSize().width;
-    height = GetPresContext()->GetPageSize().height;
+    width = PresContext()->GetPageSize().width;
+    height = PresContext()->GetPageSize().height;
     height -= mMargin.top + mMargin.bottom;
     width  -= mMargin.left + mMargin.right;
     nscoord selectionY = height;
     nsIFrame* conFrame = mCurrentPageFrame->GetFirstChild(nsnull);
     if (mSelectionHeight > -1) {
       conFrame->SetPosition(conFrame->GetPosition() + nsPoint(0, -mYSelOffset));
     }
 
     // cast the frame to be a page frame
     nsPageFrame * pf = NS_STATIC_CAST(nsPageFrame*, mCurrentPageFrame);
     pf->SetPageNumInfo(mPageNum, mTotalPages);
     pf->SetSharedPageData(mPageData);
 
     PRInt32 printedPageNum = 1;
     while (continuePrinting) {
-      if (GetPresContext()->IsRootPaginatedDocument()) {
+      if (PresContext()->IsRootPaginatedDocument()) {
         PR_PL(("\n"));
         PR_PL(("***************** BeginPage *****************\n"));
         rv = dc->BeginPage();
         NS_ENSURE_SUCCESS(rv, rv);
       }
 
       PR_PL(("SeqFr::Paint -> %p PageNo: %d", pf, mPageNum));
 
       nsCOMPtr<nsIRenderingContext> renderingContext;
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
               CreateRenderingContext(mCurrentPageFrame,
                                      getter_AddRefs(renderingContext));
       nsRect drawingRect(nsPoint(0, 0),
                          mCurrentPageFrame->GetSize());
       nsRegion drawingRegion(drawingRect);
       nsLayoutUtils::PaintFrame(renderingContext, mCurrentPageFrame,
                                 drawingRegion, NS_RGBA(0,0,0,0));
 
@@ -652,19 +652,19 @@ nsSimplePageSequenceFrame::PrintNextPage
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsSimplePageSequenceFrame::DoPageEnd()
 {
   nsresult rv = NS_OK;
-  if (GetPresContext()->IsRootPaginatedDocument() && mPrintThisPage) {
+  if (PresContext()->IsRootPaginatedDocument() && mPrintThisPage) {
     PR_PL(("***************** End Page (DoPageEnd) *****************\n"));
-    rv = GetPresContext()->DeviceContext()->EndPage();
+    rv = PresContext()->DeviceContext()->EndPage();
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   mPageNum++;
 
   if (mCurrentPageFrame) {
     mCurrentPageFrame = mCurrentPageFrame->GetNextSibling();
   }
@@ -679,17 +679,17 @@ static void PaintPageSequence(nsIFrame* 
 }
 
 //------------------------------------------------------------------------------
 void
 nsSimplePageSequenceFrame::PaintPageSequence(nsIRenderingContext& aRenderingContext,
                                              const nsRect&        aDirtyRect,
                                              nsPoint              aPt) {
   nsRect rect = aDirtyRect;
-  float scale = GetPresContext()->GetPrintPreviewScale();
+  float scale = PresContext()->GetPrintPreviewScale();
   aRenderingContext.PushState();
   nsPoint framePos = aPt;
   aRenderingContext.Translate(framePos.x, framePos.y);
   rect -= framePos;
   aRenderingContext.Scale(scale, scale);
   rect.ScaleRoundOut(1.0f / scale);
 
   // Now the rect and the rendering coordinates are are relative to this frame.
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -1442,17 +1442,17 @@ nsContinuingTextFrame::Init(nsIContent* 
     // Hook the frame into the flow
     SetPrevInFlow(aPrevInFlow);
     aPrevInFlow->SetNextInFlow(this);
 #ifdef IBMBIDI
     if (aPrevInFlow->GetStateBits() & NS_FRAME_IS_BIDI) {
       PRInt32 start, end;
       aPrevInFlow->GetOffsets(start, mContentOffset);
 
-      nsPropertyTable *propTable = GetPresContext()->PropertyTable();
+      nsPropertyTable *propTable = PresContext()->PropertyTable();
       propTable->SetProperty(this, nsGkAtoms::embeddingLevel,
             propTable->GetProperty(aPrevInFlow, nsGkAtoms::embeddingLevel),
                              nsnull, nsnull);
       propTable->SetProperty(this, nsGkAtoms::baseLevel,
                 propTable->GetProperty(aPrevInFlow, nsGkAtoms::baseLevel),
                              nsnull, nsnull);
       propTable->SetProperty(this, nsGkAtoms::charType,
                  propTable->GetProperty(aPrevInFlow, nsGkAtoms::charType),
@@ -2017,17 +2017,17 @@ nsTextFrame::BuildDisplayList(nsDisplayL
     
   return aLists.Content()->AppendNewToTop(new (aBuilder) nsDisplayText(this));
 }
 
 void
 nsTextFrame::PaintText(nsIRenderingContext& aRenderingContext, nsPoint aPt)
 {
   nsStyleContext* sc = mStyleContext;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsCOMPtr<nsIContent> content;
   PRInt32 offset, length;
   GetContentAndOffsetsForSelection(presContext,
                                    getter_AddRefs(content),
                                    &offset, &length);
   PRInt16 selectionValue;
   if (NS_FAILED(GetSelectionStatus(presContext, selectionValue)))
     selectionValue = nsISelectionController::SELECTION_NORMAL;
@@ -2780,17 +2780,17 @@ nsTextFrame::IsTextInSelection()
 {
   nsCOMPtr<nsISelectionController> selCon;
   nsCOMPtr<nsIPresShell> shell;
   PRBool  displaySelection;
   PRBool  isPaginated;
   PRBool  isSelected;
   PRBool  hideStandardSelection;
   PRInt16 selectionValue;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   if (NS_FAILED(GetTextInfoForPainting(presContext, 
                                        getter_AddRefs(shell),
                                        getter_AddRefs(selCon),
                                        displaySelection,
                                        isPaginated,
                                        isSelected,
                                        hideStandardSelection,
                                        selectionValue))) {
@@ -3172,17 +3172,17 @@ nsTextFrame::GetPositionSlowly(nsIRender
   // pre-condition tests
   NS_PRECONDITION(aRendContext && aNewContent, "null arg");
   if (!aRendContext || !aNewContent) {
     return NS_ERROR_NULL_POINTER;
   }
   // initialize out param
   *aNewContent = nsnull;
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsTextStyle ts(presContext, *aRendContext, mStyleContext);
   SetupTextRunDirection(presContext, aRendContext);
   if (!ts.mSmallCaps && !ts.mWordSpacing && !ts.mLetterSpacing && !ts.mJustifying) {
     return NS_ERROR_INVALID_ARG;
   }
 
   /* This if clause is the cause of much pain.  If aNewContent is set, then any
    * code path that returns an error must set aNewContent to null before returning,
@@ -3213,17 +3213,17 @@ nsTextFrame::GetPositionSlowly(nsIRender
   if (NS_FAILED(rv)) {
     // If we've already assigned aNewContent, make sure to 0 it out here.
     // See bug 56704.
     *aNewContent = nsnull;
     return rv;
   }
 
   // Transform text from content into renderable form
-  nsTextTransformer tx(GetPresContext());
+  nsTextTransformer tx(PresContext());
   PRInt32 textLength;
   PRIntn numJustifiableCharacter;
 
   PrepareUnicodeText(tx, &indexBuffer, &paintBuffer, &textLength, PR_TRUE, &numJustifiableCharacter);
   if (textLength <= 0) {
     // If we've already assigned aNewContent, make sure to 0 it out here.
     // aNewContent is undefined in the case that we return a failure,
     // If we were to return a valid pointer,  we risk decrementing that node's 
@@ -4102,17 +4102,17 @@ nsTextFrame::GetPositionHelper(const nsP
   }
   // initialize out param
   *aNewContent = nsnull;
 
   DEBUG_VERIFY_NOT_DIRTY(mState);
   if (mState & NS_FRAME_IS_DIRTY)
     return NS_ERROR_UNEXPECTED;
 
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsIPresShell *shell = presContext->GetPresShell();
   if (shell) {
     nsCOMPtr<nsIRenderingContext> rendContext;      
     nsresult rv = shell->CreateRenderingContext(this, getter_AddRefs(rendContext));
     if (NS_SUCCEEDED(rv)) {
       nsTextStyle ts(presContext, *rendContext, mStyleContext);
       SetupTextRunDirection(presContext, rendContext);
       if (ts.mSmallCaps || ts.mWordSpacing || ts.mLetterSpacing || ts.mJustifying) {
@@ -4129,17 +4129,17 @@ nsTextFrame::GetPositionHelper(const nsP
       if (NS_FAILED(rv)) {
         return rv;
       }
 
       // Find the font metrics for this text
       SetFontFromStyle(rendContext, mStyleContext);
 
       // Get the renderable form of the text
-      nsTextTransformer tx(GetPresContext());
+      nsTextTransformer tx(PresContext());
       PRInt32 textLength;
       // no need to worry about justification, that's always on the slow path
       PrepareUnicodeText(tx, &indexBuffer, &paintBuffer, &textLength);
 
       if (textLength <= 0) {
         aContentOffset = mContentOffset;
         aContentOffsetEnd = aContentOffset;
       }
@@ -4529,17 +4529,17 @@ PRBool
 nsTextFrame::PeekOffsetCharacter(PRBool aForward, PRInt32* aOffset)
 {
   NS_ASSERTION (aOffset && *aOffset <= mContentLength, "aOffset out of range");
   PRInt32 startOffset = *aOffset;
   // A negative offset means "end of frame".
   if (startOffset < 0)
     startOffset = mContentLength;
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   
   // Transform text from content into renderable form
   nsAutoTextBuffer paintBuffer;
   nsAutoIndexBuffer indexBuffer;
   nsresult rv = indexBuffer.GrowTo(mContentLength + 1);
   if (NS_FAILED(rv)) {
     return PR_FALSE;
   }  
@@ -4664,17 +4664,17 @@ PRBool
 nsTextFrame::PeekOffsetWord(PRBool aForward, PRBool aWordSelectEatSpace, PRBool aIsKeyboardSelect,
                             PRInt32* aOffset, PRBool* aSawBeforeType)
 {
   NS_ASSERTION (aOffset && *aOffset <= mContentLength, "aOffset out of range");
   PRInt32 startOffset = *aOffset;
   if (startOffset < 0)
     startOffset = mContentLength;
   
-  nsTextTransformer tx(GetPresContext());
+  nsTextTransformer tx(PresContext());
   PRBool keepSearching = PR_TRUE; //if you run out of chars before you hit the end of word, maybe next frame has more text to select?
   PRBool found = PR_FALSE;
   PRBool isWhitespace, wasTransformed;
   PRInt32 wordLen, contentLen;  
   
   PRBool selectable;
   PRUint8 selectStyle;
   IsSelectable(&selectable, &selectStyle);
@@ -5670,17 +5670,17 @@ nsTextFrame::MarkIntrinsicWidthsDirty()
 
 // XXX This should really share more code with the first half of MeasureText.
 /* virtual */ void
 nsTextFrame::AddInlineMinWidth(nsIRenderingContext *aRenderingContext,
                                nsIFrame::InlineMinWidthData *aData)
 {
   nsresult rv;
 
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsTextStyle ts(presContext, *aRenderingContext, mStyleContext);
   SetupTextRunDirection(presContext, aRenderingContext);
   if (!ts.mFont->mSize)
     // XXX If font size is zero, we still need to figure out whether we've
     // got non-whitespace text and whether we end in whitespace.
     return;
 
   const nsStyleText *styleText = GetStyleText();
@@ -5810,17 +5810,17 @@ nsTextFrame::AddInlineMinWidth(nsIRender
 }
 
 /* virtual */ void
 nsTextFrame::AddInlinePrefWidth(nsIRenderingContext *aRenderingContext,
                                 nsIFrame::InlinePrefWidthData *aData)
 {
   nsresult rv;
 
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsTextStyle ts(presContext, *aRenderingContext, mStyleContext);
   if (!ts.mFont->mSize)
     // XXX If font size is zero, we still need to figure out whether we've
     // got non-whitespace text and whether we end in whitespace.
     return;
 
   PRBool forceArabicShaping = (ts.mSmallCaps ||
                                (0 != ts.mWordSpacing) ||
--- a/layout/mathml/base/src/nsMathMLChar.cpp
+++ b/layout/mathml/base/src/nsMathMLChar.cpp
@@ -1987,17 +1987,17 @@ private:
   nsRect    mRect;
 };
 
 void nsDisplayMathMLSelectionRect::Paint(nsDisplayListBuilder* aBuilder,
      nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
 {
   // get color to use for selection from the look&feel object
   nscolor bgColor = NS_RGB(0, 0, 0);
-  mFrame->GetPresContext()->LookAndFeel()->
+  mFrame->PresContext()->LookAndFeel()->
       GetColor(nsILookAndFeel::eColor_TextSelectBackground, bgColor);
   aCtx->SetColor(bgColor);
   aCtx->FillRect(mRect + aBuilder->ToReferenceFrame(mFrame));
 }
 
 class nsDisplayMathMLCharBackground : public nsDisplayItem {
 public:
   nsDisplayMathMLCharBackground(nsIFrame* aFrame, const nsRect& aRect,
@@ -2020,17 +2020,17 @@ private:
 };
 
 void nsDisplayMathMLCharBackground::Paint(nsDisplayListBuilder* aBuilder,
      nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
 {
   const nsStyleBorder* border = mStyleContext->GetStyleBorder();
   const nsStylePadding* padding = mStyleContext->GetStylePadding();
   const nsStyleBackground* backg = mStyleContext->GetStyleBackground();
-  nsCSSRendering::PaintBackgroundWithSC(mFrame->GetPresContext(), *aCtx, mFrame,
+  nsCSSRendering::PaintBackgroundWithSC(mFrame->PresContext(), *aCtx, mFrame,
                                         aDirtyRect,
                                         mRect + aBuilder->ToReferenceFrame(mFrame),
                                         *backg, *border, *padding,
                                         PR_TRUE);
 }
 
 class nsDisplayMathMLCharForeground : public nsDisplayItem {
 public:
@@ -2051,17 +2051,17 @@ public:
 private:
   nsMathMLChar* mChar;
   PRPackedBool  mIsSelected;
 };
 
 void nsDisplayMathMLCharForeground::Paint(nsDisplayListBuilder* aBuilder,
      nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
 {
-  mChar->PaintForeground(mFrame->GetPresContext(), *aCtx,
+  mChar->PaintForeground(mFrame->PresContext(), *aCtx,
                          aBuilder->ToReferenceFrame(mFrame), mIsSelected);
 }
 
 #ifdef NS_DEBUG
 class nsDisplayMathMLCharDebug : public nsDisplayItem {
 public:
   nsDisplayMathMLCharDebug(nsIFrame* aFrame, const nsRect& aRect)
     : nsDisplayItem(aFrame), mRect(aRect) {
@@ -2080,17 +2080,17 @@ private:
   nsRect    mRect;
 };
 
 void nsDisplayMathMLCharDebug::Paint(nsDisplayListBuilder* aBuilder,
      nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
 {
   // for visual debug
   PRIntn skipSides = 0;
-  nsPresContext* presContext = mFrame->GetPresContext();
+  nsPresContext* presContext = mFrame->PresContext();
   const nsStyleBorder* border = mFrame->GetStyleBorder();
   nsStyleContext* styleContext = mFrame->GetStyleContext();
   nsRect rect = mRect + aBuilder->ToReferenceFrame(mFrame);
   nsCSSRendering::PaintBorder(presContext, *aCtx, mFrame,
                               aDirtyRect, rect, *border, styleContext, skipSides);
   nsCSSRendering::PaintOutline(presContext, *aCtx, mFrame,
                                aDirtyRect, rect, *border,
                                *mFrame->GetStyleOutline(), styleContext, 0);
--- a/layout/mathml/base/src/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLContainerFrame.cpp
@@ -642,17 +642,17 @@ nsMathMLContainerFrame::PropagateScriptS
     if (!gap) {
       // unset any -moz-math-font-size attribute without notifying that we want a reflow
       // (but leave it to the primary frame to do that, a child pseudo can't overrule)
       if (!aFrame->GetParent() || aFrame->GetParent()->GetContent() != content)
         content->UnsetAttr(kNameSpaceID_None, nsGkAtoms::MOZfontsize, PR_FALSE);
     }
     else {
       // By default scriptminsize=8pt and scriptsizemultiplier=0.71
-      nscoord scriptminsize = aFrame->GetPresContext()->PointsToAppUnits(NS_MATHML_SCRIPTMINSIZE);
+      nscoord scriptminsize = aFrame->PresContext()->PointsToAppUnits(NS_MATHML_SCRIPTMINSIZE);
       float scriptsizemultiplier = NS_MATHML_SCRIPTSIZEMULTIPLIER;
 #if 0
        // XXX Bug 44201
        // user-supplied scriptminsize and scriptsizemultiplier that are
        // restricted to particular elements are not supported because our
        // css rules are fixed in mathml.css and are applicable to all elements.
 
        // see if there is a scriptminsize attribute on a <mstyle> that wraps us
@@ -698,17 +698,17 @@ nsMathMLContainerFrame::PropagateScriptS
       }
 
       // set the -moz-math-font-size attribute without notifying that we want a reflow
       content->SetAttr(kNameSpaceID_None, nsGkAtoms::MOZfontsize,
                        fontsize, PR_FALSE);
     }
 
     // now, re-resolve the style contexts in our subtree
-    nsFrameManager *fm = aFrame->GetPresContext()->FrameManager();
+    nsFrameManager *fm = aFrame->PresContext()->FrameManager();
     nsStyleChangeList changeList;
     fm->ComputeStyleChangeFor(aFrame, &changeList, NS_STYLE_HINT_NONE);
 #ifdef DEBUG
     // Use the parent frame to make sure we catch in-flows and such
     nsIFrame* parentFrame = aFrame->GetParent();
     fm->DebugVerifyStyleTree(parentFrame ? parentFrame : aFrame);
 #endif
   }
@@ -769,17 +769,17 @@ nsMathMLContainerFrame::BuildDisplayList
 
 // This method is called in a top-down manner, as we descend the frame tree
 // during its construction
 NS_IMETHODIMP
 nsMathMLContainerFrame::Init(nsIContent*      aContent,
                              nsIFrame*        aParent,
                              nsIFrame*        aPrevInFlow)
 {
-  MapCommonAttributesIntoCSS(GetPresContext(), aContent);
+  MapCommonAttributesIntoCSS(PresContext(), aContent);
 
   // let the base class do its Init()
   return nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
 
   // ...We will build our automatic MathML data once the entire <math>...</math>
   // tree is constructed.
 }
 
@@ -869,17 +869,17 @@ nsMathMLContainerFrame::ReLayoutChildren
   }
 
   // Ask our parent frame to reflow us
   nsIFrame* parent = frame->GetParent();
   NS_ASSERTION(parent, "No parent to pass the reflow request up to");
   if (!parent)
     return NS_OK;
 
-  return frame->GetPresContext()->PresShell()->
+  return frame->PresContext()->PresShell()->
            FrameNeedsReflow(frame, nsIPresShell::eStyleChange);
 }
 
 // There are precise rules governing children of a MathML frame,
 // and properties such as the scriptlevel depends on those rules.
 // Hence for things to work, callers must use Append/Insert/etc wisely.
 
 nsresult
@@ -945,23 +945,23 @@ nsMathMLContainerFrame::RemoveFrame(nsIA
 }
 
 NS_IMETHODIMP
 nsMathMLContainerFrame::AttributeChanged(PRInt32         aNameSpaceID,
                                          nsIAtom*        aAttribute,
                                          PRInt32         aModType)
 {
   // Attributes common to MathML tags
-  if (CommonAttributeChangedFor(GetPresContext(), mContent, aAttribute))
+  if (CommonAttributeChangedFor(PresContext(), mContent, aAttribute))
     return NS_OK;
 
   // XXX Since they are numerous MathML attributes that affect layout, and
   // we can't check all of them here, play safe by requesting a reflow.
   // XXXldb This should only do work for attributes that cause changes!
-  return GetPresContext()->PresShell()->
+  return PresContext()->PresShell()->
            FrameNeedsReflow(this, nsIPresShell::eStyleChange);
 }
 
 nsresult 
 nsMathMLContainerFrame::ReflowChild(nsIFrame*                aChildFrame,
                                     nsPresContext*           aPresContext,
                                     nsHTMLReflowMetrics&     aDesiredSize,
                                     const nsHTMLReflowState& aReflowState,
@@ -1328,17 +1328,17 @@ nsMathMLContainerFrame::Place(nsIRenderi
         nscoord space = GetInterFrameSpacing(mPresentationData.scriptLevel,
           prevFrameType, childFrameType, &fromFrameType, &carrySpace);
         dx += space * thinSpace;
       }
       count++;
       prevFrameType = childFrameType;
       // add left correction
       dx += leftCorrection;
-      FinishReflowChild(childFrame, GetPresContext(), nsnull, childSize,
+      FinishReflowChild(childFrame, PresContext(), nsnull, childSize,
                         dx, dy, 0);
       // add child size + italic correction
       dx += bmChild.width + italicCorrection;
       childFrame = childFrame->GetNextSibling();
     }
   }
 
   return NS_OK;
@@ -1423,17 +1423,17 @@ nsMathMLContainerFrame::DidReflowChildre
   if (NS_UNLIKELY(!aFirst))
     return;
 
   for (nsIFrame* frame = aFirst;
        frame != aStop;
        frame = frame->GetNextSibling()) {
     NS_ASSERTION(frame, "aStop isn't a sibling");
     if (frame->GetStateBits() & NS_FRAME_IN_REFLOW) {
-      frame->DidReflow(frame->GetPresContext(), nsnull,
+      frame->DidReflow(frame->PresContext(), nsnull,
                        NS_FRAME_REFLOW_FINISHED);
     }
   }
 }
 
 //==========================
 
 nsIFrame*
--- a/layout/mathml/base/src/nsMathMLContainerFrame.h
+++ b/layout/mathml/base/src/nsMathMLContainerFrame.h
@@ -332,17 +332,17 @@ public:
   // beware, mFrames is not set by nsBlockFrame
   // cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames
   NS_IMETHOD
   SetInitialChildList(nsIAtom*        aListName,
                       nsIFrame*       aChildList)
   {
     nsresult rv = nsBlockFrame::SetInitialChildList(aListName, aChildList);
     // re-resolve our subtree to set any mathml-expected data
-    nsMathMLContainerFrame::MapCommonAttributesIntoCSS(GetPresContext(), this);
+    nsMathMLContainerFrame::MapCommonAttributesIntoCSS(PresContext(), this);
     nsMathMLContainerFrame::RebuildAutomaticDataForChildren(this);
     return rv;
   }
 
   NS_IMETHOD
   Reflow(nsPresContext*          aPresContext,
          nsHTMLReflowMetrics&     aDesiredSize,
          const nsHTMLReflowState& aReflowState,
@@ -415,17 +415,17 @@ public:
   friend nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
   NS_IMETHOD
   SetInitialChildList(nsIAtom*        aListName,
                       nsIFrame*       aChildList)
   {
     nsresult rv = nsInlineFrame::SetInitialChildList(aListName, aChildList);
     // re-resolve our subtree to set any mathml-expected data
-    nsMathMLContainerFrame::MapCommonAttributesIntoCSS(GetPresContext(), this);
+    nsMathMLContainerFrame::MapCommonAttributesIntoCSS(PresContext(), this);
     nsMathMLContainerFrame::RebuildAutomaticDataForChildren(this);
     return rv;
   }
 
   NS_IMETHOD
   Reflow(nsPresContext*          aPresContext,
          nsHTMLReflowMetrics&     aDesiredSize,
          const nsHTMLReflowState& aReflowState,
--- a/layout/mathml/base/src/nsMathMLFrame.h
+++ b/layout/mathml/base/src/nsMathMLFrame.h
@@ -274,27 +274,27 @@ public:
   }
 
   // helper methods for getting sup/subdrop's from a child
   static void 
   GetSubDropFromChild(nsIFrame*       aChild,
                       nscoord&        aSubDrop) 
   {
     const nsStyleFont* font = aChild->GetStyleFont();
-    nsCOMPtr<nsIFontMetrics> fm = aChild->GetPresContext()->GetMetricsFor(
+    nsCOMPtr<nsIFontMetrics> fm = aChild->PresContext()->GetMetricsFor(
                                                               font->mFont);
     GetSubDrop(fm, aSubDrop);
   }
 
   static void 
   GetSupDropFromChild(nsIFrame*       aChild,
                       nscoord&        aSupDrop) 
   {
     const nsStyleFont* font = aChild->GetStyleFont();
-    nsCOMPtr<nsIFontMetrics> fm = aChild->GetPresContext()->GetMetricsFor(
+    nsCOMPtr<nsIFontMetrics> fm = aChild->PresContext()->GetMetricsFor(
                                                               font->mFont);
     GetSupDrop(fm, aSupDrop);
   }
 
   static void
   GetSkewCorrectionFromChild(nsIFrame*       aChild,
                              nscoord&        aSkewCorrection) 
   {
--- a/layout/mathml/base/src/nsMathMLTokenFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLTokenFrame.cpp
@@ -181,17 +181,17 @@ nsMathMLTokenFrame::Reflow(nsPresContext
 // pass, it is not computed here because our children may be text frames
 // that do not implement the GetBoundingMetrics() interface.
 nsresult
 nsMathMLTokenFrame::Place(nsIRenderingContext& aRenderingContext,
                           PRBool               aPlaceOrigin,
                           nsHTMLReflowMetrics& aDesiredSize)
 {
   nsCOMPtr<nsIFontMetrics> fm =
-    GetPresContext()->GetMetricsFor(GetStyleFont()->mFont);
+    PresContext()->GetMetricsFor(GetStyleFont()->mFont);
   nscoord ascent, descent;
   fm->GetMaxAscent(ascent);
   fm->GetMaxDescent(descent);
 
   aDesiredSize.mBoundingMetrics = mBoundingMetrics;
   aDesiredSize.width = mBoundingMetrics.width;
   aDesiredSize.ascent = PR_MAX(mBoundingMetrics.ascent, ascent);
   aDesiredSize.height = aDesiredSize.ascent +
@@ -203,17 +203,17 @@ nsMathMLTokenFrame::Place(nsIRenderingCo
     while (childFrame) {
       nsRect rect = childFrame->GetRect();
       nsHTMLReflowMetrics childSize;
       childSize.width = rect.width;
       childSize.height = aDesiredSize.height; //rect.height;
 
       // place and size the child; (dx,0) makes the caret happy - bug 188146
       dy = rect.IsEmpty() ? 0 : aDesiredSize.ascent - rect.y;
-      FinishReflowChild(childFrame, GetPresContext(), nsnull, childSize, dx, dy, 0);
+      FinishReflowChild(childFrame, PresContext(), nsnull, childSize, dx, dy, 0);
       dx += rect.width;
       childFrame = childFrame->GetNextSibling();
     }
   }
 
   SetReference(nsPoint(0, aDesiredSize.ascent));
 
   return NS_OK;
@@ -250,17 +250,17 @@ nsMathMLTokenFrame::ProcessTextData(PRBo
   if (!SetTextStyle())
     return;
 
   // has changed but it doesn't have to be reflected straightaway
   if (!aComputeStyleChange)
     return;
 
   // otherwise re-resolve the style contexts in our subtree to pick up the change
-  nsFrameManager* fm = GetPresContext()->FrameManager();
+  nsFrameManager* fm = PresContext()->FrameManager();
   nsStyleChangeList changeList;
   fm->ComputeStyleChangeFor(this, &changeList, NS_STYLE_HINT_NONE);
 #ifdef DEBUG
   // Use the parent frame to make sure we catch in-flows and such
   nsIFrame* parentFrame = GetParent();
   fm->DebugVerifyStyleTree(parentFrame ? parentFrame : this);
 #endif
 }
--- a/layout/mathml/base/src/nsMathMLmactionFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmactionFrame.cpp
@@ -137,17 +137,17 @@ nsMathMLmactionFrame::Init(nsIContent*  
         // given us the associated style. But we want to start with our default style.
 
         // So... first, remove the attribute actiontype="restyle#id"
         PRBool notify = PR_FALSE; // don't trigger a reflow yet!
         aContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::actiontype_, notify);
 
         // then, re-resolve our style
         nsStyleContext* parentStyleContext = aParent->GetStyleContext();
-        newStyleContext = GetPresContext()->StyleSet()->
+        newStyleContext = PresContext()->StyleSet()->
           ResolveStyleFor(aContent, parentStyleContext);
 
         if (!newStyleContext) 
           mRestyle.Truncate();
         else {
           if (newStyleContext != GetStyleContext())
             SetStyleContextWithoutNotification(newStyleContext);
           else
@@ -306,17 +306,17 @@ nsMathMLmactionFrame::Place(nsIRendering
 {
   aDesiredSize.width = aDesiredSize.height = 0;
   aDesiredSize.ascent = 0;
   mBoundingMetrics.Clear();
   nsIFrame* childFrame = GetSelectedFrame();
   if (childFrame) {
     GetReflowAndBoundingMetricsFor(childFrame, aDesiredSize, mBoundingMetrics);
     if (aPlaceOrigin) {
-      FinishReflowChild(childFrame, GetPresContext(), nsnull, aDesiredSize, 0, 0, 0);
+      FinishReflowChild(childFrame, PresContext(), nsnull, aDesiredSize, 0, 0, 0);
     }
     mReference.x = 0;
     mReference.y = aDesiredSize.ascent;
   }
   aDesiredSize.mBoundingMetrics = mBoundingMetrics;
   return NS_OK;
 }
 
@@ -352,30 +352,30 @@ nsMathMLmactionFrame::MouseOver(nsIDOMEv
 {
   // see if we should display a status message
   if (NS_MATHML_ACTION_TYPE_STATUSLINE == mActionType) {
     nsAutoString value;
     mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::actiontype_, value);
     // expected statusline prefix (11ch)...
     if (11 < value.Length() && 0 == value.Find("statusline#")) {
       value.Cut(0, 11);
-      ShowStatus(GetPresContext(), value);
+      ShowStatus(PresContext(), value);
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMathMLmactionFrame::MouseOut(nsIDOMEvent* aMouseEvent) 
 { 
   // see if we should remove the status message
   if (NS_MATHML_ACTION_TYPE_STATUSLINE == mActionType) {
     nsAutoString value;
     value.SetLength(0);
-    ShowStatus(GetPresContext(), value);
+    ShowStatus(PresContext(), value);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMathMLmactionFrame::MouseClick(nsIDOMEvent* aMouseEvent)
 {
   if (NS_MATHML_ACTION_TYPE_TOGGLE == mActionType) {
@@ -385,31 +385,31 @@ nsMathMLmactionFrame::MouseClick(nsIDOME
       char cbuf[10];
       PR_snprintf(cbuf, sizeof(cbuf), "%d", selection);
       value.AssignASCII(cbuf);
       PRBool notify = PR_FALSE; // don't yet notify the document
       mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::selection_, value, notify);
 
       // Now trigger a content-changed reflow...
       mSelectedFrame->AddStateBits(NS_FRAME_IS_DIRTY);
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(mSelectedFrame, nsIPresShell::eTreeChange);
     }
   }
   else if (NS_MATHML_ACTION_TYPE_RESTYLE == mActionType) {
     if (!mRestyle.IsEmpty()) {
       nsCOMPtr<nsIDOMElement> node( do_QueryInterface(mContent) );
       if (node.get()) {
         if (nsContentUtils::HasNonEmptyAttr(mContent, kNameSpaceID_None,
                                             nsGkAtoms::actiontype_))
           node->RemoveAttribute(NS_LITERAL_STRING("actiontype"));
         else
           node->SetAttribute(NS_LITERAL_STRING("actiontype"), mRestyle);
 
         // Trigger a style change reflow
         mSelectedFrame->AddStateBits(NS_FRAME_IS_DIRTY);
-        GetPresContext()->PresShell()->
+        PresContext()->PresShell()->
           FrameNeedsReflow(mSelectedFrame, nsIPresShell::eStyleChange);
       }
     }
   }
   return NS_OK;
 }
--- a/layout/mathml/base/src/nsMathMLmfencedFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmfencedFrame.cpp
@@ -81,36 +81,36 @@ nsMathMLmfencedFrame::SetInitialChildLis
 {
   // First, let the base class do its work
   nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aListName, aChildList);
   if (NS_FAILED(rv)) return rv;
 
   // No need to tract the style contexts given to our MathML chars. 
   // The Style System will use Get/SetAdditionalStyleContext() to keep them
   // up-to-date if dynamic changes arise.
-  return CreateFencesAndSeparators(GetPresContext());
+  return CreateFencesAndSeparators(PresContext());
 }
 
 NS_IMETHODIMP
 nsMathMLmfencedFrame::AttributeChanged(PRInt32         aNameSpaceID,
                                        nsIAtom*        aAttribute,
                                        PRInt32         aModType)
 {
   RemoveFencesAndSeparators();
-  CreateFencesAndSeparators(GetPresContext());
+  CreateFencesAndSeparators(PresContext());
 
   return nsMathMLContainerFrame::
          AttributeChanged(aNameSpaceID, aAttribute, aModType);
 }
 
 nsresult
 nsMathMLmfencedFrame::ChildListChanged(PRInt32 aModType)
 {
   RemoveFencesAndSeparators();
-  CreateFencesAndSeparators(GetPresContext());
+  CreateFencesAndSeparators(PresContext());
 
   return nsMathMLContainerFrame::ChildListChanged(aModType);
 }
 
 void
 nsMathMLmfencedFrame::RemoveFencesAndSeparators()
 {
   if (mOpenChar) delete mOpenChar;
--- a/layout/mathml/base/src/nsMathMLmfracFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmfracFrame.cpp
@@ -99,17 +99,17 @@ nsMathMLmfracFrame::Init(nsIContent*    
                          nsIFrame*        aPrevInFlow)
 {
   nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
 
   if (IsBevelled()) {
     // enable the bevelled rendering
     mSlashChar = new nsMathMLChar();
     if (mSlashChar) {
-      nsPresContext* presContext = GetPresContext();
+      nsPresContext* presContext = PresContext();
     
       nsAutoString slashChar; slashChar.Assign(kSlashChar);
       mSlashChar->SetData(presContext, slashChar);
       ResolveMathMLCharStyle(presContext, mContent, mStyleContext, mSlashChar, PR_TRUE);
     }
   }
 
   return rv;
@@ -283,17 +283,17 @@ nsMathMLmfracFrame::Place(nsIRenderingCo
     return ReflowError(aRenderingContext, aDesiredSize);
   }
   GetReflowAndBoundingMetricsFor(frameNum, sizeNum, bmNum);
   GetReflowAndBoundingMetricsFor(frameDen, sizeDen, bmDen);
 
   //////////////////
   // Get shifts
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1);
 
   aRenderingContext.SetFont(GetStyleFont()->mFont, nsnull);
   nsCOMPtr<nsIFontMetrics> fm;
   aRenderingContext.GetFontMetrics(*getter_AddRefs(fm));
 
   nscoord defaultRuleThickness, axisHeight;
   GetRuleThickness(aRenderingContext, fm, defaultRuleThickness);
@@ -460,17 +460,17 @@ nsMathMLmfracFrame::AttributeChanged(PRI
         mSlashChar = nsnull;
       }
     }
     else {
       // enable the bevelled rendering
       if (!mSlashChar) {
         mSlashChar = new nsMathMLChar();
         if (mSlashChar) {
-          nsPresContext* presContext = GetPresContext();
+          nsPresContext* presContext = PresContext();
           nsAutoString slashChar; slashChar.Assign(kSlashChar);
           mSlashChar->SetData(presContext, slashChar);
           ResolveMathMLCharStyle(presContext, mContent, mStyleContext, mSlashChar, PR_TRUE);
         }
       }
     }
   }
   return nsMathMLContainerFrame::
--- a/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp
@@ -121,26 +121,26 @@ nsMathMLmmultiscriptsFrame::ProcessAttri
 
   // check if the subscriptshift attribute is there
   nsAutoString value;
   GetAttribute(mContent, mPresentationData.mstyle,
                nsGkAtoms::subscriptshift_, value);
   if (!value.IsEmpty()) {
     nsCSSValue cssValue;
     if (ParseNumericValue(value, cssValue) && cssValue.IsLengthUnit()) {
-      mSubScriptShift = CalcLength(GetPresContext(), mStyleContext, cssValue);
+      mSubScriptShift = CalcLength(PresContext(), mStyleContext, cssValue);
     }
   }
   // check if the superscriptshift attribute is there
   GetAttribute(mContent, mPresentationData.mstyle,
                nsGkAtoms::superscriptshift_, value);
   if (!value.IsEmpty()) {
     nsCSSValue cssValue;
     if (ParseNumericValue(value, cssValue) && cssValue.IsLengthUnit()) {
-      mSupScriptShift = CalcLength(GetPresContext(), mStyleContext, cssValue);
+      mSupScriptShift = CalcLength(PresContext(), mStyleContext, cssValue);
     }
   }
 }
 
 NS_IMETHODIMP
 nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext,
                                   PRBool               aPlaceOrigin,
                                   nsHTMLReflowMetrics& aDesiredSize)
@@ -166,17 +166,17 @@ nsMathMLmmultiscriptsFrame::Place(nsIRen
   fm->GetXHeight (xHeight);
 
   nscoord ruleSize;
   GetRuleThickness (aRenderingContext, fm, ruleSize);
 
   // scriptspace from TeX for extra spacing after sup/subscript (0.5pt in plain TeX)
   // forced to be at least 1 pixel here
   nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1);
-  nscoord scriptSpace = PR_MAX(GetPresContext()->PointsToAppUnits(0.5f), onePixel);
+  nscoord scriptSpace = PR_MAX(PresContext()->PointsToAppUnits(0.5f), onePixel);
 
   /////////////////////////////////////
   // first the shift for the subscript
 
   // subScriptShift{1,2}
   // = minimum amount to shift the subscript down
   // = sub{1,2} in TeXbook
   // subScriptShift1 = subscriptshift attribute * x-height
@@ -413,17 +413,17 @@ nsMathMLmmultiscriptsFrame::Place(nsIRen
 
     count = 0;
     childFrame = mprescriptsFrame;
     do {
       if (!childFrame) { // end of prescripts,
         // place the base ...
         childFrame = baseFrame;
         dy = aDesiredSize.ascent - baseSize.ascent;
-        FinishReflowChild (baseFrame, GetPresContext(), nsnull, baseSize, dx, dy, 0);
+        FinishReflowChild (baseFrame, PresContext(), nsnull, baseSize, dx, dy, 0);
         dx += bmBase.width + italicCorrection;
       }
       else if (mprescriptsFrame != childFrame) {
         // process each sup/sub pair
         if (0 == count) {
           subScriptFrame = childFrame;
           count = 1;
         }
@@ -436,22 +436,22 @@ nsMathMLmmultiscriptsFrame::Place(nsIRen
           GetReflowAndBoundingMetricsFor(subScriptFrame, subScriptSize, bmSubScript);
           GetReflowAndBoundingMetricsFor(supScriptFrame, supScriptSize, bmSupScript);
 
           // center w.r.t. largest width
           width = PR_MAX(subScriptSize.width, supScriptSize.width);
 
           dy = aDesiredSize.ascent - subScriptSize.ascent +
             maxSubScriptShift;
-          FinishReflowChild (subScriptFrame, GetPresContext(), nsnull, subScriptSize,
+          FinishReflowChild (subScriptFrame, PresContext(), nsnull, subScriptSize,
                              dx + (width-subScriptSize.width)/2, dy, 0);
 
           dy = aDesiredSize.ascent - supScriptSize.ascent -
             maxSupScriptShift;
-          FinishReflowChild (supScriptFrame, GetPresContext(), nsnull, supScriptSize,
+          FinishReflowChild (supScriptFrame, PresContext(), nsnull, supScriptSize,
                              dx + (width-supScriptSize.width)/2, dy, 0);
 
           dx += width + scriptSpace;
         }
       }
       childFrame = childFrame->GetNextSibling();
     } while (mprescriptsFrame != childFrame);
   }
--- a/layout/mathml/base/src/nsMathMLmoFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmoFrame.cpp
@@ -165,17 +165,17 @@ nsMathMLmoFrame::ProcessTextData(PRBool 
       (ch == kInvisibleComma || 
        ch == kApplyFunction  || 
        ch == kInvisibleTimes)) {
     mFlags |= NS_MATHML_OPERATOR_INVISIBLE;
   }
 
   // don't bother doing anything special if we don't have a
   // single child with a visible text content
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   if (NS_MATHML_OPERATOR_IS_INVISIBLE(mFlags) || mFrames.GetLength() != 1) {
     data.Truncate(); // empty data to reset the char
     mMathMLChar.SetData(presContext, data);
     ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mMathMLChar, PR_FALSE);
     return;
   }
 
   // special... in math mode, the usual minus sign '-' looks too short, so
@@ -312,17 +312,17 @@ nsMathMLmoFrame::ProcessOperatorData()
 
      // ---------------------------------------------------------------------
      // we will be called again to re-sync the rest of our state next time...
      // (nobody needs the other values below at this stage)
      mFlags |= form;
      return;
   }
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   // beware of bug 133814 - there is a two-way dependency in the
   // embellished hierarchy: our embellished ancestors need to set
   // their flags based on some of our state (set above), and here we
   // need to re-sync our 'form' depending on our outermost embellished
   // container. A null form here means that an earlier attempt to stretch
   // our mMathMLChar failed, in which case we don't bother re-stretching again
   if (form) {
@@ -742,17 +742,17 @@ nsMathMLmoFrame::Stretch(nsIRenderingCon
           height = container.ascent + container.descent;
           container.descent = aContainerSize.descent;
           container.ascent = height - container.descent;
         }
       }
     }
 
     // let the MathMLChar stretch itself...
-    nsresult res = mMathMLChar.Stretch(GetPresContext(), aRenderingContext,
+    nsresult res = mMathMLChar.Stretch(PresContext(), aRenderingContext,
                                        aStretchDirection, container, charSize, stretchHint);
     if (NS_FAILED(res)) {
       // gracefully handle cases where stretching the char failed (i.e., GetBoundingMetrics failed)
       // clear our 'form' to behave as if the operator wasn't in the dictionary
       mFlags &= ~NS_MATHML_OPERATOR_FORM;
       useMathMLChar = PR_FALSE;
     }
     else {
--- a/layout/mathml/base/src/nsMathMLmoverFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmoverFrame.cpp
@@ -251,21 +251,21 @@ i.e.:
 NS_IMETHODIMP
 nsMathMLmoverFrame::Place(nsIRenderingContext& aRenderingContext,
                           PRBool               aPlaceOrigin,
                           nsHTMLReflowMetrics& aDesiredSize)
 { 
   if ( NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
       !NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags)) {
     // place like superscript
-    return nsMathMLmsupFrame::PlaceSuperScript(GetPresContext(),
+    return nsMathMLmsupFrame::PlaceSuperScript(PresContext(),
                                                aRenderingContext,
                                                aPlaceOrigin,
                                                aDesiredSize,
-                                               this, 0, GetPresContext()->PointsToAppUnits(0.5f));
+                                               this, 0, PresContext()->PointsToAppUnits(0.5f));
   }
 
   ////////////////////////////////////
   // Get the children's desired sizes
 
   nsBoundingMetrics bmBase, bmOver;
   nsHTMLReflowMetrics baseSize;
   nsHTMLReflowMetrics overSize;
@@ -398,16 +398,16 @@ nsMathMLmoverFrame::Place(nsIRenderingCo
   aDesiredSize.mBoundingMetrics = mBoundingMetrics;
 
   mReference.x = 0;
   mReference.y = aDesiredSize.ascent;
 
   if (aPlaceOrigin) {
     // place base
     nscoord dy = aDesiredSize.ascent - baseSize.ascent;
-    FinishReflowChild (baseFrame, GetPresContext(), nsnull, baseSize, dxBase, dy, 0);
+    FinishReflowChild (baseFrame, PresContext(), nsnull, baseSize, dxBase, dy, 0);
     // place overscript
     dy = aDesiredSize.ascent - 
       mBoundingMetrics.ascent + bmOver.ascent - overSize.ascent;
-    FinishReflowChild (overFrame, GetPresContext(), nsnull, overSize, dxOver, dy, 0);
+    FinishReflowChild (overFrame, PresContext(), nsnull, overSize, dxOver, dy, 0);
   }
   return NS_OK;
 }
--- a/layout/mathml/base/src/nsMathMLmrootFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmrootFrame.cpp
@@ -87,17 +87,17 @@ nsMathMLmrootFrame::~nsMathMLmrootFrame(
 
 NS_IMETHODIMP
 nsMathMLmrootFrame::Init(nsIContent*      aContent,
                          nsIFrame*        aParent,
                          nsIFrame*        aPrevInFlow)
 {
   nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
   
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
 
   // No need to tract the style context given to our MathML char. 
   // The Style System will use Get/SetAdditionalStyleContext() to keep it
   // up-to-date if dynamic changes arise.
   nsAutoString sqrChar; sqrChar.Assign(kSqrChar);
   mSqrChar.SetData(presContext, sqrChar);
   ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mSqrChar, PR_TRUE);
 
--- a/layout/mathml/base/src/nsMathMLmsqrtFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmsqrtFrame.cpp
@@ -87,17 +87,17 @@ nsMathMLmsqrtFrame::~nsMathMLmsqrtFrame(
 
 NS_IMETHODIMP
 nsMathMLmsqrtFrame::Init(nsIContent*      aContent,
                          nsIFrame*        aParent,
                          nsIFrame*        aPrevInFlow)
 {
   nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
                                              
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
 
   // No need to tract the style context given to our MathML char. 
   // The Style System will use Get/SetAdditionalStyleContext() to keep it
   // up-to-date if dynamic changes arise.
   nsAutoString sqrChar; sqrChar.Assign(kSqrChar);
   mSqrChar.SetData(presContext, sqrChar);
   ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mSqrChar, PR_TRUE);
 
--- a/layout/mathml/base/src/nsMathMLmstyleFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmstyleFrame.cpp
@@ -155,17 +155,17 @@ nsMathMLmstyleFrame::UpdatePresentationD
 }
 
 NS_IMETHODIMP
 nsMathMLmstyleFrame::AttributeChanged(PRInt32         aNameSpaceID,
                                       nsIAtom*        aAttribute,
                                       PRInt32         aModType)
 {
   // Attributes common to MathML tags
-  if (CommonAttributeChangedFor(GetPresContext(), mContent, aAttribute))
+  if (CommonAttributeChangedFor(PresContext(), mContent, aAttribute))
     return NS_OK;
 
   // Other attributes can affect too many things, ask our parent to re-layout
   // its children so that we can pick up changes in our attributes & transmit
   // them in our subtree. However, our siblings will be re-laid too. We used
   // to have a more speedier but more verbose alternative that didn't re-layout
   // our siblings. See bug 114909 - attachment 67668.
   return ReLayoutChildren(mParent);
--- a/layout/mathml/base/src/nsMathMLmsubFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmsubFrame.cpp
@@ -82,31 +82,31 @@ nsMathMLmsubFrame::TransmitAutomaticData
 }
 
 NS_IMETHODIMP
 nsMathMLmsubFrame::Place (nsIRenderingContext& aRenderingContext,
                           PRBool               aPlaceOrigin,
                           nsHTMLReflowMetrics& aDesiredSize)
 {
   // extra spacing after sup/subscript
-  nscoord scriptSpace = GetPresContext()->PointsToAppUnits(0.5f); // 0.5pt as in plain TeX
+  nscoord scriptSpace = PresContext()->PointsToAppUnits(0.5f); // 0.5pt as in plain TeX
 
   // check if the subscriptshift attribute is there
   nscoord subScriptShift = 0;
   nsAutoString value;
   GetAttribute(mContent, mPresentationData.mstyle,
                nsGkAtoms::subscriptshift_, value);
   if (!value.IsEmpty()) {
     nsCSSValue cssValue;
     if (ParseNumericValue(value, cssValue) && cssValue.IsLengthUnit()) {
-      subScriptShift = CalcLength(GetPresContext(), mStyleContext, cssValue);
+      subScriptShift = CalcLength(PresContext(), mStyleContext, cssValue);
     }
   }
 
-  return nsMathMLmsubFrame::PlaceSubScript(GetPresContext(), 
+  return nsMathMLmsubFrame::PlaceSubScript(PresContext(), 
                                            aRenderingContext,
                                            aPlaceOrigin,
                                            aDesiredSize,
                                            this,
                                            subScriptShift,
                                            scriptSpace);
 }
 
--- a/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp
@@ -97,31 +97,31 @@ nsMathMLmsubsupFrame::Place(nsIRendering
   // check if the subscriptshift attribute is there
   nsAutoString value;
   nscoord subScriptShift = 0;
   GetAttribute(mContent, mPresentationData.mstyle,
                nsGkAtoms::subscriptshift_, value);
   if (!value.IsEmpty()) {
     nsCSSValue cssValue;
     if (ParseNumericValue(value, cssValue) && cssValue.IsLengthUnit()) {
-      subScriptShift = CalcLength(GetPresContext(), mStyleContext, cssValue);
+      subScriptShift = CalcLength(PresContext(), mStyleContext, cssValue);
     }
   }
   // check if the superscriptshift attribute is there
   nscoord supScriptShift = 0;
   GetAttribute(mContent, mPresentationData.mstyle,
                nsGkAtoms::superscriptshift_, value);
   if (!value.IsEmpty()) {
     nsCSSValue cssValue;
     if (ParseNumericValue(value, cssValue) && cssValue.IsLengthUnit()) {
-      supScriptShift = CalcLength(GetPresContext(), mStyleContext, cssValue);
+      supScriptShift = CalcLength(PresContext(), mStyleContext, cssValue);
     }
   }
 
-  return nsMathMLmsubsupFrame::PlaceSubSupScript(GetPresContext(),
+  return nsMathMLmsubsupFrame::PlaceSubSupScript(PresContext(),
                                                  aRenderingContext,
                                                  aPlaceOrigin,
                                                  aDesiredSize,
                                                  this,
                                                  subScriptShift,
                                                  supScriptShift,
                                                  scriptSpace);
 }
--- a/layout/mathml/base/src/nsMathMLmsupFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmsupFrame.cpp
@@ -82,31 +82,31 @@ nsMathMLmsupFrame::TransmitAutomaticData
 }
 
 NS_IMETHODIMP
 nsMathMLmsupFrame::Place(nsIRenderingContext& aRenderingContext,
                          PRBool               aPlaceOrigin,
                          nsHTMLReflowMetrics& aDesiredSize)
 {
   // extra spacing after sup/subscript
-  nscoord scriptSpace = GetPresContext()->PointsToAppUnits(0.5f); // 0.5pt as in plain TeX
+  nscoord scriptSpace = PresContext()->PointsToAppUnits(0.5f); // 0.5pt as in plain TeX
 
   // check if the superscriptshift attribute is there
   nsAutoString value;
   nscoord supScriptShift = 0;
   GetAttribute(mContent, mPresentationData.mstyle,
                nsGkAtoms::superscriptshift_, value);
   if (!value.IsEmpty()) {
     nsCSSValue cssValue;
     if (ParseNumericValue(value, cssValue) && cssValue.IsLengthUnit()) {
-      supScriptShift = CalcLength(GetPresContext(), mStyleContext, cssValue);
+      supScriptShift = CalcLength(PresContext(), mStyleContext, cssValue);
     }
   }
 
-  return nsMathMLmsupFrame::PlaceSuperScript(GetPresContext(), 
+  return nsMathMLmsupFrame::PlaceSuperScript(PresContext(), 
                                              aRenderingContext,
                                              aPlaceOrigin,
                                              aDesiredSize,
                                              this,
                                              supScriptShift,
                                              scriptSpace);
 }
 
--- a/layout/mathml/base/src/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmtableFrame.cpp
@@ -352,17 +352,17 @@ nsMathMLmtableOuterFrame::~nsMathMLmtabl
 }
 
 NS_IMETHODIMP
 nsMathMLmtableOuterFrame::Init(nsIContent*      aContent,
                                nsIFrame*        aParent,
                                nsIFrame*        aPrevInFlow)
 {
   nsresult rv = nsTableOuterFrame::Init(aContent, aParent, aPrevInFlow);
-  nsMathMLFrame::MapCommonAttributesIntoCSS(GetPresContext(), aContent);
+  nsMathMLFrame::MapCommonAttributesIntoCSS(PresContext(), aContent);
   return rv;
 }
 
 NS_IMETHODIMP
 nsMathMLmtableOuterFrame::InheritAutomaticData(nsIFrame* aParent)
 {
   // XXX the REC says that by default, displaystyle=false in <mtable>
 
@@ -414,17 +414,17 @@ nsMathMLmtableOuterFrame::UpdatePresenta
 }
 
 NS_IMETHODIMP
 nsMathMLmtableOuterFrame::AttributeChanged(PRInt32  aNameSpaceID,
                                            nsIAtom* aAttribute,
                                            PRInt32  aModType)
 {
   // Attributes common to MathML tags
-  if (nsMathMLFrame::CommonAttributeChangedFor(GetPresContext(), mContent, aAttribute))
+  if (nsMathMLFrame::CommonAttributeChangedFor(PresContext(), mContent, aAttribute))
     return NS_OK;
 
   // Attributes specific to <mtable>:
   // frame         : in mathml.css
   // framespacing  : not yet supported 
   // groupalign    : not yet supported
   // equalrows     : not yet supported 
   // equalcolumns  : not yet supported 
@@ -442,28 +442,28 @@ nsMathMLmtableOuterFrame::AttributeChang
   if (!tableFrame || tableFrame->GetType() != nsGkAtoms::tableFrame)
     return NS_OK;
   nsIFrame* rgFrame = tableFrame->GetFirstChild(nsnull);
   if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
     return NS_OK;
 
   // align - just need to issue a dirty (resize) reflow command
   if (aAttribute == nsGkAtoms::align) {
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eResize);
     return NS_OK;
   }
 
   // displaystyle - may seem innocuous, but it is actually very harsh --
   // like changing an unit. Blow away and recompute all our automatic
   // presentational data, and issue a style-changed reflow request
   if (aAttribute == nsGkAtoms::displaystyle_) {
     nsMathMLContainerFrame::RebuildAutomaticDataForChildren(mParent);
     nsMathMLContainerFrame::PropagateScriptStyleFor(tableFrame, mPresentationData.scriptLevel);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(mParent, nsIPresShell::eStyleChange);
     return NS_OK;
   }
 
   // ...and the other attributes affect rows or columns in one way or another
   nsIAtom* MOZrowAtom = nsnull;
   nsIAtom* MOZcolAtom = nsnull;
   if (aAttribute == nsGkAtoms::rowalign_)
@@ -496,17 +496,17 @@ nsMathMLmtableOuterFrame::AttributeChang
             MapColAttributesIntoCSS(tableFrame, rowFrame, cellFrame);
           }
         }
       }
     }
   }
 
   // Explicitly request a re-resolve and reflow in our subtree to pick up any changes
-  GetPresContext()->PresShell()->FrameConstructor()->
+  PresContext()->PresShell()->FrameConstructor()->
     PostRestyleEvent(mContent, eReStyle_Self, nsChangeHint_ReflowFrame);
 
   return NS_OK;
 }
 
 nsIFrame*
 nsMathMLmtableOuterFrame::GetRowFrameAt(nsPresContext* aPresContext,
                                         PRInt32         aRowIndex)
@@ -679,17 +679,17 @@ nsMathMLmtableFrame::SetInitialChildList
 
 void
 nsMathMLmtableFrame::RestyleTable()
 {
   // re-sync MathML specific style data that may have changed
   MapAllAttributesIntoCSS(this);
 
   // Explicitly request a re-resolve and reflow in our subtree to pick up any changes
-  GetPresContext()->PresShell()->FrameConstructor()->
+  PresContext()->PresShell()->FrameConstructor()->
     PostRestyleEvent(mContent, eReStyle_Self, nsChangeHint_ReflowFrame);
 }
 
 // --------
 // implementation of nsMathMLmtrFrame
 
 NS_IMPL_ADDREF_INHERITED(nsMathMLmtrFrame, nsTableRowFrame)
 NS_IMPL_RELEASE_INHERITED(nsMathMLmtrFrame, nsTableRowFrame)
@@ -706,27 +706,27 @@ nsMathMLmtrFrame::~nsMathMLmtrFrame()
 }
 
 NS_IMETHODIMP
 nsMathMLmtrFrame::Init(nsIContent* aContent,
                        nsIFrame*   aParent,
                        nsIFrame*   aPrevInFlow)
 {
   nsresult rv = nsTableRowFrame::Init(aContent, aParent, aPrevInFlow);
-  nsMathMLFrame::MapCommonAttributesIntoCSS(GetPresContext(), aContent);
+  nsMathMLFrame::MapCommonAttributesIntoCSS(PresContext(), aContent);
   return rv;
 }
 
 NS_IMETHODIMP
 nsMathMLmtrFrame::AttributeChanged(PRInt32  aNameSpaceID,
                                    nsIAtom* aAttribute,
                                    PRInt32  aModType)
 {
   // Attributes common to MathML tags
-  if (nsMathMLFrame::CommonAttributeChangedFor(GetPresContext(), mContent, aAttribute))
+  if (nsMathMLFrame::CommonAttributeChangedFor(PresContext(), mContent, aAttribute))
     return NS_OK;
 
   // Attributes specific to <mtr>:
   // groupalign  : Not yet supported.
   // rowalign    : Fully specified in mathml.css, and so HasAttributeDependentStyle() will
   //               pick it up and nsCSSFrameConstructor will issue a PostRestyleEvent().
   // columnalign : Need an explicit re-style call.
 
@@ -752,17 +752,17 @@ nsMathMLmtrFrame::AttributeChanged(PRInt
     if (IS_TABLE_CELL(cellFrame->GetType())) {
       cellFrame->GetContent()->
         UnsetAttr(kNameSpaceID_None, nsGkAtoms::MOZcolumnalign, PR_FALSE);
       MapColAttributesIntoCSS(tableFrame, this, cellFrame);
     }
   }
 
   // Explicitly request a re-resolve and reflow in our subtree to pick up any changes
-  GetPresContext()->PresShell()->FrameConstructor()->
+  PresContext()->PresShell()->FrameConstructor()->
     PostRestyleEvent(mContent, eReStyle_Self, nsChangeHint_ReflowFrame);
 
   return NS_OK;
 }
 
 // --------
 // implementation of nsMathMLmtdFrame
 
@@ -781,17 +781,17 @@ nsMathMLmtdFrame::~nsMathMLmtdFrame()
 }
 
 NS_IMETHODIMP
 nsMathMLmtdFrame::Init(nsIContent* aContent,
                        nsIFrame*   aParent,
                        nsIFrame*   aPrevInFlow)
 {
   nsresult rv = nsTableCellFrame::Init(aContent, aParent, aPrevInFlow);
-  nsMathMLFrame::MapCommonAttributesIntoCSS(GetPresContext(), aContent);
+  nsMathMLFrame::MapCommonAttributesIntoCSS(PresContext(), aContent);
   return rv;
 }
 
 PRInt32
 nsMathMLmtdFrame::GetRowSpan()
 {
   PRInt32 rowspan = 1;
 
@@ -829,17 +829,17 @@ nsMathMLmtdFrame::GetColSpan()
 }
 
 NS_IMETHODIMP
 nsMathMLmtdFrame::AttributeChanged(PRInt32  aNameSpaceID,
                                    nsIAtom* aAttribute,
                                    PRInt32  aModType)
 {
   // Attributes common to MathML tags
-  if (nsMathMLFrame::CommonAttributeChangedFor(GetPresContext(), mContent, aAttribute))
+  if (nsMathMLFrame::CommonAttributeChangedFor(PresContext(), mContent, aAttribute))
     return NS_OK;
 
   // Attributes specific to <mtd>:
   // groupalign  : Not yet supported
   // rowalign    : in mathml.css
   // columnalign : here
   // rowspan     : here
   // columnspan  : here
--- a/layout/mathml/base/src/nsMathMLmunderFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmunderFrame.cpp
@@ -248,21 +248,21 @@ i.e.,:
 NS_IMETHODIMP
 nsMathMLmunderFrame::Place(nsIRenderingContext& aRenderingContext,
                            PRBool               aPlaceOrigin,
                            nsHTMLReflowMetrics& aDesiredSize)
 {
   if ( NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
       !NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags)) {
     // place like subscript
-    return nsMathMLmsubFrame::PlaceSubScript(GetPresContext(),
+    return nsMathMLmsubFrame::PlaceSubScript(PresContext(),
                                              aRenderingContext,
                                              aPlaceOrigin,
                                              aDesiredSize,
-                                             this, 0, GetPresContext()->PointsToAppUnits(0.5f));
+                                             this, 0, PresContext()->PointsToAppUnits(0.5f));
   }
 
   ////////////////////////////////////
   // Get the children's desired sizes
 
   nsBoundingMetrics bmBase, bmUnder;
   nsHTMLReflowMetrics baseSize;
   nsHTMLReflowMetrics underSize;
@@ -351,17 +351,17 @@ nsMathMLmunderFrame::Place(nsIRenderingC
   aDesiredSize.mBoundingMetrics = mBoundingMetrics;
 
   mReference.x = 0;
   mReference.y = aDesiredSize.ascent;
 
   if (aPlaceOrigin) {
     nscoord dy = 0;
     // place base
-    FinishReflowChild(baseFrame, GetPresContext(), nsnull, baseSize, dxBase, dy, 0);
+    FinishReflowChild(baseFrame, PresContext(), nsnull, baseSize, dxBase, dy, 0);
     // place underscript
     dy = aDesiredSize.ascent + mBoundingMetrics.descent - bmUnder.descent - underSize.ascent;
-    FinishReflowChild(underFrame, GetPresContext(), nsnull, underSize, dxUnder, dy, 0);
+    FinishReflowChild(underFrame, PresContext(), nsnull, underSize, dxUnder, dy, 0);
   }
 
   return NS_OK;
 }
 
--- a/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp
+++ b/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp
@@ -285,21 +285,21 @@ i.e.,:
 NS_IMETHODIMP
 nsMathMLmunderoverFrame::Place(nsIRenderingContext& aRenderingContext,
                                PRBool               aPlaceOrigin,
                                nsHTMLReflowMetrics& aDesiredSize)
 {
   if ( NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
       !NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags)) {
     // place like sub-superscript pair
-    return nsMathMLmsubsupFrame::PlaceSubSupScript(GetPresContext(),
+    return nsMathMLmsubsupFrame::PlaceSubSupScript(PresContext(),
                                                    aRenderingContext,
                                                    aPlaceOrigin,
                                                    aDesiredSize,
-                                                   this, 0, 0, GetPresContext()->PointsToAppUnits(0.5f));
+                                                   this, 0, 0, PresContext()->PointsToAppUnits(0.5f));
   }
 
   ////////////////////////////////////
   // Get the children's desired sizes
 
   nsBoundingMetrics bmBase, bmUnder, bmOver;
   nsHTMLReflowMetrics baseSize;
   nsHTMLReflowMetrics underSize;
@@ -473,18 +473,18 @@ nsMathMLmunderoverFrame::Place(nsIRender
 
   mReference.x = 0;
   mReference.y = aDesiredSize.ascent;
 
   if (aPlaceOrigin) {
     nscoord dy;
     // place overscript
     dy = aDesiredSize.ascent - mBoundingMetrics.ascent + bmOver.ascent - overSize.ascent;
-    FinishReflowChild (overFrame, GetPresContext(), nsnull, overSize, dxOver, dy, 0);
+    FinishReflowChild (overFrame, PresContext(), nsnull, overSize, dxOver, dy, 0);
     // place base
     dy = aDesiredSize.ascent - baseSize.ascent;
-    FinishReflowChild (baseFrame, GetPresContext(), nsnull, baseSize, dxBase, dy, 0);
+    FinishReflowChild (baseFrame, PresContext(), nsnull, baseSize, dxBase, dy, 0);
     // place underscript
     dy = aDesiredSize.ascent + mBoundingMetrics.descent - bmUnder.descent - underSize.ascent;
-    FinishReflowChild (underFrame, GetPresContext(), nsnull, underSize, dxUnder, dy, 0);
+    FinishReflowChild (underFrame, PresContext(), nsnull, underSize, dxUnder, dy, 0);
   }
   return NS_OK;
 }
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -2612,17 +2612,17 @@ nsComputedDOMStyle::GetBorderWidthFor(PR
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
   NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
 
   nscoord width;
   const nsStyleDisplay *disp = GetStyleDisplay();
   if (mFrame && mFrame->IsThemed(disp)) {
     nsMargin result;
-    nsPresContext *presContext = mFrame->GetPresContext();
+    nsPresContext *presContext = mFrame->PresContext();
     presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(),
                                              mFrame, disp->mAppearance,
                                              &result);
     width = presContext->DevPixelsToAppUnits(result.side(aSide));
   } else {
     width = GetStyleBorder()->GetComputedBorderWidth(aSide);
   }
   val->SetAppUnits(width);
--- a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp
@@ -153,17 +153,17 @@ nsSVGForeignObjectFrame::MarkIntrinsicWi
   // Since we don't know whether this is because of a style change on an
   // ancestor or descendant, mark the kid dirty.  If it's a descendant,
   // all we need is the NS_FRAME_IS_DIRTY_CHILDREN that our caller is
   // going to set, though.
   kid->AddStateBits(NS_FRAME_IS_DIRTY);
   // This is really a style change, except we're already being called
   // from MarkIntrinsicWidthsDirty, so say it's a resize to avoid doing
   // the same work over again.
-  GetPresContext()->PresShell()->FrameNeedsReflow(kid,
+  PresContext()->PresShell()->FrameNeedsReflow(kid,
                                                   nsIPresShell::eResize);
 }
 
 NS_IMETHODIMP
 nsSVGForeignObjectFrame::Reflow(nsPresContext*           aPresContext,
                                 nsHTMLReflowMetrics&     aDesiredSize,
                                 const nsHTMLReflowState& aReflowState,
                                 nsReflowStatus&          aStatus)
@@ -474,17 +474,17 @@ nsSVGForeignObjectFrame::GetCanvasTM()
 //----------------------------------------------------------------------
 // Implementation helpers
 
 void nsSVGForeignObjectFrame::PostChildDirty()
 {
   nsIFrame* kid = GetFirstChild(nsnull);
   if (!kid)
     return;
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(kid, nsIPresShell::eStyleChange);
 }
 
 void nsSVGForeignObjectFrame::UpdateGraphic()
 {
   if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)
     return;
 
@@ -521,17 +521,17 @@ nsSVGForeignObjectFrame::DoReflow()
 {
 #ifdef DEBUG
   printf("**nsSVGForeignObjectFrame::DoReflow()\n");
 #endif
 
   if (mParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)
     return;
 
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsIFrame* kid = GetFirstChild(nsnull);
   if (!kid)
     return;
 
   // initiate a synchronous reflow here and now:  
   nsSize availableSpace(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
   nsCOMPtr<nsIRenderingContext> renderingContext;
   nsIPresShell* presShell = presContext->PresShell();
--- a/layout/svg/base/src/nsSVGGeometryFrame.cpp
+++ b/layout/svg/base/src/nsSVGGeometryFrame.cpp
@@ -80,17 +80,17 @@ nsSVGGeometryFrame::GetPaintServer(const
 
   nsIURI *uri;
   uri = aPaint->mPaint.mPaintServer;
   if (!uri)
     return nsnull;
 
   nsIFrame *result;
   if (NS_FAILED(nsSVGUtils::GetReferencedFrame(&result, uri, mContent,
-                                               GetPresContext()->PresShell())))
+                                               PresContext()->PresShell())))
     return nsnull;
 
   nsIAtom *type = result->GetType();
   if (type != nsGkAtoms::svgLinearGradientFrame &&
       type != nsGkAtoms::svgRadialGradientFrame &&
       type != nsGkAtoms::svgPatternFrame)
     return nsnull;
 
@@ -193,33 +193,33 @@ nsSVGGeometryFrame::DidModifySVGObservab
 float
 nsSVGGeometryFrame::GetStrokeWidth()
 {
   nsSVGElement *ctx = NS_STATIC_CAST(nsSVGElement*,
                                      GetType() == nsGkAtoms::svgGlyphFrame ?
                                      mContent->GetParent() : mContent);
 
   return
-    nsSVGUtils::CoordToFloat(GetPresContext(),
+    nsSVGUtils::CoordToFloat(PresContext(),
                              ctx,
                              GetStyleSVG()->mStrokeWidth);
 }
 
 nsresult
 nsSVGGeometryFrame::GetStrokeDashArray(gfxFloat **aDashes, PRUint32 *aCount)
 {
   *aDashes = nsnull;
   *aCount = 0;
 
   PRUint32 count = GetStyleSVG()->mStrokeDasharrayLength;
   gfxFloat *dashes = nsnull;
 
   if (count) {
     const nsStyleCoord *dasharray = GetStyleSVG()->mStrokeDasharray;
-    nsPresContext *presContext = GetPresContext();
+    nsPresContext *presContext = PresContext();
     gfxFloat totalLength = 0.0f;
 
     dashes = new gfxFloat[count];
     if (dashes) {
       for (PRUint32 i = 0; i < count; i++) {
         dashes[i] =
           nsSVGUtils::CoordToFloat(presContext,
                                    NS_STATIC_CAST(nsSVGElement*, mContent),
@@ -245,17 +245,17 @@ nsSVGGeometryFrame::GetStrokeDashArray(g
 
   return NS_OK;
 }
 
 float
 nsSVGGeometryFrame::GetStrokeDashoffset()
 {
   return
-    nsSVGUtils::CoordToFloat(GetPresContext(),
+    nsSVGUtils::CoordToFloat(PresContext(),
                              NS_STATIC_CAST(nsSVGElement*, mContent),
                              GetStyleSVG()->mStrokeDashoffset);
 }
 
 PRUint16
 nsSVGGeometryFrame::GetClipRule()
 {
   return GetStyleSVG()->mClipRule;
--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
+++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
@@ -667,17 +667,17 @@ nsSVGGlyphFrame::GetHighlight(PRUint32 *
   PRBool hasHighlight =
     (mState & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT;
 
   if (!hasHighlight) {
     NS_ERROR("nsSVGGlyphFrame::GetHighlight() called by renderer when there is no highlight");
     return NS_ERROR_FAILURE;
   }
 
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
 
   // The selection ranges are relative to the uncompressed text in
   // the content element. We'll need the text fragment:
   const nsTextFragment *fragment = mContent->GetText();
   NS_ASSERTION(fragment, "no text");
   
   // get the selection details 
   SelectionDetails *details = nsnull;
@@ -1288,17 +1288,17 @@ void nsSVGGlyphFrame::SelectFont(gfxCont
   cairo_select_font_face(ctx,
                          NS_ConvertUTF16toUTF8(family).get(),
                          slant,
                          weight);
 
   // Since SVG has its own scaling, we really don't want
   // fonts in SVG to respond to the browser's "TextZoom"
   // (Ctrl++,Ctrl+-)
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   float textZoom = presContext->TextZoom();
 
   cairo_set_font_size(ctx, presContext->AppUnitsToDevPixels(fontData->mSize) / textZoom);
 }
 
 void nsSVGGlyphFrame::UpdateGeometry(PRBool bRedraw,
                                      PRBool suppressInvalidation)
 {
--- a/layout/svg/base/src/nsSVGGradientFrame.cpp
+++ b/layout/svg/base/src/nsSVGGradientFrame.cpp
@@ -423,17 +423,17 @@ nsSVGGradientFrame::GetRefedGradientFrom
   nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), href,
                                             mContent->GetCurrentDoc(), base);
 
   // Fetch and store a pointer to the referenced gradient element's frame.
   // Note that we are using *our* frame tree for this call, otherwise we're
   // going to have to get the PresShell in each call
   nsIFrame *nextGrad;
   if (NS_SUCCEEDED(nsSVGUtils::GetReferencedFrame(&nextGrad, targetURI, mContent,
-                                                  GetPresContext()->PresShell()))) {
+                                                  PresContext()->PresShell()))) {
     nsIAtom* frameType = nextGrad->GetType();
     if (frameType != nsGkAtoms::svgLinearGradientFrame && 
         frameType != nsGkAtoms::svgRadialGradientFrame)
       return;
 
     mNextGrad = NS_REINTERPRET_CAST(nsSVGGradientFrame*, nextGrad);
 
     // Add ourselves to the observer list
--- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
@@ -380,32 +380,32 @@ NS_IMETHODIMP
 nsSVGOuterSVGFrame::AttributeChanged(PRInt32         aNameSpaceID,
                                      nsIAtom*        aAttribute,
                                      PRInt32         aModType)
 {
   if (aNameSpaceID == kNameSpaceID_None &&
       !(GetStateBits() & NS_FRAME_FIRST_REFLOW) &&
       (aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height)) {
     AddStateBits(NS_FRAME_IS_DIRTY);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eStyleChange);
   }
 
   return NS_OK;
 }
 
 nsIFrame*
 nsSVGOuterSVGFrame::GetFrameForPoint(const nsPoint& aPoint)
 {
   // XXX This algorithm is really bad. Because we only have a
   // singly-linked list we have to test each and every SVG element for
   // a hit. What we really want is a double-linked list.
 
-  float x = GetPresContext()->AppUnitsToDevPixels(aPoint.x);
-  float y = GetPresContext()->AppUnitsToDevPixels(aPoint.y);
+  float x = PresContext()->AppUnitsToDevPixels(aPoint.x);
+  float y = PresContext()->AppUnitsToDevPixels(aPoint.y);
 
   nsRect thisRect(nsPoint(0,0), GetSize());
   if (!thisRect.Contains(aPoint)) {
     return nsnull;
   }
 
   nsIFrame* hit;
   nsSVGUtils::HitTestChildren(this, x, y, &hit);
@@ -464,17 +464,17 @@ nsSVGOuterSVGFrame::Paint(nsIRenderingCo
   aRenderingContext.SetClipRect(clipRect, nsClipCombine_kIntersect);
   aRenderingContext.Translate(aPt.x, aPt.y);
   nsRect dirtyRect = clipRect - aPt;
 
 #if defined(DEBUG) && defined(SVG_DEBUG_PAINT_TIMING)
   PRTime start = PR_Now();
 #endif
 
-  dirtyRect.ScaleRoundOut(1.0f / GetPresContext()->AppUnitsPerDevPixel());
+  dirtyRect.ScaleRoundOut(1.0f / PresContext()->AppUnitsPerDevPixel());
 
   nsSVGRenderState ctx(&aRenderingContext);
 
   // nquartz fallback paths, which svg tends to trigger, need
   // a non-window context target
 #ifdef XP_MACOSX
   ctx.GetGfxContext()->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA);
 #endif
@@ -506,17 +506,17 @@ nsSVGOuterSVGFrame::GetType() const
 }
 
 //----------------------------------------------------------------------
 // nsSVGOuterSVGFrame methods:
 
 nsresult
 nsSVGOuterSVGFrame::InvalidateRect(nsRect aRect)
 {
-  aRect.ScaleRoundOut(GetPresContext()->AppUnitsPerDevPixel());
+  aRect.ScaleRoundOut(PresContext()->AppUnitsPerDevPixel());
   Invalidate(aRect);
 
   return NS_OK;
 }
 
 PRBool
 nsSVGOuterSVGFrame::IsRedrawSuspended()
 {
@@ -635,17 +635,17 @@ nsSVGOuterSVGFrame::GetCanvasTM()
 
 //----------------------------------------------------------------------
 // Implementation helpers
 
 void nsSVGOuterSVGFrame::InitiateReflow()
 {
   mNeedsReflow = PR_FALSE;
   
-  nsIPresShell* presShell = GetPresContext()->PresShell();
+  nsIPresShell* presShell = PresContext()->PresShell();
   presShell->FrameNeedsReflow(this, nsIPresShell::eStyleChange);
   // XXXbz why is this synchronously flushing reflows, exactly?  If it
   // needs to, why is it not using the presshell's reflow batching
   // instead of hacking its own?
   presShell->FlushPendingNotifications(Flush_OnlyReflow);  
 }
 
 
--- a/layout/svg/base/src/nsSVGPatternFrame.cpp
+++ b/layout/svg/base/src/nsSVGPatternFrame.cpp
@@ -560,17 +560,17 @@ nsSVGPatternFrame::checkURITarget(void) 
   nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI),
     href, mContent->GetCurrentDoc(), base);
 
   // Note that we are using *our* frame tree for this call, 
   // otherwise we're going to have to get the PresShell in each call
   if (NS_SUCCEEDED(
           nsSVGUtils::GetReferencedFrame(&nextPattern, targetURI, 
                                          mContent, 
-                                         GetPresContext()->PresShell()))) {
+                                         PresContext()->PresShell()))) {
     nsIAtom* frameType = nextPattern->GetType();
     if (frameType != nsGkAtoms::svgPatternFrame)
       return PR_FALSE;
     mNextPattern = (nsSVGPatternFrame *)nextPattern;
     // Are we looping?
     if (mNextPattern->mLoopFlag) {
       // Yes, remove the reference and return an error
       NS_WARNING("Pattern loop detected!");
--- a/layout/svg/base/src/nsSVGTextPathFrame.cpp
+++ b/layout/svg/base/src/nsSVGTextPathFrame.cpp
@@ -176,17 +176,17 @@ nsSVGTextPathFrame::GetPathFrame() {
   mHref->GetAnimVal(str);
 
   nsCOMPtr<nsIURI> targetURI;
   nsCOMPtr<nsIURI> base = mContent->GetBaseURI();
   nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), str,
                                             mContent->GetCurrentDoc(), base);
 
   nsSVGUtils::GetReferencedFrame(&path, targetURI, mContent,
-                                 GetPresContext()->PresShell());
+                                 PresContext()->PresShell());
   if (!path || (path->GetType() != nsGkAtoms::svgPathGeometryFrame))
     return nsnull;
   return path;
 }
 
 nsSVGFlattenedPath *
 nsSVGTextPathFrame::GetFlattenedPath() {
   nsIFrame *path = GetPathFrame();
--- a/layout/tables/BasicTableLayoutStrategy.cpp
+++ b/layout/tables/BasicTableLayoutStrategy.cpp
@@ -120,17 +120,17 @@ GetWidthInfo(nsIRenderingContext *aRende
     switch (aStylePos->mWidth.GetUnit()) {
         case eStyleUnit_Coord: {
                 hasSpecifiedWidth = PR_TRUE;
                 nscoord w = aStylePos->mWidth.GetCoordValue();
                 // Quirk: A cell with "nowrap" set and a coord value for the
                 // width which is bigger than the intrinsic minimum width uses
                 // that coord value as the minimum width.
                 if (aCellFrame && w > minCoord &&
-                    aCellFrame->GetPresContext()->CompatibilityMode() ==
+                    aCellFrame->PresContext()->CompatibilityMode() ==
                       eCompatibility_NavQuirks &&
                     aCellFrame->GetContent()->HasAttr(kNameSpaceID_None,
                                                       nsGkAtoms::nowrap)) {
                     minCoord = w;
                 }
                 prefCoord = PR_MAX(w, minCoord);
             }
             break;
@@ -219,17 +219,17 @@ GetColWidthInfo(nsIRenderingContext *aRe
  */
 void
 BasicTableLayoutStrategy::ComputeColumnIntrinsicWidths(nsIRenderingContext* aRenderingContext)
 {
     nsTableFrame *tableFrame = mTableFrame;
     nsTableCellMap *cellMap = tableFrame->GetCellMap();
 
     nscoord spacing = tableFrame->GetCellSpacingX();
-    SpanningCellSorter spanningCells(tableFrame->GetPresContext()->PresShell());
+    SpanningCellSorter spanningCells(tableFrame->PresContext()->PresShell());
 
     // Loop over the columns to consider the columns and cells *without*
     // a colspan.
     PRInt32 col, col_end;
     for (col = 0, col_end = cellMap->GetColCount(); col < col_end; ++col) {
         nsTableColFrame *colFrame = tableFrame->GetColFrame(col);
         if (!colFrame) {
             NS_ERROR("column frames out of sync with cell map");
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -1191,17 +1191,17 @@ nsTableCellMap::SetBCBorderCorner(Corner
     bcData->SetCorner(aSubSize, aOwner, aBevel);
   }
   else NS_ERROR("program error: Corner not found");
 }
 
 nsCellMap::nsCellMap(nsTableRowGroupFrame& aRowGroup, PRBool aIsBC)
   : mRows(8), mContentRowCount(0), mRowGroupFrame(&aRowGroup),
     mNextSibling(nsnull), mIsBC(aIsBC),
-    mPresContext(aRowGroup.GetPresContext())
+    mPresContext(aRowGroup.PresContext())
 {
   MOZ_COUNT_CTOR(nsCellMap);
   NS_ASSERTION(mPresContext, "Must have prescontext");
 }
 
 nsCellMap::~nsCellMap()
 {
   MOZ_COUNT_DTOR(nsCellMap);
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -169,17 +169,17 @@ nsTableCellFrame::NeedsToObserve(const n
   if (fType == nsGkAtoms::tableFrame) {
     return PR_TRUE;
   }
 
   // We need the observer to be propagated to all children of the cell
   // (i.e., children of the child block) in quirks mode, but only to
   // tables in standards mode.
   return rs->frame == this &&
-         (GetPresContext()->CompatibilityMode() == eCompatibility_NavQuirks ||
+         (PresContext()->CompatibilityMode() == eCompatibility_NavQuirks ||
           fType == nsGkAtoms::tableOuterFrame);
 }
 
 nsresult 
 nsTableCellFrame::GetRowIndex(PRInt32 &aRowIndex) const
 {
   nsresult result;
   nsTableRowFrame* row = NS_STATIC_CAST(nsTableRowFrame*, GetParent());
@@ -271,17 +271,17 @@ inline nscolor EnsureDifferentColors(nsc
 
 void
 nsTableCellFrame::DecorateForSelection(nsIRenderingContext& aRenderingContext,
                                        nsPoint aPt)
 {
   NS_ASSERTION(GetStateBits() & NS_FRAME_SELECTED_CONTENT,
                "Should only be called for selected cells");
   PRInt16 displaySelection;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   displaySelection = DisplaySelection(presContext);
   if (displaySelection) {
     nsFrameSelection *frameSelection = presContext->PresShell()->FrameSelection();
 
     if (frameSelection->GetTableCellSelection()) {
       nscolor       bordercolor;
       if (displaySelection == nsISelectionController::SELECTION_DISABLED) {
         bordercolor = NS_RGB(176,176,176);// disabled color
@@ -320,17 +320,17 @@ nsTableCellFrame::DecorateForSelection(n
 }
 
 void
 nsTableCellFrame::PaintBackground(nsIRenderingContext& aRenderingContext,
                                   const nsRect&        aDirtyRect,
                                   nsPoint              aPt)
 {
   nsRect rect(aPt, GetSize());
-  nsCSSRendering::PaintBackground(GetPresContext(), aRenderingContext, this,
+  nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this,
                                   aDirtyRect, rect, *GetStyleBorder(),
                                   *GetStylePadding(), PR_TRUE);
 }
 
 // Called by nsTablePainter
 void
 nsTableCellFrame::PaintCellBackground(nsIRenderingContext& aRenderingContext,
                                       const nsRect& aDirtyRect, nsPoint aPt)
@@ -422,17 +422,17 @@ nsTableCellFrame::BuildDisplayList(nsDis
     }
   }
 
   // the 'empty-cells' property has no effect on 'outline'
   nsresult rv = DisplayOutline(aBuilder, aLists);
   NS_ENSURE_SUCCESS(rv, rv);
 
   PRBool quirkyClip = HasPctOverHeight() &&
-    eCompatibility_NavQuirks == GetPresContext()->CompatibilityMode();
+    eCompatibility_NavQuirks == PresContext()->CompatibilityMode();
   nsIFrame* kid = mFrames.FirstChild();
   NS_ASSERTION(kid && !kid->GetNextSibling(), "Table cells should have just one child");
   if (!quirkyClip) {
     // The child's background will go in our BorderBackground() list.
     // This isn't a problem since it won't have a real background except for
     // event handling. We do not call BuildDisplayListForNonBlockChildren
     // because that/ would put the child's background in the Content() list
     // which isn't right (e.g., would end up on top of our child floats for
@@ -580,17 +580,17 @@ void nsTableCellFrame::VerticallyAlignCh
   ConsiderChildOverflow(desiredSize.mOverflowArea, firstKid);
   FinishAndStoreOverflow(&desiredSize);
   if (kidYTop != kidRect.y) {
     // Make sure any child views are correctly positioned. We know the inner table
     // cell won't have a view
     nsContainerFrame::PositionChildViews(firstKid);
   }
   if (HasView()) {
-    nsContainerFrame::SyncFrameViewAfterReflow(GetPresContext(), this,
+    nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this,
                                                GetView(),
                                                &desiredSize.mOverflowArea, 0);
   }
 }
 
 // As per bug 10207, we map 'sub', 'super', 'text-top', 'text-bottom', 
 // length and percentage values to 'baseline'
 // XXX It seems that we don't get to see length and percentage values here
@@ -1076,12 +1076,12 @@ nsBCTableCellFrame::PaintBackground(nsIR
 
   nsStyleBorder myBorder(*GetStyleBorder());
 
   NS_FOR_CSS_SIDES(side) {
     myBorder.SetBorderWidth(side, borderWidth.side(side));
   }
 
   nsRect rect(aPt, GetSize());
-  nsCSSRendering::PaintBackground(GetPresContext(), aRenderingContext, this,
+  nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this,
                                   aDirtyRect, rect, myBorder, *GetStylePadding(),
                                   PR_TRUE);
 }
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -265,17 +265,17 @@ nsTableColGroupFrame::InsertColsReflow(P
 {
   AddColsToTable(aColIndex, PR_TRUE, aFirstFrame, aLastFrame);
 
   nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
   if (!tableFrame)
     return;
 
   tableFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->FrameNeedsReflow(tableFrame,
+  PresContext()->PresShell()->FrameNeedsReflow(tableFrame,
                                                   nsIPresShell::eTreeChange);
 }
 
 void
 nsTableColGroupFrame::RemoveChild(nsTableColFrame& aChild,
                                   PRBool           aResetSubsequentColIndices)
 {
   PRInt32 colIndex = 0;
@@ -297,17 +297,17 @@ nsTableColGroupFrame::RemoveChild(nsTabl
       }
     }
   }
   nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
   if (!tableFrame)
     return;
 
   tableFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->FrameNeedsReflow(tableFrame,
+  PresContext()->PresShell()->FrameNeedsReflow(tableFrame,
                                                   nsIPresShell::eTreeChange);
 }
 
 NS_IMETHODIMP
 nsTableColGroupFrame::RemoveFrame(nsIAtom*        aListName,
                                   nsIFrame*       aOldFrame)
 {
   NS_ASSERTION(!aListName, "unexpected child list");
@@ -321,17 +321,17 @@ nsTableColGroupFrame::RemoveFrame(nsIAto
     
     nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
     if (!tableFrame)
       return NS_ERROR_NULL_POINTER;
 
     tableFrame->RemoveCol(this, colIndex, PR_TRUE, PR_TRUE);
 
     tableFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    GetPresContext()->PresShell()->FrameNeedsReflow(tableFrame,
+    PresContext()->PresShell()->FrameNeedsReflow(tableFrame,
                                                     nsIPresShell::eTreeChange);
   }
   else {
     mFrames.DestroyFrame(aOldFrame);
   }
 
   return NS_OK;
 }
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -410,17 +410,17 @@ void nsTableFrame::AttributeChangedFor(n
         RemoveCell(cellFrame, rowIndex);
         nsAutoVoidArray cells;
         cells.AppendElement(cellFrame);
         InsertCells(cells, rowIndex, colIndex - 1);
 
         AddStateBits(NS_FRAME_IS_DIRTY);
         // XXX Should this use eStyleChange?  It currently doesn't need
         // to, but it might given more optimization.
-        GetPresContext()->PresShell()->FrameNeedsReflow(this,
+        PresContext()->PresShell()->FrameNeedsReflow(this,
           nsIPresShell::eTreeChange);
       }
     }
   }
 }
 
 
 /* ****** CellMap methods ******* */
@@ -696,17 +696,17 @@ nsTableCellMap* nsTableFrame::GetCellMap
   return firstInFlow->mCellMap;
 }
 
 // XXX this needs to be moved to nsCSSFrameConstructor
 nsTableColGroupFrame*
 nsTableFrame::CreateAnonymousColGroupFrame(nsTableColGroupType aColGroupType)
 {
   nsIContent* colGroupContent = GetContent();
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsIPresShell *shell = presContext->PresShell();
 
   nsRefPtr<nsStyleContext> colGroupStyle;
   colGroupStyle = shell->StyleSet()->ResolvePseudoStyleFor(colGroupContent,
                                                            nsCSSAnonBoxes::tableColGroup,
                                                            mStyleContext);
   // Create a col group frame
   nsIFrame* newFrame = NS_NewTableColGroupFrame(shell, colGroupStyle);
@@ -779,17 +779,17 @@ nsTableFrame::CreateAnonymousColFrames(n
                                        nsTableColType        aColType,
                                        PRBool                aAddToColGroupAndTable,         
                                        nsIFrame*             aPrevFrameIn,
                                        nsIFrame**            aFirstNewFrame)
 {
   NS_PRECONDITION(aColGroupFrame, "null frame");
   *aFirstNewFrame = nsnull;
   nsIFrame* lastColFrame = nsnull;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsIPresShell *shell = presContext->PresShell();
 
   // Get the last col frame
   nsIFrame* childFrame = aColGroupFrame->GetFirstChild(nsnull);
   while (childFrame) {
     if (nsGkAtoms::tableColFrame == childFrame->GetType()) {
       lastColFrame = (nsTableColGroupFrame *)childFrame;
     }
@@ -1400,17 +1400,17 @@ nsTableFrame::BuildDisplayList(nsDisplay
 
 // XXX We don't put the borders and backgrounds in tree order like we should.
 // That requires some major surgery which we aren't going to do right now.
 void
 nsTableFrame::PaintTableBorderBackground(nsIRenderingContext& aRenderingContext,
                                          const nsRect& aDirtyRect,
                                          nsPoint aPt)
 {
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsRect dirtyRect = aDirtyRect - aPt;
   nsIRenderingContext::AutoPushTranslation
     translate(&aRenderingContext, aPt.x, aPt.y);
 
   TableBackgroundPainter painter(this, TableBackgroundPainter::eOrigin_Table,
                                  presContext, aRenderingContext, dirtyRect);
   nsresult rv;
   
@@ -1998,17 +1998,17 @@ nsTableFrame::ReflowTable(nsHTMLReflowMe
 
   if (!GetPrevInFlow()) {
     mTableLayoutStrategy->ComputeColumnWidths(aReflowState);
   }
   // Constrain our reflow width to the computed table width (of the 1st in flow).
   // and our reflow height to our avail height minus border, padding, cellspacing
   aDesiredSize.width = aReflowState.ComputedWidth() +
                        aReflowState.mComputedBorderPadding.LeftRight();
-  nsTableReflowState reflowState(*GetPresContext(), aReflowState, *this,
+  nsTableReflowState reflowState(*PresContext(), aReflowState, *this,
                                  aDesiredSize.width, aAvailHeight);
   ReflowChildren(reflowState, aStatus, aLastChildReflowed,
                  aDesiredSize.mOverflowArea);
 
   ReflowColGroups(aReflowState.rendContext);
   return rv;
 }
 
@@ -2082,23 +2082,23 @@ nsTableFrame::PushChildren(const nsAutoV
     nsIFrame* firstBodyFrame = nextInFlow->GetFirstBodyRowGroupFrame();
     nsIFrame* prevSibling = nsnull;
     if (firstBodyFrame) {
       prevSibling = nextInFlow->mFrames.GetPrevSiblingFor(firstBodyFrame);
     }
     // When pushing and pulling frames we need to check for whether any
     // views need to be reparented.
     for (nsIFrame* f = frames.FirstChild(); f; f = f->GetNextSibling()) {
-      nsHTMLContainerFrame::ReparentFrameView(GetPresContext(), f, this, nextInFlow);
+      nsHTMLContainerFrame::ReparentFrameView(PresContext(), f, this, nextInFlow);
     }
     nextInFlow->mFrames.InsertFrames(GetNextInFlow(), prevSibling, frames.FirstChild());
   }
   else {
     // Add the frames to our overflow list
-    SetOverflowFrames(GetPresContext(), frames.FirstChild());
+    SetOverflowFrames(PresContext(), frames.FirstChild());
   }
 }
 
 // Table specific version that takes into account header and footer row group
 // frames that are repeated for continuing table frames
 //
 // Appends the overflow frames to the end of the child list, just like the
 // nsContainerFrame version does, except that there are no assertions that
@@ -2254,17 +2254,17 @@ nsTableFrame::AppendFrames(nsIAtom*     
     f = next;
   }
 
 #ifdef DEBUG_TABLE_CELLMAP
   printf("=== TableFrame::AppendFrames\n");
   Dump(PR_TRUE, PR_TRUE, PR_TRUE);
 #endif
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->FrameNeedsReflow(this,
+  PresContext()->PresShell()->FrameNeedsReflow(this,
                                                   nsIPresShell::eTreeChange);
   SetGeometryDirty();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTableFrame::InsertFrames(nsIAtom*        aListName,
@@ -2362,17 +2362,17 @@ nsTableFrame::InsertFrames(nsIAtom*     
   } else {
     NS_ASSERTION(!aListName, "unexpected child list");
     // Just insert the frame and don't worry about reflowing it
     mFrames.InsertFrame(nsnull, aPrevFrame, aFrameList);
     return NS_OK;
   }
 
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->FrameNeedsReflow(this,
+  PresContext()->PresShell()->FrameNeedsReflow(this,
                                                   nsIPresShell::eTreeChange);
   SetGeometryDirty();
 #ifdef DEBUG_TABLE_CELLMAP
   printf("=== TableFrame::InsertFrames\n");
   Dump(PR_TRUE, PR_TRUE, PR_TRUE);
 #endif
   return NS_OK;
 }
@@ -2442,17 +2442,17 @@ nsTableFrame::RemoveFrame(nsIAtom*      
   }
   // for now, just bail and recalc all of the collapsing borders
   // XXXldb [reflow branch merging 20060830] do we still need this?
   if (IsBorderCollapse()) {
     nsRect damageArea(0, 0, PR_MAX(1, GetColCount()), PR_MAX(1, GetRowCount()));
     SetBCDamageArea(damageArea);
   }
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->FrameNeedsReflow(this,
+  PresContext()->PresShell()->FrameNeedsReflow(this,
                                                   nsIPresShell::eTreeChange);
   SetGeometryDirty();
 #ifdef DEBUG_TABLE_CELLMAP
   printf("=== TableFrame::RemoveFrame\n");
   Dump(PR_TRUE, PR_TRUE, PR_TRUE);
 #endif
   return NS_OK;
 }
@@ -2501,27 +2501,27 @@ nsTableFrame::GetOuterBCBorder() const
     border.left += BC_BORDER_LEFT_HALF_COORD(p2t, propData->mLeftBorderWidth);
   }
   return border;
 }
 
 nsMargin
 nsTableFrame::GetIncludedOuterBCBorder() const
 {
-  if (eCompatibility_NavQuirks == GetPresContext()->CompatibilityMode()) {
+  if (eCompatibility_NavQuirks == PresContext()->CompatibilityMode()) {
     return GetOuterBCBorder();
   }
   nsMargin border(0, 0, 0, 0);
   return border;
 }
 
 nsMargin
 nsTableFrame::GetExcludedOuterBCBorder() const
 {
-  if (eCompatibility_NavQuirks != GetPresContext()->CompatibilityMode()) {
+  if (eCompatibility_NavQuirks != PresContext()->CompatibilityMode()) {
     return GetOuterBCBorder();
   }
   nsMargin border(0, 0, 0, 0);
   return border;
 }
 static
 void GetSeparateModelBorderPadding(const nsHTMLReflowState* aReflowState,
                                    nsStyleContext&          aStyleContext,
@@ -2537,17 +2537,17 @@ void GetSeparateModelBorderPadding(const
   }
 }
 
 nsMargin 
 nsTableFrame::GetChildAreaOffset(const nsHTMLReflowState* aReflowState) const
 {
   nsMargin offset(0,0,0,0);
   if (IsBorderCollapse()) {
-    nsPresContext* presContext = GetPresContext();
+    nsPresContext* presContext = PresContext();
     if (eCompatibility_NavQuirks == presContext->CompatibilityMode()) {
       nsTableFrame* firstInFlow = (nsTableFrame*)GetFirstInFlow(); if (!firstInFlow) ABORT1(offset);
       PRInt32 p2t = nsPresContext::AppUnitsPerCSSPixel();
       BCPropertyData* propData = 
         (BCPropertyData*)nsTableFrame::GetProperty((nsIFrame*)firstInFlow, nsGkAtoms::tableBCProperty, PR_FALSE);
       if (!propData) ABORT1(offset);
 
       offset.top += BC_BORDER_TOP_HALF_COORD(p2t, propData->mTopBorderWidth);
@@ -2578,17 +2578,17 @@ nsTableFrame::GetContentAreaOffset(const
 }
 
 void
 nsTableFrame::InitChildReflowState(nsHTMLReflowState& aReflowState)                                    
 {
   nsMargin collapseBorder;
   nsMargin padding(0,0,0,0);
   nsMargin* pCollapseBorder = nsnull;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   if (IsBorderCollapse()) {
     nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(aReflowState.frame);
     if (rgFrame) {
       pCollapseBorder = rgFrame->GetBCBorderWidth(collapseBorder);
     }
   }
   aReflowState.Init(presContext, -1, -1, pCollapseBorder, &padding);
 
@@ -2603,17 +2603,17 @@ nsTableFrame::InitChildReflowState(nsHTM
 // Position and size aKidFrame and update our reflow state. The origin of
 // aKidRect is relative to the upper-left origin of our frame
 void nsTableFrame::PlaceChild(nsTableReflowState&  aReflowState,
                               nsIFrame*            aKidFrame,
                               nsHTMLReflowMetrics& aKidDesiredSize)
 {
   
   // Place and size the child
-  FinishReflowChild(aKidFrame, GetPresContext(), nsnull, aKidDesiredSize,
+  FinishReflowChild(aKidFrame, PresContext(), nsnull, aKidDesiredSize,
                     aReflowState.x, aReflowState.y, 0);
 
   // Adjust the running y-offset
   aReflowState.y += aKidDesiredSize.height;
 
   // If our height is constrained, then update the available height
   if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height) {
     aReflowState.availSize.height -= aKidDesiredSize.height;
@@ -2713,17 +2713,17 @@ nsTableFrame::ReflowChildren(nsTableRefl
 {
   aStatus = NS_FRAME_COMPLETE;
   aLastChildReflowed = nsnull;
 
   nsIFrame* prevKidFrame = nsnull;
   nsresult  rv = NS_OK;
   nscoord   cellSpacingY = GetCellSpacingY();
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   // XXXldb Should we be checking constrained height instead?
   PRBool isPaginated = presContext->IsPaginated();
 
   aOverflowArea = nsRect (0, 0, 0, 0);
 
   PRBool reflowAllKids = aReflowState.reflowState.ShouldReflowAllKids() ||
                          mBits.mResizedColumns;
 
@@ -2945,17 +2945,17 @@ nsTableFrame::ReflowChildren(nsTableRefl
   return rv;
 }
 
 void
 nsTableFrame::ReflowColGroups(nsIRenderingContext *aRenderingContext)
 {
   if (!GetPrevInFlow() && !HaveReflowedColGroups()) {
     nsHTMLReflowMetrics kidMet;
-    nsPresContext *presContext = GetPresContext();
+    nsPresContext *presContext = PresContext();
     for (nsIFrame* kidFrame = mColGroups.FirstChild(); kidFrame;
          kidFrame = kidFrame->GetNextSibling()) {
       // The column groups don't care about dimensions or reflow states.
       nsHTMLReflowState kidReflowState(presContext, kidFrame,
                                        aRenderingContext, nsSize(0,0));
       nsReflowStatus cgStatus;
       ReflowChild(kidFrame, presContext, kidMet, kidReflowState, 0, 0, 0,
                   cgStatus);
@@ -2981,17 +2981,17 @@ nsTableFrame::CalcDesiredHeight(const ns
   nsAutoVoidArray rowGroups;
   PRUint32 numRowGroups;
   OrderRowGroups(rowGroups, numRowGroups);
   if (numRowGroups <= 0) {
     // tables can be used as rectangular items without content
     nscoord tableSpecifiedHeight = CalcBorderBoxHeight(aReflowState);
     if ((NS_UNCONSTRAINEDSIZE != tableSpecifiedHeight) &&
         (tableSpecifiedHeight > 0) &&
-        eCompatibility_NavQuirks != GetPresContext()->CompatibilityMode()) {
+        eCompatibility_NavQuirks != PresContext()->CompatibilityMode()) {
           // empty tables should not have a size in quirks mode
       aDesiredSize.height = tableSpecifiedHeight;
     } 
     else
       aDesiredSize.height = 0;
     return;
   }
   PRInt32 rowCount = cellMap->GetRowCount();
@@ -6504,17 +6504,17 @@ DestroyBCPropertyDataFunc(void*         
   delete NS_STATIC_CAST(BCPropertyData*, aPropertyValue);
 }
 
 void*
 nsTableFrame::GetProperty(nsIFrame*            aFrame,
                           nsIAtom*             aPropertyName,
                           PRBool               aCreateIfNecessary)
 {
-  nsPropertyTable *propTable = aFrame->GetPresContext()->PropertyTable();
+  nsPropertyTable *propTable = aFrame->PresContext()->PropertyTable();
   void *value = propTable->GetProperty(aFrame, aPropertyName);
   if (value) {
     return (nsPoint*)value;  // the property already exists
   }
   if (aCreateIfNecessary) {
     // The property isn't set yet, so allocate a new value, set the property,
     // and return the newly allocated value
     NSPropertyDtorFunc dtorFunc = nsnull;
--- a/layout/tables/nsTableOuterFrame.cpp
+++ b/layout/tables/nsTableOuterFrame.cpp
@@ -256,17 +256,17 @@ nsTableOuterFrame::AppendFrames(nsIAtom*
                  "appending non-caption frame to captionList");
     mCaptionFrames.AppendFrames(this, aFrameList);
     mCaptionFrame = mCaptionFrames.FirstChild();
     rv = NS_OK;
 
     // Reflow the new caption frame. It's already marked dirty, so
     // just tell the pres shell.
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(mCaptionFrame, nsIPresShell::eTreeChange);
     
   }
   else {
     NS_PRECONDITION(PR_FALSE, "unexpected child list");
     rv = NS_ERROR_UNEXPECTED;
   }
 
@@ -310,17 +310,17 @@ nsTableOuterFrame::RemoveFrame(nsIAtom* 
     mInnerTableFrame->AddStateBits(NS_FRAME_IS_DIRTY);
   }
 
   // Remove the frame and destroy it
   mCaptionFrames.DestroyFrame(aOldFrame);
   mCaptionFrame = mCaptionFrames.FirstChild();
   
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); // also means child removed
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange);
 
   return NS_OK;
 }
 
 NS_METHOD 
 nsTableOuterFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                     const nsRect&           aDirtyRect,
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -192,17 +192,17 @@ nsTableRowFrame::AppendFrames(nsIAtom*  
        childFrame = childFrame->GetNextSibling()) {
     if (IS_TABLE_CELL(childFrame->GetType())) {
       // Add the cell to the cell map
       tableFrame->AppendCell((nsTableCellFrame&)*childFrame, GetRowIndex());
     }
   }
 
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->FrameNeedsReflow(this,
+  PresContext()->PresShell()->FrameNeedsReflow(this,
                                                   nsIPresShell::eTreeChange);
   tableFrame->SetGeometryDirty();
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
@@ -233,17 +233,17 @@ nsTableRowFrame::InsertFrames(nsIAtom*  
     prevCellFrame->GetColIndex(colIndex);
   }
   tableFrame->InsertCells(cellChildren, GetRowIndex(), colIndex);
 
   // Insert the frames in the frame list
   mFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
   
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->FrameNeedsReflow(this,
+  PresContext()->PresShell()->FrameNeedsReflow(this,
                                                   nsIPresShell::eTreeChange);
   tableFrame->SetGeometryDirty();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTableRowFrame::RemoveFrame(nsIAtom*        aListName,
@@ -259,17 +259,17 @@ nsTableRowFrame::RemoveFrame(nsIAtom*   
       cellFrame->GetColIndex(colIndex);
       // remove the cell from the cell map
       tableFrame->RemoveCell(cellFrame, GetRowIndex());
 
       // Remove the frame and destroy it
       mFrames.DestroyFrame(aOldFrame);
 
       AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-      GetPresContext()->PresShell()->FrameNeedsReflow(this,
+      PresContext()->PresShell()->FrameNeedsReflow(this,
                                                     nsIPresShell::eTreeChange);
       tableFrame->SetGeometryDirty();
     }
     else {
       NS_ERROR("unexpected frame type");
       return NS_ERROR_INVALID_ARG;
     }
   }
@@ -364,17 +364,17 @@ nsTableRowFrame::DidResize()
         // to this height, it will get a special height reflow.
       }
     }
     // Get the next child
     childFrame = iter.Next();
   }
   FinishAndStoreOverflow(&desiredSize);
   if (HasView()) {
-    nsContainerFrame::SyncFrameViewAfterReflow(GetPresContext(), this, GetView(), &desiredSize.mOverflowArea, 0);
+    nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this, GetView(), &desiredSize.mOverflowArea, 0);
   }
   // Let our base class do the usual work
 }
 
 // returns max-ascent amongst all cells that have 'vertical-align: baseline'
 // *including* cells with rowspans
 nscoord nsTableRowFrame::GetMaxCellAscent() const
 {
@@ -563,17 +563,17 @@ void
 nsDisplayTableRowBackground::Paint(nsDisplayListBuilder* aBuilder,
     nsIRenderingContext* aCtx, const nsRect& aDirtyRect) {
   nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(mFrame);
 
   nsPoint pt = aBuilder->ToReferenceFrame(mFrame);
   nsIRenderingContext::AutoPushTranslation translate(aCtx, pt.x, pt.y);
   TableBackgroundPainter painter(tableFrame,
                                  TableBackgroundPainter::eOrigin_TableRow,
-                                 mFrame->GetPresContext(), *aCtx,
+                                 mFrame->PresContext(), *aCtx,
                                  aDirtyRect - pt);
   painter.PaintRow(NS_STATIC_CAST(nsTableRowFrame*, mFrame));
 }
 
 NS_IMETHODIMP
 nsTableRowFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                   const nsRect&           aDirtyRect,
                                   const nsDisplayListSet& aLists)
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -195,17 +195,17 @@ static void
 PaintRowGroupBackground(nsIFrame* aFrame, nsIRenderingContext* aCtx,
                         const nsRect& aDirtyRect, nsPoint aPt)
 {
   nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(aFrame);
 
   nsIRenderingContext::AutoPushTranslation translate(aCtx, aPt.x, aPt.y);
   TableBackgroundPainter painter(tableFrame,
                                  TableBackgroundPainter::eOrigin_TableRowGroup,
-                                 aFrame->GetPresContext(), *aCtx,
+                                 aFrame->PresContext(), *aCtx,
                                  aDirtyRect - aPt);
   painter.PaintRowGroup(NS_STATIC_CAST(nsTableRowGroupFrame*, aFrame));
 }
 
 // Handle the child-traversal part of DisplayGenericTablePart
 static nsresult
 DisplayRows(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
             const nsRect& aDirtyRect, const nsDisplayListSet& aLists)
@@ -1338,17 +1338,17 @@ nsTableRowGroupFrame::AppendFrames(nsIAt
   // Append the frames to the sibling chain
   mFrames.AppendFrames(nsnull, aFrameList);
 
   if (rows.Count() > 0) {
     nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
     if (tableFrame) {
       tableFrame->AppendRows(*this, rowIndex, rows);
       AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-      GetPresContext()->PresShell()->FrameNeedsReflow(this,
+      PresContext()->PresShell()->FrameNeedsReflow(this,
                                                     nsIPresShell::eTreeChange);
       tableFrame->SetGeometryDirty();
     }
   }
 
   return NS_OK;
 }
 
@@ -1388,17 +1388,17 @@ nsTableRowGroupFrame::InsertFrames(nsIAt
 
   PRInt32 numRows = rows.Count();
   if (numRows > 0) {
     nsTableRowFrame* prevRow = (nsTableRowFrame *)nsTableFrame::GetFrameAtOrBefore(this, aPrevFrame, nsGkAtoms::tableRowFrame);
     PRInt32 rowIndex = (prevRow) ? prevRow->GetRowIndex() + 1 : startRowIndex;
     tableFrame->InsertRows(*this, rows, rowIndex, PR_TRUE);
 
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    GetPresContext()->PresShell()->FrameNeedsReflow(this,
+    PresContext()->PresShell()->FrameNeedsReflow(this,
                                                     nsIPresShell::eTreeChange);
     tableFrame->SetGeometryDirty();
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTableRowGroupFrame::RemoveFrame(nsIAtom*        aListName,
@@ -1410,17 +1410,17 @@ nsTableRowGroupFrame::RemoveFrame(nsIAto
 
   nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
   if (tableFrame) {
     if (nsGkAtoms::tableRowFrame == aOldFrame->GetType()) {
       // remove the rows from the table (and flag a rebalance)
       tableFrame->RemoveRows((nsTableRowFrame &)*aOldFrame, 1, PR_TRUE);
 
       AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-      GetPresContext()->PresShell()->FrameNeedsReflow(this,
+      PresContext()->PresShell()->FrameNeedsReflow(this,
                                                     nsIPresShell::eTreeChange);
       tableFrame->SetGeometryDirty();
     }
   }
   mFrames.DestroyFrame(aOldFrame);
 
   return NS_OK;
 }
--- a/layout/xul/base/src/grid/nsGridRowLeafFrame.cpp
+++ b/layout/xul/base/src/grid/nsGridRowLeafFrame.cpp
@@ -79,17 +79,17 @@ nsGridRowLeafFrame::GetBorderAndPadding(
   PRInt32 index = 0;
   nsGrid* grid = part->GetGrid(this, &index);
 
   if (!grid) 
     return rv;
 
   PRBool isHorizontal = IsHorizontal();
 
-  nsBoxLayoutState state((nsPresContext*) GetPresContext());
+  nsBoxLayoutState state((nsPresContext*) PresContext());
 
   PRInt32 firstIndex = 0;
   PRInt32 lastIndex = 0;
   nsGridRow* firstRow = nsnull;
   nsGridRow* lastRow = nsnull;
   grid->GetFirstAndLastRow(state, firstIndex, lastIndex, firstRow, lastRow, isHorizontal);
 
   // only the first and last rows can be affected.
--- a/layout/xul/base/src/nsBox.cpp
+++ b/layout/xul/base/src/nsBox.cpp
@@ -278,17 +278,17 @@ nsBox::SetBounds(nsBoxLayoutState& aStat
       SetSize(nsSize(aRect.width, aRect.height));
     else
       SetRect(aRect);
 
     // Nuke the overflow area. The caller is responsible for restoring
     // it if necessary.
     if (aRemoveOverflowArea && (GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN)) {
       // remove the previously stored overflow area
-      GetPresContext()->PropertyTable()->
+      PresContext()->PropertyTable()->
         DeleteProperty(this, nsGkAtoms::overflowAreaProperty);
       RemoveStateBits(NS_FRAME_OUTSIDE_CHILDREN);
     }
 
     if (!(flags & NS_FRAME_NO_MOVE_VIEW))
     {
       nsContainerFrame::PositionFrameView(this);
       if ((rect.x != aRect.x) || (rect.y != aRect.y))
@@ -337,17 +337,17 @@ nsIFrame::GetBorderAndPadding(nsMargin& 
 NS_IMETHODIMP
 nsBox::GetBorder(nsMargin& aMargin)
 {
   aMargin.SizeTo(0,0,0,0);
     
   const nsStyleDisplay* disp = GetStyleDisplay();
   if (disp->mAppearance && gTheme) {
     // Go to the theme for the border.
-    nsPresContext *context = GetPresContext();
+    nsPresContext *context = PresContext();
     if (gTheme->ThemeSupportsWidget(context, this, disp->mAppearance)) {
       nsMargin margin(0, 0, 0, 0);
       gTheme->GetWidgetBorder(context->DeviceContext(), this,
                               disp->mAppearance, &margin);
       aMargin.top = context->DevPixelsToAppUnits(margin.top);
       aMargin.right = context->DevPixelsToAppUnits(margin.right);
       aMargin.bottom = context->DevPixelsToAppUnits(margin.bottom);
       aMargin.left = context->DevPixelsToAppUnits(margin.left);
@@ -361,17 +361,17 @@ nsBox::GetBorder(nsMargin& aMargin)
 }
 
 NS_IMETHODIMP
 nsBox::GetPadding(nsMargin& aMargin)
 {
   const nsStyleDisplay *disp = GetStyleDisplay();
   if (disp->mAppearance && gTheme) {
     // Go to the theme for the padding.
-    nsPresContext *context = GetPresContext();
+    nsPresContext *context = PresContext();
     if (gTheme->ThemeSupportsWidget(context, this, disp->mAppearance)) {
       nsMargin margin(0, 0, 0, 0);
       PRBool useThemePadding;
 
       useThemePadding = gTheme->GetWidgetPadding(context->DeviceContext(),
                                                  this, disp->mAppearance,
                                                  &margin);
       if (useThemePadding) {
--- a/layout/xul/base/src/nsBoxFrame.cpp
+++ b/layout/xul/base/src/nsBoxFrame.cpp
@@ -165,17 +165,17 @@ nsBoxFrame::~nsBoxFrame()
 
 NS_IMETHODIMP
 nsBoxFrame::SetInitialChildList(nsIAtom*        aListName,
                                 nsIFrame*       aChildList)
 {
   nsresult r = nsContainerFrame::SetInitialChildList(aListName, aChildList);
   if (r == NS_OK) {
     // initialize our list of infos.
-    nsBoxLayoutState state(GetPresContext());
+    nsBoxLayoutState state(PresContext());
     CheckBoxOrder(state);
     if (mLayoutManager)
       mLayoutManager->ChildrenSet(this, state, mFrames.FirstChild());
   } else {
     NS_WARNING("Warning add child failed!!\n");
   }
 
   return r;
@@ -639,17 +639,17 @@ static void printSize(char * aDesc, nsco
 #endif
 
 /* virtual */ nscoord
 nsBoxFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
 {
   nscoord result;
   DISPLAY_MIN_WIDTH(this, result);
 
-  nsBoxLayoutState state(GetPresContext(), aRenderingContext);
+  nsBoxLayoutState state(PresContext(), aRenderingContext);
   nsSize minSize = GetMinSize(state);
 
   // GetMinSize returns border-box width, and we want to return content
   // width.  Since Reflow uses the reflow state's border and padding, we
   // actually just want to subtract what GetMinSize added, which is the
   // result of GetBorderAndPadding.
   nsMargin bp;
   GetBorderAndPadding(bp);
@@ -660,17 +660,17 @@ nsBoxFrame::GetMinWidth(nsIRenderingCont
 }
 
 /* virtual */ nscoord
 nsBoxFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
 {
   nscoord result;
   DISPLAY_PREF_WIDTH(this, result);
 
-  nsBoxLayoutState state(GetPresContext(), aRenderingContext);
+  nsBoxLayoutState state(PresContext(), aRenderingContext);
   nsSize prefSize = GetPrefSize(state);
 
   // GetPrefSize returns border-box width, and we want to return content
   // width.  Since Reflow uses the reflow state's border and padding, we
   // actually just want to subtract what GetPrefSize added, which is the
   // result of GetBorderAndPadding.
   nsMargin bp;
   GetBorderAndPadding(bp);
@@ -996,102 +996,102 @@ nsBoxFrame::MarkIntrinsicWidthsDirty()
 {
   SizeNeedsRecalc(mPrefSize);
   SizeNeedsRecalc(mMinSize);
   SizeNeedsRecalc(mMaxSize);
   CoordNeedsRecalc(mFlex);
   CoordNeedsRecalc(mAscent);
 
   if (mLayoutManager) {
-    nsBoxLayoutState state(GetPresContext());
+    nsBoxLayoutState state(PresContext());
     mLayoutManager->IntrinsicWidthsDirty(this, state);
   }
 
   // Don't call base class method, since everything it does is within an
   // IsBoxWrapped check.
 }
 
 NS_IMETHODIMP
 nsBoxFrame::RemoveFrame(nsIAtom*        aListName,
                         nsIFrame*       aOldFrame)
 {
   NS_PRECONDITION(!aListName, "We don't support out-of-flow kids");
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsBoxLayoutState state(presContext);
 
   // remove the child frame
   mFrames.RemoveFrame(aOldFrame);
 
   // notify the layout manager
   if (mLayoutManager)
     mLayoutManager->ChildrenRemoved(this, state, aOldFrame);
 
   // destroy the child frame
   aOldFrame->Destroy();
 
   // mark us dirty and generate a reflow command
   mState |= NS_FRAME_HAS_DIRTY_CHILDREN;
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsBoxFrame::InsertFrames(nsIAtom*        aListName,
                          nsIFrame*       aPrevFrame,
                          nsIFrame*       aFrameList)
 {
    NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == this,
                 "inserting after sibling frame with different parent");
    NS_PRECONDITION(!aListName, "We don't support out-of-flow kids");
-   nsBoxLayoutState state(GetPresContext());
+   nsBoxLayoutState state(PresContext());
 
    // insert the child frames
    mFrames.InsertFrames(this, aPrevFrame, aFrameList);
 
    // notify the layout manager
    if (mLayoutManager)
      mLayoutManager->ChildrenInserted(this, state, aPrevFrame, aFrameList);
 
 #ifdef DEBUG_LAYOUT
    // if we are in debug make sure our children are in debug as well.
    if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
        SetDebugOnChildList(state, mFrames.FirstChild(), PR_TRUE);
 #endif
 
    mState |= NS_FRAME_HAS_DIRTY_CHILDREN;
-   GetPresContext()->PresShell()->
+   PresContext()->PresShell()->
      FrameNeedsReflow(this, nsIPresShell::eTreeChange);
    return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsBoxFrame::AppendFrames(nsIAtom*        aListName,
                          nsIFrame*       aFrameList)
 {
    NS_PRECONDITION(!aListName, "We don't support out-of-flow kids");
-   nsBoxLayoutState state(GetPresContext());
+   nsBoxLayoutState state(PresContext());
 
    // append the new frames
    mFrames.AppendFrames(this, aFrameList);
 
    // notify the layout manager
    if (mLayoutManager)
      mLayoutManager->ChildrenAppended(this, state, aFrameList);
 
 #ifdef DEBUG_LAYOUT
    // if we are in debug make sure our children are in debug as well.
    if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
        SetDebugOnChildList(state, mFrames.FirstChild(), PR_TRUE);
 #endif
 
    if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
      mState |= NS_FRAME_HAS_DIRTY_CHILDREN;
-     GetPresContext()->PresShell()->
+     PresContext()->PresShell()->
        FrameNeedsReflow(this, nsIPresShell::eTreeChange);
    }
    return NS_OK;
 }
 
 
 
 NS_IMETHODIMP
@@ -1196,37 +1196,37 @@ nsBoxFrame::AttributeChanged(PRInt32 aNa
              aAttribute == nsGkAtoms::top) {
       mState &= ~NS_STATE_STACK_NOT_POSITIONED;
     }
     else if (aAttribute == nsGkAtoms::mousethrough) {
       UpdateMouseThrough();
     }
 
     mState |= NS_FRAME_IS_DIRTY;
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eStyleChange);
   }
   else if (aAttribute == nsGkAtoms::ordinal) {
-    nsBoxLayoutState state(GetPresContext());
+    nsBoxLayoutState state(PresContext());
 
     nsIFrame* frameToMove = this;
     if (GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
-      GetPresContext()->PresShell()->GetPlaceholderFrameFor(this,
+      PresContext()->PresShell()->GetPlaceholderFrameFor(this,
                                                             &frameToMove);
       NS_ASSERTION(frameToMove, "Out of flow without placeholder?");
     }
     
     nsIBox* parent = frameToMove->GetParentBox();
     // If our parent is not a box, there's not much we can do... but in that
     // case our ordinal doesn't matter anyway, so that's ok.
     if (parent) {
       parent->RelayoutChildAtOrdinal(state, frameToMove);
       mState |= NS_FRAME_IS_DIRTY;
       // XXXldb Should this instead be a tree change on the child or parent?
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(frameToMove, nsIPresShell::eStyleChange);
     }
   }
   // If the accesskey changed, register for the new value
   // The old value has been unregistered in nsXULElement::SetAttr
   else if (aAttribute == nsGkAtoms::accesskey) {
     RegUnregAccessKey(PR_TRUE);
   }
@@ -1920,17 +1920,17 @@ nsBoxFrame::RegUnregAccessKey(PRBool aDo
   nsAutoString accessKey;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accessKey);
 
   if (accessKey.IsEmpty())
     return NS_OK;
 
   // With a valid PresContext we can get the ESM 
   // and register the access key
-  nsIEventStateManager *esm = GetPresContext()->EventStateManager();
+  nsIEventStateManager *esm = PresContext()->EventStateManager();
 
   nsresult rv;
 
   PRUint32 key = accessKey.First();
   if (aDoReg)
     rv = esm->RegisterAccessKey(mContent, key);
   else
     rv = esm->UnregisterAccessKey(mContent, key);
@@ -1938,17 +1938,17 @@ nsBoxFrame::RegUnregAccessKey(PRBool aDo
   return rv;
 }
 
 void
 nsBoxFrame::FireDOMEventSynch(const nsAString& aDOMEventName, nsIContent *aContent)
 {
   // XXX This will be deprecated, because it is not good to fire synchronous DOM events
   // from layout. It's better to use nsFrame::FireDOMEvent() which is asynchronous.
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsIContent *content = aContent ? aContent : mContent;
   if (content && presContext) {
     // Fire a DOM event
     nsCOMPtr<nsIDOMEvent> event;
     if (NS_SUCCEEDED(nsEventDispatcher::CreateEvent(presContext, nsnull,
                                                     NS_LITERAL_STRING("Events"),
                                                     getter_AddRefs(event)))) {
       event->InitEvent(aDOMEventName, PR_TRUE, PR_TRUE);
--- a/layout/xul/base/src/nsButtonBoxFrame.cpp
+++ b/layout/xul/base/src/nsButtonBoxFrame.cpp
@@ -150,13 +150,13 @@ nsButtonBoxFrame::DoMouseClick(nsGUIEven
   if(aEvent) {
     event.isShift = ((nsInputEvent*)(aEvent))->isShift;
     event.isControl = ((nsInputEvent*)(aEvent))->isControl;
     event.isAlt = ((nsInputEvent*)(aEvent))->isAlt;
     event.isMeta = ((nsInputEvent*)(aEvent))->isMeta;
   }
 
   // Have the content handle the event, propagating it according to normal DOM rules.
-  nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+  nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
   if (shell) {
     shell->HandleDOMEventWithTarget(mContent, &event, &status);
   }
 }
--- a/layout/xul/base/src/nsDeckFrame.cpp
+++ b/layout/xul/base/src/nsDeckFrame.cpp
@@ -86,17 +86,17 @@ nsDeckFrame::AttributeChanged(PRInt32   
                               PRInt32         aModType)
 {
   nsresult rv = nsBoxFrame::AttributeChanged(aNameSpaceID, aAttribute,
                                              aModType);
 
 
    // if the index changed hide the old element and make the new element visible
   if (aAttribute == nsGkAtoms::selectedIndex) {
-    IndexChanged(GetPresContext());
+    IndexChanged(PresContext());
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsDeckFrame::Init(nsIContent*     aContent,
                   nsIFrame*       aParent,
--- a/layout/xul/base/src/nsGroupBoxFrame.cpp
+++ b/layout/xul/base/src/nsGroupBoxFrame.cpp
@@ -147,17 +147,17 @@ nsGroupBoxFrame::BuildDisplayList(nsDisp
 void
 nsGroupBoxFrame::PaintBorderBackground(nsIRenderingContext& aRenderingContext,
     nsPoint aPt, const nsRect& aDirtyRect) {
   PRIntn skipSides = 0;
   const nsStyleBorder* borderStyleData = GetStyleBorder();
   const nsStylePadding* paddingStyleData = GetStylePadding();
   const nsMargin& border = borderStyleData->GetBorder();
   nscoord yoff = 0;
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   nsRect groupRect;
   nsIBox* groupBox = GetCaptionBox(presContext, groupRect);
 
   if (groupBox) {        
     // if the border is smaller than the legend. Move the border down
     // to be centered on the legend. 
     nsMargin groupMargin;
--- a/layout/xul/base/src/nsImageBoxFrame.cpp
+++ b/layout/xul/base/src/nsImageBoxFrame.cpp
@@ -168,17 +168,17 @@ nsImageBoxFrame::AttributeChanged(PRInt3
                                   PRInt32 aModType)
 {
   nsresult rv = nsLeafBoxFrame::AttributeChanged(aNameSpaceID, aAttribute,
                                                  aModType);
 
   if (aAttribute == nsGkAtoms::src) {
     UpdateImage();
     AddStateBits(NS_FRAME_IS_DIRTY);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eStyleChange);
   }
   else if (aAttribute == nsGkAtoms::validate)
     UpdateLoadFlags();
 
   return rv;
 }
 
@@ -503,55 +503,55 @@ NS_IMETHODIMP nsImageBoxFrame::OnStartCo
   nscoord w, h;
   image->GetWidth(&w);
   image->GetHeight(&h);
 
   mIntrinsicSize.SizeTo(nsPresContext::CSSPixelsToAppUnits(w),
                         nsPresContext::CSSPixelsToAppUnits(h));
 
   AddStateBits(NS_FRAME_IS_DIRTY);
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eStyleChange);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsImageBoxFrame::OnStopContainer(imgIRequest *request,
                                                imgIContainer *image)
 {
-  nsBoxLayoutState state(GetPresContext());
+  nsBoxLayoutState state(PresContext());
   this->Redraw(state);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsImageBoxFrame::OnStopDecode(imgIRequest *request,
                                             nsresult aStatus,
                                             const PRUnichar *statusArg)
 {
   if (NS_SUCCEEDED(aStatus))
     // Fire an onload DOM event.
     FireImageDOMEvent(mContent, NS_LOAD);
   else {
     // Fire an onerror DOM event.
     mIntrinsicSize.SizeTo(0, 0);
     AddStateBits(NS_FRAME_IS_DIRTY);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eStyleChange);
     FireImageDOMEvent(mContent, NS_LOAD_ERROR);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsImageBoxFrame::FrameChanged(imgIContainer *container,
                                             gfxIImageFrame *newframe,
                                             nsRect * dirtyRect)
 {
-  nsBoxLayoutState state(GetPresContext());
+  nsBoxLayoutState state(PresContext());
   this->Redraw(state);
 
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS2(nsImageBoxListener, imgIDecoderObserver, imgIContainerObserver)
 
 nsImageBoxListener::nsImageBoxListener()
--- a/layout/xul/base/src/nsLeafBoxFrame.cpp
+++ b/layout/xul/base/src/nsLeafBoxFrame.cpp
@@ -181,17 +181,17 @@ nsLeafBoxFrame::BuildDisplayList(nsDispl
       nsDisplayEventReceiver(this));
 }
 
 /* virtual */ nscoord
 nsLeafBoxFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
 {
   nscoord result;
   DISPLAY_MIN_WIDTH(this, result);
-  nsBoxLayoutState state(GetPresContext(), aRenderingContext);
+  nsBoxLayoutState state(PresContext(), aRenderingContext);
   nsSize minSize = GetMinSize(state);
 
   // GetMinSize returns border-box width, and we want to return content
   // width.  Since Reflow uses the reflow state's border and padding, we
   // actually just want to subtract what GetMinSize added, which is the
   // result of GetBorderAndPadding.
   nsMargin bp;
   GetBorderAndPadding(bp);
@@ -201,17 +201,17 @@ nsLeafBoxFrame::GetMinWidth(nsIRendering
   return result;
 }
 
 /* virtual */ nscoord
 nsLeafBoxFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
 {
   nscoord result;
   DISPLAY_PREF_WIDTH(this, result);
-  nsBoxLayoutState state(GetPresContext(), aRenderingContext);
+  nsBoxLayoutState state(PresContext(), aRenderingContext);
   nsSize prefSize = GetPrefSize(state);
 
   // GetPrefSize returns border-box width, and we want to return content
   // width.  Since Reflow uses the reflow state's border and padding, we
   // actually just want to subtract what GetPrefSize added, which is the
   // result of GetBorderAndPadding.
   nsMargin bp;
   GetBorderAndPadding(bp);
--- a/layout/xul/base/src/nsListBoxBodyFrame.cpp
+++ b/layout/xul/base/src/nsListBoxBodyFrame.cpp
@@ -250,30 +250,30 @@ nsListBoxBodyFrame::Init(nsIContent*    
     NS_ERROR("Unable to install the scrollbar mediator on the listbox widget. You must be using GFX scrollbars.");
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIScrollbarFrame> scrollbarFrame(do_QueryInterface(verticalScrollbar));
   scrollbarFrame->SetScrollbarMediatorContent(GetContent());
 
   nsCOMPtr<nsIFontMetrics> fm;
-  GetPresContext()->DeviceContext()->GetMetricsFor(
+  PresContext()->DeviceContext()->GetMetricsFor(
     GetStyleContext()->GetStyleFont()->mFont, *getter_AddRefs(fm)
     );
   fm->GetHeight(mRowHeight);
 
   return rv;
 }
 
 void
 nsListBoxBodyFrame::Destroy()
 {
   // make sure we cancel any posted callbacks.
   if (mReflowCallbackPosted)
-     GetPresContext()->PresShell()->CancelReflowCallback(this);
+     PresContext()->PresShell()->CancelReflowCallback(this);
 
   // Make sure we tell our listbox's box object we're being destroyed.
   for (nsIFrame *a = mParent; a; a = a->GetParent()) {
     nsIContent *content = a->GetContent();
     nsIDocument *doc;
 
     if (content &&
         content->NodeInfo()->Equals(nsGkAtoms::listbox, kNameSpaceID_XUL) &&
@@ -312,17 +312,17 @@ nsListBoxBodyFrame::AttributeChanged(PRI
       PRInt32 count = rows.ToInteger(&dummy);
       PRInt32 rowHeight = GetRowHeightAppUnits();
       rowHeight = nsPresContext::AppUnitsToIntCSSPixels(rowHeight);
       nsAutoString value;
       value.AppendInt(rowHeight*count);
       mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::minheight, value, PR_FALSE);
 
       AddStateBits(NS_FRAME_IS_DIRTY);
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(this, nsIPresShell::eStyleChange);
     }
   }
   else
     rv = nsBoxFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
 
   return rv;
  
@@ -497,17 +497,17 @@ nsListBoxBodyFrame::ReflowFinished()
      VerticalScroll(mYPosition);
      mAdjustScroll = PR_FALSE;
   }
 
   // if the row height changed then mark everything as a style change. 
   // That will dirty the entire listbox
   if (mRowHeightWasSet) {
     AddStateBits(NS_FRAME_IS_DIRTY);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eStyleChange);
      PRInt32 pos = mCurrentIndex * mRowHeight;
      if (mYPosition != pos) 
        mAdjustScroll = PR_TRUE;
     mRowHeightWasSet = PR_FALSE;
   }
 
   mReflowCallbackPosted = PR_FALSE;
@@ -602,17 +602,17 @@ nsListBoxBodyFrame::ScrollByLines(PRInt3
   ScrollToIndex(scrollIndex);
 
   // we have to do a sync update for mac because if we scroll too quickly
   // w/out going back to the main event loop we can easily scroll the wrong
   // bits and it looks like garbage (bug 63465).
     
   // I'd use Composite here, but it doesn't always work.
   // vm->Composite();
-  GetPresContext()->GetViewManager()->ForceUpdate();
+  PresContext()->GetViewManager()->ForceUpdate();
 
   return NS_OK;
 }
 
 // walks the DOM to get the zero-based row index of the content
 NS_IMETHODIMP
 nsListBoxBodyFrame::GetIndexOfItem(nsIDOMElement* aItem, PRInt32* _retval)
 {
@@ -826,17 +826,17 @@ nsListBoxBodyFrame::ComputeTotalRowCount
   }
 }
 
 void
 nsListBoxBodyFrame::PostReflowCallback()
 {
   if (!mReflowCallbackPosted) {
     mReflowCallbackPosted = PR_TRUE;
-    GetPresContext()->PresShell()->PostReflowCallback(this);
+    PresContext()->PresShell()->PostReflowCallback(this);
   }
 }
 
 ////////// scrolling
 
 NS_IMETHODIMP
 nsListBoxBodyFrame::ScrollToIndex(PRInt32 aRowIndex)
 {
@@ -883,17 +883,17 @@ nsListBoxBodyFrame::InternalPositionChan
 }
 
 NS_IMETHODIMP
 nsListBoxBodyFrame::InternalPositionChanged(PRBool aUp, PRInt32 aDelta)
 {  
   if (aDelta == 0)
     return NS_OK;
 
-  nsPresContext *presContext = GetPresContext();
+  nsPresContext *presContext = PresContext();
   nsBoxLayoutState state(presContext);
 
   // begin timing how long it takes to scroll a row
   PRTime start = PR_Now();
 
   mContent->GetDocument()->FlushPendingNotifications(Flush_OnlyReflow);
 
   PRInt32 visibleRows = 0;
@@ -926,17 +926,17 @@ nsListBoxBodyFrame::InternalPositionChan
   }
 
   // clear frame markers so that CreateRows will re-create
   mTopFrame = mBottomFrame = nsnull; 
   
   mYPosition = mCurrentIndex*mRowHeight;
   mScrolling = PR_TRUE;
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eResize);
   // Flush calls CreateRows
   // XXXbz there has to be a better way to do this than flushing!
   presContext->PresShell()->FlushPendingNotifications(Flush_OnlyReflow);
   mScrolling = PR_FALSE;
   
   VerticalScroll(mYPosition);
 
@@ -1044,52 +1044,52 @@ nsListBoxBodyFrame::CreateRows()
 }
 
 void
 nsListBoxBodyFrame::DestroyRows(PRInt32& aRowsToLose) 
 {
   // We need to destroy frames until our row count has been properly
   // reduced.  A reflow will then pick up and create the new frames.
   nsIFrame* childFrame = GetFirstFrame();
-  nsBoxLayoutState state(GetPresContext());
+  nsBoxLayoutState state(PresContext());
 
   while (childFrame && aRowsToLose > 0) {
     --aRowsToLose;
 
     nsIFrame* nextFrame = childFrame->GetNextSibling();
     RemoveChildFrame(state, childFrame);
 
     mTopFrame = childFrame = nextFrame;
   }
 
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange);
 }
 
 void
 nsListBoxBodyFrame::ReverseDestroyRows(PRInt32& aRowsToLose) 
 {
   // We need to destroy frames until our row count has been properly
   // reduced.  A reflow will then pick up and create the new frames.
   nsIFrame* childFrame = GetLastFrame();
-  nsBoxLayoutState state(GetPresContext());
+  nsBoxLayoutState state(PresContext());
 
   while (childFrame && aRowsToLose > 0) {
     --aRowsToLose;
     
     nsIFrame* prevFrame;
     prevFrame = mFrames.GetPrevSiblingFor(childFrame);
     RemoveChildFrame(state, childFrame);
 
     mBottomFrame = childFrame = prevFrame;
   }
 
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange);
 }
 
 //
 // Get the nsIBox for the first visible listitem, and if none exists,
 // create one.
 //
 nsIBox* 
@@ -1135,17 +1135,17 @@ nsListBoxBodyFrame::GetFirstItemBox(PRIn
   }
 
   if (startContent) {  
     // Either append the new frame, or prepend it (at index 0)
     // XXX check here if frame was even created, it may not have been if
     //     display: none was on listitem content
     PRBool isAppend = mRowsToPrepend <= 0;
     
-    nsPresContext* presContext = GetPresContext();
+    nsPresContext* presContext = PresContext();
     nsCSSFrameConstructor* fc = presContext->PresShell()->FrameConstructor();
     nsIFrame* topFrame = nsnull;
     fc->CreateListBoxContent(presContext, this, nsnull, startContent,
                              &topFrame, isAppend, PR_FALSE, nsnull);
     mTopFrame = topFrame;
     if (mTopFrame) {
       if (aCreated)
         *aCreated = PR_TRUE;
@@ -1184,17 +1184,17 @@ nsListBoxBodyFrame::GetNextItemBox(nsIBo
     if (((PRUint32)i + aOffset + 1) < childCount) {
       // There is a content node that wants a frame.
       nsIContent *nextContent = parentContent->GetChildAt(i + aOffset + 1);
 
       // Either append the new frame, or insert it after the current frame
       PRBool isAppend = result != mLinkupFrame && mRowsToPrepend <= 0;
       nsIFrame* prevFrame = isAppend ? nsnull : aBox;
       
-      nsPresContext* presContext = GetPresContext();
+      nsPresContext* presContext = PresContext();
       nsCSSFrameConstructor* fc = presContext->PresShell()->FrameConstructor();
       fc->CreateListBoxContent(presContext, this, prevFrame, nextContent,
                                &result, isAppend, PR_FALSE, nsnull);
 
       if (result) {
         if (aCreated)
            *aCreated = PR_TRUE;
       } else
@@ -1210,17 +1210,17 @@ nsListBoxBodyFrame::GetNextItemBox(nsIBo
   mBottomFrame = result;
 
   return result->IsBoxFrame() ? result : nsnull;
 }
 
 PRBool
 nsListBoxBodyFrame::ContinueReflow(nscoord height) 
 { 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   if (presContext->PresShell()->IsAccessibilityActive()) {
     // Create all the frames at once so screen readers and
     // onscreen keyboards can see the full list right away
     return PR_TRUE;
   }
 
   if (height <= 0) {
     nsIFrame* lastChild = GetLastFrame();
@@ -1229,59 +1229,59 @@ nsListBoxBodyFrame::ContinueReflow(nscoo
       // We just want to delete everything but the first item.
       startingPoint = GetFirstFrame();
     }
 
     if (lastChild != startingPoint) {
       // We have some hangers on (probably caused by shrinking the size of the window).
       // Nuke them.
       nsIFrame* currFrame = startingPoint->GetNextSibling();
-      nsBoxLayoutState state(GetPresContext());
+      nsBoxLayoutState state(PresContext());
 
       while (currFrame) {
         nsIFrame* nextFrame = currFrame->GetNextSibling();
         RemoveChildFrame(state, currFrame);
         currFrame = nextFrame;
       }
 
       AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     }
     return PR_FALSE;
   }
   else
     return PR_TRUE;
 }
 
 NS_IMETHODIMP
 nsListBoxBodyFrame::ListBoxAppendFrames(nsIFrame* aFrameList)
 {
   // append them after
-  nsBoxLayoutState state(GetPresContext());
+  nsBoxLayoutState state(PresContext());
   mFrames.AppendFrames(nsnull, aFrameList);
   if (mLayoutManager)
     mLayoutManager->ChildrenAppended(this, state, aFrameList);
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsListBoxBodyFrame::ListBoxInsertFrames(nsIFrame* aPrevFrame, nsIFrame* aFrameList)
 {
   // insert the frames to our info list
-  nsBoxLayoutState state(GetPresContext());
+  nsBoxLayoutState state(PresContext());
   mFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
   if (mLayoutManager)
     mLayoutManager->ChildrenInserted(this, state, aPrevFrame, aFrameList);
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange);
 
   return NS_OK;
 }
 
 // 
 // Called by nsCSSFrameConstructor when a new listitem content is inserted.
 //
@@ -1313,17 +1313,17 @@ nsListBoxBodyFrame::OnContentInserted(ns
   } else if (nextSiblingContent) {
     // we may be inserting before a frame that is on screen
     nsIFrame* nextSiblingFrame = shell->GetPrimaryFrameFor(nextSiblingContent);
     mLinkupFrame = nextSiblingFrame;
   }
   
   CreateRows();
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange);
 }
 
 // 
 // Called by nsCSSFrameConstructor when listitem content is removed.
 //
 void
 nsListBoxBodyFrame::OnContentRemoved(nsPresContext* aPresContext, nsIFrame* aChildFrame, PRInt32 aIndex)
@@ -1386,17 +1386,17 @@ nsListBoxBodyFrame::OnContentRemoved(nsP
 
   // Go ahead and delete the frame.
   nsBoxLayoutState state(aPresContext);
   if (aChildFrame) {
     RemoveChildFrame(state, aChildFrame);
   }
 
   AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-  GetPresContext()->PresShell()->
+  PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange);
 }
 
 void
 nsListBoxBodyFrame::GetListItemContentAt(PRInt32 aIndex, nsIContent** aContent)
 {
   *aContent = nsnull;
   nsIContent* listboxContent = mContent->GetBindingParent();
@@ -1446,17 +1446,17 @@ nsListBoxBodyFrame::GetListItemNextSibli
 
   aSiblingIndex = -1; // no match, so there is no next sibling
 }
 
 void
 nsListBoxBodyFrame::RemoveChildFrame(nsBoxLayoutState &aState,
                                      nsIFrame         *aFrame)
 {
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsCSSFrameConstructor* fc = presContext->PresShell()->FrameConstructor();
   fc->RemoveMappingsForFrameSubtree(aFrame);
 
 #ifdef DEBUG
   PRBool removed =
 #endif
     mFrames.RemoveFrame(aFrame);
   NS_ASSERTION(removed,
--- a/layout/xul/base/src/nsMenuBarFrame.cpp
+++ b/layout/xul/base/src/nsMenuBarFrame.cpp
@@ -183,17 +183,17 @@ nsMenuBarFrame::SetActive(PRBool aActive
   else {
     RemoveKeyboardNavigator();
   }
   
   // We don't want the caret to blink while the menus are active
   // The caret distracts screen readers and other assistive technologies from the menu selection
   // There is 1 caret per document, we need to find the focused document and toggle its caret 
   do {
-    nsIPresShell *presShell = GetPresContext()->GetPresShell();
+    nsIPresShell *presShell = PresContext()->GetPresShell();
     if (!presShell)
       break;
 
     nsIDocument *document = presShell->GetDocument();
     if (!document)
       break;
 
     nsCOMPtr<nsISupports> container = document->GetContainer();
@@ -289,17 +289,17 @@ static void GetInsertionPoint(nsIPresShe
 nsIMenuFrame*
 nsMenuBarFrame::FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent)
 {
   PRUint32 charCode;
   aKeyEvent->GetCharCode(&charCode);
 
   // Enumerate over our list of frames.
   nsIFrame* immediateParent = nsnull;
-  GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull, &immediateParent);
+  GetInsertionPoint(PresContext()->PresShell(), this, nsnull, &immediateParent);
   if (!immediateParent)
     immediateParent = this;
 
   nsIFrame* currFrame = immediateParent->GetFirstChild(nsnull);
 
   while (currFrame) {
     nsIContent* current = currFrame->GetContent();
     
@@ -437,17 +437,17 @@ nsMenuBarFrame::KeyboardNavigation(PRUin
 
   return NS_OK;
 }
 
 /* virtual */ nsIMenuFrame*
 nsMenuBarFrame::GetNextMenuItem(nsIMenuFrame* aStart)
 {
   nsIFrame* immediateParent = nsnull;
-  GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull, &immediateParent);
+  GetInsertionPoint(PresContext()->PresShell(), this, nsnull, &immediateParent);
   if (!immediateParent)
     immediateParent = this;
 
   nsIFrame* currFrame = nsnull;
   nsIFrame* startFrame = nsnull;
   if (aStart) {
     aStart->QueryInterface(NS_GET_IID(nsIFrame), (void**)&currFrame); 
     if (currFrame) {
@@ -487,17 +487,17 @@ nsMenuBarFrame::GetNextMenuItem(nsIMenuF
   // No luck. Just return our start value.
   return aStart;
 }
 
 /* virtual */ nsIMenuFrame*
 nsMenuBarFrame::GetPreviousMenuItem(nsIMenuFrame* aStart)
 {
   nsIFrame* immediateParent = nsnull;
-  GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull, &immediateParent);
+  GetInsertionPoint(PresContext()->PresShell(), this, nsnull, &immediateParent);
   if (!immediateParent)
     immediateParent = this;
 
   nsFrameList frames(immediateParent->GetFirstChild(nsnull));
                               
   nsIFrame* currFrame = nsnull;
   nsIFrame* startFrame = nsnull;
   if (aStart) {
--- a/layout/xul/base/src/nsMenuFrame.cpp
+++ b/layout/xul/base/src/nsMenuFrame.cpp
@@ -176,17 +176,17 @@ public:
 
   virtual PRBool ReflowFinished() {
     PRBool shouldFlush = PR_FALSE;
     if (mWeakFrame.IsAlive()) {
       nsIMenuFrame* imenu = nsnull;
       CallQueryInterface(mWeakFrame.GetFrame(), &imenu);
       if (imenu) {
         nsMenuFrame* menu = NS_STATIC_CAST(nsMenuFrame*, imenu);
-        menu->UpdateMenuType(menu->GetPresContext());
+        menu->UpdateMenuType(menu->PresContext());
         shouldFlush = PR_TRUE;
       }
     }
     delete this;
     return shouldFlush;
   }
 
   nsWeakFrame mWeakFrame;
@@ -244,17 +244,17 @@ nsMenuFrame::Init(nsIContent*      aCont
     gAltText = new nsString(altModifier);
     gControlText = new nsString(controlModifier);
     gModifierSeparator = new nsString(modifierSeparator);    
   }
 
   BuildAcceleratorText();
   nsIReflowCallback* cb = new nsASyncMenuInitialization(this);
   NS_ENSURE_TRUE(cb, NS_ERROR_OUT_OF_MEMORY);
-  GetPresContext()->PresShell()->PostReflowCallback(cb);
+  PresContext()->PresShell()->PostReflowCallback(cb);
   return rv;
 }
 
 nsMenuFrame::~nsMenuFrame()
 {
   // Clean up shared statics
   if (--gRefCnt == 0) {
     delete gShiftText;
@@ -368,17 +368,17 @@ nsMenuFrame::Destroy()
       // yes; tell it that we're going away
       mMenuParent->SetCurrentMenuItem(nsnull);
       ENSURE_TRUE(weakFrame.IsAlive());
     }
   }
 
   UngenerateMenu();
   ENSURE_TRUE(weakFrame.IsAlive());
-  DestroyPopupFrames(GetPresContext());
+  DestroyPopupFrames(PresContext());
   nsBoxFrame::Destroy();
 }
 
 NS_IMETHODIMP
 nsMenuFrame::BuildDisplayListForChildren(nsDisplayListBuilder*   aBuilder,
                                          const nsRect&           aDirtyRect,
                                          const nsDisplayListSet& aLists)
 {
@@ -714,17 +714,17 @@ nsMenuFrame::ActivateMenu(PRBool aActiva
         nsCOMPtr<nsIScrollableFrame> scrollframe(do_QueryInterface(child));
         if (scrollframe) {
           scrollframe->ScrollTo(nsPoint(0,0));
         }
       }
 
       viewManager->UpdateView(view, rect, NS_VMREFRESH_IMMEDIATE);
       viewManager->SetViewVisibility(view, nsViewVisibility_kShow);
-      GetPresContext()->RootPresContext()->NotifyAddedActivePopupToTop(menuPopup);
+      PresContext()->RootPresContext()->NotifyAddedActivePopupToTop(menuPopup);
   } else {
     if (mMenuOpen) {
       nsWeakFrame weakFrame(this);
       nsWeakFrame weakPopup(menuPopup);
       FireDOMEventSynch(NS_LITERAL_STRING("DOMMenuInactive"), menuPopup->GetContent());
       NS_ENSURE_TRUE(weakFrame.IsAlive() && weakPopup.IsAlive(), NS_OK);
     }
     nsIView* view = menuPopup->GetView();
@@ -733,40 +733,40 @@ nsMenuFrame::ActivateMenu(PRBool aActiva
       nsIViewManager* viewManager = view->GetViewManager();
       if (viewManager) { // the view manager can be null during widget teardown
         viewManager->SetViewVisibility(view, nsViewVisibility_kHide);
         viewManager->ResizeView(view, nsRect(0, 0, 0, 0));
       }
     }
     // set here so hide chain can close the menu as well.
     mMenuOpen = PR_FALSE;
-    GetPresContext()->RootPresContext()->NotifyRemovedActivePopup(menuPopup);
+    PresContext()->RootPresContext()->NotifyRemovedActivePopup(menuPopup);
   }
   
   return NS_OK;
 }  
 
 NS_IMETHODIMP
 nsMenuFrame::AttributeChanged(PRInt32 aNameSpaceID,
                               nsIAtom* aAttribute,
                               PRInt32 aModType)
 {
   nsAutoString value;
 
   if (aAttribute == nsGkAtoms::checked) {
     if (mType != eMenuType_Normal)
-        UpdateMenuSpecialState(GetPresContext());
+        UpdateMenuSpecialState(PresContext());
   } else if (aAttribute == nsGkAtoms::acceltext) {
     // someone reset the accelText attribute, so clear the bit that says *we* set it
     AddStateBits(NS_STATE_ACCELTEXT_IS_DERIVED);
     BuildAcceleratorText();
   } else if (aAttribute == nsGkAtoms::key) {
     BuildAcceleratorText();
   } else if ( aAttribute == nsGkAtoms::type || aAttribute == nsGkAtoms::name )
-    UpdateMenuType(GetPresContext());
+    UpdateMenuType(PresContext());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMenuFrame::OpenMenu(PRBool aActivateFlag)
 {
   if (!mContent)
@@ -796,17 +796,17 @@ nsMenuFrame::OpenMenu(PRBool aActivateFl
 void 
 nsMenuFrame::OpenMenuInternal(PRBool aActivateFlag) 
 {
   gEatMouseMove = PR_TRUE;
 
   if (!mIsMenu)
     return;
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsWeakFrame weakFrame(this);
 
   if (aActivateFlag) {
     // Execute the oncreate handler
     if (!OnCreate() || !weakFrame.IsAlive())
       return;
 
     mCreateHandlerSucceeded = PR_TRUE;
@@ -1691,17 +1691,17 @@ nsMenuFrame::Execute(nsGUIEvent *aEvent)
     event.isAlt = NS_STATIC_CAST(nsInputEvent *, aEvent)->isAlt;
     event.isMeta = NS_STATIC_CAST(nsInputEvent *, aEvent)->isMeta;
   }
 
   // The order of the nsIViewManager and nsIPresShell COM pointers is
   // important below.  We want the pres shell to get released before the
   // associated view manager on exit from this function.
   // See bug 54233.
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   nsCOMPtr<nsIViewManager> kungFuDeathGrip = presContext->GetViewManager();
   nsCOMPtr<nsIPresShell> shell = presContext->GetPresShell();
   if (shell) {
     shell->HandleDOMEventWithTarget(mContent, &event, &status);
     ENSURE_TRUE(weakFrame.IsAlive());
   }
 
   if (mMenuParent) {
@@ -1721,17 +1721,17 @@ nsMenuFrame::OnCreate()
   nsMouseEvent event(PR_TRUE, NS_XUL_POPUP_SHOWING, nsnull,
                      nsMouseEvent::eReal);
 
   nsCOMPtr<nsIContent> child;
   GetMenuChildrenElement(getter_AddRefs(child));
   
   nsresult rv = NS_OK;
 
-  nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+  nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
   if (shell) {
     if (child) {
       rv = shell->HandleDOMEventWithTarget(child, &event, &status);
     }
     else {
       rv = shell->HandleDOMEventWithTarget(mContent, &event, &status);
     }
   }
@@ -1794,17 +1794,17 @@ nsMenuFrame::OnCreated()
   nsEventStatus status = nsEventStatus_eIgnore;
   nsMouseEvent event(PR_TRUE, NS_XUL_POPUP_SHOWN, nsnull,
                      nsMouseEvent::eReal);
 
   nsCOMPtr<nsIContent> child;
   GetMenuChildrenElement(getter_AddRefs(child));
   
   nsresult rv = NS_OK;
-  nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+  nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
   if (shell) {
     if (child) {
       rv = shell->HandleDOMEventWithTarget(child, &event, &status);
     }
     else {
       rv = shell->HandleDOMEventWithTarget(mContent, &event, &status);
     }
   }
@@ -1820,17 +1820,17 @@ nsMenuFrame::OnDestroy()
   nsEventStatus status = nsEventStatus_eIgnore;
   nsMouseEvent event(PR_TRUE, NS_XUL_POPUP_HIDING, nsnull,
                      nsMouseEvent::eReal);
 
   nsCOMPtr<nsIContent> child;
   GetMenuChildrenElement(getter_AddRefs(child));
   
   nsresult rv = NS_OK;
-  nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+  nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
   if (shell) {
     if (child) {
       rv = shell->HandleDOMEventWithTarget(child, &event, &status);
     }
     else {
       rv = shell->HandleDOMEventWithTarget(mContent, &event, &status);
     }
   }
@@ -1846,17 +1846,17 @@ nsMenuFrame::OnDestroyed()
   nsEventStatus status = nsEventStatus_eIgnore;
   nsMouseEvent event(PR_TRUE, NS_XUL_POPUP_HIDDEN, nsnull,
                      nsMouseEvent::eReal);
 
   nsCOMPtr<nsIContent> child;
   GetMenuChildrenElement(getter_AddRefs(child));
   
   nsresult rv = NS_OK;
-  nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+  nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
   if (shell) {
     if (child) {
       rv = shell->HandleDOMEventWithTarget(child, &event, &status);
     }
     else {
       rv = shell->HandleDOMEventWithTarget(mContent, &event, &status);
     }
   }
@@ -1871,17 +1871,17 @@ nsMenuFrame::RemoveFrame(nsIAtom*       
                          nsIFrame*       aOldFrame)
 {
   nsresult  rv;
 
   if (mPopupFrames.ContainsFrame(aOldFrame)) {
     // Go ahead and remove this frame.
     mPopupFrames.DestroyFrame(aOldFrame);
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     rv = NS_OK;
   } else {
     rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame);
   }
 
   return rv;
 }
@@ -1898,17 +1898,17 @@ nsMenuFrame::InsertFrames(nsIAtom*      
     NS_ASSERTION(aFrameList->IsBoxFrame(),"Popup is not a box!!!");
     mPopupFrames.InsertFrames(nsnull, nsnull, aFrameList);
 
 #ifdef DEBUG_LAYOUT
     nsBoxLayoutState state(GetPresContext());
     SetDebug(state, aFrameList, mState & NS_STATE_CURRENTLY_IN_DEBUG);
 #endif
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     rv = NS_OK;
   } else {
     rv = nsBoxFrame::InsertFrames(aListName, aPrevFrame, aFrameList);  
   }
 
   return rv;
 }
@@ -1927,17 +1927,17 @@ nsMenuFrame::AppendFrames(nsIAtom*      
     NS_ASSERTION(aFrameList->IsBoxFrame(),"Popup is not a box!!!");
 
     mPopupFrames.AppendFrames(nsnull, aFrameList);
 #ifdef DEBUG_LAYOUT
     nsBoxLayoutState state(GetPresContext());
     SetDebug(state, aFrameList, mState & NS_STATE_CURRENTLY_IN_DEBUG);
 #endif
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     rv = NS_OK;
   } else {
     rv = nsBoxFrame::AppendFrames(aListName, aFrameList); 
   }
 
   return rv;
 }
@@ -1954,17 +1954,17 @@ public:
       mDocument->BlockOnload();
     }
   }
 
   virtual PRBool ReflowFinished() {
     PRBool shouldFlush = PR_FALSE;
     nsIFrame* frame = mWeakFrame.GetFrame();
     if (frame) {
-      nsBoxLayoutState state(frame->GetPresContext());
+      nsBoxLayoutState state(frame->PresContext());
       if (!frame->IsCollapsed(state)) {
         nsIMenuFrame* imenu = nsnull;
         CallQueryInterface(frame, &imenu);
         if (imenu) {
           imenu->MarkAsGenerated();
           shouldFlush = PR_TRUE;
         }
       }
@@ -1991,17 +1991,17 @@ nsMenuFrame::SizeToPopup(nsBoxLayoutStat
       if (!frame) {
         nsCOMPtr<nsIContent> child;
         GetMenuChildrenElement(getter_AddRefs(child));
         if (child &&
             !nsContentUtils::HasNonEmptyAttr(child, kNameSpaceID_None,
                                              nsGkAtoms::menugenerated)) {
           nsIReflowCallback* cb = new nsASyncMenuGeneration(this);
           if (cb) {
-            GetPresContext()->PresShell()->PostReflowCallback(cb);
+            PresContext()->PresShell()->PostReflowCallback(cb);
           }
         }
         return PR_FALSE;
       }
 
       NS_ASSERTION(frame->IsBoxFrame(), "popupChild is not box!!");
 
       tmpSize = frame->GetPrefSize(aState);
@@ -2068,17 +2068,17 @@ nsMenuFrame::SetActiveChild(nsIDOMElemen
   if (!aChild) {
     // Remove the current selection
     menuPopup->SetCurrentMenuItem(nsnull);
     return NS_OK;
   }
 
   nsCOMPtr<nsIContent> child(do_QueryInterface(aChild));
   
-  nsIFrame* kid = GetPresContext()->PresShell()->GetPrimaryFrameFor(child);
+  nsIFrame* kid = PresContext()->PresShell()->GetPrimaryFrameFor(child);
   if (!kid)
     return NS_ERROR_FAILURE;
   nsIMenuFrame *menuFrame;
   nsresult rv = CallQueryInterface(kid, &menuFrame);
   if (NS_FAILED(rv))
     return rv;
   menuPopup->SetCurrentMenuItem(menuFrame);
   return NS_OK;
--- a/layout/xul/base/src/nsMenuPopupFrame.cpp
+++ b/layout/xul/base/src/nsMenuPopupFrame.cpp
@@ -155,17 +155,17 @@ nsMenuPopupFrame::Init(nsIContent*      
 {
   nsresult rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
 
   // Set up a mediator which can be used for callbacks on this frame.
   mTimerMediator = new nsMenuPopupTimerMediator(this);
   if (NS_UNLIKELY(!mTimerMediator))
     return NS_ERROR_OUT_OF_MEMORY;
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   // lookup if we're allowed to overlap the OS bar (menubar/taskbar) from the
   // look&feel object
   PRBool tempBool;
   presContext->LookAndFeel()->
     GetMetric(nsILookAndFeel::eMetric_MenusCanOverlapOSBar, tempBool);
   mMenuCanOverlapOSBar = tempBool;
 
@@ -209,22 +209,22 @@ nsMenuPopupFrame::CreateWidgetForView(ns
   nsWidgetInitData widgetData;
   widgetData.mWindowType = eWindowType_popup;
   widgetData.mBorderStyle = eBorderStyle_default;
   widgetData.clipSiblings = PR_TRUE;
 
   PRBool isCanvas;
   const nsStyleBackground* bg;
   PRBool hasBG =
-    nsCSSRendering::FindBackground(GetPresContext(), this, &bg, &isCanvas);
+    nsCSSRendering::FindBackground(PresContext(), this, &bg, &isCanvas);
   PRBool viewHasTransparentContent = hasBG &&
     (bg->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) &&
     !GetStyleDisplay()->mAppearance;
   if (viewHasTransparentContent) {
-    nsCOMPtr<nsISupports> cont = GetPresContext()->GetContainer();
+    nsCOMPtr<nsISupports> cont = PresContext()->GetContainer();
     nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(cont);
     PRInt32 type = -1;
     if (!dsti || NS_FAILED(dsti->GetItemType(&type)) ||
         type != nsIDocShellTreeItem::typeChrome)
       viewHasTransparentContent = PR_FALSE;
   }
 
   nsIContent* parentContent = GetContent()->GetParent();
@@ -416,17 +416,17 @@ nsMenuPopupFrame::AdjustClientXYForNeste
   }
   nsRect targetDocTopLeft;
   if ( targetDocumentWidget ) {
     nsRect topLeftClient ( 0, 0, 10, 10 );
     targetDocumentWidget->WidgetToScreen ( topLeftClient, targetDocTopLeft );
   }
   nsPoint pixelOffset ( targetDocTopLeft.x - popupDocTopLeft.x, targetDocTopLeft.y - popupDocTopLeft.y );
 
-  nsPresContext* context = GetPresContext();
+  nsPresContext* context = PresContext();
   *outAdjX = nsPresContext::CSSPixelsToAppUnits(inClientX) +
              context->DevPixelsToAppUnits(pixelOffset.x);
   *outAdjY = nsPresContext::CSSPixelsToAppUnits(inClientY) +
              context->DevPixelsToAppUnits(pixelOffset.y);
   
 } // AdjustClientXYForNestedDocuments
 
 
@@ -738,17 +738,17 @@ nsMenuPopupFrame::SyncViewWithFrame(nsPr
   
   // Compute info about the screen dimensions. Because of multiple monitor systems,
   // the left or top sides of the screen may be in negative space (main monitor is on the
   // right, etc). We need to be sure to do the right thing.
   nsPIDOMWindow *window = document->GetWindow();
   if (!window)
     return NS_OK;
 
-  nsIDeviceContext* devContext = GetPresContext()->DeviceContext();
+  nsIDeviceContext* devContext = PresContext()->DeviceContext();
   nsRect rect;
   if ( mMenuCanOverlapOSBar ) {
     devContext->GetRect(rect);
   }
   else {
     devContext->GetClientRect(rect);
   }
 
@@ -992,27 +992,27 @@ nsMenuPopupFrame::SyncViewWithFrame(nsPr
   // Now that we've positioned the view, sync up the frame's origin.
   nsPoint frameOrigin = GetPosition();
   nsPoint offsetToView;
   GetOriginToViewOffset(offsetToView, nsnull);
   frameOrigin -= offsetToView;
   nsBoxFrame::SetPosition(frameOrigin);
 
   if (sizedToPopup) {
-      nsBoxLayoutState state(GetPresContext());
+      nsBoxLayoutState state(PresContext());
       SetBounds(state, nsRect(mRect.x, mRect.y, parentRect.width, mRect.height));
   }
     
   if (!mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::menuactive,
                              nsGkAtoms::_true, eCaseMatters) &&
       mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::menutobedisplayed,
                             nsGkAtoms::_true, eCaseMatters)) {
     nsIReflowCallback* cb = new nsASyncMenuActivation(mContent);
     NS_ENSURE_TRUE(cb, NS_ERROR_OUT_OF_MEMORY);
-    GetPresContext()->PresShell()->PostReflowCallback(cb);
+    PresContext()->PresShell()->PostReflowCallback(cb);
   }
 
   return NS_OK;
 }
 
 static void GetInsertionPoint(nsIPresShell* aShell, nsIFrame* aFrame, nsIFrame* aChild,
                               nsIFrame** aResult)
 {
@@ -1021,17 +1021,17 @@ static void GetInsertionPoint(nsIPresShe
     child = aChild->GetContent();
   aShell->FrameConstructor()->GetInsertionPoint(aFrame, child, aResult);
 }
 
 /* virtual */ nsIMenuFrame*
 nsMenuPopupFrame::GetNextMenuItem(nsIMenuFrame* aStart)
 {
   nsIFrame* immediateParent = nsnull;
-  GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull,
+  GetInsertionPoint(PresContext()->PresShell(), this, nsnull,
                     &immediateParent);
   if (!immediateParent)
     immediateParent = this;
 
   nsIFrame* currFrame = nsnull;
   nsIFrame* startFrame = nsnull;
   if (aStart) {
     aStart->QueryInterface(NS_GET_IID(nsIFrame), (void**)&currFrame); 
@@ -1072,17 +1072,17 @@ nsMenuPopupFrame::GetNextMenuItem(nsIMen
   // No luck. Just return our start value.
   return aStart;
 }
 
 /* virtual */ nsIMenuFrame*
 nsMenuPopupFrame::GetPreviousMenuItem(nsIMenuFrame* aStart)
 {
   nsIFrame* immediateParent = nsnull;
-  GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull,
+  GetInsertionPoint(PresContext()->PresShell(), this, nsnull,
                     &immediateParent);
   if (!immediateParent)
     immediateParent = this;
 
   nsFrameList frames(immediateParent->GetFirstChild(nsnull));
                               
   nsIFrame* currFrame = nsnull;
   nsIFrame* startFrame = nsnull;
@@ -1269,17 +1269,17 @@ NS_IMETHODIMP nsMenuPopupFrame::SetCurre
     mCurrentMenu->SelectMenu(PR_FALSE);
     // XXX bug 294183 sometimes mCurrentMenu gets cleared
     if (mCurrentMenu && isOpen) {
       // Don't close up immediately.
       // Kick off a close timer.
       KillCloseTimer(); // Ensure we don't have another stray waiting closure.
       PRInt32 menuDelay = 300;   // ms
 
-      GetPresContext()->LookAndFeel()->
+      PresContext()->LookAndFeel()->
         GetMetric(nsILookAndFeel::eMetric_SubmenuDelay, menuDelay);
 
       // Kick off the timer.
       mCloseTimer = do_CreateInstance("@mozilla.org/timer;1");
       mCloseTimer->InitWithCallback(mTimerMediator, menuDelay, nsITimer::TYPE_ONE_SHOT);
       mTimerMenu = mCurrentMenu;
     }
   }
@@ -1302,17 +1302,17 @@ nsMenuPopupFrame::Escape(PRBool& aHandle
   mIncrementalString.Truncate();
 
   // See if we have a context menu open.
   nsIMenuParent* contextMenu = GetContextMenu();
   if (contextMenu) {
     // Get the context menu parent.
     nsIFrame* childFrame;
     CallQueryInterface(contextMenu, &childFrame);
-    nsIPopupSetFrame* popupSetFrame = GetPopupSetFrame(GetPresContext());
+    nsIPopupSetFrame* popupSetFrame = GetPopupSetFrame(PresContext());
     if (popupSetFrame)
       // Destroy the popup.
       popupSetFrame->DestroyPopup(childFrame, PR_FALSE);
     aHandledFlag = PR_TRUE;
     return NS_OK;
   }
 
   if (!mCurrentMenu)
@@ -1368,17 +1368,17 @@ nsMenuPopupFrame::FindMenuWithShortcut(n
   PRUint32 charCode, keyCode;
   aKeyEvent->GetCharCode(&charCode);
   aKeyEvent->GetKeyCode(&keyCode);
 
   doAction = PR_FALSE;
 
   // Enumerate over our list of frames.
   nsIFrame* immediateParent = nsnull;
-  GetInsertionPoint(GetPresContext()->PresShell(), this, nsnull,
+  GetInsertionPoint(PresContext()->PresShell(), this, nsnull,
                     &immediateParent);
   if (!immediateParent)
     immediateParent = this;
 
   PRUint32 matchCount = 0, matchShortcutCount = 0;
   PRBool foundActive = PR_FALSE;
   PRBool isShortcut;
   nsIMenuFrame* frameBefore = nsnull;
@@ -1688,17 +1688,17 @@ nsMenuPopupFrame::HideChain()
   // since this reinstates normal event handling.)
   nsMenuDismissalListener::Shutdown();
   
   nsIFrame* frame = GetParent();
   if (frame) {
     nsWeakFrame weakMenu(frame);
     nsIMenuFrame* menuFrame;
     if (NS_FAILED(CallQueryInterface(frame, &menuFrame))) {
-      nsIPopupSetFrame* popupSetFrame = GetPopupSetFrame(GetPresContext());
+      nsIPopupSetFrame* popupSetFrame = GetPopupSetFrame(PresContext());
       if (popupSetFrame)
         // Hide the popup.
         popupSetFrame->HidePopup(this);
       return NS_OK;
     }
    
     menuFrame->ActivateMenu(PR_FALSE);
     NS_ENSURE_TRUE(weakMenu.IsAlive(), NS_OK);
@@ -1724,17 +1724,17 @@ nsMenuPopupFrame::DismissChain()
   nsMenuDismissalListener::Shutdown();
   
   // Get our menu parent.
   nsIFrame* frame = GetParent();
   if (frame) {
     nsIMenuFrame *menuFrame = nsnull;
     CallQueryInterface(frame, &menuFrame);
     if (!menuFrame) {
-      nsIPopupSetFrame* popupSetFrame = GetPopupSetFrame(GetPresContext());
+      nsIPopupSetFrame* popupSetFrame = GetPopupSetFrame(PresContext());
       if (popupSetFrame) {
         // make sure the menu is not highlighted
         if (mCurrentMenu) {
           PRBool wasOpen;
           mCurrentMenu->MenuIsOpen(wasOpen);
           if (wasOpen)
             mCurrentMenu->OpenMenu(PR_FALSE);
           mCurrentMenu->SelectMenu(PR_FALSE);
@@ -1815,17 +1815,17 @@ nsMenuPopupFrame::RemoveKeyboardNavigato
 // helpers /////////////////////////////////////////////////////////////
 
 PRBool 
 nsMenuPopupFrame::IsValidItem(nsIContent* aContent)
 {
   nsIAtom *tag = aContent->Tag();
   
   PRBool skipNavigatingDisabledMenuItem;
-  GetPresContext()->LookAndFeel()->
+  PresContext()->LookAndFeel()->
     GetMetric(nsILookAndFeel::eMetric_SkipNavigatingDisabledMenuItem,
               skipNavigatingDisabledMenuItem);
 
   PRBool result = (tag == nsGkAtoms::menu ||
                    tag == nsGkAtoms::menuitem ||
                    tag == nsGkAtoms::option);
   if (skipNavigatingDisabledMenuItem)
     result = result && !IsDisabled(aContent);
@@ -1888,17 +1888,17 @@ nsMenuPopupFrame::Destroy()
 {
   // Null out the pointer to this frame in the mediator wrapper so that it 
   // doesn't try to interact with a deallocated frame.
   mTimerMediator->ClearFrame();
 
   if (mCloseTimer)
     mCloseTimer->Cancel();
 
-  nsPresContext* rootPresContext = GetPresContext()->RootPresContext();
+  nsPresContext* rootPresContext = PresContext()->RootPresContext();
   if (rootPresContext->ContainsActivePopup(this)) {
     rootPresContext->NotifyRemovedActivePopup(this);
   }
 
   RemoveKeyboardNavigator();
   nsBoxFrame::Destroy();
 }
 
--- a/layout/xul/base/src/nsNativeScrollbarFrame.cpp
+++ b/layout/xul/base/src/nsNativeScrollbarFrame.cpp
@@ -89,17 +89,17 @@ nsNativeScrollbarFrame::Init(nsIContent*
 {
   nsresult  rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
 
   // create a view for this frame and then associate the view with the native
   // scrollbar widget. The net result of this is that the view will automatically
   // be resized and moved for us when things reflow, and the widget will follow
   // suit. We don't have to lift a finger!
   static NS_DEFINE_IID(kScrollbarCID,  NS_NATIVESCROLLBAR_CID);
-  if ( NS_SUCCEEDED(CreateViewForFrame(GetPresContext(), this, GetStyleContext(), PR_TRUE)) ) {
+  if ( NS_SUCCEEDED(CreateViewForFrame(PresContext(), this, GetStyleContext(), PR_TRUE)) ) {
     nsIView* myView = GetView();
     if ( myView ) {
       nsWidgetInitData widgetData;
       if ( NS_SUCCEEDED(myView->CreateWidget(kScrollbarCID, &widgetData, nsnull)) ) {
         mScrollbar = myView->GetWidget();
         if (mScrollbar) {
           mScrollbar->Show(PR_TRUE);
           mScrollbar->Enable(PR_TRUE);
--- a/layout/xul/base/src/nsPopupSetFrame.cpp
+++ b/layout/xul/base/src/nsPopupSetFrame.cpp
@@ -385,17 +385,17 @@ nsPopupSetFrame::ShowPopup(nsIContent* a
   entry->mPopupType = aPopupType;
   entry->mElementContent = aElementContent;
   entry->mPopupAlign = aPopupAlignment;
   entry->mPopupAnchor = anAnchorAlignment;
   entry->mXPos = aXPos;
   entry->mYPos = aYPos;
 
   // If a frame exists already, go ahead and use it.
-  entry->mPopupFrame = GetPresContext()->PresShell()
+  entry->mPopupFrame = PresContext()->PresShell()
     ->GetPrimaryFrameFor(aPopupContent);
 
 #ifdef DEBUG_PINK
   printf("X Pos: %d\n", mXPos);
   printf("Y Pos: %d\n", mYPos);
 #endif
 
   // Generate the popup.
@@ -449,17 +449,17 @@ nsPopupSetFrame::HidePopup(nsIFrame* aPo
   if (entry->mCreateHandlerSucceeded)
     ActivatePopup(entry, PR_FALSE);
 
   if (entry->mElementContent && entry->mPopupType.EqualsLiteral("context")) {
     // If we are a context menu, and if we are attached to a
     // menupopup, then hiding us should also hide the parent menu
     // popup.
     if (entry->mElementContent->Tag() == nsGkAtoms::menupopup) {
-      nsIFrame* popupFrame = GetPresContext()->PresShell()
+      nsIFrame* popupFrame = PresContext()->PresShell()
         ->GetPrimaryFrameFor(entry->mElementContent);
       if (popupFrame) {
         nsIMenuParent *menuParent;
         if (NS_SUCCEEDED(CallQueryInterface(popupFrame, &menuParent))) {
           menuParent->HideChain();
         }
       }
     }
@@ -481,17 +481,17 @@ nsPopupSetFrame::DestroyPopup(nsIFrame* 
     OpenPopup(entry, PR_FALSE);
     nsCOMPtr<nsIContent> popupContent = entry->mPopupContent;
     if (weakFrame.IsAlive()) {
       if (aDestroyEntireChain && entry->mElementContent && entry->mPopupType.EqualsLiteral("context")) {
         // If we are a context menu, and if we are attached to a
         // menupopup, then destroying us should also dismiss the parent
         // menu popup.
         if (entry->mElementContent->Tag() == nsGkAtoms::menupopup) {
-          nsIFrame* popupFrame = GetPresContext()->PresShell()
+          nsIFrame* popupFrame = PresContext()->PresShell()
             ->GetPrimaryFrameFor(entry->mElementContent);
           if (popupFrame) {
             nsIMenuParent *menuParent;
             if (NS_SUCCEEDED(CallQueryInterface(popupFrame, &menuParent))) {
               menuParent->DismissChain();
             }
           }
         }
@@ -526,17 +526,17 @@ nsPopupSetFrame::MarkAsGenerated(nsICont
 }
 
 void
 nsPopupSetFrame::OpenPopup(nsPopupFrameList* aEntry, PRBool aActivateFlag)
 {
   nsWeakFrame weakFrame(this);
   nsIFrame* activeChild = aEntry->mPopupFrame;
   nsWeakFrame weakPopupFrame(activeChild);
-  nsRefPtr<nsPresContext> presContext = GetPresContext();
+  nsRefPtr<nsPresContext> presContext = PresContext();
   nsCOMPtr<nsIContent> popupContent = aEntry->mPopupContent;
   PRBool createHandlerSucceeded = aEntry->mCreateHandlerSucceeded;
   nsAutoString popupType = aEntry->mPopupType;
   if (aActivateFlag) {
     ActivatePopup(aEntry, PR_TRUE);
 
     // register the rollup listeners, etc, but not if we're a tooltip
     if (!popupType.EqualsLiteral("tooltip")) {
@@ -576,17 +576,17 @@ nsPopupSetFrame::OpenPopup(nsPopupFrameL
     if (weakPopupFrame.IsAlive())
       ActivatePopup(aEntry, PR_FALSE);
 
     OnDestroyed(presContext, popupContent);
   }
 
   if (weakFrame.IsAlive()) {
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-    GetPresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange);
+    PresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   }
 }
 
 void
 nsPopupSetFrame::ActivatePopup(nsPopupFrameList* aEntry, PRBool aActivateFlag)
 {
   if (aEntry->mPopupContent) {
     // When we sync the popup view with the frame, we'll show the popup if |menutobedisplayed|
@@ -640,17 +640,17 @@ nsPopupSetFrame::OnCreate(PRInt32 aX, PR
   // XXX This is messed up: it needs to account for widgets.
   nsPoint dummy;
   event.widget = GetClosestView()->GetNearestWidget(&dummy);
   event.refPoint.x = aX;
   event.refPoint.y = aY;
 
   if (aPopupContent) {
     nsCOMPtr<nsIContent> kungFuDeathGrip(aPopupContent);
-    nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+    nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
     if (shell) {
       nsresult rv = shell->HandleDOMEventWithTarget(aPopupContent, &event,
                                                     &status);
       if ( NS_FAILED(rv) || status == nsEventStatus_eConsumeNoDefault )
         return PR_FALSE;
     }
 
     nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(aPopupContent->GetDocument()));
@@ -708,17 +708,17 @@ nsPopupSetFrame::OnCreated(PRInt32 aX, P
   nsEventStatus status = nsEventStatus_eIgnore;
   nsMouseEvent event(PR_TRUE, NS_XUL_POPUP_SHOWN, nsnull,
                      nsMouseEvent::eReal);
   // XXX See OnCreate above
   //event.point.x = aX;
   //event.point.y = aY;
 
   if (aPopupContent) {
-    nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+    nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
     if (shell) {
       nsresult rv = shell->HandleDOMEventWithTarget(aPopupContent, &event,
                                                     &status);
       if ( NS_FAILED(rv) || status == nsEventStatus_eConsumeNoDefault )
         return PR_FALSE;
     }
   }
 
@@ -728,17 +728,17 @@ nsPopupSetFrame::OnCreated(PRInt32 aX, P
 PRBool
 nsPopupSetFrame::OnDestroy(nsIContent* aPopupContent)
 {
   nsEventStatus status = nsEventStatus_eIgnore;
   nsMouseEvent event(PR_TRUE, NS_XUL_POPUP_HIDING, nsnull,
                      nsMouseEvent::eReal);
 
   if (aPopupContent) {
-    nsCOMPtr<nsIPresShell> shell = GetPresContext()->GetPresShell();
+    nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
     if (shell) {
       nsresult rv = shell->HandleDOMEventWithTarget(aPopupContent, &event,
                                                     &status);
       if ( NS_FAILED(rv) || status == nsEventStatus_eConsumeNoDefault )
         return PR_FALSE;
     }
   }
   return PR_TRUE;
@@ -835,17 +835,17 @@ nsPopupSetFrame::AddPopupFrame(nsIFrame*
   // called for this popup.
   return NS_OK;
 }
 
 //static
 PRBool
 nsPopupSetFrame::MayOpenPopup(nsIFrame* aFrame)
 {
-  nsCOMPtr<nsISupports> cont = aFrame->GetPresContext()->GetContainer();
+  nsCOMPtr<nsISupports> cont = aFrame->PresContext()->GetContainer();
   nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(cont);
   if (!dsti)
     return PR_FALSE;
 
   // chrome shells can always open popups
   PRInt32 type = -1;
   if (NS_SUCCEEDED(dsti->GetItemType(&type)) && type == nsIDocShellTreeItem::typeChrome)
     return PR_TRUE;
--- a/layout/xul/base/src/nsProgressMeterFrame.cpp
+++ b/layout/xul/base/src/nsProgressMeterFrame.cpp
@@ -114,17 +114,17 @@ nsProgressMeterFrame::AttributeChanged(P
     leftFlex.AppendInt(flex);
     rightFlex.AppendInt(remainder);
     nsWeakFrame weakFrame(this);
     barChild->GetContent()->SetAttr(kNameSpaceID_None, nsGkAtoms::flex, leftFlex, PR_TRUE);
     remainderContent->SetAttr(kNameSpaceID_None, nsGkAtoms::flex, rightFlex, PR_TRUE);
 
     if (weakFrame.IsAlive()) {
       AddStateBits(NS_FRAME_IS_DIRTY);
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(this, nsIPresShell::eTreeChange);
     }
   }
   return NS_OK;
 }
 
 #ifdef NS_DEBUG
 NS_IMETHODIMP
--- a/layout/xul/base/src/nsScrollbarFrame.cpp
+++ b/layout/xul/base/src/nsScrollbarFrame.cpp
@@ -177,17 +177,17 @@ nsScrollbarFrame::SetScrollbarMediatorCo
 }
 
 nsIScrollbarMediator*
 nsScrollbarFrame::GetScrollbarMediator()
 {
   if (!mScrollbarMediator)
     return nsnull;
   nsIFrame* f =
-    GetPresContext()->PresShell()->GetPrimaryFrameFor(mScrollbarMediator);
+    PresContext()->PresShell()->GetPrimaryFrameFor(mScrollbarMediator);
   if (!f)
     return nsnull;
 
   // check if the frame is a scroll frame. If so, get the scrollable frame
   // inside it.
   nsIScrollableFrame* scrollFrame;
   CallQueryInterface(f, &scrollFrame);
   if (scrollFrame) {
--- a/layout/xul/base/src/nsSliderFrame.cpp
+++ b/layout/xul/base/src/nsSliderFrame.cpp
@@ -119,17 +119,17 @@ nsSliderFrame::Init(nsIContent*      aCo
   static PRBool gotPrefs = PR_FALSE;
   if (!gotPrefs) {
     gotPrefs = PR_TRUE;
 
     gMiddlePref = nsContentUtils::GetBoolPref("middlemouse.scrollbarPosition");
     gSnapMultiplier = nsContentUtils::GetIntPref("slider.snapMultiplier");
   }
 
-  CreateViewForFrame(GetPresContext(), this, GetStyleContext(), PR_TRUE);
+  CreateViewForFrame(PresContext(), this, GetStyleContext(), PR_TRUE);
   return rv;
 }
 
 NS_IMETHODIMP
 nsSliderFrame::RemoveFrame(nsIAtom*        aListName,
                            nsIFrame*       aOldFrame)
 {
   nsresult rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame);
@@ -218,17 +218,17 @@ NS_IMETHODIMP
 nsSliderFrame::AttributeChanged(PRInt32 aNameSpaceID,
                                 nsIAtom* aAttribute,
                                 PRInt32 aModType)
 {
   nsresult rv = nsBoxFrame::AttributeChanged(aNameSpaceID, aAttribute,
                                              aModType);
   // if the current position changes
   if (aAttribute == nsGkAtoms::curpos) {
-     rv = CurrentPositionChanged(GetPresContext());
+     rv = CurrentPositionChanged(PresContext());
      NS_ASSERTION(NS_SUCCEEDED(rv), "failed to change position");
      if (NS_FAILED(rv))
         return rv;
   } else if (aAttribute == nsGkAtoms::minpos ||
              aAttribute == nsGkAtoms::maxpos) {
       // bounds check it.
 
       nsIBox* scrollbarBox = GetScrollbar();
@@ -261,17 +261,17 @@ nsSliderFrame::AttributeChanged(PRInt32 
   }
 
   if (aAttribute == nsGkAtoms::minpos ||
       aAttribute == nsGkAtoms::maxpos ||
       aAttribute == nsGkAtoms::pageincrement ||
       aAttribute == nsGkAtoms::increment) {
 
       AddStateBits(NS_FRAME_IS_DIRTY);
-      GetPresContext()->PresShell()->
+      PresContext()->PresShell()->
         FrameNeedsReflow(this, nsIPresShell::eStyleChange);
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsSliderFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
@@ -733,17 +733,17 @@ nsSliderFrame::SetCurrentPosition(nsICon
 
   if (scrollbarFrame) {
     // See if we have a mediator.
     nsIScrollbarMediator* mediator = scrollbarFrame->GetScrollbarMediator();
     if (mediator) {
       mediator->PositionChanged(scrollbarFrame, GetCurrentPosition(scrollbar), newpos);
       // 'mediator' might be dangling now...
       UpdateAttribute(scrollbar, newpos, PR_FALSE, aIsSmooth);
-      CurrentPositionChanged(GetPresContext());
+      CurrentPositionChanged(PresContext());
       return;
     }
   }
 
   UpdateAttribute(scrollbar, newpos, PR_TRUE, aIsSmooth);
 
 #ifdef DEBUG_SLIDER
   printf("Current Pos=%d\n",newpos);
@@ -806,21 +806,21 @@ nsSliderFrame::MouseDown(nsIDOMEvent* aM
   }
 
   PRInt32 clientPosPx;
   nsIntRect screenRect = GetScreenRect();
   nscoord pos;
   if (isHorizontal) {
     mouseEvent->GetScreenX(&clientPosPx);
     pos = nsPresContext::CSSPixelsToAppUnits(clientPosPx) - 
-          GetPresContext()->DevPixelsToAppUnits(screenRect.x);
+          PresContext()->DevPixelsToAppUnits(screenRect.x);
   } else {
     mouseEvent->GetScreenY(&clientPosPx);
     pos = nsPresContext::CSSPixelsToAppUnits(clientPosPx) - 
-          GetPresContext()->DevPixelsToAppUnits(screenRect.y);
+          PresContext()->DevPixelsToAppUnits(screenRect.y);
   }
 
   // If shift click or middle button, first
   // place the middle of the slider thumb under the click
   if (scrollToClick) {
     nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1);
     nscoord pospx = pos/onePixel;
 
--- a/layout/xul/base/src/nsSplitterFrame.cpp
+++ b/layout/xul/base/src/nsSplitterFrame.cpp
@@ -293,17 +293,17 @@ nsSplitterFrame::AttributeChanged(PRInt3
 {
   nsresult rv = nsBoxFrame::AttributeChanged(aNameSpaceID, aAttribute,
                                              aModType);
   // if the alignment changed. Let the grippy know
   if (aAttribute == nsGkAtoms::align) {
     // tell the slider its attribute changed so it can 
     // update itself
     nsIFrame* grippy = nsnull;
-    nsScrollbarButtonFrame::GetChildWithTag(GetPresContext(), nsGkAtoms::grippy, this, grippy);
+    nsScrollbarButtonFrame::GetChildWithTag(PresContext(), nsGkAtoms::grippy, this, grippy);
     if (grippy)
       grippy->AttributeChanged(aNameSpaceID, aAttribute, aModType);
   } else if (aAttribute == nsGkAtoms::state) {
     mInner->UpdateState();
   }
 
   return rv;
 }
@@ -366,17 +366,17 @@ nsSplitterFrame::Init(nsIContent*      a
     // currently this only works on win32 and mac
     static NS_DEFINE_CID(kCChildCID, NS_CHILD_CID);
 
     // Need to have a widget to appear on top of other widgets.
     view->CreateWidget(kCChildCID);
   }
 
   mInner->mState = nsSplitterFrameInner::Open;
-  mInner->AddListener(GetPresContext());
+  mInner->AddListener(PresContext());
   mInner->mParentBox = nsnull;
   return rv;
 }
 
 NS_IMETHODIMP
 nsSplitterFrame::DoLayout(nsBoxLayoutState& aState)
 {
   if (GetStateBits() & NS_FRAME_FIRST_REFLOW) 
@@ -684,17 +684,17 @@ nsSplitterFrameInner :: IsMouseCaptured(
 }
 */
 
 nsresult
 nsSplitterFrameInner::MouseUp(nsIDOMEvent* aMouseEvent)
 {  
   mPressed = PR_FALSE;
 
-  mOuter->CaptureMouse(mOuter->GetPresContext(), PR_FALSE);
+  mOuter->CaptureMouse(mOuter->PresContext(), PR_FALSE);
 
   return NS_OK;
 }
 
 nsresult
 nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
 {  
   nsCOMPtr<nsIDOMMouseEvent> mouseEvent(do_QueryInterface(aMouseEvent));
@@ -711,17 +711,17 @@ nsSplitterFrameInner::MouseDown(nsIDOMEv
                     nsGkAtoms::_true, eCaseMatters))
     return NS_OK;
 
   mParentBox = mOuter->GetParentBox();
   if (!mParentBox)
     return NS_OK;
   
   // get our index
-  nsPresContext* outerPresContext = mOuter->GetPresContext();
+  nsPresContext* outerPresContext = mOuter->PresContext();
   nscoord childIndex = nsFrameNavigator::IndexOf(outerPresContext, mParentBox, mOuter);
   PRInt32 childCount = nsFrameNavigator::CountFrames(outerPresContext, mParentBox);
 
   // if it's 0 or the last index then stop right here.
   if (childIndex == 0 || childIndex == childCount - 1)
     return NS_OK;
 
   // XXXbz using this state for GetPrefSize/GetMinSize is wrong.  It
@@ -942,17 +942,17 @@ nsSplitterFrameInner::UpdateState()
     // No change.
     return;
   }
 
   if (SupportsCollapseDirection(Before) || SupportsCollapseDirection(After)) {
     nsIBox* splitter = mOuter;
     // Find the splitter's immediate sibling.
     nsIBox* splitterSibling =
-      nsFrameNavigator::GetChildBeforeAfter(mOuter->GetPresContext(), splitter,
+      nsFrameNavigator::GetChildBeforeAfter(mOuter->PresContext(), splitter,
                                             (newState == CollapsedBefore ||
                                              mState == CollapsedBefore));
     if (splitterSibling) {
       nsCOMPtr<nsIContent> sibling = splitterSibling->GetContent();
       if (sibling) {
         if (mState == CollapsedBefore || mState == CollapsedAfter) {
           // CollapsedBefore -> Open
           // CollapsedBefore -> Dragging
--- a/layout/xul/base/src/nsTextBoxFrame.cpp
+++ b/layout/xul/base/src/nsTextBoxFrame.cpp
@@ -119,20 +119,20 @@ nsTextBoxFrame::AttributeChanged(PRInt32
     mState |= NS_STATE_NEED_LAYOUT;
     PRBool aResize;
     PRBool aRedraw;
 
     UpdateAttributes(aAttribute, aResize, aRedraw);
 
     if (aResize) {
         AddStateBits(NS_FRAME_IS_DIRTY);
-        GetPresContext()->PresShell()->
+        PresContext()->PresShell()->
           FrameNeedsReflow(this, nsIPresShell::eStyleChange);
     } else if (aRedraw) {
-        nsBoxLayoutState state(GetPresContext());
+        nsBoxLayoutState state(PresContext());
         Redraw(state);
     }
 
     // If the accesskey changed, register for the new value
     // The old value has been unregistered in nsXULElement::SetAttr
     if (aAttribute == nsGkAtoms::accesskey || aAttribute == nsGkAtoms::control)
         RegUnregAccessKey(PR_TRUE);
 
@@ -320,17 +320,17 @@ nsTextBoxFrame::PaintTitle(nsIRenderingC
 {
     if (mTitle.IsEmpty())
         return;
 
     nsRect textRect(aPt, GetSize());
     textRect.Deflate(GetUsedBorderAndPadding());
 
     // determine (cropped) title and underline position
-    nsPresContext* presContext = GetPresContext();
+    nsPresContext* presContext = PresContext();
     LayoutTitle(presContext, aRenderingContext, textRect);
 
     // make the rect as small as our (cropped) text.
     nscoord outerWidth = textRect.width;
     textRect.width = mTitleWidth;
 
     // Align our text within the overall rect by checking our text-align property.
     const nsStyleVisibility* vis = GetStyleVisibility();
@@ -950,17 +950,17 @@ nsTextBoxFrame::RegUnregAccessKey(PRBool
 
     if (accessKey.IsEmpty())
         return NS_OK;
 
     nsresult rv;
 
     // With a valid PresContext we can get the ESM 
     // and (un)register the access key
-    nsIEventStateManager *esm = GetPresContext()->EventStateManager();
+    nsIEventStateManager *esm = PresContext()->EventStateManager();
 
     PRUint32 key = accessKey.First();
     if (aDoReg)
         rv = esm->RegisterAccessKey(mContent, key);
     else
         rv = esm->UnregisterAccessKey(mContent, key);
 
     return rv;
--- a/layout/xul/base/src/nsTitleBarFrame.cpp
+++ b/layout/xul/base/src/nsTitleBarFrame.cpp
@@ -72,17 +72,17 @@ nsTitleBarFrame::nsTitleBarFrame(nsIPres
 
 NS_IMETHODIMP
 nsTitleBarFrame::Init(nsIContent*      aContent,
                       nsIFrame*        aParent,
                       nsIFrame*        asPrevInFlow)
 {
   nsresult rv = nsBoxFrame::Init(aContent, aParent, asPrevInFlow);
 
-  CreateViewForFrame(GetPresContext(), this, GetStyleContext(), PR_TRUE);
+  CreateViewForFrame(PresContext(), this, GetStyleContext(), PR_TRUE);
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsTitleBarFrame::BuildDisplayListForChildren(nsDisplayListBuilder*   aBuilder,
                                              const nsRect&           aDirtyRect,
                                              const nsDisplayListSet& aLists)
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -202,17 +202,17 @@ AdjustForBorderPadding(nsStyleContext* a
 }
 
 NS_IMETHODIMP
 nsTreeBodyFrame::Init(nsIContent*     aContent,
                       nsIFrame*       aParent,
                       nsIFrame*       aPrevInFlow)
 {
   nsresult rv = nsLeafBoxFrame::Init(aContent, aParent, aPrevInFlow);
-  nsBoxFrame::CreateViewForFrame(GetPresContext(), this, GetStyleContext(), PR_TRUE);
+  nsBoxFrame::CreateViewForFrame(PresContext(), this, GetStyleContext(), PR_TRUE);
   nsLeafBoxFrame::GetView()->CreateWidget(kWidgetCID);
 
   mIndentation = GetIndentation();
   mRowHeight = GetRowHeight();
 
   NS_ENSURE_TRUE(mImageCache.Init(16), NS_ERROR_OUT_OF_MEMORY);
   return rv;
 }
@@ -278,17 +278,17 @@ nsTreeBodyFrame::CalcMaxRowWidth()
   nsStyleContext* rowContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreerow);
   nsMargin rowMargin(0,0,0,0);
   GetBorderPadding(rowContext, rowMargin);
 
   nscoord rowWidth;
   nsTreeColumn* col;
 
   nsCOMPtr<nsIRenderingContext> rc;
-  GetPresContext()->PresShell()->CreateRenderingContext(this, getter_AddRefs(rc));
+  PresContext()->PresShell()->CreateRenderingContext(this, getter_AddRefs(rc));
 
   for (PRInt32 row = 0; row < mRowCount; ++row) {
     rowWidth = 0;
 
     for (col = mColumns->GetFirstColumn(); col; col = col->GetNext()) {
       nscoord desiredWidth, currentWidth;
       nsresult rv = GetCellWidth(row, col, rc, desiredWidth, currentWidth);
       if (NS_FAILED(rv)) {
@@ -306,17 +306,17 @@ nsTreeBodyFrame::CalcMaxRowWidth()
   return mStringWidth;
 }
 
 void
 nsTreeBodyFrame::Destroy()
 {
   // Make sure we cancel any posted callbacks. 
   if (mReflowCallbackPosted) {
-    GetPresContext()->PresShell()->CancelReflowCallback(this);
+    PresContext()->PresShell()->CancelReflowCallback(this);
     mReflowCallbackPosted = PR_FALSE;
   }
 
   if (mColumns)
     mColumns->SetTree(nsnull);
 
   // Save off our info into the box object.
   EnsureBoxObject();
@@ -403,17 +403,17 @@ nsTreeBodyFrame::EnsureView()
 
 void
 nsTreeBodyFrame::SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
                            PRBool aRemoveOverflowArea)
 {
   nscoord horzWidth = CalcHorzWidth(GetScrollParts());
   if ((aRect != mRect || mHorzWidth != horzWidth) && !mReflowCallbackPosted) {
     mReflowCallbackPosted = PR_TRUE;
-    GetPresContext()->PresShell()->PostReflowCallback(this);
+    PresContext()->PresShell()->PostReflowCallback(this);
   }
 
   mHorzWidth = horzWidth;
 
   nsLeafBoxFrame::SetBounds(aBoxLayoutState, aRect, aRemoveOverflowArea);
 }
 
 
@@ -771,17 +771,17 @@ FindScrollParts(nsIFrame* aCurrFrame, ns
           !aResult->mColumnsScrollableView)) {
     FindScrollParts(child, aResult);
     child = child->GetNextSibling();
   }
 }
 
 nsTreeBodyFrame::ScrollParts nsTreeBodyFrame::GetScrollParts()
 {
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
   ScrollParts result = { nsnull, nsnull, nsnull, nsnull, nsnull };
   nsIContent* baseElement = GetBaseElement();
   nsIFrame* treeFrame =
     baseElement ? presContext->PresShell()->GetPrimaryFrameFor(baseElement) : nsnull;
   if (treeFrame) {
     // The way we do this, searching through the entire frame subtree, is pretty
     // dumb! We should know where these frames are.
     FindScrollParts(treeFrame, &result);
@@ -831,17 +831,17 @@ nsTreeBodyFrame::CheckOverflow(const Scr
     mVerticalOverflow = PR_TRUE;
     verticalOverflowChanged = PR_TRUE;
   }
   else if (mVerticalOverflow && mRowCount <= mPageLength) {
     mVerticalOverflow = PR_FALSE;
     verticalOverflowChanged = PR_TRUE;
   }
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   if (verticalOverflowChanged) {
     nsScrollPortEvent event(PR_TRUE, mVerticalOverflow ? NS_SCROLLPORT_OVERFLOW
                             : NS_SCROLLPORT_UNDERFLOW, nsnull);
     event.orient = nsScrollPortEvent::vertical;
 
     nsEventStatus status = nsEventStatus_eIgnore;
     nsEventDispatcher::Dispatch(mContent, presContext, &event, nsnull, &status);
@@ -930,17 +930,17 @@ nsTreeBodyFrame::InvalidateScrollbars(co
 
 // Takes client x/y in pixels, converts them to twips, and massages them to be
 // in our coordinate system.
 void
 nsTreeBodyFrame::AdjustClientCoordsToBoxCoordSpace(PRInt32 aX, PRInt32 aY,
                                                    nscoord* aResultX,
                                                    nscoord* aResultY)
 {
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   nsPoint point(nsPresContext::CSSPixelsToAppUnits(aX),
                 nsPresContext::CSSPixelsToAppUnits(aY));
 
   // Now get our client offset, in twips, and subtract if from the
   // point to get it in our coordinates
   nsPoint clientOffset;
   nsIView* closestView = GetClosestView(&clientOffset);
@@ -1047,17 +1047,17 @@ nsTreeBodyFrame::GetCoordsForCellItem(PR
   *aWidth = 0;
   *aHeight = 0;
 
   nscoord currX = mInnerBox.x;
 
   // The Rect for the requested item. 
   nsRect theRect;
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   for (nsTreeColumn* currCol = mColumns->GetFirstColumn(); currCol && currX < mInnerBox.x + mInnerBox.width;
        currCol = currCol->GetNext()) {
 
     // The Rect for the current cell.
     nscoord colWidth;
     nsresult rv = currCol->GetWidthInTwips(this, &colWidth);
     NS_ASSERTION(NS_SUCCEEDED(rv), "invalid column");
@@ -1258,17 +1258,17 @@ nsTreeBodyFrame::CheckTextForBidi(nsAuto
     if (ch >= 0xD800 || IS_IN_BMP_RTL_BLOCK(ch)) {
       maybeRTL = PR_TRUE;
       break;
     }
   }
   if (!maybeRTL)
     return;
 
-  GetPresContext()->SetBidiEnabled(PR_TRUE);
+  PresContext()->SetBidiEnabled(PR_TRUE);
 }
 
 void
 nsTreeBodyFrame::AdjustForCellText(nsAutoString& aText,
                                    PRInt32 aRowIndex,  nsTreeColumn* aColumn,
                                    nsIRenderingContext& aRenderingContext,
                                    nsRect& aTextRect)
 {
@@ -1476,17 +1476,17 @@ nsTreeBodyFrame::GetItemWithinCellAt(nsc
     mView->IsContainer(aRowIndex, &isContainer);
     if (isContainer) {
       PRBool isContainerEmpty = PR_FALSE;
       mView->IsContainerEmpty(aRowIndex, &isContainerEmpty);
       if (!isContainerEmpty)
         hasTwisty = PR_TRUE;
     }
 
-    nsPresContext* presContext = GetPresContext();
+    nsPresContext* presContext = PresContext();
     nsCOMPtr<nsIRenderingContext> rc;
     presContext->PresShell()->CreateRenderingContext(this, getter_AddRefs(rc));
 
     // Resolve style for the twisty.
     nsStyleContext* twistyContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreetwisty);
 
     nsRect imageSize;
     GetTwistyRect(aRowIndex, aColumn, imageSize, twistyRect, presContext,
@@ -1545,17 +1545,17 @@ nsTreeBodyFrame::GetItemWithinCellAt(nsc
 
   nsMargin textMargin;
   textContext->GetStyleMargin()->GetMargin(textMargin);
   textRect.Deflate(textMargin);
 
   AdjustForBorderPadding(textContext, textRect);
 
   nsCOMPtr<nsIRenderingContext> renderingContext;
-  GetPresContext()->PresShell()->CreateRenderingContext(this, getter_AddRefs(renderingContext));
+  PresContext()->PresShell()->CreateRenderingContext(this, getter_AddRefs(renderingContext));
 
   renderingContext->SetFont(textContext->GetStyleFont()->mFont, nsnull);
 
   AdjustForCellText(cellText, aRowIndex, aColumn, *renderingContext, textRect);
 
   if (aX >= textRect.x && aX < textRect.x + textRect.width)
     return nsCSSAnonBoxes::moztreecelltext;
   else
@@ -1645,17 +1645,17 @@ nsTreeBodyFrame::GetCellWidth(PRInt32 aR
     mView->GetLevel(aRow, &level);
     aDesiredSize += mIndentation * level;
     
     // Find the twisty rect by computing its size.
     nsStyleContext* twistyContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreetwisty);
 
     nsRect imageSize;
     nsRect twistyRect(cellRect);
-    GetTwistyRect(aRow, aCol, imageSize, twistyRect, GetPresContext(),
+    GetTwistyRect(aRow, aCol, imageSize, twistyRect, PresContext(),
                   *aRenderingContext, twistyContext);
 
     // Add in the margins of the twisty element.
     nsMargin twistyMargin;
     twistyContext->GetStyleMargin()->GetMargin(twistyMargin);
     twistyRect.Inflate(twistyMargin);
 
     aDesiredSize += twistyRect.width;
@@ -1701,17 +1701,17 @@ nsTreeBodyFrame::IsCellCropped(PRInt32 a
   nscoord currentSize, desiredSize;
   nsresult rv;
 
   nsRefPtr<nsTreeColumn> col = GetColumnImpl(aCol);
   if (!col)
     return NS_ERROR_INVALID_ARG;
 
   nsCOMPtr<nsIRenderingContext> rc;
-  rv = GetPresContext()->PresShell()->
+  rv = PresContext()->PresShell()->
     CreateRenderingContext(this, getter_AddRefs(rc));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = GetCellWidth(aRow, col, rc, desiredSize, currentSize);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *_retval = desiredSize > currentSize;
 
@@ -1726,28 +1726,28 @@ nsTreeBodyFrame::MarkDirtyIfSelect()
   if (baseElement && baseElement->Tag() == nsGkAtoms::select &&
       baseElement->IsNodeOfType(nsINode::eHTML)) {
     // If we are an intrinsically sized select widget, we may need to
     // resize, if the widest item was removed or a new item was added.
     // XXX optimize this more
 
     mStringWidth = -1;
     AddStateBits(NS_FRAME_IS_DIRTY);
-    GetPresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange);
+    PresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange);
   }
 }
 
 nsresult
 nsTreeBodyFrame::CreateTimer(const nsILookAndFeel::nsMetricID aID,
                              nsTimerCallbackFunc aFunc, PRInt32 aType,
                              nsITimer** aTimer)
 {
   // Get the delay from the look and feel service.
   PRInt32 delay = 0;
-  GetPresContext()->LookAndFeel()->GetMetric(aID, delay);
+  PresContext()->LookAndFeel()->GetMetric(aID, delay);
 
   nsCOMPtr<nsITimer> timer;
 
   // Create a new timer only if the delay is greater than zero.
   // Zero value means that this feature is completely disabled.
   if (delay > 0) {
     timer = do_CreateInstance("@mozilla.org/timer;1");
     if (timer)
@@ -2690,17 +2690,17 @@ nsTreeBodyFrame::PaintTreeBody(nsIRender
   aRenderingContext.SetClipRect(mInnerBox + aPt, nsClipCombine_kIntersect);
   PRInt32 oldPageCount = mPageLength;
   if (!mHasFixedRowCount)
     mPageLength = mInnerBox.height/mRowHeight;
 
   if (oldPageCount != mPageLength || mHorzWidth != CalcHorzWidth(GetScrollParts())) {
     // Schedule a ResizeReflow that will update our info properly.
     AddStateBits(NS_FRAME_IS_DIRTY);
-    GetPresContext()->PresShell()->
+    PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eResize);
   }
   #ifdef DEBUG
   PRInt32 rowCount = mRowCount;
   mView->GetRowCount(&mRowCount);
   NS_ASSERTION(mRowCount == rowCount, "row count changed unexpectedly");
   #endif
 
@@ -2714,41 +2714,41 @@ nsTreeBodyFrame::PaintTreeBody(nsIRender
                                    &colRect);
     // Don't paint hidden columns.
     if (NS_FAILED(rv) || colRect.width == 0) continue;
 
     if (OffsetForHorzScroll(colRect, PR_FALSE)) {
       nsRect dirtyRect;
       colRect += aPt;
       if (dirtyRect.IntersectRect(aDirtyRect, colRect)) {
-        PaintColumn(currCol, colRect, GetPresContext(), aRenderingContext, aDirtyRect);
+        PaintColumn(currCol, colRect, PresContext(), aRenderingContext, aDirtyRect);
       }
     }
   }
   // Loop through our on-screen rows.
   for (PRInt32 i = mTopRowIndex; i < mRowCount && i <= mTopRowIndex+mPageLength; i++) {
     nsRect rowRect(mInnerBox.x, mInnerBox.y+mRowHeight*(i-mTopRowIndex), mInnerBox.width, mRowHeight);
     nsRect dirtyRect;
     if (dirtyRect.IntersectRect(aDirtyRect, rowRect + aPt) &&
         rowRect.y < (mInnerBox.y+mInnerBox.height)) {
-      PaintRow(i, rowRect + aPt, GetPresContext(), aRenderingContext, aDirtyRect, aPt);
+      PaintRow(i, rowRect + aPt, PresContext(), aRenderingContext, aDirtyRect, aPt);
     }
   }
 
   if (mSlots && mSlots->mDropAllowed && (mSlots->mDropOrient == nsITreeView::DROP_BEFORE ||
       mSlots->mDropOrient == nsITreeView::DROP_AFTER)) {
     nscoord yPos = mInnerBox.y + mRowHeight * (mSlots->mDropRow - mTopRowIndex) - mRowHeight / 2;
     nsRect feedbackRect(mInnerBox.x, yPos, mInnerBox.width, mRowHeight);
     if (mSlots->mDropOrient == nsITreeView::DROP_AFTER)
       feedbackRect.y += mRowHeight;
 
     nsRect dirtyRect;
     feedbackRect += aPt;
     if (dirtyRect.IntersectRect(aDirtyRect, feedbackRect)) {
-      PaintDropFeedback(feedbackRect, GetPresContext(), aRenderingContext, aDirtyRect);
+      PaintDropFeedback(feedbackRect, PresContext(), aRenderingContext, aDirtyRect);
     }
   }
   aRenderingContext.PopState();
 }
 
 
 
 void
@@ -3873,17 +3873,17 @@ nsTreeBodyFrame::ScrollInternal(const Sc
   }
   else {
     if (mTopRowIndex == 0)
       return NS_OK;
   }
 
   mTopRowIndex += delta;
 
-  nsPresContext* presContext = GetPresContext();
+  nsPresContext* presContext = PresContext();
 
   // See if we have a transparent background or a background image.  
   // If we do, then we cannot blit.
   const nsStyleBackground* background = GetStyleBackground();
   if (background->mBackgroundImage || background->IsTransparent() || 
       PR_ABS(delta)*mRowHeight >= mRect.height) {
     Invalidate();
   } else {
@@ -3927,17 +3927,17 @@ nsTreeBodyFrame::ScrollHorzInternal(cons
   // See if we have a background image.  If we do, then we cannot blit.
   const nsStyleBackground* background = GetStyleBackground();
   if (background->mBackgroundImage || background->IsTransparent() || 
       PR_ABS(delta) >= mRect.width) {
     Invalidate();
   } else {
     nsIWidget* widget = nsLeafBoxFrame::GetView()->GetWidget();
     if (widget) {
-      widget->Scroll(GetPresContext()->AppUnitsToDevPixels(-delta), 0, nsnull);
+      widget->Scroll(PresContext()->AppUnitsToDevPixels(-delta), 0, nsnull);
     }
   }
 
   // Reflect the change in the scrollbar 
   nsAutoString curPos;
   curPos.AppendInt(aPosition);
   nsWeakFrame weakFrame(this);
   aParts.mHScrollbarContent->SetAttr(kNameSpaceID_None,
@@ -3948,17 +3948,17 @@ nsTreeBodyFrame::ScrollHorzInternal(cons
 
   // And fire off an event about it all
   nsScrollbarEvent event(PR_TRUE, NS_SCROLL_EVENT, nsnull);
   // scroll events fired at elements don't bubble (although scroll events
   // fired at documents do, to the window)
   event.flags |= NS_EVENT_FLAG_CANT_BUBBLE;
 
   nsEventStatus status = nsEventStatus_eIgnore;
-  nsEventDispatcher::Dispatch(mContent, GetPresContext(), &event, nsnull,
+  nsEventDispatcher::Dispatch(mContent, PresContext(), &event, nsnull,
                               &status);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTreeBodyFrame::ScrollbarButtonPressed(nsISupports* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex)
 {
@@ -4021,17 +4021,17 @@ nsTreeBodyFrame::PositionChanged(nsISupp
 
   return NS_OK;
 }
 
 // The style cache.
 nsStyleContext*
 nsTreeBodyFrame::GetPseudoStyleContext(nsIAtom* aPseudoElement)
 {
-  return mStyleCache.GetStyleContext(this, GetPresContext(), mContent,
+  return mStyleCache.GetStyleContext(this, PresContext(), mContent,
                                      mStyleContext, aPseudoElement,
                                      mScratchArray);
 }
 
 // Our comparator for resolving our complex pseudos
 NS_IMETHODIMP
 nsTreeBodyFrame::PseudoMatches(nsIAtom* aTag, nsCSSSelector* aSelector, PRBool* aResult)
 {
@@ -4175,17 +4175,17 @@ nsTreeBodyFrame::ComputeDropPosition(nsG
       else
         *aOrient = nsITreeView::DROP_AFTER;
     }
   }
 
   if (CanAutoScroll(*aRow)) {
     // Get the max value from the look and feel service.
     PRInt32 scrollLinesMax = 0;
-    GetPresContext()->LookAndFeel()->
+    PresContext()->LookAndFeel()->
       GetMetric(nsILookAndFeel::eMetric_TreeScrollLinesMax, scrollLinesMax);
     scrollLinesMax--;
     if (scrollLinesMax < 0)
       scrollLinesMax = 0;
 
     // Determine if we're w/in a margin of the top/bottom of the tree during a drag.
     // This will ultimately cause us to scroll, but that's done elsewhere.
     nscoord height = (3 * mRowHeight) / 4;
--- a/layout/xul/base/src/tree/src/nsTreeColumns.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeColumns.cpp
@@ -87,17 +87,17 @@ NS_INTERFACE_MAP_END
 NS_IMPL_ADDREF(nsTreeColumn)
 NS_IMPL_RELEASE(nsTreeColumn)
 
 nsIFrame*
 nsTreeColumn::GetFrame(nsIFrame* aBodyFrame)
 {
   NS_PRECONDITION(aBodyFrame, "null frame?");
 
-  nsIPresShell *shell = aBodyFrame->GetPresContext()->PresShell();
+  nsIPresShell *shell = aBodyFrame->PresContext()->PresShell();
   if (!shell)
     return nsnull;
 
   return shell->GetPrimaryFrameFor(mContent);
 }
 
 nsIFrame*
 nsTreeColumn::GetFrame()